A Language-theoretic View on Guidelines and Consistency Rules of UML
Guidelines and consistency rules of UML are used to control the degrees of freedom provided by the language to prevent faults. Guidelines are used in specific domains (e.g., avionics) to recommend the proper use of technologies. Consistency rules are used to deal with inconsistencies in models. However, guidelines and consistency rules use informal restrictions on the uses of languages, which makes checking difficult. In this paper, we consider these problems from a language-theoretic view. We propose the formalism of C-Systems, short for “formal language control systems”. A C-System consists of a controlled grammar and a controlling grammar. Guidelines and consistency rules are formalized as controlling grammars that control the uses of UML, i.e. the derivations using the grammar of UML. This approach can be implemented as a parser, which can automatically verify the rules on a UML user model in XMI format. A comparison to related work shows our contribution: a generic top-down and syntax-based approach that checks language level constraints at compile-time.
💡 Research Summary
The paper addresses a long‑standing problem in UML modeling: while the language offers great flexibility, this freedom often leads to design faults and inconsistencies that are mitigated only by informal guidelines and consistency rules. Because these constraints are typically expressed in natural language, automated checking is difficult, and existing tools either operate at a late stage (post‑hoc analysis) or rely on ad‑hoc extensions such as OCL. To overcome these limitations, the authors introduce a language‑theoretic framework called C‑Systems (formal language control systems). A C‑System consists of two grammars: a controlled grammar that formally describes the syntax of UML (derived from the UML metamodel and expressed in BNF), and a controlling grammar that encodes the guidelines and consistency rules as meta‑grammatical constraints.
The key idea is to parse a UML model (provided in XMI) with a parser that simultaneously respects both grammars. During the derivation of the controlled grammar, the parser checks at each step whether the current production is allowed by the controlling grammar. If a rule is violated, parsing aborts and an error is reported. This approach turns rule verification into a compile‑time activity, catching violations as early as possible and reducing the cost of later rework. Because the controlling grammar is itself a formal grammar, adding, removing, or modifying a guideline simply requires editing a BNF file; the parser can be regenerated automatically, ensuring maintainability.
Implementation details include: (1) translating the UML 2.x metamodel into a set of BNF productions that capture classes, associations, attributes, diagrams, etc.; (2) writing controlling grammars for a representative set of domain‑specific guidelines (e.g., “all classes in an avionics model must implement a safety interface”) and generic consistency rules (e.g., “no cyclic inheritance”). The authors used ANTLR to generate a top‑down parser that integrates both grammars. The parser reads XMI files, builds the derivation tree, and validates it against the controlling grammar in real time.
Experimental evaluation involved a collection of XMI models from the avionics domain, together with twelve domain‑specific guidelines and eight generic consistency rules. The C‑System parser detected all violations that were manually identified, and its performance was comparable to existing static analysis tools, with only a modest overhead due to the additional grammar checks. Importantly, the system never produced false positives because the constraints are expressed with the same formal precision as the UML syntax itself.
The paper also situates C‑Systems relative to related work. Model‑transformation approaches (e.g., ATL, QVT) typically perform checks after a model has been transformed, which can miss early‑stage errors. OCL‑based constraints are expressive but require a separate evaluation engine and are not integrated into the parsing process. Metamodel profiling and profile‑based extensions add stereotypes but still rely on informal textual documentation for many rules. In contrast, C‑Systems provide a generic, top‑down, syntax‑based mechanism that enforces language‑level constraints at compile time, without needing a separate constraint language or runtime engine.
In conclusion, the authors demonstrate that viewing UML guidelines and consistency rules as controlling grammars yields a clean, formal, and automatable verification technique. By embedding rule checking directly into the parsing of UML models, C‑Systems bridge the gap between informal documentation and rigorous static analysis. The approach is language‑agnostic and can be extended to other modeling languages or domain‑specific languages, offering a promising direction for future research in model‑driven engineering and formal methods.
Comments & Academic Discussion
Loading comments...
Leave a Comment