def test_tictactoe_cex(self): fsm = self.tictactoe() spec = parseATL("'run = circle' -> <'circlep'>X 'run = cross'")[0] agents = {atom.value for atom in spec.right.group} phi = evalATL(fsm, spec.right.child) self.assertTrue(check(fsm, spec)) sat = evalATL(fsm, spec) initsat = sat & fsm.init first = fsm.pick_one_state(initsat) explanation = explain_cex(fsm, first, agents, phi) #self.show_cex(explanation, spec.right) self.check_cex(fsm, explanation, agents, phi) spec = parseATL("'run = circle' -> <'circlep'>X 'board[1] = circle'")[0] agents = {atom.value for atom in spec.right.group} phi = evalATL(fsm, spec.right.child) self.assertTrue(check(fsm, spec)) sat = evalATL(fsm, spec) initsat = sat & fsm.init first = fsm.pick_one_state(initsat) explanation = explain_cex(fsm, first, agents, phi) #self.show_cex(explanation, spec.right) self.check_cex(fsm, explanation, agents, phi)
def test_tictactoe_cex(self): fsm = self.tictactoe() spec = parseATL("'run = circle' -> <'circlep'>X 'run = cross'")[0] agents = {atom.value for atom in spec.right.group} phi = evalATL(fsm, spec.right.child) self.assertTrue(check(fsm, spec)) sat = evalATL(fsm, spec) initsat = sat & fsm.init first = fsm.pick_one_state(initsat) explanation = explain_cex(fsm, first, agents, phi) #self.show_cex(explanation, spec.right) self.check_cex(fsm, explanation, agents, phi) spec = parseATL( "'run = circle' -> <'circlep'>X 'board[1] = circle'")[0] agents = {atom.value for atom in spec.right.group} phi = evalATL(fsm, spec.right.child) self.assertTrue(check(fsm, spec)) sat = evalATL(fsm, spec) initsat = sat & fsm.init first = fsm.pick_one_state(initsat) explanation = explain_cex(fsm, first, agents, phi) #self.show_cex(explanation, spec.right) self.check_cex(fsm, explanation, agents, phi)
def test_transmission_cex(self): fsm = self.transmission() spec = parseATL("<'transmitter'>X ~'received'")[0] agents = {atom.value for atom in spec.group} phi = evalATL(fsm, spec.child) self.assertTrue(check(fsm, spec)) sat = evalATL(fsm, spec) initsat = sat & fsm.init first = fsm.pick_one_state(initsat) explanation = explain_cex(fsm, first, agents, phi) #self.show_cex(explanation, spec) self.check_cex(fsm, explanation, agents, phi)
def test_cardgame_cex(self): fsm = self.cardgame() spec = parseATL("<'dealer'>X 'pcard = Ac'")[0] agents = {atom.value for atom in spec.group} phi = evalATL(fsm, spec.child) self.assertTrue(check(fsm, spec)) sat = evalATL(fsm, spec) initsat = sat & fsm.init first = fsm.pick_one_state(initsat) explanation = explain_cex(fsm, first, agents, evalATL(fsm, spec.child)) #self.show_cex(explanation, spec) self.check_cex(fsm, explanation, agents, phi) spec = parseATL("<'player'>X 'step = 1'")[0] agents = {atom.value for atom in spec.group} phi = evalATL(fsm, spec.child) self.assertTrue(check(fsm, spec)) sat = evalATL(fsm, spec) initsat = sat & fsm.init first = fsm.pick_one_state(initsat) explanation = explain_cex(fsm, first, agents, evalATL(fsm, spec.child)) #self.show_cex(explanation, spec) self.check_cex(fsm, explanation, agents, phi)