190 likes | 343 Views
Visual Formalisms. Message Sequence Charts Book: Chapter 10. MSCs. An ISO standard notation (Z120). Visual + Textual forms. Specifies behaviors of communication protocols. Existing algorithms + tools. MSC visual notation. P1. P2. P3. M1. M2. M3. M4. M5. M6. msc MSC;
E N D
Visual Formalisms Message Sequence Charts Book: Chapter 10
MSCs • An ISO standard notation (Z120). • Visual + Textual forms. • Specifies behaviors of communication protocols. • Existing algorithms + tools.
MSC visual notation P1 P2 P3 M1 M2 M3 M4 M5 M6
msc MSC; inst P1: process Root, P2: process Root, P3: process Root; instance P1; out M1 to P2; in M5 from P2; in M6 from P3; endinstance; instance P2; in M1 from P1; out M2 to P3; out M3 to P3; in M4 from P3; out M5 to P1; endinstance; MSC Textual form instance P3; in M2 from P2; in M3 from P2; out M4 to P2; out M6 to P1; endinstance; endmsc; P1 P2 P3 M1 M2 M3 M4 M5 M6
M1 s r M2 s r M3 s r s M4 r s s M5 M6 r r Partial order semantics P1 P2 P3 M1 M2 M3 M4 M5 M6
P1 P2 P3 P1 P2 P3 approve connect P1 P2 P3 P1 P2 P3 fail req_service report HMSCs
Visual semantics • Sends before corresponding receives. • Events on the same process line execute in order of appearance, from top to bottom.
Visual order (wysiwyg) • If some event (send, receive) is higher on the line than another, it comes first. • Sends precede matching receives. P1 P2 P3 M1 M2 M3 M4 M5 M6
M1 s r M2 s r M3 s r s M4 r s s M5 M6 r r Visual order (wysiwyg) P1 P2 P3 M1 M2 M3 M4 M5 M6
Races P1 P2 P3 P1 P2 P3 M1 M1 M2 M2 M3 M3 M4 M4 M5 M6 M6 M5
Causal Order and Races P1 P2 P3 M1 • Sends before matching receive. • Receive or sends before sends of same process. • Two receives on the same process sent from the same process. M2 M3 M4 M5 M6 Races: check if every pair of events ordered by the visual order appears in the transitive closure of the causal order.
M1 s r M2 s r M3 s r s M4 r s s M5 M6 r r Causal Order P1 P2 P3 M1 M2 M3 M4 M5 M6
Calculating the transitive closure • Structure (E, R). • E – Events, R E E. • R* The transitive closure. Defined asfollows:a R*b if there is a sequencex1 x2 … xn where a=x1, b=xn,and xi R xi+1 for 1i<n. • Complexity: cubic. In our case: quadratic (every event has 1 or 2 successors).
Races for HMSCs • Undecidable [MP99] • Idea of proof: • Trasnlate to language theory of semitraces, which are closed w.r.t. commuting certain pairs of letters. • Intuition: moving from visual to causal semantic introduces more commutations. • Reduction to universality of semitrace languages.
P1 P2 P3 connect fail report connect fail report connect approve Visual concatenation A B P1 P2 P3 P1 P2 P3 approve connect P1 P2 P3 P1 P2 P3 fail req_service report Execution: concatenation of a maximal path in the HMSC. C D
Model checking • Write both specification and system as HMSCs. Do concatenation. • Write specification in LTL. Interpret over the linearizations of the partial orders. • In both cases: undecidable.
Post Correspondence Problem • List of pairs:w1:(aab,aa), w2:(aba,ab), … wn:(a,bb).Want to find if we find a set of indexesi1, i2, …, ik, such that concatenatingthe lefthand words and concatenatingthe righthand words is the same. • Supose we take indexes 1, 2, n, 1. We get: • lefthand: aab aba a aab • righthand: aa ab bb aa
P5 P6 P5 P6 P1 P2 P5 P6 P5 P6 PCP reduction Letter match Word match a b P1 P2 P1 P2 P1 P2 a b a a b b b b P3 P4 P3 P4 P3 P4 P3 P4 w1 w2 w2 w1 (aab,bb), (ab,bab),...
Some solutions: • Obtain decidability under the following condition [MP99,AY99]:Every HMSCs cycle covers a strongly connected component in the dependency graph, where events are dependent if they belong to the same process or message. • The specification HMSCs allows any additional messages [MPS98]. • Put limit on message queues [Holzmann]