mirror of
https://github.com/Z3Prover/z3
synced 2025-08-10 21:20:52 +00:00
add array-ext to externally exposed functions to enable interpolants with arrays to be usable in feedback loops with Z3. Addresses one issue raised in #292
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
8d1fa3ae50
commit
4685a5f8ba
12 changed files with 71 additions and 16 deletions
|
@ -220,7 +220,7 @@ namespace smt {
|
|||
for (unsigned i = 0; i < dimension; ++i) {
|
||||
sort * ext_sk_domain[2] = { s_array, s_array };
|
||||
parameter p(i);
|
||||
func_decl * ext_sk_decl = m.mk_func_decl(get_id(), OP_ARRAY_EXT_SKOLEM, 1, &p, 2, ext_sk_domain);
|
||||
func_decl * ext_sk_decl = m.mk_func_decl(get_id(), OP_ARRAY_EXT, 1, &p, 2, ext_sk_domain);
|
||||
ext_skolems->push_back(ext_sk_decl);
|
||||
}
|
||||
m_sort2skolem.insert(s_array, ext_skolems);
|
||||
|
@ -310,10 +310,7 @@ namespace smt {
|
|||
func_decl_ref_vector * funcs = 0;
|
||||
sort * s = m.get_sort(e1);
|
||||
|
||||
if (!m_sort2skolem.find(s, funcs)) {
|
||||
UNREACHABLE();
|
||||
return;
|
||||
}
|
||||
VERIFY(m_sort2skolem.find(s, funcs));
|
||||
|
||||
unsigned dimension = funcs->size();
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ namespace smt {
|
|||
bool is_select(app const* n) const { return n->is_app_of(get_id(), OP_SELECT); }
|
||||
bool is_default(app const* n) const { return n->is_app_of(get_id(), OP_ARRAY_DEFAULT); }
|
||||
bool is_const(app const* n) const { return n->is_app_of(get_id(), OP_CONST_ARRAY); }
|
||||
bool is_array_ext(app const * n) const { return n->is_app_of(get_id(), OP_ARRAY_EXT_SKOLEM); }
|
||||
bool is_array_ext(app const * n) const { return n->is_app_of(get_id(), OP_ARRAY_EXT); }
|
||||
bool is_as_array(app const * n) const { return n->is_app_of(get_id(), OP_AS_ARRAY); }
|
||||
bool is_array_sort(sort const* s) const { return s->is_sort_of(get_id(), ARRAY_SORT); }
|
||||
bool is_array_sort(app const* n) const { return is_array_sort(get_manager().get_sort(n)); }
|
||||
|
|
|
@ -273,7 +273,7 @@ namespace smt {
|
|||
}
|
||||
context & ctx = get_context();
|
||||
|
||||
if (is_map(n)) {
|
||||
if (is_map(n) || is_array_ext(n)) {
|
||||
for (unsigned i = 0; i < n->get_num_args(); ++i) {
|
||||
enode* arg = ctx.get_enode(n->get_arg(i));
|
||||
if (!is_attached_to_var(arg)) {
|
||||
|
@ -320,6 +320,10 @@ namespace smt {
|
|||
found_unsupported_op(n);
|
||||
instantiate_default_as_array_axiom(node);
|
||||
}
|
||||
else if (is_array_ext(n)) {
|
||||
SASSERT(n->get_num_args() == 2);
|
||||
instantiate_extensionality(ctx.get_enode(n->get_arg(0)), ctx.get_enode(n->get_arg(1)));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue