Skip to content

Commit

Permalink
Fixing bug
Browse files Browse the repository at this point in the history
  • Loading branch information
msoos committed Jul 13, 2024
1 parent 4e1fc00 commit 5f27b32
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 25 deletions.
2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1242,9 +1242,9 @@ int Main::solve()
if (program.is_used("maxtime")) solver->set_max_time(program.get<double>("maxtime"));
if (program.is_used("maxconfl")) solver->set_max_confl(program.get<uint64_t>("maxconfl"));

parse_sampling_vars();
check_num_threads_sanity(num_threads);
solver->set_num_threads(num_threads);
parse_sampling_vars();
if (sql != 0) solver->set_sqlite(sqlite_filename);

//Print command line used to execute the solver: for options and inputs
Expand Down
36 changes: 12 additions & 24 deletions src/solver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3661,28 +3661,17 @@ void Solver::detach_clauses_in_xors() {
// Go through watchlist
uint32_t deleted = 0;
vector<ClOffset> delayed_clause_free;
for(uint32_t x = 0; x < nVars()*2; x++) {
Lit l = Lit::toLit(x);
for(const auto& w : watches[l]) {
if (w.isBin() || w.isBNN() || w.isIdx()) continue;
assert(w.isClause());
ClOffset offs = w.get_offset();
Clause* cl = cl_alloc.ptr(offs);
assert(!cl->freed());

//We have already went through this clause, and set it to be removed/detached
if (cl->red()) goto next;
if (cl->get_removed()) continue;
if (cl->size() <= maxsize_xor &&
xor_hashes.count(hash_xcl(*cl)) &&
check_clause_represented_by_xor(*cl)) {
cl->set_removed();
delayed_clause_free.push_back(offs);
deleted++;
continue;
}
next:
;
for(auto offs: longIrredCls) {
Clause* cl = cl_alloc.ptr(offs);
cl->stats.marked_clause = false;
assert(!cl->freed());
assert(!cl->get_removed());
if (cl->size() <= maxsize_xor &&
xor_hashes.count(hash_xcl(*cl)) &&
check_clause_represented_by_xor(*cl)) {
detachClause(*cl);
cl->stats.marked_clause = true;
deleted++;
}
}

Expand All @@ -3691,8 +3680,7 @@ void Solver::detach_clauses_in_xors() {
for(uint32_t i = 0; i < longIrredCls.size(); i++) {
ClOffset offs = longIrredCls[i];
Clause* cl = cl_alloc.ptr(offs);
if (cl->get_removed()) detachClause(*cl);
else longIrredCls[j++] = offs;
if (!cl->stats.marked_clause) longIrredCls[j++] = offs;
}
longIrredCls.resize(j);

Expand Down

0 comments on commit 5f27b32

Please sign in to comment.