예제 #1
0
파일: ivy_solver.py 프로젝트: simudream/ivy
def clause_model_simp(m, c):
    """ Simplify a clause by dropping literals while maintaining its truth in a model. """
    res = []
    for l in c:
        if not is_ground_lit(l):
            res.append(l)
            continue
        if isinstance(l.atom, ivy_logic.And):
            print "clause_model_simp: {}".format(c)
        v = m.eval(literal_to_z3(l))
        if z3.is_true(v):
            return [l]
        if not z3.is_false(v):
            res.append(l)
    return res
예제 #2
0
파일: ivy_solver.py 프로젝트: odedp/ivy
def clause_model_simp(m, c):
    """ Simplify a clause by dropping literals while maintaining its truth in a model. """
    res = []
    for l in c:
        if not is_ground_lit(l):
            res.append(l)
            continue
        #        if isinstance(l.atom,ivy_logic.And):
        #            print "clause_model_simp: {}".format(c)
        v = m.eval(literal_to_z3(l))
        if z3.is_true(v):
            return [l]
        if not z3.is_false(v):
            res.append(l)
    return res