Running ./holtrace-prune < oldtrace.50 > newtrace.50 converts an existing HOLTrace file into a new HOLTrace file that focuses on proving the same named theorems. Traces directly from HOL Light normally include some automatically generated proofs that did not end up being used for the named theorems, so pruning saves space. Pruning also speeds up subsequent trace processing. For example, starting with the 82MB trace of `hol.ml` from [`holtrace-save`](save.html), `holtrace-prune` produces a pruned trace occupying 37.5MB (`gzip -9` reduces this to 10.4MB, and `zstd -19` reduces it to 7.3MB). This tool is idempotent: given the 37.5MB pruned HOLTrace file as input, `holtrace-prune` generates an identical file as output. This tool lets you provide one or more theorem names as command-line arguments. The resulting trace then focuses on proving those theorems (although the tool will preserve names for any lemmas relevant to those theorems). For example, given the 37.5MB pruned trace for `hol.ml`, `holtrace-prune ONE_OR_PRIME` generates 2.4MB as output (`gzip -9` reduces this to 0.72MB). `holtrace-prune` is written in C and is not necessarily safe to run on untrusted input. A VM is recommended. There is also a simpler `holtrace-prune-simple` written in Python. ## Timings {#timings} The following timings are on [`rome1`](install.html) using `Python 3.11.11 (7.3.19+dfsg-2, Apr 11 2025, 02:57:20) [PyPy 7.3.19 with GCC 14.2.0]`. Starting with the 82MB trace of `hol.ml` from [`holtrace-save`](save.html), `holtrace-prune-simple` takes 42.39 seconds (`40.20user 2.17system 0:42.39elapsed 99%CPU (0avgtext+0avgdata 2904596maxresident)k`) while `holtrace-prune` takes 2.33 seconds (`2.13user 0.20system 0:02.33elapsed 100%CPU (0avgtext+0avgdata 224644maxresident)k`). Starting with the 37.5MB pruned trace, `holtrace-prune-simple ONE_OR_PRIME` takes 14.87 seconds (`13.83user 1.02system 0:14.87elapsed 99%CPU (0avgtext+0avgdata 1376552maxresident)k`) while `holtrace-prune ONE_OR_PRIME` takes 0.50 seconds (`0.43user 0.06system 0:00.50elapsed 99%CPU (0avgtext+0avgdata 93736maxresident)k`). An idempotent re-pruning of the 37.5MB pruned trace takes 30.27 seconds with `holtrace-prune-simple` (`28.96user 1.28system 0:30.27elapsed 99%CPU (0avgtext+0avgdata 1432828maxresident)k`) and 1.76 seconds with `holtrace-prune` (`1.68user 0.07system 0:01.76elapsed 99%CPU (0avgtext+0avgdata 92616maxresident)k`). As a larger example, pruning 15912714967 bytes (16GB) down to 5904547982 bytes (6GB) for `poincare.50` takes 20 hours with `holtrace-prune-simple` (`67551.34user 4616.66system 20:04:34elapsed 99%CPU (0avgtext+0avgdata 442957080maxresident)k`) and under 10 minutes with `holtrace-prune` (`532.08user 24.14system 9:16.62elapsed 99%CPU (0avgtext+0avgdata 38687556maxresident)k`).