5.27. among_modulo
DESCRIPTION | LINKS | GRAPH | AUTOMATON |
- Origin
- Constraint
- Arguments
- Restrictions
- Purpose
is the number of variables of the collection taking a value that is congruent to modulo .
- Example
-
In this example and specifies that we count the number of even values taken by the different variables. As a consequence the constraint holds since exactly 3 values of the collection are even.
- Typical
- Symmetries
Items of are permutable.
An occurrence of a value of such that (resp. ) can be replaced by any other value such that (resp. ).
- Arg. properties
Functional dependency: determined by , and .
Contractible wrt. when .
Contractible wrt. when .
Aggregate: , , , .
- Remark
By giving explicitly all values that satisfy the equality , the constraint can be modelled with the constraint. However the constraint provides a more compact form.
- See also
generalisation: Β (list of such that = replaced by list of ).
- Keywords
characteristic of a constraint: modulo, automaton, automaton with counters.
constraint arguments: pure functional dependency.
constraint network structure: alpha-acyclic constraint network(2).
- Arc input(s)
- Arc generator
-
- Arc arity
- Arc constraint(s)
- Graph property(ies)
-
- Graph model
The arc constraint corresponds to a unary constraint. For this reason we employ the arc generator in order to produce a graph with a single loop on each vertex.
PartsΒ (A) andΒ (B) of FigureΒ 5.27.1 respectively show the initial and final graph associated with the Example slot. Since we use the graph property, the loops of the final graph are stressed in bold.
Figure 5.27.1. Initial and final graph of the constraint
(a) (b)
- Automaton
FigureΒ 5.27.2 depicts the automaton associated with the constraint. To each variable of the collection corresponds a 0-1 signature variable . The following signature constraint links and : .
Figure 5.27.2. Automaton of the constraint
Figure 5.27.3. Hypergraph of the reformulation corresponding to the automaton (with one counter) of the constraint: since all states variables are fixed to the unique state of the automaton, the transitions constraints share only the counter variable and the constraint network is Berge-acyclic