3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-05-11 09:44:43 +00:00

z3str3: ensure top-level free variables always participate in model construction

This commit is contained in:
Murphy Berzish 2020-01-22 15:13:56 -05:00 committed by Nikolaj Bjorner
parent 812049ca4a
commit 237adbf40c
3 changed files with 14 additions and 3 deletions

View file

@ -614,6 +614,7 @@ namespace smt {
}
lbool theory_str::fixed_length_model_construction(expr_ref_vector formulas, expr_ref_vector &precondition,
expr_ref_vector& free_variables,
obj_map<expr, zstring> &model, expr_ref_vector &cex) {
ast_manager & m = get_manager();
@ -658,6 +659,15 @@ namespace smt {
sort * str_sort = u.str.mk_string_sort();
sort * bool_sort = m.mk_bool_sort();
for (expr * var : free_variables) {
TRACE("str_fl", tout << "initialize free variable " << mk_pp(var, m) << std::endl;);
rational var_lenVal;
if (!fixed_length_get_len_value(var, var_lenVal)) {
NOT_IMPLEMENTED_YET();
}
fixed_length_reduce_string_term(subsolver, var);
}
for (expr * f : formulas) {
if (!get_context().is_relevant(f)) {
TRACE("str_fl", tout << "skip reducing formula " << mk_pp(f, m) << ", not relevant" << std::endl;);