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
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