Re: [Haskell] Re: refactoring, catamorphism, termination of programs

2007-05-02 Thread Johannes Waldmann
Dear Stefan, thanks for your comment.

 E.g. the Coq papers define its elimination constructs either as
 a catamorphism, or as a combination of casefix, where the recursive calls
 are appropriately restricted to pass subterms as arguments.

if we replace the subterm ordering by some other well-founded
ordering on terms, and let a tool look for this ordering, then we get
the classical approach (that is used for term rewriting systems).

my point is that most (Haskell) programs don't require this
because they are (or should be) just primitive recursive functions
(catamorphisms) over data structures, and in fact they should be
presented as such (explicit recursion should be replaced
by the catamorphism), and I want a tool to do that replacement.

Sure, this will not solve all Haskell termination problems.
I just want to see how many are left
(e.g. from the functions in the Prelude, or in my programs).

If you want to contribute further to the discussion,
then please do so via http://groups.google.com/group/fp-termination
(I don't want to clutter the haskell  mailing  list,
but I want to have the discussion in some public place.)

Best regards,
-- 
-- Johannes Waldmann -- Tel/Fax (0341) 3076 6479/80 --
 http://www.imn.htwk-leipzig.de/~waldmann/ ---

___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


Re: [Haskell] Re: refactoring, catamorphism, termination of programs

2007-05-02 Thread Jeremy Gibbons


On 2 May 2007, at 12:18, Johannes Waldmann wrote:


If you want to contribute further to the discussion,
then please do so via http://groups.google.com/group/fp-termination
(I don't want to clutter the haskell  mailing  list,
but I want to have the discussion in some public place.)


Isn't Haskell Cafe exactly the place for that discussion? (As opposed  
to the Haskell mailing list.)


Good luck with the discussion. Someone mentioned DrHylo; that's built  
on the work of Hu, Onoue and others from Tokyo on a system called Hylo:


  http://www.ipl.t.u-tokyo.ac.jp/~onoue/hylo/

See also Alberto Pardo's HFusion:

  http://www.fing.edu.uy/inco/proyectos/fusion/

Jeremy

[EMAIL PROTECTED]
  Oxford University Computing Laboratory,TEL: +44 1865 283508
  Wolfson Building, Parks Road,  FAX: +44 1865 283531
  Oxford OX1 3QD, UK.
  URL: http://www.comlab.ox.ac.uk/oucl/people/jeremy.gibbons.html


___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


[Haskell] Re: refactoring, catamorphism, termination of programs

2007-05-01 Thread Stefan Monnier
 I'm looking for a tool that implements the source code transformation
 replace recursion by catamorphism (fold etc.).

 My application is that if the transformation succeeds,
 it implies that the program terminates. (roughly)

 I don't want to make a big research project out of this,
 rather I think of quickly putting together a prototype
 that proves the concept.

Have you considered another approach?

E.g. the Coq papers define its elimination constructs either as
a catamorphism, or as a combination of casefix, where the recursive calls
are appropriately restricted to pass subterms as arguments.

See for example Eduardo Gimenez's Codifying guarded definition with
recursive schemes.  This paper also shows how to turn such a casefix into
a call to a catamorphism.


Stefan

___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell