### 2.2.2. Compound data types

We provide the following compound data types:

• $\mathrm{\pi \pi \pi \pi }\left(T\right)$ corresponds to a list of elements of type $T$, where $T$ is a basic or a compound data type.

• $\mathrm{\pi \pi \pi \pi \pi \pi \pi \pi \pi \pi }\left({A}_{1},{A}_{2},\beta ―,{A}_{n}\right)$ corresponds to a collection of ordered items, where each item consists of $n>0$ attributes ${A}_{1},{A}_{2},\beta ―,{A}_{n}$. Each attribute is an expression of the form $\mathrm{\pi }-T$, where $\mathrm{\pi }$ is the name of the attribute and $T$ the type of the attribute (a basic or a compound data type). All names of the attributes of a given collection should be distinct and different from the keyword $\mathrm{\pi \pi \pi ’}$, which corresponds to an implicitThis attribute is not explicitly defined. attribute. Its value is the position of an item within the collection. The first item of a collection is associated with position 1.

The following notations are used for instantiated arguments:

• A list of elements ${e}_{1},{e}_{2},\beta ―,{e}_{n}$ is denoted $\left[{e}_{1},{e}_{2},\beta ―,{e}_{n}\right]$.

• A finite set of integers ${i}_{1},{i}_{2},\beta ―,{i}_{n}$ is denoted $\left\{{i}_{1},{i}_{2},\beta ―,{i}_{n}\right\}$.

• A multiset of integers ${i}_{1},{i}_{2},\beta ―,{i}_{n}$ is denoted $\left\{\left\{{i}_{1},{i}_{2},\beta ―,{i}_{n}\right\}\right\}$.

• A collection of $n$ items, each item having $m$ attributes, is denoted by

$\beta ©{\mathrm{\pi }}_{1}-{v}_{11}\beta ―{\mathrm{\pi }}_{m}-{v}_{1m},{\mathrm{\pi }}_{1}-{v}_{21}\beta ―{\mathrm{\pi }}_{m}-{v}_{2m},\beta ―,{\mathrm{\pi }}_{1}-{v}_{n1}\beta ―{\mathrm{\pi }}_{m}-{v}_{nm}\beta ͺ$. Each item is separated from the previous item by a comma. When the items of the collection involve a single attribute ${\mathrm{\pi }}_{1}$, $\beta ©{v}_{11},{v}_{21},\beta ―,{v}_{n1}\beta ͺ$ can possibly be used as a shortcut for $\beta ©{\mathrm{\pi }}_{1}-{v}_{11},{\mathrm{\pi }}_{1}-{v}_{21},\beta ―,{\mathrm{\pi }}_{1}-{v}_{n1}\beta ͺ$.

• The ${i}^{th}$ item of a collection $\mathrm{\pi }$ is denoted $\mathrm{\pi }\left[i\right]$.

• The value of the attribute $\mathrm{\pi }$ of the ${i}^{th}$ item of a collection $\mathrm{\pi }$ is denoted $\mathrm{\pi }\left[i\right].\mathrm{\pi }$. Note that, within an arithmetic expression, we can use the shortcut $\mathrm{\pi }\left[i\right]$ when the collection $\mathrm{\pi }$ involves a single attribute.

• The number of items of a collection $\mathrm{\pi }$ is denoted $|\mathrm{\pi }|$.

EXAMPLE: Let us illustrate with four examples, the types one can create. These examples concern the creation of a collection of variables, a collection of tasks, a graph variableΒ [Dooms06] and a collection of orthotopes.An orthotope corresponds to the generalisation of a segment, a rectangle and a box to the $n$-dimensional case.

• In the first example we define $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }$ so that it corresponds to a collection of variables. $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }$ is for instance used in the $\mathrm{\pi \pi \pi \pi \pi \pi \pi \pi \pi \pi \pi \pi }$ constraint. The declaration $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }:\mathrm{\pi \pi \pi \pi \pi \pi \pi \pi \pi \pi }\left(\mathrm{\pi \pi \pi }-\mathrm{\pi \pi \pi \pi }\right)$ defines a collection of items, each of which having one attribute $\mathrm{\pi \pi \pi }$ that is a domain variable.

• In the second example we define $\mathrm{\pi \pi °\pi \pi Ί\pi }$ so that it corresponds to a collection of tasks, each task being defined by its origin, its duration, its end and its resource consumption. Such a collection is for instance used in the $\mathrm{\pi \pi \pi \pi \pi \pi \pi \pi \pi \pi }$ constraint. The declaration $\mathrm{\pi \pi °\pi \pi Ί\pi }:\mathrm{\pi \pi \pi \pi \pi \pi \pi \pi \pi \pi }\left(\mathrm{\pi \pi \pi \pi \pi \pi }-\mathrm{\pi \pi \pi \pi },\mathrm{\pi \pi \pi \pi \pi \pi \pi \pi }-\mathrm{\pi \pi \pi \pi },\mathrm{\pi \pi \pi }-\mathrm{\pi \pi \pi \pi },\mathrm{\pi \pi \pi \pi \pi \pi }-\mathrm{\pi \pi \pi \pi }\right)$ defines a collection of items, each of which having the four attributes $\mathrm{\pi \pi \pi \pi \pi \pi }$, $\mathrm{\pi \pi \pi \pi \pi \pi \pi \pi }$, $\mathrm{\pi \pi \pi }$ and $\mathrm{\pi \pi \pi \pi \pi \pi }$ which all are domain variables.

• In the third example we define a graph as a collection of nodes $\mathrm{\pi ½\pi Ύ\pi ³\pi ΄\pi }$, each node being defined by its index (i.e., identifier) and its successors. Such a collection is for instance used in the $\mathrm{\pi \pi \pi }$ constraint. The declaration $\mathrm{\pi ½\pi Ύ\pi ³\pi ΄\pi }:\mathrm{\pi \pi \pi \pi \pi \pi \pi \pi \pi \pi }\left(\mathrm{\pi \pi \pi \pi \pi ‘}-\mathrm{\pi \pi \pi },\mathrm{\pi \pi \pi \pi }-\mathrm{\pi \pi \pi \pi }\right)$ defines a collection of items, each of which having the two attributes $\mathrm{\pi \pi \pi \pi \pi ‘}$ and $\mathrm{\pi \pi \pi \pi }$ which respectively are integers and set variables.

• In the last example we define $\mathrm{\pi Ύ\pi \pi \pi ·\pi Ύ\pi \pi Ύ\pi Ώ\pi ΄\pi }$ so that is corresponds to a collection of orthotopes. Each orthotope is described by an attribute $\mathrm{\pi \pi \pi \pi }$. Unlike the previous examples, the type of this attribute does not correspond any more to a basic data type but rather to a collection of $n$ items, where $n$ is the number of dimensions of the orthotope.1 for a segment, 2 for a rectangle, 3 for a box, ... . This collection, named $\mathrm{\pi Ύ\pi \pi \pi ·\pi Ύ\pi \pi Ύ\pi Ώ\pi ΄}$, defines for a given dimension the origin, the size and the end of the object in this dimension. This leads to the two declarations:

• $\mathrm{\pi Ύ\pi \pi \pi ·\pi Ύ\pi \pi Ύ\pi Ώ\pi ΄}-\mathrm{\pi \pi \pi \pi \pi \pi \pi \pi \pi \pi }\left(\mathrm{\pi \pi \pi }-\mathrm{\pi \pi \pi \pi },\mathrm{\pi \pi \pi £}-\mathrm{\pi \pi \pi \pi },\mathrm{\pi \pi \pi }-\mathrm{\pi \pi \pi \pi }\right)$,

• $\mathrm{\pi Ύ\pi \pi \pi ·\pi Ύ\pi \pi Ύ\pi Ώ\pi ΄\pi }-\mathrm{\pi \pi \pi \pi \pi \pi \pi \pi \pi \pi }\left(\mathrm{\pi \pi \pi \pi }-\mathrm{\pi Ύ\pi \pi \pi ·\pi Ύ\pi \pi Ύ\pi Ώ\pi ΄}\right)$.

$\mathrm{\pi Ύ\pi \pi \pi ·\pi Ύ\pi \pi Ύ\pi Ώ\pi ΄\pi }$ is for instance used in the $\mathrm{\pi \pi \pi \pi \pi }$ constraint.