Skip to content

Commit

Permalink
fix str.at rewrite
Browse files Browse the repository at this point in the history
Signed-off-by: Nikolaj Bjorner <[email protected]>
  • Loading branch information
NikolajBjorner committed Oct 7, 2019
1 parent a8e7074 commit 9a516e5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/ast/rewriter/seq_rewriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
3 changes: 3 additions & 0 deletions src/nlsat/nlsat_solver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 9a516e5

Please sign in to comment.