3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-03-20 11:55:49 +00:00

fix: move m_fixed insertion after check_long_strings guard

m_fixed.insert(e) was placed before the check_long_strings guard,
causing check_fixed_length(false, false) to mark variables with
len > 20 as processed without actually decomposing them. The
subsequent check_fixed_length(false, true) then skipped them.

Move the insertion after the guard so variables are only marked
as fixed once they are actually decomposed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Lev Nachmanson 2026-03-17 15:40:45 -10:00 committed by Lev Nachmanson
parent 960ab8e67a
commit b5bf4be87e

View file

@ -505,12 +505,6 @@ bool theory_seq::fixed_length(expr* len_e, bool is_zero, bool check_long_strings
return false; return false;
} }
m_trail_stack.push(insert_obj_trail<expr>(m_fixed, e));
m_fixed.insert(e);
expr_ref seq(e, m), head(m), tail(m);
TRACE(seq, tout << "Fixed: " << mk_bounded_pp(e, m, 2) << " " << lo << "\n";); TRACE(seq, tout << "Fixed: " << mk_bounded_pp(e, m, 2) << " " << lo << "\n";);
literal a = mk_eq(len_e, m_autil.mk_numeral(lo, true), false); literal a = mk_eq(len_e, m_autil.mk_numeral(lo, true), false);
if (ctx.get_assignment(a) == l_false) if (ctx.get_assignment(a) == l_false)
@ -519,6 +513,11 @@ bool theory_seq::fixed_length(expr* len_e, bool is_zero, bool check_long_strings
if (!check_long_strings && lo > 20 && !is_zero) if (!check_long_strings && lo > 20 && !is_zero)
return false; return false;
m_trail_stack.push(insert_obj_trail<expr>(m_fixed, e));
m_fixed.insert(e);
expr_ref seq(e, m), head(m), tail(m);
if (lo.is_zero()) { if (lo.is_zero()) {
seq = m_util.str.mk_empty(e->get_sort()); seq = m_util.str.mk_empty(e->get_sort());
} }