Guiding Theorem Proving by Recurrent Neural Networks

Bartosz Piotrowski, Josef Urban

Abstract

We present a dataset and experiments on applying recurrent neural networks (RNNs) for guiding clause selection in the connection tableau proof calculus. The RNN encodes a sequence of literals from the current branch of the partial proof tree to a hidden vector state; using it, the system selects a clause for extending the proof tree. The training data and learning setup are described, and the results are discussed and compared with state of the art using gradient boosted trees. Additionally, we perform a conjecturing experiment in which the RNN does not just select an existing clause, but completely constructs the next tableau goal.

Introduction: The Search for Mathematical Truth

Automated Theorem Proving (ATP) is fundamentally a search problem within a vast space of logical possibilities. In the connection tableau calculus, a prover demonstrates the unsatisfiability of a set of statements by constructing a tree. At each node, the prover must select a clause—a logical rule—to extend the current branch.

An example of connection tableau proof calculus, showing how clauses are used to extend the proof tree.

The primary challenge is non-determinism. With numerous clauses available at any step, poor choices lead to exponential search explosions and frequent backtracking. Traditionally, "internal guidance" for these choices relied on manual heuristics or "bag-of-features" machine learning models that failed to account for the sequential nature of the proof state. This research investigates whether deep learning, specifically Recurrent Neural Networks (RNNs), can better capture the "hidden proving state" to provide more effective guidance.

Methodology: Proofs as Sequences

The researchers framed clause selection as a sequence-to-sequence (Seq2Seq) task, employing a standard Neural Machine Translation (NMT) architecture with attention. The model was trained on data from the Mizar Mathematical Library (MML), utilizing over 567,000 training pairs derived from proofs generated by the leanCoP prover.

Two primary input representations were tested:

  1. Literal Paths ($P_{lits}$): The sequence of logical statements from the root to the current node.
  2. Clause Paths ($P_{cls}$): The sequence of previously selected clause identifiers.

Beyond simple selection, the authors conducted a "conjecturing" experiment where the RNN was tasked with generating the next literal string character-by-character, rather than choosing from a predefined list. The performance was compared against XGBoost, a state-of-the-art gradient-boosted tree system using hand-engineered features.

Key Results and Analysis

The experiments revealed that treating a proof path as a linguistic sequence provides superior guidance compared to traditional methods.

The Advantage of Contextual Depth

A standout finding was the relationship between proof length and model accuracy. While traditional models like XGBoost often plateau or struggle as complexity increases, the NMT model's performance improved with path length.

Accuracy comparison between NMT and XGBoost across different proof path lengths.

As shown in the data, XGBoost initially outperforms NMT at the very start of a proof (length 1). However, as the path grows, the RNN leverages the increasing context. By path length 8, NMT achieves 85% accuracy, nearly doubling the performance of the XGBoost baseline (46%).

Literals vs. Clauses

The model performed significantly better when provided with the actual semantic content of the proof (literals) rather than just a history of rule applications (clauses). Using literal paths, the NMT model achieved a top-1 accuracy of 64%, which rose to 72% when considering the top-10 predictions.

Generative Conjecturing

The conjecturing task demonstrated that RNNs can learn the underlying "grammar" of logic. Although challenging, the model successfully generated the exact correct literal 8% of the time overall, with accuracy reaching 34% for paths of length 7. Even when incorrect, the outputs were often syntactically plausible, a capability beyond the reach of standard classification models.

Conclusion and Future Directions

This work demonstrates that RNNs are highly effective at capturing the sequential context of mathematical proofs. The ability of these models to scale with proof length suggests they are well-suited for complex reasoning tasks.

Future research will focus on "online" integration—embedding these neural models directly into active provers like leanCoP to solve previously unprovable theorems in real-time. Additionally, addressing "hallucinations" in generative tasks remains a key challenge for creating robust, autonomous mathematical reasoning systems.

Summary updated

Abstract

We present a dataset and experiments on applying recurrent neural networks (RNNs) for guiding clause selection in the connection tableau proof calculus. The RNN encodes a sequence of literals from the current branch of the partial proof tree to a hidden vector state; using it, the system selects a clause for extending the proof tree. The training data and learning setup are described, and the results are discussed and compared with state of the art using gradient boosted trees. Additionally, we perform a conjecturing experiment in which the RNN does not just select an existing clause, but completely constructs the next tableau goal.
BibTeX
@inproceedings{piotrowski2020guiding,
  author = {Bartosz Piotrowski and Josef Urban},
  title = {{Guiding Theorem Proving by Recurrent Neural Networks}},
  booktitle = {CICM},
  year = {2020},
  url = {https://openreview.net/forum?id=3_WIgZ6s-xa},
}
Figure