Prolog Technology Reinforcement Learning Prover

Zsolt Zombori, Josef Urban, Chad E. BrownarXiv 2020

TL;DR

The plCoP toolkit introduces a compact, Prolog-based reinforcement learning framework for automated theorem proving. By combining Monte-Carlo Tree Search (MCTS) with gradient-boosted guidance and smarter training data extraction, it achieves up to a 17% performance boost over previous state-of-the-art systems like rlCoP.

What Problem Does This Paper Address?

Automated Theorem Proving (ATP) is essentially a needle-in-a-haystack search problem. In the "connection calculus" setting—a specific logical framework—provers must make a long sequence of choices. One wrong move often leads to a dead end, requiring expensive backtracking.

While Reinforcement Learning (RL) has revolutionized games like Go by helping agents navigate massive search spaces, applying it to ATP is tricky. Previous attempts (like the OCaml-based rlCoP) showed promise but were difficult to extend and had inefficiencies in how they learned from failed proof attempts. The authors of this paper sought to create a more flexible, Prolog-based toolkit that makes it easier to experiment with new logical rules and more efficient learning strategies.

Methods

The core of the system is plCoP, which stands for "Prolog Reinforcement Learning Prover." It builds on the classic, ultra-compact leanCoP prover.

Key technical components include:

  • MCTS with Guidance: Instead of simple depth-first search, plCoP uses Monte-Carlo Tree Search. It relies on two learned functions: a policy (which action looks best right now?) and a value (how likely is this state to lead to a proof?).
  • XGBoost Integration: The prover communicates with a Python-based machine learning backend using XGBoost to provide real-time guidance during the search.
  • Calculus Extensions: The authors added "rewrite steps" to handle equality more efficiently and "guided reduction steps" to give the RL agent more control over the search process.
  • Refined Training Data: Unlike previous systems that trained on every node in a search tree, plCoP implements Limited Policy Training. It only trains the policy on paths that actually led to a successful proof, arguing that training on failed attempts introduces too much noise.
  • External Verification: To ensure the ML-guided search doesn't "hallucinate" a proof, the toolkit includes leancheck, an independent proof checker that verifies the final output.

Datasets

The authors evaluated plCoP on two major benchmarks derived from the Mizar Mathematical Library:

  1. M2k: A selection of 2,003 problems that have been previously solved by other ATP systems. This dataset is often used to tune learning-guided provers.
  2. MPTP2078 (Bushy): A set of 2,078 "small" problems. This is considered a more unbiased benchmark because it includes problems regardless of whether they were easily solvable by existing saturation-style provers.

Key Insights and Ideas

  • Prolog as a Research Sandbox: The authors argue that Prolog’s symbolic nature makes it the ideal "glue" for AI research. It allows for rapid prototyping of new logical inferences (like the rewrite rule) while easily interfacing with statistical learners.
  • Quality Over Quantity in Training: A major "aha" moment was realizing that training the policy model on every search node is counterproductive. By limiting policy training to successful proof traces, the system learns much more effectively from the "sparse rewards" inherent in mathematics.
  • Redundancy is Fine with Guidance: Traditionally, adding redundant rules to a prover makes the search space explode. However, the authors found that adding a redundant rewrite rule actually helped because the RL guidance learned exactly when to use it to find shorter proofs, effectively pruning the expanded search space.

Key Results

The improvements were significant across both benchmarks. On the M2k dataset, the "combined" version of plCoP (using improved training and rewriting) solved 1,359 problems, a 96% increase over the unguided baseline and a clear step above the original rlCoP.

Table 1. Performance on the M2k dataset: original rlCoP, plCoP (baseline), plCoP with guided reduction, plCoP with limited policy training, plCoP trained using all proofsteps, plCoP using the previous two improved training plCoP with rewriting and plCoP with rewriting and improved training combined. incr shows the perfor- mance increase in percentages from iteration 0 (unguided) to the best result.

On the MPTP2078 bushy dataset, plCoP also outperformed rlCoP, solving 782 problems compared to rlCoP's 733.

Table 2. Performance on the MPTP2078 bushy dataset: original rlCoP, baseline plCoP, plCoP using improved training and combined plCoP. incr shows the per- formance increase in percentages from iteration 0 (unguided) to the best result.

Notably, when given more iterations to learn, plCoP's advantage grew, eventually solving 17.4% more problems than rlCoP on the M2k dataset within 20 iterations.

Limitations and Future Work

While plCoP is highly effective, it currently relies on manually engineered features (like "term walks") to describe the logical states to the machine learner. The authors suggest that moving toward Neural Learners, such as Graph Neural Networks (GNNs), could allow the system to learn its own representations of logic.

Additionally, they plan to explore Inductive Logic Programming (ILP). The goal is to have the system not just learn how to use existing rules, but to actually "invent" new, complex tactics (written as Prolog programs) based on successful proof traces it has discovered.

Summary updated

BibTeX
@misc{zombori2020prolog,
  author = {Zsolt Zombori and Josef Urban and Chad E. Brown},
  title = {{Prolog Technology Reinforcement Learning Prover}},
  year = {2020},
  eprint = {2004.06997},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2004.06997},
}
Figure