123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544 |
- ;;; GNU Guix --- Functional package management for GNU
- ;;; Copyright © 2018 Julien Lepiller <julien@lepiller.eu>
- ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
- ;;; Copyright © 2019 Dan Frumin <dfrumin@cs.ru.nl>
- ;;;
- ;;; This file is part of GNU Guix.
- ;;;
- ;;; GNU Guix is free software; you can redistribute it and/or modify it
- ;;; under the terms of the GNU General Public License as published by
- ;;; the Free Software Foundation; either version 3 of the License, or (at
- ;;; your option) any later version.
- ;;;
- ;;; GNU Guix is distributed in the hope that it will be useful, but
- ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
- ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- ;;; GNU General Public License for more details.
- ;;;
- ;;; You should have received a copy of the GNU General Public License
- ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
- (define-module (gnu packages coq)
- #:use-module (gnu packages)
- #:use-module (gnu packages base)
- #:use-module (gnu packages bison)
- #:use-module (gnu packages boost)
- #:use-module (gnu packages emacs)
- #:use-module (gnu packages flex)
- #:use-module (gnu packages multiprecision)
- #:use-module (gnu packages ocaml)
- #:use-module (gnu packages perl)
- #:use-module (gnu packages python)
- #:use-module (gnu packages texinfo)
- #:use-module (guix build-system gnu)
- #:use-module (guix build-system ocaml)
- #:use-module (guix download)
- #:use-module (guix git-download)
- #:use-module ((guix licenses) #:prefix license:)
- #:use-module (guix packages)
- #:use-module (guix utils)
- #:use-module ((srfi srfi-1) #:hide (zip)))
- (define-public coq
- (package
- (name "coq")
- (version "8.8.2")
- (source
- (origin
- (method git-fetch)
- (uri (git-reference
- (url "https://github.com/coq/coq.git")
- (commit (string-append "V" version))))
- (file-name (git-file-name name version))
- (sha256
- (base32 "03v8b57mz3ivsijwxy51avzwiyhla5ijaf98a5a2q29yabdq8dkp"))))
- (native-search-paths
- (list (search-path-specification
- (variable "COQPATH")
- (files (list "lib/coq/user-contrib")))))
- (build-system ocaml-build-system)
- (inputs
- `(("lablgtk" ,lablgtk)
- ("python" ,python-2)
- ("camlp5" ,camlp5)
- ("ocaml-num" ,ocaml-num)))
- (arguments
- `(#:phases
- (modify-phases %standard-phases
- (add-after 'unpack 'make-git-checkout-writable
- (lambda _
- (for-each make-file-writable (find-files "."))
- #t))
- (replace 'configure
- (lambda* (#:key outputs #:allow-other-keys)
- (let* ((out (assoc-ref outputs "out"))
- (mandir (string-append out "/share/man"))
- (browser "icecat -remote \"OpenURL(%s,new-tab)\""))
- (invoke "./configure"
- "-prefix" out
- "-mandir" mandir
- "-browser" browser
- "-coqide" "opt"))))
- (replace 'build
- (lambda _
- (invoke "make"
- "-j" (number->string (parallel-job-count))
- "world")))
- (delete 'check)
- (add-after 'install 'check
- (lambda _
- (with-directory-excursion "test-suite"
- ;; These two tests fail.
- ;; This one fails because the output is not formatted as expected.
- (delete-file-recursively "coq-makefile/timing")
- ;; This one fails because we didn't build coqtop.byte.
- (delete-file-recursively "coq-makefile/findlib-package")
- (invoke "make")))))))
- (home-page "https://coq.inria.fr")
- (synopsis "Proof assistant for higher-order logic")
- (description
- "Coq is a proof assistant for higher-order logic, which allows the
- development of computer programs consistent with their formal specification.
- It is developed using Objective Caml and Camlp5.")
- ;; The code is distributed under lgpl2.1.
- ;; Some of the documentation is distributed under opl1.0+.
- (license (list license:lgpl2.1 license:opl1.0+))))
- (define-public proof-general
- (package
- (name "proof-general")
- (version "4.2")
- (source (origin
- (method url-fetch)
- (uri (string-append
- "http://proofgeneral.inf.ed.ac.uk/releases/"
- "ProofGeneral-" version ".tgz"))
- (sha256
- (base32
- "09qb0myq66fw17v4ziz401ilsb5xlxz1nl2wsp69d0vrfy0bcrrm"))))
- (build-system gnu-build-system)
- (native-inputs
- `(("which" ,which)
- ("emacs" ,emacs-minimal)
- ("texinfo" ,texinfo)))
- (inputs
- `(("host-emacs" ,emacs)
- ("perl" ,perl)
- ("coq" ,coq)))
- (arguments
- `(#:tests? #f ; no check target
- #:make-flags (list (string-append "PREFIX=" %output)
- (string-append "DEST_PREFIX=" %output))
- #:modules ((guix build gnu-build-system)
- (guix build utils)
- (guix build emacs-utils))
- #:imported-modules (,@%gnu-build-system-modules
- (guix build emacs-utils))
- #:phases
- (modify-phases %standard-phases
- (delete 'configure)
- (add-after 'unpack 'disable-byte-compile-error-on-warn
- (lambda _
- (substitute* "Makefile"
- (("\\(setq byte-compile-error-on-warn t\\)")
- "(setq byte-compile-error-on-warn nil)"))
- #t))
- (add-after 'unpack 'patch-hardcoded-paths
- (lambda* (#:key inputs outputs #:allow-other-keys)
- (let ((out (assoc-ref outputs "out"))
- (coq (assoc-ref inputs "coq"))
- (emacs (assoc-ref inputs "host-emacs")))
- (define (coq-prog name)
- (string-append coq "/bin/" name))
- (emacs-substitute-variables "coq/coq.el"
- ("coq-prog-name" (coq-prog "coqtop"))
- ("coq-compiler" (coq-prog "coqc"))
- ("coq-dependency-analyzer" (coq-prog "coqdep")))
- (substitute* "Makefile"
- (("/sbin/install-info") "install-info"))
- (substitute* "bin/proofgeneral"
- (("^PGHOMEDEFAULT=.*" all)
- (string-append all
- "PGHOME=$PGHOMEDEFAULT\n"
- "EMACS=" emacs "/bin/emacs")))
- #t)))
- (add-after 'unpack 'clean
- (lambda _
- ;; Delete the pre-compiled elc files for Emacs 23.
- (invoke "make" "clean")))
- (add-after 'install 'install-doc
- (lambda* (#:key make-flags #:allow-other-keys)
- ;; XXX FIXME avoid building/installing pdf files,
- ;; due to unresolved errors building them.
- (substitute* "Makefile"
- ((" [^ ]*\\.pdf") ""))
- (apply invoke "make" "install-doc" make-flags))))))
- (home-page "http://proofgeneral.inf.ed.ac.uk/")
- (synopsis "Generic front-end for proof assistants based on Emacs")
- (description
- "Proof General is a major mode to turn Emacs into an interactive proof
- assistant to write formal mathematical proofs using a variety of theorem
- provers.")
- (license license:gpl2+)))
- (define-public coq-flocq
- (package
- (name "coq-flocq")
- (version "2.6.1")
- (source (origin
- (method url-fetch)
- ;; Use the ‘Latest version’ link for a stable URI across releases.
- (uri (string-append "https://gforge.inria.fr/frs/download.php/"
- "file/37454/flocq-" version ".tar.gz"))
- (sha256
- (base32
- "06msp1fwpqv6p98a3i1nnkj7ch9rcq3rm916yxq8dxf51lkghrin"))))
- (build-system gnu-build-system)
- (native-inputs
- `(("ocaml" ,ocaml)
- ("which" ,which)
- ("coq" ,coq)))
- (arguments
- `(#:configure-flags
- (list (string-append "--libdir=" (assoc-ref %outputs "out")
- "/lib/coq/user-contrib/Flocq"))
- #:phases
- (modify-phases %standard-phases
- (add-before 'configure 'fix-remake
- (lambda _
- (substitute* "remake.cpp"
- (("/bin/sh") (which "sh")))
- #t))
- (replace 'build
- (lambda _
- (invoke "./remake")
- #t))
- (replace 'check
- (lambda _
- (invoke "./remake" "check")
- #t))
- ;; TODO: requires coq-gappa and coq-interval.
- ;(invoke "./remake" "check-more")
- (replace 'install
- (lambda _
- (invoke "./remake" "install")
- #t)))))
- (home-page "http://flocq.gforge.inria.fr/")
- (synopsis "Floating-point formalization for the Coq system")
- (description "Flocq (Floats for Coq) is a floating-point formalization for
- the Coq system. It provides a comprehensive library of theorems on a multi-radix
- multi-precision arithmetic. It also supports efficient numerical computations
- inside Coq.")
- (license license:lgpl3+)))
- (define-public coq-gappa
- (package
- (name "coq-gappa")
- (version "1.3.2")
- (source (origin
- (method url-fetch)
- (uri (string-append "https://gforge.inria.fr/frs/download.php/file/36397/gappa-"
- version ".tar.gz"))
- (sha256
- (base32
- "19kg2zldaqs4smy7bv9hp650sqg46xbx1ss7jnyagpxdscwn9apd"))))
- (build-system gnu-build-system)
- (native-inputs
- `(("ocaml" ,ocaml)
- ("which" ,which)
- ("coq" ,coq)
- ("bison" ,bison)
- ("flex" ,flex)))
- (inputs
- `(("gmp" ,gmp)
- ("mpfr" ,mpfr)
- ("boost" ,boost)))
- (arguments
- `(#:configure-flags
- (list (string-append "--libdir=" (assoc-ref %outputs "out")
- "/lib/coq/user-contrib/Gappa"))
- #:phases
- (modify-phases %standard-phases
- (add-before 'configure 'fix-remake
- (lambda _
- (substitute* "remake.cpp"
- (("/bin/sh") (which "sh")))
- #t))
- (replace 'build
- (lambda _ (invoke "./remake")))
- (replace 'check
- (lambda _ (invoke "./remake" "check")))
- (replace 'install
- (lambda _ (invoke "./remake" "install"))))))
- (home-page "http://gappa.gforge.inria.fr/")
- (synopsis "Verify and formally prove properties on numerical programs")
- (description "Gappa is a tool intended to help verifying and formally proving
- properties on numerical programs dealing with floating-point or fixed-point
- arithmetic. It has been used to write robust floating-point filters for CGAL
- and it is used to certify elementary functions in CRlibm. While Gappa is
- intended to be used directly, it can also act as a backend prover for the Why3
- software verification plateform or as an automatic tactic for the Coq proof
- assistant.")
- (license (list license:gpl2+ license:cecill))));either gpl2+ or cecill
- (define-public coq-mathcomp
- (package
- (name "coq-mathcomp")
- (version "1.7.0")
- (source
- (origin
- (method git-fetch)
- (uri (git-reference
- (url "https://github.com/math-comp/math-comp.git")
- (commit (string-append "mathcomp-" version))))
- (file-name (git-file-name name version))
- (sha256
- (base32 "1cdzi67jj440xkdpxm10aly80zpn56vjzj2ygb67iq3xpljlv95h"))))
- (build-system gnu-build-system)
- (native-inputs
- `(("ocaml" ,ocaml)
- ("which" ,which)
- ("coq" ,coq)))
- (arguments
- `(#:tests? #f ; no need to test formally-verified programs :)
- #:phases
- (modify-phases %standard-phases
- (delete 'configure)
- (add-before 'build 'chdir
- (lambda _ (chdir "mathcomp") #t))
- (replace 'install
- (lambda* (#:key outputs #:allow-other-keys)
- (setenv "COQLIB" (string-append (assoc-ref outputs "out") "/lib/coq/"))
- (invoke "make" "-f" "Makefile.coq"
- (string-append "COQLIB=" (assoc-ref outputs "out")
- "/lib/coq/")
- "install"))))))
- (home-page "https://math-comp.github.io/math-comp/")
- (synopsis "Mathematical Components for Coq")
- (description "Mathematical Components for Coq has its origins in the formal
- proof of the Four Colour Theorem. Since then it has grown to cover many areas
- of mathematics and has been used for large scale projects like the formal proof
- of the Odd Order Theorem.
- The library is written using the Ssreflect proof language that is an integral
- part of the distribution.")
- (license license:cecill-b)))
- (define-public coq-coquelicot
- (package
- (name "coq-coquelicot")
- (version "3.0.1")
- (source (origin
- (method url-fetch)
- (uri (string-append "https://gforge.inria.fr/frs/download.php/"
- "file/37045/coquelicot-" version ".tar.gz"))
- (sha256
- (base32
- "0hsyhsy2lwqxxx2r8xgi5csmirss42lp9bkb9yy35mnya0w78c8r"))))
- (build-system gnu-build-system)
- (native-inputs
- `(("ocaml" ,ocaml)
- ("which" ,which)
- ("coq" ,coq)))
- (propagated-inputs
- `(("mathcomp" ,coq-mathcomp)))
- (arguments
- `(#:configure-flags
- (list (string-append "--libdir=" (assoc-ref %outputs "out")
- "/lib/coq/user-contrib/Coquelicot"))
- #:phases
- (modify-phases %standard-phases
- (add-before 'configure 'fix-coq8.8
- (lambda _
- ; appcontext has been removed from coq 8.8
- (substitute* "theories/AutoDerive.v"
- (("appcontext") "context"))
- #t))
- (add-before 'configure 'fix-remake
- (lambda _
- (substitute* "remake.cpp"
- (("/bin/sh") (which "sh")))
- #t))
- (replace 'build
- (lambda _ (invoke "./remake")))
- (replace 'check
- (lambda _ (invoke "./remake" "check")))
- (replace 'install
- (lambda _ (invoke "./remake" "install"))))))
- (home-page "http://coquelicot.saclay.inria.fr/index.html")
- (synopsis "Coq library for Reals")
- (description "Coquelicot is an easier way of writing formulas and theorem
- statements, achieved by relying on total functions in place of dependent types
- for limits, derivatives, integrals, power series, and so on. To help with the
- proof process, the library comes with a comprehensive set of theorems that cover
- not only these notions, but also some extensions such as parametric integrals,
- two-dimensional differentiability, asymptotic behaviors. It also offers some
- automations for performing differentiability proofs. Moreover, Coquelicot is a
- conservative extension of Coq's standard library and provides correspondence
- theorems between the two libraries.")
- (license license:lgpl3+)))
- (define-public coq-bignums
- (package
- (name "coq-bignums")
- (version "8.8.0")
- (source (origin
- (method url-fetch)
- (uri (string-append "https://github.com/coq/bignums/archive/V"
- version ".tar.gz"))
- (file-name (string-append name "-" version ".tar.gz"))
- (sha256
- (base32
- "08m1cmq4hkaf4sb0vy978c11rgzvds71cphyadmr2iirpr5815r0"))))
- (build-system gnu-build-system)
- (native-inputs
- `(("ocaml" ,ocaml)
- ("coq" ,coq)))
- (inputs
- `(("camlp5" ,camlp5)))
- (arguments
- `(#:tests? #f; No test target
- #:make-flags
- (list (string-append "COQLIBINSTALL=" (assoc-ref %outputs "out")
- "/lib/coq/user-contrib"))
- #:phases
- (modify-phases %standard-phases
- (delete 'configure))))
- (home-page "https://github.com/coq/bignums")
- (synopsis "Coq library for arbitrary large numbers")
- (description "Bignums is a coq library of arbitrary large numbers. It
- provides BigN, BigZ, BigQ that used to be part of Coq standard library.")
- (license license:lgpl2.1+)))
- (define-public coq-interval
- (package
- (name "coq-interval")
- (version "3.3.0")
- (source (origin
- (method url-fetch)
- (uri (string-append "https://gforge.inria.fr/frs/download.php/"
- "file/37077/interval-" version ".tar.gz"))
- (sha256
- (base32
- "08fdcf3hbwqphglvwprvqzgkg0qbimpyhnqsgv3gac4y1ap0f903"))))
- (build-system gnu-build-system)
- (native-inputs
- `(("ocaml" ,ocaml)
- ("which" ,which)
- ("coq" ,coq)))
- (propagated-inputs
- `(("flocq" ,coq-flocq)
- ("bignums" ,coq-bignums)
- ("coquelicot" ,coq-coquelicot)
- ("mathcomp" ,coq-mathcomp)))
- (arguments
- `(#:configure-flags
- (list (string-append "--libdir=" (assoc-ref %outputs "out")
- "/lib/coq/user-contrib/Gappa"))
- #:phases
- (modify-phases %standard-phases
- (add-before 'configure 'fix-remake
- (lambda _
- (substitute* "remake.cpp"
- (("/bin/sh") (which "sh")))
- #t))
- (replace 'build
- (lambda _ (invoke "./remake")))
- (replace 'check
- (lambda _ (invoke "./remake" "check")))
- (replace 'install
- (lambda _ (invoke "./remake" "install"))))))
- (home-page "http://coq-interval.gforge.inria.fr/")
- (synopsis "Coq tactics to simplify inequality proofs")
- (description "Interval provides vernacular files containing tactics for
- simplifying the proofs of inequalities on expressions of real numbers for the
- Coq proof assistant.")
- (license license:cecill-c)))
- (define-public coq-autosubst
- ;; Latest commit on that branch, where work on supporting coq 8.6 and
- ;; more recent versions of coq happen.
- (let ((branch "coq86-devel")
- (commit "d0d73557979796b3d4be7aac72135581c33f26f7"))
- (package
- (name "coq-autosubst")
- (version (git-version "1" branch commit))
- (source (origin
- (method git-fetch)
- (uri (git-reference
- (url "git://github.com/uds-psl/autosubst.git")
- (commit commit)))
- (file-name (git-file-name name version))
- (sha256
- (base32 "1852xb5cwkjw3dlc0lp2sakwa40bjzw37qmwz4bn3vqazg1hnh6r"))))
- (build-system gnu-build-system)
- (arguments
- `(#:tests? #f
- #:phases
- (modify-phases %standard-phases
- (delete 'configure)
- (replace 'install
- (lambda* (#:key outputs #:allow-other-keys)
- (setenv "COQLIB" (string-append (assoc-ref outputs "out") "/lib/coq/"))
- (invoke "make"
- (string-append "COQLIB=" (assoc-ref outputs "out")
- "/lib/coq/")
- "install"))))))
- (native-inputs
- `(("coq" ,coq)))
- (home-page "https://www.ps.uni-saarland.de/autosubst/")
- (synopsis "Coq library for parallel de Bruijn substitutions")
- (description "Formalizing syntactic theories with variable binders is
- not easy. Autosubst is a library for the Coq proof assistant to
- automate this process. Given an inductive definition of syntactic objects in
- de Bruijn representation augmented with binding annotations, Autosubst
- synthesizes the parallel substitution operation and automatically proves the
- basic lemmas about substitutions. This library contains an automation
- tactic that solves equations involving terms and substitutions. This makes the
- usage of substitution lemmas unnecessary. The tactic is based on our current
- work on a decision procedure for the equational theory of an extension of the
- sigma-calculus by Abadi et al. The library is completely written in Coq and
- uses Ltac to synthesize the substitution operation.")
- (license license:bsd-3))))
- (define-public coq-equations
- (package
- (name "coq-equations")
- (version "1.1")
- (source (origin
- (method git-fetch)
- (uri (git-reference
- (url "https://github.com/mattam82/Coq-Equations.git")
- (commit (string-append "v" version "-8.8"))))
- (file-name (git-file-name name version))
- (sha256
- (base32
- "129rxsdsf88vjcw0xhm74yax1hmnk6f8n9ksg0hcyyjq1ijddiwa"))))
- (build-system gnu-build-system)
- (native-inputs
- `(("ocaml" ,ocaml)
- ("coq" ,coq)
- ("camlp5" ,camlp5)))
- (arguments
- `(#:test-target "test-suite"
- #:phases
- (modify-phases %standard-phases
- (replace 'configure
- (lambda* (#:key outputs #:allow-other-keys)
- (invoke "coq_makefile" "-f" "_CoqProject" "-o" "Makefile")))
- (replace 'install
- (lambda* (#:key outputs #:allow-other-keys)
- (setenv "COQLIB" (string-append (assoc-ref outputs "out") "/lib/coq/"))
- (invoke "make"
- (string-append "COQLIB=" (assoc-ref outputs "out")
- "/lib/coq/")
- "install"))))))
- (home-page "https://mattam82.github.io/Coq-Equations/")
- (synopsis "Function definition plugin for Coq")
- (description "Equations provides a notation for writing programs
- by dependent pattern-matching and (well-founded) recursion in Coq. It
- compiles everything down to eliminators for inductive types, equality
- and accessibility, providing a definitional extension to the Coq
- kernel.")
- (license license:lgpl2.1)))
|