Home

Awesome

<img src="paip-cover.png" title="Paradigms of Artificial Intelligence Programming" width=413>

This is an open-source repository for the book Paradigms of Artificial Intelligence Programming: Case Studies in Common Lisp by Peter Norvig (1992), and the code contained therein. The copyright has reverted to the author, who has shared it here under MIT license. On the list of most influential books for programmers. As seen on TV. See also: errata, comments, retrospective.

The book is available in these formats:

Table of Contents

The Lisp Files

The Lisp code files are listed here:

CHFilenameDescription
-examples.lispA list of example inputs taken from the book
-tutor.lispAn interpreter for running the examples
-auxfns.lispAuxiliary functions; load this before anything else
1intro.lispA few simple definitions
2simple.lispRandom sentence generator (two versions)
3overview.lisp14 versions of LENGTH and other examples
4gps1.lispSimple version of General Problem Solver
4gps.lispFinal version of General Problem Solver
5eliza1.lispBasic version of Eliza program
5eliza.lispEliza with more rules; different reader
6patmatch.lispPattern Matching Utility
6eliza-pm.lispVersion of Eliza using utilities
6search.lispSearch Utility
6gps-srch.lispVersion of GPS using the search utility
7student.lispThe Student Program
8macsyma.lispThe Macsyma Program
8macsymar.lispSimplification and integration rules for Macsyma
9-10auxfns.lispAuxiliary functions
11unify.lispUnification functions
11prolog1.lispFirst version of Prolog interpreter
11prolog.lispFinal version of Prolog interpreter
12prologc1.lispFirst version of Prolog compiler
12prologc2.lispSecond version of Prolog compiler
12prologc.lispFinal version of Prolog compiler
12prologcp.lispPrimitives for Prolog compiler
13clos.lispSome object-oriented and CLOS code
14krep1.lispKnowledge Representation code: first version
14krep2.lispKnowledge Representation code with conjunctions
14krep.lispFinal KR code: worlds and attached functions
15cmacsyma.lispEfficient Macsyma with canonical form
16mycin.lispThe Emycin expert system shell
16mycin-r.lispSome rules for a medical application of emycin
17waltz.lispA Line-Labeling program using the Waltz algorithm
18othello.lispThe Othello playing program and some strategies
18othello2.lispAdditional strategies for Othello
18edge-tab.lispEdge table for Iago strategy
19syntax1.lispSyntactic Parser
19syntax2.lispSyntactic Parser with semantics
19syntax3.lispSyntactic Parser with semantics and preferences
20unifgram.lispUnification Parser
21grammar.lispComprehensive grammar of English
21lexicon.lispSample Lexicon of English
22interp1.lispScheme interpreter, including version with macros
22interp2.lispA tail recursive Scheme interpreter
22interp3.lispA Scheme interpreter that handles call/cc
23compile1.lispSimple Scheme compiler
23compile2.lispCompiler with tail recursion and primitives
23compile3.lispCompiler with peephole optimizer
23compopt.lispPeephole optimizers for compile3.lisp

Running the Code

There is no single "application" to run. Rather, there is a collection of source code files, duplicating the code in the book. You can read and/or run whatever you like. Lisp is an interactive language, and you will need to interact with the code to get benefit from it. Some hints:

Other resources