Re: Intended meaning

From: Michael Hanus <>
Date: Fri, 26 Oct 2007 15:24:51 +0200

Sergio Antoy wrote:
> Thanks for all the replies. So,
> test = 1+x ? zero x where x free
> is the same as
> test = 1+x ? zero y where x,y free
> Is this OK? In the first rule, x is a variable, therefore it is
> shared.

The current operational semantics (e.g., CRWL or also the big/small
step semantics in
does not specify any sharing over nondeterministic branches
of a computation. Thus, both are the same.

> If the two arguments of "?" are evaluated concurrently, should x
> be shared by the concurrent evaluations?
> If we replace "where x free" with "where x = 2+2", should 2+2
> be evaluated twice or it can be safely shared?
> If we replace "?" with "+", the above rules are clearly different.

>From my point of view, there is a declarative semantics that describes
the desired results of computations, like CRWL.
Sharing over nondeterministic branches is a useful optimization
that can avoid recomputations but should not change the set
of computable values. In this sense, 2+2 can be safely shared
over nondeterministic branches since this expression has the
same value in all branches, whereas a free variable
cannot be shared if it is instantiated differently in different

Best regards,

curry mailing list
Received on Fr Okt 26 2007 - 16:06:34 CEST

This archive was generated by hypermail 2.3.0 : Fr Feb 23 2024 - 07:15:09 CET