Conjunction, disjunction, negation, and if-then-else

The construct (P,Q) denotes conjunction. It succeeds if both P and Q succeed.

The construct (not P) and \+ P denote negation. It succeeds if and only if P fails. No negation is transparent to cuts. In other words, the cuts in a negation are effective only in the negation. No cut in a negation can remove choice points created for the goals to the left of the negation.

The construct (P;Q) denotes disjunction. It succeeds if either P or Q succeeds. Q is executed only after P fails. Disjunction is transparent to cuts. A cut in P or Q will remove not only the choice points created for the goals to the left of the cut in P or Q but also the choice points created for the goals to the left of the disjunction.

The control construct (If->Then;Else) succeeds if (1) If and Then succeed, or (2) If fails and Else succeeds. If is not transparent to cuts, but Then and Else are transparent to cuts. The control construct (If->Then) is equivalent to (If->Then;fail).

Neng-Fa Zhou 2011-05-12