예제 #1
0
파일: Rules.py 프로젝트: vizafogo123/pokpok
def assumption_apply(formulas, after):
    def after1(formula):
        after(formula, type=ProofElement.SPLIT, second_formula=formula.negation().simplify(), predecessors=[],
              rule_name=assumption.name)
        # TODO:spoapok

    request_formula(proof.get_operations(), after1, type='rel')
예제 #2
0
파일: Rules.py 프로젝트: vizafogo123/pokpok
def gen_apply(formulas, after):
    def after1(formula):
        f = formulas[0]
        f = Formula(f.body[2:]).substitute(Formula([f.body[1]]), formula)
        after(f, rule_name=gen.name, additional_info=formula)

    request_formula([op for op in proof.get_operations() if op.type == Operation.EXPRESSION], after1, type='exp')
예제 #3
0
파일: Rules.py 프로젝트: vizafogo123/pokpok
def assumption_apply(formulas, after):
    def after1(formula):
        after(formula,
              type=ProofElement.SPLIT,
              second_formula=formula.negation().simplify(),
              predecessors=[],
              rule_name=assumption.name)
        # TODO:spoapok

    request_formula(proof.get_operations(), after1, type='rel')
예제 #4
0
파일: Rules.py 프로젝트: vizafogo123/pokpok
def gen_apply(formulas, after):
    def after1(formula):
        f = formulas[0]
        f = Formula(f.body[2:]).substitute(Formula([f.body[1]]), formula)
        after(f, rule_name=gen.name, additional_info=formula)

    request_formula([
        op for op in proof.get_operations() if op.type == Operation.EXPRESSION
    ],
                    after1,
                    type='exp')
예제 #5
0
            def poas(sender):
                if len(theorem.operations) == 1:
                    constants = [Operation("const" + str(i + 1), 0, print_scheme(i), name(i), Operation.EXPRESSION)
                                 for i in range(theorem.operations[0].no_of_args)]

                    def after1(f):
                        self.after(
                            theorem.formula.substitute_definition(Formula([theorem.operations[0]] + constants), f),
                            predecessors=[], rule_name="insert")

                    request_formula([op for op in proof.get_operations()] + constants,
                                    after1, type=('rel' if theorem.operations[0].type == Operation.RELATION else 'exp'))
                else:
                    self.after(theorem.formula, predecessors=[], rule_name="insert")
예제 #6
0
            def poas(sender):
                if len(theorem.operations) == 1:
                    constants = [
                        Operation("const" + str(i + 1), 0, print_scheme(i),
                                  name(i), Operation.EXPRESSION)
                        for i in range(theorem.operations[0].no_of_args)
                    ]

                    def after1(f):
                        self.after(theorem.formula.substitute_definition(
                            Formula([theorem.operations[0]] + constants), f),
                                   predecessors=[],
                                   rule_name="insert")

                    request_formula([op for op in proof.get_operations()] +
                                    constants,
                                    after1,
                                    type=('rel' if theorem.operations[0].type
                                          == Operation.RELATION else 'exp'))
                else:
                    self.after(theorem.formula,
                               predecessors=[],
                               rule_name="insert")
예제 #7
0
파일: Rules.py 프로젝트: vizafogo123/pokpok
def exist_apply(formulas, after):
    const = Operation.get_new_expression(proof.get_operations(), 0)
    f = formulas[0]
    f = Formula(f.body[2:]).substitute(Formula([f.body[1]]), Formula([const]))
    after(f, rule_name=exist.name, additional_info=const)
예제 #8
0
파일: Root.py 프로젝트: vizafogo123/pokpok
    def button_test_click(self):
        def after(formula):
            self.add_formula(formula, predecessors=[], rule_name="dojdojdoj")

        FormulaBuilder(proof.get_operations(), after, type='rel').show()
예제 #9
0
파일: Rules.py 프로젝트: vizafogo123/pokpok
def exist_apply(formulas, after):
    const = Operation.get_new_expression(proof.get_operations(), 0)
    f = formulas[0]
    f = Formula(f.body[2:]).substitute(Formula([f.body[1]]), Formula([const]))
    after(f, rule_name=exist.name, additional_info=const)
예제 #10
0
    def button_test_click(self):
        def after(formula):
            self.add_formula(formula, predecessors=[], rule_name="dojdojdoj")

        FormulaBuilder(proof.get_operations(), after, type='rel').show()