SLIDE 1 Theoretical Foundations of the UML
Lecture 14: Realising Local-Choice MSGs Joost-Pieter Katoen
Lehrstuhl für Informatik 2 Software Modeling and Verification Group
moves.rwth-aachen.de/teaching/ss-20/fuml/
June 9, 2020
Joost-Pieter Katoen Theoretical Foundations of the UML 1/14
Theoretical Foundations of the UML Lecture 14: Realising - - PowerPoint PPT Presentation
Theoretical Foundations of the UML Lecture 14: Realising - - PowerPoint PPT Presentation
Theoretical Foundations of the UML Lecture 14: Realising Local-Choice MSGs Joost-Pieter Katoen Lehrstuhl fr Informatik 2 Software Modeling and Verification Group moves.rwth-aachen.de/teaching/ss-20/fuml/ June 9, 2020 Joost-Pieter Katoen
SLIDE 2 Outline
1
Introduction
2
Local Choice MSGs
3
A Realisation Algorithm for MSGs
Joost-Pieter Katoen Theoretical Foundations of the UML 2/14
SLIDE 3 Overview
1
Introduction
2
Local Choice MSGs
3
A Realisation Algorithm for MSGs
Joost-Pieter Katoen Theoretical Foundations of the UML 3/14
SLIDE 4 Today’s topic
Today’s lecture
An algorithm to realise local-choice MSGs using CFMs with synchronisation messages.
Results:
1 An algorithm that generates a CFM from local-choice MSGs. Joost-Pieter Katoen Theoretical Foundations of the UML 4/14
SLIDE 5 Overview
1
Introduction
2
Local Choice MSGs
3
A Realisation Algorithm for MSGs
Joost-Pieter Katoen Theoretical Foundations of the UML 5/14
SLIDE 6 Non-local choice
p q a
msc
p q b
msc
G: v1 v2 Inconsistency if process p behaves according to vertex v1 and process q behaves according to vertex v2 = ⇒ realisation by a CFM may yield a deadlock
Problem:
Subsequent behavior in G is determined by distinct processes. When several processes independently decide to initiate behavior, they might start executing different successor MSCs (= vertices). This is called a non-local choice.
Joost-Pieter Katoen Theoretical Foundations of the UML 6/14
SLIDE 7 Local choice property
Definition (Local choice)
Let MSG G = (V, →, v0, F, λ). MSG G is local choice if for every branching vertex v ∈ V it holds: ∃process p.
- ∀π ∈ Paths(v). | min(π′)| = 1 ∧ min(π′) ⊆ Ep
- where for π = vv1v2 . . . vn we have π′ = v1v2 . . . vn.
- U
①
✓
itzevw To '=W\
. @ t p SLIDE 8 Local choice property
Definition (Local choice)
Let MSG G = (V, →, v0, F, λ). MSG G is local choice if for every branching vertex v ∈ V it holds: ∃process p.
- ∀π ∈ Paths(v). | min(π′)| = 1 ∧ min(π′) ⊆ Ep
- where for π = vv1v2 . . . vn we have π′ = v1v2 . . . vn.
SLIDE 9 Overview
1
Introduction
2
Local Choice MSGs
3
A Realisation Algorithm for MSGs
Joost-Pieter Katoen Theoretical Foundations of the UML 8/14
SLIDE 10 Local choice MSGs
An example local-choice MSG on black board.
Joost-Pieter Katoen Theoretical Foundations of the UML 9/14
SLIDE 11 I 2
3
MSG
Vo- 7
ton
. I 2 3 n 2 3 Y Vzb
.t
Vs I 2 3D-
SLIDE 12 Realising local choice (C)MSGs
Theorem
[Genest et al., 2005]
Any local-choice MSG G is safely realisable by a CFM with synchronisation data (which is of size linear in G).
Proof
As MSG G is local choice, at every branch v of G there is a unique process, p(v), say, such that on every path from v the unique minimal event occur at p(v). Then:
1 Process p(v) determines the successor vertex of v. 2 Process p(v) informs all other processes about its decision by
adding synchronisation data to the exchanged messages.
3 Synchronisation data is the successor vertex (in G) from v chosen
by p(v).
Joost-Pieter Katoen Theoretical Foundations of the UML 10/14
SLIDE 13 Structure of the CFM of local choice MSG G
Let MSG G = (V, →, v0, F, λ) be local choice. Define the CFM AG = (((Sp, ∆p))p∈P, D, sinit, F ′) with:
1 Local automaton Ap = (Sp, ∆p) as defined on next slides Joost-Pieter Katoen Theoretical Foundations of the UML 11/14 I
✓
pairs
( y
E )
[
downward
.
- closed
SLIDE 14 Structure of the CFM of local choice MSG G
Let MSG G = (V, →, v0, F, λ) be local choice. Define the CFM AG = (((Sp, ∆p))p∈P, D, sinit, F ′) with:
1 Local automaton Ap = (Sp, ∆p) as defined on next slides 2 D = V
synchronisation data = vertices in the MSG
3 sinit = { (v0, ∅) }n where n = |P|
each local automaton Ap starts in initial state (v0, ∅), i.e., in initial vertex v0 while no events of p have been performed
Joost-Pieter Katoen Theoretical Foundations of the UML 11/14
every
process starts
in
the
initial vertex
with
no
events executed
so
for
SLIDE 15 Structure of the CFM of local choice MSG G
Let MSG G = (V, →, v0, F, λ) be local choice. Define the CFM AG = (((Sp, ∆p))p∈P, D, sinit, F ′) with:
1 Local automaton Ap = (Sp, ∆p) as defined on next slides 2 D = V
synchronisation data = vertices in the MSG
3 sinit = { (v0, ∅) }n where n = |P|
each local automaton Ap starts in initial state (v0, ∅), i.e., in initial vertex v0 while no events of p have been performed
4 s ∈ F ′ iff for all p ∈ P, local state s[p] = (v, E) with E ⊆ Ep and: 1
v ∈ F and E contains a maximal event wrt. <p in MSC λ(v), or
2
v ∈ F and π = v . . . w is a path in G with w ∈ F and E contains a maximal event wrt. <p in MSC M(π).
Joost-Pieter Katoen Theoretical Foundations of the UML 11/14
[
.÷÷÷ . I ( si , Sz ,- ,
{
→ ⇒ SLIDE 16 State space of local automaton Ap
Sp = V × Ep such that for any s = (v, E) ∈ Sp: ∀e, e′ ∈ λ(v).
- e <p e′ and e′ ∈ E
- that is, E is downward-closed with respect to <p in MSC λ(v)
- f
- vertex
- .
- P
÷
.:⇒ , SLIDE 17 State space of local automaton Ap
Sp = V × Ep such that for any s = (v, E) ∈ Sp: ∀e, e′ ∈ λ(v).
- e <p e′ and e′ ∈ E
- that is, E is downward-closed with respect to <p in MSC λ(v)
SLIDE 18 Transition relation of local automaton Ap
Executing events within a vertex of the MSG G: e ∈ Ep ∩ λ(v) and e ∈ E (v, E)
l(e),v
− − − − →p (v, E ∪ { e }) Note: since E ∪ {e} is downward-closed wrt. <p, e is enabled
Joost-Pieter Katoen Theoretical Foundations of the UML 13/14
f
eaten
t- ccurs
- ccurred
- #
(
f ED current state- f
SLIDE 19 Transition relation of local automaton Ap
Executing events within a vertex of the MSG G: e ∈ Ep ∩ λ(v) and e ∈ E (v, E)
l(e),v
− − − − →p (v, E ∪ { e }) Note: since E ∪ {e} is downward-closed wrt. <p, e is enabled Taking an edge (possibly a self-loop) of the MSG G: E = Ep ∩ λ(v) and e ∈ Ep ∩ λ(w) and vu0 . . . unw ∈ V ∗ with p not active in u0 . . . un (v, E)
l(e),w
− − − − →p (w, {e}) Note: vertex w is the first successor vertex of v on which p is active
Joost-Pieter Katoen Theoretical Foundations of the UML 13/14
SLIDE 20
¥
↳- nly
[
all events that p executed " in " vertex v①
MSG①
- ①
Ep
②
MSG①
→④
→ . . . . → ④ →①
- T
¥)
ID
p is p is not active not active first vertex P- in
Ap
w~÷
'EYE
synchronisation
data SLIDE 21 Examples
On the black board.
Joost-Pieter Katoen Theoretical Foundations of the UML 14/14
SLIDE 22 I 2
3
MSG
a Vo e ,- ez
- D
ton
. I 2 3 n 2 3 a b v , es .- %
- et
b I
. Vs I 2 3 CD-
a- ez
SLIDE 23 Local
automata
Ay
,Az
,Az
an
:→v÷%voO
I
?
c)
✓ Led
×
- "
- Vz
④
→④
- ⑤
inactive
SLIDE 24 local
automaton
Az
→!÷:÷*i
. ←local
automaton
Az
→u
SLIDE 25 Second
example
- a
e.IE/e .
Be
.IE/e
.regular
expression
= A .fat
B)
* veA
→⑦ TAO
's MSGf )
to\
⑧
- A
U Applying
the realisation constructionyields
An
, Azt.cn?res),ve
local automatonAy
:J
→ u!vO ve"
.:÷÷6¥
.
Ly
ve ?Grade )
Vr SLIDE 26 local
automaton
Az
:? Can
.me )a
→ uO"
'id
,"
" : ! Canada ) ,vr