5.59. cardinality_atmost
DESCRIPTION | LINKS | GRAPH | AUTOMATON |
- Origin
- Constraint
- Arguments
- Restrictions
- Purpose
is the maximum number of occurrences of each value of within the variables of the collection .
- Example
-
In this example, values 5, 7, 2 and 9 occur respectively 0, 1, 2 and 0 times within the collection . As a consequence, the constraint holds since its first argument is assigned to the maximum number of occurrences 2.
- Typical
- Symmetries
Items of are permutable.
Items of are permutable.
An occurrence of a value of that does not belong to can be replaced by any other value that also does not belong to .
All occurrences of two distinct values in or can be swapped; all occurrences of a value in or can be renamed to any unused value.
- Arg. properties
Functional dependency: determined by and .
- Usage
An application of the constraint is to enforce a maximum use of values.
- Remark
This is a restricted form of a variant of the constraint and of the constraint. In the original constraint, one specifies for each value its minimum and maximum number of occurrences.
- Algorithm
See Β [Regin96].
- See also
generalisation: Β (single replaced by an individual for each value), Β (window of size 1 replaced by window of consecutive values).
- Keywords
-
characteristic of a constraint: automaton, automaton with array of counters.
constraint arguments: pure functional dependency.
constraint type: value constraint.
- Arc input(s)
- Arc generator
-
- Arc arity
- Arc constraint(s)
- Graph property(ies)
-
- Graph class
-
- Graph model
PartsΒ (A) andΒ (B) of FigureΒ 5.59.1 respectively show the initial and final graph associated with the Example slot. Since we use the graph property, the vertex that has the maximum number of predecessor is stressed with a double circle.
Figure 5.59.1. Initial and final graph of the constraint
(a) (b)
- Automaton
FigureΒ 5.59.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.59.2. Automaton of the constraint