3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-05-10 17:25:47 +00:00

fix bug reported in issue #193: MBQI needs to avoid instantiating data-types that contain model values in nested positions

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2015-08-13 14:29:48 +02:00
parent 702af71a2d
commit cd838e5cf4
7 changed files with 100 additions and 40 deletions

View file

@ -171,7 +171,7 @@ namespace smt {
sk_value = sk_term;
}
}
if (m_manager.is_model_value(sk_value))
if (contains_model_value(sk_value))
return false;
bindings.set(num_decls - i - 1, sk_value);
}
@ -190,6 +190,30 @@ namespace smt {
return true;
}
void model_checker::operator()(expr *n) {
if (m_manager.is_model_value(n)) {
throw is_model_value();
}
}
bool model_checker::contains_model_value(expr* n) {
if (m_manager.is_model_value(n)) {
return true;
}
if (is_app(n) && to_app(n)->get_num_args() == 0) {
return false;
}
m_visited.reset();
try {
for_each_expr(*this, m_visited, n);
}
catch (is_model_value) {
return true;
}
return false;
}
bool model_checker::add_blocking_clause(model * cex, expr_ref_vector & sks) {
SASSERT(cex != 0);
unsigned num_sks = sks.size();