Skip to content

Commit 3ae6853

Browse files
set recorded cubes outside and remember to reset
Signed-off-by: Nikolaj Bjorner <[email protected]>
1 parent f0d03e9 commit 3ae6853

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

src/smt/smt_context.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ namespace smt {
137137
scoped_ptr<base_dependent_expr_state> m_fmls;
138138

139139
svector<double> m_lit_scores[2];
140-
vector<expr_ref_vector> m_recorded_cubes;
140+
vector<expr_ref_vector>* m_recorded_cubes = nullptr;
141141

142142

143143
// -----------------------------------

src/smt/smt_internalizer.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -967,6 +967,8 @@ namespace smt {
967967

968968
// following the pattern of solver::persist_clause in src/sat/smt/user_solver.cpp
969969
void context::record_cube(unsigned num_lits, literal const *lits) {
970+
if (!m_recorded_cubes)
971+
return;
970972
expr_ref_vector cube(m);
971973
for (unsigned i = 0; i < num_lits; ++i) {
972974
literal lit = lits[i];
@@ -976,7 +978,7 @@ namespace smt {
976978
e = m.mk_not(e); // only negate positive literal
977979
cube.push_back(e);
978980
}
979-
m_recorded_cubes.push_back(cube);
981+
m_recorded_cubes->push_back(cube);
980982
}
981983

982984
void context::add_scores(unsigned n, literal const *lits) {

src/smt/smt_parallel.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ namespace smt {
6767
lbool parallel::param_generator::run_prefix_step() {
6868
IF_VERBOSE(1, verbose_stream() << " Param generator running prefix step\n");
6969
ctx->get_fparams().m_max_conflicts = m_max_prefix_conflicts;
70+
m_recorded_cubes.reset();
71+
ctx->m_recorded_cubes = &m_recorded_cubes;
7072
lbool r = l_undef;
7173
try {
7274
r = ctx->check();
@@ -110,7 +112,7 @@ namespace smt {
110112
double score = 0.0;
111113

112114
// replay the cube (negation of the clause)
113-
for (expr_ref_vector const& cube : probe_ctx->m_recorded_cubes) {
115+
for (expr_ref_vector const& cube : m_recorded_cubes) {
114116
lbool r = probe_ctx->check(cube.size(), cube.data());
115117
unsigned conflicts = probe_ctx->m_stats.m_num_conflicts;
116118
unsigned decisions = probe_ctx->m_stats.m_num_decisions;

src/smt/smt_parallel.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ namespace smt {
128128
unsigned m_max_prefix_conflicts = 1000;
129129

130130
scoped_ptr<context> m_prefix_solver;
131+
vector<expr_ref_vector> m_recorded_cubes;
131132
params_ref m_p;
132133
param_values m_param_state;
133134

0 commit comments

Comments
 (0)