-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support native compilation of HOL Light, add unit tests
This patch adds support for native compilation of HOL Light. If `HOLLIGHT_USE_MODULE` is set to 1, `make` inlines loads in hol_lib.ml and compiles into hol_lib.cmx and hol_lib.cmxa. The stack overflow error is a hurdle when compiling the code using `ocamlopt`. To avoid this error, `make` uses `ocamlopt.byte` which is a bytecode version of `ocamlopt` and distributed by the current OPAM switch. Combined with `OCAMLRUNPARAM=l=<some large number>` which sets the maximum stack size for OCaml bytecode runners, this successfully compiles hol_lib. However, it could not still compile a significantly large project such as Multivariate. One possible approach is to chop the inlined .ml file into multiple smaller .ml files and compile each of them, but this makes the inliner script complicated which could be a concern... This patch also adds unit_tests.ml, and when `HOLLIGHT_USE_MODULE` is set, compiles it into a bytecode and native executable. It currently contains simple checks of the verbose quantifiers and constants, but it can contain more interesting sanity checks in the future. The CI check is also updated to make with `HOLLIGHT_USE_MODULE` set to 1 and run the unit tests. OCaml 4.05 CI check had been broken, and this is fixed too.
- Loading branch information
1 parent
4563ae5
commit f566904
Showing
8 changed files
with
125 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,18 @@ | ||
.DS_Store | ||
.vscode | ||
_opam | ||
*.a | ||
*.cma | ||
*.cmi | ||
*.cmo | ||
*.o | ||
*.cmx | ||
*.cmxa | ||
pa_j.ml | ||
update_database.ml | ||
ocaml-hol | ||
hol.sh | ||
hol_lib_inlined.ml | ||
unit_tests_inlined.ml | ||
unit_tests.byte | ||
unit_tests.native |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
(* ========================================================================= *) | ||
(* HOL LIGHT unit tests *) | ||
(* ========================================================================= *) | ||
|
||
(* ------------------------------------------------------------------------- *) | ||
(* Test verbose descriptive names for quantifiers/logical consts. *) | ||
(* ------------------------------------------------------------------------- *) | ||
|
||
assert (`T` = `true`);; | ||
assert (`F` = `false`);; | ||
assert (`!(x:A). P x` = `forall (x:A). P x`);; | ||
assert (`?(x:A). P x` = `exists (x:A). P x`);; | ||
assert (`?!(x:A). P x` = `existsunique (x:A). P x`);; |