Skip to content

Commit d5a8668

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 81eb906 commit d5a8668

File tree

2 files changed

+30
-12
lines changed

2 files changed

+30
-12
lines changed

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

Lines changed: 14 additions & 10 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,19 +33,24 @@ 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
4448
run: |
45-
make -C unit test
46-
make -C jbmc/unit test
49+
make -C unit test IPASIR=$PWD/riss.git/riss
50+
make -C jbmc/unit test IPASIR=$PWD/riss.git/riss
4751
echo "Running expected failure tests"
48-
make TAGS="[!shouldfail]" -C unit test
49-
make TAGS="[!shouldfail]" -C jbmc/unit test
52+
make TAGS="[!shouldfail]" -C unit test IPASIR=$PWD/riss.git/riss
53+
make TAGS="[!shouldfail]" -C jbmc/unit test IPASIR=$PWD/riss.git/riss
5054
- name: Run regression tests
5155
run: |
5256
make -C regression test-parallel JOBS=2

src/solvers/sat/satcheck_ipasir.cpp

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,22 @@ void satcheck_ipasirt::lcnf(const bvt &bv)
9090
}
9191
ipasir_add(solver, 0); // terminate clause
9292

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

96110
clause_counter++;
97111
}

0 commit comments

Comments
 (0)