Introduction
Automated Theorem Provers (ATPs) are critical components in software verification, formal mathematics, and hardware design. Proving a theorem involves navigating a vast search space of logical deductions to find a valid proof. Traditionally, ATPs have relied on hand-crafted heuristics to guide this search. However, these heuristics are often brittle and difficult to adapt to new mathematical domains.
Recent efforts to automate proof guidance using machine learning have often relied on imitation learning from existing solvers. This approach limits the AI to the strategies and biases of its human-coded predecessors. This paper introduces TRAIL (Trial Reasoner for AI that Learns), a system designed for tabula rasa learning. TRAIL learns to become a proficient logic reasoner entirely from scratch through trial and error using deep reinforcement learning.
The TRAIL Framework
TRAIL operates within a saturation-based theorem proving environment. In this setting, the prover maintains a set of "processed" clauses and a set of "unprocessed" clauses. The core challenge is selecting the most promising unprocessed clause to move into the processed set, thereby generating new logical consequences. The learning process follows a reinforcement learning loop where the system attempts proofs, receives rewards based on success and efficiency, and updates its policy. This allows TRAIL to develop strategies without any initial human-provided examples.
Methodology and Innovations
The authors propose three primary innovations to enable effective learning in the complex domain of first-order logic:
- Chain-Based Vectorization: To represent logical formulas for a neural network, TRAIL utilizes a novel "chain-based" approach. It deconstructs formulas into linear paths (chains) from predicates to constants or variables. This method captures structural information more efficiently than computationally expensive Graph Neural Networks (GNNs), allowing for faster search steps.
- Neural Proof State: The system represents the proof state by considering both available actions and the set of already processed clauses, providing a comprehensive context for decision-making.
- Attention-Based Policy: A key insight of the paper is the importance of context. TRAIL employs an attention mechanism to compute interaction scores between available actions and the processed clause set. This allows the model to "attend" to relevant lemmas and previous deductions when choosing the next step.
Experimental Evaluation
TRAIL was evaluated on two benchmarks from the Mizar library: M2k (2,003 problems) and MPTP2078 (2,078 harder problems). The system demonstrated significant improvements over previous reinforcement learning approaches:
- Performance: TRAIL solved approximately 15% more theorems than state-of-the-art RL provers like plCop and rlCop. On the MPTP2078 dataset, it solved 910 problems, compared to 782 by its closest RL competitor.
- Comparison with Traditional Solvers: TRAIL outperformed Beagle, a well-established traditional saturation-based prover, on both datasets.
- Generalization: The system showed strong generalization capabilities, maintaining high performance when transferred between different datasets, suggesting it learns fundamental reasoning principles.
Conclusion and Future Work
TRAIL represents a significant step forward in tabula rasa learning for automated theorem proving. By combining efficient chain-based features with a powerful attention-based policy, it achieves state-of-the-art performance among RL-based provers. While it currently lags behind highly optimized traditional solvers like E-prover due to neural inference overhead, future work will focus on more efficient architectures and extending the approach to higher-order logics.
Summary updated