3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-24 01:25:31 +00:00
This commit is contained in:
Nikolaj Bjorner 2023-01-04 11:56:38 -08:00
commit 8d0d6d8f04
17 changed files with 25 additions and 22 deletions

View file

@ -228,14 +228,17 @@ br_status array_rewriter::mk_select_core(unsigned num_args, expr * const * args,
}
return true;
};
expr *array = to_app(args[0])->get_arg(0);
bool is_leaf = m_util.is_const(array);
bool should_expand =
m_blast_select_store ||
is_leaf ||
are_values() ||
(m_expand_select_store && to_app(args[0])->get_arg(0)->get_ref_count() == 1);
(m_expand_select_store && array->get_ref_count() == 1);
if (should_expand) {
// select(store(a, I, v), J) --> ite(I=J, v, select(a, J))
ptr_buffer<expr> new_args;
new_args.push_back(to_app(args[0])->get_arg(0));
new_args.push_back(array);
new_args.append(num_args-1, args+1);
expr * sel_a_j = m().mk_app(get_fid(), OP_SELECT, num_args, new_args.data());
expr * v = to_app(args[0])->get_arg(num_args);

View file

@ -27,7 +27,7 @@ Revision History:
template<typename Cfg>
void bit_blaster_tpl<Cfg>::checkpoint() {
if (memory::get_allocation_size() > m_max_memory)
if (memory::get_allocation_size() > m_max_memory || memory::above_high_watermark())
throw rewriter_exception(Z3_MAX_MEMORY_MSG);
if (!m().inc())
throw rewriter_exception(m().limit().get_cancel_msg());