def test_eight_case(self):
     self.assertEqual(
         implication_elimination('((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(
         implication_elimination('(p>>(r>>q)&(q>>r))&((r>>q)&(q>>r)>>p)'),
         '(~p|((~r|q)&(~q|r)))&(~((~r|q)&(~q|r))|p)')
 def test_sixth_case(self):
     self.assertEqual(
         implication_elimination(
             '((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_seventh_case(self):
     self.assertEqual(
         implication_elimination(
             '((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(
         implication_elimination(
             '((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(
         implication_elimination('((p>>q)>>p&~q)&(p&~q>>(p>>q))'),
         '(~(~p|q)|(p&~q))&(~(p&~q)|~p|q)')
 def test_third_case(self):
     self.assertEqual(implication_elimination('(p>>q)&(q>>p)>>p&q'),
                      '~((~p|q)&(~q|p))|(p&q)')
 def test_second_case(self):
     self.assertEqual(implication_elimination('(p&q>>p&r)&(p&r>>p&q)'),
                      '(~(p&q)|(p&r))&(~(p&r)|(p&q))')
 def test_first_case(self):
     self.assertEqual(implication_elimination('(p>>q)&(q>>p)'),
                      '(~p|q)&(~q|p)')