5.77. count
| DESCRIPTION | LINKS | GRAPH | AUTOMATON |
- Origin
- Constraint
- Synonyms
, , .
- Arguments
- Restrictions
- Purpose
Let be the number of variables of the collection assigned to value ; Enforce condition to hold.
- Example
-
The constraint holds since value occurs 3 times within the items of the collection , which is greater than or equal to ( is set to ) .
- Typical
- Symmetries
Items of are permutable.
An occurrence of a value of that is different from can be replaced by any other value that is also different from .
- Remark
-
In JaCoP (http://www.jacop.eu/) is implicitly set to .
- Reformulation
The constraint can be expressed in term of the conjunction .
- Systems
occurence in Choco, count in Gecode, count in JaCoP, count in SICStus.
- See also
assignment dimension added: Β (= replaced by and assignment dimension introduced).
common keyword: Β (value constraint,counting constraint), Β (value constraint), , , Β (value constraint,counting constraint), Β (counting constraint).
generalisation: Β (= replaced by ).
related: .
- 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 model
PartsΒ (A) andΒ (B) of FigureΒ 5.77.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.77.1. Initial and final graph of the constraint


(a) (b)
- Automaton
FigureΒ 5.77.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.77.2. Automaton of the constraint

Figure 5.77.3. Hypergraph of the reformulation corresponding to the automaton of the constraint
