mirror of
https://github.com/Z3Prover/z3
synced 2025-05-05 14:55:45 +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:
parent
aa2721517b
commit
55eb11d91b
5 changed files with 33 additions and 37 deletions
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue