HOLTrace: Verify

The recommended tools for verifying HOLTrace files are holtrace_restore and its variants. You can also compile holtrace_restore for extra speed. There are also some experimental tools, examples of traces, and examples of timings.

holtrace_restore is a command available in a new HOL Light session after HOLTrace is installed. Running

holtrace_restore !theorems "holtrace-12345.50";;

will read and verify a trace file holtrace-12345.50. Verification checks the following:

The holtrace_typedef_thms() list is not in the kernel; it is a separate list maintained by HOLTrace, whether or not traces are being saved in this session. The !theorems list is also outside the kernel but is built into HOL Light.

Verification remembers named theorems from the trace (whether or not those are listed in !theorems), and you can inspect those theorems:

holtrace_restore_name2thm "ONE_OR_PRIME";;

The theorems are erased by the next holtrace_restore run.

Variants

There is a holtrace_restore_allownew variant that will instead add any new axioms, add any new constant definitions (failing if the constant name is used already), and add any new type definitions (again failing on collisions).

With more work to add bindings for new names and any related syntax, it should be possible to use holtrace_restore and holtrace_restore_allownew to build a faster replacement for the normal loading of hol.ml or of other HOL Light libraries. There is also an even faster variant holtrace_restore_skipthmchecks that should be suitable in this context: this variant skips checking whether the theorems match the theorem statements in the trace, but still runs all of the same inferences through the HOL Light kernel.

Compilation

The following steps produce a self-contained restore binary that, given the name of a trace file, prints out the results of loading HOL Light and running holtrace_restore_allownew [] on that trace. The filename is specified by the HOLTRACE_RESTORE environment variable. This binary is still using the HOL Light kernel, but with the OCaml compiler instead of the OCaml interpreter.

First, after HOLTrace's ./install, modify the HOL Light installation to include a compiled HOL Light module:

( cd `hol.sh -dir`; HOLLIGHT_USE_MODULE=1 make )

Second, in another directory, create a file restore.ml with the following lines:

open Hol_lib;;
open Hol_loader;;
holtrace_restore_allownew [] (try Sys.getenv "HOLTRACE_RESTORE" with Not_found -> "restore.50");;

Third, compile restore.ml into restore:

ocamlfind ocamlopt -package zarith \
  -linkpkg -pp "`hol.sh -pp`" -I `hol.sh -dir` \
  bignum.cmx hol_loader.cmx hol_lib.cmx \
  restore.ml -o restore

Example of using restore:

wget https://holtrace.cr.yp.to/hull_light.50.zst
unzstd hull_light.50.zst
env HOLTRACE_RESTORE=hull_light.50 ./restore > hull_light.restore

You can then check the theorems printed in hull_light.restore, such as the following, an example of a theorem proven via a large computation:

thm endtoend_simple concise:
|- forall i f g M m.
       i 0 = &0
       ==> &0 < M
       ==> &0 <= g 0
       ==> g 0 <= f 0
       ==> f 0 <= M
       ==> (forall n.
                i (n + 1) = &1 + i n /\
                f (n + 1) = f n /\
                g (n + 1) = g n / &2 \/
                (if i n < &0
                 then i (n + 1) = &1 + i n /\
                      f (n + 1) = f n /\
                      g (n + 1) = (g n + f n) / &2
                 else i (n + 1) = --i n /\
                      f (n + 1) = g n /\
                      g (n + 1) = (g n - f n) / &2))
       ==> (forall n. integer (f n))
       ==> (forall n. integer (g n))
       ==> M * divsteps_s pow m <= &8388391 / &8388608
       ==> (exists n. n <= m /\ g n = &0)

The meaning of this theorem depends on earlier definitions listed in hull_light.restore, including

constant divsteps_s concise:
|- divsteps_s = &30902639 / &41749730

and various standard definitions and axioms.

Experimental tools

This package includes two experimental command-line tools for verifying traces. First, holtrace-verify-simple tries to verify traces in essentially the same way that the HOL Light kernel does. Beware that this tool is likely to have soundness bugs that let it accept false theorems: the tool has had vastly less review than the HOL Light kernel.

Second, holtrace-verify tries to verify traces and is more efficient than the HOL Light kernel. Beware that this tool is even more likely than holtrace-verify-simple to have soundness bugs that let it accept false theorems: the tool has had vastly less review than the HOL Light kernel and is more complicated than holtrace-verify-simple. Furthermore, unlike holtrace-verify-simple, this tool currently does not check whether a name refers to multiple theorems.

holtrace-verify is written in C and is not necessarily safe to run on untrusted input. A VM is recommended. holtrace-verify-simple is written in Python.

Outside this package, https://github.com/hol-light-family/HolLean includes a HOLTrace reader. To check a trace file hol_lib.50 on a system with elan installed, run lake exe holtrace hol_lib.50 in the HolLean directory; the first run will automatically build HolLean.

Examples of traces

The following pruned traces are hosted on https://holtrace.cr.yp.to:

Examples of timings

These timings are single measurements on rome1. The time for unzstd to decompress zst files is negligible (e.g., under 20 seconds to decompress poincare.50.zst) and is not included below.

For prime.50:

For hol_lib.50:

For hull_light.50:

For poincare.50:


Version: This is version 2026.11.22 of the "Verify" web page.