Skip to content

Commit 1bfa39c

Browse files
committed
simplify appmc7 search loop
1 parent 1885b1a commit 1bfa39c

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/counter.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,6 @@ void Counter::appmc7_one_measurement_count(
703703
//threshold_sols[hash_num]==0 tells that no solution was found.
704704
map<uint64_t,bool> threshold_sols;
705705
int64_t total_max_xors = conf.sampl_vars.size();
706-
int64_t num_explored = 0;
707706
int64_t lower_fib = 0;
708707
int64_t upper_fib = total_max_xors+1;
709708
threshold_sols[lower_fib] = 1;
@@ -720,7 +719,7 @@ void Counter::appmc7_one_measurement_count(
720719
//This is implemented by using two sentinels: lower_fib and upper_fib. The correct answer
721720
// is always between lower_fib and upper_fib. We do exponential search until upper_fib < lower_fib*2
722721
// Once upper_fib < lower_fib*2; we do a binary search.
723-
while (num_explored < total_max_xors) {
722+
while (true) {
724723
uint64_t cur_hash_cnt = hash_cnt;
725724
const vector<Lit> assumps = set_num_hashes(hash_cnt, hm->hashes, sparse_data);
726725

@@ -738,8 +737,6 @@ void Counter::appmc7_one_measurement_count(
738737
const uint64_t num_sols = std::min<uint64_t>(sols.solutions, 1);
739738
assert(num_sols <= 1);
740739
if (num_sols < 1) {
741-
num_explored = lower_fib + total_max_xors - hash_cnt;
742-
743740
//one less hash count had threshold solutions
744741
//this one has less than threshold
745742
//so this is the real deal!
@@ -775,7 +772,6 @@ void Counter::appmc7_one_measurement_count(
775772
}
776773
} else {
777774
assert(num_sols == 1);
778-
num_explored = hash_cnt + total_max_xors - upper_fib;
779775

780776
//success record for +1 hashcount exists and is 0
781777
//so one-above hashcount was below threshold, this is above
@@ -812,7 +808,6 @@ void Counter::appmc7_one_measurement_count(
812808
}
813809
hash_prev = cur_hash_cnt;
814810
}
815-
assert(false and "This code should never be reached");
816811
}
817812

818813
bool Counter::gen_rhs()

0 commit comments

Comments
 (0)