Skip to content

Commit c2fd3cd

Browse files
committed
Make IPASIR configuration build after solver hardness changes
In diffblue#5480 the solver hardness interface was updated, but changes were only implemented in the Minisat2 interface. Update the IPASIR interface to match these changes. To avoid future regressions, make the check-macos-10_15-make-clang GitHub action use IPASIR with Riss as the back-end solver.
1 parent c8301fe commit c2fd3cd

File tree

2 files changed

+27
-7
lines changed

2 files changed

+27
-7
lines changed

.github/workflows/pull-request-checks.yaml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ jobs:
105105
with:
106106
submodules: recursive
107107
- name: Fetch dependencies
108-
run: brew install maven flex bison parallel ccache
108+
run: brew install maven flex bison parallel ccache cmake
109109
- name: Prepare ccache
110110
uses: actions/cache@v2
111111
with:
@@ -122,11 +122,16 @@ jobs:
122122
run: ccache -z --max-size=500M
123123
- name: Build using Make
124124
run: |
125-
make -C src minisat2-download
126-
make -C src -j2 CXX="ccache clang++"
127-
make -C jbmc/src -j2 CXX="ccache clang++"
128-
make -C unit "CXX=ccache clang++"
129-
make -C jbmc/unit "CXX=ccache clang++"
125+
git clone https://github.com/conp-solutions/riss riss.git
126+
cmake -Hriss.git -Briss.git/release -DCMAKE_BUILD_TYPE=Release
127+
make -C riss.git/release riss-coprocessor-lib-static -j2
128+
make -C src -j2 CXX="ccache clang++" LIBS="$PWD/riss.git/release/lib/libriss-coprocessor.a -lpthread" IPASIR=$PWD/riss.git/riss
129+
make -C jbmc/src -j2 CXX="ccache clang++" LIBS="$PWD/riss.git/release/lib/libriss-coprocessor.a -lpthread" IPASIR=$PWD/riss.git/riss
130+
131+
make -C unit "CXX=ccache clang++" LIBS="$PWD/riss.git/release/lib/libriss-coprocessor.a -lpthread" IPASIR=$PWD/riss.git/riss
132+
133+
make -C jbmc/unit "CXX=ccache clang++" LIBS="$PWD/riss.git/release/lib/libriss-coprocessor.a -lpthread" IPASIR=$PWD/riss.git/riss
134+
130135
- name: Print ccache stats
131136
run: ccache -s
132137
- name: Run unit tests

src/solvers/sat/satcheck_ipasir.cpp

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,22 @@ void satcheck_ipasirt::lcnf(const bvt &bv)
9191
ipasir_add(solver, 0); // terminate clause
9292

9393
with_solver_hardness(
94-
[&bv](solver_hardnesst &hardness) { hardness.register_clause(bv); });
94+
[&bv, &cnf, &clause_removed](solver_hardnesst &hardness) {
95+
// To map clauses to lines of program code, track clause indices in the
96+
// dimacs cnf output. Dimacs output is generated after processing
97+
// clauses to remove duplicates and clauses that are trivially true.
98+
// Here, a clause is checked to see if it can be thus eliminated. If
99+
// not, add the clause index to list of clauses in
100+
// solver_hardnesst::register_clause().
101+
static size_t cnf_clause_index = 0;
102+
bvt cnf;
103+
bool clause_removed = process_clause(bv, cnf);
104+
105+
if(!clause_removed)
106+
cnf_clause_index++;
107+
108+
hardness.register_clause(bv, cnf, cnf_clause_index, !clause_removed);
109+
});
95110

96111
clause_counter++;
97112
}

0 commit comments

Comments
 (0)