Abstract This paper introduces a formal framework for logic programming centered on a "recursive-schema." By distilling complex recursive logic into a standardized template, the author demonstrates that this simplified class of programs is Turing complete. The framework facilitates program transformation, synthesis across domains, and the development of demand-driven databases.
Introduction
In the early era of the "Fifth Generation Computer Systems" project, researchers sought to define the computational limits and structural commonalities of logic programming languages like Prolog. While it was known that simple Horn clauses were Turing complete, the proofs were often mathematically dense and lacked practical utility for program optimization.
Takashi Yokomori addresses this by introducing "recursive-schema programs." This approach provides a universal template for recursion, allowing for a more streamlined understanding of logic programs and enabling automated synthesis and database space optimization.
The Recursive-Schema Framework
The core of the proposal is a specific predicate, recursive-schema(A, B, F, G, X), which captures the essence of recursive operations. The schema is defined by two fundamental rules:
- Base Case: If a condition $A(X)$ is satisfied, the computation terminates.
- Recursive Step: If a condition $B(G(X))$ is met, the program recursively calls itself with a transformed input $F(X)$.
This structure is a generalization of transitive closure logic. Yokomori defines a class of programs, REC, constructed from this schema and a set of primitive predicates (such as unification and basic truth values).
As shown in the figure above, traditional logic programs (DB1), such as those for list reversal or factorial calculation, can be transformed into a more compact representation (DB2). In DB2, the complex logic is replaced by the universal recursive-schema ($P_0$) and a series of facts ($F_1 \dots F_n$) that define the specific parameters for each operation.
Theoretical Power and Turing Completeness
A significant contribution of this work is the formal proof of the schema's expressive power. Using formal language theory, Yokomori demonstrates that any recursively enumerable language—the most complex class in the Chomsky hierarchy—can be represented using this specific schema.
This provides a simpler proof for the Turing completeness of simple logic programs compared to previous results (e.g., Tärnlund, 1977). Furthermore, the author establishes the "Three-Schema Rule," proving that any Turing computable logic program can be expressed as a conjunctive formula of exactly three recursive-schema programs.
Program Synthesis and Database Efficiency
The standardization offered by the schema has practical implications for program synthesis and database design:
- Program Isomorphism: The author demonstrates that operations in different domains, such as
plusin arithmetic andappendin list processing, are structurally identical. By applying a "transfer mapping," one can synthesize a program in one domain directly from its counterpart in another. - Demand-Driven Databases: Instead of storing numerous specific rules for every possible operation, a database can store the single recursive schema and a set of assertions. This "demand-driven" approach saves significant storage space, as results are only computed when specifically queried, using the generalized rule.
Conclusion
Yokomori’s recursive-schema offers a powerful theoretical bridge between the mathematical foundations of logic programming and practical software engineering. While the paper establishes the "sufficient expressive capability" of the schema, it leaves open the challenge of automatically discovering transfer mappings between domains. Future research is required to evaluate the computational time complexity of these generalized schemas compared to hand-optimized specific programs in real-world Prolog environments.
Summary updated