3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-02-28 19:01:29 +00:00

fix infinite loop in traversing equivalence class, #1274, still requires addressing MBQI

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2017-11-15 21:17:00 -08:00
parent f47671931f
commit c3f67f3b5f
4 changed files with 24 additions and 8 deletions

View file

@ -47,6 +47,8 @@ namespace smt {
sLevel(0),
finalCheckProgressIndicator(false),
m_trail(m),
m_factory(nullptr),
m_unused_id(0),
m_delayed_axiom_setup_terms(m),
tmpStringVarCount(0),
tmpXorVarCount(0),
@ -4648,14 +4650,17 @@ namespace smt {
// We only check m_find for a string constant.
expr * theory_str::z3str2_get_eqc_value(expr * n , bool & hasEqcValue) {
expr * curr = n;
theory_var curr = m_find.find(get_var(n));
theory_var first = curr;
do {
if (u.str.is_string(curr)) {
expr* a = get_ast(curr);
if (u.str.is_string(a)) {
hasEqcValue = true;
return curr;
return a;
}
curr = get_eqc_next(curr);
} while (curr != n);
curr = m_find.next(curr);
}
while (curr != first && curr != null_theory_var);
hasEqcValue = false;
return n;
}
@ -10584,7 +10589,9 @@ namespace smt {
return alloc(expr_wrapper_proc, val);
} else {
TRACE("str", tout << "WARNING: failed to find a concrete value, falling back" << std::endl;);
return alloc(expr_wrapper_proc, to_app(mk_string("**UNUSED**")));
std::ostringstream unused;
unused << "**UNUSED**" << (m_unused_id++);
return alloc(expr_wrapper_proc, to_app(mk_string(unused.str().c_str())));
}
}