def test_tictactoe_cag(self): fsm = self.tictactoe() spec = parseATL("['circlep'] G 'winner != circle'")[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_cag(fsm, first, agents, phi) self.check_ceg(fsm, explanation, agents, phi)
def test_cardgame_cag(self): fsm = self.cardgame() spec = parseATL("['dealer'] G ~'win'")[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_cag(fsm, first, agents, phi) self.check_ceg(fsm, explanation, agents, phi)
def test_transmission_cag(self): fsm = self.transmission() spec = parseATL("['sender'] G ~'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_cag(fsm, first, agents, phi) self.check_ceg(fsm, explanation, agents, phi) spec = parseATL("['transmitter'] G ~'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_cag(fsm, first, agents, phi) self.check_ceg(fsm, explanation, agents, phi)