Research Article

Rational Uniform Consensus with General Omission Failures

Algorithm 2

Agent verifies and updates link state in round .
Require:, , , , ,
Ensure:or
(1)function VERIFYANDUPDATE(, , , , , )
(2)                      ⊳ The function IDs returns ids from NS set
(3)  
(4)
(5)  Phase 1: update the state of direct links
(6)  fordo
(7)                       ⊳ Message source verification is not required if
(8)   APPENDHS ()                    ⊳ append the state into HS or decide
(9)  fordo
(10)   ifthen
(11)    
(12)   else
(13)    
(14)    APPENDHS ()
(15)
(16)  Phase 2: verify message chain
(17)  fordo
(18)   VERIFYMSGCHAIN()                    ⊳ Message chain verification or decide
(19)
(20)  Phase 3: verify and update
(21)  fordo
(22)   fordo
(23)    fordo
(24)     
(25)     
(26)     if an inconsistency is detected then
(27)      Decide                    ⊳ Punishment
(28)     ifthen                    ⊳Case 10
(29)      
(30)     else ifthen                    ⊳ Case 11
(31)      
(32)      APPENDHS()
(33)     else
(34)      
(35)      
(36)      
(37)      
(38)      if (or) then                    ⊳ Direct link
(39)       ifandthen                    ⊳ Case 1
(40)        APPENDHS()
(41)       else ifandthen                    ⊳ Case 2
(42)        Decide
(43)       else ifandthen                    ⊳ Case 3
(44)        APPENDHS()
(45)       else ifandthen                    ⊳ Case 4 and 5
(46)        ifthen                    ⊳ Case 4
(47)         iforthen
(48)          APPENDHS()
(49)         else ifthen
(50)          
(51)          APPENDHS()
(52)      else                    ⊳ Indirect link
(53)       ifandthen                    ⊳ Case 6
(54)        ifthen
(55)         APPENDHS()
(56)        else ifthen
(57)         
(58)         APPENDHS ()
(59)       else ifandthen                    ⊳ Case 7
(60)        
(61)        APPENDHS ()
(62)       else ifandthen                    ⊳ Case 8
(63)        APPENDHS ()
(64)       else ifandthen                    ⊳ Case 9
(65)        ifthen
(66)         ifthen
(67)          APPENDHS ()
(68)         else
(69)          
(70)          APPENDHS ()
(71)return