3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-09-30 21:19:29 +00:00

taking a look at mbp_qel for arrays

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2025-02-18 16:28:49 -08:00
parent dda60737dc
commit a143ed3bff
4 changed files with 53 additions and 27 deletions

View file

@ -33,6 +33,18 @@ inline sort* get_array_domain(sort const * s, unsigned idx) {
return to_sort(s->get_parameter(idx).get_ast());
}
inline expr_container array_select_indices(app* e) {
return expr_container(e->get_args() + 1, e->get_args() + e->get_num_args());
}
inline expr_container array_store_indices(app* e) {
return expr_container(e->get_args() + 1, e->get_args() + e->get_num_args() - 1);
}
inline expr* array_store_elem(app* e) {
return e->get_arg(e->get_num_args() - 1);
}
enum array_sort_kind {
ARRAY_SORT,
_SET_SORT

View file

@ -690,8 +690,21 @@ public:
sort* get_sort() const;
unsigned get_small_id() const { return get_id(); }
unsigned get_small_id() const { return get_id(); }
};
class expr_container {
expr* const* m_pos;
expr* const* m_end;
public:
expr_container(expr* const* pos, expr* const* end) :m_pos(pos), m_end(end) {}
expr_container& operator++() { ++m_pos; return *this; }
expr_container operator++(int) { expr_container tmp = *this; ++(*this); return tmp; }
bool operator==(expr_container const& it) const { return m_pos == it.m_pos; }
bool operator!=(expr_container const& it) const { return m_pos != it.m_pos; }
expr* operator*() const { return *m_pos; }
expr* const* begin() const { return m_pos; }
expr* const* end() const { return m_end; }
};
// -----------------------------------