Skip to content

Commit

Permalink
fix regressions during string fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
  • Loading branch information
NikolajBjorner committed Aug 25, 2019
1 parent 0d9cd7b commit 64f4c97
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/smt/theory_seq.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6044,6 +6044,12 @@ void theory_seq::propagate_not_prefix(expr* e) {
VERIFY(m_util.str.is_prefix(e, e1, e2));
literal lit = ctx.get_literal(e);
SASSERT(ctx.get_assignment(lit) == l_false);
dependency * deps = nullptr;
expr_ref cont = canonize(e, deps);
if (m.is_true(cont)) {
propagate_lit(deps, 0, nullptr, lit);
return;
}
propagate_non_empty(~lit, e1);
literal e1_gt_e2 = mk_simplified_literal(m_autil.mk_ge(mk_sub(mk_len(e1), mk_len(e2)), m_autil.mk_int(1)));
sort* char_sort = nullptr;
Expand All @@ -6070,6 +6076,13 @@ void theory_seq::propagate_not_suffix(expr* e) {
VERIFY(m_util.str.is_suffix(e, e1, e2));
literal lit = ctx.get_literal(e);
SASSERT(ctx.get_assignment(lit) == l_false);

dependency * deps = nullptr;
expr_ref cont = canonize(e, deps);
if (m.is_true(cont)) {
propagate_lit(deps, 0, nullptr, lit);
return;
}
propagate_non_empty(~lit, e1);
literal e1_gt_e2 = mk_simplified_literal(m_autil.mk_ge(mk_sub(mk_len(e1), mk_len(e2)), m_autil.mk_int(1)));
sort* char_sort = nullptr;
Expand Down

0 comments on commit 64f4c97

Please sign in to comment.