Prologue negation and logical negation

Suppose we have the following program:

a(tom). 
v(pat).

and request (which returns false):

\+ a(X), v(X).

When tracing, I see that X becomes an instance for tom, the predicate a (tom) succeeds, so + a (tom) fails.

In some tutorials, I read that not (+) in Prolog is just a test and does not cause instantiation.

  • Can someone clarify the above point for me? How can I see the creation.

  • I understand that there are differences between non (denial as denial) and logical negation. Could you name a good article explaining in which cases they behave the same and when they behave differently?

+5
source share
2 answers

WRT 2, .

, NAF . , () , , (., , Russell paradox) Prolog , , . , forall/2 (, , ), :

%%  forall(+Condition, +Action)
%
%   True if Action if true for all variable bindings for which Condition
%   if true.

forall(Cond, Action) :-
    \+ (Cond, \+ Action).

, , , ...

, , "spelunking" , J.R.Fisher. , , , . . 2.5, . , 3. Prolog

+2

.

: "".

, \+ , , .. . , , . , , , . , , .

v(X), \+ a(X).

. - , .

1), NAF. , , , ( v (X)). , . .

2) : .

+2

All Articles