mirror of
https://github.com/Z3Prover/z3
synced 2025-04-10 19:27:06 +00:00
add model validation
This commit is contained in:
parent
b5aab7ec2a
commit
16db8bf49e
|
@ -34,6 +34,7 @@ namespace euf {
|
|||
values2model(deps, mdl);
|
||||
for (auto* mb : m_solvers)
|
||||
mb->finalize_model(*mdl);
|
||||
// validate_model(*mdl);
|
||||
}
|
||||
|
||||
bool solver::include_func_interp(func_decl* f) {
|
||||
|
@ -196,5 +197,19 @@ namespace euf {
|
|||
return m_values2root;
|
||||
}
|
||||
|
||||
void solver::validate_model(model& mdl) {
|
||||
for (enode* n : m_egraph.nodes()) {
|
||||
expr* e = n->get_expr();
|
||||
if (!m.is_bool(e))
|
||||
continue;
|
||||
unsigned id = n->get_root_id();
|
||||
bool tt = m.is_true(m_values.get(id));
|
||||
if (mdl.is_true(e) != tt) {
|
||||
IF_VERBOSE(0, verbose_stream() << "Failed to evaluate " << id << " " << mk_bounded_pp(e, m) << "\n");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue