Abstract
The Object Constraint Language (OCL) serves the expression of complex conditions and queries over UML-based models in an object-oriented style. We note that OCL’s grounding in object-orientation leads to a number of issues, including subtle inconsistencies and unsafe navigation. To address these issues, we present OCL♯, a new formal foundation for OCL with borrowings from Alloy. We provide OCL♯’s syntax and semantics, prove type safety, and present a prototype implementation.