def test_ANDed_pair(self): """logicutils - ANDed pair should be in CNF""" self.assertEqual(to_cnf(expr('a & b')), Expr('&', 'a', 'b'))
def test_complex_example_Norvig(self): """logicutils - (P&Q) | (~P & ~Q) in CNF""" self.assertEqual(str(to_cnf('(P&Q) | (~P & ~Q)')), str('((~P | P) & (~Q | P) & (~P | Q) & (~Q | Q))'))
def test_ORed_pair(self): """logicutils - ORed 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'))