mirror of
https://github.com/Z3Prover/z3
synced 2025-10-05 15:33:59 +00:00
Merge branch 'master' of https://github.com/z3prover/z3
This commit is contained in:
commit
30b0d5ba13
95 changed files with 1836 additions and 446 deletions
|
@ -91,6 +91,31 @@ public:
|
|||
SASSERT(invariant());
|
||||
}
|
||||
|
||||
class iterator {
|
||||
scoped_vector const& m_vec;
|
||||
unsigned m_index;
|
||||
public:
|
||||
iterator(scoped_vector const& v, unsigned idx): m_vec(v), m_index(idx) {}
|
||||
|
||||
bool operator==(iterator const& other) const { return &other.m_vec == &m_vec && other.m_index == m_index; }
|
||||
bool operator!=(iterator const& other) const { return &other.m_vec != &m_vec || other.m_index != m_index; }
|
||||
T const& operator*() { return m_vec[m_index]; }
|
||||
|
||||
iterator & operator++() {
|
||||
++m_index;
|
||||
return *this;
|
||||
}
|
||||
|
||||
iterator operator++(int) {
|
||||
iterator r = *this;
|
||||
++m_index;
|
||||
return r;
|
||||
}
|
||||
};
|
||||
|
||||
iterator begin() { return iterator(*this, 0); }
|
||||
iterator end() { return iterator(*this, m_size); }
|
||||
|
||||
void push_back(T const& t) {
|
||||
set_index(m_size, m_elems.size());
|
||||
m_elems.push_back(t);
|
||||
|
|
|
@ -79,12 +79,7 @@ class total_order {
|
|||
}
|
||||
|
||||
cell * to_cell(T const & a) const {
|
||||
void * r;
|
||||
#ifdef Z3DEBUG
|
||||
bool ok =
|
||||
#endif
|
||||
m_map.find(a, r);
|
||||
SASSERT(ok);
|
||||
void * r = m_map.find(a);
|
||||
return reinterpret_cast<cell*>(r);
|
||||
}
|
||||
|
||||
|
|
|
@ -38,6 +38,11 @@ public:
|
|||
return v != 0;
|
||||
}
|
||||
}
|
||||
|
||||
T * find(unsigned k) const {
|
||||
SASSERT(k < m_map.size() && m_map[k] != 0);
|
||||
return m_map[k];
|
||||
}
|
||||
|
||||
void insert(unsigned k, T * v) {
|
||||
m_map.reserve(k+1);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue