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)
def transform_fun(): data = dict(request.json) print data _type = str(data['type']) _params = [str(p) for p in data['params'].split(',')] global resDF trdf = transform(resDF, _type, _params) table_1 = trdf.to_html(classes='table', index=False, escape=False) return table_1
fof_data = l.parse_and_load(args['file']) #fof_data = from_file(args['file']) elif args['formula']: fof_data = from_string("fof(ax,axiom," + args['formula'] + ").") elif args['jsonfile']: fof_data = l.load_file(args['jsonfile']) else : string = "fof(ax, axiom, ![X]: r(X) => ?[Y]:r(Y) ).fof(ax, conjecture, ![X]: r(X) => ?[Y]:r(Y) )." 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:
def proof(formula): formula = o.transform(formula.negate()) return r.proof([formula])
def negate_and_transform(self, formula): formula = o.transform(UnaryOperator("~",formula)) return formula
def negate_and_transform(self, formula): formula = o.transform(UnaryOperator("~", formula)) return formula
fof_data = l.parse_and_load(args['file']) #fof_data = from_file(args['file']) elif args['formula']: fof_data = from_string("fof(ax,axiom," + args['formula'] + ").") elif args['jsonfile']: fof_data = l.load_file(args['jsonfile']) else: string = "fof(ax, axiom, ![X]: r(X) => ?[Y]:r(Y) ).fof(ax, conjecture, ![X]: r(X) => ?[Y]:r(Y) )." 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: