[m-dev.] functions whose forward mode fails (was Re: Suggestion for a new "where" operator

Peter Moulder pmoulder at mail.csse.monash.edu.au
Thu Aug 7 20:06:07 AEST 2003


On Tue, Aug 05, 2003 at 11:58:50AM +1000, Fergus Henderson wrote:

> > [EXPR = EXPR can fail when using functions whose forward mode fails]

> Yes, that's not the reason why Mercury doesn't support multi/nondet functions.
> The reason is that if functions were allowed to be nondet in their forwards
> mode, `X = f, p(X, X)' could mean something different than `p(f, f)'.

Is it a problem that

   X = f, not p(X)

means something different than

   not p(f)

?  If f is a function that fails, then the first version is false,
while the second version is true: it expands to

   not(V1 = f, p(V1))

which is equivalent to `not(false, p(V1))', `not(false)', `true'.

pjm.

--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list