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

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

The constructs (not P) and \+ P denote negation. They succeed if and only if P fails. Negation is not transparent to cuts. In other words, the cuts in a negation are only effective within the negation. Cuts in a negation cannot remove choice points that are 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 only executed after P fails. Disjunction is transparent to cuts. A cut in P or in Q will remove not only the choice points that are created for the goals to the left of the cut in P or in Q, but will also remove the choice points that are 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 2013-01-25