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

add notes and additional functions to sls-seq

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2024-11-25 13:46:16 -08:00
parent aed3279d7d
commit b143a954c5
5 changed files with 125 additions and 27 deletions

View file

@ -76,6 +76,10 @@ namespace smt {
return ctx.get_num_bool_vars();
}
void theory_sls::init_search_eh() {
m_init_search = true;
}
void theory_sls::finalize() {
if (!m_smt_plugin)
return;
@ -84,11 +88,14 @@ namespace smt {
m_smt_plugin->finalize(m_model);
m_model = nullptr;
m_smt_plugin = nullptr;
m_init_search = false;
}
void theory_sls::propagate() {
if (!m_smt_plugin)
if (!m_init_search)
return;
if (!m_smt_plugin)
m_smt_plugin = alloc(sls::smt_plugin, * this);
if (!m_checking) {
expr_ref_vector fmls(m);
for (unsigned i = 0; i < ctx.get_num_asserted_formulas(); ++i)
@ -104,6 +111,7 @@ namespace smt {
m_smt_plugin->collect_statistics(m_st);
m_smt_plugin->finalize(m_model);
m_smt_plugin = nullptr;
m_init_search = false;
}
}
@ -183,8 +191,9 @@ namespace smt {
finalize();
smt_params p(ctx.get_fparams());
m_parallel_mode = p.m_sls_parallel;
m_smt_plugin = alloc(sls::smt_plugin, *this);
m_smt_plugin = nullptr;
m_checking = false;
m_init_search = false;
}
void theory_sls::collect_statistics(::statistics& st) const {
@ -216,6 +225,7 @@ namespace smt {
m_smt_plugin->collect_statistics(m_st);
m_smt_plugin->finalize(m_model);
m_smt_plugin = nullptr;
m_init_search = false;
}
}

View file

@ -72,6 +72,7 @@ namespace smt {
unsigned m_after_resolve_decide_count = 0;
unsigned m_resolve_count = 0;
unsigned m_resolve_gap = 0;
bool m_init_search = false;
::statistics m_st;
vector<sat::literal_vector> m_shared_clauses;
@ -125,6 +126,7 @@ namespace smt {
void inc_activity(sat::bool_var v, double inc) override;
bool parallel_mode() const override { return m_parallel_mode; }
bool get_smt_value(expr* v, expr_ref& value) override;
void init_search_eh() override;
};