[mercury-users] negating closures

Ralph Becket rafe at csse.unimelb.edu.au
Mon Aug 14 11:05:03 AEST 2006


Nicholas Nethercote, Monday, 14 August 2006:
> Hi,
> 
> You can use require/2 like this:
> 
>    require(unify(A,B), "A should equal B")
> 
> Is it possible to negate the condition without writing a new predicate? 
> Eg. something like:
> 
>    require(not unify(A,B), "A should equal B")

Unfortunately, applying an Mercury logical operator to a closure does not
result in another closure.  You have to use a separate predicate.  And,
as far as I know, we don't have something like this for negation.  The
closest I can think of is isnt/2 in std_util.  Maybe you could add
something?

-- Ralph
--------------------------------------------------------------------------
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