Re: Language change proposal

From: Sergio Antoy <antoy_at_cs.pdx.edu>
Date: Wed, 8 Jan 1997 15:10:42 -0800

Michael, Herbert:

Thanks for your replies to my comments. You convinced me of the
necessity of both guard and where-clauses. I agree with all your
corrections and clarifications.

There is a point of your replies that I do not fully understand.

> One final point: I think that extra variables occurring in
> a right-hand side are also useful even if they are not
> instantiated by simple pattern matching (see the example
>
> last xs | append _ [x] == xs = x
>
> which I showed in a previous email). Such a use of
> extra variables is useful if the value of the
> extra variable is computed by some general constraint solving
> and it is ensured that only one solution exists (for instance,
> by selecting the best solution). Unfortunately, there are
> no simple syntactic criteria to ensure the confluence
> for such applications. A possible solution is to check
> for the requirements you proposed and provide a warning
> to the user if a clause does not satisfy these requirements
> (but the compiler accepts also the more general cases
> which cause no implementation problems in a functional
> logic language).

How do we ensure "that only one solution exists"? Is this related
to the "choice" operator? For instance, consider the example at
page 14 of the December 5 draft. What is the value of, say

        merge [1,2] [3,4]

and could the expression

        merge [1,2] [3,4] == merge [1,2] [3,4]

fail (evalute to false)?

Thanks,
Sergio
Received on Fr Jan 10 1997 - 09:11:39 CET

This archive was generated by hypermail 2.3.0 : Do Dez 12 2019 - 07:15:05 CET