Theoretical Foundations of the UML Lecture 14: Realising - - PowerPoint PPT Presentation

theoretical foundations of the uml
SMART_READER_LITE
LIVE PREVIEW

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-1
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
slide-2
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
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
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
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
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
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.
Joost-Pieter Katoen Theoretical Foundations of the UML 7/14 I P p IT , = VU IT , '
  • U
MSG G :

itzevw To '=W

\

. @ t p
slide-8
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.
Intuition: There is a single process that initiates behavior along every path from the branching vertex v. This process decides how to proceed. In a realisation by a CFM, it can inform the other processes how to proceed. Local choice or not? Deciding whether MSG G is local choice or not is in P. Joost-Pieter Katoen Theoretical Foundations of the UML 7/14
slide-9
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
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
SLIDE 11 I 2 3

MSG

Vo
  • 7

ton

. I 2 3 n 2 3 Y Vz

b

.

t

Vs I 2 3

D-

slide-12
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
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
writ Lp
slide-14
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
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 ,
  • ,
Sn ) IPI in

{

slide-16
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
implies e ∈ E
  • that is, E is downward-closed with respect to <p in MSC λ(v)
Joost-Pieter Katoen Theoretical Foundations of the UML 12/14 µ vertex in the MSG µ the set
  • f
events that ← Ep process p has executed so far in
  • vertex
v HD
  • .
E :*)
  • P
a- r " "

÷

.:⇒ ,
slide-17
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
implies e ∈ E
  • that is, E is downward-closed with respect to <p in MSC λ(v)
Intuition: a state (v, E) means that process p is currently in vertex v of MSG G and has already performed the events E of λ(v) Initial state of Ap is (v0, ∅) Joost-Pieter Katoen Theoretical Foundations of the UML 12/14
slide-18
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
process p in vertex v and has not .
  • ccurred
already
  • #

(

f ED current state
  • f
Ap YEO IE u Le}
slide-19
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
SLIDE 20

¥

  • nly
event executed by p in vertex w

[

all events that p executed " in " vertex v

MSG

EE

Ep

MSG

. . . . → ④

  • T

¥)

ID

p is p is not active not active first vertex P
  • in
MSG in which p is p is not active active

Ap

w~÷

'

EYE

synchronisation

data
slide-21
SLIDE 21 Examples On the black board. Joost-Pieter Katoen Theoretical Foundations of the UML 14/14
slide-22
SLIDE 22 I 2 3

MSG

a Vo e ,
  • ez
  • D

ton

. I 2 3 n 2 3 a b v , es .
  • %
vz es .
  • et

b I

. Vs I 2 3 C

D-

a
  • ez
ep
slide-23
SLIDE 23 Local automata

Ay

,

Az

,

Az

an

:

→v÷%voO

I

?

c)

✓ Led

×

  • "
in
  • Vz
Vz I V 3

← process a is

inactive

slide-24
SLIDE 24 local automaton

Az

!÷:÷*i

.

local

automaton

Az

u

slide-25
SLIDE 25 Second

example

  • a

e.IE/e .

Be

.IE/e

.

regular

expression

= A .

fat

B)

* ve

A

⑦ TAO

's MSG

f )

to

\

  • A
ur

U Applying

the realisation construction

yields

An

, Az

t.cn?res),ve

local automaton

Ay

:

J

→ u!vO ve

"

.

:÷÷6¥

.

Ly

ve ?

Grade )

Vr
slide-26
SLIDE 26 local automaton

Az

:

? Can

.me )

a

→ uO

"

'

id

,

"

" : ! Canada ) ,vr