Skip to content

Commit 2ebe248

Browse files
committed
Fixing printing
1 parent f88c837 commit 2ebe248

File tree

2 files changed

+15
-16
lines changed

2 files changed

+15
-16
lines changed

src/counter.cpp

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1829,7 +1829,8 @@ void Counter::print_trail(bool check_entail, bool check_anything) const {
18291829
void Counter::go_back_to(int32_t backj) {
18301830
debug_print("going back to lev: " << backj << " dec level now: " << dec_level());
18311831
while(dec_level() > backj) {
1832-
debug_print("at dec lit: " << top_dec_lit() << " lev: " << dec_level() << " cnt:" << decisions.top().total_model_count());
1832+
debug_print("at dec lit: " << top_dec_lit() << " lev: " << dec_level()
1833+
<< " cnt:" << decisions.top().total_model_count());
18331834
VERBOSE_DEBUG_DO(print_comp_stack_info());
18341835
decisions.top().mark_branch_unsat();
18351836
decisions.top().zero_out_all_sol(); //not sure it's needed
@@ -1843,7 +1844,8 @@ void Counter::go_back_to(int32_t backj) {
18431844
comp_manager->remove_cache_pollutions_of(decisions.top());
18441845
comp_manager->clean_remain_comps_of(decisions.top());
18451846
}
1846-
VERBOSE_DEBUG_DO(cout << "now at dec lit: " << top_dec_lit() << " lev: " << dec_level() << " cnt:" << decisions.top().total_model_count() << endl);
1847+
VERBOSE_DEBUG_DO(cout << "now at dec lit: " << top_dec_lit() << " lev: " << dec_level()
1848+
<< " cnt:" << *decisions.top().total_model_count() << endl);
18471849
}
18481850
VERBOSE_DEBUG_DO(print_comp_stack_info());
18491851
VERBOSE_DEBUG_DO(cout << "DONE backw cleaning" << endl);
@@ -3375,12 +3377,12 @@ bool Counter::run_sat_solver(RetState& state) {
33753377
uint32_t v = *it;
33763378
if (v >= opt_indep_support_end) continue;
33773379
debug_print(COLYEL "SAT solver -- mult var: " << setw(4) << v << " val: " << setw(3) << sat_solution[v]
3378-
<< " weight: " << setw(9) << get_weight(Lit(v, sat_solution[v] == T_TRI)) << COLDEF
3380+
<< " weight: " << setw(9) << *get_weight(Lit(v, sat_solution[v] == T_TRI)) << COLDEF
33793381
<< " dec_lev: " << setw(5) << var(v).decision_level << " sat_start_dec_level: " << sat_start_dec_level);
33803382
if (var(v).decision_level != INVALID_DL && var(v).decision_level <= sat_start_dec_level) continue;
33813383
*cnt *= *get_weight(Lit(v, sat_solution[v] == T_TRI));
33823384
}
3383-
debug_print(COLYEL "SAT cnt will be: " << cnt);
3385+
debug_print(COLYEL "SAT cnt will be: " << *cnt);
33843386
}
33853387
decisions.top().var = 0;
33863388
var(0).sublevel = old_sublev; // hack not to re-propagate everything.
@@ -3402,11 +3404,11 @@ bool Counter::run_sat_solver(RetState& state) {
34023404
else stats.sat_found_unsat++;
34033405
stats.sat_conflicts += stats.conflicts-conflicts_before;
34043406

3405-
debug_print("after SAT mode. cnt dec: " << decisions.top().total_model_count()
3406-
<< " left: " << decisions.top().left_model_count()
3407-
<< " right: " << decisions.top().right_model_count());
3407+
debug_print("after SAT mode. cnt dec: " << *decisions.top().total_model_count()
3408+
<< " left: " << *decisions.top().left_model_count()
3409+
<< " right: " << *decisions.top().right_model_count());
34083410
if (sat) {
3409-
debug_print("after SAT mode. cnt of this comp: " << decisions.top().total_model_count()
3411+
debug_print("after SAT mode. cnt of this comp: " << *decisions.top().total_model_count()
34103412
<< " unproc comps end: " << decisions.top().get_unproc_comps_end()
34113413
<< " remaining comps: " << decisions.top().remaining_comps_ofs()
34123414
<< " has unproc: " << decisions.top().has_unproc_comps());

src/stack.hpp

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,7 @@ class StackLevel {
153153
void include_one_sol() {
154154
VERBOSE_DEBUG_DO(cout << COLRED << "incl sol: ONE" << COLDEF << " ");
155155
#ifdef VERBOSE_DEBUG
156-
auto before = fg->zero();
157-
if (branch_mc[act_branch]) before = branch_mc[act_branch]->dup();
156+
auto before = val_or_zero(act_branch);
158157
#endif
159158
if (branch_unsat[act_branch]) {
160159
VERBOSE_DEBUG_DO(cout << "-> incl sol unsat branch, doing nothing." << endl);
@@ -169,8 +168,7 @@ class StackLevel {
169168
void include_solution(const FF& solutions) {
170169
VERBOSE_DEBUG_DO(cout << COLRED << "incl sol: " << *solutions << COLDEF << " ");
171170
#ifdef VERBOSE_DEBUG
172-
auto before = fg->zero();
173-
if (branch_mc[act_branch]) before = branch_mc[act_branch]->dup();
171+
auto before = val_or_zero(act_branch);
174172
#endif
175173
if (branch_unsat[act_branch]) {
176174
VERBOSE_DEBUG_DO(cout << "-> incl sol unsat branch, doing nothing." << endl);
@@ -195,8 +193,7 @@ class StackLevel {
195193
VERBOSE_DEBUG_DO(cout << COLRED << "left side div sol: " << *div_by << COLDEF << " " << endl;);
196194
if (act_branch == 0) return;
197195
#ifdef VERBOSE_DEBUG
198-
auto before = fg->zero();
199-
if (branch_mc[0]) before = branch_mc[0]->dup();
196+
auto before = val_or_zero(0);
200197
#endif
201198
if (branch_unsat[0]) {
202199
VERBOSE_DEBUG_DO(cout << "-> left side incl sol unsat branch, doing nothing." << endl);
@@ -210,8 +207,8 @@ class StackLevel {
210207
}
211208
VERBOSE_DEBUG_DO(cout << "now "
212209
<< ((0) ? "right" : "left")
213-
<< " count is: " << branch_mc[0]
214-
<< " before it was: " << before
210+
<< " count is: " << *val_or_zero(0)
211+
<< " before it was: " << *before
215212
<< " var: " << var
216213
<< endl);
217214
}

0 commit comments

Comments
 (0)