Re: Proposal: Lazy matching for local patterns

From: Mario Rodriguez-Artalejo <mario_at_maraton.sim.ucm.es>
Date: Wed, 24 Oct 2001 11:51:52 +0200

Dear all,

Wolfgang Lux writes:

>Hello,
>
>the semantics of purely functional programs in Curry is mostly similar
>to that of Haskell (except for the handling of overlapping rules).
>However, there is one major difference, which results in valid Haskell
>programs to fail under Curry: The lifting algorithm given in appendix
>D.8 of the report is too strict wrt local patterns. E.g. consider the
>definition

I agree with Wolgang that a less strict lifting algorithm would be better,
in order to achieve succesful computations in those cases where Haskell does
so. However, I have a comment about the alternative translation which
Wolgang proposes to eliminate local pattern declarations. It seems to me
that the translation does not work in the case of recursive local definitions.
Consider for example the definition

   f x = let {xs = x:xs} in head (tail xs)

In Haskell, (f 0) evaluates to 0, while the translation proposed by Wolgang
cannot be applied because free (x:xs) is not a subset of free (f x).

Maybe the translation is not meant to be used for recursive local definitions.
If this is the case, just forget about the comment.

Best Wishes,

Mario.


               

***************************************************************************
* *
* Donate Food for Free to Hungry People * * *
* Visit The Hunger Site: *
* *
* http://www.thehungersite.com/cgi-bin/WebObjects/HungerSite *
* *
***************************************************************************
                      

               In this world, up to the present time,
               hate has never dispelled hate.
               Only love can dispel hate: this is the law.
        

---------------------------------------------------------------------------
Prof. Mario Rodriguez-Artalejo e-mail: mario_at_sip.ucm.es
Dpto. de Sistemas Informáticos y Programación Fax: +34 91 3 94 46 07
Universidad Complutense de Madrid Phone: +34 91 3 94 45 12
Edificio de la Facultad de Matematicas
Av. Complutense s/n
E-28040 Madrid, Spain
---------------------------------------------------------------------------

_______________________________________________
curry mailing list
curry_at_lists.RWTH-Aachen.DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/curry
Received on Wed Oct 24 2001 - 11:56:47 CEST

This archive was generated by hypermail 2.3.0 : Mon Nov 11 2019 - 07:15:05 CET