Skip to content

Commit 677fe42

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-ubuntu-20_04-make-gcc GitHub action use IPASIR with Riss as the back-end solver.
1 parent a0dbf74 commit 677fe42

File tree

2 files changed

+26
-7
lines changed

2 files changed

+26
-7
lines changed

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

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ jobs:
1616
# user input
1717
DEBIAN_FRONTEND: noninteractive
1818
run: |
19-
sudo apt-get install --no-install-recommends -yq gcc gdb g++ maven jq flex bison libxml2-utils ccache
20-
make -C src minisat2-download
19+
sudo apt-get install --no-install-recommends -yq gcc gdb g++ maven jq flex bison libxml2-utils ccache cmake
2120
- name: Prepare ccache
2221
uses: actions/cache@v2
2322
with:
@@ -34,10 +33,15 @@ jobs:
3433
run: ccache -z --max-size=500M
3534
- name: Build with make
3635
run: |
37-
make -C src CXX='ccache /usr/bin/g++' -j2
38-
make -C unit CXX='ccache /usr/bin/g++' -j2
39-
make -C jbmc/src CXX='ccache /usr/bin/g++' -j2
40-
make -C jbmc/unit CXX='ccache /usr/bin/g++' -j2
36+
git clone https://github.com/conp-solutions/riss riss.git
37+
cmake -Hriss.git -Briss.git/release -DCMAKE_BUILD_TYPE=Release
38+
make -C riss.git/release riss-coprocessor-lib-static -j2
39+
make -C src -j2 CXX="ccache g++" LIBS="$PWD/riss.git/release/lib/libriss-coprocessor.a -lpthread" IPASIR=$PWD/riss.git/riss
40+
make -C jbmc/src -j2 CXX="ccache g++" LIBS="$PWD/riss.git/release/lib/libriss-coprocessor.a -lpthread" IPASIR=$PWD/riss.git/riss
41+
42+
make -C unit -j2 CXX="ccache g++" LIBS="$PWD/riss.git/release/lib/libriss-coprocessor.a -lpthread" IPASIR=$PWD/riss.git/riss
43+
44+
make -C jbmc/unit -j2 CXX="ccache g++" LIBS="$PWD/riss.git/release/lib/libriss-coprocessor.a -lpthread" IPASIR=$PWD/riss.git/riss
4145
- name: Print ccache stats
4246
run: ccache -s
4347
- 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+
[this, &bv](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)