In 1977, Robert S. Boyer and J Strother Moore published a seminal paper that redefined the landscape of formal methods. Their work introduced a theorem prover capable of "learning" from previously established results, moving away from rigid, fully automated "black box" systems toward a more flexible, "lemma-driven" architecture. This approach proved essential for tackling the complexities of software verification, particularly in the context of recursive functions.
The Challenge of Recursion
During the 1970s, the "software crisis" highlighted the urgent need for reliable program verification. However, existing theorem provers struggled with recursion. Proving properties of recursive programs requires mathematical induction, which involves choosing the correct induction scheme—deciding which variable to induct on and defining the base case versus the inductive step. This task is notoriously difficult to automate. Earlier systems were either restricted to simple primitive recursion or required significant manual intervention. Boyer and Moore aimed to create a system that was entirely automatic once a goal was set, yet extensible through a library of user-provided lemmas.
Methodology: The Heuristic Pipeline
The prover operates on Recursive Function Theory using a sophisticated pipeline of heuristics designed to decompose complex goals into provable sub-problems:
- Simplification: The system uses axioms and lemmas as rewrite rules to "open up" function definitions and simplify expressions.
- Substitution & Elimination: The system cleans up the goal by applying equality substitutions and removing irrelevant terms that do not contribute to the proof.
- Generalization: To facilitate induction, the prover replaces specific subterms with variables. This often makes a theorem easier to prove by creating a stronger inductive hypothesis.
- Induction: This is the system's core innovation. It employs the Generalized Principle of Induction (Noetherian induction) to handle complex recursive structures.
The Role of Lemmas as "Training"
A critical feature of this system is the use of Measure Lemmas. To justify an induction, the prover must demonstrate that some "measure" of the function's arguments decreases according to a well-founded ordering (e.g., a list getting shorter or a number getting smaller). By proving these measure lemmas in advance, the user effectively "teaches" the prover how to handle specific recursive patterns.
The authors describe this process as "training" the prover. By feeding the system a sequence of simple lemmas, the user builds a knowledge base that allows the prover to eventually leap to difficult theorems that would have been impossible to solve from scratch. Most of the computational effort in a proof is actually simplification; by treating lemmas as conditional rewrite rules (e.g., if H then rewrite U to V), the prover drastically reduces the search space.
Experimental Evaluation and Benchmarks
As a theoretical work in formal logic, the paper evaluates the system on a suite of challenging benchmarks derived from computer science problems rather than modern datasets:
- Optimizing Compiler Correctness: The system successfully proved the
CORRECTNESS.OF.OPTIMIZING.COMPILERtheorem, verifying that a two-pass compiler (constant folding and code generation) preserves the original expression's meaning. It handled the subtle induction required for code generation, where the state of the instruction stream changes non-obviously during recursion. - Arbitrary-Precision Arithmetic: The prover verified an algorithm for adding integers larger than a machine's word size, a task requiring complex reasoning about quotients, remainders, and base-N representations.
- Tree Flattening: The system tackled the
MC.FLATTENchallenge, a classic recursive problem involving nested list structures.
Key Insights and Legacy
Boyer and Moore's system demonstrated that automatic induction selection was possible by analyzing the recursive structure of functions and referencing a library of measure lemmas. Interestingly, the authors opted for an untyped logic, arguing it provided greater flexibility for modeling diverse data objects like arrays, stacks, and symbols within a single framework. Furthermore, the system produced human-readable proof commentaries, making it easier for researchers to verify the machine's logic.
While the authors acknowledged limitations—such as the dependency on the user to provide lemmas in the correct order and potential memory constraints—the work served as a powerful proof-of-concept. This system eventually evolved into the Boyer-Moore Theorem Prover (NQTHM), which was used to verify some of the most complex hardware and software systems of the late 20th century, cementing its place in the history of computer science.
Summary updated