mirror of
https://github.com/Z3Prover/z3
synced 2025-04-12 04:03:39 +00:00
modify #5454
This commit is contained in:
parent
429e5ed0cd
commit
904c6e21b1
|
@ -175,6 +175,9 @@ namespace array {
|
||||||
ptr_buffer<expr> sel1_args, sel2_args;
|
ptr_buffer<expr> sel1_args, sel2_args;
|
||||||
unsigned num_args = select->get_num_args();
|
unsigned num_args = select->get_num_args();
|
||||||
|
|
||||||
|
expr* arg = select->get_arg(0);
|
||||||
|
if (arg != store && !can_beta_reduce(arg) && expr2enode(arg)->get_root() == expr2enode(store)->get_root())
|
||||||
|
return false;
|
||||||
bool has_diff = false;
|
bool has_diff = false;
|
||||||
for (unsigned i = 1; i < num_args; i++)
|
for (unsigned i = 1; i < num_args; i++)
|
||||||
has_diff |= expr2enode(select->get_arg(i))->get_root() != expr2enode(store->get_arg(i))->get_root();
|
has_diff |= expr2enode(select->get_arg(i))->get_root() != expr2enode(store->get_arg(i))->get_root();
|
||||||
|
@ -182,7 +185,7 @@ namespace array {
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
sel1_args.push_back(store);
|
sel1_args.push_back(store);
|
||||||
sel2_args.push_back(store->get_arg(0));
|
sel2_args.push_back(arg);
|
||||||
|
|
||||||
for (unsigned i = 1; i < num_args; i++) {
|
for (unsigned i = 1; i < num_args; i++) {
|
||||||
sel1_args.push_back(select->get_arg(i));
|
sel1_args.push_back(select->get_arg(i));
|
||||||
|
|
|
@ -272,8 +272,7 @@ namespace array {
|
||||||
return !get_config().m_array_delay_exp_axiom && d.m_prop_upward;
|
return !get_config().m_array_delay_exp_axiom && d.m_prop_upward;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool solver::can_beta_reduce(euf::enode* n) const {
|
bool solver::can_beta_reduce(expr* c) const {
|
||||||
expr* c = n->get_expr();
|
|
||||||
return a.is_const(c) || a.is_as_array(c) || a.is_store(c) || is_lambda(c) || a.is_map(c);
|
return a.is_const(c) || a.is_as_array(c) || a.is_store(c) || is_lambda(c) || a.is_map(c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -209,7 +209,8 @@ namespace array {
|
||||||
unsigned get_lambda_equiv_size(var_data const& d) const;
|
unsigned get_lambda_equiv_size(var_data const& d) const;
|
||||||
bool should_set_prop_upward(var_data const& d) const;
|
bool should_set_prop_upward(var_data const& d) const;
|
||||||
bool should_prop_upward(var_data const& d) const;
|
bool should_prop_upward(var_data const& d) const;
|
||||||
bool can_beta_reduce(euf::enode* n) const;
|
bool can_beta_reduce(euf::enode* n) const { return can_beta_reduce(n->get_expr()); }
|
||||||
|
bool can_beta_reduce(expr* e) const;
|
||||||
|
|
||||||
var_data& get_var_data(euf::enode* n) { return get_var_data(n->get_th_var(get_id())); }
|
var_data& get_var_data(euf::enode* n) { return get_var_data(n->get_th_var(get_id())); }
|
||||||
var_data& get_var_data(theory_var v) { return *m_var_data[v]; }
|
var_data& get_var_data(theory_var v) { return *m_var_data[v]; }
|
||||||
|
|
Loading…
Reference in a new issue