Recent Developments in OCL and Textual Modelling

Achim D. Brucker, Jordi Cabot, Gwendal Daniel, Martin Gogolla, Adolfo Sánchez-Barbudo Herrera, Frank Hilken, Frédéric Tuong, Edward D. Willink, Burkhart Wolff

Introduction

The Object Constraint Language (OCL) has served as the standard for specifying rules and constraints in software models for nearly two decades. However, as software engineering moves toward more complex formal verification, large-scale model transformations, and NoSQL data architectures, the OCL standard faces new challenges. This paper summarizes five key advancements presented at the 16th OCL Workshop, representing the "state of the union" for the OCL community. These developments address critical gaps in formal verification, transformation complexity, tool fragmentation, and modern data needs.

Formal Verification and HOL-OCL 2.0

One of the primary hurdles for OCL has been the lack of robust, machine-checked environments for proving the correctness of specifications. HOL-OCL 2.0 addresses this by providing a complete rewrite of a formal proof environment built on top of the Isabelle/HOL theorem prover.

The HOL-OCL 2.0 environment integrated with Isabelle/HOL.

By using a "closed-world" data model and supporting four-valued logic, HOL-OCL 2.0 allows researchers to perform interactive proofs for complex properties, such as invariant satisfiability. This ensures that a system can actually exist that satisfies all written rules. The tool is now capable of automatically proving type-cast properties and handling unbounded data types like mathematical integers and reals, bridging the gap between abstract modeling and formal logic.

Simplifying Model Transformations

Navigating between source and target models during complex transformations often introduces side effects or requires cumbersome manual coding of reverse paths. The introduction of "Opposite Navigation" for QVT (Query/View/Transformation) languages offers an elegant solution. This technique allows OCL to automatically synthesize reverse navigation paths, even when the underlying UML model only specifies a one-way relationship.

A diagram illustrating bidirectional navigation paths in model transformations.

By synthesizing these "opposites," OCL provides a foundation for side-effect-free transformations that are significantly easier to reason about. This approach ignores "accidental" unidirectionality, allowing developers to query models more flexibly and ensuring that trace-based mappings remain consistent across forward and reverse operations.

Addressing Determinism and Tool Fragmentation

A subtle but critical issue in the current OCL standard is the non-deterministic behavior of collection operations. Currently, different OCL tools might convert the same unordered Set into different ordered Sequences, leading to inconsistent results in testing and verification. To solve this "determinism crisis," researchers propose adding "restricting equations" to the OCL standard. These mathematical constraints would force deterministic behavior, ensuring that COL->convert() always yields the same result across different engines.

Furthermore, the OCL community is tackling tool fragmentation through the establishment of a centralized OCL Repository on GitHub. Unlike previous ambitious but broad modeling repositories, this project focuses strictly on OCL-related benchmarks, including UML class diagrams and their accompanying OCL expressions. This centralized home provides a standardized basis for evaluating and comparing the performance and correctness of different OCL tools.

OCL in the NoSQL Era

As data storage shifts toward "schemaless" NoSQL databases, OCL must adapt to remain relevant. The UMLtoGraphDB framework demonstrates this adaptation by mapping UML/OCL schemas to graph databases and translating OCL invariants into Gremlin queries. This model-to-model transformation pipeline allows for high-volume integrity checking. Initial results show that delegating OCL computation directly to a graph database engine is significantly more efficient than using traditional modeling framework APIs, proving that OCL can offer superior integrity checking compared to native NoSQL tools.

Conclusion

While OCL is a mature language, it is far from static. The advancements in formal verification, deterministic collections, and NoSQL integration demonstrate its continued relevance in modern software engineering. However, the path forward requires community-driven efforts to mature benchmarking repositories and navigate the bureaucratic processes of official standard evolution. By addressing these modern hurdles, OCL remains a vital tool for ensuring the reliability and integrity of complex software systems.

Summary updated

BibTeX
@inproceedings{brucker2016recent,
  author = {Achim D. Brucker and Jordi Cabot and Gwendal Daniel and Martin Gogolla and Adolfo Sánchez-Barbudo Herrera and Frank Hilken and Frédéric Tuong and Edward D. Willink and Burkhart Wolff},
  title = {{Recent Developments in OCL and Textual Modelling}},
  booktitle = {OCL@MoDELS},
  year = {2016},
  url = {https://openreview.net/forum?id=nyTvZh18wJ},
}
Figure