('q1', 'orange') :'q2', ('q2', 'red') :'q2', ('q2', 'green') :'q2', ('q2', 'orange') :'q2', }[(q, a)] ) ################################################################################## # # ############################################################################### ###Invoke the enforcer with properties psi, phi, and some test input sequence # ######### (psi, phi, input sequence sigma)####################################### ############################################################################### phi12 = Automata.DFAProduct([phi1, phi2], lambda (o1, o2) : o1 and o2).getDFA() ##Property Phi1 and Phi2 and Phi3 phi123 = Automata.DFAProduct([phi12, phi3], lambda (o1, o2) : o1 and o2).getDFA() ##Property Phi1 and Phi2 and Phi3 and Phi4 phi1234 = Automata.DFAProduct([phi123, phi4], lambda (o1, o2) : o1 and o2).getDFA() ##Property Phi1 and Phi2 and Phi3 and Phi4 and phi5 phi12345 = Automata.DFAProduct([phi1234, phi5], lambda (o1, o2) : o1 and o2).getDFA() ####################### EnforcerEval.enforcer(copy.copy(psi), copy.copy(phi12345), ['red', 'green', 'orange' ] ) #######################
('l0', 'a1Inform'): 'l1', ('l0', 'a2Inform'): 'l2', ('l0', 'a1Ack'): 'l0', ('l0', 'a2Ack'): 'l0', ('l1', 'a1Inform'): 'l2', ('l1', 'a2Inform'): 'l0', ('l1', 'a1Ack'): 'l0', ('l1', 'a2Ack'): 'l0', ('l2', 'a1Inform'): 'l2', ('l2', 'a2Inform'): 'l2', ('l2', 'a1Ack'): 'l2', ('l2', 'a2Ack'): 'l2', }[(q, a)] ) ############################################################################### ###Invoke the enforcer with properties psi, "phi = phi1 and Phi2", and some test input sequence # ######### (psi, phi, input sequence sigma)####################################### ############################################################################### ##phi is conjunction of phi1 and phi2 #### phi = Automata.DFAProduct([phi1, phi2], lambda (o1, o2) : o1 and o2).getDFA() ####Input sigma = a1Inform. a2Inform.a1Ack##### EnforcerEval.enforcer(copy.copy(psi), copy.copy(phi), ['a1Inform', 'a2Inform', 'a1Ack' ] ) ###############################################################################
('l2', 'F2') : 'l2', ('l2', 'R') : 'l2', ('l2', 'Ot') : 'l2', }[(q, a)] ) ############################################################################### ############################################################################### ###Invoke the enforcer with properties psi, phi, and some test input sequence # ######### (psi, phi, input sequence sigma)####################################### ############################################################################### ##phi is conjunction of phi1 and phi2 and phi3#### phiTemp = Automata.DFAProduct([phi1, phi2], lambda (o1, o2) : o1 and o2).getDFA() phi = Automata.DFAProduct([phiTemp, phi3],lambda (o1, o2) : o1 and o2).getDFA() print "input sequence is 'S', 'SA', 'A', 'F1', 'F2' " EnforcerEval.enforcer(copy.copy(psi), copy.copy(phi), ['S', 'SA', 'A', 'F1', 'F2' ]) print "######################" ###############################################################################
('q2', 'c') : 'q3', ('q3', 'a') : 'q3', ('q3', 'b') : 'q3', ('q3', 'c') : 'q3', }[(q, a)] ) ############################################################################### ############################################################################### ###Invoke the enforcer with properties psi, phi, and some test input sequence # ######### (psi, phi, input sequence sigma)####################################### ############################################################################### ####Input sigma = aac##### print "input sequence is aac" EnforcerEval.enforcer(copy.copy(psi), copy.copy(phi), ['a', 'a', 'c']) print "######################" # #####Input sigma = bbc##### #print "input sequence is bbc" #Enforcer.enforcer(copy.copy(psi), copy.copy(phi), ['b', 'b', 'c']) #print "######################" # #####Input sigma = abc##### #print "input sequence is abc" #Enforcer.enforcer(copy.copy(psi), copy.copy(phi), ['a', 'b', 'c']) #print "######################" # #####Input sigma = bac##### #print "input sequence is bac"