Simplifying Transformations of OCL Constraints Martin Giese 1 and Daniel Larsson 2 1 Johann Radon Institute for Computational and Applied Mathematics Altenbergerstr. 69, A-4040 Linz, Austria martin.giese@oeaw.ac.at 2 Chalmers University of Technology Department of Computer Science and Engineering S-412 96 Gothenburg, Sweden danla@cs.chalmers.se Abstract. With the advent of Model Driven Architecture, OCL con- straints are no longer necessarily written by humans. They can be part of models that emerge from a chain of transformations. They might be the result of instantiating templates, of combining prefabricated parts, or of more general computation. Such generated specifications will of- ten contain redundancies that reduce their readability. In this paper, we explore the possibilities of transforming OCL formulae to a simpler form through the repeated application of simple rules. We discuss the different kinds of rules that are needed, and we describe a prototypical implementation of the approach. 1 Introduction The Object Constraint Language (OCL) [12] is designed with human authors and readers in mind. While some of today’s UML tools allow attaching OCL con- straints to diagrams and checking their syntax with a parser, there is practically no support for authoring OCL specifications. But writing good specifications is hard, and as the software to be specified becomes larger and more complex, designers will need tools that help them with that task. OCL constraints might result from a transformation of a more abstract de- scription of the system. For instance, constraints written at the analysis level might be transformed into design level constraints by some tool. Or a specifica- tion in some other graphical or logic-based formalism might be translated into OCL. While tools performing such tasks have yet to be written, we already en- counter tool-generated constraints in connection with an extension of the ‘design pattern’ instantiation mechanism provided by various case tools [2]. 3 The idea is to let the user instantiate templates, pieces of class diagrams, which provide implementations for various design patterns. As part of the instantiation, one 3 In the present work we employ Borland Together ControlCenter (TCC), see http://www.borland.com/together/index.html.