//-------- DECLARE VARIBLES ----------// var b_PatientWithTPC : int , b_ThirdParty : int , b_target : int , b_SUPER_ROLE : int , d_PatientWithTPC : int , d_ThirdParty : int , d_target : int , d_SUPER_ROLE : int , n_PatientWithTPC : int , n_SUPER_ROLE : int , n_ThirdParty : int , n_target : int ; //-------------- BEGIN Program --------------------// begin //-------------- Init VARS ------------------------// b_PatientWithTPC = 0; b_ThirdParty = 0; b_target = 0; b_SUPER_ROLE = 0; d_PatientWithTPC = 0; d_ThirdParty = 0; d_target = 0; d_SUPER_ROLE = 0; n_PatientWithTPC = 0; n_SUPER_ROLE = 0; n_ThirdParty = 0; n_target = 0; // Initialize track variables in the system n_SUPER_ROLE = n_SUPER_ROLE + 1; while ( true ) do //----- Non-deterministic assignment ------// b_PatientWithTPC = random; assume b_PatientWithTPC >= 0 and b_PatientWithTPC <= 1; b_ThirdParty = random; assume b_ThirdParty >= 0 and b_ThirdParty <= 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_PatientWithTPC = random; assume d_PatientWithTPC >= 0 and d_PatientWithTPC <= 1; d_ThirdParty = random; assume d_ThirdParty >= 0 and d_ThirdParty <= 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_PatientWithTPC==1 and n_PatientWithTPC>0) then if(true) then n_target = n_target+1; endif; endif; //------------------ CAN_ASSIGN RULE NUMBER 1 ----------------- // //------------------------------------------------------------------ if(brandom and d_SUPER_ROLE==1 and n_SUPER_ROLE>0) then if(true) then n_ThirdParty = n_ThirdParty+1; endif; endif; //------------------ CAN_ASSIGN RULE NUMBER 2 ----------------- // //------------------------------------------------------------------ if(brandom and d_ThirdParty==1 and n_ThirdParty>0) then if(true) then n_PatientWithTPC = n_PatientWithTPC+1; endif; endif; //------------------- CAN_REVOKE RULE NUMBER 0 --------------------- // //------------------------------------------------------------------ if(brandom and d_ThirdParty==1 and n_ThirdParty>0 and b_PatientWithTPC==1) then if(b_PatientWithTPC==1 and n_PatientWithTPC>0) then n_PatientWithTPC = n_PatientWithTPC-1; endif; endif; //------------ ERROR Query ---------------// if (n_target>0) then skip; endif; done; //End while loop end //End main