O'Reilly logo

Paradigms of Artificial Intelligence Programming by Peter Norvig

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 6

Building Software Tools

Man is a tool-using animal…Without tools he is nothing with tools he is all.

–Thomas Carlyle (1795–1881)

In chapters 4 and 5 we were concerned with building two particular programs, GPS and ELIZA In this chapter, we will reexamine those two programs to discover some common patterns. Those patterns will be abstracted out to form reusable software tools that will prove helpful in subsequent chapters.

6.1 An Interactive Interpreter Tool

The structure of the function eliza is a common one. It is repeated below:

(defun eliza ()

 "Respond to user input using pattern matching rules."

 (loop

  (print 'eliza >)

  (print (flatten (use-eliza-rules (read))))))

Many other applications use this pattern, including Lisp itself. The top ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required