3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-07-04 22:36:10 +00:00
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2025-09-11 10:19:16 -07:00
parent 7566cc744d
commit 9196a3c369
2 changed files with 45 additions and 0 deletions

View file

@ -63,6 +63,30 @@ public:
bool eq_args(ast_manager & m, unsigned arity, expr * const * args) const;
};
struct func_entry_eq {
unsigned m_arity;
func_entry_eq(unsigned arity) : m_arity(arity) {}
bool operator()(func_entry* a, func_entry* b) const {
for (unsigned i = 0; i < m_arity; ++i)
if (a->get_arg(i) != b->get_arg(i))
return false;
return true;
}
};
struct func_entry_hash {
unsigned m_arity;
struct chasher {
unsigned operator()(func_entry* e, unsigned idx) const {
return e->get_arg(idx)->get_id();
}
};
func_entry_hash(unsigned arity) : m_arity(arity) {}
unsigned operator()(func_entry* e) const {
return get_composite_hash(e, m_arity, default_kind_hash_proc<func_entry*>(), chasher());
}
};
class func_interp {
ast_manager & m_manager;
unsigned m_arity;
@ -74,6 +98,9 @@ class func_interp {
expr * m_array_interp; // <! interp with lambda abstraction
using entry_table = ptr_hashtable<func_entry, func_entry_hash, func_entry_eq>;
entry_table* m_entry_table = nullptr;
void reset_interp_cache();
expr * get_interp_core() const;