next up previous contents
Next: Negation as Failure Up: The Problem of Previous: The Problem of

/1

This strangely named predicate is Prolog's equivalent to the not (often written as which stands for negation) of predicate logic. It is not named not/1 because we it turns out that we cannot easily implement classical negation in Prolog.

The predicate \+/1 takes a Prolog goal as its argument. For example:

 
?- \+( man(jim) ).

will succeed if man(jim) fails and will fail if man(jim) succeeds.

Paul Brna
Mon May 24 20:14:48 BST 1999