Weakly endochronous systems Dumitru Potop-Butucaru IRISA, France Joint work with A. Benveniste and...
-
Upload
peter-washington -
Category
Documents
-
view
215 -
download
0
Transcript of Weakly endochronous systems Dumitru Potop-Butucaru IRISA, France Joint work with A. Benveniste and...
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
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
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
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
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
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
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
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…
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)
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
AB
BA
R
input
0 2
3
1
RR
R
A,BAB
BA
executive
R
Bad executions
A
R
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)
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
• 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
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
• 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)
• 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
Consequences
• Accept concurrency between independent behaviors– non-determinism– support event-driven implementations
• Compositionality:Σ1,Σ2 weakly endochronous
Σ1Σ2 weakly endochronous
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!
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
Correct desynchronization
Theorem
If Σ1,Σ2 weakly endochronous, (Σ1,Σ2) weakly isochronous then:
(L(Σ1Σ2)) = (L(Σ1))||(L(Σ2))
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)
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
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
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
Desynchronization
• Stuttering-invariant synchronous specification, distributed architecture (FIFOs)
• Two aspects:– Correct re-synchronization
– Causality, full asynchrony
Σ1 Σ2
1
2 2
1FIFO
FIFOWRONG
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
Correct resynchronization
• Equivalent formulation (Benveniste):
(L(Σ1Σ2)) = (L(Σ1))||(L(Σ2))
= desynchronization operator
|| = composition of asynchronous traces (equality on interface union)
01112
11021
δ
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)
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
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
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
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
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)
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
Consequences
• Accept concurrency between independent behaviors– non-determinism– support event-driven implementations
• Normal form
• Compositionality:Σ1,Σ2 weakly endochronous
Σ1Σ2 weakly endochronous
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!
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
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
Correct desynchronization
Theorem
If Σ1,Σ2 weakly endochronous, (Σ1,Σ2) weakly isochronous then:
(L(Σ1Σ2)) = (L(Σ1))||(L(Σ2))
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
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)
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
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
δ
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
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
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