11.2.4 Control

:P,:Q           ISO

prove P and Q

:P;:Q           ISO

prove P or Q

+M::P           ISO

call P in module M

:P->:Q;:R           ISO

if P succeeds, prove Q; if not, prove R

:P->:Q           ISO

if P succeeds, prove Q; if not, fail

!           ISO

cut any choices taken in the current procedure

\+ :P           ISO

goal P is not provable

?X ^ :P

there exists an X such that P is provable (used in setof/3 and bagof/3)

block :P   declaration

declaration that predicates specified by P should block until sufficiently instantiated

call(:P)   ISO
call(:P,…)   ISO

execute P or P(…)


Executes the procedure call Goal. When Goal succeeds determinately, is cut, fails, or raises an exception, Cleanup is executed.


Executes the procedure call Goal. Vars is unified with the list of new variables created during the call that remain unbound and have blocked goals or attributes attached to them.

+Iterators do :Body

executes Body iteratively according to Iterators

fail           ISO

fail (start backtracking)

false           ISO

same as fail


Blocks Goal until nonvar(Var) holds.


for each solution of P that succeeds, prove Q; if none, prove R

once(:P)           ISO

Find the first solution, if any, of goal P.


same as true

repeat           ISO

succeed repeatedly on backtracking

true           ISO



block Goal until Cond holds

Send feedback on this subject.