Most devastating, though, is that the discussion of principles and i m p l e m e n t a t i o n is t o o superficial. I m p o r t a n t concepts are often used w i t h o u t adequate (or in some cases any) definition or discussion. For example, the a u thor mentions control schemes frequently, yet never discusses w h a t a control scheme is or explicitly gives e x amples of different control schemes. Backtracking is d i s missed in the chapter on search with the single s t a t e m e n t that it is often inefficient, vet no adequate explanation is given of w h a t backtracking really is. (He does define backtracking as "retraction of the m o s t recently placed square," but there is m o r e to backtracking than that.) Discussions of the programs often do not make clear just w h a t principle t h e y i m p l e m e n t or the reasons and ass u m p t i o n s underlying a particular i m p l e m e n t a t i o n . The impression I get f r o m this b o o k is that I am r e a d ing the class notes from the author's course in artificial intelligence m e n t i o n e d in the preface and that the a u t h o r has either not fully understood the difference in e x p o s i t o r y style b e t w e e n a lecture and a text, or not vet done enough in t r a n s f o r m i n g the one to the other. Software is available for use with the text (and I understand a separate r e v i e w will be made of either the software alone or the b o o k in conjunction with the software), but I do not see that that will do much to r e m e d y the problems mentioned. As such I cannot r e c o m m e n d this book as it stands for student use, either for independent use or for use in the classroom. * virtually no data t y p i n g * simple syntax * clean semantics Yet the b o o k uses, w h e r e v e r appropriate, traditional n o tions such as record, assignment, procedure call, sideeffect, c o m m a n d , and the like. Perhaps the highpoint of Chapter 1 is a t w o page discussion of the cut, nicely clarified with a nine clause program. Chapter 2 covers Prolog and logic, but just enough logic t o explain predicates, quantification, and resolution. Even here PP highlights Prolog's procedural side; the chapter's last third deals with control issues, including a contrast of backtracking with coroutining. PP does not d o w n p l a y Prolog's "descriptive" semantics, but rather puts t h e m in perspective. A passage from the Preface is w o r t h q u o t i n g in full because it explains both the order of the first t w o chapters and the book's overall approach to the language: Prolog can be classified as a descriptive p r o g r a m ming language, as opposed to prescriptive (or imperative) languages such as Pascal, C, and Ada. In principle, the p r o g r a m m e r is only supposed to specify w h a t is t o be done by his or her program, w i t h o u t bothering with h o w this should be achieved. Robert A. Kowalski has coined the "equation" A l g o r i t h m = Logic + Control, which emphasizes the distinction b e t w e e n the w h a t (logic) and the h o w (control). The p r o g r a m m e r need n o t always specify the control component. In practice, however, Prolog can be treated as a procedural language. The candid last sentence says it all about PP's approach. The chapter on definite-clause g r a m m a r comes right after the basic introduction. The focus is on representing the parsing problem in Prolog, and the chapter illustrates rather than explains Prolog programming. Next comes a chapter on stacks, queues, and graphs in Protog. It covers general list processing, including sorting and searching, and devotes a section to array analogues in Prolog. The chapter ends with design examples and hints; and, in this context, introduces topics such as the cut-fail c o m b i n a t i o n and use of assert/retract. The rest of PP divides into t w o parts. In the first, the b o o k gives a language s u m m a r y for its o w n i m p l e m e n tation; lays out the broad issues of Prolog implementation; and then carefully explains details of its own. The discussions of structure-sharing and tail-recursion optimization are especially well done. This first part is suited for s t u dent projects, as the authors suggest s o m e natural but challenging extensions to their implementation. In the second part, PP does case studies of a STRIPS problem in WARPLAN and a P r o l o g - b a s e d SQL. PP is an outstanding book in design and execution. It is about Prolog p r o g r a m m i n g in particular, not logic p r o g r a m m i n g in general. The approach is d o w n - t o - e a r t h and practical; but the pedagogy and topics are very s o p h i s ticated. PP is intended for p r o g r a m m e r s c o m i n g to Prolog f r o m a n o t h e r language, but w o r t h w h i l e even for those a l ready fluent in it. PP puts a lot of Prolog into a small space, making r o o m for some o t h e r things as well. If I had to pick one book on Prolog, this w o u l d be it. Prolog for Programmers Feliks Kluzniak and Stanislaw Szpakowicz I S B N - 0 - 1 2 - 4 1 6 5 2 0 - 4 Academic Press, 308 pps. $24.95 Reviewed by: Marty Kalin Department of C o m p u t e r Science De Paul University Chicago, IL 60604 Prolog for Programmers (PP) delivers w h a t it promises by introducing Prolog to p r o g r a m m e r s from other l a n guages; I k n o w of no better introduction for this audience. (The dialect used is a slight variant of DEC-10 Prolog.) Yet even the experienced Prolog p r o g r a m m e r can gain from PP's f i r s t - r a t e t r e a t m e n t of data structures, control, p r o g r a m m i n g techniques, and implementation. The style is clear and concise, and a dry wit makes it fun to read. PP could be used as language text in an introductory AI course; for example, w e have used it along with Genesereth and Nilsson's Logical Foundations of Artificial Intelligence. PP also addresses broader issues such as language extensibilitv with a chapter on definite-clause grammars; database with a c a s e study of relational databases in Prolog; planning with an analysis of a STRIPS problem in WARPLAN; and i m p l e m e n t a t i o n and o p t i m i z a tion with a discussion of the authors' o w n Prolog i n t e r preter. PP furnishes source for the interpreter and case studies in listings as well as on a floppy diskette. The book's introductory core has t w o chapters that t o g e t h e r run just f i f t y - o n e pages. With short but often quite sophisticated examples, these chapters cover basic jargon, syntax, unification, resolution, procedure invocation, control, and programming strategy. The chapters are not in the usual order for Prolog text. The first deals with data structures, drawing on analogues in conventional languages such as Basic, Fortran, and Pascal. To be sure, PP makes the usual pitch to the unconverted. Prolog has * directly expressed rather than encoded data s t r u c tures * high-level dynamic objects without low-level pointers SIC,ART N e w s l e t t e r , J a n u a r y 1988, N u m b e r 103 Page 21
/lp/association-for-computing-machinery/book-review-prolog-for-programmers-by-feliks-kluzniak-and-stanislaw-FXixluQsNo