def test_ANDed_pair(self): """logicutils - ANDed pair should be in CNF""" self.assertEqual(to_cnf(expr('a & b')), Expr('&', 'a', 'b'))
def test_singleton(self): """logicutils - singletons are already in CNF""" self.assertEqual(to_cnf(expr('a')), Expr('a'))
def test_ORed_pair(self): """logicutils - ORed pair should be in CNF""" self.assertEqual(to_cnf(expr('a | b')), Expr('|', 'a', 'b'))
def test_trivial_expr(self): """logicutils - create trivial Expr with expr()""" self.assertEqual(expr('a | b'), Expr('|', 'a', 'b'))
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'))
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'))