Extending Logic Programming to Object Programming: The System Lap

Herman Iline, Henry Kanoui

Abstract

The integration of logic programming and object-oriented programming (OOP) offers a powerful paradigm for developing sophisticated artificial intelligence systems. This paper introduces LAP (Logic and Object Programming), a system that extends Prolog to incorporate the hierarchical structure and inheritance mechanisms of OOP. By treating object attributes as logic variables, LAP facilitates reasoning over incomplete information and supports non-deterministic querying. We describe the architecture of LAP, its approach to multiple inheritance, and its application in modeling complex domains such as biological and social hierarchies.

Introduction

In the mid-1980s, artificial intelligence research was characterized by a divide between two dominant paradigms. Logic programming, exemplified by Prolog, provided a robust framework for "subtle reasoning" and declarative problem-solving. However, it struggled with representing complex, deeply interconnected data structures. Conversely, Object-Oriented Programming (OOP) excelled at modeling hierarchies and managing state through inheritance but lacked the built-in inference engines and backtracking capabilities essential for expert systems.

The LAP system was developed to reconcile these approaches. It provides a unified environment where objects are not merely data containers but nodes of centralized knowledge, capable of participating in the unification and search processes inherent to logic programming.

The LAP System Architecture

LAP distinguishes between two primary environments: the definition of abstract "models" (frames) and the management of "instances" (concrete objects). This separation allows for a clear distinction between schema definition and data instantiation.

Logic-Integrated Slots

A cornerstone of LAP is the treatment of object slots as true Prolog variables. In traditional OOP, a slot typically holds a fixed value. In LAP, a slot can be "partially known." This allows the system to use unification to progressively fill in details as a program executes. If a query requires a value that is not yet present, the system can backtrack or use procedural attachments to infer it.

Facets and Methods

To manage the behavior of objects, LAP utilizes "procedural attachments" known as facets and methods:

  • Facets: These include triggers such as if_added, if_needed, and if_created. They are Prolog clauses that maintain data integrity or compute missing values dynamically.
  • Methods: These facilitate message-passing between objects, allowing for procedural behavior within a declarative framework.

Modeling and Inheritance

LAP supports a graph-based multiple inheritance model. A "son-model" can inherit properties and behaviors from multiple "father-models." To maintain consistency with Prolog’s execution model, inheritance conflicts are resolved using a depth-first search strategy.

Figure 1: A modelization of a biological and social universe in LAP, illustrating inheritance and relational links.

As shown in Figure 1, LAP can model complex universes. In this example, "LIVING CREATURE" serves as a root for "BIRD", "MAMMAL", and "ANIMAL". The system handles both "parentship links" (inheritance) and "relation links" (associations). For instance, the symmetric relation between a "HUMANBEING" and an "ANIMAL" is defined through has-favorite-animal and has-master. This symmetry ensures that updates to one side of the relation are reflected across the entire knowledge base, maintaining a consistent "dynamic image" of the universe.

Non-Deterministic Querying and Reasoning

Because LAP is built on Horn-clause logic, queries to the object database are inherently non-deterministic. A user can query the system for a "domestic animal with an unknown master," and LAP will explore the object graph, backtracking through possible solutions until a valid instance is found. This "cognitive" approach treats objects as active participants in the reasoning process rather than passive data structures.

Implementation and Applications

LAP was implemented as a library of approximately 150 predicates, ensuring compatibility with Prolog II and Quintus-Prolog. It was deployed on various systems, including Vax/Vms and Sun/Unix. Beyond theoretical modeling, LAP has been utilized in several practical domains:

  • Computer-Aided Design (CAD): Modeling architectural components and their spatial relationships.
  • Industrial Simulation: Managing complex state transitions in manufacturing environments.
  • Medical Consultation: Building expert systems that reason over patient data and diagnostic hierarchies.

Conclusion

The LAP system demonstrates that the strengths of logic programming and object-oriented programming are complementary. By integrating unification at the object level and providing a robust inheritance mechanism, LAP allows developers to build AI systems that are both structurally organized and capable of complex reasoning. While future work remains in optimizing performance for massive object graphs and improving user interfaces, LAP represents a significant step toward a more expressive and unified programming paradigm for artificial intelligence.

Summary updated

BibTeX
@inproceedings{iline1987extending,
  author = {Herman Iline and Henry Kanoui},
  title = {{Extending Logic Programming to Object Programming: The System Lap}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {1987},
}
Figure