[mercury-users] infinite recursion

Ralph Becket rbeck at microsoft.com
Thu Sep 7 00:19:48 AEDT 2000


> From: Michael Day [mailto:mcda at students.cs.mu.oz.au]
> 
> :- pred a.
> :- mode a is semidet.
> 
> a :- a.
> 
> Operationally, this is an infinite loop, which the compiler 
> is kind enough to warn about. Logically, should a/0 fail?

No: translating the above clause into FOL we have a <= a, and
(a <= a)  <=>  (~a \/ a)  <=>  true

So a/0 should be det and true.  Detecting this is, in general,
undecidable.

Ralph
--------------------------------------------------------------------------
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