Storage and Retrieval of First-order Terms Using a Relational Database

We present several practical techniques for storing first-order terms (e.g. clauses) in a relational database, and for mechanically constructing SQL select queries which retrieve all terms matching a given pattern. First we outline the deductive database application which prompted us to develop the techniques, then we present our approach to clause storage and indexing, and consider three variants of the unifiability retrieval condition. We discuss several issues in interfacing Prolog to a RDBMS, including caching and re-entrancy. We then present four techniques: one for storing and retrieving general terms; a specialisation of this for storing ground terms; another specialisation for storing finite maps; and a quite different technique for ground terms. We comment on the complexity of some of the generated SQL queries.

[1]  K. Lunn,et al.  TREQL (Thornton Research Easy Query Language): An Intelligent Front-End to a Relational Database , 1988, Prolog and Databases.

[2]  Peter van Emde Boas,et al.  Storing and Evaluating Horn-Clause Rules in a Relational Database , 1986, IBM J. Res. Dev..

[3]  ROBERT M. COLOMB Enhancing Unification in Prolog through Clause Indexing , 1991, J. Log. Program..

[4]  Jorge B. Bocca,et al.  MegaLog - A platform for developing Knowledge Base Management Systems , 1991, DASFAA.

[5]  Kam-Fai Wong,et al.  Design Considerations for a Prolog Database Engine , 1988, JCDKB.

[6]  Peter M. D. Gray Logic, algebra and databases , 1984, Ellis Horwood series in computers and their applications.

[7]  Jorge B. Bocca,et al.  On Prolog DBMS Connections: A Step Forward from Educe , 1988, Prolog and Databases.

[8]  Christian A. Wieland,et al.  Adding Inferencing to a Relational Database Management System , 1989, BTW.

[9]  Kazunori Ueda,et al.  What is a Variable in Prolog? , 1984, Fifth Generation Computer Systems.

[10]  Johann Eder,et al.  Logic and Databases , 1992, Advanced Topics in Artificial Intelligence.

[11]  Georg Gottlob,et al.  Efficient Database Access from Prolog , 1989, IEEE Trans. Software Eng..

[12]  Edward Sciore,et al.  Towards an Integrated Database-Prolog System , 1984, Expert Database Workshop.

[13]  Matthias Jarke,et al.  An optimizing prolog front-end to a relational query system , 1984, SIGMOD '84.

[14]  Michael Freeston Grid Files for Efficient Prolog Clause Access , 1988, Prolog and Databases.

[15]  Peter Hitchcock,et al.  Coupling Prolog to a Database Management System , 1990, Inf. Syst..

[16]  Robert J. Lucas,et al.  A Prolog-Relational Database Interface , 1988, Prolog and Databases.

[17]  Peter M. D. Gray,et al.  Prolog and Databases, Implementations and New Directions. , 1989 .

[18]  Walter F. Tichy,et al.  Tools for Software Configuration Management , 1988, SCM.

[19]  Kurt Rothermel An Effective Method for Storing and Retrieving Prolog Clauses from a Relational Database , 1988, JCDKB.

[20]  Robert M. Keller,et al.  Applicative caching , 1986, TOPL.

[21]  Jeffrey D. Ullman,et al.  Introduction to Automata Theory, Languages and Computation , 1979 .