Cut. Discard all choice points created since entering the predicate in
which the cut appears. In other words, commit to the clause in
which the cut appears and discard choice points that have been
created by goals to the left of the cut in the current clause. Meta
calling is opaque to the cut. This implies that cuts that appear in a
term that is subject to meta-calling (call/1)
only affect choice points created by the meta-called term. The following
control structures are transparent to the cut: ;/2, ->/2
*->/2. Cuts appearing
in the condition part of
->/2 and *->/2
are opaque to the cut. The table below explains the scope of the cut
with examples. Prunes here means ``prunes X choice
point created by X''.
t0 :- (a, !, b).
% prunes a/0 and t0/0
t1 :- (a, !, fail ; b).
% prunes a/0 and t1/0
t2 :- (a -> b, ! ; c).
% prunes b/0 and t2/0
t3 :- call((a, !, fail ; b)).
% prunes a/0
t4 :- \+(a, !, fail).
Tag confusing pages with doc-needs-help|Tags are associated to your profile if you are logged in