# 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 The Lisp source code (and documentation) that accompanies the book is packaged up in the file code.tar.Z in the directory /ucb/people/russell/aima on the machine ftp.cs.berkeley.edu. To download the code, you have four choices:

1. Select code.tar.Z from your Web browser.
2. Use ftp directly. On a UNIX system, a typical ftp session looks like this:

       Computer prompts:		You type:
       ================		========
       %				cd where-you-want-the-code-to-be
       %				ftp ftp.cs.berkeley.edu
       Name:				anonymous
       Password:			your-login-name@your.mail.address
       ftp>				cd ucb/people/russell/aima
       250 CWD command successful.
       ftp>				binary
       200 Type set to I.
       ftp>				get code.tar.Z
       150 Opening ASCII connection
       226 Transfer complete.
       ftp> 				quit
       221 Goodbye.
       %				zcat code.tar.Z | tar xvf -
       %				rm code.tar.Z

3. If you don't have the zcat (or uncompress) and tar programs, or another suitable unpacking utility, you can get the files one at a time from the ftp site, or by using a web browser to the code directory.
4. If you don't have access to ftp, but do have an email account, you can retrieve the files by sending a message to ftpmail@decwrl.dec.com with the following body (or send a message with the body help to see all your options):

       	connect ftp.cs.berkeley.edu
       	binary
       	uuencode
       	get README
       	get code.tar.Z
       	quit

## 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 | Authors | Lisp Code | AI Programming | Instructors Pages