Fails if the goal P has a solution, and succeeds otherwise.
This is not real negation ("P is
false"), which is not possible in Prolog, but negation-by-failure
meaning "P is not provable". P may not contain a
cut. The goal
behaves exactly like
( P -> fail ; true)
Remember that with prefix operators such as this
one, it is necessary to be careful about spaces if the argument starts
(. For example:
| ?- \+ (P, Q).
\+/1 operator applied to the conjunction of P
| ?- \+(P, Q).
would require a predicate
\+/2 for its solution. The
operator can, however, be written as a functor of one argument; thus
| ?- \+((P,Q)).
is also correct.
library(not) -- defines a safer form of
negation as failure.