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

Fergus Henderson fjh at cs.mu.OZ.AU
Sun Aug 30 14:18:06 AEST 1998


On 19-Aug-1998, David Glen JEFFERY <dgj at cs.mu.OZ.AU> wrote:
> Yuck! IMHO, the compiler is not handling implied modes correctly.
> 
> Surely this:
> moddat__add_assumption(Obj, Model, [a(Obj)|Model) :-
> 	list__member(o(Obj,_), Model).
> 
> and this:
> moddat__add_assumption(Obj, Model, [a(Obj)|Model]) :-
> 	some [] (
> 		list__member(o(Obj, _), Model)
> 	).
> 
> are the same thing, given that the call to list__member/2 has no output vars!
> 
> I think that the introduction of variables for the implicit unifications of an
> implied mode need to be a little more careful in preserving quantification.
> 
> Thoughts?

Conjunctions get flattened before mode analysis, so that mode analysis
can do reordering properly.

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.

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



More information about the developers mailing list