mirror of
https://github.com/Z3Prover/z3
synced 2025-04-29 11:55:51 +00:00
add c-cube's recursive function theory
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
commit
c7d0d4e191
23 changed files with 1590 additions and 21 deletions
|
@ -31,6 +31,7 @@ public:
|
|||
void reset() { std::for_each(m_vector.begin(), m_vector.end(), delete_proc<T>()); m_vector.reset(); }
|
||||
void push_back(T * ptr) { m_vector.push_back(ptr); }
|
||||
void pop_back() { SASSERT(!empty()); set(size()-1, nullptr); m_vector.pop_back(); }
|
||||
T * back() const { return m_vector.back(); }
|
||||
T * operator[](unsigned idx) const { return m_vector[idx]; }
|
||||
void set(unsigned idx, T * ptr) {
|
||||
if (m_vector[idx] == ptr)
|
||||
|
@ -51,6 +52,13 @@ public:
|
|||
push_back(nullptr);
|
||||
}
|
||||
}
|
||||
//!< swap last element with given pointer
|
||||
void swap_back(scoped_ptr<T> & ptr) {
|
||||
SASSERT(!empty());
|
||||
T * tmp = ptr.detach();
|
||||
ptr = m_vector.back();
|
||||
m_vector[m_vector.size()-1] = tmp;
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue