Deductive Database Languages: Problems and Solutions MENGCHI LIU University of Regina
Total Page:16
File Type:pdf, Size:1020Kb
Deductive Database Languages: Problems and Solutions MENGCHI LIU University of Regina Deductive databases result from the integration of relational database and logic programming techniques. However, significant problems remain inherent in this simple synthesis from the language point of view. In this paper, we discuss these problems from four different aspects: complex values, object orientation, higher- orderness, and updates. In each case, we examine four typical languages that address the corresponding issues. Categories and Subject Descriptors: H.2.3 [Database Management]: Languages— Data description languages (DD); Data manipulation languages (DM); Query languages; Database (persistent) programming languages; H.2.1 [Database Management]: Logical Design—Data models; Schema and subschema; I.2.3 [Artificial Intelligence]: Deduction and Theorem Proving—Deduction (e.g., natural, rule-base); Logic programming; Nonmonotonic reasoning and belief revision; I.2.4 [Artificial Intelligence]: Knowledge Representation Formalisms and Methods—Representation languages; D.1.5 [Programming Techniques]: Object-oriented Programming; D.1.6 [Programming Techniques]: Logic Programming; D.3.2 [Programming Languages]: Language Classifications; F.4.1 [Mathematical Logic and Formal Languages]: Mathematical Logic—Logic and constraint programming General Terms: Languages, Theory Additional Key Words and Phrases: Deductive databases, logic programming, nested relational databases, complex object databases, inheritance, object-oriented databases 1. INTRODUCTION ment of various data models. The most well-known and widely used data model Databases and logic programming are is the relational data model [Codd two independently developed areas in 1970]. The power of the relational data computer science. Database technology model lies in its rigorous mathematical has evolved in order to effectively and foundations with a simple user-level efficiently organize, manage and main- paradigm and set-oriented, high-level tain large volumes of increasingly com- query languages. However, the rela- plex data reliably in various memory tional data model has been found inex- devices. The underlying structure of da- pressive for many novel database appli- tabases has been the primary focus of cations. During the past decade, many research that has led to the develop- Author’s address: Department of Computer Science, University of Regina, Regina, Saskatchewan S4S 0A2, Canada; email: [email protected]. Permission to make digital/hard copy of part or all of this work for personal or classroom use is granted without fee provided that the copies are not made or distributed for profit or commercial advantage, the copyright notice, the title of the publication, and its date appear, and notice is given that copying is by permission of the ACM, Inc. To copy otherwise, to republish, to post on servers, or to redistribute to lists, requires prior specific permission and/or a fee. © 1999 ACM 0360-0300/99/0300–0027 $5.00 ACM Computing Surveys, Vol. 31, No. 1, March 1999 28 • M. Liu CONTENTS tion to solve problems by deriving logi- cal consequences. The most well-known 1. Introduction 2. Complex-Value Deductive Languages and widely used logic programming lan- 2.1 LDL guage is Prolog [Colmerauer 1985; Kow- 2.2 COL alski 1988; Sterling and Shapiro 1986], 2.3 Hilog which uses the Horn clause subset of 2.4 Relationlog 3. Object-Oriented Deductive Languages first-order logic as a programming lan- 3.1 O-Logic guage and the resolution principle as a 3.2 F-Logic method of inference with well-defined 3.3 ROL model-theoretic and proof-theoretic se- 3.4 IQL mantics [Lloyd 1987]. However, Prolog 4. Schema and Higher-Order Features 4.1 HiLog lacks expressiveness in a number of ar- 4.2 L2 eas. Over the past several years, a num- 4.3 F-logic ber of richer and more expressive logic 4.4 ROL programming languages have been pro- 5. Updates 5.1 Prolog posed and implemented, such as LOGIN 5.2 DLP and Its Extension [Aït-Kaci and Nasr 1986], LIFE [Aït- 5.3 DatalogA and LDL Kaci and Nash 1986], HiLog [Chen et al. 5.4 Transaction Logic 1993], Prolog11 [Moss 1994], Gödel 6. Conclusion [Hill and Lloyd 1994], Oz [Smolka 1995], Mercury [Somogyi et al. 1996], XSB [Rao et al. 1997], etc. Important studies on the relations be- more expressive data models and sys- tween logic programming and relational tems have been developed, such as the databases have been conducted for ER model [Chen 1976], RM/T [Codd about two decades, mostly from a theo- 1979], TAXIS [Mylopoulos et al. 1980], retical point of view [Gallaire and SDM [Hammer and McLeod 1981], DA- Minker 1978; Gallaire 1981; Jacobs PLEX [Shipman 1981], SHM1 [Brodie 1982; Ullman 1982; Maier 1983]. Rela- 1984], Gemstone [Maier et al. 1986], tional databases and logic programming * Galileo [Albano et al. 1985], SAM [Su have been found quite similar in their 1986], Iris [Fishman et al. 1987], IFO representation of data at the language [Abiteboul and Hull 1987], the one for level. They have also been found com- EXODUS [Carey et al. 1988], Orion plementary in many aspects. Relational [Kim 1990a; 1990b], O2 [Deux et al. database systems are superior to the 1991], Jasmine [Ishikawa et al. 1993], standard implementations of Prolog Fabonacci [Albano et al. 1995], ODMG with respect to data independence, sec- [Cattell 1996], and others. ondary storage access, concurrency, re- Logic programming is a direct out- covery, security and integrity [Tsur and growth of earlier work in automatic the- Zaniolo 1986]. The control over the exe- orem proving and artificial intelligence. cution of query languages is the respon- It is based on mathematical logic, which sibility of the system, which uses query is the study of the relations between optimization and compilation tech- assertions and deductions and is for- niques to ensure efficient performance malized in terms of proof and model over a wide range of storage structures. theories. Proof theory provides formal However, the expressive power and specifications for correct reasoning with functionality of relational database premises, while model theory prescribes query languages are limited compared how general assertions may be inter- to that of logic programming languages. preted with respect to a collection of Relational languages do not have specific facts. Logic programming is pro- built-in reasoning capabilities. Besides, gramming by description. It uses logic relational query languages are often to represent knowledge and uses deduc- powerless to express complete applica- ACM Computing Surveys, Vol. 31, No. 1, March 1999 Deductive Database Languages: Problems and Solutions •29 tions, and are thus embedded in tradi- Aditi [Vaghani et al. 1994], LogicBase tional programming languages, result- [Han et al. 1994], Declare/SDS [Kie- ing in impedance mismatch [Maier bling et al. 1994] etc. See Ramakrish- 1987] between programming and rela- man and Ullman [1995] for a survey of tional query languages. Prolog, on the these deductive database systems. De- other hand, can be used as a general- ductive database systems have been purpose programming language. It can used in a variety of application domains be used to express facts, deductive in- including scientific modeling, financial formation, recursion, queries, updates, analysis, decision support, language and integrity constraints in a uniform analysis, parsing, and various applica- way [Reiter 1984; Sterling and Shapiro tions of transitive closure such as bill- 1986]. of-materials and path problems [Ra- The integration of logic programming makrishman 1994]. They are best and relational database techniques has suited for applications in which a large led to the active research area of deduc- amount of data must be accessed and tive databases [Gallaire et al. 1984; Ceri complex queries must be supported. et al. 1990; Grant and Minker 1992]. However, significant problems remain This combines the benefits of the two inherent in this kind of deductive data- approaches, such as representational base from the language point of view. In and operational uniformity, reasoning this paper, we investigate four problem- capabilities, recursion, declarative que- atic areas. The first one is that such rying, efficient secondary storage ac- deductive databases provide inexpres- cess, etc. The function symbols of Pro- sive flat structures and cannot directly log, which are typically used for support the complex values common in building recursive functions and com- novel database applications. The second plex data structures, have not been is that object orientation offers some of found useful for operating over rela- the most promising ways of meeting the tional databases made up of flat rela- demands of the most advanced database tions. As a result, a restricted form of applications, but it is not clear how to Prolog without function symbols called incorporate object orientation into de- Datalog (with negation), with a well- ductive databases to increase their data defined declarative semantics based on modeling capability. The third is that the work in logic programming, has current deductive databases cannot nat- been widely accepted as the standard urally deal with schema and higher- deductive database language [Ullman order features in a uniform framework 1989a; Ceri et al. 1990]. so that a separate, non-logic-based lan- In the past few years, various set- guage is normally provided to specify oriented evaluation strategies specific and manipulate the schema informa- for deductive databases