Theoretical Foundations of the UML 0 Lecture 5+6: Compositional Message Sequence Graphs Joost-Pieter Katoen Lehrstuhl für Informatik 2 Software Modeling and Verification Group moves.rwth-aachen.de/teaching/ss-20/fuml/ May 4, 2020 Be BEE Joost-Pieter Katoen Theoretical Foundations of the UML 1/29
Outline A non-decomposable MSC 1 Compositional Message Sequence Charts 2 Compositional Message Sequence Graphs 3 Safe Compositional Message Sequence Graphs 4 Undecidable Existence of Safe Paths 5 } two decision problem , decidable Universality of Safe Paths 6 B• Joost-Pieter Katoen Theoretical Foundations of the UML 2/29
Compositional MSCs [Gunter, Muscholl, Peled 2001] Solution: drop restriction that e and m ( e ) belong to the same MSC (= allow for incomplete message transfer) Definition (Compositional MSC) M = ( P , E, C , l, m, � ) is a compositional MSC (CMSC, for short) where P , E, C and l are defined as before, and m : E ! ! E ? is a partial, injective function such that (as before): m ( e ) = e 0 ^ l ( e ) = !( p, q, a ) l ( e 0 ) = ?( q, p, a ) implies �S � ⇤ � = p 2 P < p { ( e, m ( e )) | e 2 dom ( m ) } [ - | {z } - domain of m | {z } “ m ( e ) is defined” Note: An MSC is a CMSC where m is total and bijective. . egad Joost-Pieter Katoen Theoretical Foundations of the UML 6/29
CMSC example m ( e 2 ) = e 3 e 1 / 2 dom ( m ) e 4 / 2 rng ( m ) ÷i÷÷÷÷:÷÷÷ zydeco Joost-Pieter Katoen Theoretical Foundations of the UML 7/29
Paths EM X V Let G = ( V, ! , v 0 , F, λ ) be a CMSG. → : Definition (Path in a CMSG) A path π of G is a finite sequence π = u 0 u 1 . . . u n with u i 2 V (0 i n ) and u i ! u i +1 (0 i < n ) Definition (Accepting path of a CMSG) Path π = u 0 . . . u n is accepting if: u 0 = v 0 and u n 2 F . - - Definition (CMSC of a path) The CMSC of a path π = u 0 . . . u n is: M ( π ) = ( . . . ( λ ( u 0 ) • λ ( u 1 )) • λ ( u 2 ) . . . ) • λ ( u n ) - - un - where CMSC concatenation is left associative. Joost-Pieter Katoen Theoretical Foundations of the UML 14/29 ft
The MSC language of a CMSG Definition (Language of a CMSG) The (MSC) language of CMSG G is defined by: L ( G ) = { M ( π ) 2 M | π is an accepting path of G } . | {z } only “real” MSCs Note: Accepting paths that give rise to an CMSC (which is not an MSC) are not part of L ( G ) . Egg Joost-Pieter Katoen Theoretical Foundations of the UML 15/29
2 r I 2 CMSG a a → - D f- → 8 . > b→ ✓ Uo U , 2 accepting a MCT ) → path IT You : -- , → IM C- E Lcg ) thus Mct ) r 2 accepting IM ⑦ ' ) '= MCIT IT 4044 a- path , ¢ → MCT '7¢LCg ) .
Yannakakis’ example as compositional MSG This MSC cannot be modeled for n > 1 by: M = M 1 • M 2 • . . . • M n with M i ∈ M Thus it cannot be modeled by a MSG. But it can be modeled as compositional MSG: Egos Joost-Pieter Katoen Theoretical Foundations of the UML 16/29
CMS G g : Pi P2 LCG ) Msc M E t , - ? } - Vo rise . 2 • . a In . 2 safe j . MCT)isan_ ± a In - for G accepting Evey path IT i c- Llg ) Mcm ) → safe called g C MSG is
Safe paths and CMSGs n•EBMiE"↳ Definition (Safe path) Path π of CMSG G is safe whenever M ( π ) ∈ M . Definition (Safe CMSG) CMSG G is safe if for every accepting path π of G , M ( π ) is an MSC. Joost-Pieter Katoen Theoretical Foundations of the UML 18/29
Existence of a safe accepting path Theorem: undecidability of existence of a safe path The decision problem “does CMSG G have at least one safe, accepting path?” is undecidable. Proof. By a reduction from Post’s Correspondence Problem (PCP). . . . black board . . . The complement decision problem “does CMSG G have no safe, accepting path?” is undecidable too. Joost-Pieter Katoen Theoretical Foundations of the UML 20/29
Universality of safe accepting paths Theorem: undecidability of existence of a safe path The decision problem “does CMSG G have at least one safe, accepting path?” is undecidable. Joost-Pieter Katoen Theoretical Foundations of the UML 22/29
Universality of safe accepting paths Theorem: undecidability of existence of a safe path The decision problem “does CMSG G have at least one safe, accepting path?” is undecidable. Theorem: decidability of universality of safe paths The decision problem “are all accepting paths of CMSG G safe?” is decidable in PTIME. Joost-Pieter Katoen Theoretical Foundations of the UML 22/29
Universality of safe accepting paths Theorem: undecidability of existence of a safe path The decision problem “does CMSG G have at least one safe, accepting path?” is undecidable. Theorem: decidability of universality of safe paths The decision problem “are all accepting paths of CMSG G safe?” is decidable in PTIME. Proof. Polynomial reduction to reachability problem in (non-deterministic) pushdown automata. . . . see details on the next slides . . . Joost-Pieter Katoen Theoretical Foundations of the UML 22/29
Pushdown automata Definition (Pushdown automaton) A pushdown automaton (PDA, for short) K = ( Q, q 0 , Γ , Σ , ∆ ) with Q , a finite set of control states be put symbols q 0 ∈ Q , the initial state which can # stack the on Γ , a finite stack alphabet , b C a Σ , a finite input alphabet - , ∆ ⊆ Q × Σ × Γ × Q × Γ ∗ , the transition relation. I ret I I I t stack next stole next content top ) c- ( next at the ip.ee . stele that symbol symbol be to of the read is steak Joost-Pieter Katoen Theoretical Foundations of the UML 23/29
Pushdown automata Definition (Pushdown automaton) A pushdown automaton (PDA, for short) K = ( Q, q 0 , Γ , Σ , ∆ ) with Q , a finite set of control states q 0 ∈ Q , the initial state Γ , a finite stack alphabet Σ , a finite input alphabet O ∆ ⊆ Q × Σ × Γ × Q × Γ ∗ , the transition relation. Transition relation ( q, a, γ , q 0 , pop ) ∈ ∆ means: in state q , on reading input symbol a and top of stack is symbol γ , change to q 0 and pop γ from the stack. Joost-Pieter Katoen Theoretical Foundations of the UML 23/29
o } { oh In " L EL > on = L C- Oona Cfl on of L 010 PDA K Construct L K that accepts the language such a Intuition - K initial control PDA starts state • in Io i reject " " if if with input start • word E we w a s or " " otherwise all the • stack push them Os and scan on , " first " control to reading stele • the t I a on move , , from the stack O pop 6 6 9 from " the stack in • reading 9 O on a we pop a , a , " " if if reject input word • in I O read is d is i a or , , - but stack not the is - accept of Os > Is hr if . in input word S , ; and • both the stack empty are .
0 OF ① evokes " " push # O 0 o , , f) # " of " bottom stack → .ae ( a " " " " pop O O pop - O O 00 , , ( " " push O E ) { , ) Ceo transitions Q= D I 7 O C- so a : , , , , , , - on ) { Z= 00 ) ( So EA 0,0 so , , , # ) I r o = , E ) A ( 1 O ← oh oh , , , , , 9- go = o o ) ( So # A 10 , C- So , , configurations Example : 4k¥ ' II . ¥ ¥ ⇐ c a ' . of configuration Change 11,00 ) # ) 0 ) ( gon ( a- Cao 1- t a- I on - o o , , , , , o ) , e. e) Can ( oh 1- r , , ( oh E ) Is E reachable , , # ) ? from ( ooh so , ,
Reachability in pushdown automata Definition A configuration c is a triple (state q , stack content Z , rest input w ). ' f Control Joost-Pieter Katoen Theoretical Foundations of the UML 24/29
Reachability in pushdown automata Definition A configuration c is a triple (state q , stack content Z , rest input w ). Definition Given a transition in ∆ , a (direct) successor configuration c 0 of c is 0 obtained: c ` c 0 . Joost-Pieter Katoen Theoretical Foundations of the UML 24/29
Reachability in pushdown automata Definition A configuration c is a triple (state q , stack content Z , rest input w ). Definition Given a transition in ∆ , a (direct) successor configuration c 0 of c is obtained: c ` c 0 . Reachability problem 0 For configuration c , and initial configuration c 0 : c 0 ` ⇤ c ? Joost-Pieter Katoen Theoretical Foundations of the UML 24/29
Reachability in pushdown automata Definition A configuration c is a triple (state q , stack content Z , rest input w ). Definition Given a transition in ∆ , a (direct) successor configuration c 0 of c is obtained: c ` c 0 . Reachability problem For configuration c , and initial configuration c 0 : c 0 ` ⇤ c ? Theorem: [Esparza et al. 2000] The reachability problem for PDA is decidable in PTIME. Joost-Pieter Katoen Theoretical Foundations of the UML 24/29
. Reek Dyck language : ] ) brackets { E E square = , " " " " receive send Dyck language y y we 2*1 " " { of I contain prefixes all no more u " " of E than the number and - , linearization " E " T " " of egads the member } in u = the PDA that Exercise construct accepts a - language Dyck .
Recommend
More recommend