Пример #1
0
    def test_equal_atoms(self):
        test = parse_next_expression("test")
        test = nsnode.find_node(test.type, nsnode.car(test), nsnode.cdr(test))
        same = parse_next_expression("test")
        same = nsnode.find_node(same.type, nsnode.car(same), nsnode.cdr(same))
        other = parse_next_expression("testx")
        other = nsnode.find_node(other.type, nsnode.car(other),
                                 nsnode.cdr(other))

        self.assertTrue(nsnode.node_equal(test, same) != 0)
        self.assertTrue(nsnode.node_equal(test, other) == 0)
Пример #2
0
 def test_equal_atoms(self):
     test = parse_next_expression("test")
     test = nsnode.find_node(test.type, nsnode.car(test), nsnode.cdr(test))
     same = parse_next_expression("test")
     same = nsnode.find_node(same.type, nsnode.car(same), nsnode.cdr(same))
     other = parse_next_expression("testx")
     other = nsnode.find_node(other.type, nsnode.car(other),
                                          nsnode.cdr(other))
     
     self.assertTrue(nsnode.node_equal(test, same) != 0)
     self.assertTrue(nsnode.node_equal(test, other) == 0)
Пример #3
0
    def test_equal_expressions(self):
        test = parse_next_expression("test.r")
        test = find_hierarchy(test)
        nsnode.free_node(test)
        same = parse_next_expression("test.r")
        same = find_hierarchy(same)
        nsnode.free_node(same)
        other = parse_next_expression("testx.rx")
        other = find_hierarchy(other)
        nsnode.free_node(other)

        self.assertTrue(nsnode.node_equal(test, same) != 0)
        self.assertTrue(nsnode.node_equal(test, other) == 0)
Пример #4
0
 def test_equal_expressions(self):
     test = parse_next_expression("test.r")
     test = find_hierarchy(test)
     nsnode.free_node(test)
     same = parse_next_expression("test.r")
     same = find_hierarchy(same)
     nsnode.free_node(same)
     other = parse_next_expression("testx.rx")
     other = find_hierarchy(other)
     nsnode.free_node(other)
     
     self.assertTrue(nsnode.node_equal(test, same) != 0)
     self.assertTrue(nsnode.node_equal(test, other) == 0)
Пример #5
0
 def test_parsing_error(self):
     try:
         expr = parse_next_expression("a == 0")
     except NuSMVParsingError as err:
         self.assertEqual(len(err.errors), 1)
         self.assertEqual(str(err),
                          "Error at line 1, token '=': syntax error")
Пример #6
0
    def test_set(self):
        test = parse_next_expression("{a, b, c}")
        test = find_hierarchy(test)
        nsnode.free_node(test)

        print("UNION:", nsparser.UNION)
        print("ATOM:", nsparser.ATOM)
        self.show_types(test)
Пример #7
0
 def test_set(self):
     test = parse_next_expression("{a, b, c}")
     test = find_hierarchy(test)
     nsnode.free_node(test)
     
     print("UNION:", nsparser.UNION)
     print("ATOM:", nsparser.ATOM)
     self.show_types(test)
Пример #8
0
def _get_epistemic_trans(variable):
    """Return a new TRANS next(variable) = variable"""
    
    transexpr = "next({0}) = {0}".format(variable)
    return parse_next_expression(transexpr)
Пример #9
0
 def test_contexted_expression(self):
     parsed = parse_next_expression("test")
     self.assertEqual(parsed.type, nsparser.ATOM)
Пример #10
0
def _get_epistemic_trans(variable):
    """Return a new TRANS next(variable) = variable"""

    transexpr = "next({0}) = {0}".format(variable)
    return parse_next_expression(transexpr)
Пример #11
0
 def test_contexted_expression(self):
     parsed = parse_next_expression("test")
     self.assertEqual(parsed.type, nsparser.ATOM)