120 Views

Download Presentation
## UML Statechart semantics

- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -

**UML Statechart semantics**Speaker: Fei Mo Tutor: Priv.-Doz. Dr. Thomas Noll Lehrstuhl für Informatik 2 RWTH Aachen SS 07**Contents**• Introduction • Fundamentals • Semantik of UML Statechart • Extended Hierarchical Automata • Statechart with STATEMATE • Summary**Introduction**• formulate the semantics of UML Statechart • We show how the Extended hierarchical Automata represent statecharts • We show the Statechart in STATEMATE**Contents**• Introduction • Fundamentals • Semantik of UML Statechart • Extended Hierarchical Automata • Statechart with STATEMATE • Summary**Fundamentals**• HierarchyHumans not capable to understand systems containing more than ~5 objects. Most actual systems require more objects • Behavioral hierarchy • Structural hierarchy • Timing behavior.**Introducing hierarchy**super-state S sub-states**Contents**• Introduction • Fundamentals • Semantik of UML Statechart • Extended Hierarchical Automata • Statechart with STATEMATE • Summary**Semantik of UML Statechart**• State a condition during the life of an object or an interaction Simple State rectangle with rounded corners The name tab The action label entry exit do include**Composite State**• State Composite State**Composite states**• Composite states – concurrent substates - using -and- relationship • each substate separated from others by dotted line – disjoint substates - using -or- relationship • transitions between substates • Example of concurrent substates**Configuration**• A maximum set of states (C) that the system can be simultaneously in • C contains rootstate • If C contains OR-state A, it must contain only one of A’s substates • If C contains AND-state A, it must contain all of A’s substates • Basic configuration is a maximal set of basicstates that the system can be in simultaneously • Subconfiguration**Semantik of UML Statechart**• Event Triggers the transition Can be either internally or externally generated • Conditions: Guards the transition from being taken unless it is true when event occurs**Semantik of UML Statechart**• Transition • Simple transition a relationship between two states source state of t1 is a directly or transitively nested substate of the source state of t2 -> t1 is higher than t2 Start and end transitions**Semantik of UML Statechart**• Transition • The exact sequence of actions first: the exit actions of all states left by the transition are executed starting the deepest one in the hierarchy next: the action associated to the transition is performed finally: the entry actions of states entered by the transition starting with the highest one in the hierarchy**Semantik of UML Statechart**• Transition • Transitions to and from Concurrent States multiple source states and target states**Semantik of UML Statechart**example • s0 refined: s1, s2, and s3 composite state: s0, s1, s4 s5; concurrent state: s1 • Configurations "System states“: {s1; s6; s8}; {s2}; {s3} Transition fire: source state is in the current configuration trigger is offered by the external environment the guard is satisfied**Semantik of UML Statechart**• Initial subconfiguration {n8, n6} – b -> t6; next subconfiguration: {n5, n6}; sequence <d.e> – a -> t3, t2; {n9, n7}; <b, d>; if s8 active: no t1 (s8 lower than s4) – e ∈ Π\{a, b}, No transtion, configuration does not change**Contents**• Introduction • Fundamentals • Semantik of UML Statechart • Extended Hierarchical Automata • Statechart with STATEMATE • Summary**Extended hierarchical Automata**Definition Sequential Automaton A sequential automaton A is a 4-tuple is a finite set of states is the initial state is a finite set of transition labels (labels have a particular structure) is the transition relation**Extended hierarchical Automata**Definition Extended hierarchical Automata • An EHA consists of a set of sequential automata • An EHA is a 5-tuple • F is a finite set of sequential automaton • E is a finite set of events • V is the set of variables • ρ is refinement function**Extended hierarchical Automata**• UML Statechart example**Extended hierarchical Automata**• Extended hierarchical Automata example Extended Hierarchical Automata can represent statecharts**Extended hierarchical Automata**• the refinement function ρ; ρ(S) = {TV, USER}, ρ(OFF) = {POWER}, ρ(ON) = {IMAGE,SOUND} ρ(s) = ∅ for any other state sin EHA: dotted arrows. • Initial states: indicated by thick boxes. • Non-inter-level transitions: represented in the obvious way.**Extended hierarchical Automata**• The source restriction of transition on: STB Join transitions: a set of states • target determinator (TD) transition from ON to STB -> off 1 TD of the transition off1: {STB}; TD of the transition on: {SHW, SND}.**Contents**• Introduction • Fundamentals • Semantik of UML Statechart • Extended Hierarchical Automata • Statechart with STATEMATE • Summary**Statechart with STATEMATE**STATEMATE system structure function Action Module-charts Statecharts Activity-charts**Statechart with STATEMATE**In Conf. {S,S1,A,B,D,E} • Event a trigers a/b • Event b trigers b/c? • what with Event d?**Contents**• Introduction • Fundamentals • Semantik of UML Statechart • Extended Hierarchical Automata • Statechart with STATEMATE • Summary**UML Statechart Semantics**• Can describe the behavior of instances of a model element. • Describe sequences of states (rounded boxes) and transitions (arrows). • Can describe behavior of use cases and subsystems. • Extended Hierarchical Automata can represent statecharts • Can be used in STATEMATE to descript separated actions as a more universal design methodology**References**• [1] Unified Modeling Language Document Set. Version1. 1, Rational Software Corporation, 1997. • [2] OMG Unified Modeling Language Specification, version 2.1.1, Object Management Group, Inc., 2005. • [3] Mikk E, Lakhnech Y, Petersohn C, Siegel M. On formal semantics of Statecharts as supported by STATEMATE. In: Duke D, 1997 • [4] Evans A, eds. Proceedings of the 2nd BCS-FACS Northern Formal Methods Workshop. London: Springer-Verlag, 1997. • [5] Harel D, Naamad A. The STATEMATE semantics of statecharts[J]. ACM Transactions on Software Engineering and Methodology, 1996.