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

filter out terms that are not solved

This commit is contained in:
Nikolaj Bjorner 2025-04-30 09:40:45 -07:00
parent f89e133d52
commit dd211bade9
2 changed files with 8 additions and 5 deletions

View file

@ -95,10 +95,11 @@ extern "C"
obj_map<ast, ast*> &map_z3 = to_ast_map_ref(map); obj_map<ast, ast*> &map_z3 = to_ast_map_ref(map);
for (auto& kv : emap) { for (auto& [k,v] : emap) {
m.inc_ref(kv.m_key); SASSERT(v);
m.inc_ref(kv.m_value); m.inc_ref(k);
map_z3.insert(kv.m_key, kv.m_value); m.inc_ref(v);
map_z3.insert(k, v);
} }
return of_expr (result); return of_expr (result);

View file

@ -995,9 +995,11 @@ extern "C" {
_terms.reset(); _terms.reset();
_guards.reset(); _guards.reset();
for (solver::solution const& s : solutions) { for (solver::solution const& s : solutions) {
if (!s.term)
continue;
_vars.push_back(s.var); _vars.push_back(s.var);
_terms.push_back(s.term); _terms.push_back(s.term);
_guards.push_back(s.guard); _guards.push_back(s.guard ? s.guard : m.mk_true());
} }
Z3_CATCH; Z3_CATCH;
} }