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
Andres Noetzli 2021-05-10 12:52:57 -07:00 committed by BrewTestBot
parent 96f853cd42
commit 1e9aa6b593
No known key found for this signature in database
GPG Key ID: 82D7D104050B0F0F
1 changed files with 46 additions and 0 deletions

46
Formula/cadical.rb Normal file
View File

@ -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