5.148. elements_sparse
DESCRIPTION | LINKS | GRAPH |
- Origin
- Constraint
- Arguments
- Restrictions
- Purpose
All the items of should be equal to one of the entries of the table or to the default value if the entry does not occurs among the values of the index attribute of the collection.
- Example
-
The constraint holds since:
The first and third items (items and ) of its collection respectively correspond to the fourth and second item of its collection.
The attribute of the second item of its collection (i.e.,Β value 3) does not correspond to any index of the collection. Therefore the attribute of the second item of the collection is set the the default value 5 given by the last argument of the constraint.
- Typical
- Symmetries
Items of are permutable.
Items of are permutable.
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
Used for replacing several constraints sharing exactly the same sparse table by a single constraint.
- Reformulation
Let and respectively denote and . The constraint can be expressed in term of reified constraints of the form:
Β
Β
Β
Β
Β
Β
Β .
- See also
common keyword: , Β (data constraint), Β (sparse table).
- Keywords
characteristic of a constraint: derived collection.
constraint type: data constraint, system of constraints.
modelling: table, shared table, sparse table, sparse functional dependency.
- Derived Collections
- Arc input(s)
- Arc generator
-
- Arc arity
- Arc constraint(s)
-
- Graph property(ies)
-
- Graph model
An item of the collection may have up to two successors (see for instance the third item of the collection of the Example slot). Therefore we use the graph property for enforcing the fact that each item of the collection has at least one successor.
PartsΒ (A) andΒ (B) of FigureΒ 5.148.1 respectively show the initial and final graph associated with the Example slot. Since we use the graph property, the vertices of the final graph are drawn with a double circle.
Figure 5.148.1. Initial and final graph of the constraint
(a) (b) - Signature
On the one hand note that is equal to the number of sources of the initial graph. On the other hand note that, in the initial graph, all the vertices that are not sources correspond to sinks. Since isolated vertices are eliminated from the final graph the sinks of the initial graph cannot become sources of the final graph. Therefore the maximum number of sources of the final graph is equal to . We can rewrite to and simplify to .