mirror of
https://github.com/Z3Prover/z3
synced 2025-04-10 19:27:06 +00:00
#5532 remove unsound rewrite rule that was recently added
This commit is contained in:
parent
72f6271d82
commit
be4df46f6f
|
@ -693,12 +693,6 @@ br_status array_rewriter::mk_eq_core(expr * lhs, expr * rhs, expr_ref & result)
|
|||
if (m_util.is_const(rhs) && m_util.is_store(lhs)) {
|
||||
std::swap(lhs, rhs);
|
||||
}
|
||||
if (m_util.is_const(lhs, v) && m_util.is_store(rhs)) {
|
||||
unsigned n = to_app(rhs)->get_num_args();
|
||||
result = m().mk_and(m().mk_eq(lhs, to_app(rhs)->get_arg(0)),
|
||||
m().mk_eq(v, to_app(rhs)->get_arg(n - 1)));
|
||||
return BR_REWRITE2;
|
||||
}
|
||||
if (m_util.is_const(lhs, v) && m_util.is_const(rhs, w)) {
|
||||
result = m().mk_eq(v, w);
|
||||
return BR_REWRITE1;
|
||||
|
|
|
@ -710,11 +710,10 @@ void model_evaluator::operator()(expr * t, expr_ref & result) {
|
|||
TRACE("model_evaluator", tout << mk_ismt2_pp(t, m()) << "\n";);
|
||||
m_imp->operator()(t, result);
|
||||
m_imp->expand_stores(result);
|
||||
TRACE("model_evaluator", tout << result << "\n";);
|
||||
TRACE("model_evaluator", tout << "eval: " << mk_ismt2_pp(t, m()) << " --> " << result << "\n";);
|
||||
}
|
||||
|
||||
expr_ref model_evaluator::operator()(expr * t) {
|
||||
TRACE("model_evaluator", tout << mk_ismt2_pp(t, m()) << "\n";);
|
||||
expr_ref result(m());
|
||||
this->operator()(t, result);
|
||||
return result;
|
||||
|
|
|
@ -189,7 +189,7 @@ namespace euf {
|
|||
else {
|
||||
IF_VERBOSE(1, verbose_stream() << "no model values created for " << mk_pp(e, m) << "\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void solver::values2model(deps_t const& deps, model_ref& mdl) {
|
||||
|
@ -291,6 +291,18 @@ namespace euf {
|
|||
}
|
||||
|
||||
void solver::validate_model(model& mdl) {
|
||||
model_evaluator ev(mdl);
|
||||
ev.set_model_completion(true);
|
||||
TRACE("model",
|
||||
for (enode* n : m_egraph.nodes()) {
|
||||
unsigned id = n->get_root_id();
|
||||
expr* val = m_values.get(id, nullptr);
|
||||
if (!val)
|
||||
continue;
|
||||
expr_ref mval = ev(n->get_expr());
|
||||
if (m.is_value(mval) && val != mval)
|
||||
tout << "#" << bpp(n) << " := " << mk_pp(val, m) << " ~ " << mval << "\n";
|
||||
});
|
||||
bool first = true;
|
||||
for (enode* n : m_egraph.nodes()) {
|
||||
expr* e = n->get_expr();
|
||||
|
|
Loading…
Reference in a new issue