3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-06-06 22:23:22 +00:00

bug in non-member disjunction

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2020-05-28 12:03:40 -07:00
parent 220b8afd97
commit 6a90072a98
3 changed files with 5 additions and 6 deletions

View file

@ -816,10 +816,7 @@ class smt2_printer {
TRACE("pp_let", tout << "decls.size(): " << decls.size() << "\n";); TRACE("pp_let", tout << "decls.size(): " << decls.size() << "\n";);
ptr_buffer<format> buf; ptr_buffer<format> buf;
unsigned num_op = 0; unsigned num_op = 0;
vector<ptr_vector<format> >::iterator it = decls.begin(); for (ptr_vector<format> & lvl_decls : decls) {
vector<ptr_vector<format> >::iterator end = decls.end();
for (; it != end; ++it) {
ptr_vector<format> & lvl_decls = *it;
if (lvl_decls.empty()) if (lvl_decls.empty())
continue; continue;
if (num_op > 0) if (num_op > 0)

View file

@ -2717,7 +2717,7 @@ void seq_rewriter::elim_condition(expr* elem, expr_ref& cond) {
else { else {
ranges1.reset(); ranges1.reset();
ranges1.append(ranges); ranges1.append(ranges);
intersect(0, ch-1, ranges); intersect(0, ch - 1, ranges);
intersect(ch + 1, zstring::max_char(), ranges1); intersect(ch + 1, zstring::max_char(), ranges1);
ranges.append(ranges1); ranges.append(ranges1);
} }

View file

@ -303,7 +303,7 @@ namespace smt {
} }
/** /**
* is_non_empty(r, u) => nullable or not c_i or is_non_empty(r_i, u union r) * is_non_empty(r, u) => nullable or \/_i (c_i and is_non_empty(r_i, u union r))
* *
* for each (c_i, r_i) in cofactors (min-terms) * for each (c_i, r_i) in cofactors (min-terms)
* *
@ -337,6 +337,8 @@ namespace smt {
if (m.is_false(cond)) if (m.is_false(cond))
continue; continue;
expr_ref next_non_empty = sk().mk_is_non_empty(p.second, re().mk_union(u, r)); expr_ref next_non_empty = sk().mk_is_non_empty(p.second, re().mk_union(u, r));
if (!m.is_true(cond))
next_non_empty = m.mk_and(cond, next_non_empty);
lits.push_back(th.mk_literal(next_non_empty)); lits.push_back(th.mk_literal(next_non_empty));
} }
th.add_axiom(lits); th.add_axiom(lits);