Downloading and Installing Lisp Code for AIMA

This page gives instructions for retrieving the code for the book, and installing it on your local system. This installation procedure need only be followed once. If you are using the book in a course, your instructor (or an assistant) will probably do this for you, and you can move on to using the code.

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 (900KB), or the file code.tar.Z (200KB) if you have the compress program, or code.tar.gz 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).
  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.

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.

  3. Depending on your version of Lisp, you may need to edit the parameter *aima-binary-type* to indicate the type of files created by your Lisp compiler. If the compiler creates files of the form "name.bin", then set this parameter to "bin". Do include the double-quote marks.

  4. Start up your Common Lisp, and enter the following two forms:
    	(load "aima.lisp")
    	(aima-compile)
    

  5. Most versions of Lisp provide a way to dump out an image -- an executable file that contains all the code that has been loaded so far. If your Lisp has this feature, it might be a good idea to create such an image at this point, and save it for later use.

    Then exit from Lisp (and if you like, you can remove write-permission from this directory and its sub-directories).


AIMA Home Contact Russell & Norvig What's new Changed 3/13/97