5.117. element
| DESCRIPTION | LINKS | GRAPH | AUTOMATON |
- Origin
- Constraint
- Synonyms
, , .
- Arguments
- Restrictions
- Purpose
is equal to the item of .
- Example
-
The constraint holds since its third argument is equal to the 3th () item of the collection .
- Typical
- Symmetry
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.
- Usage
- Remark
In the original constraint of CHIP the attribute was not explicitly present in the table of values. It was implicitly defined as the position of a value in the previous table.
The constraint is called in Choco (http://choco.sourceforge.net/). It is also sometimes called when the second argument corresponds to a table of variables.
The constraintΒ [Sicstus95] is a generalisation of the constraint, where the table is replaced by a directed acyclic graph describing the set of solutions.
- Systems
nth in Choco, element in Gecode, element in JaCoP, element in SICStus.
- See also
common keyword: , , , , , Β (array constraint), , , , , Β (data constraint).
generalisation: Β ( replaced by of ).
implies: .
- Keywords
characteristic of a constraint: core, automaton, automaton without counters, reified automaton constraint, derived collection.
constraint network structure: centered cyclic(2) constraint network(1).
constraint type: data constraint.
modelling: array constraint, table, functional dependency, variable indexing, variable subscript, disjunction, assignment to the same set of values, sequence dependent set-up.
modelling exercises: assignment to the same set of values, sequence dependent set-up, zebra puzzle.
- Derived Collection
- Arc input(s)
- Arc generator
-
- Arc arity
- Arc constraint(s)
-
- Graph property(ies)
-
- Graph model
The original constraint with three arguments. We use the derived collection for putting together the and parameters of the constraint. Within the arc constraint we use the implicit attribute that associates to each item of a collection its position within the collection.
PartsΒ (A) andΒ (B) of FigureΒ 5.117.1 respectively show the initial and final graph associated with the Example slot. Since we use the graph property, the unique arc of the final graph is stressed in bold.
Figure 5.117.1. Initial and final graph of the constraint


(a) (b) - Signature
Because of the first condition of the arc constraint the final graph cannot have more than one arc. Therefore we can rewrite to and simplify to .
- Automaton
FigureΒ 5.117.2 depicts the automaton associated with the constraint. Let be the attribute of the item of the collection. To each triple corresponds a 0-1 signature variable as well as the following signature constraint: .
Figure 5.117.2. Automaton of the constraint

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