-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from sbeyer/update-to-2024
Update to 2024
- Loading branch information
Showing
19 changed files
with
160 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
name: Compilation and Tests | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
linux-build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Clone and checkout commit | ||
uses: actions/checkout@v4 | ||
- name: Quickstart | ||
run: util/quickstart.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,3 @@ | ||
/Makefile | ||
/CMakeCache.txt | ||
/CMakeDoxyfile.in | ||
/CMakeDoxygenDefaults.cmake | ||
CMakeFiles | ||
cmake_install.cmake | ||
CTestTestfile.cmake | ||
/Testing | ||
/build | ||
/compile_commands.json | ||
/doc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
[submodule "test/bandit"] | ||
path = test/bandit | ||
url = https://github.com/joakimkarlsson/bandit.git | ||
url = https://github.com/banditcpp/bandit.git |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,63 @@ | ||
all: compile_all | ||
|
||
LINGELING_VERSION=bal-2293bef-151109 | ||
PICOSAT_VERSION=965 | ||
|
||
minisat: | ||
git clone https://github.com/niklasso/minisat | ||
# https://github.com/niklasso/minisat is unmaintained and does not compile, hence we use a fork | ||
git clone -b fix-c++ https://github.com/spakin/minisat | ||
|
||
cryptominisat: | ||
git clone https://github.com/msoos/cryptominisat.git | ||
|
||
lingeling: | ||
curl -o ll.tar.gz http://fmv.jku.at/lingeling/lingeling-$(LINGELING_VERSION).tar.gz | ||
tar xf ll.tar.gz | ||
mv lingeling-$(LINGELING_VERSION) lingeling | ||
$(RM) ll.tar.gz | ||
git clone https://github.com/arminbiere/lingeling | ||
|
||
picosat: | ||
curl -o ps.tar.gz http://fmv.jku.at/picosat/picosat-$(PICOSAT_VERSION).tar.gz | ||
curl -o ps.tar.gz https://fmv.jku.at/picosat/picosat-$(PICOSAT_VERSION).tar.gz | ||
tar xf ps.tar.gz | ||
mv picosat-$(PICOSAT_VERSION) picosat | ||
$(RM) ps.tar.gz | ||
|
||
.PHONY: compile_all | ||
.PHONY: compile_all clean | ||
|
||
compile_minisat: minisat | ||
cd minisat && mkdir -p build && cd build && cmake .. | ||
$(MAKE) -C minisat/build | ||
echo "Removing this file will make Make compile Minisat again." > "$@" | ||
echo "Removing this file will make Make compile Minisat again." >"$@" | ||
|
||
compile_cryptominisat: cryptominisat | ||
cd cryptominisat && mkdir -p build && cd build && cmake -DENABLE_PYTHON_INTERFACE=OFF .. | ||
cadical: | ||
git clone -b mate-only-libraries-1.8.0 https://github.com/meelgroup/cadical | ||
|
||
compile_cadical: cadical | ||
cd cadical && ./configure && make | ||
echo "Removing this file will make Make compile cadical again." >"$@" | ||
|
||
cadiback: | ||
git clone -b mate https://github.com/meelgroup/cadiback | ||
|
||
compile_cadiback: cadiback | ||
cd cadiback && ./configure && make | ||
echo "Removing this file will make Make compile cadiback again." >"$@" | ||
|
||
compile_cryptominisat: cryptominisat compile_cadical compile_cadiback | ||
cd cryptominisat && mkdir -p build && cd build && cmake .. | ||
$(MAKE) -C cryptominisat/build | ||
echo "Removing this file will make Make compile CryptoMiniSat again." > "$@" | ||
echo "Removing this file will make Make compile CryptoMiniSat again." >"$@" | ||
|
||
compile_lingeling: lingeling | ||
cd lingeling && ./configure.sh | ||
$(MAKE) -C lingeling | ||
echo "Removing this file will make Make compile lingeling again." > "$@" | ||
echo "Removing this file will make Make compile lingeling again." >"$@" | ||
|
||
compile_picosat: picosat | ||
cd picosat && ./configure.sh | ||
$(MAKE) -C picosat | ||
echo "Removing this file will make Make compile PicoSAT again." > "$@" | ||
echo "Removing this file will make Make compile PicoSAT again." >"$@" | ||
|
||
compile_all: compile_minisat compile_cryptominisat compile_lingeling compile_picosat | ||
|
||
clean: | ||
$(RM) -f compile_minisat compile_cryptominisat compile_lingeling compile_picosat | ||
$(RM) -rf minisat cryptominisat lingeling picosat | ||
$(RM) -f compile_cadical compile_cadiback | ||
$(RM) -rf cadical cadiback |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#include "tests.h" | ||
|
||
#include <bandit/assertion_frameworks/snowhouse/snowhouse.h> | ||
#include <commonsat/commonsat.h> | ||
|
||
using namespace snowhouse; | ||
|
||
void test_satisfiable(commonsat::SolverInterface &solver) | ||
{ | ||
solver.add_clause({1, 2}); | ||
solver.add_clause({1, -2, 3}); | ||
solver.add_clause({-1, 2}); | ||
solver.add_clause({-1, -2}); | ||
bool isSatisfiable = solver.solve(); | ||
AssertThat(isSatisfiable, IsTrue()); | ||
} | ||
|
||
void test_unsatisfiable(commonsat::SolverInterface &solver) | ||
{ | ||
solver.add_clause({1, 2}); | ||
solver.add_clause({1, -2, 3}); | ||
solver.add_clause({-1, 2}); | ||
solver.add_clause({-1, -2}); | ||
solver.add_clause({-3}); | ||
bool isSatisfiable = solver.solve(); | ||
AssertThat(isSatisfiable, IsFalse()); | ||
} | ||
|
||
void test_assignment(commonsat::SolverInterface &solver) | ||
{ | ||
for (int i = 0; i < 7; ++i) { | ||
commonsat::clause_t clause = {1, 2, 3}; | ||
for (int j = 0; j < 3; ++j) { | ||
if ((i >> j) & 1) { | ||
clause[j] = -clause[j]; | ||
} | ||
} | ||
solver.add_clause(clause); | ||
} | ||
|
||
bool isSatisfiable = solver.solve(); | ||
AssertThat(isSatisfiable, IsTrue()); | ||
AssertThat(solver.is_assigned(1), IsTrue()); | ||
AssertThat(solver.is_assigned(2), IsTrue()); | ||
AssertThat(solver.is_assigned(3), IsTrue()); | ||
AssertThat(solver.is_true(1), IsTrue()); | ||
AssertThat(solver.is_true(2), IsTrue()); | ||
AssertThat(solver.is_true(3), IsTrue()); | ||
} |
Oops, something went wrong.