– 19 – 2015-01-29 – main –
Software Design, Modelling and Analysis in UML
Lecture 19: Hierarchical State Machines III
2015-01-29
- Prof. Dr. Andreas Podelski, Dr. Bernd Westphal
Albert-Ludwigs-Universit¨ at Freiburg, Germany
Lecture 19: Hierarchical State Machines III 2015-01-29 Prof. Dr. - - PowerPoint PPT Presentation
Software Design, Modelling and Analysis in UML Lecture 19: Hierarchical State Machines III 2015-01-29 Prof. Dr. Andreas Podelski, Dr. Bernd Westphal 19 2015-01-29 main Albert-Ludwigs-Universit at Freiburg, Germany Contents
– 19 – 2015-01-29 – main –
Albert-Ludwigs-Universit¨ at Freiburg, Germany
– 19 – 2015-01-29 – Sprelim –
2/28
inject this event?
(formalisation follows [Damm et al., 2003])
– 19 – 2015-01-29 – main –
3/28
– 19 – 2015-01-29 – Shierstm –
4/28
– 18 – 2015-01-22 – Shierstm –
14/30
1
2
3
1
2
3
– 19 – 2015-01-29 – Shierstm –
5/28
– 18 – 2015-01-22 – Shierstm –
15/30
1
2
3
1
2
3
– 19 – 2015-01-29 – Shierstm –
6/28
– 18 – 2015-01-22 – Shierstm –
16/30
∃ s, region(s) = {S1, . . . , Sn} ∃ 1 ≤ i = j ≤ n : s1 ∈ child ∗(Si)∧s2 ∈ child ∗(Sj),
1
2
3
1
2
3
– 19 – 2015-01-29 – Shierstm –
7/28
– 18 – 2015-01-22 – Shierstm –
17/30
1
2
3
1
2
3
– 19 – 2015-01-29 – Shierstm –
8/28
– 18 – 2015-01-22 – Shierstm –
18/30
(i) source and destination are consistent, i.e. ↓ source(t) and ↓ target(t), (ii) source (and destination) states are pairwise orthogonal, i.e.
(iii) the top state is neither source nor destination, i.e.
∈ source(t) ∪ source(t).
s2
s8 s4
s6
E/ F/ F/ E/ G/
s7 [true]/ F/
– 19 – 2015-01-29 – Shierstm –
9/28
s2
s8 s4
s6
E/ F/ F/ E/ G/
s7 [true]/ F/
– 19 – 2015-01-29 – Shierstm –
10/28
– 19 – 2015-01-29 – Shierstm –
10/28
– 19 – 2015-01-29 – Shierstm –
11/28
(cons,Snd)
– 19 – 2015-01-29 – main –
12/28
– 19 – 2015-01-29 – Shist –
13/28
susp
act
H H∗
s2 s3 sb
s5
E/ B/ C/ D/ F/ Rs/ Rd/ A/ S/ Rs/ Rd/
What happens on...
s0, s2
s0, s2
s0, s1, s2, s3, susp, s3
s0, s1, s2, s3, susp, s3
s0, s1, s2, s3, s4, s5, susp, s3
s0, s1, s2, s3, s4, s5, susp, s5
– 19 – 2015-01-29 – Shist –
14/28
g d
1
] / a c t
1
[ g d
2
] / a c t
2
– 19 – 2015-01-29 – Shist –
14/28
g d
1
] / a c t
1
[ g d
2
] / a c t
2
– 19 – 2015-01-29 – Shist –
15/28
– 19 – 2015-01-29 – Shist –
15/28
– 19 – 2015-01-29 – main –
16/28
– 19 – 2015-01-29 – Sdefer –
17/28
E/ F/
– 19 – 2015-01-29 – Sdefer –
18/28
ether (= extend ε) or into the local state of the object (= extend σ))
[Fecher and Sch¨
Hierarchical State Machine language, including deferred events.
– 19 – 2015-01-29 – main –
19/28
– 19 – 2015-01-29 – Smethods –
20/28
ξ1 f(τ1,1, . . . , τ1,n1) : τ1 P1 ξ2 F(τ2,1, . . . , τ2,n2) : τ2 P2
E
Note: The signal list can be seen as redundant (can be looked up in the state machine) of the class. But: certainly useful for documentation (or sanity check).
– 19 – 2015-01-29 – Smethods –
21/28 C
ξ1 f(τ1,1, . . . , τ1,n1) : τ1 P1 ξ2 F(τ2,1, . . . , τ2,n2) : τ2 P2
E
In our setting, we simply assume a transformer like Tf. It is then, e.g. clear how to admit method calls as actions on transitions: function composition of transformers (clear but tedious: non-termination). In a setting with Java as action language: operation is a method body.
creates an auxiliary event F and dispatches it (bypassing the ether).
– 19 – 2015-01-29 – Smethods –
22/28
C
ξ1 f(τ1,1, . . . , τ1,n1) : τ1 P1 ξ2 F(τ2,1, . . . , τ2,n2) : τ2 P2
E
a well-typed action sequence only calls visible methods.
around state machines. Yet we could explain pre/post in OCL (if we wanted to).
– 19 – 2015-01-29 – main –
23/28
– 19 – 2015-01-29 – Ssemvar –
24/28
can then “be” in enclosing state without being in any substate; or assume one
by considering the order in which things have been added to the CASE tool’s repository, or graphical order
(i.e. there are pictures that mean the same thing to all three communities)
(i.e. for each pair of communities exist pictures meaning different things)
– 19 – 2015-01-29 – main –
25/28
– 19 – 2015-01-29 – main –
26/28
N S W E
CD, SM S = (T, C, V, atr ), SM M = (ΣD
S , AS , →SM )
ϕ ∈ OCL expr CD, SD S , SD B = (QSD, q0, AS , →SD, FSD) π = (σ0, ε0)
(cons0,Snd0)
− − − − − − − − →
u0
(σ1, ε1)· · · wπ = ((σi, consi, Sndi))i∈N G = (N, E, f)
OD
– 19 – 2015-01-29 – main –
27/28
– 19 – 2015-01-29 – main –
28/28
[Crane and Dingel, 2007] Crane, M. L. and Dingel, J. (2007). UML vs. classical vs. rhapsody statecharts: not all models are created equal. Software and Systems Modeling, 6(4):415–435. [Damm et al., 2003] Damm, W., Josko, B., Votintseva, A., and Pnueli, A. (2003). A formal semantics for a UML kernel language 1.2. IST/33522/WP 1.1/D1.1.2-Part1, Version 1.2. [Fecher and Sch¨
machines: Complete formal semantics via core state machines. In Brim, L., Haverkort, B. R., Leucker, M., and van de Pol, J., editors, FMICS/PDMC, volume 4346 of LNCS, pages 244–260. Springer. [Harel and Kugler, 2004] Harel, D. and Kugler, H. (2004). The rhapsody semantics
and Westk¨ amper, E., editors, Integration of Software Specification Techniques for Applications in Engineering, number 3147 in LNCS, pages 325–354. Springer-Verlag. [OMG, 2007] OMG (2007). Unified modeling language: Superstructure, version 2.1.2. Technical Report formal/07-11-02.