3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-15 13:28:47 +00:00
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2020-03-29 12:48:14 -07:00
parent c142f99127
commit f74079de01
2 changed files with 15 additions and 13 deletions

View file

@ -509,14 +509,17 @@ namespace smt {
unmark_enodes(to_unmark.size(), to_unmark.c_ptr()); unmark_enodes(to_unmark.size(), to_unmark.c_ptr());
} }
#else #else
bool theory_array_base::has_array_ext(enode* n) {
enode* r = n; bool theory_array_base::is_select_arg(enode* r) {
do { for (enode* n : r->get_parents()) {
if (is_array_ext(n->get_owner())) if (is_select(n)) {
return true; for (unsigned i = 1; i < n->get_num_args(); ++i) {
n = n->get_next(); if (r == n->get_arg(i)->get_root()) {
return true;
}
}
}
} }
while (r != n);
return false; return false;
} }
@ -534,10 +537,10 @@ namespace smt {
if (r->is_marked()) { if (r->is_marked()) {
continue; continue;
} }
// array extensionality terms may be produced in nested arrays. // arrays used as indices in other arrays have to be treated as shared.
// they have to be treated as shared to resolve equalities. // issue #3532, #3529
// issue #3532 //
if (ctx.is_shared(r) || has_array_ext(r)) { if (ctx.is_shared(r) || is_select_arg(r)) {
TRACE("array", tout << "new shared var: #" << r->get_owner_id() << "\n";); TRACE("array", tout << "new shared var: #" << r->get_owner_id() << "\n";);
theory_var r_th_var = r->get_th_var(get_id()); theory_var r_th_var = r->get_th_var(get_id());
SASSERT(r_th_var != null_theory_var); SASSERT(r_th_var != null_theory_var);

View file

@ -60,8 +60,7 @@ namespace smt {
bool is_array_sort(enode const* n) const { return is_array_sort(n->get_owner()); } bool is_array_sort(enode const* n) const { return is_array_sort(n->get_owner()); }
bool is_set_has_size(enode const* n) const { return is_set_has_size(n->get_owner()); } bool is_set_has_size(enode const* n) const { return is_set_has_size(n->get_owner()); }
bool is_set_carde(enode const* n) const { return is_set_card(n->get_owner()); } bool is_set_carde(enode const* n) const { return is_set_card(n->get_owner()); }
bool has_array_ext(enode* n); bool is_select_arg(enode* r);
app * mk_select(unsigned num_args, expr * const * args); app * mk_select(unsigned num_args, expr * const * args);
app * mk_store(unsigned num_args, expr * const * args); app * mk_store(unsigned num_args, expr * const * args);