Note that IDL only lets us specify the syntactic interface of the component. An OCL specification of a stack. Some languages are considered pure expression specification languages. These languages are not meant to be used to denote the operational semantics of an entity. Instead, they specify predicates on the state of an entity.
Some languages provide direct support for such constructs.
These are examples of expression specification constructs. Figure 3 is an example of a OCL specification of our stack. Note that OCL lets us specify both the interface of the component and the externally observable side-effects of each method. OCL does not let the designer specify implementation details, such as how the size attribute is manipulated. Contrast this with the Object-Z specification of the same stack in Figure 4 .