cadical 1.4.0 (new formula)
Closes #76983. Signed-off-by: Carlo Cabrera <30379873+carlocab@users.noreply.github.com> Signed-off-by: Sean Molenaar <1484494+SMillerDev@users.noreply.github.com> Signed-off-by: BrewTestBot <1589480+BrewTestBot@users.noreply.github.com>master
parent
96f853cd42
commit
1e9aa6b593
|
@ -0,0 +1,46 @@
|
|||
class Cadical < Formula
|
||||
desc "Clean and efficient state-of-the-art SAT solver"
|
||||
homepage "http://fmv.jku.at/cadical/"
|
||||
url "https://github.com/arminbiere/cadical/archive/refs/tags/rel-1.4.0.tar.gz"
|
||||
sha256 "b5990bea7aa5df6002b9bfe782323742d786565b9dfee37bbc0dd0f4b8e65141"
|
||||
license "MIT"
|
||||
|
||||
def install
|
||||
system "./configure"
|
||||
chdir "build" do
|
||||
system "make"
|
||||
bin.install "cadical"
|
||||
lib.install "libcadical.a"
|
||||
include.install "../src/cadical.hpp"
|
||||
end
|
||||
end
|
||||
|
||||
test do
|
||||
(testpath/"simple.cnf").write <<~EOS
|
||||
p cnf 3 4
|
||||
1 0
|
||||
-2 0
|
||||
-3 0
|
||||
-1 2 3 0
|
||||
EOS
|
||||
result = shell_output("#{bin}/cadical simple.cnf", 20)
|
||||
assert_match "s UNSATISFIABLE", result
|
||||
|
||||
(testpath/"test.cpp").write <<~EOS
|
||||
#include <cadical.hpp>
|
||||
#include <cassert>
|
||||
int main() {
|
||||
CaDiCaL::Solver solver;
|
||||
solver.add(1);
|
||||
solver.add(0);
|
||||
int res = solver.solve();
|
||||
assert(res == 10);
|
||||
res = solver.val(1);
|
||||
assert(res > 0);
|
||||
return 0;
|
||||
}
|
||||
EOS
|
||||
system ENV.cxx, "test.cpp", "-L#{lib}", "-lcadical", "-o", "test", "-std=c++11"
|
||||
system "./test"
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue