An Incremental Theorem Prover

Murray Shanahan

Introduction

In the mid-1980s, logic programming stood as a cornerstone of artificial intelligence research. However, a significant bottleneck hindered its application to robotics and dynamic environments: the "forgetful" nature of standard theorem provers. When an AI's world model changed—even slightly—existing systems often had to re-evaluate their entire knowledge base from scratch. Murray Shanahan’s 1987 paper, An Incremental Theorem Prover, proposed a structural solution to this inefficiency, introducing a method to maintain and update logical conclusions without redundant computation.

The Problem: The Computational Cost of Change

The paper addresses a technical manifestation of the Frame Problem. In a typical AI scenario, such as a robot moving an object, the vast majority of facts about the environment remain constant. However, standard Prolog-like interpreters utilize a depth-first search with backtracking that discards the "work" performed once a conclusion is reached.

Because these systems do not retain the history of their reasoning, the addition or deletion of a single axiom (a rule or fact) invalidates the entire search state. The interpreter cannot discern which previous conclusions remain valid and which are affected by the update. Consequently, the system must re-explore the entire search space to ensure consistency, a process that is computationally expensive and scales poorly as the knowledge base grows.

The Proposed Solution: Persistent Search Structures

Shanahan’s core innovation is the transformation of the search process from a transient event into a persistent, manageable data structure. Rather than discarding the search tree after a proof is completed, the incremental prover records the tree and augments it with three specific types of dependency structures:

  1. Answer Dependencies: These link specific results (answer substitutions) to the exact branches of the search tree that generated them.
  2. Clause Dependencies: These track which specific axioms or rules were utilized at each node within the tree.
  3. Predicate Dependencies: These record the points where a search was exhausted for a specific predicate, essentially marking where the system "gave up" because no further matching clauses were found.

By maintaining this "living map" of reasoning, the prover can treat the search space as a dynamic entity that can be surgically modified.

Mechanisms for Incremental Updates

The incremental prover handles changes to the database through two primary operations: pruning and resuming.

Deletion and Pruning

When a clause is deleted from the database, the system consults its clause dependencies. It identifies every node in the search tree that relied on that specific clause and prunes those subtrees entirely. Any answers or conclusions derived from those pruned branches are subsequently removed. This ensures that the system's knowledge remains sound without requiring a full re-evaluation of unaffected branches.

Addition and Resuming

When a new clause is added, the system does not restart the search. Instead, it examines its predicate dependencies to find nodes where it previously stopped searching for that specific predicate. The prover then "resumes" the search from those specific nodes using the new clause. This process, which Shanahan describes as "grafting," allows the system to discover new conclusions by only exploring the newly available paths in the search space.

Key Insights and Performance

The fundamental shift in this approach is that the cost of "re-thinking" becomes proportional to the magnitude of the change in the world, rather than the total size of the world model.

  • Efficiency: Shanahan notes that the overhead of maintaining these structures is relatively low, requiring only minor insertions (one tree insertion and two list insertions) per resolution step.
  • Locality: The system is most effective when changes occur at the "leaves" of the search tree—peripheral facts that do not underpin the entire logical structure. While changes to root-level axioms still require significant re-computation, the system still avoids duplicating work in branches that do not depend on the modified root.
  • Bridging Paradigms: The paper effectively bridges the gap between backward-reasoning systems (like Prolog) and Truth Maintenance Systems (TMS), which were traditionally limited to forward-reasoning contexts.

Limitations and Future Directions

Despite its advantages, the incremental theorem prover introduces new challenges:

  • Memory Constraints: Storing the entire search tree, including all variable bindings and dependency pointers, requires significantly more memory than a standard depth-first interpreter.
  • Negation as Failure: The 1987 model does not account for "negation as failure"—the common Prolog assumption that if something cannot be proven true, it is false. Tracking dependencies through negative proofs adds a layer of complexity not covered in this initial architecture.
  • Contextual Reasoning: Shanahan suggested that future iterations should incorporate "contexts" (similar to Assumption-Based TMS), allowing the system to represent multiple versions of a theory—such as the state of the world before and after an action—within a single, shared data structure to further optimize space and reasoning.

Conclusion

An Incremental Theorem Prover represented a vital step toward making logical AI more resilient and efficient in real-time applications. By treating the search process as a persistent data structure, Shanahan provided a blueprint for AI systems that can update their understanding of a changing world with surgical precision rather than wholesale re-calculation.

Summary updated

BibTeX
@inproceedings{shanahan1987incremental,
  author = {Murray Shanahan},
  title = {{An Incremental Theorem Prover}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {1987},
}
Figure