Presentation is loading. Please wait.

Presentation is loading. Please wait.

Binary Self - Stabilization By: Sukumar Ghosh Presented By: Ilan Cohen.

Similar presentations


Presentation on theme: "Binary Self - Stabilization By: Sukumar Ghosh Presented By: Ilan Cohen."— Presentation transcript:

1 Binary Self - Stabilization By: Sukumar Ghosh Presented By: Ilan Cohen

2 Our Goal: Show an algorithm for self-stabilization with Only Two States. Unfortunately: There is no deterministic Algorithm for A ring with only two state.

3 Global criteria for the legitimate states In each legitimate state, one privilege is present. In each legitimate state, each possible move would again bring the system to a legitimate state. Each privilege is present in at least one legitimate state. For any pair of legitimate states, there exists a sequence of move transferring the system from one to another.

4 Few Simple Cases: P1P0 P0 : if (s[0],s[1])=(b,¬b) then s[0] := ¬b fi P1: if (s[0],s[1])=(b,b) then s[1] := ¬b fi P0P1 P2 P0 : if (s[0],s[1],s[2])=(b,b,¬b) then s[0]:= ¬b fi P1: if (s[0],s[1]) = (b,¬b) then s[1] := b fi P2: if (s[1],s[2]) = (b,b) then s[2] := ¬b fi P2P1 P0 P3 P0 : if (s[0],s[1]) = (b,¬b) then s[0]:= ¬b fi P1: if (s[1],s[2],s[3])=(b,b,¬b) then s[1]:= ¬b fi P2: if (s[0],s[1],s[2])=(b,b,¬b) then s[2]:= b fi P3: if (s[2],s[3]) = (b,b) then s[3] := ¬b fi

5 A general system: P0 P1 P2 P3 P4 P5 P6 P2n-3 P2n-2 P2n-1 The bottom machine The top machine The x- machines The y- machines

6 The Algorithm For each x-machine 2i,i  1..n-1 If (s[2i-2],s[2i-1],s[2i],s[2i+1]) = (b,b,¬b,b) then s[2i]:= b fi For each y-machine 2i-1,i  1..n-1 If (s[2i-2],s[2i-1],s[2i],s[2i+1]) = (b,b,b,¬b) then s[2i-1]:=¬b fi For the bottom machine 0 If (s[0],s[1]) = (¬b,b) then s[0]:= b fi For the bottom machine 2n-1 If (s[2n-1],s[2n-2]) = (b,b) then s[2n-1]:=¬b fi

7 Correctness criteria Symobls pX,pY,pT,pB denote the privileges of the x- machines,y – machines,Top and Bottom machine. For Machine i, (i+2) and (i-2) are right and left neighbor Precondition → i Post condition will be used to present the changes cause when machine i makes a move.

8 Lemma 1:No Deadlock Let’s say s[2n-1]=b If ¬pT holds  s[2n-2]= ¬b,if (¬pX[2i]  ¬pY[2i-1])  i  1..n-1 then (s[2i-1]  s[2i-2])  s[1]  s[0]  pB is true. P2n-4P2n-2 P2n-3 P2n-1 P2n-6 P2n-5 ¬b¬b b ¬ b1 b1 ¬ b2 b2

9 Lemma 2. No two adjacent machines can simultaneous privileges b b b ¬b For each x-machine 2i,i  1..n-1 If (s[2i-2],s[2i-1],s[2i],s[2i+1]) = (b,b,¬b,b) then s[2i]:= b fi For each y-machine 2i-1,i  1..n-1 If (s[2i-2],s[2i-1],s[2i],s[2i+1]) = (b,b,b,¬b) then s[2i-1]:=¬b fi b ¬b P2iP2i+2P2i-2 P2i-1P2i-3P2i+1

10 Lemma 3. Propagation of pX let s[2i]=b then 1. pX[2i]  ((s[2i+2],s[2i+3])=(b,¬b))  2i ¬pX[2i]  pX[2i+2] 2. pX[2i]  (s[2i+2]=s[2i+3])  2i ¬pX[2i]  ¬pX[2i+2] 3. pX[2i]  ((s[2i+2],s[2i+3])=(¬b,b)  2i ¬pX[2i]  pY[2i+1] b ¬b For each x-machine 2i,i  1..n-1 If (s[2i-2],s[2i-1],s[2i],s[2i+1]) = (b,b,¬b,b) then s[2i]:= b fi For each y-machine 2i-1,i  1..n-1 If (s[2i-2],s[2i-1],s[2i],s[2i+1]) = (b,b,b,¬b) then s[2i-1]:=¬b fi P2iP2i+2 P2i+1P2i+3 ¬b

11 Lemma 4. Propagation of pY let s[2i+1]=b then 1. pY[2i+1]  ((s[2i-1],s[2i-2])=(b,b))  2i+1 pY[2i-1]  ¬pY[2i+1] 2. pY[2i+1]  (s[2i-1]  s[2i-2])  2i+1 ¬pY[2i-1]  ¬pY[2i+1] 3. pY[2i+1]  ((s[2i-1],s[2i-2])=(¬b,¬b))  2i+1 pX[2i]  pY[2i+1] For each x-machine 2i,i  1..n-1 If (s[2i-2],s[2i-1],s[2i],s[2i+1]) = (b,b,¬b,b) then s[2i]:= b fi For each y-machine 2i-1,i  1..n-1 If (s[2i-2],s[2i-1],s[2i],s[2i+1]) = (b,b,b,¬b) then s[2i-1]:=¬b fi bb b P2i+1P2i-1 P2i-2P2i ¬b¬b

12 Lemma 5 (Collision of privileges) Let pX[2i]  pY[2i+3] hold, then regardless of the order in which machines 2i and 2i+3 make their moves, and either pX[2i+2] or pY[2i+1] P2iP2i+2 P2i+1P2i+3

13 Lemma 6 (Reflection of privileges) (a) If pX[2n-2]  2n-2 pT then pT  2n-1 pY[2n-3] (b) If pY[1]  1 pB then pB  0 pX[2] b b b ¬b¬b For each x-machine 2i,i  1..n-1 If (s[2i-2],s[2i-1],s[2i],s[2i+1]) = (b,b,¬b,b) then s[2i]:= b fi For each y-machine 2i-1,i  1..n-1 If (s[2i-2],s[2i-1],s[2i],s[2i+1]) = (b,b,b,¬b) then s[2i-1]:=¬b fi For 0 machine If (s[0],s[1]) = (¬b,b) then s[0]:=b fi ¬b¬b P0 P2 P1P3 ¬b¬b

14 Theorem 7. Within three successive moves by the machine 2i, machine (2i+2) must move at least once. Let’s notice between two successive moves by machine 2i The states of all three neighbors must change. Let’s divide for three cases according to lemma 3. 1. pX[2i]  ((s[2i+2],s[2i+3])=(b,¬b))  2i ¬pX[2i]  pX[2i+2] b ¬b b For each x-machine 2i,i  1..n-1 If (s[2i-2],s[2i-1],s[2i],s[2i+1]) = (b,b,¬b,b) then s[2i]:= b fi For each y-machine 2i-1,i  1..n-1 If (s[2i-2],s[2i-1],s[2i],s[2i+1]) = (b,b,b,¬b) then s[2i-1]:=¬b fi P2iP2i+2 P2i+1P2i+3 ¬b

15 Theorem 7. cont Within three successive moves by the machine 2i, machine (2i+2) must move at least once. 2. pX[2i]  ((s[2i+2],s[2i+3])=(¬b,¬b)) b ¬b For each x-machine 2i,i  1..n-1 If (s[2i-2],s[2i-1],s[2i],s[2i+1]) = (b,b,¬b,b) then s[2i]:= b fi For each y-machine 2i-1,i  1..n-1 If (s[2i-2],s[2i-1],s[2i],s[2i+1]) = (b,b,b,¬b) then s[2i-1]:=¬b fi P2iP2i+2 P2i+1P2i+3 ¬b bb b

16 Theorem 8. Within three successive moves by the machine (2i+1), machine (2i-1) must move at least once. Proof. Starting from Lemma 4, this can be proved exactly in the same way. b b For each x-machine 2i,i  1..n-1 If (s[2i-2],s[2i-1],s[2i],s[2i+1]) = (b,b,¬b,b) then s[2i]:= b fi For each y-machine 2i-1,i  1..n-1 If (s[2i-2],s[2i-1],s[2i],s[2i+1]) = (b,b,b,¬b) then s[2i-1]:=¬b fi P2i-2P2i P2i-1P2i+1 ¬b

17 Theorem 9. In an infinite sequence of moves, every machine must move infinitely often. Proof. Lemmas 3-6 show that the total number of privileges is nonincreasing. Theorem 7 establishes the fact after a bounded number (at most two) of moves by an x-machine it’s privilege is transfer to the right neighbor. Similarly, it follows from theory 8 that after a bounded number of moves by an y-machine it’s privilege is transfer to the left neighbor. According to lemma 6, a pX is converted to a pY when the top machine moves, and pY converted to pX when the bottom machine moves. Therefore in a infinite sequence of moves, each machine must move infinitely often.

18 Theorem 10. If exactly one machine of moves has a privilege then the system is stabilized Proof. Lemmas 3-6 show that the total number of privileges is nonincreasing, Also following from lemma 1 (no deadlock), at least one privilege always exists. It follows from Theorem 9 That in an infinite sequence of moves every machine move infinitely often. Thus the one privilege remain the only one and passes from machine to machine.

19 Theorem 11. This Algorithm guarantees self-stabilization. Proof. We need to demonstrate that in a finite number of moves, the number of privileges is reduced to one. Lemmas 3-6 show that the total number of privileges is nonincreasing. Theorem 7 establishes the fact after a bounded number (at most two) of moves by an x-machine it’s privilege is transfer to the right neighbor. Similarly, it follows from theory 8 that after a bounded number of moves by an y-machine it’s privilege is transfer to the left neighbor. According to lemma 6, a pX is converted to a pY when the top machine moves, and pY converted to pX when the bottom machine moves.

20 Theorem 11. Cont This Algorithm guarantees self-stabilization. Under these circumstances, it is inevitable that as long as more than one privileges, the condition pX[2i]  PY[2i+3] hold for some I According to Lemma 5, this always leads to the negation of one of the two privileges, Thus the number of privileges is reduced to 1 and according to Therefore the system is stabilized.

21 Example N=8: 0 1 0 1 1 0 0 For each x-machine 2i,i  1..n-1 If (s[2i-2],s[2i-1],s[2i],s[2i+1]) = (b,b,¬b,b) then s[2i]:= b fi For each y-machine 2i-1,i  1..n-1 If (s[2i-2],s[2i-1],s[2i],s[2i+1]) = (b,b,b,¬b) then s[2i-1]:=¬b fi For the bottom machine 0 If (s[0],s[1]) = (¬b,b) then s[0]:= b fi For the bottom machine 2n-1 If (s[2n-1],s[2n-2]) = (b,b) then s[2n-1]:=¬b fi P1 P2 P0 P4 P3P5 P6 P7 1 10 0 0 0 00 1 111 1 111

22 Remarks In this algorithm every general machine is required to read the states of three of its neighbor, the required atomicity is therefore large. This article proved for central demon, because of the property of noninterference (Lemma 2), it is tempting to conclude that the proposed algorithm works with distributed algorithm, however because of the large atomicity this issue if far more complex and needs careful examination. This Topology appear to be the sparsest topology in which self-stabilization is possible with binary machine and deterministic moves.

23

24 References G.M. Brown, M.G. gouda and C.L. Wu, Token systems that self-stabilize. J.E. Burns M.G. Gouda and R. Miller, On relaxing interleaving assumption.


Download ppt "Binary Self - Stabilization By: Sukumar Ghosh Presented By: Ilan Cohen."

Similar presentations


Ads by Google