not/1

Module: builtins

not/1 — tests whether a goal fails
\+/1 — tests whether a goal fails

ISO Standard Predicate

FORMS

not Goal

not(Goal)

\+ Goal

\+(Goal)

DESCRIPTION

not/1 and \+/1 implement negation by failure. If the Goal fails, then not(Goal) succeeds. If Goal succeeds, then not(Goal) fails. When not/1 succeeds it doesn’t bind any variables. Cuts occurring within Goal will be restricted to cutting choices created within the execution of Goal.

EXAMPLES

?- not(true).

no.

?- not(a=b).

yes.

?- not(not(f(A)=f(b))).

A=_2

yes.

SEE ALSO