Ejemplo n.º 1
0
 def test_cnf_action_alpha(self):
     g1 = Generalization("or", [Formula("&", Formula("X"), Formula("Y"))])
     exp = [
         Generalization("or", [Formula("X")]),
         Generalization("or", [Formula("Y")])
     ]
     self.assertEqual(exp, g1.cnf_action())
 def test_cnf(self):
     g1 = Generalization("or", [
             Formula("&", Formula("X"), Formula("!", Formula("Y")))])
     g2 = Generalization("and", [
             Generalization("or", [
                     Formula("&", Formula("X"),
                             Formula("!", Formula("Y")))])])
     self.assertEqual(Generalization("and", g1.cnf_action()), g2.cnf())
Ejemplo n.º 3
0
 def test_cnf(self):
     g1 = Generalization(
         "or", [Formula("&", Formula("X"), Formula("!", Formula("Y")))])
     g2 = Generalization("and", [
         Generalization(
             "or", [Formula("&", Formula("X"), Formula("!", Formula("Y")))])
     ])
     self.assertEqual(Generalization("and", g1.cnf_action()), g2.cnf())
 def test_cnf_action_not_bottom(self):
     g1 = Generalization("or", [Formula("!", Formula("F"))])
     exp = [Generalization("or", [Formula("T")])]
     self.assertEqual(exp, g1.cnf_action())
 def test_cnf_action_beta(self):
     g1 = Generalization("or", [Formula("|", Formula("X"), Formula("Y"))])
     exp = [Generalization("or", [Formula("X"), Formula("Y")])]
     self.assertEqual(exp, g1.cnf_action())
 def test_cnf_action_basis(self):
     g1 = Generalization("or", [Formula("X"), Formula("Y"),
                                Formula("!", Formula("X"))])
     self.assertEqual([g1], g1.cnf_action())
Ejemplo n.º 7
0
 def test_cnf_action_not_bottom(self):
     g1 = Generalization("or", [Formula("!", Formula("F"))])
     exp = [Generalization("or", [Formula("T")])]
     self.assertEqual(exp, g1.cnf_action())
Ejemplo n.º 8
0
 def test_cnf_action_basis(self):
     g1 = Generalization(
         "or", [Formula("X"),
                Formula("Y"),
                Formula("!", Formula("X"))])
     self.assertEqual([g1], g1.cnf_action())