[m-dev.] proposal for promise_pure scope warning
Julien Fischer
juliensf at csse.unimelb.edu.au
Tue Apr 15 17:09:43 AEST 2008
On Tue, 15 Apr 2008, Julien Fischer wrote:
>
> On Tue, 15 Apr 2008, Ian MacLarty wrote:
>
>>
>> ( promise_pure ( impure p ) ->
>> true
>> ;
>> true
>> )
>>
>> The same applies to the case where there is output, but the output is
>> not used.
>>
>>> (Which is the "bug" I assume you are trying to address here)
>>>
>>
>> That is a symptom, but the underlying problem is that purity is being
>> promised away in the wrong spot. A goal like:
>>
>> promise_pure ( impure p )
>>
>> just makes no sense (regardless of the determinism), because either the
>> goal should be impure, or p itself should be pure.
>
> The G12 FD solver uses constructs like the above extensively (which
> is one reason I don't want any warning to be enabled by default).
Actually, calls to the automatically generated solver type casting
functions is another case where one may legitimatly have something of
the form:
promise_pure (impure p).
Julien.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to: mercury-developers at csse.unimelb.edu.au
Administrative Queries: owner-mercury-developers at csse.unimelb.edu.au
Subscriptions: mercury-developers-request at csse.unimelb.edu.au
--------------------------------------------------------------------------
More information about the developers
mailing list