A Metamodel for OCL

The Object Constraint Language (OCL) allows the extension of UML models with constraints in a formal way. While the UML itself is defined by following a metamodeling approach, there is currently no equivalent definition for the OCL. We propose a metamodel for OCL that fills this gap. The benefit of a metamodel for OCL is that it precisely defines the syntax of all OCL concepts like types, expressions, and values in an abstract way and by means of UML features. Thus, all legal OCL expressions can be systematically derived and instantiated from the metamodel. We also show that our metamodel smoothly integrates with the UML metamodel. The focus of this work lies on the syntax of OCL; the metamodel does not include a definition of the semantics of constraints.