Example #1
0
    def test_impl_1(self):
        wff = "a->b"
        expr = Impl(Atom("a"), Atom("b"))

        tree = PropParser.parse(wff)

        self.assertEqual(expr, tree.expr)
Example #2
0
    def test_or_4(self):
        wff = "a2df1|bash3"
        expr = Or(Atom("a2df1"), Atom("bash3"))

        tree = PropParser.parse(wff)

        self.assertEqual(expr, tree.expr)
Example #3
0
    def test_and_4(self):
        wff = "a2df1&bash3"
        expr = And(Atom("a2df1"), Atom("bash3"))

        tree = PropParser.parse(wff)

        self.assertEqual(expr, tree.expr)
Example #4
0
    def test_or_3(self):
        wff = "a | b"
        expr = Or(Atom("a"), Atom("b"))

        tree = PropParser.parse(wff)

        self.assertEqual(expr, tree.expr)
Example #5
0
    def test_eq_4(self):
        wff = "a2df1<->bash3"
        expr = Eq(Atom("a2df1"), Atom("bash3"))

        tree = PropParser.parse(wff)

        self.assertEqual(expr, tree.expr)
Example #6
0
    def test_and_3(self):
        wff = "a & b"
        expr = And(Atom("a"), Atom("b"))

        tree = PropParser.parse(wff)

        self.assertEqual(expr, tree.expr)
Example #7
0
    def test_eq_3(self):
        wff = "a <-> b"
        expr = Eq(Atom("a"), Atom("b"))

        tree = PropParser.parse(wff)

        self.assertEqual(expr, tree.expr)
Example #8
0
    def test_impl_4(self):
        wff = "a2df1->bash3"
        expr = Impl(Atom("a2df1"), Atom("bash3"))

        tree = PropParser.parse(wff)

        self.assertEqual(expr, tree.expr)
Example #9
0
    def test_complex_1(self):
        wff = "(a->b&c)<->!(d|a)"
        expr = Eq(Impl(Atom("a"), And(Atom("b"), Atom("c"))),
                  Not(Or(Atom("d"), Atom("a"))))

        tree = PropParser.parse(wff)

        self.assertEqual(expr, tree.expr)
Example #10
0
    def test_atom_1(self):
        wff = "A"
        expr = Atom("A")

        tree = PropParser.parse(wff)

        self.assertEqual(expr, tree.expr)
Example #11
0
    def test_atom_3(self):
        wff = "9af3b"
        expr = Atom("9af3b")

        tree = PropParser.parse(wff)

        self.assertEqual(expr, tree.expr)
Example #12
0
    def test_clamp_2(self):
        wff = "( ads )"
        expr = Atom("ads")

        tree = PropParser.parse(wff)

        self.assertEqual(expr, tree.expr)
Example #13
0
    def test_not_3(self):
        wff = "!a2df1"
        expr = Not(Atom("a2df1"))

        tree = PropParser.parse(wff)

        self.assertEqual(expr, tree.expr)
Example #14
0
    def test_complex_2(self):
        wff = "a|b&c|d&e&f"
        expr = Or(Or(Atom("a"), And(Atom("b"), Atom("c"))),
                  And(And(Atom("d"), Atom("e")), Atom("f")))

        tree = PropParser.parse(wff)

        self.assertEqual(expr, tree.expr)