Constraints

There are three types of constraints: Boolean, arithmetic, and global. Note that each of the new operators in the interface has a counterpart in CLP(FD). For example, the equality operator is $= in the interface, and its counterpart in CLP(FD) is #=.

A basic Boolean expression is made from constants (0 and 1), Boolean variables, and the following operators: $/\ (and), $\/ (or), $\ (not or xor), $<=> (equivalent), and $=> (implication). The operator $\ is used for two different purposes: $\ X indicates the negation of X, and X $\ Y is the exclusive or of X and Y (the same as (X $/\ ($\ Y)) $\/ (Y $/\ ($\ X))).

An arithmetic constraint takes the form $E_1\ R\ E_2$, where E1 and E2 are two arithmetic expressions, and R is one of the following constraint operators: $= (equal), $\= (not equal), $>=, $>, $=<, and $<. An arithmetic expression is made of numbers, domain variables, and the following arithmetic functions: + (sign or addition), - (sign or subtraction), * (multiplication), div (integer division), mod (remainder), abs, min, max, and sum.

In addition to the basic standard syntax for expressions, the following forms of extended expressions are also acceptable. Let C be a Boolean expression, let E1 and E2 be expressions, and let L be a list of expressions [E1,E2,$\ldots$,En]. The following are also valid expressions:

An extended Boolean expression can also include arithmetic constraints as operands. In particular, the constraint B $<=> (E1 $= E2) is called a reification constraint, which uses a Boolean variable B to indicate the satisfiability of the arithmetic constraint E1 $= E2.

The following two global constraints are currently supported:

Neng-Fa Zhou 2013-01-25