You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This project provides a tool, hol2dk, to translate [HOL-Light](https://github.com/jrh13/hol-light) proofs to [Dedukti](https://github.com/Deducteam/Dedukti/), [Lambdapi](https://github.com/Deducteam/lambdapi) and [Coq](https://coq.inria.fr/).
4
+
This project provides a tool, hol2dk, to translate [HOL-Light](https://github.com/jrh13/hol-light) proofs to [Dedukti](https://github.com/Deducteam/Dedukti/), [Lambdapi](https://github.com/Deducteam/lambdapi) and [Rocq](https://rocq-prover.org/).
5
5
6
6
[HOL-Light](https://github.com/jrh13/hol-light) is a proof assistant
7
7
based on higher-order logic, aka simple type theory.
@@ -15,78 +15,55 @@ rewriting rules).
15
15
based on the λΠ-calculus modulo rewriting that can read and generate
16
16
Dedukti proofs.
17
17
18
-
[Coq](https://coq.inria.fr/) is a proof assistant based on the
18
+
[Rocq](https://rocq-prover.org/) is a proof assistant based on the
19
19
Calculus of Inductive Constructions.
20
20
21
-
Usability of translated libraries
22
-
---------------------------------
21
+
Examples:
22
+
---------
23
23
24
-
For the obtained theorems to be readily usable in Coq, we need to
25
-
align the type and functions of HOL-Light with those used in the Coq
26
-
standard library. We already did this for various types and functions
27
-
(see [With_N.lp](https://github.com/Deducteam/hol2dk/blob/main/With_N.lp)):
28
-
29
-
- types: unit, prod, list, option, sum, ascii, N, R, Z
30
-
- functions on N: pred, add, mul, pow, le, lt, ge, gt, max, min, sub, div, modulo
31
-
- functions on list: app, rev, map, removelast, In, hd, tl
integration, measure theory, complex numbers and analysis,
32
+
transcendental numbers, real analysis, complex line integrals,
33
+
etc. The resulting Rocq theorems are provided in the Opam package
34
+
[coq-hol-light](https://github.com/Deducteam/coq-hol-light). Various
35
+
HOL-Light types and functions have been mapped to the corresponding
36
+
types and functions of the Rocq standard library so that, for
37
+
instance, a HOL-Light theorem on HOL-Light real numbers is translated
38
+
to a Rocq theorem on Rocq real numbers. The provided theorems can
39
+
therefore be readily used within other Rocq developments based on the
40
+
Rocq standard library.
67
41
68
42
Bibliography
69
43
------------
70
44
71
-
-[Translating HOL-Light proofs to Coq](https://files.inria.fr/blanqui/lpar24.pdf), Frédéric Blanqui, 4 April 2024
45
+
-[Translating HOL-Light proofs to Coq](https://doi.org/10.29007/6k4x), Frédéric Blanqui, 25th International Conference on Logic for Programming, Artificial Intelligence and Reasoning (LPAR), 2024.
46
+
47
+
Dependencies
48
+
------------
49
+
50
+
- ocaml >= 4.13
51
+
- hol_light >= 3.0.0
52
+
- lambdapi >= 3.0.0
53
+
- rocq >= 9.0
72
54
73
55
Installing HOL-Light sources
74
56
----------------------------
75
57
76
-
**Requirement:** hol_light >= 3.0.0
77
-
78
58
```
59
+
opam install -y --deps-only hol_light.3.0.0
79
60
git clone https://github.com/jrh13/hol-light
80
61
make -C hol-light
81
62
```
82
63
83
64
Installing hol2dk
84
65
-----------------
85
66
86
-
**Requirements:**
87
-
- ocaml >= 4.13
88
-
- dune >= 3.7
89
-
90
67
hol2dk is available on [Opam](https://opam.ocaml.org/). To install it, simply do:
91
68
```
92
69
opam install hol2dk
@@ -187,16 +164,8 @@ The command `purge` compute in `file.use` all the theorems that do not need to b
187
164
188
165
The command `simp` is the sequential composition of `rewrite` and `purge`.
For instance, to translate the Multivariate library using the Coq type N for natural numbers, we use [CONFIG](https://github.com/Deducteam/coq-hol-light/blob/main/CONFIG).
214
-
215
182
- You can then do in order:
216
183
*`make` to get the list of targets and variables
217
184
*`make split` to generate a file for each theorem
218
185
*`make -j$jobs lp` to translate HOL-Light proofs to Lambdapi
219
186
*`make -j$jobs lpo` to check Lambdapi files (optional)
220
-
*`make -j$jobs v` to translate Lambdapi files to Coq files
187
+
*`make -j$jobs v` to translate Lambdapi files to Rocq files
221
188
*`make -j$jobs spec` to merge all small spec files into a single one
222
189
*`make -j$jobs rm-empty-deps` to remove `theory_hol.v`, `${base}_types.v` and `${base}_axioms.v` (to use when these files are empty only)
223
-
*`make -j$jobs vo` to check Coq files
190
+
*`make -j$jobs vo` to check Rocq files
224
191
225
192
To speed up lp file generation for some theorems with very big proofs, you can write in a file named `BIG_FILES` a list of theorem names (lines starting with `#` are ignored). See for instance [BIG_FILES](https://github.com/Deducteam/hol2dk/blob/main/BIG_FILES). You can also change the default values of the options `--max-proof-size` and `--max-abbrev-size` as follows:
**Remark:** for the checking of generated Coq files to not fail because of lack of RAM, we generate for each theorem `${thm}.lp` one or several files for its proof, and a file `${thm}_spec.lp` declaring this theorem as an axiom. Moreover, each other theorem proof using `${thm}` requires `${thm}_spec` instead of `${thm}`.
195
+
**Remark:** for the checking of generated Rocq files to not fail because of lack of RAM, we generate for each theorem `${thm}.lp` one or several files for its proof, and a file `${thm}_spec.lp` declaring this theorem as an axiom. Moreover, each other theorem proof using `${thm}` requires `${thm}_spec` instead of `${thm}`.
0 commit comments