def test_first_case(self): self.assertEqual(de_morgan_laws('(~p|q)&(~q|p)'), '(~p|q)&(~q|p)')
def test_second_case(self): self.assertEqual(de_morgan_laws('(~(p&q)|(p&r))&(~(p&r)|(p&q))'), '(~p|~q|(p&r))&(~p|~r|(p&q))')
def test_eight_case(self): self.assertEqual( de_morgan_laws('(~((~p|q)&(~q|p))|r)&(~r|((~p|q)&(~q|p)))'), '((p&~q)|(q&~p)|r)&(~r|((~p|q)&(~q|p)))')
def test_ninth_case(self): self.assertEqual( de_morgan_laws('(~p|((~r|q)&(~q|r)))&(~((~r|q)&(~q|r))|p)'), '(~p|((~r|q)&(~q|r)))&((r&~q)|(q&~r)|p)')
def test_seventh_case(self): self.assertEqual( de_morgan_laws('(~(~(p&q)|r)|~p|r|~q|r)&(~(~p|r|~q|r)|~(p&q)|r)'), '((p&q&~r)|~p|r|~q|r)&((p&~r&q&~r)|~p|~q|r)')
def test_sixth_case(self): self.assertEqual( de_morgan_laws( '(~(~(p|q)|r)|((~p|r)&(~q|r)))&(~((~p|r)&(~q|r))|~(p|q)|r)'), '(((p|q)&~r)|((~p|r)&(~q|r)))&((p&~r)|(q&~r)|(~p&~q)|r)')
def test_fifth_case(self): self.assertEqual( de_morgan_laws( '(~(~p|(q&r))|((~p|q)&(~p|r)))&(~((~p|q)&(~p|r))|~p|(q&r))'), '((p&(~q|~r))|((~p|q)&(~p|r)))&((p&~q)|(p&~r)|~p|(q&r))')
def test_fourth_case(self): self.assertEqual(de_morgan_laws('(~(~p|q)|(p&~q))&(~(p&~q)|~p|q)'), '((p&~q)|(p&~q))&(~p|q|~p|q)')
def test_third_case(self): self.assertEqual(de_morgan_laws('~((~p|q)&(~q|p))|(p&q)'), '(p&~q)|(q&~p)|(p&q)')