[mercury-users] Determinism question

Peter Schachte schachte at cs.mu.OZ.AU
Fri Sep 7 00:55:12 AEST 2001


> I'm wondering about what happens when you have a conjunction of the form
> (semidet, erroneous)... the compiler infers such a conjunction as `failure'.

> The Mercury Reference Manual says this about `failure' and `erroneous':
> 
>     If all possible calls to a particular mode of a predicate or function fail
>     without producing a solution, then that mode has a determinism of failure. 
> 
>     If all possible calls to a particular mode of a predicate or function lead
>     to a runtime error, i.e. neither succeed nor fail, then that mode has a
>     determinism of erroneous.

The wording here could be better.  I think it should say failure means
something like "if and when it terminates, it fails," and erroneous should
say something like "it will neither terminate in success nor failure."  With
the current phrasing, it's not clear that

	p :- p.

is erroneous.

With that explaination, (erroneous, semidet) has two possibilities:  it can
fail, or neither succeed nor fail.  Thus if it terminates, it fails, so it's
determinism is failure.  I find it easier to think of erroneous as meaning
nonterminating, and all the other modes meaning "if it terminates, then ...."


-- 
Peter Schachte              We hang the petty thieves and appoint the great
schachte at cs.mu.OZ.AU        ones to public office.
www.cs.mu.oz.au/~schachte/      -- Aesop 
Phone: +61 3 8344 9166      
--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list