Modeling the Dynamics of UML State Machines Egon B¨ orger 1 , Alessandra Cavarra 2 , and Elvinia Riccobene 2 1 Dipartimento di Informatica - Universit`a di Pisa - C.so Italia, 40 - 50125 Pisa boerger@di.unipi.it (currently visiting Microsoft Research, Redmond) 2 Dipartimento di Matematica e Informatica - Universit`a di Catania - V.le A. Doria, 6 - 95125 Catania {cavarra, riccobene}@dmi.unict.it Abstract. We define the dynamic semantics of UML State Machines which integrate statecharts with the UML object model. The use of ASMs allows us (a) to rigorously model the event driven run to com- pletion scheme, including the sequential execution of entry/exit actions (along the structure of state nesting) and the concurrent execution of internal activities; (b) to formalize the object interaction, by combining control and data flow features in a seamless way; and (c) to provide a precise but nevertheless provably most general computational meaning to the UML terms of atomic and durative actions/activities. We borrow some features from the rigorous description of UML Activity Diagrams by ASMs in [7]. 1 Introduction The Unified Modeling Language [2, 5, 20] is a standardized notation based on a set of diagrams to describe the structure and the behavior of a software system. In [5] it is stated that “UML is more than just a graphical language. Rather, behind every part of its graphical notation there is a specification that provides a textual statement of the syntax and semantics of that building block” although the official document [4] for the UML semantics only gives an unambiguous textual definition of the syntax for UML notations and leaves the behavioral content of various UML constructs largely open. The necessity to develop the UML as a precise (i.e. well defined) modeling language is widely felt [10, 9, 19] and the pUML (precise UML) group has been created to achieve this goal [18]. In this paper we analyze one of the principal diagram types which are used in UML for the description of dynamical system behavior, namely statechart or state diagrams, and provide a rigorous definition of their dynamics. Many papers on the semantics of statecharts [16, 21, 11, 17] exist in the literature, in particular in relation to their implementation in STATEMATE [15] and RHAPSODY [14]. Nevertheless, the debate is still ongoing on what exactly should be considered as the authoritative definition of UML State Machines which integrate statecharts with the UML object model. One major difficulty here concerns the mechanisms for object interaction [14, 19]. ASMs [1,12] provide a technique to solve such specification problems and to clarify the relevant issues. In this paper, we propose an ASM model that (a)