model checking with message sequence charts
play

Model checking with Message Sequence Charts Doron Peled - PowerPoint PPT Presentation

Model checking with Message Sequence Charts Doron Peled Collaborators: R. Alur, E. Gunter, G. Holzmann, A. Muscholl, Z. Su Department of Computer Science University of Warwick, UK Bar Ilan University, IL MSCs An ITU standard notation


  1. Model checking with Message Sequence Charts Doron Peled Collaborators: R. Alur, E. Gunter, G. Holzmann, A. Muscholl, Z. Su Department of Computer Science University of Warwick, UK Bar Ilan University, IL

  2. MSCs � An ITU standard notation (Z120). � Visual + Textual forms. � Specifies behaviors of communication protocols. � Existing algorithms + tools.

  3. MSC visual notation P1 P2 P3 M1 M2 M3 M4 M5 M6

  4. MSC Textual form msc MSC; instance P3; inst P1: process Root, in M2 from P2; P2: process Root, in M3 from P2; P3: process Root; out M4 to P2; out M6 to P1; instance P1; endinstance; out M1 to P2; endmsc; in M5 from P2; in M6 from P3; P1 P2 P3 M1 endinstance; M2 instance P2; M3 in M1 from P1; M4 out M2 to P3; M5 M6 out M3 to P3; in M4 from P3; out M5 to P1; endinstance;

  5. Partial order semantics: How exactly? V - Set of events (vertices). N - names. P1 P2 P3 P - processes. M1 M2 p:V � P maps events to processes. M3 E - Set of edges (orders, to be fixed). M4 M5 n: V � N naming function. M6 t: V � {s, r, l} matches a type (send, receive, local). m � VxV - matching of sends and receives with same name and opposite types.

  6. HMSCs: a graph of MSCs (again, what semantics?) P1 P2 P3 P1 P2 P3 approve connect P1 P2 P3 P1 P2 P3 fail req_service report

  7. Visual semantics � Sends before corresponding receives. � Events on the same process line execute in order of appearance, from top to bottom.

  8. Visual order (wysiwyg) � If some event P1 P2 P3 (send, receive) is M1 M2 higher on the line M3 M4 than another, it M5 M6 comes first. � Sends precede matching receives.

  9. Visual order (wysiwyg) M1 s r M2 s P1 P2 P3 r M1 M2 M3 r s M3 M4 M4 M5 s M6 r s s M5 An events that appear in the M6 r process line above the other will precede it in time! r

  10. Causal Order P1 P2 P3 M1 P1 P2 P3 M1 M2 M2 M3 M3 M4 M5 M4 M6 Rules: order between M5 - receive and a later send. M6 - two sends from same process. - send and corresponding receive. -fifo order. -Everything that follows by transitive closure

  11. Causal Order P1 P2 P3 M1 P1 P2 P3 M1 M2 M2 M3 M3 M4 M5 M4 M6 Rules: order between M5 - receive and a later send. M6 - two sends from same process. - send and corresponding receive. -fifo order. -Everything that follows by transitive closure

  12. Races: the difference between the visual order and the causal order P1 P2 P3 M1 M1 s r M2 M2 s r M3 M3 r s M4 s M4 r s s M5 M5 M6 r M6 r

  13. Races: events can also occur in reverse order P1 P2 P3 P1 P2 P3 M1 M1 M2 M2 M3 M3 M4 M4 M5 M6 M6 M5

  14. Calculating the transitive closure � Structure (E, R). � E – Events, R ⊆ E × E. � R * The transitive closure. Defined as follows: a R * b if there is a sequence x 1 x 2 … x n where a=x 1 , b=x n , and x i R x i+1 for 1 ≤ i<n. � Complexity: cubic. In our case: quadratic since every event has 1 or 2 successors).

  15. Can also deal with time P1 P2 Use Difference [2,4] Bound Matrices (DBMs) [3,5] [7,10]? [2,3]

  16. Put all known constraints, e.g., 2 ≤ e2-e1 ≤ 4 � e2-e1 ≤ 4,e1-e2 ≤ -2 P1 P2 e1 e2 e3 e4 [2,4] e1 e2 � � e1 0 4 � [7,10]? [3,5] e2 -2 0 5 � e3 -3 0 3 e4 e3 [2,3] � � e4 -2 0

  17. Normalize: e i -e j ≤ l+ e j -e k ≤ m+ e i -e k ≤ n � e i -e k ≤ min (n,l+k) 9 P1 P2 e1 e2 e3 e4 [2,4] e1 e2 � � e1 0 4 � [7,10]? [3,5] e2 -2 0 5 � e3 -3 0 3 e4 e3 [2,3] � � e4 -2 0

  18. Compare checked limit to normalized table. Problem!! P1 P2 e1 e2 e3 e4 [2,4] e1 e2 9 12 e1 0 4 8 [7,10]? [3,5] e2 -2 0 5 -5 e3 -3 0 3 e4 e3 [2,3] -7 -5 e4 -2 0 OK!!

  19. Visual concatenation semantics: extend process lines. An execution: infinite or maximal A B Execution: ACACD approve connect connect fail report connect fail fail Req_service report report Req_service C D Technically: for concatenation: take union of events. For each process P i , order events of A before events of C. For the path: take limit of union (A U AC U ACA … )

  20. Visual concatenation semantics: extend process lines. An execution: infinite or maximal A B Execution: ACACD approve connect connect fail report connect fail Note: fail Req_service report unordered report even if in Req_service subsequent C D HMSC boxes!! More?

  21. Visual concatenation semantics: extend process lines. An execution: infinite or maximal A B Execution: ACACD approve connect connect fail report connect fail Note: fail Req_service report unordered report even if in Req_service subsequent C D HMSC boxes!! … and more.

  22. Star operation over partial order: not necessarily regular (“recognizable”) Language: P1 P2 At least as many send events as s receives in every prefix (Stack Machine Recognizable) r

  23. Star operation over partial order: not necessarily regular (“recognizable”) Language: P1 P1 P1 Even worse… (Not even Stack Machine Recognizable)

  24. Races in HMSCs. Definition � For each HMSC M execution Ex , define � the linearizations according to the visual order lin vis ( Ex ) and � the linearizations according to the causal order lin caus ( Ex ). Extend to all executions: lin vis ( Ex ) and lin caus ( Ex ). � Always lin vis ( Ex ) ⊆ lin caus ( Ex ). (Visual order will not allow exchanging two receives on same process!!) Races : when lin vis ( Ex ) ⊂ lin caus ( Ex ). � Races �

  25. Similar to Mazurkiewicz Traces (semi commutation: can exchange receive with next send, but not vice versa). Alphabet {a,b,c} Independence: aIb, bIc Equivalence classes of words (denoted using representatives): [aabb]=[abba] Regular trace language: can be defined using concatenation, star, union, intersection. Note: [ab]* is not regular (recognizable).

  26. Other problems… Global decision M1 M2 P1 P2 P1 P2 + =? What if one process will start to behave according to M1 and the other will start according to M2?

  27. Races for HMSCs (intuition only) � Undecidable [MP99] � Translate to language theory of traces , which are closed w.r.t. commuting certain pairs of letters. � Intuition: moving from visual to causal semantic introduces more Independent commutations: Two receives on the same process Language L line (from different processes) are dependent on visual and independent on causal order. Independent � Reduction to universality of trace languages (things are independent with causal semantics).

  28. Model checking � Write both specification and system as HMSCs. Check emptiness of intersection. � Write specification in LTL. Interpret over the linearizations of the partial orders. � In both cases: undecidable.

  29. Post Correspondence Problem � List of pairs: w 1 :(aab,bb), w 2 :(ab,bab), … w n :(a,bb). Want to find if there is a set of indices i 1 , i 2 , …, i k , such that concatenating the lefthand words and concatenating the righthand words is the same. � Supose we take indices 1, 2, n, 1. We get: � lefthand: aab ab a aab � righthand: bb bab bb bb

  30. PCP reduction Letter match Word P5 P6 P5 P6 match P1 P2 P1 P2 P1 P2 P1 P2 a b a b a a b b b b P3 P4 P3 P4 P3 P4 P3 P4 w 1 w 2 w 2 w 1 (aab,bb), P5 P6 P5 P6 (ab,bab),...

  31. Some solutions: � The specification HMSCs allows any additional gaps [MPS98]. � Put limit on message queues [Holzmann] � Strongly connected communication graph for each cycle [AY, MP]. This also gives a limit (exponential in number of processes) on needed size of message queues.

  32. Obtain decidability under the following condition [MP99,AY99]: Every HMSCs A B cycle covers a strongly connected component in the P1 P2 P3 communication graph: An approve connect edge exist from a process Pi to a process Pj if there is a communication from Pi to Pj. Then system finite and regular! fail Req_service report P1 P2 C D Graph of loop AC: P3

  33. Problem with describing protocols P1 P2 s1 t1 P1:snd s2 P2:snd P2:rcv P1:snd P1:rcv t2 s3

  34. Problem with describing protocols P1 P2

  35. Problem with describing protocols P1 P2

  36. Problem with describing protocols P1 P2

  37. Problem with describing protocols P1 P2

  38. Problem with describing protocols P1 P2

  39. Problem with describing protocols P1 P2

  40. Solution: Compositional HMSCs P1 P2 P1 P2

  41. Even emptiness is undecideable! (but this HCMSC has strange “executions) (E1+E2+…+Em) + (G1+G2+…+Gm) + F a b b b w3 w2 a a E3 G2 F

  42. Left closed CHMSCs � Does not allow unmatched receive event that is not yet matched by a previous unmatched send. � HCMSC is realizable if every path is matched. � Can be checked in polynomial time using a nondeterministic stack machine.

Recommend


More recommend