mirror of
https://github.com/Z3Prover/z3
synced 2025-04-23 17:15:31 +00:00
seq
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
99da56a786
commit
284fcc2c04
8 changed files with 334 additions and 49 deletions
|
@ -46,7 +46,7 @@ public:
|
|||
m_elems_lim.push_back(m_elems_start);
|
||||
}
|
||||
|
||||
void pop_scopes(unsigned num_scopes) {
|
||||
void pop_scope(unsigned num_scopes) {
|
||||
if (num_scopes == 0) return;
|
||||
unsigned new_size = m_sizes.size() - num_scopes;
|
||||
unsigned src_lim = m_src_lim[new_size];
|
||||
|
@ -72,6 +72,12 @@ public:
|
|||
return m_elems[m_index[idx]];
|
||||
}
|
||||
|
||||
// breaks abstraction, caller must ensure backtracking.
|
||||
T& ref(unsigned idx) {
|
||||
SASSERT(idx < m_size);
|
||||
return m_elems[m_index[idx]];
|
||||
}
|
||||
|
||||
void set(unsigned idx, T const& t) {
|
||||
SASSERT(idx < m_size);
|
||||
unsigned n = m_index[idx];
|
||||
|
@ -102,6 +108,13 @@ public:
|
|||
SASSERT(invariant());
|
||||
}
|
||||
|
||||
void erase_and_swap(unsigned i) {
|
||||
if (i + 1 < size()) {
|
||||
set(i, m_elems[m_index[i]]);
|
||||
}
|
||||
pop_back();
|
||||
}
|
||||
|
||||
unsigned size() const { return m_size; }
|
||||
|
||||
bool empty() const { return m_size == 0; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue