Ejemplo n.º 1
0
def theorem_proving(prove_fun, premises, conclusion, predicates, lst):
    res = prove_fun(premises, conclusion, predicates, lst)
    if res:
        prediction = 'yes'
    else:
        negated_conclusion = NegatedExpression(conclusion)
        res = prove_fun(premises, negated_conclusion, predicates, lst)
        if res:
            prediction = 'no'
        else:
            prediction = 'unknown'
    return prediction
Ejemplo n.º 2
0
def theorem_proving(prove_fun, premises, conclusion, predicates, lst, axioms,
                    mode, data):
    res = prove_fun(premises, conclusion, predicates, lst, axioms, mode)
    if res:
        prediction = 'yes'
    else:
        if data not in datasets:
            negated_conclusion = NegatedExpression(conclusion)
            res = prove_fun(premises, negated_conclusion, predicates, lst,
                            axioms, mode)
            if res:
                prediction = 'no'
            else:
                prediction = 'unknown'
        else:
            prediction = 'unknown'
    return prediction