mirror of
https://github.com/Z3Prover/z3
synced 2025-04-24 01:25:31 +00:00
#5778 - ensure arrays used inside of extensionality function are treated as shared
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
0a665b0fa0
commit
8e2f09b517
2 changed files with 9 additions and 33 deletions
|
@ -473,39 +473,12 @@ namespace smt {
|
|||
return false;
|
||||
}
|
||||
|
||||
#if 0
|
||||
void theory_array_base::collect_shared_vars(sbuffer<theory_var> & result) {
|
||||
TRACE("array_shared", tout << "collecting shared vars...\n";);
|
||||
ptr_buffer<enode> to_unmark;
|
||||
unsigned num_vars = get_num_vars();
|
||||
for (unsigned i = 0; i < num_vars; i++) {
|
||||
enode * n = get_enode(i);
|
||||
if (ctx.is_relevant(n) && ctx.is_shared(n)) {
|
||||
enode * r = n->get_root();
|
||||
if (!r->is_marked() && is_array_sort(r)) {
|
||||
TRACE("array_shared", tout << "new shared var: #" << r->get_expr_id() << "\n";);
|
||||
r->set_mark();
|
||||
to_unmark.push_back(r);
|
||||
theory_var r_th_var = r->get_var(get_id());
|
||||
SASSERT(r_th_var != null_theory_var);
|
||||
result.push_back(r_th_var);
|
||||
}
|
||||
}
|
||||
}
|
||||
unmark_enodes(to_unmark.size(), to_unmark.c_ptr());
|
||||
}
|
||||
#else
|
||||
|
||||
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()) {
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -536,7 +509,6 @@ namespace smt {
|
|||
TRACE("array", tout << "collecting shared vars...\n" << unsigned_vector(result.size(), (unsigned*)result.data()) << "\n";);
|
||||
unmark_enodes(to_unmark.size(), to_unmark.data());
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
\brief Create interface variables for shared array variables.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue