On 28-Sep-1999, Paul Hudak <[EMAIL PROTECTED]> wrote:
> There seems to be serious confusion here!
> 
> True and False are the only "fully determined" members of Bool.  But,
> even in imperative languages, it is possible for a boolean-typed
> expression to diverge, or possibly cause an error -- neither of these is
> True or False.  So the question to every language designer that permits
> this is: How do you handle this situation?  If the answer is given in
> terms of denotational semantics, then the notion of _|_ invariably
> creeps in, or possibly even more complex domains with error elements,
> etc.  This is not something unique to Haskell.

I don't think it is correct to say that the notion of _|_ invariably
creeps into the denotational semantics.
But perhaps I am misusing the term "denotational semantics".

In languages such as Goedel and Mercury, the declarative
semantics does not deal with nontermination or runtime errors.
Instead, those issues are handled by a separate operational semantics.

So, wouldn't the declarative semantics of Goedel and Mercury count
as denotational semantics, if suitably expressed?

> So as pointed out by others, a && b is not the same as b && a, simply
> because && is strict in its first argument (but not in its second). 
> That is, _|_ && e is always _|_, whereas e && _|_ is not (necessarily)
> _|_.  But note that this is also true in most imperative languages, even
> when e has no side effects!

In Goedel, `a & b' has the same declarative semantics as `b & a'.
However, `a & b' may have different operational semantics to `b & a'.

Using a denotational style, the declarative semantics of `a & b'
in Goedel can be given by  

                  def
        [[a & b]] === [[a]] /\ [[b]]

where `/\' just has its ordinary meaning as logical conjunction.

-- 
Fergus Henderson <[EMAIL PROTECTED]>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger [EMAIL PROTECTED]        |     -- the last words of T. S. Garp.



Reply via email to