Theoretical Foundations of the UML Lecture 8: Communicating Finite-State Machines Joost-Pieter Katoen Lehrstuhl für Informatik 2 Software Modeling and Verification Group moves.rwth-aachen.de/teaching/ss-16/theoretical-foundations-of-the-uml/ 23. Mai 2016 Joost-Pieter Katoen Theoretical Foundations of the UML 1/21
Outline Introduction 1 Communicating Finite-State Machines 2 Semantics of Communicating Finite-State Machines 3 Emptiness Problem for CFMs 4 Joost-Pieter Katoen Theoretical Foundations of the UML 2/21
Overview Introduction 1 Communicating Finite-State Machines 2 Semantics of Communicating Finite-State Machines 3 Emptiness Problem for CFMs 4 Joost-Pieter Katoen Theoretical Foundations of the UML 3/21
Specification to implementation Joost-Pieter Katoen Theoretical Foundations of the UML 4/21
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
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
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
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
Intuition Joost-Pieter Katoen Theoretical Foundations of the UML 5/21
The need for synchronisation messages Joost-Pieter Katoen Theoretical Foundations of the UML 6/21
Overview Introduction 1 Communicating Finite-State Machines 2 Semantics of Communicating Finite-State Machines 3 Emptiness Problem for CFMs 4 Joost-Pieter Katoen Theoretical Foundations of the UML 7/21
Preliminaries Definition Let be a finite set of at least two (sequential) processes P be a finite set of message contents C Joost-Pieter Katoen Theoretical Foundations of the UML 8/21
Preliminaries Definition Let be a finite set of at least two (sequential) processes P be a finite set of message contents C 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
Preliminaries Definition Let be a finite set of at least two (sequential) processes P be a finite set of message contents C 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
Preliminaries Definition Let be a finite set of at least two (sequential) processes P be a finite set of message contents C 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 Act p := Act ! p ∪ Act ? p Joost-Pieter Katoen Theoretical Foundations of the UML 8/21
Preliminaries Definition Let be a finite set of at least two (sequential) processes P be a finite set of message contents C 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 Act p := Act ! p ∪ Act ? p Act := � p ∈P Act p Joost-Pieter Katoen Theoretical Foundations of the UML 8/21
Preliminaries Definition Let be a finite set of at least two (sequential) processes P be a finite set of message contents C 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 Act p := Act ! p ∪ Act ? p Act := � p ∈P Act p Ch := { ( p, q ) | p, q ∈ P , p � = q } “channels“ Joost-Pieter Katoen Theoretical Foundations of the UML 8/21
Communicating finite-state machines Definition A communicating finite-state machine (CFM) over P and C is a structure A = ((( S p , ∆ p )) p ∈P , D , s init , F ) where Joost-Pieter Katoen Theoretical Foundations of the UML 9/21
Communicating finite-state machines Definition A communicating finite-state machine (CFM) over P and C is a structure A = ((( S p , ∆ p )) p ∈P , D , s init , F ) where D is a nonempty finite set of synchronization messages (or data) σ,m → p s ′ instead of ( s, σ, m, s ′ ) ∈ ∆ p We often write s − Joost-Pieter Katoen Theoretical Foundations of the UML 9/21
Communicating finite-state machines Definition A communicating finite-state machine (CFM) over P and C is a structure A = ((( S p , ∆ p )) p ∈P , D , s init , F ) where D is a nonempty finite set of synchronization messages (or data) for each p ∈ P : S p is a non-empty finite set of local states (the S p are disjoint) ∆ p ⊆ S p × Act p × D × S p is a set of local transitions σ,m → p s ′ instead of ( s, σ, m, s ′ ) ∈ ∆ p We often write s − Joost-Pieter Katoen Theoretical Foundations of the UML 9/21
Communicating finite-state machines Definition A communicating finite-state machine (CFM) over P and C is a structure A = ((( S p , ∆ p )) p ∈P , D , s init , F ) where D is a nonempty finite set of synchronization messages (or data) for each p ∈ P : S p is a non-empty finite set of local states (the S p are disjoint) ∆ p ⊆ S p × Act p × D × S p is a set of local transitions s init ∈ S A is the global initial state where S A := � p ∈P S p is the set of global states of A σ,m → p s ′ instead of ( s, σ, m, s ′ ) ∈ ∆ p We often write s − Joost-Pieter Katoen Theoretical Foundations of the UML 9/21
Communicating finite-state machines Definition A communicating finite-state machine (CFM) over P and C is a structure A = ((( S p , ∆ p )) p ∈P , D , s init , F ) where D is a nonempty finite set of synchronization messages (or data) for each p ∈ P : S p is a non-empty finite set of local states (the S p are disjoint) ∆ p ⊆ S p × Act p × D × S p is a set of local transitions s init ∈ S A is the global initial state where S A := � p ∈P S p is the set of global states of A F ⊆ S A is the set of global final states σ,m → p s ′ instead of ( s, σ, m, s ′ ) ∈ ∆ p We often write s − Joost-Pieter Katoen Theoretical Foundations of the UML 9/21
Communicating finite-state machines Example CFM A over P = { 1 , 2 } !(1 , 2 , req ) s 0 t 0 and C = { req , ack } ?(2 , 1 , req ) ?(1 , 2 , ack ) !(2 , 1 , ack ) D = { } , , S 1 = { s 0 , s 1 , s 2 } s 1 t 1 S 2 = { t 0 , t 1 , t 2 } !(1 , 2 , req ) ?(1 , 2 , ack ) !(2 , 1 , ack ) !(1,2, req ) ∆ 1 : s 0 − − − − − − → 1 s 0 ... s 2 ?(2 , 1 , req ) t 2 ?(2,1, req ) ∆ 2 : t 0 − − − − − − → 2 t 1 ... s init = ( s 0 , t 0 ) F = { ( s 2 , t 2 ) } Joost-Pieter Katoen Theoretical Foundations of the UML 10/21
Communicating finite-state machines Example !(1 , 2 , req ) s 0 t 0 ?(2 , 1 , req ) ?(1 , 2 , ack ) !(2 , 1 , ack ) s 1 t 1 !(1 , 2 , req ) ?(1 , 2 , ack ) !(2 , 1 , ack ) s 2 ?(2 , 1 , req ) t 2 . . . . . . Joost-Pieter Katoen Theoretical Foundations of the UML 10/21
Communicating finite-state machines Example !(1 , 2 , req ) !(1 , 2 , req ) s 0 t 0 ?(2 , 1 , req ) ?(1 , 2 , ack ) !(2 , 1 , ack ) s 1 t 1 !(1 , 2 , req ) ?(1 , 2 , ack ) !(2 , 1 , ack ) s 2 ?(2 , 1 , req ) t 2 req . . . . . . !(1 , 2 , req ) Joost-Pieter Katoen Theoretical Foundations of the UML 10/21
Communicating finite-state machines Example !(1 , 2 , req ) !(1 , 2 , req ) s 0 t 0 !(1 , 2 , req ) ?(2 , 1 , req ) ?(1 , 2 , ack ) !(2 , 1 , ack ) s 1 t 1 !(1 , 2 , req ) ?(1 , 2 , ack ) !(2 , 1 , ack ) s 2 ?(2 , 1 , req ) t 2 req req . . . . . . !(1 , 2 , req ) !(1 , 2 , req ) Joost-Pieter Katoen Theoretical Foundations of the UML 10/21
Communicating finite-state machines Example !(1 , 2 , req ) ?(2 , 1 , req ) !(1 , 2 , req ) s 0 t 0 !(1 , 2 , req ) ?(2 , 1 , req ) ?(1 , 2 , ack ) !(2 , 1 , ack ) s 1 t 1 !(1 , 2 , req ) ?(1 , 2 , ack ) !(2 , 1 , ack ) s 2 ?(2 , 1 , req ) t 2 req . . . . . . !(1 , 2 , req ) !(1 , 2 , req ) ?(2 , 1 , req ) Joost-Pieter Katoen Theoretical Foundations of the UML 10/21
Recommend
More recommend