Weakly endochronous systems Dumitru Potop-Butucaru IRISA, France Joint work with A. Benveniste and...

53
Weakly endochronous systems Dumitru Potop-Butucaru IRISA, France Joint work with A. Benveniste and B. Caillaud

Transcript of Weakly endochronous systems Dumitru Potop-Butucaru IRISA, France Joint work with A. Benveniste and...

Page 1: Weakly endochronous systems Dumitru Potop-Butucaru IRISA, France Joint work with A. Benveniste and B. Caillaud.

Weakly endochronous systems

Dumitru Potop-Butucaru

IRISA, France

Joint work with A. Benveniste and B. Caillaud

Page 2: Weakly endochronous systems Dumitru Potop-Butucaru IRISA, France Joint work with A. Benveniste and B. Caillaud.

Outline

• Introduction (the distribution problem)

• Weakly endochronous systems

• Applications– Weak isochrony– Main result

• Conclusion

Page 3: Weakly endochronous systems Dumitru Potop-Butucaru IRISA, France Joint work with A. Benveniste and B. Caillaud.

module M: input A,B,R;relation A#R,B#R;abort loop await A || await B endwhen Rend module

0 2

3

1

RR

R

A,BAB

BA

Page 4: Weakly endochronous systems Dumitru Potop-Butucaru IRISA, France Joint work with A. Benveniste and B. Caillaud.

A

B

BA

R

inputSynchrony

– Global clock, reactions– Can test the absence– Composition:

• synchronized product

(unification on reactions)

0 2

3

1

RR

R

A,BAB

BA

Page 5: Weakly endochronous systems Dumitru Potop-Butucaru IRISA, France Joint work with A. Benveniste and B. Caillaud.

A

B

BA

R

inputAsynchrony

– No global clock– No reaction, no absence– Composition:

• unification of FIFO histories

0 2

3

1

RR

R

A,BAB

BA

Page 6: Weakly endochronous systems Dumitru Potop-Butucaru IRISA, France Joint work with A. Benveniste and B. Caillaud.

A

B

BA

R

input

0 2

3

1

RR

R

A,BAB

BA

executive

A

B

BA

R

Good executions

BA

R

BA

Asynchrony– No global clock– No reaction, no absence– Composition:

• unification of FIFO histories

Page 7: Weakly endochronous systems Dumitru Potop-Butucaru IRISA, France Joint work with A. Benveniste and B. Caillaud.

AB

BA

R

input

0 2

3

1

RR

R

A,BAB

BA

executive

R

Bad executions

Asynchrony– No global clock– No reaction, no absence– Composition:

• unification of FIFO histories

A

R

Page 8: Weakly endochronous systems Dumitru Potop-Butucaru IRISA, France Joint work with A. Benveniste and B. Caillaud.

Model

• Components = synchronous automatons

no causality• Synchronous composition (automaton product)

Σ1Σ2

• Desynchronization operator

• Asynchronous composition (on traces)

43

2

1

34

21

δ

1321

13321a b c d a b c

Page 9: Weakly endochronous systems Dumitru Potop-Butucaru IRISA, France Joint work with A. Benveniste and B. Caillaud.

Model

• Correct resynchronization (Benveniste):

(L(Σ1Σ2)) = (L(Σ1))||(L(Σ2))

• Intuition:

– the asynchronous observations do not

change when changing FIFO size and delay

• Condition on infinite traces…

Page 10: Weakly endochronous systems Dumitru Potop-Butucaru IRISA, France Joint work with A. Benveniste and B. Caillaud.

Previous work

• Latency-insensitivity (Carloni et al., 1999)– Hardware-directed (handle long wires)– Use all channels in each reaction

(transmit values)• Monoclock – not efficient• Difficult to re-configure the communication scheme

– Extension: Singh and Theobald, 2003

• Endo/Isochrony (Benveniste et al., 2000)

Page 11: Weakly endochronous systems Dumitru Potop-Butucaru IRISA, France Joint work with A. Benveniste and B. Caillaud.

Endo/Isochrony

• An endochronous component decides itself how to read its inputs– No event-driven, no real concurrency, determinism!– Comparable to Kahn processes (but no causality)– Executive = state machine and blocking reads

• A pair of components is isochronous if no incorrect synchronization takes place

• Compositionality problem– Endochrony is not compositional– Difficult to generalize isochrony to >2 components

Page 12: Weakly endochronous systems Dumitru Potop-Butucaru IRISA, France Joint work with A. Benveniste and B. Caillaud.

AB

BA

R

input

0 2

3

1

RR

R

A,BAB

BA

executive

R

Bad executions

A

R

Page 13: Weakly endochronous systems Dumitru Potop-Butucaru IRISA, France Joint work with A. Benveniste and B. Caillaud.

AB

BA

R

input

Event-executive

0

0

1

0

0

1

0 2

3

1

R,E=1

A,D=0

B,E=0

B,E=0

A,D=0

A,B,D=E=0

R,D=E=1

R,D=1

What I want– Non-determinism

(Event-driven execution)

Page 14: Weakly endochronous systems Dumitru Potop-Butucaru IRISA, France Joint work with A. Benveniste and B. Caillaud.

Weak endochrony

• Independent reactions =non-overlapping, fully commuting

• Weak endochrony = allow online re-synchronization in any environment without restricting concurrency between independent reactions:– Choice between non-independent reactions is

visible on a channel– Causal ordering of reactions is visible on a

channel

Page 15: Weakly endochronous systems Dumitru Potop-Butucaru IRISA, France Joint work with A. Benveniste and B. Caillaud.

• Non-independent reactions share a common support variable with different value

• Non-independent causally ordered reactions share a common variable

0 2

3

1

R,E=1

A,D=0

B,E=0

B,E=0

A,D=0

A,B,D=E=0

R,D=E=1

R,D=1

Weak endochrony

Page 16: Weakly endochronous systems Dumitru Potop-Butucaru IRISA, France Joint work with A. Benveniste and B. Caillaud.

1. Determinism: ss1, ss2r1=r2

2. Commutation: if r1,r2 do not share present values

• ss1, ss2s’:ss’

• ss1s2s’:ss2

3. Decomposition: if ss1, ss2 and r1, r2 do not share present variables with different values

Weak endochrony axiomsr1 r2

r1 r2 r1r2

r1 r2 r2

s’:ss’

r1 r2

r1r2

s1

s2

r1\r2

r2\r1

Page 17: Weakly endochronous systems Dumitru Potop-Butucaru IRISA, France Joint work with A. Benveniste and B. Caillaud.

• All reactions are composed of atoms

• Disjoint atoms in a state fully commute and can be freely combined

0 2

3

1

R,E=1

A,D=0

B,E=0

B,E=0

A,D=0

A,B,D=E=0

R,D=E=1

R,D=1

Properties

State 0 atoms:(A,D=0),(B,E=0),(R,D=E=1)

State 1 atoms:(B,E=0),(R,E=1)

Page 18: Weakly endochronous systems Dumitru Potop-Butucaru IRISA, France Joint work with A. Benveniste and B. Caillaud.

• Mazurkiewicz traces over atoms– The letters are the atoms, disjoint atoms are

independent– Normal form

• trace equivalence upto commutation of atoms• take at each reaction the maximal reaction (unique)

– Confluence for a given history

• Tetris-like heaps (gravity => normal form)• Generalization of endochrony, latency-

insensitivity

Related models

Page 19: Weakly endochronous systems Dumitru Potop-Butucaru IRISA, France Joint work with A. Benveniste and B. Caillaud.

Consequences

• Accept concurrency between independent behaviors– non-determinism– support event-driven implementations

• Compositionality:Σ1,Σ2 weakly endochronous

Σ1Σ2 weakly endochronous

Page 20: Weakly endochronous systems Dumitru Potop-Butucaru IRISA, France Joint work with A. Benveniste and B. Caillaud.

Simpler correctness criterion

(s1,s2)RSS(Σ1Σ2),iΣi(si),i=1,2: 1||2 exists

1,2 are both void traces

or

Σ1Σ2 can perform a common transition

• Still not an online correctness criterion!

Page 21: Weakly endochronous systems Dumitru Potop-Butucaru IRISA, France Joint work with A. Benveniste and B. Caillaud.

Weak isochrony

(s1,s2)RSS(Σ1Σ2), ai atom in Σi(si), i=1,2, Ai reaction in Σi(si) such that

• A1||A2 maximal• ai Ai,i=1,2

i reaction in Σi(si), i=1,2 such that• ai i Ai,i=1,21||2 exists

Page 22: Weakly endochronous systems Dumitru Potop-Butucaru IRISA, France Joint work with A. Benveniste and B. Caillaud.

Correct desynchronization

Theorem

If Σ1,Σ2 weakly endochronous, (Σ1,Σ2) weakly isochronous then:

(L(Σ1Σ2)) = (L(Σ1))||(L(Σ2))

Page 23: Weakly endochronous systems Dumitru Potop-Butucaru IRISA, France Joint work with A. Benveniste and B. Caillaud.

Methodology

1. Make components weakly endochronous by deciding which signals are missing

2. Incrementally build communication protocols that insure the weak isochrony

3. Remove the useless variables created at point (1)

Page 24: Weakly endochronous systems Dumitru Potop-Butucaru IRISA, France Joint work with A. Benveniste and B. Caillaud.

Conclusion

• Weak endochrony/isochrony – Compositional– Supports the development of communication

protocols that minimize communication– Not yet effective (not efficiently)– No causality

• Future:– Define appropriate algorithms– Extend with causality

Page 25: Weakly endochronous systems Dumitru Potop-Butucaru IRISA, France Joint work with A. Benveniste and B. Caillaud.
Page 26: Weakly endochronous systems Dumitru Potop-Butucaru IRISA, France Joint work with A. Benveniste and B. Caillaud.
Page 27: Weakly endochronous systems Dumitru Potop-Butucaru IRISA, France Joint work with A. Benveniste and B. Caillaud.
Page 28: Weakly endochronous systems Dumitru Potop-Butucaru IRISA, France Joint work with A. Benveniste and B. Caillaud.

Weak isochrony

(s1,s2)RSS(Σ1Σ2), ai atom in Σi(si), i=1,2, Ai reaction in Σi(si) such that

• A1||A2 maximal• ai Ai,i=1,2

i reaction in Σi(si), i=1,2 such that• ai i Ai,i=1,21||2 exists

Page 29: Weakly endochronous systems Dumitru Potop-Butucaru IRISA, France Joint work with A. Benveniste and B. Caillaud.
Page 30: Weakly endochronous systems Dumitru Potop-Butucaru IRISA, France Joint work with A. Benveniste and B. Caillaud.

Synchrony and asynchrony

• Composition:– Synchronous composition

– Asynchronous composition

Σ1 Σ2

1

2 2

1

Σ1||Σ2:

Σ1Σ2:

Σ1 Σ2

1

2 2

1

rejected

accepted

Page 31: Weakly endochronous systems Dumitru Potop-Butucaru IRISA, France Joint work with A. Benveniste and B. Caillaud.

Desynchronization

• Stuttering-invariant synchronous specification, distributed architecture (FIFOs)

• Two aspects:– Correct re-synchronization

– Causality, full asynchrony

Σ1 Σ2

1

2 2

1FIFO

FIFOWRONG

Page 32: Weakly endochronous systems Dumitru Potop-Butucaru IRISA, France Joint work with A. Benveniste and B. Caillaud.

Correct resynchronization

• Model – labeled synchronous transition systems – synchronous, n-place bidirectional buffers – no causality

• Correctness criterion: – the traces accepted with empty buffers do not

change from n=0 to n=

Σ1 Σ2

1

2 2

1Bn

Bn

Page 33: Weakly endochronous systems Dumitru Potop-Butucaru IRISA, France Joint work with A. Benveniste and B. Caillaud.

Correct resynchronization

• Equivalent formulation (Benveniste):

(L(Σ1Σ2)) = (L(Σ1))||(L(Σ2))

= desynchronization operator

|| = composition of asynchronous traces (equality on interface union)

01112

11021

δ

Page 34: Weakly endochronous systems Dumitru Potop-Butucaru IRISA, France Joint work with A. Benveniste and B. Caillaud.

Previous work

• Latency-insensitivity (Carloni et al., 1999)– Hardware-directed (handle long wires)– A component reads/emits all its inputs, or none – Monoclock– Endochrony-like extensions (Singh and

Theobald, 2003)

• Endo/Isochrony (Benveniste et al., 2000)

Page 35: Weakly endochronous systems Dumitru Potop-Butucaru IRISA, France Joint work with A. Benveniste and B. Caillaud.

Endo/Isochrony

• An endochronous component decides itself how to read its inputs Kahn!!!– Determinism, no real concurrency

• A pair of components is isochronous if non-contradictory reactions can be fully unified

• Compositionality problem– Endochrony is not compositional– Difficult to generalize isochrony to >2

components

Page 36: Weakly endochronous systems Dumitru Potop-Butucaru IRISA, France Joint work with A. Benveniste and B. Caillaud.

Weakly endochronous systems

• Allow online re-synchronization in any environment without restricting concurrency:– Each computation choice is visible on an

interface variable

– Causally ordered reactions share a common variable 1

2

10

20

2

1

21

10

or

after

Page 37: Weakly endochronous systems Dumitru Potop-Butucaru IRISA, France Joint work with A. Benveniste and B. Caillaud.

Weakly endochronous systems

• Example

• Not weakly endochronous.

0 2

3

1

R

module M: input A,B,R;relation A#R,B#R;abort loop await A || await B endwhen Rend module

RR

A,BAB

BA

Page 38: Weakly endochronous systems Dumitru Potop-Butucaru IRISA, France Joint work with A. Benveniste and B. Caillaud.

Weakly endochronous systems

• Example

0 2

3

1

R,E=1

A,D=0

B,E=0

B,E=0

A,D=0

A,B,D=E=0

R,D=E=1

R,D=1

module M: input A,B,R;relation A#R,B#R;abort loop await A || await B endwhen Rend module

Page 39: Weakly endochronous systems Dumitru Potop-Butucaru IRISA, France Joint work with A. Benveniste and B. Caillaud.

Weakly endochronous systems

• All reactions are composed of atoms

• Disjoint atoms in a state fully commute and can be freely combined

• A reaction can be decomposed into its atoms

0 2

3

1

R,E=1

A,D=0

B,E=0

B,E=0

A,D=0

A,B,D=E=0

R,D=E=1

R,D=1State 0 atoms:

(A,D=0),(B,E=0),(R,D=E=1)

State 1 atoms:(B,E=0),(R,E=1)

Page 40: Weakly endochronous systems Dumitru Potop-Butucaru IRISA, France Joint work with A. Benveniste and B. Caillaud.

Related models

• Mazurkiewicz traces over atoms– The letters are the atoms, disjoint atoms are

independent– Normal form

• trace equivalence upto commutation of atoms• take at each reaction the maximal reaction (unique)

– Confluence for a given history

• Tetris-like heaps (gravity => normal form)

• Generalization of endochrony

Page 41: Weakly endochronous systems Dumitru Potop-Butucaru IRISA, France Joint work with A. Benveniste and B. Caillaud.

Consequences

• Accept concurrency between independent behaviors– non-determinism– support event-driven implementations

• Normal form

• Compositionality:Σ1,Σ2 weakly endochronous

Σ1Σ2 weakly endochronous

Page 42: Weakly endochronous systems Dumitru Potop-Butucaru IRISA, France Joint work with A. Benveniste and B. Caillaud.

Simpler correctness criterion

(s1,s2)RSS(Σ1Σ2),iΣi(si),i=1,2: 1||2 exists

1,2 are both void traces

or

Σ1Σ2 can perform a common transition

• Weak endochrony online correctness criterion!

Page 43: Weakly endochronous systems Dumitru Potop-Butucaru IRISA, France Joint work with A. Benveniste and B. Caillaud.

Weak isochrony

(s1,s2)RSS(Σ1Σ2), ai atom in Σi(si), i=1,2, Ai reaction in Σi(si) such that

• A1||A2 maximal• ai Ai,i=1,2

i reaction in Σi(si), i=1,2 such that• ai i Ai,i=1,21||2 exists

Page 44: Weakly endochronous systems Dumitru Potop-Butucaru IRISA, France Joint work with A. Benveniste and B. Caillaud.

Weak isochrony

(s1,s2)RSS(Σ1Σ2), ai atom in Σi(si), i=1,2, Ai reaction in Σi(si) such that

• A1||A2 maximal• ai Ai,i=1,2

i reaction in Σi(si), i=1,2 such that• ai i Ai,i=1,21||2 exists

Page 45: Weakly endochronous systems Dumitru Potop-Butucaru IRISA, France Joint work with A. Benveniste and B. Caillaud.

Correct desynchronization

Theorem

If Σ1,Σ2 weakly endochronous, (Σ1,Σ2) weakly isochronous then:

(L(Σ1Σ2)) = (L(Σ1))||(L(Σ2))

Page 46: Weakly endochronous systems Dumitru Potop-Butucaru IRISA, France Joint work with A. Benveniste and B. Caillaud.

Conclusion

• Weak endochrony/isochrony – Compositional– Supports the development of communication

protocols that minimize communication– Not yet effective (not efficiently)– No causality

• Future:– Define appropriate algorithms– Extend with causality

Page 47: Weakly endochronous systems Dumitru Potop-Butucaru IRISA, France Joint work with A. Benveniste and B. Caillaud.

Methodology

1. Make components weakly endochronous by deciding which signals are missing

2. Incrementally build communication protocols that insure the weak isochrony

3. Remove the useless variables created at point (1)

Page 48: Weakly endochronous systems Dumitru Potop-Butucaru IRISA, France Joint work with A. Benveniste and B. Caillaud.
Page 49: Weakly endochronous systems Dumitru Potop-Butucaru IRISA, France Joint work with A. Benveniste and B. Caillaud.

Weakly endochronous systems

• Composition– Weak endochrony is compositional– Weak endochrony insures the equivalence

between C1 and C2– Re-synchrhronize a atome pres– Confluence, unique etat pour une histoire

donnee

Page 50: Weakly endochronous systems Dumitru Potop-Butucaru IRISA, France Joint work with A. Benveniste and B. Caillaud.

Correct resynchronization

• Correctness criterion, revisited:

L0(Σ1Σ2B0B0) = L0(Σ1Σ2BB)

• Equivalent formulation (Benveniste):

(L(Σ1Σ2)) = (L(Σ1))||(L(Σ2)) = desynchronization operator

|| = composition of asynchronous traces (equality on interface union)

01112

11021

δ

Page 51: Weakly endochronous systems Dumitru Potop-Butucaru IRISA, France Joint work with A. Benveniste and B. Caillaud.

Weakly endochronous systems

• Example

module M: input A,B,R;output E,F:integer;relation A#R,B#R;abort await immediate A;emit E(0)|| await immediate B;emit F(0)when R;emit E(1);emit F(1)end module

emit A;emit C;await immediate

await immediate C;emit R;

FIFO

FIFO

FIFO

A

R

C

AFIFO

Page 52: Weakly endochronous systems Dumitru Potop-Butucaru IRISA, France Joint work with A. Benveniste and B. Caillaud.

Weakly endochronous systems

• Examplemodule M: input A,B,R;relation A#R,B#R;abort await immediate A|| await immediate Bwhen Rend module

emit A;emit R

FIFO

FIFOR

AB

Page 53: Weakly endochronous systems Dumitru Potop-Butucaru IRISA, France Joint work with A. Benveniste and B. Caillaud.

Weakly endochronous systems

• Example

emit A;assert ?D=1;emit R;assert ?D=0;

module M:input A,B,R;output D,E:int;relation A#R,B#R;abort await immediate A;emit D(1)|| await immediate B;emit E(1)when R do emit D(0);emit E(0) endend module

A

BR

D