next up previous index
Next: Constraint Predicates Up: The Finite Domains Library Previous: The Finite Domains Library   Index

Terminology

Some of the terms frequently used in this chapter are explained below.
domain variable
A domain variable is a variable which can be instantiated only to a value from a given finite set. Unification with a term outside of this domain fails. The domain can be associated with the variable using the predicate ::/2. Built-in predicates that expect domain variables treat atomic and other ground terms as variables with singleton domains.

integer domain variable
An integer domain variable is a domain variable whose domain contains only integer numbers. Only such variables are accepted in inequality constraints and in rational terms. Note that a non-integer domain variable can become an integer domain variable when the non-integer values are removed from its domain.

integer interval
An integer interval is written as
Min .. Max
with integer expressions Min <= Max and it represents the set
{Min, Min + 1, ..., Max}.

linear term
A linear term is a linear integer combination of integer domain variables. The constraint predicates accept linear terms even in a non-canonical form, containing functors +, - and *, e.g.

5*(3+(4-6)*Y-X*3).

If the constraint predicates encounter a variable without a domain, they give it a default domain -10000000..10000000. Note that arithmetic operations on linear terms are performed with standard machine word integers without any overflow checks. If the domain ranges or coefficients are too large, the operation will not yield correct results. Both the maximum and minimum value of a linear term must be representable in a machine word, and so must the maximum and minimum value of every

ci xi

term.

rational term
A rational term is a term constructed from integers and integer domain variables using the arithmetic operations

+, -, *, /.

Besides that, every subexpression of the form VarA/VarB must have an integer value in the solution. The system replaces such a subexpression by a new variable X and adds a new constraint VarA #= VarB * X. Similarly, all subexpressions of the form VarA*VarB are replaced by a new variable X and a new constraint X #= VarA * VarB is added, so that in the internal representation, the term is converted to a linear term.

constraint expression
A constraint expression is either an arithmetic constraint or a combination of constraint expressions using the logical FD connectives #/\/2, #\//2, #=>/2, #<=>/2, #\+/1.


next up previous index
Next: Constraint Predicates Up: The Finite Domains Library Previous: The Finite Domains Library   Index
Warwick Harvey
2004-08-07