<BooleanExpression> ::= 0 | /* false */ 1 | /* true */ <Variable> | <Variable> in <Domain> | <Variable> notin <Domain> | <Expression> #= <Expression> | <Expression> #\= <Expression> | <Expression> #> <Expression> | <Expression> #>= <Expression> | <Expression> #< <Expression> | <Expression> #=< <Expression> | count(Val,List,RelOp,N) | #\ <BooleanExpression> | /* not */ <BooleanExpression> #/\ <BooleanExpression> | /* and */ <BooleanExpression> #\/ <BooleanExpression> | /* or */ <BooleanExpression> #=> <BooleanExpression> | /* imply */ <BooleanExpression> #<=> <BooleanExpression> | /* equivalent */ <BooleanExpression> #\ <BooleanExpression> /* xor */
A Boolean constraint is made of a constraint symbol and one or two Boolean expressions.
Var in D
: This is true if Var is a value in the domain D, where Var must be an integer or an integer-domain variable, and D must an integer domain. For example, X in [3,5] #<=> B
is equivalent to (X #= 3 #\/ X#= 5) #<=> B
.
Var notin D
: This is true if Var is not a value in the domain D, where Var must be an integer or an integer-domain variable, and D must be an integer domain. For example, X notin [3,5] #<=> B
is equivalent to
(X #\= 3 #/\ X#\= 5) #<=> B
E1 RelOp E2
: This is true if the arithmetic constraint is true, where RelOp is one of the following: #=
, #\=
, #=<
, #<
, #>=
, and #>
. For example,
(X #= 3) #= (Y #= 5)means that the finite-domain constraints
(X #= 3)
and (Y #= 5)
have the same satisfibility. In other words, they are either both true or both false. As another example,
(X #= 3) #\= (Y #= 5)means that the finite-domain constraints
(X #= 3)
and (Y #= 5)
are mutually exclusive. In other words, if (X #= 3)
is satisfied, then (Y #= 5)
cannot be satisfied, and, similarly, if (X #= 3)
is not satisfied, then (Y #= 5)
must be satisfied.
#\ E
: This is equivalent to E#=0
.
E1 #/\ E2
: Both E1 and E2 are 1.
E1 #\/ E2
:
Either E1 or E2 is 1.
E1 #=> E2
:
If E1 is 1, then E2 must be also 1.
E1 #<=> E2
:
E1 and E2 are equivalent.
E1 #\ E2
:
Exactly one of E1 and E2 is 1.
The following constraints restrict the values of Boolean variables.
Neng-Fa Zhou 2013-01-25