Skip to content

Commit dd211ba

Browse files
filter out terms that are not solved
1 parent f89e133 commit dd211ba

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

src/api/api_qe.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,11 @@ extern "C"
9595

9696
obj_map<ast, ast*> &map_z3 = to_ast_map_ref(map);
9797

98-
for (auto& kv : emap) {
99-
m.inc_ref(kv.m_key);
100-
m.inc_ref(kv.m_value);
101-
map_z3.insert(kv.m_key, kv.m_value);
98+
for (auto& [k,v] : emap) {
99+
SASSERT(v);
100+
m.inc_ref(k);
101+
m.inc_ref(v);
102+
map_z3.insert(k, v);
102103
}
103104

104105
return of_expr (result);

src/api/api_solver.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -995,9 +995,11 @@ extern "C" {
995995
_terms.reset();
996996
_guards.reset();
997997
for (solver::solution const& s : solutions) {
998+
if (!s.term)
999+
continue;
9981000
_vars.push_back(s.var);
9991001
_terms.push_back(s.term);
1000-
_guards.push_back(s.guard);
1002+
_guards.push_back(s.guard ? s.guard : m.mk_true());
10011003
}
10021004
Z3_CATCH;
10031005
}

0 commit comments

Comments
 (0)