3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-23 17:15:31 +00:00

updated notes, fixes to dual solver

This commit is contained in:
Nikolaj Bjorner 2020-09-29 03:29:33 -07:00
parent ef6542823b
commit a216bee647
5 changed files with 142 additions and 54 deletions

42
src/util/lim_vector.h Normal file
View file

@ -0,0 +1,42 @@
/*++
Copyright (c) 2020 Microsoft Corporation
Module Name:
lim_vector.h
Abstract:
Vector that restores during backtracking.
Author:
Nikolaj Bjorner (nbjorner) 2020-29-09
--*/
#pragma once
#include "util/vector.h"
template<typename T>
class lim_svector : public svector<T> {
unsigned_vector m_lim;
public:
lim_svector() {}
void push_scope() {
m_lim.push_back(size());
}
void pop_scope(unsigned num_scopes) {
SASSERT(num_scopes > 0);
unsigned old_sz = m_lim.size() - num_scopes;
shrink(m_lim[old_sz]);
m_lim.shrink(old_sz);
}
unsigned num_scopes() const { return m_lim.size(); }
unsigned old_size(unsigned n) const { return m_lim[m_lim.size() - n]; }
};