3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-13 12:28:44 +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());
}
#else
bool theory_array_base::has_array_ext(enode* n) {
enode* r = n;
do {
if (is_array_ext(n->get_owner()))
return true;
n = n->get_next();
bool theory_array_base::is_select_arg(enode* r) {
for (enode* n : r->get_parents()) {
if (is_select(n)) {
for (unsigned i = 1; i < n->get_num_args(); ++i) {
if (r == n->get_arg(i)->get_root()) {
return true;
}
}
}
}
while (r != n);
return false;
}
@ -534,10 +537,10 @@ namespace smt {
if (r->is_marked()) {
continue;
}
// array extensionality terms may be produced in nested arrays.
// they have to be treated as shared to resolve equalities.
// issue #3532
if (ctx.is_shared(r) || has_array_ext(r)) {
// arrays used as indices in other arrays have to be treated as shared.
// issue #3532, #3529
//
if (ctx.is_shared(r) || is_select_arg(r)) {
TRACE("array", tout << "new shared var: #" << r->get_owner_id() << "\n";);
theory_var r_th_var = r->get_th_var(get_id());
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_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 has_array_ext(enode* n);
bool is_select_arg(enode* r);
app * mk_select(unsigned num_args, expr * const * args);
app * mk_store(unsigned num_args, expr * const * args);