Commit | Line | Data |
---|---|---|
33af92dd JL |
1 | ;;; GNU Guix --- Functional package management for GNU |
2 | ;;; Copyright © 2018 Julien Lepiller <julien@lepiller.eu> | |
b92660af | 3 | ;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr> |
7d60df33 | 4 | ;;; Copyright © 2019 Dan Frumin <dfrumin@cs.ru.nl> |
33af92dd JL |
5 | ;;; |
6 | ;;; This file is part of GNU Guix. | |
7 | ;;; | |
8 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | |
9 | ;;; under the terms of the GNU General Public License as published by | |
10 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
11 | ;;; your option) any later version. | |
12 | ;;; | |
13 | ;;; GNU Guix is distributed in the hope that it will be useful, but | |
14 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | ;;; GNU General Public License for more details. | |
17 | ;;; | |
18 | ;;; You should have received a copy of the GNU General Public License | |
19 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | |
20 | ||
21 | (define-module (gnu packages coq) | |
22 | #:use-module (gnu packages) | |
23 | #:use-module (gnu packages base) | |
24 | #:use-module (gnu packages bison) | |
25 | #:use-module (gnu packages boost) | |
26 | #:use-module (gnu packages emacs) | |
27 | #:use-module (gnu packages flex) | |
66fbffde | 28 | #:use-module (gnu packages gawk) |
33af92dd JL |
29 | #:use-module (gnu packages multiprecision) |
30 | #:use-module (gnu packages ocaml) | |
31 | #:use-module (gnu packages perl) | |
32 | #:use-module (gnu packages python) | |
33 | #:use-module (gnu packages texinfo) | |
34 | #:use-module (guix build-system gnu) | |
35 | #:use-module (guix build-system ocaml) | |
36 | #:use-module (guix download) | |
7d60df33 | 37 | #:use-module (guix git-download) |
33af92dd JL |
38 | #:use-module ((guix licenses) #:prefix license:) |
39 | #:use-module (guix packages) | |
40 | #:use-module (guix utils) | |
41 | #:use-module ((srfi srfi-1) #:hide (zip))) | |
42 | ||
43 | (define-public coq | |
44 | (package | |
45 | (name "coq") | |
b92660af | 46 | (version "8.9.1") |
8b9b2210 TGR |
47 | (source |
48 | (origin | |
49 | (method git-fetch) | |
50 | (uri (git-reference | |
51 | (url "https://github.com/coq/coq.git") | |
52 | (commit (string-append "V" version)))) | |
53 | (file-name (git-file-name name version)) | |
54 | (sha256 | |
b92660af | 55 | (base32 "1p4z967s18wkblayv12ygqsrqlyk5ax1pz40yf4kag8pva6gblhk")))) |
33af92dd JL |
56 | (native-search-paths |
57 | (list (search-path-specification | |
58 | (variable "COQPATH") | |
59 | (files (list "lib/coq/user-contrib"))))) | |
60 | (build-system ocaml-build-system) | |
61 | (inputs | |
62 | `(("lablgtk" ,lablgtk) | |
63 | ("python" ,python-2) | |
64 | ("camlp5" ,camlp5) | |
65 | ("ocaml-num" ,ocaml-num))) | |
e03e1b55 JL |
66 | (native-inputs |
67 | `(("ocaml-ounit" ,ocaml-ounit))) | |
33af92dd JL |
68 | (arguments |
69 | `(#:phases | |
70 | (modify-phases %standard-phases | |
8b9b2210 TGR |
71 | (add-after 'unpack 'make-git-checkout-writable |
72 | (lambda _ | |
73 | (for-each make-file-writable (find-files ".")) | |
74 | #t)) | |
33af92dd JL |
75 | (replace 'configure |
76 | (lambda* (#:key outputs #:allow-other-keys) | |
77 | (let* ((out (assoc-ref outputs "out")) | |
78 | (mandir (string-append out "/share/man")) | |
79 | (browser "icecat -remote \"OpenURL(%s,new-tab)\"")) | |
80 | (invoke "./configure" | |
81 | "-prefix" out | |
82 | "-mandir" mandir | |
83 | "-browser" browser | |
84 | "-coqide" "opt")))) | |
85 | (replace 'build | |
86 | (lambda _ | |
87 | (invoke "make" | |
88 | "-j" (number->string (parallel-job-count)) | |
89 | "world"))) | |
90 | (delete 'check) | |
91 | (add-after 'install 'check | |
92 | (lambda _ | |
93 | (with-directory-excursion "test-suite" | |
94 | ;; These two tests fail. | |
95 | ;; This one fails because the output is not formatted as expected. | |
96 | (delete-file-recursively "coq-makefile/timing") | |
97 | ;; This one fails because we didn't build coqtop.byte. | |
98 | (delete-file-recursively "coq-makefile/findlib-package") | |
99 | (invoke "make"))))))) | |
100 | (home-page "https://coq.inria.fr") | |
101 | (synopsis "Proof assistant for higher-order logic") | |
102 | (description | |
103 | "Coq is a proof assistant for higher-order logic, which allows the | |
104 | development of computer programs consistent with their formal specification. | |
105 | It is developed using Objective Caml and Camlp5.") | |
106 | ;; The code is distributed under lgpl2.1. | |
107 | ;; Some of the documentation is distributed under opl1.0+. | |
108 | (license (list license:lgpl2.1 license:opl1.0+)))) | |
109 | ||
110 | (define-public proof-general | |
111 | (package | |
112 | (name "proof-general") | |
113 | (version "4.2") | |
114 | (source (origin | |
115 | (method url-fetch) | |
116 | (uri (string-append | |
117 | "http://proofgeneral.inf.ed.ac.uk/releases/" | |
118 | "ProofGeneral-" version ".tgz")) | |
119 | (sha256 | |
120 | (base32 | |
121 | "09qb0myq66fw17v4ziz401ilsb5xlxz1nl2wsp69d0vrfy0bcrrm")))) | |
122 | (build-system gnu-build-system) | |
123 | (native-inputs | |
124 | `(("which" ,which) | |
125 | ("emacs" ,emacs-minimal) | |
126 | ("texinfo" ,texinfo))) | |
127 | (inputs | |
128 | `(("host-emacs" ,emacs) | |
129 | ("perl" ,perl) | |
130 | ("coq" ,coq))) | |
131 | (arguments | |
132 | `(#:tests? #f ; no check target | |
133 | #:make-flags (list (string-append "PREFIX=" %output) | |
134 | (string-append "DEST_PREFIX=" %output)) | |
135 | #:modules ((guix build gnu-build-system) | |
136 | (guix build utils) | |
137 | (guix build emacs-utils)) | |
138 | #:imported-modules (,@%gnu-build-system-modules | |
139 | (guix build emacs-utils)) | |
140 | #:phases | |
141 | (modify-phases %standard-phases | |
142 | (delete 'configure) | |
143 | (add-after 'unpack 'disable-byte-compile-error-on-warn | |
144 | (lambda _ | |
145 | (substitute* "Makefile" | |
146 | (("\\(setq byte-compile-error-on-warn t\\)") | |
147 | "(setq byte-compile-error-on-warn nil)")) | |
148 | #t)) | |
149 | (add-after 'unpack 'patch-hardcoded-paths | |
150 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
151 | (let ((out (assoc-ref outputs "out")) | |
152 | (coq (assoc-ref inputs "coq")) | |
153 | (emacs (assoc-ref inputs "host-emacs"))) | |
154 | (define (coq-prog name) | |
155 | (string-append coq "/bin/" name)) | |
156 | (emacs-substitute-variables "coq/coq.el" | |
157 | ("coq-prog-name" (coq-prog "coqtop")) | |
158 | ("coq-compiler" (coq-prog "coqc")) | |
159 | ("coq-dependency-analyzer" (coq-prog "coqdep"))) | |
160 | (substitute* "Makefile" | |
161 | (("/sbin/install-info") "install-info")) | |
162 | (substitute* "bin/proofgeneral" | |
163 | (("^PGHOMEDEFAULT=.*" all) | |
164 | (string-append all | |
165 | "PGHOME=$PGHOMEDEFAULT\n" | |
166 | "EMACS=" emacs "/bin/emacs"))) | |
167 | #t))) | |
168 | (add-after 'unpack 'clean | |
a48d6acc RW |
169 | (lambda _ |
170 | ;; Delete the pre-compiled elc files for Emacs 23. | |
171 | (invoke "make" "clean"))) | |
33af92dd | 172 | (add-after 'install 'install-doc |
a48d6acc RW |
173 | (lambda* (#:key make-flags #:allow-other-keys) |
174 | ;; XXX FIXME avoid building/installing pdf files, | |
175 | ;; due to unresolved errors building them. | |
176 | (substitute* "Makefile" | |
177 | ((" [^ ]*\\.pdf") "")) | |
178 | (apply invoke "make" "install-doc" make-flags)))))) | |
33af92dd JL |
179 | (home-page "http://proofgeneral.inf.ed.ac.uk/") |
180 | (synopsis "Generic front-end for proof assistants based on Emacs") | |
181 | (description | |
182 | "Proof General is a major mode to turn Emacs into an interactive proof | |
183 | assistant to write formal mathematical proofs using a variety of theorem | |
184 | provers.") | |
185 | (license license:gpl2+))) | |
186 | ||
187 | (define-public coq-flocq | |
188 | (package | |
189 | (name "coq-flocq") | |
0b611996 | 190 | (version "3.1.0") |
33af92dd JL |
191 | (source (origin |
192 | (method url-fetch) | |
193 | ;; Use the ‘Latest version’ link for a stable URI across releases. | |
194 | (uri (string-append "https://gforge.inria.fr/frs/download.php/" | |
0b611996 | 195 | "file/37901/flocq-" version ".tar.gz")) |
33af92dd JL |
196 | (sha256 |
197 | (base32 | |
0b611996 | 198 | "02szrgz9m0ac51la1lqpiv6i2g0zbgx9gz5rp0q1g00ajldyna5c")))) |
33af92dd JL |
199 | (build-system gnu-build-system) |
200 | (native-inputs | |
201 | `(("ocaml" ,ocaml) | |
202 | ("which" ,which) | |
203 | ("coq" ,coq))) | |
204 | (arguments | |
205 | `(#:configure-flags | |
206 | (list (string-append "--libdir=" (assoc-ref %outputs "out") | |
207 | "/lib/coq/user-contrib/Flocq")) | |
208 | #:phases | |
209 | (modify-phases %standard-phases | |
210 | (add-before 'configure 'fix-remake | |
211 | (lambda _ | |
212 | (substitute* "remake.cpp" | |
213 | (("/bin/sh") (which "sh"))) | |
214 | #t)) | |
215 | (replace 'build | |
216 | (lambda _ | |
718d358a | 217 | (invoke "./remake"))) |
33af92dd JL |
218 | (replace 'check |
219 | (lambda _ | |
718d358a | 220 | (invoke "./remake" "check"))) |
33af92dd JL |
221 | ;; TODO: requires coq-gappa and coq-interval. |
222 | ;(invoke "./remake" "check-more") | |
223 | (replace 'install | |
224 | (lambda _ | |
718d358a | 225 | (invoke "./remake" "install")))))) |
33af92dd JL |
226 | (home-page "http://flocq.gforge.inria.fr/") |
227 | (synopsis "Floating-point formalization for the Coq system") | |
228 | (description "Flocq (Floats for Coq) is a floating-point formalization for | |
229 | the Coq system. It provides a comprehensive library of theorems on a multi-radix | |
230 | multi-precision arithmetic. It also supports efficient numerical computations | |
231 | inside Coq.") | |
232 | (license license:lgpl3+))) | |
233 | ||
234 | (define-public coq-gappa | |
235 | (package | |
236 | (name "coq-gappa") | |
1f1ea9c0 | 237 | (version "1.3.4") |
33af92dd JL |
238 | (source (origin |
239 | (method url-fetch) | |
1f1ea9c0 | 240 | (uri (string-append "https://gforge.inria.fr/frs/download.php/file/37918/gappa-" |
33af92dd JL |
241 | version ".tar.gz")) |
242 | (sha256 | |
243 | (base32 | |
1f1ea9c0 | 244 | "1wdg07dk4lbq7dr80ywzna0lclwgi8bddzc6yfx19z1zn9yljzxh")))) |
33af92dd JL |
245 | (build-system gnu-build-system) |
246 | (native-inputs | |
247 | `(("ocaml" ,ocaml) | |
248 | ("which" ,which) | |
249 | ("coq" ,coq) | |
250 | ("bison" ,bison) | |
251 | ("flex" ,flex))) | |
252 | (inputs | |
253 | `(("gmp" ,gmp) | |
254 | ("mpfr" ,mpfr) | |
255 | ("boost" ,boost))) | |
256 | (arguments | |
257 | `(#:configure-flags | |
258 | (list (string-append "--libdir=" (assoc-ref %outputs "out") | |
0fe041bd | 259 | "/lib/coq/user-contrib/Gappa")) |
33af92dd JL |
260 | #:phases |
261 | (modify-phases %standard-phases | |
262 | (add-before 'configure 'fix-remake | |
263 | (lambda _ | |
264 | (substitute* "remake.cpp" | |
ace73a93 RW |
265 | (("/bin/sh") (which "sh"))) |
266 | #t)) | |
33af92dd | 267 | (replace 'build |
ace73a93 | 268 | (lambda _ (invoke "./remake"))) |
33af92dd | 269 | (replace 'check |
ace73a93 | 270 | (lambda _ (invoke "./remake" "check"))) |
33af92dd | 271 | (replace 'install |
ace73a93 | 272 | (lambda _ (invoke "./remake" "install")))))) |
33af92dd JL |
273 | (home-page "http://gappa.gforge.inria.fr/") |
274 | (synopsis "Verify and formally prove properties on numerical programs") | |
275 | (description "Gappa is a tool intended to help verifying and formally proving | |
276 | properties on numerical programs dealing with floating-point or fixed-point | |
277 | arithmetic. It has been used to write robust floating-point filters for CGAL | |
278 | and it is used to certify elementary functions in CRlibm. While Gappa is | |
279 | intended to be used directly, it can also act as a backend prover for the Why3 | |
280 | software verification plateform or as an automatic tactic for the Coq proof | |
281 | assistant.") | |
282 | (license (list license:gpl2+ license:cecill))));either gpl2+ or cecill | |
283 | ||
284 | (define-public coq-mathcomp | |
285 | (package | |
286 | (name "coq-mathcomp") | |
f5b0d904 | 287 | (version "1.8.0") |
aaa2add8 TGR |
288 | (source |
289 | (origin | |
290 | (method git-fetch) | |
291 | (uri (git-reference | |
292 | (url "https://github.com/math-comp/math-comp.git") | |
293 | (commit (string-append "mathcomp-" version)))) | |
294 | (file-name (git-file-name name version)) | |
295 | (sha256 | |
f5b0d904 | 296 | (base32 "1sdrw3b6lc8crz02lp90a863rvyzhc9vcfsrdvc9m311yiaad4xv")))) |
33af92dd JL |
297 | (build-system gnu-build-system) |
298 | (native-inputs | |
299 | `(("ocaml" ,ocaml) | |
300 | ("which" ,which) | |
301 | ("coq" ,coq))) | |
302 | (arguments | |
aaa2add8 | 303 | `(#:tests? #f ; no need to test formally-verified programs :) |
33af92dd JL |
304 | #:phases |
305 | (modify-phases %standard-phases | |
306 | (delete 'configure) | |
307 | (add-before 'build 'chdir | |
492ee4f8 | 308 | (lambda _ (chdir "mathcomp") #t)) |
33af92dd JL |
309 | (replace 'install |
310 | (lambda* (#:key outputs #:allow-other-keys) | |
311 | (setenv "COQLIB" (string-append (assoc-ref outputs "out") "/lib/coq/")) | |
492ee4f8 RW |
312 | (invoke "make" "-f" "Makefile.coq" |
313 | (string-append "COQLIB=" (assoc-ref outputs "out") | |
314 | "/lib/coq/") | |
315 | "install")))))) | |
33af92dd JL |
316 | (home-page "https://math-comp.github.io/math-comp/") |
317 | (synopsis "Mathematical Components for Coq") | |
318 | (description "Mathematical Components for Coq has its origins in the formal | |
319 | proof of the Four Colour Theorem. Since then it has grown to cover many areas | |
320 | of mathematics and has been used for large scale projects like the formal proof | |
321 | of the Odd Order Theorem. | |
322 | ||
323 | The library is written using the Ssreflect proof language that is an integral | |
324 | part of the distribution.") | |
325 | (license license:cecill-b))) | |
326 | ||
327 | (define-public coq-coquelicot | |
328 | (package | |
329 | (name "coq-coquelicot") | |
3d03fed4 | 330 | (version "3.0.2") |
33af92dd JL |
331 | (source (origin |
332 | (method url-fetch) | |
333 | (uri (string-append "https://gforge.inria.fr/frs/download.php/" | |
3d03fed4 | 334 | "file/37523/coquelicot-" version ".tar.gz")) |
33af92dd JL |
335 | (sha256 |
336 | (base32 | |
3d03fed4 | 337 | "1biia7nfqf7vaqq5gmykl4rwjyvrcwss6r2jdf0in5pvp2rnrj2w")))) |
33af92dd JL |
338 | (build-system gnu-build-system) |
339 | (native-inputs | |
340 | `(("ocaml" ,ocaml) | |
341 | ("which" ,which) | |
342 | ("coq" ,coq))) | |
343 | (propagated-inputs | |
344 | `(("mathcomp" ,coq-mathcomp))) | |
345 | (arguments | |
346 | `(#:configure-flags | |
347 | (list (string-append "--libdir=" (assoc-ref %outputs "out") | |
348 | "/lib/coq/user-contrib/Coquelicot")) | |
349 | #:phases | |
350 | (modify-phases %standard-phases | |
33af92dd JL |
351 | (add-before 'configure 'fix-remake |
352 | (lambda _ | |
353 | (substitute* "remake.cpp" | |
e09e8388 RW |
354 | (("/bin/sh") (which "sh"))) |
355 | #t)) | |
33af92dd | 356 | (replace 'build |
e09e8388 | 357 | (lambda _ (invoke "./remake"))) |
33af92dd | 358 | (replace 'check |
e09e8388 | 359 | (lambda _ (invoke "./remake" "check"))) |
33af92dd | 360 | (replace 'install |
e09e8388 | 361 | (lambda _ (invoke "./remake" "install")))))) |
33af92dd JL |
362 | (home-page "http://coquelicot.saclay.inria.fr/index.html") |
363 | (synopsis "Coq library for Reals") | |
364 | (description "Coquelicot is an easier way of writing formulas and theorem | |
365 | statements, achieved by relying on total functions in place of dependent types | |
366 | for limits, derivatives, integrals, power series, and so on. To help with the | |
367 | proof process, the library comes with a comprehensive set of theorems that cover | |
368 | not only these notions, but also some extensions such as parametric integrals, | |
369 | two-dimensional differentiability, asymptotic behaviors. It also offers some | |
370 | automations for performing differentiability proofs. Moreover, Coquelicot is a | |
371 | conservative extension of Coq's standard library and provides correspondence | |
372 | theorems between the two libraries.") | |
373 | (license license:lgpl3+))) | |
374 | ||
375 | (define-public coq-bignums | |
376 | (package | |
377 | (name "coq-bignums") | |
8aeef534 | 378 | (version "8.9.0") |
33af92dd JL |
379 | (source (origin |
380 | (method url-fetch) | |
381 | (uri (string-append "https://github.com/coq/bignums/archive/V" | |
382 | version ".tar.gz")) | |
383 | (file-name (string-append name "-" version ".tar.gz")) | |
384 | (sha256 | |
385 | (base32 | |
8aeef534 | 386 | "0pmk9smw7a14wrfkvjlvmpxim4bsv6xnm5xkrlld2faqy74a044g")))) |
33af92dd JL |
387 | (build-system gnu-build-system) |
388 | (native-inputs | |
389 | `(("ocaml" ,ocaml) | |
390 | ("coq" ,coq))) | |
391 | (inputs | |
392 | `(("camlp5" ,camlp5))) | |
393 | (arguments | |
394 | `(#:tests? #f; No test target | |
395 | #:make-flags | |
396 | (list (string-append "COQLIBINSTALL=" (assoc-ref %outputs "out") | |
397 | "/lib/coq/user-contrib")) | |
398 | #:phases | |
399 | (modify-phases %standard-phases | |
400 | (delete 'configure)))) | |
401 | (home-page "https://github.com/coq/bignums") | |
402 | (synopsis "Coq library for arbitrary large numbers") | |
403 | (description "Bignums is a coq library of arbitrary large numbers. It | |
404 | provides BigN, BigZ, BigQ that used to be part of Coq standard library.") | |
405 | (license license:lgpl2.1+))) | |
406 | ||
407 | (define-public coq-interval | |
408 | (package | |
409 | (name "coq-interval") | |
0b611996 | 410 | (version "3.4.0") |
33af92dd JL |
411 | (source (origin |
412 | (method url-fetch) | |
413 | (uri (string-append "https://gforge.inria.fr/frs/download.php/" | |
0b611996 | 414 | "file/37524/interval-" version ".tar.gz")) |
33af92dd JL |
415 | (sha256 |
416 | (base32 | |
0b611996 | 417 | "023j9sd64brqvjdidqkn5m8d7a93zd9r86ggh573z9nkjm2m7vvg")))) |
33af92dd JL |
418 | (build-system gnu-build-system) |
419 | (native-inputs | |
420 | `(("ocaml" ,ocaml) | |
421 | ("which" ,which) | |
422 | ("coq" ,coq))) | |
423 | (propagated-inputs | |
424 | `(("flocq" ,coq-flocq) | |
425 | ("bignums" ,coq-bignums) | |
426 | ("coquelicot" ,coq-coquelicot) | |
427 | ("mathcomp" ,coq-mathcomp))) | |
428 | (arguments | |
429 | `(#:configure-flags | |
430 | (list (string-append "--libdir=" (assoc-ref %outputs "out") | |
431 | "/lib/coq/user-contrib/Gappa")) | |
432 | #:phases | |
433 | (modify-phases %standard-phases | |
434 | (add-before 'configure 'fix-remake | |
435 | (lambda _ | |
436 | (substitute* "remake.cpp" | |
7492af9b RW |
437 | (("/bin/sh") (which "sh"))) |
438 | #t)) | |
33af92dd | 439 | (replace 'build |
7492af9b | 440 | (lambda _ (invoke "./remake"))) |
33af92dd | 441 | (replace 'check |
7492af9b | 442 | (lambda _ (invoke "./remake" "check"))) |
33af92dd | 443 | (replace 'install |
7492af9b | 444 | (lambda _ (invoke "./remake" "install")))))) |
33af92dd JL |
445 | (home-page "http://coq-interval.gforge.inria.fr/") |
446 | (synopsis "Coq tactics to simplify inequality proofs") | |
447 | (description "Interval provides vernacular files containing tactics for | |
448 | simplifying the proofs of inequalities on expressions of real numbers for the | |
449 | Coq proof assistant.") | |
450 | (license license:cecill-c))) | |
7d60df33 DF |
451 | |
452 | (define-public coq-autosubst | |
453 | ;; Latest commit on that branch, where work on supporting coq 8.6 and | |
454 | ;; more recent versions of coq happen. | |
455 | (let ((branch "coq86-devel") | |
e03e1b55 | 456 | (commit "fa6ef30664511ffa659cbcf3c962715cbee03572")) |
7d60df33 DF |
457 | (package |
458 | (name "coq-autosubst") | |
459 | (version (git-version "1" branch commit)) | |
460 | (source (origin | |
461 | (method git-fetch) | |
462 | (uri (git-reference | |
463 | (url "git://github.com/uds-psl/autosubst.git") | |
464 | (commit commit))) | |
465 | (file-name (git-file-name name version)) | |
466 | (sha256 | |
e03e1b55 | 467 | (base32 "1cl0bp96bk6lplbl7n5c703vd3gvbs5mvf2qrf8q333kkqd7jqq4")))) |
7d60df33 DF |
468 | (build-system gnu-build-system) |
469 | (arguments | |
470 | `(#:tests? #f | |
471 | #:phases | |
472 | (modify-phases %standard-phases | |
473 | (delete 'configure) | |
474 | (replace 'install | |
475 | (lambda* (#:key outputs #:allow-other-keys) | |
476 | (setenv "COQLIB" (string-append (assoc-ref outputs "out") "/lib/coq/")) | |
477 | (invoke "make" | |
478 | (string-append "COQLIB=" (assoc-ref outputs "out") | |
479 | "/lib/coq/") | |
480 | "install")))))) | |
481 | (native-inputs | |
482 | `(("coq" ,coq))) | |
483 | (home-page "https://www.ps.uni-saarland.de/autosubst/") | |
484 | (synopsis "Coq library for parallel de Bruijn substitutions") | |
485 | (description "Formalizing syntactic theories with variable binders is | |
486 | not easy. Autosubst is a library for the Coq proof assistant to | |
487 | automate this process. Given an inductive definition of syntactic objects in | |
488 | de Bruijn representation augmented with binding annotations, Autosubst | |
489 | synthesizes the parallel substitution operation and automatically proves the | |
490 | basic lemmas about substitutions. This library contains an automation | |
491 | tactic that solves equations involving terms and substitutions. This makes the | |
492 | usage of substitution lemmas unnecessary. The tactic is based on our current | |
493 | work on a decision procedure for the equational theory of an extension of the | |
494 | sigma-calculus by Abadi et al. The library is completely written in Coq and | |
495 | uses Ltac to synthesize the substitution operation.") | |
496 | (license license:bsd-3)))) | |
ec23bae6 DF |
497 | |
498 | (define-public coq-equations | |
499 | (package | |
500 | (name "coq-equations") | |
414f545e | 501 | (version "1.2") |
ec23bae6 DF |
502 | (source (origin |
503 | (method git-fetch) | |
504 | (uri (git-reference | |
505 | (url "https://github.com/mattam82/Coq-Equations.git") | |
e03e1b55 | 506 | (commit (string-append "v" version "-8.9")))) |
ec23bae6 DF |
507 | (file-name (git-file-name name version)) |
508 | (sha256 | |
509 | (base32 | |
414f545e | 510 | "1q3wvicr43bgy7xn1diwh4j43mnrhprrc2xd22qlbz9cl6bhf8bj")))) |
ec23bae6 DF |
511 | (build-system gnu-build-system) |
512 | (native-inputs | |
513 | `(("ocaml" ,ocaml) | |
514 | ("coq" ,coq) | |
515 | ("camlp5" ,camlp5))) | |
516 | (arguments | |
517 | `(#:test-target "test-suite" | |
518 | #:phases | |
519 | (modify-phases %standard-phases | |
520 | (replace 'configure | |
521 | (lambda* (#:key outputs #:allow-other-keys) | |
522 | (invoke "coq_makefile" "-f" "_CoqProject" "-o" "Makefile"))) | |
523 | (replace 'install | |
524 | (lambda* (#:key outputs #:allow-other-keys) | |
525 | (setenv "COQLIB" (string-append (assoc-ref outputs "out") "/lib/coq/")) | |
526 | (invoke "make" | |
527 | (string-append "COQLIB=" (assoc-ref outputs "out") | |
528 | "/lib/coq/") | |
529 | "install")))))) | |
530 | (home-page "https://mattam82.github.io/Coq-Equations/") | |
531 | (synopsis "Function definition plugin for Coq") | |
532 | (description "Equations provides a notation for writing programs | |
533 | by dependent pattern-matching and (well-founded) recursion in Coq. It | |
534 | compiles everything down to eliminators for inductive types, equality | |
535 | and accessibility, providing a definitional extension to the Coq | |
536 | kernel.") | |
537 | (license license:lgpl2.1))) | |
66fbffde DF |
538 | |
539 | (define-public coq-stdpp | |
540 | (package | |
541 | (name "coq-stdpp") | |
542 | (version "1.2.0") | |
543 | (synopsis "Alternative Coq standard library std++") | |
544 | (source (origin | |
545 | (method git-fetch) | |
546 | (uri (git-reference | |
547 | (url "https://gitlab.mpi-sws.org/iris/stdpp.git") | |
548 | (commit (string-append "coq-stdpp-" version)))) | |
549 | (file-name (git-file-name name version)) | |
550 | (sha256 | |
551 | (base32 "11m7kqxsbxygk41v2wsi3npdzwin9fcnzc1gn0gq0rd57wnqk83i")))) | |
552 | (build-system gnu-build-system) | |
553 | (inputs | |
554 | `(("coq" ,coq))) | |
555 | (arguments | |
556 | `(#:tests? #f ;; the tests are being run automaticlly as part of `make all` | |
557 | #:phases | |
558 | (modify-phases %standard-phases | |
559 | (delete 'configure) | |
560 | (replace 'install | |
561 | (lambda* (#:key outputs #:allow-other-keys) | |
562 | (setenv "COQLIB" (string-append (assoc-ref outputs "out") "/lib/coq/")) | |
563 | (invoke "make" | |
564 | (string-append "COQLIB=" (assoc-ref outputs "out") | |
565 | "/lib/coq/") | |
566 | "install")))))) | |
567 | (description "This project contains an extended \"Standard Library\" for | |
568 | Coq called coq-std++. The key features are: | |
569 | @itemize | |
570 | @item Great number of definitions and lemmas for common data structures such | |
571 | as lists, finite maps, finite sets, and finite multisets. | |
572 | ||
573 | @item Type classes for common notations (like ∅, ∪, and Haskell-style monad | |
574 | notations) so that these can be overloaded for different data structures. | |
575 | ||
576 | @item It uses type classes to keep track of common properties of types, like | |
577 | it having decidable equality or being countable or finite. | |
578 | ||
579 | @item Most data structures are represented in canonical ways so that Leibniz | |
580 | equality can be used as much as possible (for example, for maps we have m1 = | |
581 | m2 iff ∀ i, m1 !! i = m2 !! i). On top of that, the library provides setoid | |
582 | instances for most types and operations. | |
583 | ||
584 | @item Various tactics for common tasks, like an ssreflect inspired done tactic | |
585 | for finishing trivial goals, a simple breadth-first solver naive_solver, an | |
586 | equality simplifier simplify_eq, a solver solve_proper for proving | |
587 | compatibility of functions with respect to relations, and a solver set_solver | |
588 | for goals involving set operations. | |
589 | ||
590 | @item The library is dependency- and axiom-free. | |
591 | @end itemize") | |
592 | (home-page "https://gitlab.mpi-sws.org/iris/stdpp") | |
593 | (license license:bsd-3))) |