### 4.5.2.3. Structure of schema

#### Model

The top-level element for the schema is model, which contains an optional variables element and a required constraints element.

#### Variables

The variables element consists of a non-empty sequence of variable elements, each describing a single variable which may occur in some of the constraints. Each variable has some attributes, an required id, an optional name and a required external. The id is an XML schema ID used to refer to the variable in the constraints of the model, the name is a string which describes the variable to the user, and external is a “yes”/“no” string which states if the variable is visible outside the model.

The domains of variables are not described as part of the variables section, special unary constraints (e.g., $\mathrm{𝚒𝚗}_\mathrm{𝚒𝚗𝚝𝚎𝚛𝚟𝚊𝚕}$) are used in the constraint section instead.

#### constraints

The constraints element consists of one or more elements representing constraints in the catalogue. The constraints can be stated in any order, with the understanding that the order may influence the sequence in which they are introduced to the solver.

For each constraint in the catalogue, a specific element with the same name is described in the schema. This imposes restrictions on the names of constraints in the catalogue, only alphanumerical names (with underscores) should be used.

Each constraint has attributes id (type ID), a name (type string) and an optional description (type string). The name and description can be used to include user-readable information about the constraint for example for debugging or explanations.

For each introduced element, a sequence of arguments is defined to define the arguments of the constraints in the same order as described in the catalogue. Each of the arguments has a specific type, which is defined in accordance with the catalogue definition. The argument names can be reused throughout the catalogue, as long as they are unique within each constraint. Arguments can have atomic values (i.e., consist of a single value), or they may be collection elements.

#### collection

Roughly, collections correspond to lists in Prolog. Collections can be empty, or must contain entries of the same type. Collections can be nested as required.

#### item

Items correspond to terms in Prolog. Items have named arguments, for which the same rules apply as for the arguments of constraints. The different arguments of an item can be of different type.