34
Communicating Timed Automata Pavel Krčál Wang Yi Uppsala University [CAV’06]

Communicating Timed Automata

  • Upload
    zelda

  • View
    36

  • Download
    0

Embed Size (px)

DESCRIPTION

Communicating Timed Automata. Pavel Krčál Wang Yi Uppsala University [CAV’06]. Goal. Real time tasks A, B, C, D Read inputs from channels and write output to channels Channel under/overflow is an issue Channel machines (Communicating finite state machines) - PowerPoint PPT Presentation

Citation preview

Page 1: Communicating Timed Automata

Communicating Timed Automata

Pavel KrčálWang Yi

Uppsala University

[CAV’06]

Page 2: Communicating Timed Automata

2006/07/06Pavel Krčál, Communicating Timed Automata

Goal

A B C DCommands High-level inst

Precise moves

requests

mission

Real time tasks A, B, C, D Read inputs from channels and write output to channels Channel under/overflow is an issue

Channel machines (Communicating finite state machines) Computing in the common (real) time Verification – reachability, boundedness

Page 3: Communicating Timed Automata

2006/07/06Pavel Krčál, Communicating Timed Automata

Outline Communicating Finite State Machines (Channel Systems)

Known results

Communicating Timed Automata Definition, Subclasses Main results

One Channel Reordering technique How to handle the dense time

Two Channels Reordering technique Eager reading – Turing power

Page 4: Communicating Timed Automata

2006/07/06Pavel Krčál, Communicating Timed Automata

Communicating Finite State Machines Finite automata connected by unbounded (FIFO)

unidirectional channels Labels on transitions: a letter, read/write, channel State: (s1, …, sn, w1, …, wm)

a!,c1

b?,c2

d!,c1a!,c1

a?,c1

d?,c1

b!,c2

a?,c1

c1

c2

Page 5: Communicating Timed Automata

2006/07/06Pavel Krčál, Communicating Timed Automata

Communicating Finite State Machines Finite automata connected by unbounded (FIFO)

unidirectional channels – a model for protocols Labels on transitions: a letter, read/write, channel State: (s1, …, sn, w1, …, wm)

a!,c1

b?,c2

d!,c1a!,c1

a?,c1

d?,c1

b!,c2

a?,c1

c1

c2

Asynchronous!

Page 6: Communicating Timed Automata

2006/07/06Pavel Krčál, Communicating Timed Automata

Communicating Finite State Machines

a!,c1

b?,c2

d!,c1a!,c1

a?,c1

d?,c1

b!,c2

a?,c1

c1

c2

Finite automata connected by unbounded (FIFO) unidirectional channels

Labels on transitions: a letter, read/write, channel State: (s1, …, sn, w1, …, wm)

Page 7: Communicating Timed Automata

2006/07/06Pavel Krčál, Communicating Timed Automata

Communicating Finite State Machines

a!,c1

b?,c2

d!,c1a!,c1

a?,c1

d?,c1

b!,c2

a?,c1

c1

c2

a

Finite automata connected by unbounded (FIFO) unidirectional channels

Labels on transitions: a letter, read/write, channel State: (s1, …, sn, w1, …, wm)

Page 8: Communicating Timed Automata

2006/07/06Pavel Krčál, Communicating Timed Automata

Communicating Finite State Machines

a!,c1

b?,c2

d!,c1a!,c1

a?,c1

d?,c1

b!,c2

a?,c1

c1

c2

Finite automata connected by unbounded (FIFO) unidirectional channels

Labels on transitions: a letter, read/write, channel State: (s1, …, sn, w1, …, wm)

Page 9: Communicating Timed Automata

2006/07/06Pavel Krčál, Communicating Timed Automata

Communicating Finite State Machines

a!,c1

b?,c2

d!,c1a!,c1

a?,c1

d?,c1

b!,c2

a?,c1

c1

c2

b

Finite automata connected by unbounded (FIFO) unidirectional channels

Labels on transitions: a letter, read/write, channel State: (s1, …, sn, w1, …, wm)

Page 10: Communicating Timed Automata

2006/07/06Pavel Krčál, Communicating Timed Automata

Communicating Finite State Machines

a!,c1

b?,c2

d!,c1a!,c1

a?,c1

d?,c1

b!,c2

a?,c1

c1

c2

b b

Finite automata connected by unbounded (FIFO) unidirectional channels

Labels on transitions: a letter, read/write, channel State: (s1, …, sn, w1, …, wm)

Page 11: Communicating Timed Automata

2006/07/06Pavel Krčál, Communicating Timed Automata

Communicating Finite State Machines

a!,c1

b?,c2

d!,c1a!,c1

a?,c1

d?,c1

b!,c2

a?,c1

c1

c2

b b b

Finite automata connected by unbounded (FIFO) unidirectional channels

Labels on transitions: a letter, read/write, channel State: (s1, …, sn, w1, …, wm)

Page 12: Communicating Timed Automata

2006/07/06Pavel Krčál, Communicating Timed Automata

Communicating Finite State Machines

a!,c1

b?,c2

d!,c1a!,c1

a?,c1

d?,c1

b!,c2

a?,c1

c1

c2

b b

Finite automata connected by unbounded (FIFO) unidirectional channels

Labels on transitions: a letter, read/write, channel State: (s1, …, sn, w1, …, wm)

Page 13: Communicating Timed Automata

2006/07/06Pavel Krčál, Communicating Timed Automata

Communicating Finite State Machines

a!,c1

b?,c2

d!,c1a!,c1

a?,c1

d?,c1

b!,c2

a?,c1

c1

c2

b b

d

Finite automata connected by unbounded (FIFO) unidirectional channels

Labels on transitions: a letter, read/write, channel State: (s1, …, sn, w1, …, wm)

Page 14: Communicating Timed Automata

2006/07/06Pavel Krčál, Communicating Timed Automata

Communicating Finite State Machines

a!,c1

b?,c2

d!,c1a!,c1

a?,c1

d?,c1

b!,c2

a?,c1

c1

c2

b b

da

Finite automata connected by unbounded (FIFO) unidirectional channels

Labels on transitions: a letter, read/write, channel State: (s1, …, sn, w1, …, wm)

Page 15: Communicating Timed Automata

2006/07/06Pavel Krčál, Communicating Timed Automata

Some Results (Old) Turing power

Equivalent to finite automata

people: Brand, Zafiropulo, Pachl, Purush Iyer, Finkel, Abdulla, Jonsson, Schnoebelen, …

A B AA B

A B C A BHalf duplex

Page 16: Communicating Timed Automata

2006/07/06Pavel Krčál, Communicating Timed Automata

Communicating Timed Automata (CTA) Replace Finite Automata by Timed Automata

Communication via unbounded FIFO channels Time is global (time passes globally and for all automata in

the same pace) A, B, C – Timed Automata

A CB

Negative results carry over Positive results – do not carry over (previous proofs do not

work in the timed setting)

Page 17: Communicating Timed Automata

2006/07/06Pavel Krčál, Communicating Timed Automata

Communicating Timed Automata – Semantics

State: (sA, sB, A, B, w) sA, sB – locations of A,B A, B – clock valuations w – channel content (a word from Σ*)

Transitions: Time pass: A+t, B+t Discrete transition: s s’, A produces (w a∙w),

B consumes (w∙a w); timed automata guards Lazy vs. eager reading

Language: accepting states, words produced by A We show that both dense & discrete time give the same

expressivity.

A B

Page 18: Communicating Timed Automata

2006/07/06Pavel Krčál, Communicating Timed Automata

Communicating Timed Automata – Results

Accepts non-regular context free languages, e.g., anban

Only regular languages in the untimed case! Equivalent to Petri nets with one unbounded place (eager

reading: One-counter machines)

A CB

Non-context free context sensitive languages, e.g., (anbanb)*

Petri nets with two unbounded places (eager reading: Turing machines)

A B

Page 19: Communicating Timed Automata

2006/07/06Pavel Krčál, Communicating Timed Automata

Untimed Case – Reordering Technique

Equivalent to finite automata

A B …

Reordering of the computation 1st phase: there is at most one letter in each channel 2nd phase: letters are not read

When A produces a letter then it stops. B runs until it reads the letter from the channel. Then A continues again…

Page 20: Communicating Timed Automata

2006/07/06Pavel Krčál, Communicating Timed Automata

Reordering Technique

a!,c1

b!,c1

d!,c1

a?,c1

d?,c1

a?,c1

…c1

b?,c1

Untimed Case – Reordering Technique

Page 21: Communicating Timed Automata

2006/07/06Pavel Krčál, Communicating Timed Automata

Reordering Technique

a!,c1

b!,c1

d!,c1

a?,c1

d?,c1

a?,c1

…c1

b?,c1

a

Untimed Case – Reordering Technique

Page 22: Communicating Timed Automata

2006/07/06Pavel Krčál, Communicating Timed Automata

Reordering Technique

a!,c1

b!,c1

d!,c1

a?,c1

d?,c1

a?,c1

…c1

b?,c1

Untimed Case – Reordering Technique

Page 23: Communicating Timed Automata

2006/07/06Pavel Krčál, Communicating Timed Automata

Reordering Technique

a!,c1

b!,c1

d!,c1

a?,c1

d?,c1

a?,c1

…c1

b?,c1

b

Untimed Case – Reordering Technique

Page 24: Communicating Timed Automata

2006/07/06Pavel Krčál, Communicating Timed Automata

Reordering Technique

a!,c1

b!,c1

d!,c1

a?,c1

d?,c1

a?,c1

…c1

b?,c1

b

Untimed Case – Reordering Technique

Page 25: Communicating Timed Automata

2006/07/06Pavel Krčál, Communicating Timed Automata

Reordering Technique

a!,c1

b!,c1

d!,c1

a?,c1

d?,c1

a?,c1

…c1

b?,c1

Untimed Case – Reordering Technique

Page 26: Communicating Timed Automata

2006/07/06Pavel Krčál, Communicating Timed Automata

Reordering Technique

a!,c1

b!,c1

d!,c1

a?,c1

d?,c1

a?,c1

…c1

b?,c1

d

Untimed Case – Reordering Technique

Page 27: Communicating Timed Automata

2006/07/06Pavel Krčál, Communicating Timed Automata

Reordering Technique

a!,c1

b!,c1

d!,c1

a?,c1

d?,c1

a?,c1

…c1

b?,c1

d

Untimed Case – Reordering Technique

Page 28: Communicating Timed Automata

2006/07/06Pavel Krčál, Communicating Timed Automata

Reordering Technique

a!,c1

b!,c1

d!,c1

a?,c1

d?,c1

a?,c1

…c1

b?,c1

Untimed Case – Reordering Technique

Page 29: Communicating Timed Automata

2006/07/06Pavel Krčál, Communicating Timed Automata

CTA with One Channel We try to modify the reordering technique such that it

works also for timed automata

But for this we need to desynchronize timed automata - desynchronized semantics [CONCUR’98, BJLY]

A desired semantics: language equivalent to the original one a state with finite control and a counter

Reordering of the computation1st phase: there is at most one letter in the channel2nd phase: letters are not read

Page 30: Communicating Timed Automata

2006/07/06Pavel Krčál, Communicating Timed Automata

CTA with One Channel We are able to desynchronize timed automata and

resynchronize them correctly later! We need to limit all possible resynchronizations (only some

are correct) Clock Difference Relations [FSTTCS’05, PK]

tA – x ◊ tB – y

tA – x ◊ 1 – (tB – y)

x – tA ◊ tB – y … x – a clock of A, y – a clock of B, ◊ {<,>,=}

Semantics:(A, B) satisfies tA – x ◊ tB – y fr(A(tA))-fr(A(x)) ◊ fr(B(tB))-fr(B(y))

Page 31: Communicating Timed Automata

2006/07/06Pavel Krčál, Communicating Timed Automata

CTA with One Channel Desynchronization + CDR

Now we can encode the state of a CTA (with desynchronized semantics) by finite state control and a counter

finiteunbounded place/counter

state: (sA, sB, DA, DB, tA◊tB , CDR, w, N)

Page 32: Communicating Timed Automata

2006/07/06Pavel Krčál, Communicating Timed Automata

One Counter Machines Counter – number of a’s in the channel Control unit – locations of A, B

q1: C++; goto q2

A: s1 s2 B: s1 s2

q1: if C=0 then goto q2 else C--; goto q3

a!

b!

a?

b?

b?

A: s1

s2

s3

B: s1

s2

s3

error

Page 33: Communicating Timed Automata

2006/07/06Pavel Krčál, Communicating Timed Automata

CTA with Two Channels Similar desynchronization, needs two unbounded places

Eager reading: can simulate Two-Counter Machines Two channels can check whether the input word is

anbanbanbanb… Each pair anban is context free (one channel is enough to

check this), overlap is checked using ‘alternation’ Counters C,D (valued c,d) are encoded by number of a’s: n =

2c∙3d C: doubling/halving of the number of a’s (anba2n is context

free), D: multiplication/division by three Test for zero: modulo two/three

Page 34: Communicating Timed Automata

2006/07/06Pavel Krčál, Communicating Timed Automata

Conclusions Synchrony makes analysis more difficult One channel:

Some context free languages (contrast with the asynchronous case)

Petri Nets with one unbounded place/One-counter machine Reachability/boundedness questions decidable

Two channels: Some context sensitive languages Petri Nets with two unbounded places/Turing Machine Eager reading – most questions undecidable

Further questions? Abstraction of the channels? Controllers for CTA?