visual formalisms message sequence charts book: chapter 10

19
Visual Formalisms Message Sequence Charts Book: Chapter 10

Upload: alexa-andersen

Post on 28-Mar-2015

218 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Visual Formalisms Message Sequence Charts Book: Chapter 10

Visual Formalisms

Message Sequence ChartsBook: Chapter 10

Page 2: 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.

Page 3: Visual Formalisms Message Sequence Charts Book: Chapter 10

MSC visual notation

P1 P3P2

M1

M2

M3

M4

M5

M6

Page 4: Visual Formalisms Message Sequence Charts Book: Chapter 10

MSC Textual formmsc 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;

P1 P3P2M1

M2M3M4

M5M6

instance P3; in M2 from P2; in M3 from P2; out M4 to P2; out M6 to P1; endinstance;endmsc;

Page 5: Visual Formalisms Message Sequence Charts Book: Chapter 10

Partial order semantics

P1 P3P2M1

M2M3M4

M5M6

s s

s

s

s

r

r

r

r

r

r

s M1

M2

M3

M4

M5

M6

Page 6: Visual Formalisms Message Sequence Charts Book: Chapter 10

HMSCs

P1 P3P2 P1 P3P2

P1 P3P2P1 P3P2

connect approve

failreq_service

report

Page 7: Visual Formalisms Message Sequence Charts Book: Chapter 10

Visual semantics

Sends before corresponding receives.

Events on the same process line execute in order of appearance, from top to bottom.

Page 8: Visual Formalisms Message Sequence Charts Book: Chapter 10

Visual order (wysiwyg)

If some event (send, receive) is higher on the line than another, it comes first.

Sends precede matching receives.

P1 P3P2M1

M2M3M4

M5M6

Page 9: Visual Formalisms Message Sequence Charts Book: Chapter 10

Visual order (wysiwyg)

P1 P3P2M1

M2M3M4

M5M6

s s

s

s

s

r

r

r

r

r

r

s M1

M2

M3

M4

M5

M6

Page 10: Visual Formalisms Message Sequence Charts Book: Chapter 10

Races

P1 P3P2M1

M2M3M4

M5M6

P1 P3P2M1

M2M3M4

M5M6

Page 11: Visual Formalisms Message Sequence Charts Book: Chapter 10

Causal Order and Races

•Sends before matching receive.

•Receive or sends before sends of same process.

•Two receives on the same process sent from the same process.

P1 P3P2M1

M2M3M4

M5M6

Races: check if every pair of events ordered by the visual order appears in the transitive closure of the causal order.

Page 12: Visual Formalisms Message Sequence Charts Book: Chapter 10

Causal Order

P1 P3P2M1

M2M3M4

M5M6

s s

s

s

s

r

r

r

r

r

r

s M1

M2

M3

M4

M5

M6

Page 13: Visual Formalisms Message Sequence Charts Book: Chapter 10

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 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).

Page 14: Visual Formalisms Message Sequence Charts Book: Chapter 10

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.

Page 15: Visual Formalisms Message Sequence Charts Book: Chapter 10

Visual concatenation

P1 P3P2 P1 P3P2

P1 P3P2P1 P3P2

connect approve

failreq_service

report

P1 P2 P3

connect

failreport

approve

connect

connect

fail

report

A B

C DExecution: concatenation of a maximal path in the HMSC.

Page 16: Visual Formalisms Message Sequence Charts Book: Chapter 10

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.

Page 17: Visual Formalisms Message Sequence Charts Book: Chapter 10

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

Page 18: Visual Formalisms Message Sequence Charts Book: Chapter 10

PCP reduction

P1 P2

P3 P4P3 P4

P1 P2

P5 P6

P5 P6

ab

a ab

P5 P6

P5 P6

P1 P2

P3 P4P3 P4

P1 P2

w2

b

w1

b

(aab,bb),

(ab,bab),...

Word

match

Letter match

w1

w2

bab

Page 19: Visual Formalisms Message Sequence Charts Book: Chapter 10

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]