Re: [eclipse-clp-users] testing NOT existence

From: Kish Shen <kisshen_at_...5...>
Date: Wed, 14 Apr 2010 18:50:43 +0100
Christian Wirth wrote:
> i have a conditon NOT(pred(A)) and a fact pred(1). The existenc check 
> \+(\+(not(pred(A))) should succeed, because it's possible that A is not 
> bound to 1, but it fails because A gets bound to 1 by the test.
> How can i test if a NOT(condition) is solvable ?
> 

Hi Christian,

not/1 and \+/1 behave exactly the same -- I believe \+/1 was added 
because not/1 does not do negation as some people understand it, so \+/2 
is considered by some to be a better name for the way Prolog (and thus 
ECLiPSe) implements negation. Specifically, negation as failure (with 
closed world assumption).

\+(A) and not(A) succeeds if A fails, and fails if A succeeds.
Thus \+( \+( not(A))) (which is what you have) has exactly the same 
semantics as \+(A) (and not(A)), except it does more work.

What exact semantics do you want? Note that if you want pred(A) to 
behave like a constraint (i.e. it can delay if it is not immediately 
entailed), then you cannot use the \+(\+(A)) trick, because if A delays, 
A will appear to succeed, and \+(A) will fail.

Cheers,

Kish

-- 
This e-mail may contain confidential and privileged material for the
sole use of the intended recipient. Any review, use, distribution or
disclosure by others is strictly prohibited. If you are not the intended
recipient (or authorized to receive for the recipient), please contact
the sender by reply e-mail and delete all copies of this message.
Cisco Systems Limited (Company Number: 02558939), is registered in
England and Wales with its registered office at 1 Callaghan Square,
Cardiff, South Glamorgan CF10 5BT.
Received on Wed Apr 14 2010 - 17:50:50 CEST

This archive was generated by hypermail 2.3.0 : Tue Apr 16 2024 - 09:13:20 CEST