Modeling OCL Collection Types and Type Casting Using Constraint Programming
In Model-Driven Engineering (MDE), the Unified Modeling Language (UML) is often combined with the Object Constraint Language (OCL) to express constraints on models. While these constraints are typically used for validation, certain tasks-such as model search, completion, repair, or exploration–require the automatic generation of models that satisfy them. Due to the combinatorial nature of these tasks, even small models can lead to computationally complex problems. Constraint Programming (CP) offers a powerful paradigm for modeling and solving such combinatorial challenges, notably through the use of global constraints, which enable concise models supported by efficient algorithms. Although previous approaches have tackled model search using tools like Alloy or ATLc, they often rely on simplified subsets or avoid the use of global constraints. In this paper, we extend the ATLc approach by leveraging CP to the expressiveness and coverage of UML/OCL. We introduce a CP model for representing UML instances and evaluating queries, along with global constraint formulations for UML collection types (Sequence, Bag, Set, OrderedSet) and their corresponding OCL type casting operations (asSequence, asBag, asSet and asOrderedSet). Finally we provide an implementation allowing us to test our model for this subset of OCL and compare with related work.
Authors
- Samir Loudni (ORCID: https://orcid.org/0000-0001-6245-7661)
- Massimo Tisi (ORCID: https://orcid.org/0000-0001-7891-9138)
- Théo Le Calvar (ORCID: https://orcid.org/0000-0003-2273-2053)
- Matthew Coyle
Institutions
- Centre National de la Recherche Scientifique (FR)
- Laboratoire des Sciences du Numérique de Nantes (FR)
- IMT Atlantique (FR)
Publication Details
- Published
- 2025-11-03
- DOI
- https://doi.org/10.1109/ictai66417.2025.00206
- Primary Topic
- Model-Driven Software Engineering Techniques
- Type
- article
- Field-Weighted Citation Impact
- 0.00