synchronized composition of labeled transition systemts

28
Synchronized Composition of Labeled Transition System Ang Chen University of Geneva, Switzerland 17.06.2008

Upload: angchen

Post on 02-Jul-2015

823 views

Category:

Education


2 download

DESCRIPTION

How to compose labeled transition system to build large distributed system. With the counter example.

TRANSCRIPT

Page 1: Synchronized Composition Of Labeled Transition SystemTS

Synchronized Composition of Labeled

Transition SystemAng Chen

University of Geneva, Switzerland17.06.2008

Page 2: Synchronized Composition Of Labeled Transition SystemTS

Roadmap

ID-NetControlled System

refinement

ID-NetCFlow

DSL

DSL DSL

DSL

ID-Net Flow

s

t

a

r

t

regis

ter

C

1

C

2

check availability

send

bill

C

4

C

3

ship

goods

receive payment

C

5

C

6

remaind

er

Graphical Design Front-End (Visual Language for Abstract CFlow)

Control flow

Receive

Order

Start

Collect

Payments

Ship

Books

Send

Invoices

End

custom

er Stock

Interaction

transformation

Composition &Refinement

Optimized Process

composition test

DSM

verification

code generation (optional)

Page 3: Synchronized Composition Of Labeled Transition SystemTS

Labeled Transition System

Page 4: Synchronized Composition Of Labeled Transition SystemTS

Transition System

Transition System. A transition system is a quadruple A =< S, T,!, " >where

• S is a finite or infinite set of states,

• T is a finite or infinite set of transitions,

• ! and " are two mappings from T to S which take each transition t in Tto the two states !(t) and "(t), respectively the source and the target ofthe transition t.

4

Page 5: Synchronized Composition Of Labeled Transition SystemTS

Labeled Transition System

Labeled Transition System. A labeled transition system is a quadrupleA =< S, T,A, s0 > where:

• S is a set of states,

• A is a set of actions names (labels), called alphabet

• T ! S"A"S, denoted as sa#$ s!, a % A, s, s! % S, is a transition relation.

! : T $ S, " : T $ S, # : T $ A are mappings from a transition to itssource state, target state, and label, respectively,

• s0 % S is the initial state.

5

Page 6: Synchronized Composition Of Labeled Transition SystemTS

Example: Counter

0

1 2

3t4

t1t3

t2

LTS of counter

It has 4 states {0, 1, 2, 3}, one action inc, initial state 0, and the followingtransitions:

• t1 : 0! inc! 1, !(t1) = 0, "(t1) = inc, #(t1) = 1

• t2 : 1! inc! 2, !(t2) = 1, "(t2) = inc, #(t2) = 2

• t3 : 2! inc! 3, !(t3) = 2, "(t3) = inc, #(t3) = 3

• t4 : 3! inc! 0, !(t4) = 3, "(t4) = inc, #(t4) = 0

6

Page 7: Synchronized Composition Of Labeled Transition SystemTS

Different models for the same semantics

0

x

x+1inc

0+1=11+1=22+1=33+1=0

P0 P1

P2P3

t1

t2

t3

t4

Place/Transition Net model of the counter(Places are Safe)

APN (CO-OPN) model of the counter

They have different labels (action) setThe P/T Net can be considered as an unfolded APN model

7

Page 8: Synchronized Composition Of Labeled Transition SystemTS

LTS: Summary• LTS: State, Action (names), Transition

• Semantics are what we want to have, i.e. LTS

• The same semantics can be realized by different DSL with different syntax

• Composition of LTS can be independent of DSL

• Assumption: LTS transitions are instance of Action (labels). Each LTS transition is always labeled by a label.

8

Page 9: Synchronized Composition Of Labeled Transition SystemTS

Model Composition

Page 10: Synchronized Composition Of Labeled Transition SystemTS

Model Composition

• Synonyms

• communication (e.g. in Process Algebra)

• synchronization (e.g. Petri Net)

• transaction (e.g in CO-OPN)

• Composition implies constraints

10

Page 11: Synchronized Composition Of Labeled Transition SystemTS

Synchronous Product of Transition Systems

• André Arnold

• Free Product: no interaction between components

• Synchronous product

• a subsystem of the free product

• synchronization constraints (implied by interaction)

11

Page 12: Synchronized Composition Of Labeled Transition SystemTS

Arnold’s Synchronous Product of TS

• Only essential synchronization constraints are used

e.g.• program/process P is a TS• boolean variable B is a TS• a constraint is : •“P.read” is synchronized with “B.get”

12

Page 13: Synchronized Composition Of Labeled Transition SystemTS

Synchronous Product of TS vs. CO-OPN transaction

• “when A sends a message to B, B receives it”

A B

A.out//B.in

B.out//A.ackout

with CO-OPN, we can do more: “when B receives a message, it send an acknowledgment to A”

13

Page 14: Synchronized Composition Of Labeled Transition SystemTS

Proposition

Use CO-OPN Transactions operators to specify

synchronization constraints for model composition

14

Page 15: Synchronized Composition Of Labeled Transition SystemTS

Free product of counters

0

1 2

3

System A

inc

inc inc

inc

0

1 2

3

System B

inc

inc

inc

inc

Two simultaneous, independent counters

LTS

Model 0

x

x+1

Ainc 0

x

x+1

Binc

15

Page 16: Synchronized Composition Of Labeled Transition SystemTS

Free Product (interleaving run)

Bt4

00 01 02

10 11 12

20 21 22

03

13

23

30 31 32 33

Bt1 Bt2 Bt3

Bt1 Bt2 Bt3

Bt1 Bt2 Bt3

Bt1 Bt2 Bt3

At1

At2

At3

At1

At2

At3

At1

At2

At3

At1

At2

At3

Bt4

Bt4

Bt4

At4At4At4At4

LTS of the composed system

0

x

x+1

Ainc

0

x

x+1

Binc

16

Page 17: Synchronized Composition Of Labeled Transition SystemTS

Composing the counters: I

0

x

x+1Ainc

0x

x+1Binc

SA SB

x

x+1

y

y+1

Ainc//Binc

Ainc+//Binc+

17

Page 18: Synchronized Composition Of Labeled Transition SystemTS

Composed LTS: I

0

x

x+1Ainc

0x

x+1Binc

SA SB

x

x+1

y

y+1

Ainc//Binc

Ainc+//Binc+

Bt1 Bt2 Bt3

00 01 02

10 11 12

20 21 22

03

13

23

30 31 32 33

Bt1 Bt2 Bt3

Bt1 Bt2 Bt3

Bt1 Bt2 Bt3

At1Bt1

At2Bt1

At3Bt1

At1Bt2

At2Bt3

At3Bt2

At1Bt3

At2Bt3

At3Bt3

At1Bt4

At2Bt4

At3Bt4

At4//Bt4

At4Bt1

At4Bt2

At4Bt3

At1

At2

At3

At1

At2

At3

At1

At2

At3

At1

At2

At3

18

Page 19: Synchronized Composition Of Labeled Transition SystemTS

Composing the counters: II

0

x

x+1Ainc

0

SA SB

x

x+1

y

y+1

Ainc//Binc

Ainc+//Binc

19

Page 20: Synchronized Composition Of Labeled Transition SystemTS

Composing the counters: III

00

x

x+1Binc

SA SB

x

x+1

y

y+1

Ainc//Binc

Ainc//Binc+

20

Page 21: Synchronized Composition Of Labeled Transition SystemTS

Composed LTS: III

Ainc//Binc+

00

x

x+1Binc

SA SB

x

x+1

y

y+1

Ainc//Binc

Bt1 Bt2 Bt3

00 01 02

10 11 12

20 21 22

03

13

23

30 31 32 33

Bt1 Bt2 Bt3

Bt1 Bt2 Bt3

Bt1 Bt2 Bt3

At1Bt1

At2Bt1

At3Bt1

At1Bt2

At2Bt3

At3Bt2

At1Bt3

At2Bt3

At3Bt3

At1Bt4

At2Bt4

At3Bt4

At4//Bt4

At4Bt1

At4Bt2At4Bt3

21

Page 22: Synchronized Composition Of Labeled Transition SystemTS

Composed LTS: IV

00 11 22 33At1Bt1 At2Bt2 At3Bt3

At4Bt4

00

SA SB

x

x+1

y

y+1

Ainc//Binc

LTS

Ainc//Binc

22

Page 23: Synchronized Composition Of Labeled Transition SystemTS

Conditional Synchronizations I

Bt1 Bt2 Bt3

00 01 02

10 11 12

20 21 22

03

13

23

30 31 32 33

Bt1 Bt2 Bt3

Bt1 Bt2 Bt3

Bt1 Bt2 Bt3

At1

At2

At3

At1

At2

At3

At1

At2

At3

At1

At2

At3

SA=3, SB=3::Ainc // Binc (At4//Bt4)SA=3, SB=3::Ainc // Binc

Two counters are synchronized at

each cycle

0

x!=3

x+1Ainc

0x!=3

x+1Binc

SA SB

3

0

3

0

SA=3, SB=3::Ainc//Binc

23

Page 24: Synchronized Composition Of Labeled Transition SystemTS

Conditional Synchronizations II

Bt1 Bt2 Bt3

00 01 02

10 11 12

20 21 22

03

13

23

30 31 32 33

Bt1 Bt2 Bt3

Bt1 Bt2 Bt3

Bt1 Bt2 Bt3

At1

At2

At3

At1

At2

At3

At1

At2

At3

At1

At2

At3

SA=3, SB=3::Ainc // Binc (At4//Bt4)

At4 At4 At4 At4

1). SA=3, SB=3::Ainc+

// Binc

SA=3, SB=3::Ainc+ // Binc

Same as before, but A can resets itself

without synchronizing with B

24

0

x

x+1Ainc

0x!=3

x+1Binc

SA SB

3

0

3

0

SA=3, SB=3::Ainc+//Binc

Page 25: Synchronized Composition Of Labeled Transition SystemTS

Conditional Synchronizations

SA=3, SB=3::Ainc+//Binc+

0

x

x+1Ainc

0x

x+1Binc

SA SB

3

0

3

0

SA=3, SB=3::Ainc//Binc

Both A and B can reset themselves, or they can be synchronized at 0

Bt1 Bt2 Bt3

00 01 02

10 11 12

20 21 22

03

13

23

30 31 32 33

Bt1 Bt2 Bt3

Bt1 Bt2 Bt3

Bt1 Bt2 Bt3

At1

At2

At3

At1

At2

At3

At1

At2

At3

At1

At2

At3

SA=3, SB=3::Ainc // Binc (At4//Bt4)

At4 At4At4

At4

Bt4

Bt4

Bt4

Bt4

2). SA=3, SB=3::Ainc+

//Binc+

25

Page 26: Synchronized Composition Of Labeled Transition SystemTS

More conditional synchronizations

SA=3::Ainc//Binc+

A triggers B at each cycle of A

26

1). SA=3::Ainc//Binc+

Bt1 Bt2 Bt3

00 01 02

10 11 12

20 21 22

03

13

23

30 31 32 33

Bt1 Bt2 Bt3

Bt1 Bt2 Bt3

Bt1 Bt2 Bt3

At1

At2

At3

At1

At2

At3

At1

At2

At3

At1

At2

At3

At4//Bt4

At4Bt1 At4Bt2 At4Bt3

0

x!=3

x+1

Ainc

0

x

x+1

Binc

SA SB

3

0

x

x+1

SA=3::Ainc//Binc+

Page 27: Synchronized Composition Of Labeled Transition SystemTS

More conditional synchronizations

SA=3::Ainc//Binc

0

x!=3

x+1

Ainc

0

SA SB

3

0

x

x+1

SA=3::Ainc//Binc

B is driven by A at each cycle of A

27

00 01 02

10 11 12

20 21 22

03

13

23

30 31 32 33

At1

At2

At3

At1

At2

At3

At1

At2

At3

At1

At2

At3

At4//Bt4

At4Bt1 At4Bt2 At4Bt3

2). SA=3::Ainc//Binc

Page 28: Synchronized Composition Of Labeled Transition SystemTS

Summary

• Use transaction for model composition

• Synchronization constraints: extend transaction with modifiers +,- to control the composition

• Formalization of these composition operators: ongoing work

• Formalism Integration with ID-Net: this summer

28