HOList: An Environment for Machine Learning of Higher-Order Theorem Proving (extended version)

Kshitij Bansal, Sarah M. Loos, Markus N. Rabe, Christian Szegedy, Stewart WilcoxarXiv 2019

Abstract

HOList is an open-source environment designed to facilitate machine learning research in higher-order theorem proving. By wrapping the HOL Light theorem prover with a high-performance Python API and providing a benchmark of approximately 30,000 theorems, HOList enables the application of deep reinforcement learning to formal logic. We present DeepHOL, a neural prover that employs a two-tower architecture to select tactics and theorem arguments. Our results demonstrate that reinforcement learning significantly improves upon supervised learning baselines, achieving a 38.9% success rate on a challenging calculus benchmark.

1. Introduction

Automated theorem proving (ATP) represents a grand challenge for artificial intelligence, requiring high-level reasoning and an understanding of abstract structures. Historically, the field has been fragmented by differing logical foundations, hindering the creation of a unified benchmark for mathematical reasoning. Furthermore, Interactive Theorem Provers (ITPs) like HOL Light, while powerful, present significant barriers to machine learning researchers due to their reliance on specialized languages like OCaml and slow startup times. HOList addresses these challenges by providing a standardized, high-performance environment for reinforcement learning (RL) agents to interact with formal logic.

2. The HOList Environment

HOList bridges the gap between formal logic and machine learning by wrapping the HOL Light theorem prover in a stable Python API. This allows researchers to interact with the prover without specialized knowledge of OCaml. A key technical achievement of the environment is the reduction of mathematical library load times from 20 minutes to mere seconds, a critical improvement for scaling reinforcement learning experiments. This high-performance interface allows RL agents to interact with the formal logic system as efficiently as they would with a physics engine in traditional RL tasks.

3. DeepHOL Architecture

The DeepHOL prover utilizes a "two-tower" neural architecture designed to process mathematical goals and potential premises. One tower, the Goal Encoder (G), employs a WaveNet-style architecture to embed the current mathematical goal. The second tower, the Premise Encoder (P), processes potential premises from previously proven theorems. These embeddings are then utilized by the Tactic Classifier (S) to predict the appropriate high-level command (e.g., "simplify" or "induct") and by the Theorem Scorer (R) to select theorem arguments via a Combiner Network (C).

The DeepHOL architecture featuring goal and premise encoders feeding into a tactic classifier and theorem scorer.

4. Datasets and Benchmarks

The paper introduces a massive benchmark divided into three corpora: Core (foundational theorems), Complex (complex calculus), and Flyspeck (the formalization of the Kepler conjecture proof). In total, the benchmark contains 2,200 definitions and 29,462 theorems, providing over a million proof states for training and evaluation. This scale provides the necessary data for deep learning models to learn complex reasoning patterns.

5. Results and Evaluation

Evaluation on the "complex" calculus benchmark reveals significant performance gains from the reinforcement learning approach. Traditional automated provers, such as ASM_MESON_TAC, achieved a success rate of only 6.1%. Supervised learning models trained to imitate human proof logs reached approximately 32% success. The full reinforcement learning system, DeepHOL (referred to as "Loop tactic dependent" in the results), achieved a state-of-the-art success rate of 38.9%.

Comparison of proof success rates across different models and baselines on the complex calculus benchmark.

DeepHOL also demonstrated strong generalization capabilities. On a sample of the difficult Flyspeck dataset, the system automatically closed 37% of the proofs, showing that it can handle sophisticated mathematics beyond its primary training set.

6. Discussion: Key Innovations

Two key innovations contributed to the success of DeepHOL:

  • Subgoal Sharing: By sharing nodes in a search graph, the prover identifies identical mathematical goals reached through different paths, preventing it from getting stuck in infinite loops.
  • Proof Pruning: Human proofs often contain superfluous steps. The authors implemented a pruning step that greedily removes unnecessary arguments, resulting in cleaner, higher-quality training data for the RL agent.

7. Conclusion and Future Work

HOList and DeepHOL represent a significant step toward "Auto-formalization"—the goal of AI systems that can automatically verify mathematical correctness. However, limitations remain. Currently, DeepHOL only predicts theorems as arguments and cannot generate arbitrary mathematical terms from scratch. Additionally, the reinforcement learning loop is computationally expensive, and the model's current handling of hypotheses could be improved to capture more context. Future work will focus on these areas to further enhance the reasoning capabilities of neural provers.

Summary updated

BibTeX
@misc{bansal2019holist,
  author = {Kshitij Bansal and Sarah M. Loos and Markus N. Rabe and Christian Szegedy and Stewart Wilcox},
  title = {{HOList: An Environment for Machine Learning of Higher-Order Theorem Proving (extended version)}},
  year = {2019},
  eprint = {1904.03241},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1904.03241},
}
Figure