Constraints

Composition

User Interface

MetaGME: Static Semantics

The metamodels fully specify the domain modeling language, or more precisely, its concrete syntax. They do not, at least not entirely, specify the static semantics of the language. By static semantics we mean the set of rules that specify the well-formedness of domain models. UML class diagrams do allow the specification of some basic rules, for example, the multiplicity of associations. For more complex semantic specifications, however, UML includes the Object Constraint Language (OCL), a textual predicate logic language. MIC adopts OCL as well; metamodels consist of UML class diagrams and OCL constraints.

Consider the example depicted in the figure on the MetaGME homepage. Suppose the finite state machines in the target domain must not allow state transitions from a state to itself. A UML class diagram alone cannot specify such a rule. Rather, the following OCL expression must be attached to States:


        self.transTo->forAll(s | s <> self)
where self and forAll are OCL keywords, while transTo is a role name of the Transition association. These constraints are relatively straightforward to check programmatically. The expressions need to be evaluated in the context of every applicable model object. Notice that this problem is quite different from the well-known constraint satisfiability problem. Its time-complexity is polynomial in the number of model objects.