;/2 -- if-then-else+-P -> +*Q ; +*R
If P then Q else R, using first solution of P only.
The character | can be used as an alternative to ;,
giving the form:
P -> Q | R
The | is transformed into a ; when the goal is read.
First P is executed. If it succeeds, then Q is executed, and if Q fails, the whole conditional goal fails. If P fails, however, R is executed instead of Q.
The operator precedences of the ; and -> are
both greater than 1000, so that they dominate commas.
If P succeeds and Q
then fails, backtracking into P does not occur. P may
not contain a cut. -> acts like a cut except that its range
is restricted to within the disjunction: it cuts away R and any
choice points within P. -> may be thought of as a
"local cut".