3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-24 09:35:32 +00:00

fix bug in blocked clause elimination: it was ignoring unit literals

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2018-03-31 13:26:20 -07:00
parent aa2721517b
commit 55eb11d91b
5 changed files with 33 additions and 37 deletions

View file

@ -52,7 +52,7 @@ struct bit_blaster_model_converter : public model_converter {
m_newbits.push_back(f);
}
virtual ~bit_blaster_model_converter() {
~bit_blaster_model_converter() override {
}
void collect_bits(obj_hashtable<func_decl> & bits) {
@ -123,10 +123,7 @@ struct bit_blaster_model_converter : public model_converter {
SASSERT(is_uninterp_const(bit));
func_decl * bit_decl = to_app(bit)->get_decl();
expr * bit_val = old_model->get_const_interp(bit_decl);
if (bit_val == 0) {
goto bail;
}
if (m().is_true(bit_val))
if (bit_val != nullptr && m().is_true(bit_val))
val++;
}
}
@ -141,18 +138,12 @@ struct bit_blaster_model_converter : public model_converter {
func_decl * bit_decl = to_app(bit)->get_decl();
expr * bit_val = old_model->get_const_interp(bit_decl);
// remark: if old_model does not assign bit_val, then assume it is false.
if (bit_val == 0) {
goto bail;
}
if (!util.is_zero(bit_val))
if (bit_val != nullptr && !util.is_zero(bit_val))
val++;
}
}
new_val = util.mk_numeral(val, bv_sz);
new_model->register_decl(m_vars.get(i), new_val);
continue;
bail:
new_model->register_decl(m_vars.get(i), mk_bv(bs, *old_model));
}
}

View file

@ -40,6 +40,7 @@ Notes:
#include "tactic/smtlogics/qfbv_tactic.h"
#include "solver/tactic2solver.h"
#include "tactic/bv/bv_bound_chk_tactic.h"
#include "ackermannization/ackermannize_bv_tactic.h"
///////////////
class qfufbv_ackr_tactic : public tactic {
@ -158,13 +159,14 @@ static tactic * mk_qfufbv_preamble1(ast_manager & m, params_ref const & p) {
static tactic * mk_qfufbv_preamble(ast_manager & m, params_ref const & p) {
return and_then(mk_simplify_tactic(m),
mk_propagate_values_tactic(m),
mk_solve_eqs_tactic(m),
mk_elim_uncnstr_tactic(m),
if_no_proofs(if_no_unsat_cores(mk_reduce_args_tactic(m))),
if_no_proofs(if_no_unsat_cores(mk_bv_size_reduction_tactic(m))),
mk_max_bv_sharing_tactic(m)
);
mk_propagate_values_tactic(m),
mk_solve_eqs_tactic(m),
mk_elim_uncnstr_tactic(m),
if_no_proofs(if_no_unsat_cores(mk_reduce_args_tactic(m))),
if_no_proofs(if_no_unsat_cores(mk_bv_size_reduction_tactic(m))),
mk_max_bv_sharing_tactic(m),
if_no_proofs(if_no_unsat_cores(mk_ackermannize_bv_tactic(m,p)))
);
}
tactic * mk_qfufbv_tactic(ast_manager & m, params_ref const & p) {