[Next]
[Up]
[Previous]
[Contents]
[Index]
Next: Global constraints
Up: CLP(FD)
Previous: Finite-domain variables
  Contents
  Index
- E1 R E2: This is the basic form of an arithmetic constraint, where where E1 and E2 are two arithmetic expressions and R is one of the following constraint symbols
#=, #\=, #>=, #>, #=<, and #<. An arithmetic expression is made of integers, variables, domain variables, and the following arithmetic functions: + (addition), - (subtraction), * (multiplication), / (division),// (integer division), mod, ** (power), abs, min, max, and sum. The ** operator has the highest priority, followed by *, /, //, and mod, then followed by unary minus sign -, and finally followed + and -. Let E, E1, E2 be an expression, and L be a list of expressions [E1,E2,...,En]. The following are valid expressions as well.
- min(L) The minimum element of L.
- max(L) The maximum element of L.
- min(E1,E2) The minimum of E1 and E2.
- max(E1,E2) The maximum of E1 and E2.
- sum(L) The sum of the elements of L.
- sum(Xs,R E): equivalent to sum(X) R E, where Xs must be a list of expressions.
.
- scalar_product(Coeffs, Xs, R, E): Let Coeffs be a list of integers [C1,...,Cn] and Xs be a list of expressions [E1,...,En]. The constraint is equivalent to C1*E1+...+Cn*En R E.
[Next]
[Up]
[Previous]
[Contents]
[Index]
Next: Global constraints
Up: CLP(FD)
Previous: Finite-domain variables
  Contents
  Index
Neng-Fa Zhou ()
2007-06-05