[mercury-users] Exceptions, determinism and purity

Julien Fischer juliensf at csse.unimelb.edu.au
Fri Mar 7 14:57:58 AEDT 2008


On Fri, 7 Mar 2008, Ralph Becket wrote:

> Nicholas Nethercote, Friday,  7 March 2008:
>> Hi,
>>
>> Take this predicate:
>>
>>   :- pred p(int::in) is det.
>>
>> It is det and doesn't produce any output.  So at first glance you'd think
>> you could safely remove any call to it.
>>
>> But, it could be defined like this:
>>
>>   pos(X) :- ( if X >= 0 then true else error("negative!") ).
>>
>> So removing calls could clearly change a program's behaviour.
>
> Yes, this is a sticky one and it's related to the handling of trace
> goals.

It's not particularly sticky and it's not related to the handling
of trace goals.  (See my reply to Nick.)

Julien.
--------------------------------------------------------------------------
mercury-users mailing list
Post messages to:       mercury-users at csse.unimelb.edu.au
Administrative Queries: owner-mercury-users at csse.unimelb.edu.au
Subscriptions:          mercury-users-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the users mailing list