2.2.4. Declaring a global constraint
Declaring a global constraint consists of providing the following information:
A term , where corresponds to the
name of the global constraint and to its arguments.
A possibly empty list of type declarations, where each declaration has the form
:;
is the name of the new type we define and
is a basic data type, a compound data type or
a type previously defined.
An argument declaration :::
giving for each argument of the global constraint its type.
Each type is a basic data type, a compound data type, or a type that was declared
in the list of type declarations.
A possibly empty list of restrictions, where each restriction is one of
the restrictions described in SectionΒ 2.2.3 on page 2.2.3.
EXAMPLE:
The arguments of the constraint are
described by:
- Β Β ConstraintΒ Β Β
- Β Β Type(s)Β Β Β Β Β Β
- Β Β Argument(s)Β
- Β Β Restriction(s)Β
The first line indicates that the
constraint has two arguments: and .
The second line declares a new type , which corresponds to a
collection of variables.
The third line indicates that the first argument is an integer,
while the fourth line tells that the second argument
corresponds to a collection of vectors of type .
Finally the four restrictions respectively enforce that:
All the items of the collection mention the
attribute,
be greater than or equal to 0,
All the items of the collection mention the
attribute,
All the vectors have the same number of components.