Beispiel #1
0
    def test_counters_FSF(self):
        fsm = self.counters()

        from pynusmv_tools.atlkPO.evalGen import split
        agents = {'a1', 'a2'}
        strats = split(fsm,
                       fsm.protocol(agents) & fsm.reachable_states,
                       agents,
                       semantics='individual')
        self.assertEqual(len(list(strats)), 16)

        config.partial.filtering = True
        self.assertTrue(
            check(fsm,
                  parseATLK("<'a1', 'a2'> F 'v1 & v2'")[0],
                  semantics="individual",
                  implem="partialSI"))
        self.assertFalse(
            check(fsm,
                  parseATLK("<'a1', 'a2'> G '!v1 & !v2'")[0],
                  semantics="individual",
                  implem="partialSI"))
        self.assertTrue(
            check(
                fsm,
                parseATLK("AG('!v1 & !v2' -> <'a1', 'a2'> G '!v1 | !v2')")[0],
                semantics="individual",
                implem="partialSI"))
        config.partial.filtering = False
Beispiel #2
0
    def test_coins(self):
        fsm = self.coins()

        from pynusmv_tools.atlkPO.evalGen import split
        agents = {'a1', 'a2'}
        strats = split(fsm,
                       fsm.protocol(agents) & fsm.reachable_states,
                       agents,
                       semantics='individual')
        self.assertEqual(len(list(strats)), 64)

        self.assertFalse(
            check(fsm,
                  parseATLK("<'a1', 'a2'> F 'result = win'")[0],
                  semantics="individual"))
        self.assertFalse(
            check(fsm,
                  parseATLK("<'a1', 'a2'> F 'result = win'")[0],
                  semantics="individual",
                  variant="FSF"))
        self.assertFalse(
            check(fsm,
                  parseATLK("<'a1', 'a2'> F 'result = win'")[0],
                  semantics="individual",
                  variant="FS"))