section: < previous | next > | | | |
chapter: << previous | next >> |
3.2 The Boolean expression "and" Two expressions put next to each other define implicitly an "and" expression. Intuitively all expressions have to be fulfilled, if there is more than one on the same level, so VOCL just uses this intuition for an easy version of the "and" expression.
The example in figure 3.3 describes as before in figure 3.2, that the spouse of a person has to be at least 18 years old, but this time the navigation to the attribute has only to be done, if there is a spouse of the considered person. The corresponding OCL text is: context Person inv: self.wife->notEmpty() implies self.wife.age >= 18 and self.husband->notEmpty() implies self.husband.age >= 18 |
|
||
3.2 The Boolean expression "not" The negation of a VOCL expression holds in context of an invariant, if there is no configuration which fulfils this inner expression. Graphically there is a box around the expression, which has to be negated and on top of the box is placed the label "not". The example in figure 3.4 describes, that a manager of a company is not allowed to be married. The corresponding OCL text is: context Company inv: not (self.manager.isMarried) |
|
section: < previous | next > | | | |
chapter: << previous | next >> |