3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-06 09:34:08 +00:00

fix str.at rewrite

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2019-10-06 20:43:02 -07:00
parent a8e7074ddd
commit 9a516e5e41
2 changed files with 8 additions and 1 deletions

View file

@ -1007,9 +1007,13 @@ br_status seq_rewriter::mk_seq_at(expr* a, expr* b, expr_ref& result) {
unsigned i = 0;
for (; i < m_lhs.size(); ++i) {
expr* lhs = m_lhs.get(i);
if (lens.contains(lhs)) {
if (lens.contains(lhs) && !r.is_neg()) {
lens.erase(lhs);
}
else if (m_util.str.is_unit(lhs) && r.is_zero() && lens.empty()) {
result = lhs;
return BR_REWRITE1;
}
else if (m_util.str.is_unit(lhs) && r.is_pos()) {
r -= rational(1);
}

View file

@ -1586,6 +1586,9 @@ namespace nlsat {
check_lemma(c->size(), c->c_ptr(), false, nullptr);
}
}
for (clause* c : m_learned) {
IF_VERBOSE(0, display(verbose_stream() << "KEEP: ", c->size(), c->c_ptr()) << "\n");
}
assumptions.reset();
assumptions.append(result);
return r;