Node:Term Expressions, Next:, Previous:Range Expressions, Up:Defining Primitive Constraints



Term Expressions

A term expression has one of the following forms, where T1 and T2 denote term expressions, X denotes a variable, I denotes an integer, and S denotes the current store.

min(X)
evaluates to the minimum of D(X,S)
max(X)
evaluates to the maximum of D(X,S)
card(X)
evaluates to the size of D(X,S)
X
evaluates to the integer value of X. A subexpression of this form, not "quantified" by unionof/3, will cause the evaluation to suspend until the variable is assigned.
I
an integer
inf
minus infinity
sup
plus infinity
-T1
evaluates to S(T1) negated
T1+T2
evaluates to the sum of S(T1) and S(T2)
T1-T2
evaluates to the difference of S(T1) and S(T2)
T1*T2
evaluates to the product of S(T1) and S(T2), where S(T2) must not be negative
T1/>T2
evaluates to the quotient of S(T1) and S(T2), rounded up, where S(T2) must be positive
T1/<T2
evaluates to the quotient of S(T1) and S(T2), rounded down, where S(T2) must be positive
T1 mod T2
evaluates to the modulo of S(T1) and S(T2)