# HOL4

> A proof assistant for higher-order logic in the LCF tradition, written in Standard ML; the prover behind the CakeML verified compiler.

It can call external tools (SMT, SAT, BDD) whose results are tagged as oracles, so a theorem records whether it relied on one.

- Kind: proof-assistant
- Logic: Higher-order logic (simple type theory with polymorphic types)
- Checker level: Strong (green)
- Licence: open-source, BSD-3-Clause (modified; HOL4 licence)
- Latest release: trindemossen-2 (2025-08-12) https://github.com/HOL-Theorem-Prover/HOL/releases/tag/trindemossen-2
- Latest commit: 2026-11-26 https://github.com/HOL-Theorem-Prover/HOL/commits/develop

## Trust card

- Kernel: LCF-style kernel in Standard ML (src/thm): theorems are an abstract type built only by primitive inference rules. There is a standard kernel and an OpenTheory-logging variant (otknl). The kernel also includes Thm.compute, a built-in evaluator for fast computation, where several 2026 bugs were found. Theorems that depend on oracles or `cheat` carry tags. No published line count found. ([source](https://github.com/HOL-Theorem-Prover/HOL/tree/develop/src/thm))
- Independent checkers: [Candle (HOL4 proof traces)](https://github.com/HOL-Theorem-Prover/HOL/pull/2171) (Since November 2026, HOL4 can convert a theory's proof dump into portable proof traces that the verified Candle prover replays. New; coverage limits are documented in the converter's README.); [Verified OpenTheory article checker (CakeML)](https://github.com/CakeML/cakeml/tree/master/examples/opentheory) (Checks OpenTheory articles on top of the verified Candle kernel; HOL4 can write such articles.)
- Axioms: Four axioms in boolScript.sml: BOOL_CASES_AX (excluded middle), ETA_AX (extensionality), SELECT_AX (Hilbert choice) and INFINITY_AX. Users can add axioms; `cheat` and oracles add tags that stay on every theorem derived from them. ([source](https://github.com/HOL-Theorem-Prover/HOL/blob/develop/src/bool/boolScript.sml))
- Certificates: Not by default. Builds with the OpenTheory kernel (--otknl) write OpenTheory articles, and since November 2026 theories can be exported as proof traces for replay in Candle. ([source](https://github.com/HOL-Theorem-Prover/HOL/tree/develop/src/opentheory))
- Soundness reports: https://github.com/HOL-Theorem-Prover/HOL/issues

## Soundness issues (notable, recent first)
- 2026-10: [prim_type_definition could be exploited under a snapshotted context to prove False](https://github.com/HOL-Theorem-Prover/HOL/issues/2079) — fixed
- 2026-07: [Thm.compute did not check polymorphic type instances, giving a proof of False with no hypotheses, tags or oracles](https://github.com/HOL-Theorem-Prover/HOL/issues/2029) — fixed. A follow-up variant (issue 2030) was also fixed.
- 2026-07: [dest_eq did not check the identity of the equality constant](https://github.com/HOL-Theorem-Prover/HOL/issues/2026) — fixed. The exploit replaces the signature entry for "=" from ML code.
- 2026-03: [Soundness bug in Thm.compute's handling of mod](https://github.com/HOL-Theorem-Prover/HOL/issues/1838) — fixed
- 2026-03: [Theorems can be forged with Poly/ML's unsafe cast, without any tag showing it](https://github.com/HOL-Theorem-Prover/HOL/issues/1841) — not fixed. Open. A property of running the kernel inside an ML system with unsafe primitives, not a flaw in an inference rule.

---
Last checked 2026-11-26. Data: [JSON](/provers/hol4.json) · Page: [HTML](/provers/hol4/) · Methodology v0.1: [/methodology/](/methodology/) · Corrections: [/contribute/](/contribute/)
