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')
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')
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')
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")
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")
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)
def button_test_click(self): def after(formula): self.add_formula(formula, predecessors=[], rule_name="dojdojdoj") FormulaBuilder(proof.get_operations(), after, type='rel').show()