示例#1
0
    def test_replace_placeholder(self):
        query1 = "? | 'a'"
        query2 = "True -> AG ('a' & ?)"
        query3 = "A [? U AG ('b' -> False & AX ?)]"

        self.assertEqual(count(replace(parse_ctlq(query1), TrueExp())), 0)
        self.assertEqual(count(replace(parse_ctlq(query2), TrueExp())), 0)
        self.assertEqual(count(replace(parse_ctlq(query3), TrueExp())), 0)
示例#2
0
    def test_replace_placeholder(self):
        query1 = "? | 'a'"
        query2 = "True -> AG ('a' & ?)"
        query3 = "A [? U AG ('b' -> False & AX ?)]"

        self.assertEqual(count(replace(parse_ctlq(query1), TrueExp())), 0)
        self.assertEqual(count(replace(parse_ctlq(query2), TrueExp())), 0)
        self.assertEqual(count(replace(parse_ctlq(query3), TrueExp())), 0)
示例#3
0
    def test_ast_to_spec(self):
        queries = ["?",
                   "~?",
                   "'request' & ?",
                   "? | 'state = ready'",
                   "? -> '!request'",
                   "'state = busy' <-> ?",
                   "AX ?",
                   "AF ?",
                   "AG ?",
                   "EX ?",
                   "EF ?",
                   "EG ?",
                   "A[True U ?]",
                   "A[? W False]",
                   "E[? U True]",
                   "E[False W ?]",
                   "A[False oU ?]",
                   "A[? oW True]",
                   "A[True dU ?]",
                   "A[? dW False]",
                   "E[False oU ?]",
                   "E[? oW True]",
                   "E[True dU ?]",
                   "E[? dW False]"]

        for query in queries:
            init_nusmv()
            self.init_model()
            self.assertIsInstance(ast_to_spec(replace(parse_ctlq(query),
                                                      TrueExp())),
                                  Spec)
            deinit_nusmv()
示例#4
0
    def test_ast_to_spec(self):
        queries = [
            "?", "~?", "'request' & ?", "? | 'state = ready'",
            "? -> '!request'", "'state = busy' <-> ?", "AX ?", "AF ?", "AG ?",
            "EX ?", "EF ?", "EG ?", "A[True U ?]", "A[? W False]",
            "E[? U True]", "E[False W ?]", "A[False oU ?]", "A[? oW True]",
            "A[True dU ?]", "A[? dW False]", "E[False oU ?]", "E[? oW True]",
            "E[True dU ?]", "E[? dW False]"
        ]

        for query in queries:
            init_nusmv()
            self.init_model()
            self.assertIsInstance(
                ast_to_spec(replace(parse_ctlq(query), TrueExp())), Spec)
            deinit_nusmv()