Second-Order Matching modulo Evaluation: A Technique for Reusing Proofs

Thomas Kolbe, Christoph Walther

Abstract

Automated Theorem Proving (ATP) systems frequently struggle with redundancy, often re-proving structurally similar theorems from scratch. This paper presents a method for proof reuse that generalizes successful proofs into "proof shells." By employing second-order matching modulo evaluation, the system can adapt these shells to new conjectures, effectively transferring logical structures across different mathematical domains. The approach is implemented in the PLAGIATOR system and demonstrates the ability to speculate necessary lemmas during the reuse process.

Introduction

A persistent challenge in Automated Theorem Proving is the "reinvention of the wheel." A system that has proved a property about addition (e.g., commutativity) typically lacks the inherent flexibility to apply that same logic to multiplication or list concatenation without manual intervention. Standard first-order matching—simple variable substitution—is insufficient for mapping the underlying logic of one proof onto another when function names, argument counts, or definitions differ. This research introduces a mechanism to bridge this gap by capturing the abstract structure of a proof.

Methodology

The authors propose a four-step process for proof reuse centered on abstraction and flexible matching:

  1. Generalization (The Proof Shell): Upon completing a proof, the system extracts a "proof shell." This consists of a schematic conjecture (the theorem with specific function symbols replaced by variables) and a proof catch (the set of schematic axioms required for the proof to hold).
  2. Second-Order Matching: When presented with a new conjecture, the system attempts to match it against known schematic conjectures. Unlike first-order matching, second-order matching allows for the substitution of entire function definitions into variables.
  3. Modulo Evaluation: The core innovation is interleaving the matching process with symbolic evaluation. Pure syntactic matching often fails because functions are defined differently across domains. By simplifying terms using known definitions during the matching process, the system can identify equivalences that are not syntactically obvious.
  4. The solve_catch Algorithm: This recursive heuristic search attempts to find valid substitutions for all function variables in the "catch." If successful, the original proof is "replayed" for the new problem.

Evaluation and Results

The method was evaluated using the PLAGIATOR system on a suite of inductive problems in Peano arithmetic and functional programming, including properties of arithmetic operations (sum, product, exponentiation) and list operations (length, append, reverse).

Table 1: Examples of successful proof reuses and their corresponding schematic conjectures.

As shown in the table above, the system successfully maps various concrete conjectures ($\psi_i$) to a single schematic form ($\Phi$). For instance, a proof for the relationship between sum and append can be automatically adapted to prove similar properties for length or product. A significant feature of this approach is lemma speculation: if a reuse attempt requires a specific property (like associativity) to be true, the system can identify this requirement as a "proof obligation" and attempt to verify it independently.

Discussion and Limitations

While the technique demonstrates significant power in capturing the "logic of the argument," several challenges remain:

  • The Selection Problem: The current framework assumes the system knows which prior proof to attempt to reuse. In large libraries, identifying the correct "shell" remains a significant search problem.
  • Undecidability: Second-order matching is generally undecidable. While the authors' heuristics are effective for many inductive proofs, there is no guarantee of termination or success in all cases.
  • Heuristic Dependency: The efficiency of the solve_catch algorithm is highly dependent on specific heuristics, such as prioritizing the most complex equations, which may require tuning for different mathematical domains.

Summary updated

BibTeX
@inproceedings{kolbe1995second,
  author = {Thomas Kolbe and Christoph Walther},
  title = {{Second-Order Matching modulo Evaluation: A Technique for Reusing Proofs}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {1995},
}
Figure