示例#1
0
文件: ivy_transrel.py 项目: asyaf/ivy
def implies(s1, s2):
    assert isinstance(s1, SemValue) and type(s1) is type(s2)
    op = s1.op
    axioms = im.background_theory()
    u1, c1, p1 = s1.comps
    u2, c2, p2 = s2.comps
    if u1 == None and u2 != None:
        return False


#    print "c1: {}".format(c1)
#    print "axioms: {}".format(axioms)
#    print "df: {}".format(diff_frame(u1,u2,relations,op))
    c1 = and_clauses(c1, axioms, diff_frame(u1, u2, op))
    if isinstance(c2, Clauses):
        if not c2.is_universal_first_order(
        ) or not p2.is_universal_first_order():
            return False
        c2 = and_clauses(c2, diff_frame(u2, u1, op))
        return clauses_imply(p1, p2) and clauses_imply(c1, c2)
    else:
        if not is_prenex_universal(c2) or not is_prenex_universal(p2):
            return False
        c2 = And(c2, clauses_to_formula(diff_frame(u2, u1, op)))
        return clauses_imply_formula_cex(p1, p2) and clauses_imply_formula_cex(
            c1, c2)
示例#2
0
def implies(s1,s2,axioms,relations,op):
    u1,c1,p1 = s1
    u2,c2,p2 = s2
    if u1 == None and u2 != None:
        return False
#    print "c1: {}".format(c1)
#    print "axioms: {}".format(axioms)
#    print "df: {}".format(diff_frame(u1,u2,relations,op))
    c1 = and_clauses(c1,axioms,diff_frame(u1,u2,relations,op))
    if isinstance(c2,Clauses):
        if not c2.is_universal_first_order() or not p2.is_universal_first_order():
            return False
        c2 = and_clauses(c2,diff_frame(u2,u1,relations,op))
        return clauses_imply(p1,p2) and clauses_imply(c1,c2)
    else:
        if not is_prenex_universal(c2) or not is_prenex_universal(p2):
            return False
        c2 = And(c2,clauses_to_formula(diff_frame(u2,u1,relations,op)))
        return clauses_imply_formula_cex(p1,p2) and clauses_imply_formula_cex(c1,c2)
示例#3
0
def implies(s1,s2):
    assert isinstance(s1,SemValue) and type(s1) is type(s2)
    op = s1.op
    axioms = im.background_theory()
    u1,c1,p1 = s1.comps
    u2,c2,p2 = s2.comps
    if u1 == None and u2 != None:
        return False
#    print "c1: {}".format(c1)
#    print "axioms: {}".format(axioms)
#    print "df: {}".format(diff_frame(u1,u2,relations,op))
    c1 = and_clauses(c1,axioms,diff_frame(u1,u2,op))
    if isinstance(c2,Clauses):
        if not c2.is_universal_first_order() or not p2.is_universal_first_order():
            return False
        c2 = and_clauses(c2,diff_frame(u2,u1,op))
        return clauses_imply(p1,p2) and clauses_imply(c1,c2)
    else:
        if not is_prenex_universal(c2) or not is_prenex_universal(p2):
            return False
        c2 = And(c2,clauses_to_formula(diff_frame(u2,u1,op)))
        return clauses_imply_formula_cex(p1,p2) and clauses_imply_formula_cex(c1,c2)