3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-10-03 14:33:56 +00:00

replace restore_size_trail by more generic restore_vector

other updates:
- change signature of advance_qhead to simplify call sites
- have model reconstruction replay work on a tail of dependent_expr state, while adding formulas to the tail.
This commit is contained in:
Nikolaj Bjorner 2022-11-28 11:45:56 +07:00
parent 6454014119
commit 85f9c7eefa
25 changed files with 80 additions and 59 deletions

View file

@ -98,20 +98,21 @@ public:
}
};
template<typename T, bool CallDestructors=true>
class restore_size_trail : public trail {
vector<T, CallDestructors> & m_vector;
unsigned m_old_size;
template<typename V>
class restore_vector : public trail {
V& m_vector;
unsigned m_old_size;
public:
restore_size_trail(vector<T, CallDestructors> & v, unsigned sz):
restore_vector(V& v):
m_vector(v),
m_old_size(sz) {
}
restore_size_trail(vector<T, CallDestructors> & v):
m_old_size(v.size())
{}
restore_vector(V& v, unsigned sz):
m_vector(v),
m_old_size(v.size()) {
}
m_old_size(sz)
{}
void undo() override {
m_vector.shrink(m_old_size);
}