Abstract
In the early 1980s, Alain Colmerauer, a primary architect of Prolog, proposed a refined theoretical foundation for the language. This model, which became the basis for Prolog II, moved away from traditional first-order logic and Robinson’s resolution principle. Instead, it framed Prolog as a system for computing with constraints over potentially infinite trees. By treating logic as a set of tree-based constraints, Colmerauer provided a more autonomous and implementation-friendly framework that addressed practical challenges like inequalities and recursive data structures.
Introduction
The development of Prolog was initially rooted in the mathematical elegance of first-order logic. However, the "minimal Herbrand interpretation" model often struggled to align with the concrete needs of computer science, particularly regarding the efficient handling of complex data and inequalities. Colmerauer sought to "rewrought" this model, giving Prolog an autonomous existence independent of lengthy inference rules. His approach presents the language as a rigorous system for manipulating tree structures, bridging the gap between abstract logic and practical computation.
Trees as the Fundamental Data Structure
At the heart of this reimagining is the concept of "Trees as Data." Rather than dealing with abstract symbols in a vacuum, knowledge in Prolog II is represented as trees, typically drawn upside down. Every fact is a tree, where every leaf and node serves as an "atom" of information. This structural approach allows for a more intuitive mapping of complex expressions.
A significant innovation introduced in this framework is the concept of Rational Trees. These are trees that, while potentially infinite, can be represented by finite diagrams containing loops (isomorphic subtrees). This allows Prolog to handle recursive data structures naturally and efficiently, without the system crashing due to infinite recursion.
Methodology: Constraint Reduction and Tree Transformation
The paper formalizes the process of turning logical terms into tree structures through a set of specific rules. Computation is then framed as "computing on trees" by accumulating and simplifying constraints. These constraints are typically pairs of terms representing equalities ($s = s'$) or inequalities ($t \neq t'$).
The execution of a Prolog program is tracked via an idealized abstract machine known as the "Prolog Clock." This machine formalizes how the system "sweeps" through a tree-shaped search space to find valid tree-assignments, effectively solving the accumulated constraints to find a solution.
Key Insights
The shift from seeing Prolog as a theorem prover to a constraint solver over trees is the most significant conceptual leap. This makes the language behave more like an algebraic system. By stripping away the heavy machinery of first-order logic, Colmerauer reveals that Prolog’s core is a recursive process of simplifying equations. Furthermore, by incorporating inequality ($\neq$) directly into the theoretical model, the paper addresses a long-standing limitation in early implementations, making the language more robust for combinatorial problems.
Conclusion
"Prolog in Ten Figures" served as the manifesto for Prolog II, providing the rigorous definitions needed for handling rational trees and inequalities. By demonstrating these concepts through benchmarks like Molière’s stylistic permutations and the "SEND MORE MONEY" puzzle, Colmerauer proved that tree-based constraints could solve complex problems with minimal declarative code. This work laid the groundwork for the broader field of Constraint Logic Programming (CLP), ensuring Prolog's continued relevance in both theoretical and applied computer science.
Summary updated