Theoretical Foundations of the UML Lecture 7: Communicating - - PowerPoint PPT Presentation

theoretical foundations of the uml
SMART_READER_LITE
LIVE PREVIEW

Theoretical Foundations of the UML Lecture 7: Communicating - - PowerPoint PPT Presentation

Theoretical Foundations of the UML Lecture 7: Communicating Finite-State Machines Joost-Pieter Katoen Lehrstuhl fr Informatik 2 Software Modeling and Verification Group moves.rwth-aachen.de/teaching/ss-20/fuml/ May 11, 2020 Joost-Pieter


slide-1
SLIDE 1 Theoretical Foundations of the UML Lecture 7: Communicating Finite-State Machines Joost-Pieter Katoen Lehrstuhl für Informatik 2 Software Modeling and Verification Group moves.rwth-aachen.de/teaching/ss-20/fuml/ May 11, 2020 Joost-Pieter Katoen Theoretical Foundations of the UML 1/21
slide-2
SLIDE 2 Outline 1 Introduction 2 Communicating Finite-State Machines 3 Semantics of Communicating Finite-State Machines 4 Emptiness Problem for CFMs Joost-Pieter Katoen Theoretical Foundations of the UML 2/21
slide-3
SLIDE 3 Overview 1 Introduction 2 Communicating Finite-State Machines 3 Semantics of Communicating Finite-State Machines 4 Emptiness Problem for CFMs Joost-Pieter Katoen Theoretical Foundations of the UML 3/21
slide-4
SLIDE 4 Specification to implementation Joost-Pieter Katoen Theoretical Foundations of the UML 4/21
  • consider
(c) MSGS as complete Specification . . s
  • f
a system . MSG g , L ( g) = set
  • f
Mscs set
  • f
possible scenarios
  • finite
countably infinite ( e.g . CMSG for the Hanna kakis example ) Central question i can we
  • btain
a system " realisation "
  • that
exhibits all possible scenarios in L (g) First question : how do such system " realisation , " look like ?
  • model
the behavior
  • f
each process by a finite automaton C blood " automaton )
  • processes
can communicate via unbounded Fifo channels
slide-5
SLIDE 5 Specification to implementation Consider an MSGs as complete system specifications they describe a full set of possible system scenarios Joost-Pieter Katoen Theoretical Foundations of the UML 4/21 L ( G ) = set
  • f
all possible scenarios
slide-6
SLIDE 6 Specification to implementation Consider an MSGs as complete system specifications they describe a full set of possible system scenarios Can we obtain “realisations“ that exhibit precisely these scenarios? Joost-Pieter Katoen Theoretical Foundations of the UML 4/21
  • central
question in the next 3-4 lectures
slide-7
SLIDE 7 Specification to implementation Consider an MSGs as complete system specifications they describe a full set of possible system scenarios Can we obtain “realisations“ that exhibit precisely these scenarios? Map MSGs, i.e., scenarios onto an executable model model each process by a finite-state automaton that communicate via unbounded directed FIFO channels Joost-Pieter Katoen Theoretical Foundations of the UML 4/21 k " p→q
  • (c)
MSG 1-7 communicating finite-state a ,b machine ( CFM ) p→ a
slide-8
SLIDE 8 Specification to implementation Consider an MSGs as complete system specifications they describe a full set of possible system scenarios Can we obtain “realisations“ that exhibit precisely these scenarios? Map MSGs, i.e., scenarios onto an executable model model each process by a finite-state automaton that communicate via unbounded directed FIFO channels ⇒ This yields Communicating Finite-state Machines Joost-Pieter Katoen Theoretical Foundations of the UML 4/21 Brand & Zafiropou lov
slide-9
SLIDE 9 Intuition Joost-Pieter Katoen Theoretical Foundations of the UML 5/21 process p " realisation " process I Example a
! Cpi e. a ) →

AOD

?Cqp,a ) " local " automaton
  • f
p " local " automaton
  • f
I global initial stele = ( n , A ) global final States = { ( a A ) } CMSC p 9- CFM possible behavior
accepts if
  • f
the CFM : a

all channels p
  • 31
a are empty
  • O
e a .

I

a -→ we are in g- p
  • not
used M state G. A )
slide-10
SLIDE 10 Eixample process p process I → .

I

?a tb

③ ②

global initial state = ( n , A ) global Arial states = { ( 2,13 ) } p
  • 07
p I
  • .

ae

.

LE

.
  • a
b .
  • L
8.
  • a
c > is " accepted " by MSC the example CFM ( Yannakakis example )
slide-11
SLIDE 11 The need for synchronisation messages Joost-Pieter Katoen Theoretical Foundations of the UML 6/21 Suppose we want to realise

:-p

I p I

# µ

find states { ( 2. B) ( 3. c)) I I D A Cfm : Process p y

apgcessqcE7ieh@oToatoE.o

Otto
  • 2
7 3 B A C
slide-12
SLIDE 12

p I p 9- left n

b

b

Process p informs process q whether to go " left "
  • r
" right " Automaton for process p : Fe { ( 0,0 ) , ( 0,0 ))

do
  • we
For process I L A deadlock like in the previous example cannot Occur
slide-13
SLIDE 13 Overview 1 Introduction 2 Communicating Finite-State Machines 3 Semantics of Communicating Finite-State Machines 4 Emptiness Problem for CFMs Joost-Pieter Katoen Theoretical Foundations of the UML 7/21
slide-14
SLIDE 14 Preliminaries Definition Let P be a finite set of at least two (sequential) processes C be a finite set of message contents Joost-Pieter Katoen Theoretical Foundations of the UML 8/21

(

  • a. b.
a
slide-15
SLIDE 15 Preliminaries Definition Let P be a finite set of at least two (sequential) processes C be a finite set of message contents Definition (communication actions, channels) Act! p := {!(p, q, a) | q ∈ P \ {p}, a ∈ C} the set of send actions by process p Joost-Pieter Katoen Theoretical Foundations of the UML 8/21
slide-16
SLIDE 16 Preliminaries Definition Let P be a finite set of at least two (sequential) processes C be a finite set of message contents Definition (communication actions, channels) Act! p := {!(p, q, a) | q ∈ P \ {p}, a ∈ C} the set of send actions by process p Act? p := {?(p, q, a) | q ∈ P \ {p}, a ∈ C} the set of receive actions by process p Joost-Pieter Katoen Theoretical Foundations of the UML 8/21
slide-17
SLIDE 17 Preliminaries Definition Let P be a finite set of at least two (sequential) processes C be a finite set of message contents Definition (communication actions, channels) Act! p := {!(p, q, a) | q ∈ P \ {p}, a ∈ C} the set of send actions by process p Act? p := {?(p, q, a) | q ∈ P \ {p}, a ∈ C} the set of receive actions by process p Actp := Act! p ∪ Act? p Joost-Pieter Katoen Theoretical Foundations of the UML 8/21
slide-18
SLIDE 18 Preliminaries Definition Let P be a finite set of at least two (sequential) processes C be a finite set of message contents Definition (communication actions, channels) Act! p := {!(p, q, a) | q ∈ P \ {p}, a ∈ C} the set of send actions by process p Act? p := {?(p, q, a) | q ∈ P \ {p}, a ∈ C} the set of receive actions by process p Actp := Act! p ∪ Act? p Act := p∈P Actp Joost-Pieter Katoen Theoretical Foundations of the UML 8/21
slide-19
SLIDE 19 Preliminaries Definition Let P be a finite set of at least two (sequential) processes C be a finite set of message contents Definition (communication actions, channels) Act! p := {!(p, q, a) | q ∈ P \ {p}, a ∈ C} the set of send actions by process p Act? p := {?(p, q, a) | q ∈ P \ {p}, a ∈ C} the set of receive actions by process p Actp := Act! p ∪ Act? p Act := p∈P Actp Ch := {(p, q) | p, q ∈ P, p = q} “channels“ Joost-Pieter Katoen Theoretical Foundations of the UML 8/21
  • rdered
( P . I ) ( a , p)
slide-20
SLIDE 20 Communicating finite-state machines Definition A communicating finite-state machine (CFM) over P and C is a structure A = (((Sp, ∆p))p∈P, D, sinit, F) where Joost-Pieter Katoen Theoretical Foundations of the UML 9/21 Sef
  • f
global Anil steles
  • "
local " global initial automaton state £719 " ( synchronisation messages ( e.g . left , right )
slide-21
SLIDE 21 Communicating finite-state machines Definition A communicating finite-state machine (CFM) over P and C is a structure A = (((Sp, ∆p))p∈P, D, sinit, F) where D is a nonempty finite set of synchronization messages (or data) We often write s σ,m − →p s′ instead of (s, σ, m, s′) ∈ ∆p Joost-Pieter Katoen Theoretical Foundations of the UML 9/21 e- g .
  • left
, right
slide-22
SLIDE 22 Communicating finite-state machines Definition A communicating finite-state machine (CFM) over P and C is a structure A = (((Sp, ∆p))p∈P, D, sinit, F) where D is a nonempty finite set of synchronization messages (or data) for each p ∈ P: Sp is a non-empty finite set of local states (the Sp are disjoint) ∆p ⊆ Sp × Actp × D × Sp is a set of local transitions We often write s σ,m − →p s′ instead of (s, σ, m, s′) ∈ ∆p Joost-Pieter Katoen Theoretical Foundations of the UML 9/21
  • (
s , ' . Cp . e. a ) , d , s ' ) e Dp Og
  • E Aatp
slide-23
SLIDE 23 Communicating finite-state machines Definition A communicating finite-state machine (CFM) over P and C is a structure A = (((Sp, ∆p))p∈P, D, sinit, F) where D is a nonempty finite set of synchronization messages (or data) for each p ∈ P: Sp is a non-empty finite set of local states (the Sp are disjoint) ∆p ⊆ Sp × Actp × D × Sp is a set of local transitions sinit ∈ SA is the global initial state where SA := p∈P Sp is the set of global states of A We often write s σ,m − →p s′ instead of (s, σ, m, s′) ∈ ∆p Joost-Pieter Katoen Theoretical Foundations of the UML 9/21 P , I , r ( p , I , r )
slide-24
SLIDE 24 Communicating finite-state machines Definition A communicating finite-state machine (CFM) over P and C is a structure A = (((Sp, ∆p))p∈P, D, sinit, F) where D is a nonempty finite set of synchronization messages (or data) for each p ∈ P: Sp is a non-empty finite set of local states (the Sp are disjoint) ∆p ⊆ Sp × Actp × D × Sp is a set of local transitions sinit ∈ SA is the global initial state where SA := p∈P Sp is the set of global states of A F ⊆ SA is the set of global final states We often write s σ,m − →p s′ instead of (s, σ, m, s′) ∈ ∆p Joost-Pieter Katoen Theoretical Foundations of the UML 9/21
slide-25
SLIDE 25 Communicating finite-state machines Example s0 s1 s2 t0 t1 t2 !(1, 2, req ) ?(2, 1, req ) ?(1, 2, ack) !(2, 1, ack) !(1, 2, req ) ?(1, 2, ack) ?(2, 1, req ) !(2, 1, ack) CFM A over P = {1, 2} and C = {req, ack} D = { , , } S1 = {s0, s1, s2} S2 = {t0, t1, t2} ∆1: s0 !(1,2, req ) − − − − − − →1 s0 ... ∆2: t0 ?(2,1, req ) − − − − − − →2 t1 ... sinit = (s0, t0) F = {(s2, t2)} Joost-Pieter Katoen Theoretical Foundations of the UML 10/21 e
  • I
  • 1
2
slide-26
SLIDE 26 Communicating finite-state machines Example s0 s1 s2 t0 t1 t2 !(1, 2, req ) ?(2, 1, req ) ?(1, 2, ack) !(2, 1, ack) !(1, 2, req ) ?(1, 2, ack) ?(2, 1, req ) !(2, 1, ack) . . . . . . Joost-Pieter Katoen Theoretical Foundations of the UML 10/21 1 2 1-32 2-21
slide-27
SLIDE 27 Communicating finite-state machines Example s0 s1 s2 t0 t1 t2 !(1, 2, req ) ?(2, 1, req ) ?(1, 2, ack) !(2, 1, ack) !(1, 2, req ) ?(1, 2, ack) ?(2, 1, req ) !(2, 1, ack) req . . . . . . !(1, 2, req) !(1, 2, req) Joost-Pieter Katoen Theoretical Foundations of the UML 10/21 CMS C C O linearis atsuis O
slide-28
SLIDE 28 Communicating finite-state machines Example s0 s1 s2 t0 t1 t2 !(1, 2, req ) ?(2, 1, req ) ?(1, 2, ack) !(2, 1, ack) !(1, 2, req ) ?(1, 2, ack) ?(2, 1, req ) !(2, 1, ack) req req . . . . . . !(1, 2, req) !(1, 2, req) !(1, 2, req) !(1, 2, req) Joost-Pieter Katoen Theoretical Foundations of the UML 10/21 c ' : .

O

slide-29
SLIDE 29 Communicating finite-state machines Example s0 s1 s2 t0 t1 t2 !(1, 2, req ) ?(2, 1, req ) ?(1, 2, ack) !(2, 1, ack) !(1, 2, req ) ?(1, 2, ack) ?(2, 1, req ) !(2, 1, ack) req . . . . . . !(1, 2, req) !(1, 2, req) ?(2, 1, req) !(1, 2, req) !(1, 2, req) ?(2, 1, req) Joost-Pieter Katoen Theoretical Foundations of the UML 10/21

so

x
slide-30
SLIDE 30 Communicating finite-state machines Example s0 s1 s2 t0 t1 t2 !(1, 2, req ) ?(2, 1, req ) ?(1, 2, ack) !(2, 1, ack) !(1, 2, req ) ?(1, 2, ack) ?(2, 1, req ) !(2, 1, ack) req ack . . . . . . !(1, 2, req) !(1, 2, req) ?(2, 1, req) !(2, 1, ack) !(1, 2, req) !(1, 2, req) ?(2, 1, req) !(2, 1, ack) Joost-Pieter Katoen Theoretical Foundations of the UML 10/21 j O
slide-31
SLIDE 31 Communicating finite-state machines Example s0 s1 s2 t0 t1 t2 !(1, 2, req ) ?(2, 1, req ) ?(1, 2, ack) !(2, 1, ack) !(1, 2, req ) ?(1, 2, ack) ?(2, 1, req ) !(2, 1, ack) ack . . . . . . !(1, 2, req) !(1, 2, req) ?(2, 1, req) !(2, 1, ack) ?(2, 1, req) !(1, 2, req) !(1, 2, req) ?(2, 1, req) !(2, 1, ack) ?(2, 1, req) Joost-Pieter Katoen Theoretical Foundations of the UML 10/21 f O X
slide-32
SLIDE 32 Communicating finite-state machines Example s0 s1 s2 t0 t1 t2 !(1, 2, req ) ?(2, 1, req ) ?(1, 2, ack) !(2, 1, ack) !(1, 2, req ) ?(1, 2, ack) ?(2, 1, req ) !(2, 1, ack) ack ack . . . . . . !(1, 2, req) !(1, 2, req) ?(2, 1, req) !(2, 1, ack) ?(2, 1, req) !(2, 1, ack) !(1, 2, req) !(1, 2, req) ?(2, 1, req) !(2, 1, ack) ?(2, 1, req) !(2, 1, ack) Joost-Pieter Katoen Theoretical Foundations of the UML 10/21

Oo

I °
slide-33
SLIDE 33 Communicating finite-state machines Example s0 s1 s2 t0 t1 t2 !(1, 2, req ) ?(2, 1, req ) ?(1, 2, ack) !(2, 1, ack) !(1, 2, req ) ?(1, 2, ack) ?(2, 1, req ) !(2, 1, ack) ack . . . . . . !(1, 2, req) !(1, 2, req) ?(2, 1, req) !(2, 1, ack) ?(2, 1, req) !(2, 1, ack) ?(1, 2, ack) !(1, 2, req) !(1, 2, req) ?(2, 1, req) !(2, 1, ack) ?(2, 1, req) !(2, 1, ack) ?(1, 2, ack) Joost-Pieter Katoen Theoretical Foundations of the UML 10/21 j
O
slide-34
SLIDE 34 Communicating finite-state machines Example s0 s1 s2 t0 t1 t2 !(1, 2, req ) ?(2, 1, req ) ?(1, 2, ack) !(2, 1, ack) !(1, 2, req ) ?(1, 2, ack) ?(2, 1, req ) !(2, 1, ack) req ack . . . . . . !(1, 2, req) !(1, 2, req) ?(2, 1, req) !(2, 1, ack) ?(2, 1, req) !(2, 1, ack) ?(1, 2, ack) !(1, 2, req) !(1, 2, req) !(1, 2, req) ?(2, 1, req) !(2, 1, ack) ?(2, 1, req) !(2, 1, ack) ?(1, 2, ack) !(1, 2, req) Joost-Pieter Katoen Theoretical Foundations of the UML 10/21 x
slide-35
SLIDE 35 Communicating finite-state machines Example s0 s1 s2 t0 t1 t2 !(1, 2, req ) ?(2, 1, req ) ?(1, 2, ack) !(2, 1, ack) !(1, 2, req ) ?(1, 2, ack) ?(2, 1, req ) !(2, 1, ack) req . . . . . . !(1, 2, req) !(1, 2, req) ?(2, 1, req) !(2, 1, ack) ?(2, 1, req) !(2, 1, ack) ?(1, 2, ack) !(1, 2, req) ?(1, 2, ack) !(1, 2, req) !(1, 2, req) ?(2, 1, req) !(2, 1, ack) ?(2, 1, req) !(2, 1, ack) ?(1, 2, ack) !(1, 2, req) ?(1, 2, ack) Joost-Pieter Katoen Theoretical Foundations of the UML 10/21 T
slide-36
SLIDE 36 Communicating finite-state machines Example s0 s1 s2 t0 t1 t2 !(1, 2, req ) ?(2, 1, req ) ?(1, 2, ack) !(2, 1, ack) !(1, 2, req ) ?(1, 2, ack) ?(2, 1, req ) !(2, 1, ack) req req . . . . . . !(1, 2, req) !(1, 2, req) ?(2, 1, req) !(2, 1, ack) ?(2, 1, req) !(2, 1, ack) ?(1, 2, ack) !(1, 2, req) ?(1, 2, ack) !(1, 2, req) !(1, 2, req) !(1, 2, req) ?(2, 1, req) !(2, 1, ack) ?(2, 1, req) !(2, 1, ack) ?(1, 2, ack) !(1, 2, req) ?(1, 2, ack) !(1, 2, req) Joost-Pieter Katoen Theoretical Foundations of the UML 10/21
slide-37
SLIDE 37 Communicating finite-state machines Example s0 s1 s2 t0 t1 t2 !(1, 2, req ) ?(2, 1, req ) ?(1, 2, ack) !(2, 1, ack) !(1, 2, req ) ?(1, 2, ack) ?(2, 1, req ) !(2, 1, ack) req . . . . . . !(1, 2, req) !(1, 2, req) ?(2, 1, req) !(2, 1, ack) ?(2, 1, req) !(2, 1, ack) ?(1, 2, ack) !(1, 2, req) ?(1, 2, ack) !(1, 2, req) ?(2, 1, req) !(1, 2, req) !(1, 2, req) ?(2, 1, req) !(2, 1, ack) ?(2, 1, req) !(2, 1, ack) ?(1, 2, ack) !(1, 2, req) ?(1, 2, ack) !(1, 2, req) ?(2 Joost-Pieter Katoen Theoretical Foundations of the UML 10/21

±

x =
slide-38
SLIDE 38 Communicating finite-state machines Example s0 s1 s2 t0 t1 t2 !(1, 2, req ) ?(2, 1, req ) ?(1, 2, ack) !(2, 1, ack) !(1, 2, req ) ?(1, 2, ack) ?(2, 1, req ) !(2, 1, ack) . . . . . . !(1, 2, req) !(1, 2, req) ?(2, 1, req) !(2, 1, ack) ?(2, 1, req) !(2, 1, ack) ?(1, 2, ack) !(1, 2, req) ?(1, 2, ack) !(1, 2, req) ?(2, 1, req) ?(2, 1, req) !(1, 2, req) !(1, 2, req) ?(2, 1, req) !(2, 1, ack) ?(2, 1, req) !(2, 1, ack) ?(1, 2, ack) !(1, 2, req) ?(1, 2, ack) !(1, 2, req) ?(2 Joost-Pieter Katoen Theoretical Foundations of the UML 10/21
  • a
. X
slide-39
SLIDE 39 Communicating finite-state machines Example s0 s1 s2 t0 t1 t2 !(1, 2, req ) ?(2, 1, req ) ?(1, 2, ack) !(2, 1, ack) !(1, 2, req ) ?(1, 2, ack) ?(2, 1, req ) !(2, 1, ack) . . . . . . 1 2 req req ack ack req req !(1, 2, req) !(1, 2, req) ?(2, 1, req) !(2, 1, ack) ?(2, 1, req) !(2, 1, ack) ?(1, 2, ack) !(1, 2, req) ?(1, 2, ack) !(1, 2, req) ?(2 Joost-Pieter Katoen Theoretical Foundations of the UML 10/21
  • MSC
M M is accepted by this CFM .
slide-40
SLIDE 40 Overview 1 Introduction 2 Communicating Finite-State Machines 3 Semantics of Communicating Finite-State Machines 4 Emptiness Problem for CFMs Joost-Pieter Katoen Theoretical Foundations of the UML 11/21
slide-41
SLIDE 41 Formal semantics of CFMs Let A = (((Sp, ∆p))p∈P, D, sinit, F) be a CFM over P and C. Definition (configurations) Configurations of A: ConfA := SA × {η | η : Ch → (C × D)∗} Joost-Pieter Katoen Theoretical Foundations of the UML 12/21

=

[

" the content
  • f
all global state channels
  • f
the Local ( = a state for Cfm " every process p ) 2 : Ch ( c × D) * 2 ( Crs )) = E r ( Cp , s ) ) = ( a ,
  • 7. ( b
, )
slide-42
SLIDE 42 Formal semantics of CFMs Let A = (((Sp, ∆p))p∈P, D, sinit, F) be a CFM over P and C. Definition (configurations) Configurations of A: ConfA := SA × {η | η : Ch → (C × D)∗} Definition (global step) = ⇒ A ⊆ ConfA × Act × D × ConfA is defined as follows: Joost-Pieter Katoen Theoretical Foundations of the UML 12/21

(

Tpp

the
  • (
Csi , . she) , e ) ( Cs ,
  • s
!
  • I
, ri )

(

ch C Cx D)£ ? Csi , sj , a ) , m
slide-43
SLIDE 43 Formal semantics of CFMs Let A = (((Sp, ∆p))p∈P, D, sinit, F) be a CFM over P and C. Definition (configurations) Configurations of A: ConfA := SA × {η | η : Ch → (C × D)∗} Definition (global step) = ⇒ A ⊆ ConfA × Act × D × ConfA is defined as follows: sending a message: ((s, η), !(p, q, a), m, (s′, η′)) ∈ = ⇒ A if (s[p], !(p, q, a), m, s′[p]) ∈ ∆p η′ = η[(p, q) := (a, m) · η((p, q))] s[r] = s′[r] for all r ∈ P \ {p} Joost-Pieter Katoen Theoretical Foundations of the UML 12/21 1PI=k
  • =L
[ ] ( 5=6 , , . . . . . . .sk ) , r )

::i÷:÷÷l⇐÷÷÷ii

:

slide-44
SLIDE 44 Formal semantics of CFMs Let A = (((Sp, ∆p))p∈P, D, sinit, F) be a CFM over P and C. Definition (configurations) Configurations of A: ConfA := SA × {η | η : Ch → (C × D)∗} Definition (global step) = ⇒ A ⊆ ConfA × Act × D × ConfA is defined as follows: sending a message: ((s, η), !(p, q, a), m, (s′, η′)) ∈ = ⇒ A if (s[p], !(p, q, a), m, s′[p]) ∈ ∆p η′ = η[(p, q) := (a, m) · η((p, q))] s[r] = s′[r] for all r ∈ P \ {p} receipt of a message: ((s, η), ?(p, q, a), m, (s′, η′)) ∈ = ⇒ A if (s[p], ?(p, q, a), m, s′[p]) ∈ ∆p η((q, p)) = w · (a, m) = and η′ = η[(q, p) := w] s[r] = s′[r] for all r ∈ P \ {p} Joost-Pieter Katoen Theoretical Foundations of the UML 12/21
slide-45
SLIDE 45

¥

¢

, n ) anent configuration

|

? Cp . e. a ) , m w

I

((

k ) , hi ) rice ,pD=w for all
  • ther
channels C

n' Cd . red
slide-46
SLIDE 46 Example Joost-Pieter Katoen Theoretical Foundations of the UML 13/21
slide-47
SLIDE 47 E
  • e-
shiny
  • nes
  • ton
: (

cnn.s.ca#ta99-D--

e = to I , p )) = E

[/enpty

(( r , c) , le , b )) = t ,

I empty

  • C. lad
, ( a. b )) = tz II
  • I
Vcrs D= a a 2 I ( Ep ))
  • b
. . . . ( I 2,4 , ( age )) I C s , c ) , Caa , b )) =L ,

÷

slide-48
SLIDE 48 Linearizations of a CFM Let A = (((Sp, ∆p))p∈P, D, sinit, F) be a CFM over P and C. Definition (accepting runs) A run ρ of CFM A on word w = σ1 . . . σn ∈ Act∗ is an alternating sequence ρ = γ0 m1 γ1 . . . γn−1 mn γn such that 1 γ0 = (sinit, ηε) with ηε mapping any channel to ε 2 γi−1 σi,mi ⇒A γi for any i ∈ {1, . . . , n} Joost-Pieter Katoen Theoretical Foundations of the UML 14/21

y

! C Pie , a) , ? Ce , p , b ) ( empty contest )
slide-49
SLIDE 49 Linearizations of a CFM Let A = (((Sp, ∆p))p∈P, D, sinit, F) be a CFM over P and C. Definition (accepting runs) A run ρ of CFM A on word w = σ1 . . . σn ∈ Act∗ is an alternating sequence ρ = γ0 m1 γ1 . . . γn−1 mn γn such that 1 γ0 = (sinit, ηε) with ηε mapping any channel to ε 2 γi−1 σi,mi ⇒A γi for any i ∈ {1, . . . , n} The run ρ is accepting if γn ∈ F × {ηε}. Joost-Pieter Katoen Theoretical Foundations of the UML 14/21 fn = global final starlet all channels are
  • empty
.
slide-50
SLIDE 50 Linearizations of a CFM Let A = (((Sp, ∆p))p∈P, D, sinit, F) be a CFM over P and C. Definition (accepting runs) A run ρ of CFM A on word w = σ1 . . . σn ∈ Act∗ is an alternating sequence ρ = γ0 m1 γ1 . . . γn−1 mn γn such that 1 γ0 = (sinit, ηε) with ηε mapping any channel to ε 2 γi−1 σi,mi ⇒A γi for any i ∈ {1, . . . , n} The run ρ is accepting if γn ∈ F × {ηε}. Definition (linearization of a CFM) The (word) language of CFM A is defined by: Lin(A) := {w ∈ Act∗ | there is an accepting run of A on w} Joost-Pieter Katoen Theoretical Foundations of the UML 14/21
slide-51
SLIDE 51 Linearizations of an example CFM Example s0 s1 s2 t0 t1 t2 !(1, 2, req ) ?(2, 1, req ) ?(1, 2, ack) !(2, 1, ack) !(1, 2, req ) ?(1, 2, ack) ?(2, 1, req ) !(2, 1, ack) CFM A over {1, 2} and {req, ack} Joost-Pieter Katoen Theoretical Foundations of the UML 15/21

E

I

Jux

slide-52
SLIDE 52 Linearizations of an example CFM Example s0 s1 s2 t0 t1 t2 !(1, 2, req ) ?(2, 1, req ) ?(1, 2, ack) !(2, 1, ack) !(1, 2, req ) ?(1, 2, ack) ?(2, 1, req ) !(2, 1, ack) CFM A over {1, 2} and {req, ack} Lin(A) =
  • w ∈ Act∗ | there is n 1 such that:
w1 = !(1, 2, req))n (?(1, 2, ack) !(1, 2, req))n w2 = (?(2, 1, req) !(2, 1, ack))n (?(2, 1, req))n for any u ∈ Pref (w) and (p, q) ∈ Ch:
  • a∈C
|u|!(p,q,a) −
  • a∈C
|u|?(q,p,a) 0
  • Joost-Pieter Katoen
Theoretical Foundations of the UML 15/21 n h WM = the sequence
  • f
actions in w that n 7
  • ccur
at process 1 n w T2 =
  • .
. for process 2 . . Cta)
  • Csar)
C tart )
slide-53
SLIDE 53 Linearizations of an example CFM Example s0 s1 s2 t0 t1 t2 !(1, 2, req ) ?(2, 1, req ) ?(1, 2, ack) !(2, 1, ack) !(1, 2, req ) ?(1, 2, ack) ?(2, 1, req ) !(2, 1, ack) CFM A over {1, 2} and {req, ack} !(1, 2, req) and !(2, 1, ack) are always independent. !(1, 2, req) and ?(1, 2, ack) are always dependent. !(1, 2, req) and ?(2, 1, req) are sometimes independent. non-regular (word) languages Joost-Pieter Katoen Theoretical Foundations of the UML 15/21 → more expressive than finite
  • state
automata !
slide-54
SLIDE 54 Linearizations and MSCs of an example CFM Example s0 s1 s2 t0 t1 t2 !(1, 2, req ) ?(2, 1, req ) ?(1, 2, ack) !(2, 1, ack) !(1, 2, req ) ?(1, 2, ack) ?(2, 1, req ) !(2, 1, ack) CFM A over {1, 2} and {req, ack} Lin(A) =
  • w ∈ Act∗ | there is n 1 such that:
w1 = (!(1, 2, req))n (?(1, 2, ack) !(1, 2, req))n w2 = (?(2, 1, req) !(2, 1, ack))n (?(2, 1, req))n for any u ∈ Pref (w) and (p, q) ∈ Ch:
  • a∈C
|u|!(p,q,a) −
  • a∈C
|u|?(q,p,a) 0
  • Joost-Pieter Katoen
Theoretical Foundations of the UML 16/21
slide-55
SLIDE 55 Linearizations and MSCs of an example CFM Example s0 s1 s2 t0 t1 t2 !(1, 2, req ) ?(2, 1, req ) ?(1, 2, ack) !(2, 1, ack) !(1, 2, req ) ?(1, 2, ack) ?(2, 1, req ) !(2, 1, ack) CFM A over {1, 2} and {req, ack} L(A) =
  • M ∈ M | there is n ≥ 1 such that:
M 1 = (!(1, 2, req))n (?(1, 2, ack) !(1, 2, req))n M 2 = (?(2, 1, req) !(2, 1, ack))n (?(2, 1, req))n Joost-Pieter Katoen Theoretical Foundations of the UML 16/21 r t
  • set
  • f
MS Cs
  • # I
accepted by CFM A .
slide-56
SLIDE 56 Overview 1 Introduction 2 Communicating Finite-State Machines 3 Semantics of Communicating Finite-State Machines 4 Emptiness Problem for CFMs Joost-Pieter Katoen Theoretical Foundations of the UML 17/21 # CFMS are more expressive than finite
  • state
automata

I

does a CFM accept at least
  • ne
word ? undecidable
slide-57
SLIDE 57 Elementary questions are undecidable for CFMs Emptiness of CFMs is undecidable [Brand & Zafiropulo 1983] The following problem is undecidable (even if C is a singleton): Input: CFM A over processes P and message contents C Question: Is L(A) empty? Joost-Pieter Katoen Theoretical Foundations of the UML 18/21
  • (
e.g . c- { a ) the set
  • f
Mscs accepted by CFM A

€a

, the set
  • f

linton

's atoms accepted by Crm A .
slide-58
SLIDE 58 Elementary questions are undecidable for CFMs Emptiness of CFMs is undecidable [Brand & Zafiropulo 1983] The following problem is undecidable (even if C is a singleton): Input: CFM A over processes P and message contents C Question: Is L(A) empty? Proof (sketch) Reduction from the halting problem for Turing machine TM = (Q, Σ, ∆, , q0, qf) to emptiness for a CFM with two processes. Build CFM A = ((A1, A2), D, sinit, F) over {1, 2} and some singleton set C such that L(A) = ∅ iff TM can reach qf, i.e., TM accepts. Process 1 sends current configurations to process 2 Process 2 chooses successor configurations and sends them to 1 D =
  • (Σ ∪ {}) × (Q ∪ {_})
  • ∪ {#}
Joost-Pieter Katoen Theoretical Foundations of the UML 18/21 ✓ ✓ I of the TM
slide-59
SLIDE 59 A CFM simulating a Turing machine Proof (contd.)
  • q0
a
  • q1
a q2 b
  • q3
a′ b . . . ⊢TM ⊢TM ⊢TM γ0
  • γ1
         γ2          γ3                      . . .          γ1          γ2                      γ3 ← q0 # ← q1 a # b a ← q2 # b a′ ← q3 # ← q1 a # b a ← q2 # b a′ ← q3 # Joost-Pieter Katoen Theoretical Foundations of the UML 19/21 Turing machine 1CFM# initial conf .
  • marks
  • ÷
: : #
slide-60
SLIDE 60 A CFM simulating a Turing machine Proof (contd.) Left or standstill transition: Process 2 may just wait for a symbol containing a state of TM and to alter it correspondingly. In the example, the left-moving transition (q2, a, a′, L, q3) is applied so that process 2 sends b unchanged back to process 1 detects (receives) a ← q2 sends a′ to process 1 entering a state indicating that the symbol to be sent next has to be equipped with q3 receives # so that the symbol ← q3 has to be inserted before returning # Joost-Pieter Katoen Theoretical Foundations of the UML 20/21
slide-61
SLIDE 61 A CFM simulating a Turing machine Proof (contd.) Left or standstill transition: Process 2 may just wait for a symbol containing a state of TM and to alter it correspondingly. In the example, the left-moving transition (q2, a, a′, L, q3) is applied so that process 2 sends b unchanged back to process 1 detects (receives) a ← q2 sends a′ to process 1 entering a state indicating that the symbol to be sent next has to be equipped with q3 receives # so that the symbol ← q3 has to be inserted before returning # Right transition: Process 2 has to guess what the position right before the head is. For example, provided process 2 decided in favor of (q2, a, a′, R, q3) while reading b, it would have to send b ← q3 instead of just b, entering some state t(a ← q2) receive a ← q2 (no other symbol can be received in state t(a ← q2)) send a′ back to process 1 Joost-Pieter Katoen Theoretical Foundations of the UML 20/21
slide-62
SLIDE 62

Communicating

Finite
  • state
Machines
  • a
  • realisation
"
  • f
system

forming

:::::I

" (c) MSG = " requirements " all scenarios a system should exhibit
slide-63
SLIDE 63 A CFM simulating a Turing machine Proof (contd.) Introduce local final states sf and tf, one for process 1 and one for process 2, respectively (i.e., F = {(sf, tf)} and A is locally accepting). At any time, process 1 may switch into sf, in which arbitrary and arbitrarily many messages can be received to empty channel (2, 1). Process 2 is allowed to move into tf and to empty the channel (1, 2) as soon as it receives a letter c ← qf for some c. As process 2 modifies a configuration of TM locally, finitely many states are sufficient in A.
  • Joost-Pieter Katoen
Theoretical Foundations of the UML 21/21