Re: [eclipse-clp-users] Problem with double delayed negation

From: Stephan Schiffel <stephan.schiffel_at_...1...>
Date: Fri, 9 Dec 2011 10:48:41 +0000
Dear Alexandre,

Alexandre Saidi wrote:
> Didn't you mean
> 
> p2 :- not  p(X), X=1.
> 
> instead of
> p2 :- ~ p(X), X=1.

No. not/1 is negation as failure, and writing "not  p(X), X=1" in that order 
means the same as "not p(_), X=1". This is something totally different than 
"not p(1)", which I wanted to express using delayed negation.

> this version works doing the job.

Only because there is no clause for p(X) that succeeds for any X. Just add the 
fact p(2) and it will fail.

> Recall :
> 		not P :- P, !, fail.
> 		not P.

I know that. ;)

Cheers,
Stephan
Received on Fri Dec 09 2011 - 10:48:51 CET

This archive was generated by hypermail 2.3.0 : Wed Sep 25 2024 - 15:13:20 CEST