[m-dev.] Constraint goals in negated contexts: a solution

Ralph Becket rafe at cs.mu.OZ.AU
Mon Dec 20 15:26:12 AEDT 2004

I believe I have a palatable solution to the problem of constraint goals
appearing in negations and the conditions of if-then-else goals.

* Ask goals must be declared impure because they allow one to break
referential transparency (they can give different answers depending upon
the execution history of the program).

* Tell goals are pure, but should be illegal in a (pure) negated context
because the compiler doesn't know how to assert the negation of the tell
outside the negated context.

* Therefore, any goal with a non-local inst-any variable in a negated
context should be implicitly impure.  (Conceivably a tell goal could
appear in a negated context and still be pure, but it would be
unreasonable to expect the compiler to decide this for itself.)

I think this fixes the problem philosophically and practically.

Any problems?
-- Ralph
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au

More information about the developers mailing list