4.2.2.4. Channeling constraints
In this section: int_set_channel, inverse, inverse_in_range, inverse_set, link_set_to_booleans.
int_set_channel
predicate int_set_channel(array [int] of var int: x,
array [int] of var set of int: y)
|
Requires that array of int variables x and array of set variables y are related such that (x[i] = j) \(\leftrightarrow\) (i in y[j]). |
inverse
1. predicate inverse(array [$$X] of var $$Y: f,
array [$$Y] of var $$X: invf)
2. function array [$$E] of var $$F: inverse(array [$$F] of var $$E: f)
3. function array [$$E] of var opt $$F: inverse(array [$$F] of var opt $$E: f)
4. function array [$$E] of $$F: inverse(array [$$F] of $$E: f)
|
|
inverse_in_range
predicate inverse_in_range(array [$$A] of var $$B: X,
array [$$B] of var $$A: Y)
|
If the i th variable of the collection X is assigned to j and if j is in the index set of Y then the j th variable of the collection Y is assigned to i. Conversely, if the j th variable of the collection Y is assigned to i and if i is in the index set of X then the i th variable of the collection X is assigned to j. |
inverse_set
predicate inverse_set(array [$$X] of var set of $$Y: f,
array [$$Y] of var set of $$X: invf)
|
Constrains two arrays of set of int variables, f and invf, so that a j in f[i] iff i in invf[j]. All the values in each array’s sets must be within the index set of the other array. |
link_set_to_booleans
predicate link_set_to_booleans(var set of $$E: s,
array [$$E] of var bool: b)
|
Constrains the array of Booleans b to be a representation of the set s: i in s \(\leftrightarrow\) b[i]. The index set of b must be a superset of the possible values of s. |