PLANLOG: A Language Framework for the Integration of Procedural and Logical Programming

TL;DR

This paper introduces PLANLOG, a novel language framework that seamlessly integrates logical and procedural programming paradigms. By viewing Horn clause reasoning as plan generation and allowing built-in predicates for external interactions, PLANLOG offers a powerful way to build intelligent systems that are both declarative and executable.

What Problem Does This Paper Address?

Traditional programming languages often fall into two camps: logical/functional (like Prolog) and procedural. While logical languages excel at representing knowledge and deduction, they can struggle with tasks that inherently involve sequences of actions or interaction with the external world. Procedural languages, on the other hand, are great for sequences but can lack the declarative power of logical systems. This paper addresses the challenge of unifying these two approaches, aiming to create a language that leverages the strengths of both for tasks like AI planning and automatic programming. The authors highlight the "procedural contamination" in languages like Prolog (e.g., assert/retract) as evidence that procedural features are often necessary for naturalness and simplicity, even in logic-based systems.

Methods

The core of PLANLOG is built upon the idea of Horn clause reasoning as plan generation. The authors propose that a theorem prover can be viewed as a "robot" constructing theorems, and every proof inherently contains a plan for its construction. This is achieved by:

  • Linear Proofs: Utilizing linear proofs (as described in [BIB 86]), which are a restricted form of proof where each literal is used at most once. This restriction is claimed to be necessary for representing plans.
  • Transformation of Horn Clauses: Horn clauses with non-empty tails are transformed into rules that describe actions. These rules specify how to derive a new situation (head of the clause) from an existing situation (tail of the clause) and a set of conditions.
  • Built-in Predicates: To interact with the external world (e.g., files, terminals), PLANLOG allows for built-in predicates. These predicates are not defined logically but are coded directly into the interpreter. This necessitates a distinction between plan generation and plan execution.
  • Intermingling Plan Generation and Execution: For tasks involving external interactions, the plan generation process is not entirely separated from execution. When a partial plan is sufficiently determined, its actions are executed, and the information gained is used to resume plan generation.

Datasets

Not discussed in the paper.

Key Insights and Ideas

  • Declarative Procedures: PLANLOG allows actions (procedural parts) to be defined using logical implications, leading to "declarative procedures" that are easier to understand and manipulate.
  • Predicative Procedural Language: The language operates on relations and formulas, making it akin to a high-level database language.
  • Knowledge-Based Procedural Language: Logical implications are directly translated into rules, meaning the statements in PLANLOG reflect chunks of knowledge, making the code more interpretable.
  • Overcoming Prolog's Contamination: PLANLOG offers a way to write programs in pure logic, which is beneficial for meta-programming tasks like program transformation and synthesis.
  • Facilitating Program Synthesis: By providing a target language that encourages more procedural and efficient programs, PLANLOG can drive advancements in program synthesis.
  • Uncovering Parallelism: Representing plans as partial proofs allows for the analysis of connection structures, potentially revealing and facilitating parallel execution.

Key Results

The paper primarily presents a conceptual framework and its underlying principles. It illustrates the transformation of Horn clauses and the proof mechanism for plan generation with an example of list appending. The authors argue that PLANLOG offers a powerful way to integrate different programming styles, leading to more expressive and efficient systems, particularly for AI tasks. No specific quantitative results or benchmarks are presented.

Limitations and Future Work

The authors acknowledge that their approach is based on a purely logical world initially, and the introduction of built-in predicates creates a necessary distinction between plan generation and execution. They also note that formalizing the "what" of a procedural task can be difficult, suggesting that a significant role will be played by the execution of prefabricated plans.

Future work could involve further exploration of:

  • The practical implementation of PLANLOG.
  • The potential for uncovering and exploiting parallelism in plans.
  • The application of PLANLOG to a wider range of AI problems beyond basic planning.
  • The development of tools and techniques for working with this integrated language.

Summary updated

BibTeX
@inproceedings{1987planlog,
  title = {{PLANLOG: A Language Framework for the Integration of Procedural and Logical Programming}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {1987},
}
Figure