def test_tictactoe_ceu(self): fsm = self.tictactoe() spec = parseATL( "<'circlep'> ['TRUE' U 'winner != circle' & 'run = stop']")[0] agents = {atom.value for atom in spec.group} phi = evalATL(fsm, spec.left) psi = evalATL(fsm, spec.right) self.assertTrue(check(fsm, spec)) sat = evalATL(fsm, spec) initsat = sat & fsm.init first = fsm.pick_one_state(initsat) explanation = explain_ceu(fsm, first, agents, phi, psi) self.check_ceu(fsm, explanation, agents, phi, psi) spec = parseATL( "<'circlep', 'crossp'> ['TRUE' U 'winner = empty' & 'run = stop']" )[0] agents = {atom.value for atom in spec.group} phi = evalATL(fsm, spec.left) psi = evalATL(fsm, spec.right) self.assertTrue(check(fsm, spec)) sat = evalATL(fsm, spec) initsat = sat & fsm.init first = fsm.pick_one_state(initsat) explanation = explain_ceu(fsm, first, agents, phi, psi) self.check_ceu(fsm, explanation, agents, phi, psi)
def test_cardgame_ceu(self): fsm = self.cardgame() spec = parseATL("<'player'>['TRUE' U 'win']")[0] agents = {atom.value for atom in spec.group} phi = evalATL(fsm, spec.left) psi = evalATL(fsm, spec.right) self.assertTrue(check(fsm, spec)) sat = evalATL(fsm, spec) initsat = sat & fsm.init first = fsm.pick_one_state(initsat) explanation = explain_ceu(fsm, first, agents, phi, psi) self.check_ceu(fsm, explanation, agents, phi, psi)
def test_transmission_ceu(self): fsm = self.transmission() spec = parseATL("<'sender','transmitter'>['TRUE' U 'received']")[0] agents = {atom.value for atom in spec.group} phi = evalATL(fsm, spec.left) psi = evalATL(fsm, spec.right) self.assertTrue(check(fsm, spec)) sat = evalATL(fsm, spec) initsat = sat & fsm.init first = fsm.pick_one_state(initsat) explanation = explain_ceu(fsm, first, agents, phi, psi) self.check_ceu(fsm, explanation, agents, phi, psi)
def test_tictactoe_ceu(self): fsm = self.tictactoe() spec = parseATL("<'circlep'> ['TRUE' U 'winner != circle' & 'run = stop']")[0] agents = {atom.value for atom in spec.group} phi = evalATL(fsm, spec.left) psi = evalATL(fsm, spec.right) self.assertTrue(check(fsm, spec)) sat = evalATL(fsm, spec) initsat = sat & fsm.init first = fsm.pick_one_state(initsat) explanation = explain_ceu(fsm, first, agents, phi, psi) self.check_ceu(fsm, explanation, agents, phi, psi) spec = parseATL("<'circlep', 'crossp'> ['TRUE' U 'winner = empty' & 'run = stop']")[0] agents = {atom.value for atom in spec.group} phi = evalATL(fsm, spec.left) psi = evalATL(fsm, spec.right) self.assertTrue(check(fsm, spec)) sat = evalATL(fsm, spec) initsat = sat & fsm.init first = fsm.pick_one_state(initsat) explanation = explain_ceu(fsm, first, agents, phi, psi) self.check_ceu(fsm, explanation, agents, phi, psi)