[m-dev.] from [mercury-users] Re: Question regarding determinism

Peter Schachte pets at cs.mu.OZ.AU
Sun Aug 30 14:48:18 AEST 1998


On Sun, Aug 30, 1998 at 02:18:06PM +1000, Fergus Henderson wrote:
> A possible solution would be to make determinism analysis check not just for
> goals (e.g. whole conjunctions) with no outputs but also for
> subsequences of conjunctions with no outputs.
> 
> However, this might be expensive in terms of compilation time.

Wouldn't it be sufficient to, while scheduling a body, carry along a
list (call it the "nondet" list) of variables that have been (will
be?)  bound by scheduled nondet/multi goals and whose values will be
needed later in the clause?  When this list is empty, your determinism
is either det or semidet, no matter what the determinism of the
predicates you've scheduled so far would indicate.  I wouldn't think
this would be expensive.

In fact, you could take it a little farther.  When you go to schedule
a goal that needs to be called in a det context (eg, a goal
with a di argument) and the present context is not det, and if the
goal itself doesn't use any of the variables on the nondet list, then
delay it.  It'll be successfully scheduled eventually (assuming the
only problem is determinism).


-Peter Schachte               | What use is magic if it can't save a unicorn?
mailto:pets at cs.mu.OZ.AU       |     -- Peter S. Beagle, "The Last Unicorn" 
http://www.cs.mu.oz.au/~pets/ | 
PGP: finger pets at 128.250.37.3 | 



More information about the developers mailing list