Computing with Logic : Logic Programming with Prolog

Emphasizing theory and implementation issues more than specific applications and Prolog programming techniques, Computing with Logic Logic Programming with Prolog (The Benjamin Cummings Publishing Company, Menlo Park, Calif., 1988, 535 pp., $27 95) by David Maier and David S. Warren, respected researchers in logic programming, is a superb book Offering an in-depth treatment of advanced topics, the book also includes the necessary background material on logic and automatic theorem proving, making it self-contained. The only real prerequisite is a first course in data structures, although it would be helpful if the reader has also had a first course in program translation. The book has a wealth of exercises and would make an excellent textbook for advanced undergraduate or graduate students in computer science; it is also appropriate for programmers interested in the implementation of Prolog The book presents the concepts of logic programming using theory presentation, implementation, and application of Proplog, Datalog, and Prolog, three logic programming languages of increasing complexity that are based on horn clause subsets of propositional, predicate, and functional logic, respectively This incremental approach, unique to this book, is effective in conveying a thorough understanding of the subject The book consists of 12 chapters grouped into three parts (Part 1 chapters 1 to 3, Part 2. chapters 4 to 6, and Part 3 chapters 7 to 12), an appendix, and an index The three parts, each dealing with one of these logic programming languages, are organized the same First, the authors informally present the language using examples; an interpreter is also presented. Then the formal syntax and semantics for the language and logic are presented, along with soundness and completeness results for the logic and the effects of various search strategies Next, they give optimization techniques for the interpreter Each chapter ends with exercises, brief comments regarding the material in the chapter, and a bibliography Chapter I presents top-down and bottom-up interpreters for Proplog Chapter 2 offers a good discussion of the related notions: negation as failure, closed-world assumption, minimal models, and stratified programs Chapter 3 considers clause indexing and lazy concatenation as optimization techniques for the Proplog interpreter in chapter 1 Chapter 4 explains the connection between Datalog and relational algebra. Chapter 5 contains a proof of Herbrand’s theorem for predicate logic. Chapter 6 presents structure sharing as an optimization technique for the Datalog interpreter in chapter 4 Chapter 7 gives example Prolog programs dealing with lists and graphs Chapter 8 discusses the “cut” and valuable predicates and metapredicates of Prolog Chapter 9 contains a proof of Herbrand’s theorem for functional logic. Chapters 10 and 11 describe several optimization techniques for the Prolog interpreter in chapter 7. Chapter 11 also presents the Warren Prolog Machine, a virtual machine whose machine language can serve as the intermediate language for a Prolog compiler Chapter 12 details the implementation of a relational database query language in Prolog. The appendix contains suggestions for two courses that can be taught using the book, one emphasizing the theory and applications of logic programming and another stressing the implementation of logic programming. Although the book provides an excellent treatment of the topics that it covers, it omits some areas Topics not covered in the book include Prolog programming techniques and applications such as expert systems; approaches to logic programming besides Prolog and its subsets; derivation and verification of logic programs; fix-point theory, deductive databases, and other topics in the theory of logic programming; and Concurrent Prolog. The book is written in a clear and lucid style The bibliographic entries are up to date, and the index is detailed The typography is good. In summary, the book is a most valuable addition to the Prolog literature It consolidates a lot of material scattered across a large number of technical reports, conference proceedings, and journal articles Its emphasis on implementation and theory and its incremental approach to the presentation of Prolog distinguish it from other available books on Prolog and make it an excellent text for the computer science student.