2.1.9. Containment Constraint

[Tip]Description

A containment constraint is defined in the scope of a variable. It restricts the domain of a variable with respect to the containment hierarchy of the model space.

[Important]Syntax
ContainmentConstraintOptAST ::= $empty 
	                            | in ArithmeticTermAST
	                            | below ArithmeticTermAST

The container in a containment constraint is an arithmetic term which evaluates to an entity.

[Note]Semantics

In case of the in constraint, the domain of the constrained variable is restricted to the elements that are directly contained by the container, i.e. the domain contains the children of the entity defined by the container.

In case of the below constraint the domain of the constrained variable is restricted to the elements that are directly or indirectly contained by a container, i.e. the domain contains all the descendants of the container (e.g. the children, the children of the children, etc. in an arbitrary depth).

[Caution]Constraints

A containment constraint can be applied only for variables that refer to entities, but it is a run-time error if the scope of the containment constraint is a relation.

Used By:  constrained variable list, entity

See Also:  variable pattern variable