[mercury-users] infinite recursion

Peter Moulder pjm at bofh.asn.au
Tue Sep 26 02:11:09 AEDT 2000


> On 06-Sep-2000, Michael Day <mcda at students.cs.mu.oz.au> wrote:
> > 
> > :- pred a.
> > :- mode a is semidet.
> > 
> > a :- a.

Hmm, I thought that this used to be treated like a call to error/1?

My favourite argument for doing so is that we can claim

 "Mercury is so fast that it can do an infinite loop in 0.1 seconds."

:-)

I'm not convinced by the consistency argument; in general, mmc can't
correctly determine the determinism of a predicate, but it still makes
its best attempt.  I'm not saying that lots of effort should be
expended to detect infinite recursion, but when it is detected, I
think the compiler should try to make use of the information
(depending on compiler flags), analagous to how intermodule
optimizations can change the determinism calculated.  This can be
useful especially when the infinite recursion is detected by tabling.
I don't see behaving consistently badly has much value here; it is
more valuable for the implementation to be more complete (depending on
what compiler flags were given, like --fully-strict).

Please don't count my opinion here for much, as I don't use Mercury much
at the moment.

pjm.
--------------------------------------------------------------------------
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