section: < previous | next > | | | |
chapter: << previous | next >> |
OCL Constraints
To restrict the set of instances of the VOCL meta model there have been defined nearly 100 OCL constraints. The following three just give an example of them:
1. ArithmExpThe types of the arguments belonging to the ArithmExp have to be equal: |
2. BooleanExpThe arguments are VOCL expressions of the same constraint: |
3. Path
The ClassifierRoles respectively the CollectionRoles, that are referenced by AssociationRoles or AssociationClassRoles in a Path, have to be nodes of this Path:
context Path inv:
self.arnode->forall(a:AssociationRole|
a.start.participant.path=self and a.end.participant.path=self) and
self.arnode->select(ar:AssociationRole|
ar.oclIsTypeOf(AssociationClassRole))->forall(a:AssociationClassRole|
a.referredClassifierRole.path=self)
The constraints together with the meta model define the language VOCL. Alternatively there is a formal definition with the graph grammar approach. Just select it on the top left navigation.
section: < previous | next > | | | |
chapter: << previous | next >> |