Peter Norvig's Paradigms of AI Programming implemented in Python
Python Common Lisp Prolog
Switch branches/tags
Nothing to show
Clone or download
Latest commit 907abe3 Dec 16, 2015


Python implementations of some of the classic AI programs from Peter Norvig's fantastic textbook "Paradigms of Artificial Intelligence Programming."


This is meant to be a learning resource for beginning AI programmers. Although PAIP is a fantastic book, it is no longer common for students to have a background in Lisp programming, as many universities have replaced Lisp with other languages in introductory programming and introductory artificial intelligence courses. It is my hope that making the programs from PAIP available in a commonly-taught language will provide a useful hands-on resource for beginning AI students.

The following programs are available, each with annotated source:

  • General Problem Solver, means-ends analysis problem solving
  • Eliza, a pattern-matching psychiatrist
  • Search, a collection of search algorithms
  • Logic, a library for logic programming
  • Prolog, a basic Prolog interpreter
  • Emycin, an expert system shell
  • Othello, some game-playing strategies for the Othello board game

Unit tests and some example applications are provided for each of these; see the paip/tests and paip/examples directories or the links from the annotated sources.

Getting Started

Get the source code from GitHub or just download the latest version.

Also make sure you have Python 2.7.

  • To run the examples: python and follow the prompts.
  • To run the Prolog interpreter: ./ Pass the -h flag for more details on its use and capabilities.
  • To run the unit tests: python
  • To build the documentation: python


  • fork on GitHub
  • write code in paip/
  • add unit tests in paip/tests
  • make sure all tests pass: python
  • send me a pull request


These programs were written by Daniel Connelly at Georgia Tech as an independent project supervised by Professor Ashok Goel.