On Compiling Logic Programs Into Relational Algebra

Al-Amoudi, Saeed M. H (1990) On Compiling Logic Programs Into Relational Algebra. MSc(R) thesis, University of Glasgow.

Full text available as:
[thumbnail of 11003375.pdf] PDF
Download (3MB)


The combination of logic programming methods and database systems technology will result in knowledge bases of increased size and improved efficiency: this topic has received a lot of attention [Zaniolo 1985, Reiter 1978, Chang 1986, Minker 1978, Henschen 1984, Parker 1986, Brodie 1986]. Our approach to integrating logic programming languages (e. g. PROLOG) and database systems is to compile logic programming languages into conventional relational algebra. There are many technical problems which must be addressed and solved when compiling logic programs into relational algebra. Mainly, we are interested in the following problems: the finiteness (i. e. safety) of a logic program's executions and the differences between logic programing languages and database systems in data representation and typing systems. Our approach to safety checking integrates the rule/goal graph of [Ullman 1985] with the magic basis of a variable [Zaniolo 1986]. This approach allows us, effectively, to check the safety of a logic program at compile time, for those programs which are strongly safe. Otherwise, the safety of the program with respect to a query must be checked at execution time. Relational database systems are well typed, whilst logic programming languages are not. We overcome this difference by adding types to PROLOG (i. e TPROLOG). TPROLOG allows the user to define enumerated types, sub-types, structured types, and variant types. Our approach to compiling typed logic programs into conventional relational algebra expressions is to translate the logic program containing complex clauses into an equivalent complex-free program, and then to translate it into a form suitable for storage and manipulation by conventional relational database systems. The normalization of logic programs is achieved by removing complex arguments from facts and rules and replacing them with simplified (i. e. normalized) facts and rules. The normalized facts are stored in a conventional relational database (i. e. extensional database), and the normalized rules are stored in a rule base (i. e. intentional database). The translation of a complex-free program into conventional relational algebra is based on [Reiter 1978, Chang 1986, Henschen 1984, Bancilhon 1986].

Item Type: Thesis (MSc(R))
Qualification Level: Masters
Keywords: Computer science
Date of Award: 1990
Depositing User: Enlighten Team
Unique ID: glathesis:1990-78022
Copyright: Copyright of this thesis is held by the author.
Date Deposited: 30 Jan 2020 15:43
Last Modified: 30 Jan 2020 15:43
URI: https://theses.gla.ac.uk/id/eprint/78022

Actions (login required)

View Item View Item


Downloads per month over past year