$=
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 , 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,,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:
$alldifferent
(L): Logically, the constraint $alldifferent
(L) is equivalent to the conjunction of the pair-wise inequality constraints on the variables in L.
$element
(I,L,V): The Ith element of L is V.
Neng-Fa Zhou 2013-01-25