5.92. counts
DESCRIPTION | LINKS | GRAPH | AUTOMATON |
- Origin
- Constraint
- Arguments
- Restrictions
- Purpose
Let be the number of variables of the collection assigned to a value of the collection. Enforce condition to hold.
- Example
-
Values 1, 3, 4 and 9 of the collection are assigned to 3 items of the collection. The constraint holds since this number is in fact equal ( is set to ) to the last argument of the constraint.
- Typical
- Symmetries
Items of are permutable.
Items of are permutable.
An occurrence of a value of that belongs to (resp. does not belong to ) can be replaced by any other value in (resp. not in ).
- Arg. properties
Contractible wrt. when .
Extensible wrt. when .
Aggregate: , , , when .
- Usage
Used in the Constraint(s) on sets slot for defining some constraints like .
- Reformulation
The constraint can be expressed in term of the conjunction .
- Systems
- Used in
- See also
assignment dimension added: Β (assignment dimension introduced).
common keyword: Β (value constraint,counting constraint).
specialisation: Β ( replaced by =).
- Keywords
characteristic of a constraint: automaton, automaton with counters.
constraint network structure: alpha-acyclic constraint network(2).
- Arc input(s)
- Arc generator
-
- Arc arity
- Arc constraint(s)
- Graph property(ies)
-
- Graph class
-
- Graph model
Because of the arc constraint and since each domain variable can take at most one value, is the number of variables taking a value in the collection.
PartsΒ (A) andΒ (B) of FigureΒ 5.92.1 respectively show the initial and final graph associated with the Example slot. Since we use the graph property, the arcs of the final graph are stressed in bold.
Figure 5.92.1. Initial and final graph of the constraint
(a) (b)
- Automaton
FigureΒ 5.92.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.92.2. Automaton of the constraint
Figure 5.92.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