Downloading and Installing Lisp Code for AIMA

This page gives instructions for retrieving the code for the book, and installing it on your system if you decide to work from home.

Downloading the Code

To download the code, follow these steps:
  1. Create the directory where you want the code to reside.
  2. Download the file code.tar (973KB), or the file code.tar.Z (284KB) if you have the compress program, or code.tar.gz (188KB) if you have the gunzip program. Make sure you download the file to the correct directory (in most browsers, this is done by clicking the right mouse button and choosing the "save as file" option). You can also get the files by anonymous ftp to ftp.norvig.com.
  3. If you have downloaded code.tar, skip this step. Otherwise, execute the command uncompress code.tar.Z or the command gunzip code.tar.gz to create the file code.tar.
  4. Execute the command tar xf code.tar to unpack the archive of files. Or drag the code.tar file to a program such as Stuffit Expander or PKUnzip.
  5. Replace the file utilities/cltl2.lisp with this "CLISP repaired version of cltl2.lisp".

Installing the Code

  1. Make sure you have both read-permission and write-permission for the directory where the code is kept.
  2. Edit the file "aima.lisp" and change the value of the parameter *aima-root* to reflect the location of the files. Make sure to use the proper syntax for a directory, not a regular file. For example, on a Unix file system, you want something like "/usr/local/aima/", where the final "/" indicates that /usr/local/aima is a directory. On a Windows system, make sure that you use forward slashes ("/"), not backward slashes ("\") to indicate the location.
  3. Start up CLISP, and enter the following two forms:
  4.         (load "aima.lisp")
            (aima-compile)
  5. You may see some errors that say:

    "If you type continue (by typing 'continue'): The old definition will be lost."

    Type 'continue' to keep the install going.

  6. Make sure it all works by entering the form (test).

  7. This installation guide is heavily borrowed from Russell & Norvig's guide, at  http://www.cs.berkeley.edu/~russell/code/doc/install.html .