示例#1
0
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)
示例#2
0
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)
示例#3
0
文件: main.py 项目: slomo/fol-2012
        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")
示例#4
0
def proof(formula):
    formula = o.transform(formula.negate())
    return r.proof([formula])
示例#5
0
        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")