Abstract:

This article describes an object-oriented inference engine
for PROLOG. The inference engine is part of the Graphically Oriented
Development Environment for Logic (Gödel) programming. Gödel
incrementally translates source clauses to a persistent clause
base in which each clause is an object. The inference engine is
a distributed one in which each clause object knows how to unify
and execute itself. This means that Gödel supports multiple
queries at various points of execution. That is, although multiple
queries cannot actually execute concurrently, they can be suspended
at any point in their execution and reactivated at any time. This
is a major advantage during debugging and exploratory programming.
In addition, the inference engine supports primitive clauses written
in the implementation language, SMALLTALK-80. This provides a
simple interface between PROLOG clauses and SMALLTALK objects
that puts the entire SMALLTALK-80 class hierarchy in the hands
of PROLOG programmers. Despite these advantages, an object-oriented
interface engine has one drawback. In its most general form, the
object granularity is too small, so that too many objects must
be created and destroyed during program execution. This reduces
execution speed. For this reason, several optimizations have been
performed in the implementation to consolidate objects to a more
reasonable size. With these optimizations, Gödel's interpreter
has execution speeds that are still significantly slower than
compiled PROLOG but acceptable for exploration, development, and
debugging. In exchange, this approach provides integration with
the object- oriented paradigm, including all the power that comes
from object-oriented programming environments, including browsers,
incremental translation, inspectors, debuggers, and multiple query
execution, as well as the ability to easily experiment with both
the environment and the PROLOG language itself.