Developing the UML as a Formal Modelling Notation
The Unified Modeling Language (UML) is rapidly emerging as a de-facto standard for modelling OO systems. Given this role, it is imperative that the UML have a well- defined, fully explored semantics. Such semantics is required in order to ensure that UML concepts are precisely stated and defined. In this paper we describe and motivate an approach to formalizing UML in which formal specification techniques are used to gain insight into the semantics of UML notations and diagrams. We present work carried out by the Precise UML (PUML) group on the development of a precise semantic model for UML class diagrams. The semantic model is used as the basis for a set of diagrammatical transformation rules, which enable formal deductions to be made about UML class diagrams. It is also shown how these rules can be used to verify whether one class diagram is a valid refinement (design) of another. Because these rules are presented at the diagrammatical level, it will be argued that UML can be successfully used as a formal modelling tool without the notational complexities that are commonly found in formal specification techniques.
💡 Research Summary
The paper addresses a critical gap in the widespread use of the Unified Modeling Language (UML) as a de‑facto standard for object‑oriented system modeling: the lack of a rigorously defined semantics. While UML’s visual notations are highly expressive, their informal nature leads to ambiguities that hinder precise reasoning, tool interoperability, and formal verification. To remedy this, the authors present an approach that leverages formal specification techniques—specifically set‑theoretic and relational foundations—to construct a precise semantic model for UML class diagrams, and then build a suite of diagrammatic transformation rules that enable formal deductions directly on the diagrams themselves.
The first major contribution is the development of a formal meta‑model for UML class diagrams. Using the Z notation as a vehicle, the authors map each UML construct—classes, attributes, associations, generalizations, multiplicities, and constraints—onto mathematical entities such as sets, functions, binary relations, and predicates. For instance, a class becomes a tuple (Name, AttributeSet, InheritanceSet), an association is represented as a relation between two class sets, and inheritance is captured as a partial order on the class set. Constraints that are normally expressed in OCL are re‑expressed as first‑order logical formulas over these structures, ensuring that the semantics are unambiguous and machine‑checkable.
Building on this semantic foundation, the paper introduces a collection of diagrammatic transformation rules. Each rule follows a “pattern‑to‑pattern” schema: if a certain sub‑diagram matching a pre‑condition exists, it may be replaced by an equivalent sub‑diagram satisfying a post‑condition, without altering the underlying meaning. Examples include transitive association introduction, attribute inheritance propagation, and association multiplicity refinement. Crucially, the applicability and soundness of each rule are proved against the formal semantic model, guaranteeing that any transformation preserves the intended interpretation of the original diagram.
A third, equally important, contribution is the formalization of refinement (or design‑step) verification. In model‑driven development, a later, more detailed diagram should be a refinement of an earlier abstract diagram. The authors define refinement as a relation where the refined diagram satisfies all constraints of the abstract diagram and possibly adds new, consistent constraints. Using the transformation rules, they devise a systematic procedure to test refinement: by attempting to derive the abstract diagram from the refined one through a series of inverse transformations, or by checking that the refined diagram’s semantic interpretation is a subset of the abstract diagram’s interpretation. This provides a mechanistic way to certify that a design step does not violate earlier requirements.
The paper validates the approach through a case study conducted by the Precise UML (PUML) group. In a realistic software design project, the team started with a high‑level class diagram derived from requirements, then incrementally refined it into a detailed design diagram. At each refinement stage, the transformation rules were applied to detect inconsistencies, such as missing associations or contradictory multiplicities. The formal refinement checks successfully identified a subtle violation where a subclass introduced an attribute that conflicted with a superclass constraint, prompting an immediate correction. Moreover, the authors demonstrate that the formal semantic model can be linked to automated tooling, enabling model checkers to perform the rule applications and refinement checks without manual proof effort.
In conclusion, the authors argue that UML can serve as a fully fledged formal modeling language without inheriting the syntactic complexity typical of traditional formal methods. By grounding UML class diagrams in a mathematically precise meta‑model and providing diagram‑level transformation and refinement rules, they enable developers to reason about models, verify design steps, and maintain consistency using the familiar visual notation. This bridges the gap between the accessibility of UML and the rigor of formal specification, offering a pragmatic pathway for industry practitioners to adopt model‑driven engineering with confidence in the correctness of their designs.
Comments & Academic Discussion
Loading comments...
Leave a Comment