def proof(fstr): fstr = "fof(ax,axiom, (" + fstr + ") )." print("fof", fstr) formula = p.parse_string(fstr)[0]['formula'] formula = o.transform(formula.negate()) return r.proof(formula)
def proof(fstr): fstr = "fof(ax,axiom, (" + fstr + ") )." print("fof",fstr) formula = p.parse_string(fstr)[0]['formula'] formula = o.transform(formula.negate()) return r.proof(formula)
fof_data = from_string(string) print("input formula:",fof_data) conjectures = [] axioms = [] for formula in fof_data: if formula['type'] in ('axiom', 'theorem'): formula = o.transform(formula['formula']) axioms.append(formula) elif formula['type'] in ('conjecture'): f = formula['formula'].negate() f = o.transform(f) conjectures.append(f) print('axioms: ', axioms) print('conjectures: ', conjectures) for conjecture in conjectures: print("working on: ", conjecture) stuff = [] stuff.append(conjecture) stuff += axioms print(type(stuff)) result = r.proof(stuff) if result: print("formula is theorem") else: stuff[0] = o.transform(conjecture.negate()) if r.proof(stuff): print("formula is counter theorem") else: print("Unable")
def proof(formula): formula = o.transform(formula.negate()) return r.proof([formula])
fof_data = from_string(string) print("input formula:", fof_data) conjectures = [] axioms = [] for formula in fof_data: if formula['type'] in ('axiom', 'theorem'): formula = o.transform(formula['formula']) axioms.append(formula) elif formula['type'] in ('conjecture'): f = formula['formula'].negate() f = o.transform(f) conjectures.append(f) print('axioms: ', axioms) print('conjectures: ', conjectures) for conjecture in conjectures: print("working on: ", conjecture) stuff = [] stuff.append(conjecture) stuff += axioms print(type(stuff)) result = r.proof(stuff) if result: print("formula is theorem") else: stuff[0] = o.transform(conjecture.negate()) if r.proof(stuff): print("formula is counter theorem") else: print("Unable")