2.3.2.1. Collection generators

The vertices of the initial graph are usually directly generated from collections of items that are arguments of the global constraint 𝙢 under consideration. However, it sometimes happens that we would like to derive a new collection from existing arguments of 𝙢 in order to produce the vertices of the initial graph.

EXAMPLE: This is for instance the case of the πšŽπš•πšŽπš–πšŽπš—πš(π™Έπ™½π™³π™΄πš‡, πšƒπ™°π™±π™»π™΄, πš…π™°π™»πš„π™΄) constraint, where π™Έπ™½π™³π™΄πš‡ and πš…π™°π™»πš„π™΄ are domain variables that we would like to group as a single item ℐ (with two attributes) of a new derived collection. This is in fact done in order to generate the following initial graph:

  • The item ℐ as well as all items of πšƒπ™°π™±π™»π™΄ constitute the vertices,

  • There is an arc from ℐ to each item of the πšƒπ™°π™±π™»π™΄ collection.

Β 

We provide the following mechanism for deriving new collections:

  • In a first phase we declare the name of the new collection as well as the names of its attributes and their respective types. This is achieved exactly in the same way as those collections that are used in the arguments of a global constraint (see page 2.2.2).

    EXAMPLE: Consider again the example of the πšŽπš•πšŽπš–πšŽπš—πš(π™Έπ™½π™³π™΄πš‡, πšƒπ™°π™±π™»π™΄, πš…π™°π™»πš„π™΄) constraint. The declaration π™Έπšƒπ™΄π™Ό-πšŒπš˜πš•πš•πšŽπšŒπšπš’πš˜πš—(πš’πš—πšπšŽπš‘-πšπšŸπšŠπš›,πšŸπšŠπš•πšžπšŽ-πšπšŸπšŠπš›) introduces a new collection called π™Έπšƒπ™΄π™Ό where each item has an πš’πš—πšπšŽπš‘ and a πšŸπšŠπš•πšžπšŽ attribute. Both attributes correspond to domain variables.

  • In a second phase we give a list of patterns that are used for generating the items of the new collection. A pattern o-πš’πšπšŽπš–(𝚊 1 -v 1 ,𝚊 2 -v 2 ,β‹―,𝚊 n -v n ) or πš’πšπšŽπš–(𝚊 1 -v 1 ,𝚊 2 -v 2 ,β‹―,𝚊 n -v n ) specifies for each attribute 𝚊 i (1≀i≀n) of the new collection how to fill it.o is one of the comparison operators =,β‰ ,<,β‰₯,>,≀. When omitted its default value is =. This is done by providing for each attribute 𝚊 i one of the following expression v i :

    • A constant.

    • An argument of the global constraint 𝙢.

    • An expression 𝚌.𝚊, where 𝚊 is an attribute of a collection 𝚌, such that 𝚌 is an argument of the global constraint 𝙢 or a derived collection that was previously declared. An expression of this form is called a direct reference to an attribute of a collection.

    • An expression 𝚌 1 .𝚌 2 .𝚊, where 𝚊 is an attribute of a collection 𝚌 2 , and 𝚌 2 is an attribute of a collection 𝚌 1 such that 𝚌 1 is an argument of the global constraint 𝙢 or a derived collection that was previously declared. An expression of this form is called an indirect reference to an attribute of a collection.

    This expression v i must be compatible with the type declaration of the corresponding attribute of the new collection.

EXAMPLE: We continue the example of the πšŽπš•πšŽπš–πšŽπš—πš(π™Έπ™½π™³π™΄πš‡,πšƒπ™°π™±π™»π™΄,πš…π™°π™»πš„π™΄) constraint and the derived collection π™Έπšƒπ™΄π™Ό-πšŒπš˜πš•πš•πšŽπšŒπšπš’πš˜πš—(πš’πš—πšπšŽπš‘-πšπšŸπšŠπš›,πšŸπšŠπš•πšžπšŽ-πšπšŸπšŠπš›). The pattern πš’πšπšŽπš–(πš’πš—πšπšŽπš‘-π™Έπ™½π™³π™΄πš‡,πšŸπšŠπš•πšžπšŽ-πš…π™°π™»πš„π™΄) indicates that:

  • The πš’πš—πšπšŽπš‘ attribute of the π™Έπšƒπ™΄π™Ό collection will be generated by using the π™Έπ™½π™³π™΄πš‡ argument of the πšŽπš•πšŽπš–πšŽπš—πš constraint. Since π™Έπ™½π™³π™΄πš‡ is a domain variable, it is compatible with the declaration π™Έπšƒπ™΄π™Ό-πšŒπš˜πš•πš•πšŽπšŒπšπš’πš˜πš—(πš’πš—πšπšŽπš‘-πšπšŸπšŠπš›,πšŸπšŠπš•πšžπšŽ-πšπšŸπšŠπš›) of the new collection.

  • The πšŸπšŠπš•πšžπšŽ attribute of the π™Έπšƒπ™΄π™Ό collection will be generated by using the πš…π™°π™»πš„π™΄ argument of the πšŽπš•πšŽπš–πšŽπš—πš constraint. πš…π™°π™»πš„π™΄ is also compatible with the declaration statement of the new collection.

We now describe how we use the pattern for generating the items of a derived collection. We have the following two cases:

  • If the pattern o-πš’πšπšŽπš–(𝚊 1 -v 1 ,𝚊 2 -v 2 ,β‹―,𝚊 n -v n ) does not contain any direct or indirect reference to an attribute of a collection then we generate a single item for such pattern.In this first case the value of o is irrelevant. In this context the value v i of the attribute 𝚊 i (1≀i≀n) corresponds to a constant, to an argument of the global constraint or to a new derived collection.

  • If the pattern o-πš’πšπšŽπš–(𝚊 1 -v 1 ,𝚊 2 -v 2 ,β‹―,𝚊 n -v n ), where o is one of the comparison operators =,β‰ ,<,β‰₯,>,≀, contains one or several direct or indirect references to an attribute of a collectionThis collection is an argument of the global constraint or corresponds to a newly derived collection. we denote by:

    • π’Ÿ the set of indices of the positions corresponding to a direct reference to an attribute of a collection within πš’πšπšŽπš–(𝚊 1 -v 1 ,𝚊 2 -v 2 ,β‹―,𝚊 n -v n ). In this context, let 𝚌 Ξ± 1 ,𝚌 Ξ± 2 ,β‹―,𝚌 Ξ± m and 𝚊 Ξ± 1 ,𝚊 Ξ± 2 ,β‹―,𝚊 Ξ± m respectively denote the corresponding collections and attributes.

    • ℐ the set of indices of the positions corresponding to an indirect reference to an attribute of a collection within πš’πšπšŽπš–(𝚊 1 -v 1 ,𝚊 2 -v 2 ,β‹―,𝚊 n -v n ). In this context, let 𝚌 Ξ² 1 1 ,𝚌 Ξ² 2 1 ,β‹―,𝚌 Ξ² p 1 , 𝚌 Ξ² 1 2 ,𝚌 Ξ² 2 2 ,β‹―,𝚌 Ξ² p 2 and 𝚊 Ξ² 1 ,𝚊 Ξ² 2 ,β‹―,𝚊 Ξ² p respectively denote the corresponding collections, attributes of type collection and attributes.

    • Let π‘‘π‘–π‘Ÿ 1 ,π‘‘π‘–π‘Ÿ 2 ,β‹―,π‘‘π‘–π‘Ÿ m , 𝑖𝑛𝑑 1 ,𝑖𝑛𝑑 2 ,β‹―,𝑖𝑛𝑑 p and 𝑖𝑑 1 ,𝑖𝑑 2 ,β‹―,𝑖𝑑 m+p respectively denote the indices sorted in increasing order of π’Ÿ, ℐ and π’Ÿβˆͺℐ.

    For each combination of items 𝚌 Ξ± 1 [i 1 ],𝚌 Ξ± 2 [i 2 ],β‹―,𝚌 Ξ± m [i m ], 𝚌 Ξ² 1 1 [j 1 ].𝚌 Ξ² 1 2 [k 1 ], 𝚌 Ξ² 2 1 [j 2 ].𝚌 Ξ² 2 2 [k 2 ], β‹―, 𝚌 Ξ² p 1 [j p ].𝚌 Ξ² p 2 [k p ] such that:

    i 1 ∈[1,|𝚌 Ξ± 1 |],i 2 ∈[1,|𝚌 Ξ± 2 |],β‹― ,i m ∈[1,|𝚌 Ξ± m |]j 1 ∈[1,|𝚌 Ξ² 1 1 |],j 2 ∈[1,|𝚌 Ξ² 2 1 |],β‹― ,j p ∈[1,|𝚌 Ξ² p 1 |]k 1 ∈[1,|𝚌 Ξ² 1 1 [j 1 ].𝚌 Ξ² 1 2 |],k 2 ∈[1,|𝚌 Ξ² 2 1 [j 2 ].𝚌 Ξ² 2 2 |],β‹― ,k p ∈[1,|𝚌 Ξ² p 1 [j p ].𝚌 Ξ² p 2 |] 𝑖𝑑 1 o 𝑖𝑑 2 o β‹― o 𝑖𝑑 m+p

    we generate an item of the new derived collection 〈𝚊 1 -w 1 𝚊 2 -w 2 β‹― 𝚊 n -w n βŒͺ defined by:

    w j (1≀j≀n)=𝚌 Ξ± r [i r ].𝚊 Ξ± r if jβˆˆπ’Ÿ,j=π‘‘π‘–π‘Ÿ r 𝚌 Ξ² r 1 [j r ].𝚌 Ξ² r 2 [k r ].𝚊 Ξ² r if jβˆˆβ„,j=𝑖𝑛𝑑 r v j if jβˆ‰π’Ÿβˆͺℐ.

We illustrate this generation process on a set of examples. Each example is described by providing:

  • The global constraint and its arguments,

  • The declaration of the new derived collection,

  • The pattern used for creating an item of the new collection,

  • The items generated by applying this pattern to the global constraint,

  • A comment about the generation process.

We first start with four examples that do not mention any references to an attribute of a collection. A box surrounds an argument of a global constraint that is mentioned in a generated item.

EXAMPLE

π™²π™Ύπ™½πš‚πšƒπšπ™°π™Έπ™½πšƒ :

πšŽπš•πšŽπš–πšŽπš—πš(π™Έπ™½π™³π™΄πš‡,πšƒπ™°π™±π™»π™΄,πš…π™°π™»πš„π™΄)

π™³π™΄πšπ™Έπš…π™΄π™³ π™²π™Ύπ™»π™»π™΄π™²πšƒπ™Έπ™Ύπ™½:

π™Έπšƒπ™΄π™Ό-πšŒπš˜πš•πš•πšŽπšŒπšπš’πš˜πš—(πš’πš—πšπšŽπš‘-πšπšŸπšŠπš›,πšŸπšŠπš•πšžπšŽ-πšπšŸπšŠπš›)

π™Ώπ™°πšƒπšƒπ™΄πšπ™½(πš‚)Β Β Β Β Β Β Β Β Β :

πš’πšπšŽπš–(πš’πš—πšπšŽπš‘-π™Έπ™½π™³π™΄πš‡,πšŸπšŠπš•πšžπšŽ-πš…π™°π™»πš„π™΄)

π™Άπ™΄π™½π™΄πšπ™°πšƒπ™΄π™³ π™Έπšƒπ™΄π™Ό(πš‚)Β Β :

βŒ©πš’πš—πšπšŽπš‘-π™Έπ™½π™³π™΄πš‡ πšŸπšŠπš•πšžπšŽ-πš…π™°π™»πš„π™΄βŒͺ

We generate a single item where the two attributes πš’πš—πšπšŽπš‘ and πšŸπšŠπš•πšžπšŽ respectively take the first argument π™Έπ™½π™³π™΄πš‡ and the third argument πš…π™°π™»πš„π™΄ of the πšŽπš•πšŽπš–πšŽπš—πš constraint.

EXAMPLE

π™²π™Ύπ™½πš‚πšƒπšπ™°π™Έπ™½πšƒ :

πš•πšŽπš‘_πš•πšŽπšœπšœπšŽπšš(πš…π™΄π™²πšƒπ™Ύπš1,πš…π™΄π™²πšƒπ™Ύπš2)

π™³π™΄πšπ™Έπš…π™΄π™³ π™²π™Ύπ™»π™»π™΄π™²πšƒπ™Έπ™Ύπ™½:

π™³π™΄πš‚πšƒπ™Έπ™½π™°πšƒπ™Έπ™Ύπ™½-πšŒπš˜πš•πš•πšŽπšŒπšπš’πš˜πš—(πš’πš—πšπšŽπš‘-πš’πš—πš,𝚑-πš’πš—πš,𝚒-πš’πš—πš)

π™Ώπ™°πšƒπšƒπ™΄πšπ™½(πš‚)Β Β Β Β Β Β Β Β Β Β :

πš’πšπšŽπš–(πš’πš—πšπšŽπš‘-0,𝚑-0,𝚒-0)

π™Άπ™΄π™½π™΄πšπ™°πšƒπ™΄π™³ π™Έπšƒπ™΄π™Ό(πš‚)Β Β :

βŒ©πš’πš—πšπšŽπš‘-0 𝚑-0 𝚒-0βŒͺ

We generate a single item where the three attributes πš’πš—πšπšŽπš‘, 𝚑 and 𝚒 take value 0.

EXAMPLE

π™²π™Ύπ™½πš‚πšƒπšπ™°π™Έπ™½πšƒ :

πš’πš—_πš›πšŽπš•πšŠπšπš’πš˜πš—(πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚,πšƒπš„π™Ώπ™»π™΄πš‚_𝙾𝙡_πš…π™°π™»πš‚)

π™³π™΄πšπ™Έπš…π™΄π™³ π™²π™Ύπ™»π™»π™΄π™²πšƒπ™Έπ™Ύπ™½:

πšƒπš„π™Ώπ™»π™΄πš‚_𝙾𝙡_πš…π™°πšπš‚-πšŒπš˜πš•πš•πšŽπšŒπšπš’πš˜πš—(𝚟𝚎𝚌-πšƒπš„π™Ώπ™»π™΄_𝙾𝙡_πš…π™°πšπš‚)

π™Ώπ™°πšƒπšƒπ™΄πšπ™½(πš‚)Β Β Β Β Β Β Β Β Β :

πš’πšπšŽπš–(𝚟𝚎𝚌-πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚)

π™Άπ™΄π™½π™΄πšπ™°πšƒπ™΄π™³ π™Έπšƒπ™΄π™Ό(πš‚)Β Β :

〈𝚟𝚎𝚌-πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚βŒͺ

We generate a single item where the unique attribute 𝚟𝚎𝚌 takes the first argument of the πš’πš—_πš›πšŽπš•πšŠπšπš’πš˜πš— constraint as its value.

EXAMPLE

π™²π™Ύπ™½πš‚πšƒπšπ™°π™Έπ™½πšƒ :

πšπš˜πš–πšŠπš’πš—_πšŒπš˜πš—πšœπšπš›πšŠπš’πš—πš(πš…π™°πš,πš…π™°π™»πš„π™΄πš‚)

π™³π™΄πšπ™Έπš…π™΄π™³ π™²π™Ύπ™»π™»π™΄π™²πšƒπ™Έπ™Ύπ™½:

πš…π™°π™»πš„π™΄-πšŒπš˜πš•πš•πšŽπšŒπšπš’πš˜πš—(πšŸπšŠπš›01-πš’πš—πš,πšŸπšŠπš•πšžπšŽ-πšπšŸπšŠπš›)

π™Ώπ™°πšƒπšƒπ™΄πšπ™½(πš‚)Β Β Β Β Β Β Β Β Β :

πš’πšπšŽπš–(πšŸπšŠπš›01-1,πšŸπšŠπš•πšžπšŽ-πš…π™°πš)

π™Άπ™΄π™½π™΄πšπ™°πšƒπ™΄π™³ π™Έπšƒπ™΄π™Ό(πš‚)Β Β :

βŒ©πšŸπšŠπš›01-1 πšŸπšŠπš•πšžπšŽ-πš…π™°πšβŒͺ

We generate a single item where the two attributes πšŸπšŠπš›01 and πšŸπšŠπš•πšžπšŽ respectively take value 1 and the first argument of the πšπš˜πš–πšŠπš’πš—_πšŒπš˜πš—πšœπšπš›πšŠπš’πš—πš constraint.

We continue with three examples that mention one or several direct references to an attribute of some collections. We now need to explicitly give the items of these collections in order to generate the items of the derived collection.

EXAMPLE

π™²π™Ύπ™½πš‚πšƒπšπ™°π™Έπ™½πšƒ :

πš•πšŽπš‘_πš•πšŽπšœπšœπšŽπšš(πš…π™΄π™²πšƒπ™Ύπš1,πš…π™΄π™²πšƒπ™Ύπš2)

πš…π™΄π™²πšƒπ™Ύπš1 :

βŒ©πšŸπšŠπš›-5,πšŸπšŠπš›-2,πšŸπšŠπš›-3,πšŸπšŠπš›-1βŒͺ

πš…π™΄π™²πšƒπ™Ύπš2 :

βŒ©πšŸπšŠπš›-5,πšŸπšŠπš›-2,πšŸπšŠπš›-6,πšŸπšŠπš›-2βŒͺ

π™³π™΄πšπ™Έπš…π™΄π™³ π™²π™Ύπ™»π™»π™΄π™²πšƒπ™Έπ™Ύπ™½:

π™²π™Ύπ™Όπ™Ώπ™Ύπ™½π™΄π™½πšƒπš‚-πšŒπš˜πš•πš•πšŽπšŒπšπš’πš˜πš—(πš’πš—πšπšŽπš‘-πš’πš—πš,

𝚑-πšπšŸπšŠπš›,𝚒-πšπšŸπšŠπš›)

π™Ώπ™°πšƒπšƒπ™΄πšπ™½(πš‚)Β Β Β Β Β Β Β Β Β Β :

πš’πšπšŽπš–(πš’πš—πšπšŽπš‘-πš…π™΄π™²πšƒπ™Ύπš1.πš”πšŽπš’As defined in SectionΒ 2.2.2 on page 2.2.2, πš”πšŽπš’ is an implicit attribute corresponding to the position of an item within a collection.,

𝚑-πš…π™΄π™²πšƒπ™Ύπš1.πšŸπšŠπš›,𝚒-πš…π™΄π™²πšƒπ™Ύπš2.πšŸπšŠπš›)

π™Άπ™΄π™½π™΄πšπ™°πšƒπ™΄π™³ π™Έπšƒπ™΄π™Ό(πš‚)Β Β :

βŒ©πš’πš—πšπšŽπš‘-1 𝚑-5 𝚒-5, πš’πš—πšπšŽπš‘-2 𝚑-2 𝚒-2,

πš’πš—πšπšŽπš‘-3 𝚑-3 𝚒-6, πš’πš—πšπšŽπš‘-4 𝚑-1 𝚒-2βŒͺ

The pattern mentions three references πš…π™΄π™²πšƒπ™Ύπš1.πš”πšŽπš’, πš…π™΄π™²πšƒπ™Ύπš1.πšŸπšŠπš› and πš…π™΄π™²πšƒπ™Ύπš2.πšŸπšŠπš› to the collections πš…π™΄π™²πšƒπ™Ύπš1 and πš…π™΄π™²πšƒπ™Ύπš2 used in the arguments of the πš•πšŽπš‘_πš•πšŽπšœπšœπšŽπšš constraint. βˆ€i 1 ∈[1,|πš…π™΄π™²πšƒπ™Ύπš1|],βˆ€i 2 ∈[1,|πš…π™΄π™²πšƒπ™Ύπš2|] such that i 1 =i 2 We use an equality since this is the default value of the comparison operator o when we do not use a pattern of the form o-πš’πšπšŽπš–(β‹―). we generate an item πš’πš—πšπšŽπš‘-v 1 𝚑-v 2 𝚒-v 3 where:

v 1 =i 1 , v 2 =πš…π™΄π™²πšƒπ™Ύπš1[i 1 ].πšŸπšŠπš›, v 3 =πš…π™΄π™²πšƒπ™Ύπš2[i 1 ].πšŸπšŠπš›.

This leads to the four items listed in the π™Άπ™΄π™½π™΄πšπ™°πšƒπ™΄π™³ π™Έπšƒπ™΄π™Ό(πš‚) field.

EXAMPLE

π™²π™Ύπ™½πš‚πšƒπšπ™°π™Έπ™½πšƒ :

πšŒπšžπš–πšžπš•πšŠπšπš’πšŸπšŽπšœ(πšƒπ™°πš‚π™Ίπš‚,π™Όπ™°π™²π™·π™Έπ™½π™΄πš‚,π™²πšƒπš)

πšƒπ™°πš‚π™Ίπš‚ :

βŒ©πš–πšŠπšŒπš‘πš’πš—πšŽ-1 πš˜πš›πš’πšπš’πš—-1 πšπšžπš›πšŠπšπš’πš˜πš—-4 πšŽπš—πš-5 πš‘πšŽπš’πšπš‘πš-1,

πš–πšŠπšŒπš‘πš’πš—πšŽ-1 πš˜πš›πš’πšπš’πš—-4 πšπšžπš›πšŠπšπš’πš˜πš—-2 πšŽπš—πš-6 πš‘πšŽπš’πšπš‘πš-3,

πš–πšŠπšŒπš‘πš’πš—πšŽ-1 πš˜πš›πš’πšπš’πš—-2 πšπšžπš›πšŠπšπš’πš˜πš—-3 πšŽπš—πš-5 πš‘πšŽπš’πšπš‘πš-2,

πš–πšŠπšŒπš‘πš’πš—πšŽ-2 πš˜πš›πš’πšπš’πš—-5 πšπšžπš›πšŠπšπš’πš˜πš—-2 πšŽπš—πš-7 πš‘πšŽπš’πšπš‘πš-2βŒͺ

π™³π™΄πšπ™Έπš…π™΄π™³ π™²π™Ύπ™»π™»π™΄π™²πšƒπ™Έπ™Ύπ™½:

πšƒπ™Έπ™Όπ™΄_π™Ώπ™Ύπ™Έπ™½πšƒπš‚-πšŒπš˜πš•πš•πšŽπšŒπšπš’πš˜πš—(πš’πšπš–-πš’πš—πš,

πšπšžπš›πšŠπšπš’πš˜πš—-πšπšŸπšŠπš›,πš™πš˜πš’πš—πš-πšπšŸπšŠπš›)

π™Ώπ™°πšƒπšƒπ™΄πšπ™½(πš‚)Β Β Β Β Β Β Β Β Β :

πš’πšπšŽπš–(πš’πšπš–-πšƒπ™°πš‚π™Ίπš‚.πš–πšŠπšŒπš‘πš’πš—πšŽ,

πšπšžπš›πšŠπšπš’πš˜πš—-πšƒπ™°πš‚π™Ίπš‚.πšπšžπš›πšŠπšπš’πš˜πš—,πš™πš˜πš’πš—πš-πšƒπ™°πš‚π™Ίπš‚.πš˜πš›πš’πšπš’πš—)

πš’πšπšŽπš–(πš’πšπš–-πšƒπ™°πš‚π™Ίπš‚.πš–πšŠπšŒπš‘πš’πš—πšŽ,

πšπšžπš›πšŠπšπš’πš˜πš—-πšƒπ™°πš‚π™Ίπš‚.πšπšžπš›πšŠπšπš’πš˜πš—,πš™πš˜πš’πš—πš-πšƒπ™°πš‚π™Ίπš‚.πšŽπš—πš)

π™Άπ™΄π™½π™΄πšπ™°πšƒπ™΄π™³ π™Έπšƒπ™΄π™Ό(πš‚)Β Β :

βŒ©πš’πšπš–-1 πšπšžπš›πšŠπšπš’πš˜πš—-4 πš™πš˜πš’πš—πš-1,

πš’πšπš–-1 πšπšžπš›πšŠπšπš’πš˜πš—-2 πš™πš˜πš’πš—πš-4,

πš’πšπš–-1 πšπšžπš›πšŠπšπš’πš˜πš—-3 πš™πš˜πš’πš—πš-2,

πš’πšπš–-2 πšπšžπš›πšŠπšπš’πš˜πš—-2 πš™πš˜πš’πš—πš-5,

πš’πšπš–-1 πšπšžπš›πšŠπšπš’πš˜πš—-4 πš™πš˜πš’πš—πš-5,

πš’πšπš–-1 πšπšžπš›πšŠπšπš’πš˜πš—-2 πš™πš˜πš’πš—πš-6,

πš’πšπš–-1 πšπšžπš›πšŠπšπš’πš˜πš—-3 πš™πš˜πš’πš—πš-5,

πš’πšπš–-2 πšπšžπš›πšŠπšπš’πš˜πš—-2 πš™πš˜πš’πš—πš-7βŒͺ

The two patterns mention the references πšƒπ™°πš‚π™Ίπš‚.πš–πšŠπšŒπš‘πš’πš—πšŽ, πšƒπ™°πš‚π™Ίπš‚.πšπšžπš›πšŠπšπš’πš˜πš—, πšƒπ™°πš‚π™Ίπš‚.πš˜πš›πš’πšπš’πš— and πšƒπ™°πš‚π™Ίπš‚.πšŽπš—πš of the πšƒπ™°πš‚π™Ίπš‚ collection used in the arguments of the πšŒπšžπš–πšžπš•πšŠπšπš’πšŸπšŽπšœ constraint. βˆ€i∈[1,|πšƒπ™°πš‚π™Ίπš‚|], we generate two items πš’πšπš–-u 1 πšπšžπš›πšŠπšπš’πš˜πš—-u 2 πš™πš˜πš’πš—πš-u 3 , πš’πšπš–-v 1 πšπšžπš›πšŠπšπš’πš˜πš—-v 2 πš™πš˜πš’πš—πš-v 3 where:

u 1 =πšƒπ™°πš‚π™Ίπš‚[i].πš–πšŠπšŒπš‘πš’πš—πšŽ, u 2 =πšƒπ™°πš‚π™Ίπš‚[i].πšπšžπš›πšŠπšπš’πš˜πš—, u 3 =πšƒπ™°πš‚π™Ίπš‚[i].πš˜πš›πš’πšπš’πš—,

v 1 =πšƒπ™°πš‚π™Ίπš‚[i].πš–πšŠπšŒπš‘πš’πš—πšŽ, v 2 =πšƒπ™°πš‚π™Ίπš‚[i].πšπšžπš›πšŠπšπš’πš˜πš—, v 3 =πšƒπ™°πš‚π™Ίπš‚[i].πšŽπš—πš.

This leads to the eight items listed in the π™Άπ™΄π™½π™΄πšπ™°πšƒπ™΄π™³ π™Έπšƒπ™΄π™Ό(πš‚) field.

EXAMPLE

π™²π™Ύπ™½πš‚πšƒπšπ™°π™Έπ™½πšƒ :

πšπš˜πš•πš˜πš–πš‹(πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚)

πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚ :

βŒ©πšŸπšŠπš›-0,πšŸπšŠπš›-1,πšŸπšŠπš›-4,πšŸπšŠπš›-6βŒͺ

π™³π™΄πšπ™Έπš…π™΄π™³ π™²π™Ύπ™»π™»π™΄π™²πšƒπ™Έπ™Ύπ™½:

π™Ώπ™°π™Έπšπš‚-πšŒπš˜πš•πš•πšŽπšŒπšπš’πš˜πš—(𝚑-πšπšŸπšŠπš›,𝚒-πšπšŸπšŠπš›)

π™Ώπ™°πšƒπšƒπ™΄πšπ™½(πš‚)Β Β Β Β Β Β Β Β Β :

>-πš’πšπšŽπš–(𝚑-πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚.πšŸπšŠπš›,𝚒-πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚.πšŸπšŠπš›)

π™Άπ™΄π™½π™΄πšπ™°πšƒπ™΄π™³ π™Έπšƒπ™΄π™Ό(πš‚)Β Β :

〈𝚑-1 𝚒-0,

𝚑-4 𝚒-0, 𝚑-4 𝚒-1,

𝚑-6 𝚒-0, 𝚑-6 𝚒-1, 𝚑-6 𝚒-4βŒͺ

The pattern mentions two references πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚.πšŸπšŠπš› and πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚.πšŸπšŠπš› to the πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚ collection used in the arguments of the πšπš˜πš•πš˜πš–πš‹ constraint. βˆ€i 1 ∈[1,|πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚|], βˆ€i 2 ∈[1,|πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚|] such that i 1 >i 2 We use the comparison operator > since we have a pattern of the form >-πš’πšπšŽπš–(β‹―). we generate the item 𝚑-u 1 𝚒-u 2 where:

u 1 =πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚[i 1 ].πšŸπšŠπš›, u 2 =πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚[i 2 ].πšŸπšŠπš›.

This leads to the six items listed in the π™Άπ™΄π™½π™΄πšπ™°πšƒπ™΄π™³ π™Έπšƒπ™΄π™Ό(πš‚) field.

Β 

We finish with an example that mentions an indirect reference to an attribute of a collection.

EXAMPLE

π™²π™Ύπ™½πš‚πšƒπšπ™°π™Έπ™½πšƒ :

πšŒπšžπš–πšžπš•πšŠπšπš’πšŸπšŽ_πšŒπš˜πš—πšŸπšŽπš‘(πšƒπ™°πš‚π™Ίπš‚,π™»π™Έπ™Όπ™Έπšƒ)

πšƒπ™°πš‚π™Ίπš‚ :

βŒ©πš™πš˜πš’πš—πšπšœ-βŒ©πšŸπšŠπš›-2,πšŸπšŠπš›-1,πšŸπšŠπš›-5βŒͺ πš‘πšŽπš’πšπš‘πš-1,

πš™πš˜πš’πš—πšπšœ-βŒ©πšŸπšŠπš›-4,πšŸπšŠπš›-5,πšŸπšŠπš›-7βŒͺ πš‘πšŽπš’πšπš‘πš-2,

πš™πš˜πš’πš—πšπšœ-βŒ©πšŸπšŠπš›-14,πšŸπšŠπš›-15βŒͺ πš‘πšŽπš’πšπš‘πš-2βŒͺ

π™³π™΄πšπ™Έπš…π™΄π™³ π™²π™Ύπ™»π™»π™΄π™²πšƒπ™Έπ™Ύπ™½:

π™Έπ™½πš‚πšƒπ™°π™½πšƒπš‚-πšŒπš˜πš•πš•πšŽπšŒπšπš’πš˜πš—(πš’πš—πšœπšπšŠπš—πš-πš’πš—πš)

π™Ώπ™°πšƒπšƒπ™΄πšπ™½(πš‚)Β Β Β Β Β Β Β Β Β Β :

πš’πšπšŽπš–(πš’πš—πšœπšπšŠπš—πš-πšƒπ™°πš‚π™Ίπš‚.πš™πš˜πš’πš—πšπšœ.πšŸπšŠπš›)

π™Άπ™΄π™½π™΄πšπ™°πšƒπ™΄π™³ π™Έπšƒπ™΄π™Ό(πš‚)Β Β :

βŒ©πš’πš—πšœπšπšŠπš—πš-2, πš’πš—πšœπšπšŠπš—πš-1, πš’πš—πšœπšπšŠπš—πš-5, πš’πš—πšœπšπšŠπš—πš-4,

πš’πš—πšœπšπšŠπš—πš-5, πš’πš—πšœπšπšŠπš—πš-7, πš’πš—πšœπšπšŠπš—πš-14, πš’πš—πšœπšπšŠπš—πš-15βŒͺ

The pattern mentions the indirect reference πšƒπ™°πš‚π™Ίπš‚.πš™πš˜πš’πš—πšπšœ.πšŸπšŠπš› of the πšƒπ™°πš‚π™Ίπš‚ collection used in the arguments of the πšŒπšžπš–πšžπš•πšŠπšπš’πšŸπšŽ_πšŒπš˜πš—πšŸπšŽπš‘ constraint. βˆ€i∈[1,|πšƒπ™°πš‚π™Ίπš‚|], βˆ€j∈[1,|πšƒπ™°πš‚π™Ίπš‚[i].πš™πš˜πš’πš—πšπšœ|] we generate the item πš’πš—πšœπšπšŠπš—πš-u ij where:

u ij =πšƒπ™°πš‚π™Ίπš‚[i].πš™πš˜πš’πš—πšπšœ[j].

This leads to the eight items listed in the π™Άπ™΄π™½π™΄πšπ™°πšƒπ™΄π™³ π™Έπšƒπ™΄π™Ό(πš‚) field.