3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-07 18:05:21 +00:00

fix bug in order for model conversion in normalize_bounds

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2018-06-18 09:34:53 -07:00
parent c81f25a1c8
commit cd890bd993
4 changed files with 9 additions and 16 deletions

View file

@ -1826,8 +1826,9 @@ void cmd_context::validate_model() {
catch (contains_underspecified_op_proc::found) {
continue;
}
TRACE("model_validate", model_smt2_pp(tout, *this, *(md.get()), 0););
TRACE("model_validate", model_smt2_pp(tout, *this, *md, 0););
IF_VERBOSE(10, verbose_stream() << "model check failed on: " << mk_pp(a, m()) << "\n";);
IF_VERBOSE(11, model_smt2_pp(verbose_stream(), *this, *md, 0););
invalid_model = true;
}
}

View file

@ -162,10 +162,8 @@ class lia2pb_tactic : public tactic {
}
bool has_target() {
bound_manager::iterator it = m_bm.begin();
bound_manager::iterator end = m_bm.end();
for (; it != end; ++it) {
if (is_target(*it))
for (expr * x : m_bm) {
if (is_target(x))
return true;
}
return false;
@ -174,10 +172,7 @@ class lia2pb_tactic : public tactic {
bool check_num_bits() {
unsigned num_bits = 0;
rational u;
bound_manager::iterator it = m_bm.begin();
bound_manager::iterator end = m_bm.end();
for (; it != end; ++it) {
expr * x = *it;
for (expr * x : m_bm) {
if (is_target_core(x, u) && u > rational(1)) {
num_bits += u.get_num_bits();
if (num_bits > m_total_bits)
@ -234,10 +229,7 @@ class lia2pb_tactic : public tactic {
expr_substitution subst(m, m_produce_unsat_cores, false);
rational u;
ptr_buffer<expr> def_args;
bound_manager::iterator it = m_bm.begin();
bound_manager::iterator end = m_bm.end();
for (; it != end; ++it) {
expr * x = *it;
for (expr * x : m_bm) {
if (is_target_core(x, u) && u > rational(1)) {
num_converted++;
def_args.reset();
@ -251,7 +243,7 @@ class lia2pb_tactic : public tactic {
def_args.push_back(x_prime);
else
def_args.push_back(m_util.mk_mul(m_util.mk_numeral(a, true), x_prime));
if (m_produce_models)
if (m_produce_models)
gmc->hide(x_prime->get_decl());
a *= rational(2);
}

View file

@ -109,8 +109,8 @@ class normalize_bounds_tactic : public tactic {
expr * def = m_util.mk_add(x_prime, m_util.mk_numeral(val, s));
subst.insert(x, def);
if (produce_models) {
gmc->add(to_app(x)->get_decl(), def);
gmc->hide(x_prime->get_decl());
gmc->add(to_app(x)->get_decl(), def);
}
}
}

View file

@ -41,7 +41,7 @@ void generic_model_converter::add(func_decl * d, expr* e) {
void generic_model_converter::operator()(model_ref & md) {
TRACE("model_converter", tout << "before generic_model_converter\n"; model_v2_pp(tout, *md); display(tout););
// IF_VERBOSE(0, verbose_stream() << "Apply converter " << m_orig << "\n";);
model_evaluator ev(*(md.get()));
ev.set_model_completion(true);
ev.set_expand_array_equalities(false);