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