diff --git a/src/smt/smt_context.h b/src/smt/smt_context.h index 63df29d29..0e4cdde44 100644 --- a/src/smt/smt_context.h +++ b/src/smt/smt_context.h @@ -137,7 +137,7 @@ namespace smt { scoped_ptr m_fmls; svector m_lit_scores[2]; - vector m_recorded_cubes; + vector* m_recorded_cubes = nullptr; // ----------------------------------- diff --git a/src/smt/smt_internalizer.cpp b/src/smt/smt_internalizer.cpp index 45c174f65..e1eda24f9 100644 --- a/src/smt/smt_internalizer.cpp +++ b/src/smt/smt_internalizer.cpp @@ -967,6 +967,8 @@ namespace smt { // following the pattern of solver::persist_clause in src/sat/smt/user_solver.cpp void context::record_cube(unsigned num_lits, literal const *lits) { + if (!m_recorded_cubes) + return; expr_ref_vector cube(m); for (unsigned i = 0; i < num_lits; ++i) { literal lit = lits[i]; @@ -976,7 +978,7 @@ namespace smt { e = m.mk_not(e); // only negate positive literal cube.push_back(e); } - m_recorded_cubes.push_back(cube); + m_recorded_cubes->push_back(cube); } void context::add_scores(unsigned n, literal const *lits) { diff --git a/src/smt/smt_parallel.cpp b/src/smt/smt_parallel.cpp index c0c1f067f..faf45af79 100644 --- a/src/smt/smt_parallel.cpp +++ b/src/smt/smt_parallel.cpp @@ -67,6 +67,8 @@ namespace smt { lbool parallel::param_generator::run_prefix_step() { IF_VERBOSE(1, verbose_stream() << " Param generator running prefix step\n"); ctx->get_fparams().m_max_conflicts = m_max_prefix_conflicts; + m_recorded_cubes.reset(); + ctx->m_recorded_cubes = &m_recorded_cubes; lbool r = l_undef; try { r = ctx->check(); @@ -110,7 +112,7 @@ namespace smt { double score = 0.0; // replay the cube (negation of the clause) - for (expr_ref_vector const& cube : probe_ctx->m_recorded_cubes) { + for (expr_ref_vector const& cube : m_recorded_cubes) { lbool r = probe_ctx->check(cube.size(), cube.data()); unsigned conflicts = probe_ctx->m_stats.m_num_conflicts; unsigned decisions = probe_ctx->m_stats.m_num_decisions; diff --git a/src/smt/smt_parallel.h b/src/smt/smt_parallel.h index e0ecb874a..27111c0bd 100644 --- a/src/smt/smt_parallel.h +++ b/src/smt/smt_parallel.h @@ -128,6 +128,7 @@ namespace smt { unsigned m_max_prefix_conflicts = 1000; scoped_ptr m_prefix_solver; + vector m_recorded_cubes; params_ref m_p; param_values m_param_state;