예제 #1
0
 def test_tictactoe_ceg(self):
     fsm = self.tictactoe()
     
     spec = parseATL("<'circlep', 'crossp'> G 'winner = empty'")[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_ceg(fsm, first, agents, phi)
     self.check_ceg(fsm, explanation, agents, phi)
     
     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_ceg(fsm, first, agents, phi)
     self.check_ceg(fsm, explanation, agents, phi)
예제 #2
0
 def test_cardgame_ceg(self):
     fsm = self.cardgame()
     
     spec = parseATL("<'player'> 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_ceg(fsm, first, agents, phi)
     self.check_ceg(fsm, explanation, agents, phi)
     
     spec = parseATL("<'player','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_ceg(fsm, first, agents, phi)
     self.check_ceg(fsm, explanation, agents, phi)
예제 #3
0
    def test_tictactoe_ceg(self):
        fsm = self.tictactoe()

        spec = parseATL("<'circlep', 'crossp'> G 'winner = empty'")[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_ceg(fsm, first, agents, phi)
        self.check_ceg(fsm, explanation, agents, phi)

        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_ceg(fsm, first, agents, phi)
        self.check_ceg(fsm, explanation, agents, phi)
예제 #4
0
    def test_cardgame_ceg(self):
        fsm = self.cardgame()

        spec = parseATL("<'player'> 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_ceg(fsm, first, agents, phi)
        self.check_ceg(fsm, explanation, agents, phi)

        spec = parseATL("<'player','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_ceg(fsm, first, agents, phi)
        self.check_ceg(fsm, explanation, agents, phi)
예제 #5
0
    def test_transmission_ceg(self):
        fsm = self.transmission()

        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_ceg(fsm, first, agents, phi)
        self.check_ceg(fsm, explanation, agents, phi)

        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_ceg(fsm, first, agents, phi)
        self.check_ceg(fsm, explanation, agents, phi)
예제 #6
0
 def test_transmission_ceg(self):
     fsm = self.transmission()
     
     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_ceg(fsm, first, agents, phi)
     self.check_ceg(fsm, explanation, agents, phi)
     
     
     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_ceg(fsm, first, agents, phi)
     self.check_ceg(fsm, explanation, agents, phi)