Skip to content

Make Glucose configuration build after solver hardness changes #5709

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/pull-request-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ jobs:
run: |
mkdir build
cd build
cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++
cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++ -Dsat_impl=glucose
- name: Build with Ninja
run: cd build; ninja -j2
- name: Print ccache stats
Expand Down
18 changes: 16 additions & 2 deletions src/solvers/sat/satcheck_glucose.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,22 @@ void satcheck_glucose_baset<T>::lcnf(const bvt &bv)

solver->addClause_(c);

with_solver_hardness(
[&bv](solver_hardnesst &hardness) { hardness.register_clause(bv); });
with_solver_hardness([this, &bv](solver_hardnesst &hardness) {
// To map clauses to lines of program code, track clause indices in the
// dimacs cnf output. Dimacs output is generated after processing
// clauses to remove duplicates and clauses that are trivially true.
// Here, a clause is checked to see if it can be thus eliminated. If
// not, add the clause index to list of clauses in
// solver_hardnesst::register_clause().
static size_t cnf_clause_index = 0;
bvt cnf;
bool clause_removed = process_clause(bv, cnf);

if(!clause_removed)
cnf_clause_index++;

hardness.register_clause(bv, cnf, cnf_clause_index, !clause_removed);
});

clause_counter++;
}
Expand Down