예제 #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
파일: glob.py 프로젝트: xgillard/pynusmv
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)