2.4.2. Defining an automaton
An automaton of a global constraint is defined by
, , , ,
, , ,
where:
is the sequence of variables corresponding to the signature of the constraint .
is an interval that defines the range of possible values of the variables of .
is the signature argument of the constraint . The link between the variables of and the variable is done by writing down the signature constraint .
When used, defines a symbolic name for each term of . These names can be used within the description of a transition for expressing an additional condition for triggering the corresponding transition.
is the, possibly empty, list of all counters used in the automaton . Each counter is described by a term where is a symbolic name representing the counter, is an integer giving the value of the counter in the initial state of , and gives the variable that should be unified with the value of the counter in the accepting state of .
is the, possibly empty, list of all arrays used in the automaton . Each array is described by a term where is a symbolic name representing the array, is an integer giving the value of all the entries of the array in the initial state of . denotes an existing constraint of the catalogue that should hold in the accepting state of . Arguments of this constraint correspond to collections of variables that are bound to array of counters, or to variables that are bound to counters declared in . For an array of counters we only consider those entries that are located between the first and the last entries that were modified while triggering a transition of .
is the list of states of , where each state has the form , or . is a unique identifier associated with each state. Finally, and respectively denote the initial and the accepting state of . An automaton has a single initial state and at least one accepting state. The initial and accepting states may coincide.
is the list of transitions of . Each transition has the form or . and respectively correspond to the state just before and just after , while denotes the value that the signature variable should have in order to trigger . When used, gives for each counter of its value after firing the corresponding transition. This value is specified by an arithmetic expression involving counters, constants, as well as usual arithmetic functions, such as , , , or . The order used in the list is identical to the order used in .
EXAMPLE: As an illustrative example we give the description of the automaton associated with the constraint. We have:
,
,
= ,
is not used,
,
,
, , , , , , , , .
The signature constraint relating each pair of variables to the signature variable is defined as follows: . The sequence of transitions triggered on the ground instance , is . Each transition gives the corresponding condition and, possibly, the value of the counter just after firing that transition. After the last encountered state the first argument of the constraint is fixed to the current value of the counter , i.e. .