Next: mpg-ref-not_unifiable, Previous: mpg-ref-not_less_than, Up: mpg-bpr [Contents][Index]
\+/1
ISO\+
+P
Fails if the goal P has a solution, and succeeds otherwise. Equivalent to:
call(P) -> fail ; true.
except that the use of call/1
often can be avoided.
callable, must be nonvar
This is not normally regarded as a built-in
predicate, since it is part of the syntax of the language. However,
it is like a built-in predicate in that you can say
call((
.
\+
P))
Cuts in P do not make sense, but are allowed, their scope being the goal P.
Remember that with prefix operators such as this one it is necessary to be careful about spaces if the argument starts with a ‘(’. For example:
| ?- \+ (P,Q).
is this operator applied to the conjunction of P and Q, but
| ?- \+(P,Q).
would require a predicate \+ /2
for its solution. The
prefix operator can however be written as a functor of one
argument; thus
| ?- \+((P,Q)).
is also correct.
Call errors (see ref-sem-exc).