homebrew-core/Formula/coq.rb

67 lines
1.8 KiB
Ruby

class Coq < Formula
desc "Proof assistant for higher-order logic"
homepage "https://coq.inria.fr/"
url "https://github.com/coq/coq/archive/V8.13.0.tar.gz"
sha256 "06445dbd6cb3c8a2e4e957dbd12e094d609a62fcb0c8c3cad0cd1fdedda25c9b"
license "LGPL-2.1-only"
head "https://github.com/coq/coq.git"
livecheck do
url :head
regex(/^v?(\d+(?:\.\d+)+)$/i)
end
bottle do
rebuild 1
sha256 "7dd6076443266eac49ec08a6dfa21e87bc5ca4078c9f437a5332f1608850feca" => :big_sur
sha256 "efa50a3b7b3e835905f814c8de3a8ec05348f5039387ec0ec615c034e92b985e" => :catalina
sha256 "201e0b61e6a02145c3afa3083cdf7b05fe270306317eedeaa35a27e8d8470445" => :mojave
end
depends_on "ocaml-findlib" => :build
depends_on "ocaml"
depends_on "ocaml-zarith"
uses_from_macos "m4" => :build
uses_from_macos "unzip" => :build
def install
system "./configure", "-prefix", prefix,
"-mandir", man,
"-coqdocdir", "#{pkgshare}/latex",
"-coqide", "no",
"-with-doc", "no"
system "make", "world"
ENV.deparallelize { system "make", "install" }
end
test do
(testpath/"testing.v").write <<~EOS
Require Coq.micromega.Lia.
Require Coq.ZArith.ZArith.
Inductive nat : Set :=
| O : nat
| S : nat -> nat.
Fixpoint add (n m: nat) : nat :=
match n with
| O => m
| S n' => S (add n' m)
end.
Lemma add_O_r : forall (n: nat), add n O = n.
Proof.
intros n; induction n; simpl; auto; rewrite IHn; auto.
Qed.
Import Coq.micromega.Lia.
Import Coq.ZArith.ZArith.
Open Scope Z.
Lemma add_O_r_Z : forall (n: Z), n + 0 = n.
Proof.
intros; lia.
Qed.
EOS
system("#{bin}/coqc", "#{testpath}/testing.v")
end
end