def test_transmission_cau(self): fsm = self.transmission() spec = parseATL("['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_cau(fsm, first, agents, phi, psi) self.check_ceu(fsm, explanation, agents, phi, psi)
def test_cardgame_cau(self): fsm = self.cardgame() spec = parseATL("['dealer']['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_cau(fsm, first, agents, phi, psi) self.check_ceu(fsm, explanation, agents, phi, psi) spec = parseATL("['dealer']['TRUE' U 'lose']")[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_cau(fsm, first, agents, phi, psi) self.check_ceu(fsm, explanation, agents, phi, psi)
def test_tictactoe_cau(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) self.assertEqual(sat, fp(lambda Y : psi | (phi & fsm.pre_nstrat(Y, agents)), BDD.false(fsm.bddEnc.DDmanager))) initsat = sat & fsm.init first = fsm.pick_one_state(initsat) explanation = explain_cau(fsm, first, agents, phi, psi) self.check_ceu(fsm, explanation, agents, phi, psi)
def test_tictactoe_cau(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) self.assertEqual( sat, fp(lambda Y: psi | (phi & fsm.pre_nstrat(Y, agents)), BDD.false(fsm.bddEnc.DDmanager))) initsat = sat & fsm.init first = fsm.pick_one_state(initsat) explanation = explain_cau(fsm, first, agents, phi, psi) self.check_ceu(fsm, explanation, agents, phi, psi)