AI Magazine Volume 15 Number 4 (1994) (© AAAI)
Book Reviews
Book Reviews
code in this book is well written and
Paradigms of Artificial edifying and pleasurable to read,
Intelligence Programming: although it is sometimes rather chal-
lenging. Later chapters deal with
Case Studies in Common Lisp advanced features of Lisp and trou-
bleshooting. He argues cogently for
the use of Lisp because it is open end-
ed and has uniform data structures
and the ability to manipulate and
Robert P. Futrelle generate code through macros and
other mechanisms. CLOS is not used
in the book, but a limited form of
object-oriented programming is
Paradigms of Artificial Intelligence Pro- search and heuristics, pattern match- developed using closures. Modern
gramming: Case Studies in Common ing, rule-based translation, efficiency- Lisps can also be efficient, and the
Lisp, Peter Norvig, Morgan Kaufmann related caching and compiling, the book is replete with examples of
Publishers, San Mateo, California, creation of object-based facilities, strategies to produce fast code.
1992, 946 pp., $49.95, ISBN 1- compilation to an abstract machine, The second chapter, “A Simple Lisp
55860191-0. and troubleshooting and trouble- Program,” illustrates the author’s
avoidance strategies. The most strategy of successive refinement. The
N
orvig’s Paradigms of Artificial notable omission from the book is example is a program to generate
Intelligence Programming is a any discussion of machine learning, a English sentences, starting with a set
splendid work that skillfully topic of growing importance in all of nested function calls. This pro-
weaves together three threads: (1) AI, areas of AI. gram has obvious problems, so a sec-
(2) programming skills in general, The book is nearly 1,000 pages ond, more modular, data-driven solu-
and (3) programming skills in Com- long with a historical end note in tion is developed that separates the
mon Lisp in particular. It is written each chapter, extensive references, grammar from the interpreter. Then,
with great intelligence and insight and a thorough index. The 10,000 a tree printer is integrated into the
and can benefit a wide audience from lines of source code discussed in generator. These themes of successive
advanced undergraduates to seasoned detail in the book are available refinement and data-driven program-
researchers. It is a book that should online. Each of the 25 chapters ming are pursued with great success
be in the permanent collection of includes approximately 10 exercises throughout the book.
every AI aficionado because it is such of widely varying difficulty or time to Much of the first part of the book
a rich source of ideas and examples. complete. Each major section of each is devoted to exploring early AI
It is not a full-blown AI text; it does chapter includes a glossary, a table paradigms by recreating historically
not depend on the reader having any that lists the macros, top-level func- important systems. The first is Newell
previous knowledge of AI but does tions, special variables, data types, and Simon’s GENERAL PROBLEM SOLVER
assume some basic knowledge of functions, selected Common Lisp (GPS). The treatment of GPS is good,
Lisp. I have used this book with great functions, and previously defined presenting many useful ideas and
success as a supplement in an intro- functions that are discussed and used pedagogical strategies in the clear and
ductory graduate AI course, the text in the section. The book includes interesting style that pervades the
in a graduate AI course focusing on pointers to other major AI software book. A systematic strategy is intro-
techniques, and a resource in my sources, although these pointers are duced for system development, going
research group. mostly superseded by the large collec- from description to specification to
The sheer amount of material is tion in /pub/ai at [Link] (also implementation to testing and, final-
impressive, including symbolic math- available on CD-ROM). The frequent- ly, to debugging and analysis. Norvig
ematics, logic programming, natural ly asked questions (FAQs) in the discusses five problems encountered
language, expert systems, games, and [Link] newsgroup are anoth- with the simple S T R I P S -based G P S
more. Perhaps even more important, er useful adjunct to the text. implementation, followed by the
however, are the numerous para- The book starts with a refresher on implementation of a version with a
digms introduced, in keeping with Lisp. Norvig states that one of the somewhat different architecture that
the book’s title. These paradigms best ways to learn how to program solves the problems raised. Instead of
include data-driven programming, well is to read lots of good code. The generating a new set of data to satisfy
WINTER 1994 75
Book Reviews
the newly required format, he writes get the unknown values. This task is refreshingly different from the
a function that converts the old data seems daunting, but it’s all accom- many standard AI textbook treat-
format to the new. Elegant and sensi- plished in 16 pages of lucid code and ments. The limitations of the predi-
ble touches such as this one occur text. The book points out that some cate calculus and Prolog are discussed,
throughout the book. The enhanced of the approaches used in the STUDENT and partial workarounds for them are
GPS is applied to mazes, monkey and system have not survived, especially developed by altering the Prolog sys-
bananas, and the blocks world. The its handling of natural language. It tem. The problems treated in this way
blocks world application points out further points out that symbolic inte- include efficiency of indexing and
the fundamental limitations of the gration was once an outstanding AI completeness. The expressiveness
GPS paradigm, and the chapter ends problem but is now accomplished by problem is dealt with by building
with some sobering reflections on deterministic algorithms and is avail- some facilities for higher-order predi-
why GPS cannot handle a wide range able in packages for PCs. There are cations, frames, possible worlds, and
of important problems or at least can- chapters later in the book that deal negation and disjunction.
not do so without unacceptable com- with natural language and symbolic Many AI students are eager to learn
putational costs. mathematics in a more sophisticated about expert systems. The book
ELIZA is treated briefly in a similar and up-to-date manner and include rewards them with a fine chapter
vein. Tools for pattern matching are case studies in performance enhance- devoted to a reconstruction of
developed. A general-purpose rule- ment. The most advanced chapters EMYCIN, with medical rules added to
based translator, mapping from user on symbolic mathematics deal with build M Y C I N . The development is
input to action, is constructed using rather complicated material and will entirely within Lisp, but the relations
the pattern matcher and is applied to not be easy for some readers. to Prolog are carefully explained as
ELIZA and GPS. The book takes pains to Two chapters are devoted to effi- consisting of Prolog plus uncertainty,
point out just how brittle the ELIZA ciency issues and include material explanations, and other features.
paradigm is. that is hard to find elsewhere. Most Constraint satisfaction is discussed
by implementing the Waltz line-
labeling algorithm. Unfortunately,
the treatment is not related to the
This book can lead to a deep appreciation of the current literature on constraint satis-
unique strengths of Lisp and help the reader faction; nor is any of the terminology
of the field used; nor, in the chapters
understand why Lisp is still in active use nearly on Prolog, is the related field of con-
40 years after it was first developed straint logic programming men-
tioned. (Perhaps the latter develop-
ment is just too recent.) In spite of
Search is introduced, and in only notably, memoization is implemented, some ingenious ideas and code, the
20 pages, an integrated set of search a transparent method of caching general nature of constraints in prob-
tools is built and demonstrated. All results to avoid reevaluation. There is lem solving is not explored deeply
the standard methods of search are also a discussion of compiling one enough in this chapter. To pursue the
covered, including A* and iterative language into another, turning inter- topic further, the reader is advised to
deepening. GPS is reformulated as a preters into compiled code. All these start with a 1992 special issue of the
search problem, so that even the ideas are applied to a symbolic math- AI Journal, 58(1–3), or the book by E.
Sussman anomaly can be solved. ematics program, getting a speedup Tsang, Foundations of Constraint Satis-
This point is well taken: The solution of 130. The techniques are used later faction (Academic Press, 1993).
of many AI problems involves some in extensive studies of Prolog and Games are always of great interest
form of search; so, search is a foun- SCHEME. to students of AI. Norvig devotes a
dational topic. A minor point: A significant portion of the book satisfying chapter to search and the
Although the handling of tail recur- discusses Prolog, develops it in Lisp game of OTHELLO. He develops search
sion is discussed later in the book, no and then uses it, primarily for natural heuristics and systematically
mention is made that the tree-search language analysis. An interpreted ver- improves them, culminating in a sys-
routines here should be compiled by sion of Prolog is built first, then tem of tournament-level quality that
a compiler that handles tail recursion refined with destructive unification uses techniques from the high-end
(to avoid blowing the stack on large and compiled into Lisp so that it runs programs IAGO and BILL.
searches). 20 to 200 times faster. Some readers One of this book’s many strengths
A treatment of Bobrow’s 1964 STU- might find the chapter on compiling is its treatment of natural language
DENT system introduces a number of Prolog a bit daunting because various processing. The topic is introduced
new ideas, including analyzing features are added, such as call, bagof, with an exhilarating tour of the
English input, using a rule-based and cut. basics of natural language parsing by
translator to generate symbolic equa- Issues of knowledge representation building a simple parser for a phrase-
tions, and solving the equations to are discussed with an approach that structure grammar, then generating
76 AI MAGAZINE
Book Reviews
multiple parses for ambiguous sen-
tences, dealing with unknown words,
integrating compositional semantics,
and integrating preference-based
parsing using the same strategy. A
speedup of 10 to 20 is obtained by
memoizing the parser. Elsewhere,
Norvig has shown that careful memo-
ization of a simple parser can match
the performance of the more com-
plex chart parsers (1991, Techniques
for Automatic Memoization with
Applications to Context-Free Parsing,
Computational Linguistics 17(1):
91–98).
Unification grammars for natural
language, a thoroughly modern
approach, are discussed at length.
Norvig uses Prolog in this discussion,
which might seem an odd choice for
a book built around Lisp; however,
the fact that in Prolog, the grammar
is the code, as it were, gives the entire
presentation great clarity. To go
beyond this simple initial treatment,
definite clause grammars (DCGs) are
introduced. The economy of his
treatment leaves room for a discus-
sion of interesting issues, such as
quantifiers and their scope, ambigui-
ty, and long-distance dependencies.
An additional chapter is taken up
entirely with presenting an extensive
DCG grammar of English, making
this textbook possibly the only one
that includes both a working parser
and an extensive grammar. Studying
such a large grammar is informative,
but the reader should have been
warned that such large grammars,
applied to real English (with 40+
word long sentences such as this
one), have to deal with serious prob-
lems of performance that are mostly
driven by lexical and structural ambi-
guity problems.
This book can lead to a deep appre-
ciation of the unique strengths of
Lisp and help the reader understand
why Lisp is still in active use nearly
40 years after it was first developed.
The ideas underlying Lisp are power-
ful and pervasive, so they will be
with us for a long time (even if the
language is reborn as DYLAN or as
some future language yet unknown).
The paradigms of AI programming so
artfully presented in this book will
remain valuable well into the future.
WINTER 1994 77