《人工智能程序设计范例》Lisp 代码

《人工智能程序设计范例》教材的 Lisp 代码。「Lisp code for the textbook "Paradigms of Artificial Intelligence Programming"」

Github stars Tracking Chart

人工智能程序设计范例

这是 peternorvig(1992)出版的《人工智能编程范例:公共 Lisp 中的案例研究》一书的开源资源库,以及其中包含的代码。版权归作者所有,作者是在麻省理工学院的许可下分享的。

这本书

本书提供以下格式:

  • pdf:扫描版本 参见发布
  • text:PAIP.txt (从 OCR'ing 扫描的pdf,包含许多错误 )
  • epub:参见发布 从 Safari 下载的清理后的版本(比扫描的版本干净得多)
  • 还有 chapter?.md markdown 文件:

目录

就像在 TV上看到的那样。另见:勘误表, 评论, 回顾

Lisp 文件

Lisp 代码文件如下所示:

CH 文件名 说明
- examples.lisp 从书中获得的示例输入列表
- tutor.lisp 运行示例的解释程序
- auxfns.lisp 辅助函数;先加载此函数
1 intro.lisp 几个简单的定义
2 simple.lisp 随机句子生成器(两个版本)
3 overview.lisp 14个版本的 LENGTH 和其他例子
4 gps1.lisp 通用问题求解器的简单版本
4 gps.lisp 通用问题求解器的最终版本
5 eliza1.lisp 基本版 Eliza 程序
5 eliza.lisp Eliza 有更多的规则;不同的读者
6 patmatch.lisp 模式匹配实用程序
6 eliza-pm.lisp 使用实用程序的 Eliza 版本
6 search.lisp 搜索实用工具
6 gps-srch.lisp 使用搜索工具的 GPS 版本
7 student.lisp 学生计划
8 macsyma.lisp Macsyma 程序
8 macsymar.lisp Macsyma 的简化和集成规则
9-10 (functions from these chapters are in auxfns.lisp)
11 unify.lisp 统一的函数
11 prolog1.lisp Prolog 解释器的第一个版本
11 prolog.lisp Prolog解释器的最终版本
12 prologc1.lisp Prolog 编译器的第一个版本
12 prologc2.lisp Prolog 编译器的第二个版本
12 prologc.lisp Prolog 编译器的最终版本
12 prologcp.lisp Prolog 编译器原语
13 clos.lisp 一些面向对象和 CLOS 代码
14 krep1.lisp 知识表示代码:第一版
14 krep2.lisp 带连接的知识表示代码
14 krep.lisp 最终的KR代码:worlds 和附加函数
15 cmacsyma.lisp 正则形式的有效 Macsyma
16 mycin.lisp Emycin 专家系统 shell
16 mycin-r.lisp emycin 的一些医学应用规则
17 waltz.lisp 基于 Waltz 算法的直线标记程序
18 othello.lisp Othello 的游戏程序和一些策略
18 othello2.lisp Othello 的附加策略
18 edge-tab.lisp Iago 策略的边缘表
19 syntax1.lisp 语法分析器
19 syntax2.lisp 语义句法分析器
19 syntax3.lisp 具有语义和偏好的语法分析器
20 unifgram.lisp 统一的解析器
21 grammar.lisp 英语综合语法
21 lexicon.lisp 英语词典范本
22 interp1.lisp Scheme 解释器,包括带有宏的版本
22 interp2.lisp 尾部递归方案解释器
22 interp3.lisp 处理 call/cc 的模式解释器
23 compile1.lisp 简单的模式编译器
23 compile2.lisp 带有尾递归和原语的编译器
23 compile3.lisp 带有窥视孔优化器的编译器
23 compopt.lisp compile3.lisp 的窥视孔优化器

运行代码

没有一个“应用程序”可以运行。相反,这里有一个源代码文件的集合,复制了书中的代码。你可以随意阅读和/或跑步。Lisp是一种交互式语言,您需要与代码交互才能从中获益。一些提示:

  • 您需要一个通用的 Lisp 解释器/编译器/环境。下面是对选项的讨论
  • 你总是需要的(auxfns.lisp 文件)。
  • 对于要使用的各种文件实例,您将需要(requires "file")。(如果 requires 不能在您的系统上正常工作,您可能需要在 auxfns.lisp 文件。
  • 函数 do examples 可以用作参数:all 或一个章节号或一个章节号列表,可以用来查看各种函数的使用示例。例如,(do-examples 1)展示了第一章的例子。通过这样做来访问它(requires "examples")。

其他资源

我为这本书写了一篇回顾文章。

有一个不错的 Python 版本 的代码,由乔治亚理工大学开发。


(The first version translated by vz on 2020.10.24)

Overview

Name With Ownernorvig/paip-lisp
Primary LanguageCommon Lisp
Program languageCommon Lisp (Language Count: 3)
PlatformLinux, Mac, Windows
License:MIT License
Release Count5
Last Release Namev1.3 (Posted on )
First Release Namev1.0 (Posted on )
Created At2018-02-05 22:02:34
Pushed At2023-10-16 07:02:51
Last Commit At
Stargazers Count7k
Watchers Count236
Fork Count697
Commits Count646
Has Issues Enabled
Issues Count51
Issue Open Count24
Pull Requests Count126
Pull Requests Open Count4
Pull Requests Close Count9
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private

Paradigms of Artificial Intelligence Programming

PAIP

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.

The Book

The book is available in these formats:

Table of Contents

As seen on TV. See also: errata, comments, retrospective.

The Lisp Files

The Lisp code files are listed here:

To the top