Logic Programming by J.M. Spivey
This is one of the few texts that combines three essential theses in the study of logic programming: the logic that gives logic programs their unique character: the practice of programming effectively using the logic; and the efficient implementation of logic programming on computers. The book begins with a gentle introduction to logic programming using a number of simple examples, followed by a concise and self-contained account of the logic behind Prolog programming. This leads to a discussion of methods of writing programs so that the process of deriving anwers from them is as efficient as possible. The techniques are illustrated by practical examples and the final part of the book explains how logic programming can be implented efficiently. It includes source code for a small but Complete Prolog implementation written in Pascal. The implementation is capable of running all the programs presented in the book, and is available via the Internet.