mirror of
https://github.com/Z3Prover/z3
synced 2025-05-15 11:44:44 +00:00
Issue #354. Fix unsoundness in Array theory based on missing propagation of selects over ite expressions
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
0df4931c4b
commit
fce286db91
10 changed files with 112 additions and 10 deletions
|
@ -399,6 +399,45 @@ namespace smt {
|
|||
|
||||
#endif
|
||||
|
||||
bool context::validate_model() {
|
||||
if (!m_proto_model) {
|
||||
return true;
|
||||
}
|
||||
ast_manager& m = m_manager;
|
||||
literal_vector::const_iterator it = m_assigned_literals.begin();
|
||||
literal_vector::const_iterator end = m_assigned_literals.end();
|
||||
for (; it != end; ++it) {
|
||||
literal lit = *it;
|
||||
if (!is_relevant(lit)) {
|
||||
continue;
|
||||
}
|
||||
expr_ref n(m), res(m);
|
||||
literal2expr(lit, n);
|
||||
if (!is_ground(n)) {
|
||||
continue;
|
||||
}
|
||||
switch (get_assignment(*it)) {
|
||||
case l_undef:
|
||||
break;
|
||||
case l_true:
|
||||
m_proto_model->eval(n, res, false);
|
||||
CTRACE("mbqi_bug", !m.is_true(res), tout << n << " evaluates to " << res << "\n";);
|
||||
if (m.is_false(res)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case l_false:
|
||||
m_proto_model->eval(n, res, false);
|
||||
CTRACE("mbqi_bug", !m.is_false(res), tout << n << " evaluates to " << res << "\n";);
|
||||
if (m.is_true(res)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
\brief validate unsat core returned by
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue