theoretical foundations of the uml
play

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


  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

  2. Outline Introduction 1 Local Choice MSGs 2 A Realisation Algorithm for MSGs 3 Joost-Pieter Katoen Theoretical Foundations of the UML 2/14

  3. Overview Introduction 1 Local Choice MSGs 2 A Realisation Algorithm for MSGs 3 Joost-Pieter Katoen Theoretical Foundations of the UML 3/14

  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

  5. Overview Introduction 1 Local Choice MSGs 2 A Realisation Algorithm for MSGs 3 Joost-Pieter Katoen Theoretical Foundations of the UML 5/14

  6. Non-local choice G : p q p q msc msc a b v 1 v 2 Inconsistency if process p behaves according to vertex v 1 and process q behaves according to vertex v 2 = ⇒ 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 di ff erent successor MSCs (= vertices). This is called a non-local choice. Joost-Pieter Katoen Theoretical Foundations of the UML 6/14

  7. Local choice property Definition (Local choice) Let MSG G = ( V, → , v 0 , F, λ ) . MSG G is local choice if for every branching vertex v ∈ V it holds: I � ∀ π ∈ Paths ( v ) . | min( π ′ ) | = 1 ∧ min( π ′ ) ⊆ E p � ∃ process p. where for π = vv 1 v 2 . . . v n we have π ′ = v 1 v 2 . . . v n . P p ① ✓ ' IT U IT VU - , = , ① '=W G MSG itzevw : To \ t . @ p Joost-Pieter Katoen Theoretical Foundations of the UML 7/14

  8. Local choice property Definition (Local choice) Let MSG G = ( V, → , v 0 , F, λ ) . MSG G is local choice if for every branching vertex v ∈ V it holds: � ∀ π ∈ Paths ( v ) . | min( π ′ ) | = 1 ∧ min( π ′ ) ⊆ E p � ∃ process p. where for π = vv 1 v 2 . . . v n we have π ′ = v 1 v 2 . . . v n . 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

  9. Overview Introduction 1 Local Choice MSGs 2 A Realisation Algorithm for MSGs 3 Joost-Pieter Katoen Theoretical Foundations of the UML 8/14

  10. Local choice MSGs An example local-choice MSG on black board. Joost-Pieter Katoen Theoretical Foundations of the UML 9/14

  11. I 3 2 MSG -7 Vo ton . 2 3 I 3 2 n Vz Y b t . 3 Vs 2 I D-

  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

  13. Structure of the CFM of local choice MSG G Let MSG G = ( V, → , v 0 , F, λ ) be local choice. Define the CFM A G = ((( S p , ∆ p )) p ∈ P , D , s init , F ′ ) with: 1 Local automaton A p = ( S p , ∆ p ) as defined on next slides I ✓ E ) ( y pairs [ closed downward - . Lp writ Joost-Pieter Katoen Theoretical Foundations of the UML 11/14

  14. Structure of the CFM of local choice MSG G Let MSG G = ( V, → , v 0 , F, λ ) be local choice. Define the CFM A G = ((( S p , ∆ p )) p ∈ P , D , s init , F ′ ) with: 1 Local automaton A p = ( S p , ∆ p ) as defined on next slides 2 D = V synchronisation data = vertices in the MSG with vertex initial the starts in process every for executed events so no 3 s init = { ( v 0 , ∅ ) } n where n = |P| each local automaton A p starts in initial state ( v 0 , ∅ ) , i.e., in initial vertex v 0 while no events of p have been performed Joost-Pieter Katoen Theoretical Foundations of the UML 11/14

  15. Structure of the CFM of local choice MSG G Let MSG G = ( V, → , v 0 , F, λ ) be local choice. Define the CFM A G = ((( S p , ∆ p )) p ∈ P , D , s init , F ′ ) with: [ 1 Local automaton A p = ( S p , ∆ p ) as defined on next slides .÷÷÷ . 2 D = V synchronisation data = vertices in the MSG 3 s init = { ( v 0 , ∅ ) } n where n = |P| each local automaton A p starts in initial state ( v 0 , ∅ ) , i.e., in initial vertex v 0 while no events of p have been performed Sn ) ( si IPI , Sz in I , - - - , 4 s ∈ F ′ i ff for all p ∈ P , local state s [ p ] = ( v, E ) with E ⊆ E p and: { ⇒ - v ∈ F and E contains a maximal event wrt. < p in MSC λ ( v ) , or 1 v �∈ F and π = v . . . w is a path in G with w ∈ F and E contains a → 2 - maximal event wrt. < p in MSC M ( π ) . - Joost-Pieter Katoen Theoretical Foundations of the UML 11/14

  16. State space of local automaton A p of that set events MSG the the in vertex µ µ has Ep process executed p ← far in so S p = V × E p such that for any s = ( v, E ) ∈ S p : HD vertex v - e < p e ′ and e ′ ∈ E ∀ e, e ′ ∈ λ ( v ) . ÷ E :*) � � implies e ∈ E . :⇒ - - - . - - that is, E is downward-closed with respect to < p in MSC λ ( v ) - - P a- r " " , Joost-Pieter Katoen Theoretical Foundations of the UML 12/14

  17. State space of local automaton A p S p = V × E p such that for any s = ( v, E ) ∈ S p : e < p e ′ and e ′ ∈ E ∀ e, e ′ ∈ λ ( v ) . � � 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 A p is ( v 0 , ∅ ) Joost-Pieter Katoen Theoretical Foundations of the UML 12/14

  18. Transition relation of local automaton A p eaten t occurs f Executing events within a vertex of the MSG G : process p vertex in v e ∈ E p ∩ λ ( v ) and e �∈ E not and has l ( e ) ,v . ( v, E ) → p ( v, E ∪ { e } ) − − − − occurred already Note: since E ∪ { e } is downward-closed wrt. < p , e is enabled ( # - - ED f state current of YEO Ap Le } IE u Joost-Pieter Katoen Theoretical Foundations of the UML 13/14

  19. Transition relation of local automaton A p Executing events within a vertex of the MSG G : e ∈ E p ∩ λ ( v ) and e �∈ E l ( e ) ,v ( v, E ) → 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 = E p ∩ λ ( v ) and e ∈ E p ∩ λ ( w ) and vu 0 . . . u n w ∈ V ∗ with p not active in u 0 . . . u n l ( e ) ,w ( v, E ) − − − − → 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

  20. ¥ executed event only vertex by w ↳ in [ p " " that executed in vertex all events v p ① ① ① MSG - Ep EE ② MSG → ④ ① ④ ① → → → . . . . T ¥ ) - - ID is is p p first not active vertex active not P MSG in - which is in p active not is p active w~÷ EYE ' Ap data synchronisation

  21. Examples On the black board. Joost-Pieter Katoen Theoretical Foundations of the UML 14/14

  22. I 3 2 MSG a D • - Vo ez e , ton . 2 3 I 3 2 n b a . % . o - et es vz v es , b I . 3 Vs 2 I C D- a ez • ep

  23. Az Az automata Ay Local , , an : I ? c) Led ✓ →v÷%voO × - " Vz - in Vz V I 3 ⑤ ④ ④ → - inactive ← is process a

  24. Az local automaton !÷:÷*i → . ← local Az automaton u →

  25. Second example - Be .IE/e e.IE/e . a . * B) fat A regular expression = . A ve ⑦ TAO 's f ) → MSG \ to → u!vO ⑧ A - U ur realisation construction , Az the yields An Applying t.cn?res),ve local automaton Ay : J :÷÷6¥ ve " . . ve Ly Grade ) ? Vr

  26. → uO .me ) ? Can local automaton Az : a " " : ' " id , ! Canada ) ,vr

Recommend


More recommend