예제 #1
0
 def test_ANDed_pair(self):
     """logicutils - ANDed pair should be in CNF"""
     self.assertEqual(to_cnf(expr('a & b')),
                      Expr('&', 'a', 'b'))
예제 #2
0
 def test_singleton(self):
     """logicutils - singletons are already in CNF"""
     self.assertEqual(to_cnf(expr('a')),
                      Expr('a'))
예제 #3
0
 def test_ORed_pair(self):
     """logicutils - ORed pair should be in CNF"""
     self.assertEqual(to_cnf(expr('a | b')),
                      Expr('|', 'a', 'b'))
예제 #4
0
 def test_trivial_expr(self):
     """logicutils - create trivial Expr with expr()"""
     self.assertEqual(expr('a | b'), Expr('|', 'a', 'b'))
예제 #5
0
 def test_deep_expr(self):
     """logicutils - create deep Expr with expr()"""
     self.assertEqual(expr('a | b | c | d | e'),
                      Expr('|', Expr('|', Expr('|', Expr('|', 'a', 'b'), 'c'), 'd'), 'e'))
예제 #6
0
 def test_ANDed_pair(self):
     """logicutils - ANDed pair should be in CNF"""
     self.assertEqual(to_cnf(expr('a & b')), Expr('&', 'a', 'b'))
예제 #7
0
 def test_ORed_pair(self):
     """logicutils - ORed pair should be in CNF"""
     self.assertEqual(to_cnf(expr('a | b')), Expr('|', 'a', 'b'))
예제 #8
0
 def test_singleton(self):
     """logicutils - singletons are already in CNF"""
     self.assertEqual(to_cnf(expr('a')), Expr('a'))
예제 #9
0
 def test_deep_expr(self):
     """logicutils - create deep Expr with expr()"""
     self.assertEqual(
         expr('a | b | c | d | e'),
         Expr('|', Expr('|', Expr('|', Expr('|', 'a', 'b'), 'c'), 'd'),
              'e'))
예제 #10
0
 def test_trivial_expr(self):
     """logicutils - create trivial Expr with expr()"""
     self.assertEqual(expr('a | b'), Expr('|', 'a', 'b'))