//-------- DECLARE VARIBLES ----------// var b_Nurse : int , b_target : int , b_SUPER_ROLE : int , d_Nurse : int , d_target : int , d_SUPER_ROLE : int , n_Nurse : int , n_SUPER_ROLE : int , n_target : int ; //-------------- BEGIN Program --------------------// begin //-------------- Init VARS ------------------------// b_Nurse = 0; b_target = 0; b_SUPER_ROLE = 0; d_Nurse = 0; d_target = 0; d_SUPER_ROLE = 0; n_Nurse = 0; n_SUPER_ROLE = 0; n_target = 0; // Initialize track variables in the system n_Nurse = n_Nurse + 2; n_SUPER_ROLE = n_SUPER_ROLE + 1; while ( true ) do //----- Non-deterministic assignment ------// b_Nurse = random; assume b_Nurse >= 0 and b_Nurse <= 1; b_target = random; assume b_target >= 0 and b_target <= 1; b_SUPER_ROLE = random; assume b_SUPER_ROLE >= 0 and b_SUPER_ROLE <= 1; d_Nurse = random; assume d_Nurse >= 0 and d_Nurse <= 1; d_target = random; assume d_target >= 0 and d_target <= 1; d_SUPER_ROLE = random; assume d_SUPER_ROLE >= 0 and d_SUPER_ROLE <= 1; //-------------- Simulation -------------------// //------------------ CAN_ASSIGN RULE NUMBER 0 ----------------- // //------------------------------------------------------------------ if(brandom and d_SUPER_ROLE==1 and n_SUPER_ROLE>0 and b_Nurse==1 and n_Nurse>0) then if(true) then n_target = n_target+1; endif; endif; //------------------- CAN_REVOKE RULE NUMBER 0 --------------------- // //------------------------------------------------------------------ if(brandom and d_SUPER_ROLE==1 and n_SUPER_ROLE>0 and b_Nurse==1) then if(b_Nurse==1 and n_Nurse>0) then n_Nurse = n_Nurse-1; endif; endif; //------------ ERROR Query ---------------// if (n_target>0) then skip; endif; done; //End while loop end //End main