3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-28 19:35:50 +00:00

memory throttling (#108)

* fixes to use list bookkeeping

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* fix reset logic

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* fix non-termination bug in simplifier

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* missing reset of values

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* add configuration to throttle memory usage

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2019-12-30 14:13:41 -08:00 committed by Lev Nachmanson
parent 361964f173
commit a9a602c1aa
4 changed files with 49 additions and 11 deletions

View file

@ -133,10 +133,12 @@ namespace dd {
while (!done() && step()) {
TRACE("grobner", display(tout););
DEBUG_CODE(invariant(););
IF_VERBOSE(3, display_statistics(verbose_stream()));
}
DEBUG_CODE(invariant(););
}
catch (pdd_manager::mem_out) {
IF_VERBOSE(1, verbose_stream() << "mem-out\n");
// don't reduce further
}
}
@ -752,6 +754,7 @@ namespace dd {
return
m_to_simplify.size() + m_processed.size() >= m_config.m_eqs_threshold ||
canceled() ||
m_stats.m_compute_steps > m_config.m_max_steps ||
m_conflict != nullptr;
}
@ -794,11 +797,14 @@ namespace dd {
}
void grobner::collect_statistics(statistics& st) const {
st.update("steps", m_stats.m_compute_steps);
st.update("simplified", m_stats.m_simplified);
st.update("superposed", m_stats.m_superposed);
st.update("degree", m_stats.m_max_expr_degree);
st.update("size", m_stats.m_max_expr_size);
st.update("dd.solver.steps", m_stats.m_compute_steps);
st.update("dd.solver.simplified", m_stats.m_simplified);
st.update("dd.solver.superposed", m_stats.m_superposed);
st.update("dd.solver.processed", m_processed.size());
st.update("dd.solver.solved", m_solved.size());
st.update("dd.solver.to_simplify", m_to_simplify.size());
st.update("dd.solver.degree", m_stats.m_max_expr_degree);
st.update("dd.solver.size", m_stats.m_max_expr_size);
}
std::ostream& grobner::display(std::ostream & out, const equation & eq) const {
@ -811,6 +817,10 @@ namespace dd {
out << "solved\n"; for (auto e : m_solved) display(out, *e);
out << "processed\n"; for (auto e : m_processed) display(out, *e);
out << "to_simplify\n"; for (auto e : m_to_simplify) display(out, *e);
return display_statistics(out);
}
std::ostream& grobner::display_statistics(std::ostream& out) const {
statistics st;
collect_statistics(st);
st.display(out);