Softw Syst Model (2004) 3: 194–209 / Digital Object Identifier (DOI) 10.1007/s10270-003-0047-5 Meta-modelling and graph grammars for multi-paradigm modelling in AToM 3 Juan de Lara 1 , Hans Vangheluwe 2 , Manuel Alfonseca 1 1 Escuela Polit´ ecnica Superior, Ingenier´ ıa Inform´ atica, Universidad Aut´ onoma de Madrid, 28049 Madrid, Spain 2 School of Computer Science, McGill University, 3480 University Street, H2A 2A7 Montr´ eal, Qu´ ebec, Canada Received: 30 January 2003/Accepted: 13 October 2003 Published online: 1 April 2004 – Springer-Verlag 2004 Abstract. This paper presents the combined use of meta-modelling and graph grammars for the generation of visual modelling tools for simulation formalisms. In meta-modelling, formalisms are described at a meta- level. This information is used by a meta-model processor to generate modelling tools for the described formalisms. We combine meta-modelling with graph grammars to extend the model manipulation capabilities of the gen- erated modelling tools: edit, simulate, transform into another formalism, optimize and generate code. We store all (meta-)models as graphs, and thus, express model ma- nipulations as graph grammars. We present the design and implementation of these concepts in AToM 3 (A To ol for M ulti-formalism, M eta- M odelling). AToM 3 supports modelling of complex sys- tems using different formalisms, all meta-modelled in their own right. Models in different formalisms may be transformed into a single common formalism for fur- ther processing. These transformations are specified by graph grammars. Mosterman and Vangheluwe [18] in- troduced the term multi-paradigm modelling to denote the combination of multiple formalisms, multiple ab- straction levels, and meta-modelling. As an example of multi-paradigm modelling we present a meta-model for the Object-Oriented Continuous Simulation Language OOCSMP, in which we combine ideas from UML class diagrams (to express the OOCSMP model structure), Causal Block Diagrams (CBDs), and Statecharts (to specify the methods of the OOCSMP classes). A graph grammar is able to generate OOCSMP code, and then a compiler for this language (C-OOL) generates Java ap- plets for the simulation execution. Keywords: Meta-modelling – Multi-formalism – Multi- paradigm modelling – Graph grammars – Model trans- This is a revised and extended version of a paper presented at the GT-VMT’02 workshop, see [10] formation – Code generation – Causal block diagrams – Statecharts – AToM 3 – OOCSMP 1 Introduction Complex systems are characterized by components and aspects whose structure as well as behaviour cannot be described in a single formalism (due to their different na- ture). For example, if we wish to model a temperature and level controlled vessel, the controller can be described with a discrete formalism (such as Petri-Nets or State- charts [15]) whereas the behaviour of the liquid (which de- scribes the variation in volume and temperature) should be described using a continuous formalism (such as Ordi- nary Differential Equations or CBDs). One of the approaches to tackle complex systems is multi-formalism modelling. In this approach the differ- ent parts of the system are modelled using different for- malisms. In order to analyze a multi-formalism system, it is not enough to look at each component in isolation. One must consider the whole system. For this reason, multi- formalism modelling attempts to convert all components into a common formalism which is closed under composi- tion, so that the whole system can be properly analyzed or simulated. In order to make the multi-formalism approach pos- sible, we still have to solve the problem of dealing with a plethora of different formalisms. One would like to ded- icated tools to model in each one of these formalisms, but the cost of building such tools from scratch is pro- hibitive. Meta-Modelling is useful to deal with this prob- lem, as it allows the (possibly graphical) modelling of the formalisms themselves. A model of a formalism should contain enough information to permit the automatic gen- eration of a tool to check and build models subject to