示例#1
0
文件: test_main.py 项目: jtpaasch/inc
    def test_expand_f_neg(self):
        """Ensure ``expand()`` expands false negations."""
        a = language.atom("A")
        neg_a = language.molecule("NEG", [a])
        f_neg_a = language.sign_formula("F", neg_a)
        t_a = language.sign_formula("T", a)

        branches = [[f_neg_a]]

        result = main.expand(PC.rules, branches)
        self.assertEqual(result, [[t_a]])
示例#2
0
文件: test_main.py 项目: jtpaasch/inc
    def test_expand_t_conj(self):
        """Ensure ``expand()`` expands true conjunctions."""
        a = language.atom("A")
        b = language.atom("B")
        conj = language.molecule("CONJ", [a, b])
        t_conj = language.sign_formula("T", conj)
        t_a = language.sign_formula("T", a)
        t_b = language.sign_formula("T", b)

        branches = [[t_conj]]

        result = main.expand(PC.rules, branches)
        self.assertEqual(result, [[t_a, t_b]])
示例#3
0
文件: test_main.py 项目: jtpaasch/inc
    def test_expand_t_neg_mbC(self):
        """Ensure ``expand()`` expands false negations (for mbC)."""
        a = language.atom("A")
        neg_a = language.molecule("NEG", [a])
        ball_a = language.molecule("BALL", [a])
        f_a = language.sign_formula("F", a)
        t_neg_a = language.sign_formula("T", neg_a)
        t_ball_a = language.sign_formula("T", ball_a)

        branches = [[t_neg_a, t_ball_a]]

        result = main.expand(mbC.rules, branches)
        self.assertEqual(result, [[f_a]])