Research Article

Formal Modeling and Verification for MVB

Listing 1

PROMELA codes of a BA.
active proctype Bus_Administrator_1 ( ) {
 …
 BA_1_STANDBY_MASTER: /*State Standby Master*/
atomic  {
  BA_1. curState = STANDBY_MASTER;
  BA_1. in_count > 0; /*wait until BA_1. in_count>0*/
  BA_1. input ? frame; /*receive a frame*/
  BA_1. in_count−−;
  if
 ::frame.type == LOST->
    …/*frame loss*/
  ::(frame. type == MASTERSHIP_OFFERED && frame.recv == BA_1. rank) ->
    …/*Mastership offered to me*/
  ::(frame. type == STATUS_REQUEST && frame.recv == BA_1. rank) ->
    …/*request status of me*/
 :: (frame. type == REGULAR) ->
    …/*Master Frame*/
  ::else ->
  fi;
 }
 …
}