+ All Categories
Home > Documents > 人工智能 Artificial Intelligence

人工智能 Artificial Intelligence

Date post: 12-Jan-2016
Category:
Upload: vilina
View: 130 times
Download: 0 times
Share this document with a friend
Description:
人工智能 Artificial Intelligence. 专家系统. 专家系统( Expert System )是人工智能应用研究最活跃和最广泛的领域之一。 I965 年斯坦福大学的费根鲍姆和化学家勒德贝格合作研制 DENDRAL 系统,使得人工智能的研究从面向基本技术和基本方法的理论研究走向解决实际问题的具体研究,从探索广泛的普遍规律转向知识的工程应用,体现知识的巨大力量。. 本章主要内容. 概述 专家系统基本结构 专家系统工具 CLIPS 面向对象专家系统工具 OKPS. 概述( 1 ). - PowerPoint PPT Presentation
35
Artificial Intelligence Expert System: 1 © Graduate University , Chinese academy of Sciences. 人人人人 Artificial Intelligence
Transcript
Page 1: 人工智能 Artificial Intelligence

Artificial Intelligence Expert System: 1

© G

rad

uat

e University

, C

hin

ese

acad

emy

of

Sci

ence

s.

人工智能Artificial Intelligence

Page 2: 人工智能 Artificial Intelligence

Artificial Intelligence Expert System: 2

© G

rad

uat

e University

, C

hin

ese

acad

emy

of

Sci

ence

s.

专家系统

Page 3: 人工智能 Artificial Intelligence

Artificial Intelligence Expert System: 3

© G

rad

uat

e University

, C

hin

ese

acad

emy

of

Sci

ence

s.

• 专家系统( Expert System )是人工智能应用研究最活跃和最广泛的领域之一。

• I965 年斯坦福大学的费根鲍姆和化学家勒德贝格合作研制DENDRAL 系统,使得人工智能的研究从面向基本技术和基本方法的理论研究走向解决实际问题的具体研究,从探索广泛的普遍规律转向知识的工程应用,体现知识的巨大力量。

Page 4: 人工智能 Artificial Intelligence

Artificial Intelligence Expert System: 4

© G

rad

uat

e University

, C

hin

ese

acad

emy

of

Sci

ence

s.

本章主要内容

• 概述• 专家系统基本结构• 专家系统工具 CLIPS

• 面向对象专家系统工具 OKPS

Page 5: 人工智能 Artificial Intelligence

Artificial Intelligence Expert System: 5

© G

rad

uat

e University

, C

hin

ese

acad

emy

of

Sci

ence

s.

概述( 1 )

• 专家系统是一类具有专门知识和经验的计算机智能程序系统,通过对人类专家的问题求解能力的建模,采用人工智能中的知识表示和知识推理技术来模拟通常由专家才能解决的复杂问题,达到具有与专家同等解决问题能力的水平。

• 这种基于知识的系统设计方法是以知识库和推理机为中心而展开的,即

专家系统 = 知识库 + 推理机• 专家系统把知识从系统中与其他部分分离开来。专家系统强

调的是知识而不是方法。很多问题没有基于算法的解决方案,或算法方案太复杂,采用专家系统,可以利用人类专家拥有丰富的知识,因此专家系统也称为基于知识的系统( Knowledge-Based Systems )。

Page 6: 人工智能 Artificial Intelligence

Artificial Intelligence Expert System: 6

© G

rad

uat

e University

, C

hin

ese

acad

emy

of

Sci

ence

s.

概述( 2 )

• 一个专家系统应该具备以下三个要素:

( 1 )具备某个应用领域的专家级知识;

( 2 )能模拟专家的思维;

( 3 )能达到专家级的解题水平。• 建造一个专家系统的过程可以称为“知识工程”,它是把软件工程的思

想应用于设计基于知识的系统。知识工程包括下面几个方面:

( 1 )从专家那里获取系统所用的知识(即知识获取)

( 2 )选择合适的知识表示形式(即知识表示)

( 3 )进行软件设计

( 4 )以合适的计算机编程语言实现。

Page 7: 人工智能 Artificial Intelligence

Artificial Intelligence Expert System: 7

© G

rad

uat

e University

, C

hin

ese

acad

emy

of

Sci

ence

s.

概述( 3 )

• 专家系统的特点

(1) 启发性

(2) 透明性

(3) 灵活性

(4) 交互性

(5) 实用性

(6) 易推广

Page 8: 人工智能 Artificial Intelligence

Artificial Intelligence Expert System: 8

© G

rad

uat

e University

, C

hin

ese

acad

emy

of

Sci

ence

s.

概述( 4 )

• 专家系统的发展史 • 1977 年美国斯坦福大学计算机科学家费根鲍姆 (E.A.Feigenballm) 在第

五届国际人工智能联合会议上提出知识工程的新概念。 20 世纪 80 年代以来,在知识工程的推动下,涌现出了不少专家系统开发工具,例如EMYCIN 、 CLIPS(OPS5, OPS83) 、 G2 、 KEE 、 OKPS 等。

• 1977 年,基于关幼波先生的经验,研制成功了我国第一个“中医肝病诊治专家系统”。

• 1985 年 10 月中科院合肥智能所熊范纶建成“砂姜黑土小麦施肥专家咨询系统”, 这是我国第一个农业专家系统。

• 中科院计算所史忠植与东海水产研究所等合作,研制了东海渔场预报专家系统。在专家系统开发工具方面,

• 中科院数学研究所研制了专家系统开发环境“天马”,• 中科院计算所研制了面向对象专家系统开发工具“ OKPS” 。

Page 9: 人工智能 Artificial Intelligence

Artificial Intelligence Expert System: 9

© G

rad

uat

e University

, C

hin

ese

acad

emy

of

Sci

ence

s.

概述( 5 )

专家系统开发工具• 人工智能语言: LISP , Prolog, C/C++,Java

• 专家系统外壳 :又称为骨架系统,从成功应用的专家系统演变而来的。如:

MYCIN-------------------->E-MYCIN

PROSPECTOR的知识获取系统 ----->KAS

• 通用型专家系统工具: OPS系列, CLIPS(JESS):规则型 ART:规则 +框架

• 专家系统开发环境: ES开发的工具包,提供多种方便的构件

Page 10: 人工智能 Artificial Intelligence

Artificial Intelligence Expert System: 10

© G

rad

uat

e University

, C

hin

ese

acad

emy

of

Sci

ence

s.

概述( 6 )

• 新一代专家系统的研究– 分布协同式的体系结构

• 任务分布• 合作策略

– 知识的自动获取• KB尚未建立时知识的获取• ES运行过程中,知识的获取

– 深层知识的利用– 知识的表示和推理

Page 11: 人工智能 Artificial Intelligence

Artificial Intelligence Expert System: 11

© G

rad

uat

e University

, C

hin

ese

acad

emy

of

Sci

ence

s.

本章主要内容

• 概述

• 专家系统基本结构• 专家系统工具 CLIPS

• 面向对象专家系统工具 OKPS

Page 12: 人工智能 Artificial Intelligence

Artificial Intelligence Expert System: 12

© G

rad

uat

e University

, C

hin

ese

acad

emy

of

Sci

ence

s.

专家系统的基本结构 (1)

Page 13: 人工智能 Artificial Intelligence

Artificial Intelligence Expert System: 13

© G

rad

uat

e University

, C

hin

ese

acad

emy

of

Sci

ence

s.

专家系统的基本结构 (2)

• 知识库是问题求解所需要的领域知识的集合,包括基本事实、规则和其他有关信息。知识的表示形式可以是多种多样的,包括框架、规则、语义网络等等。

• 推理机是实施问题求解的核心执行机构,它实际上是对知识进行解释的程序,根据知识的语义,对按一定策略找到的知识进行解释执行,并把结果记录到动态库的适当空间中。推理机的程序与知识库的具体内容无关,即推理机和知识库是分离的,这是专家系统的重要特征。它的优点是对知识库的修改无须改动推理机,但是纯粹的形式推理会降低问题求解的效率。将推理机和知识库相结合也不失为一种可选方法。

Page 14: 人工智能 Artificial Intelligence

Artificial Intelligence Expert System: 14

© G

rad

uat

e University

, C

hin

ese

acad

emy

of

Sci

ence

s.

专家系统的基本结构 (3)

• 知识获取负责建立、修改和扩充知识库,是专家系统中把问题求解的各种专门知识从人类专家的头脑中或其他知识源那里转换到知识库中的一个重要机构。

• 人机界面是系统与用户进行交流时的界面。• 综合数据库也称为动态库或工作存储器,是反映当前问题求

解状态的集合,用于存放系统运行过程中所产生的所有信息,以及所需要的原始数据,包括用户输入的信息、推理的中间结果、推理过程的记录等。

• 解释器用于对求解过程做出说明,并回答用户的提问。两个最基本的问题是“ why” 和“ how” 。

Page 15: 人工智能 Artificial Intelligence

Artificial Intelligence Expert System: 15

© G

rad

uat

e University

, C

hin

ese

acad

emy

of

Sci

ence

s.

本章主要内容

• 概述• 专家系统基本结构

•专家系统工具 CLIPS• 面向对象专家系统工具 OKPS

Page 16: 人工智能 Artificial Intelligence

Artificial Intelligence Expert System: 16

© G

rad

uat

e University

, C

hin

ese

acad

emy

of

Sci

ence

s.

专家系统工具 CLIPS(1)

• 早期的专家系统工具大都用 LISP 、 Prolog 等编程语言开发, 它们的共同问题是运行速度慢,可移植性差, 解决复杂问题的能力差。

• 为此, 1984 年美国航空航天局约翰逊空间中心( NASA’s Johnson Space Center )推出 CLIPS ( C Language Integrated Production System )。

• CLIPS 是一个基于 Rete 算法的前向推理语言,用标准 C 语言编写。它具有高移植性、高扩展性、强大的知识表达能力和编程方式以及低成本等特点。

Page 17: 人工智能 Artificial Intelligence

Artificial Intelligence Expert System: 17

© G

rad

uat

e University

, C

hin

ese

acad

emy

of

Sci

ence

s.

专家系统工具 CLIPS(2)

CLIPS 中的知识表示 1. 字段• 在 CLIPS 中,把从键盘或文件读入的一组有特定意义的字符叫做一个“令牌( token )”,它是 CLIPS 的基本语言符号单位。

• 字段( field )是由一组令牌组成的,是 CLIPS 中知识表示的基本单位。字段可以是常量也可以是变量, CLIPS 有七种字段,它们是 CLIPS 的原始数据类型:整型( Integer )、浮点型( Float )、符号型( Symbol )、字符串型( String )、外部地址( External address )、示例名( Instance name )和示例地址( Instance address )。

Page 18: 人工智能 Artificial Intelligence

Artificial Intelligence Expert System: 18

© G

rad

uat

e University

, C

hin

ese

acad

emy

of

Sci

ence

s.

专家系统工具 CLIPS(3)

CLIPS 中的知识表示 2. 事实• 在 CLIPS 中,事实由关系名,后面跟着零个或多个槽(也称为符号字段

)以及它们的相关值组成。• 事实分为两类:自定义模板事实( deftemplate fact )和有序事实

( ordered fact )。• 自定义模板结构的一般格式为: (deftemplate <relation-name> [<optional comment> ]

<slot-definition>*)

<slot-definition> 的定义可以为: ( slot <slot-name> ) | ( multislot <slot-name>)

Page 19: 人工智能 Artificial Intelligence

Artificial Intelligence Expert System: 19

© G

rad

uat

e University

, C

hin

ese

acad

emy

of

Sci

ence

s.

专家系统工具 CLIPS(4)

CLIPS 中的知识表示 3. 规则• 在 CLIPS 语言中,规则表示为如下形式: ( defrule <rule-name> [<comment>]

<patterns>* ; Left-Hand Side(LHS) of the rule

<actions>* ) ; Right-Hand Side(RHS) of the rule

• 其中, rule-name 为规则名, patterns 为一组模式, actions 为一组动作

Page 20: 人工智能 Artificial Intelligence

Artificial Intelligence Expert System: 20

© G

rad

uat

e University

, C

hin

ese

acad

emy

of

Sci

ence

s.

CLIPS 结构图

WORKINGMEMORY

RULE BASE

EXECUTIONENGINE

INFERENCEENGINE

PATTERNMATCHER

AGENDA

Page 21: 人工智能 Artificial Intelligence

Artificial Intelligence Expert System: 21

© G

rad

uat

e University

, C

hin

ese

acad

emy

of

Sci

ence

s.

CLIPS 的匹配算法( 1 )• 模式一般是指组成规则前提的基本的单位,每个模式由一个或

多个字段组成。 • 可满足规则:一个规则称为可满足的,若规则的每一模式均能

在当前工作存储器中找到可匹配的事实,且模式之间的同一变量能取得统一的约束值 。即

r : P1 P2 … PnQ1Q2… Qm

若存在一个置换,使得对每一个模式 Pi ,在工作存储器中有一个元素 Wi满足

Pi= Wi, i=1, 2, …, n

作用在某个模式的结果称为模式实例,作用在整个规则的结果称为规则实例。

Page 22: 人工智能 Artificial Intelligence

Artificial Intelligence Expert System: 22

© G

rad

uat

e University

, C

hin

ese

acad

emy

of

Sci

ence

s.

CLIPS匹配算法( 2 )

• Rete 算法 – 是一个快速的模式匹配器,它通过在网络上存储

规则信息来提高速度 – 由于在每一个识别动作循环中,那些没有变化的数据可以不用考虑,因此可以大大提高事实与前件的匹配速度。

– 类似 Rete 算法的一些快速模式匹配算法的出现,奠定了专家系统走向实用的基础。

Page 23: 人工智能 Artificial Intelligence

Artificial Intelligence Expert System: 23

© G

rad

uat

e University

, C

hin

ese

acad

emy

of

Sci

ence

s.

CLIPS匹配算法( 3 )

• Rete 算法的基本思想 – 该算法快速匹配的重要依据为:

•时间冗余性:工作存储器中的内容在推理过程中的变化是缓慢的,即在每个执行周期中,增删的事实只占很小的比例

•结构相似性:许多规则常常包括类似的模式和模式组 – Rete 算法的基本思想是保存过去匹配过程中留下的全部信息,以空间代价来换取产生式系统的执行效率

Page 24: 人工智能 Artificial Intelligence

Artificial Intelligence Expert System: 24

© G

rad

uat

e University

, C

hin

ese

acad

emy

of

Sci

ence

s.

CLIPS匹配算法( 4 )

• Rete匹配网络结构 – Rete 算法的核心是建立 Rete匹配网络结构。这一网络

结构由模式网络和连接网络两部分构成。其中,模式网络记录每一模式各域的测试条件,每一测试条件对应于网络的一个域结点,每一模式的所有域结点依次连起来,构成模式网络的一条匹配链。

– 在每一模式匹配链的终结点上都有一个寄存器来记录所有能与该模式匹配的事实集合,即模式实例集,这种寄存器称为寄存器。

Page 25: 人工智能 Artificial Intelligence

Artificial Intelligence Expert System: 25

© G

rad

uat

e University

, C

hin

ese

acad

emy

of

Sci

ence

s.

CLIPS匹配算法( 5 )

• 模式网络

若两个模式的前k个域相同,则它们可以共享k个域结点。

• 连接网络

用于检查同一规则不同模式之间因同名变量而带来的相应模式实例之间的相互约束关系,以保证同名变量取值的一致性。

Page 26: 人工智能 Artificial Intelligence

Artificial Intelligence Expert System: 26

© G

rad

uat

e University

, C

hin

ese

acad

emy

of

Sci

ence

s.

CLIPS匹配算法( 6 )• 定义 称满足相互约束条件的 k个模式实例为可满足的 k— 模

式实例。

显然,寄存器中所有非空模式实例均为 1—模式实例,且是可满足的

• 可满足的 k— 模式实例存在寄存器 k中,寄存器可以看成寄存器 1。

• 在连接网络中,每一连接点有两个输入,一个来自含有 1—模式实例的寄存器,另一个来自含有可满足的 k— 模式实例集的寄存器 (k=1) 或寄存器 k (k>1),连接点指出两组输入模式实例的约束条件,输出可满足的 (k+1)— 模式实例集,存入寄存器 k+! 。

Page 27: 人工智能 Artificial Intelligence

Artificial Intelligence Expert System: 27

© G

rad

uat

e University

, C

hin

ese

acad

emy

of

Sci

ence

s.

CLIPS匹配算法( 7 )

• Rete网络匹配过程

Rete网络匹配过程由模式网络上的模式匹配和连接网络上的部分匹配两部分构成。– 在模式网络的机器内部表示中,我们把共享一个父结点的

所有结点表示成一条共享链,同时,把每一模式匹配链中的结点表示成一条下拉链,于是,每一结点由共享链和下拉链指向其后继结点,模式网络就是一棵可以使用典型遍历算法进行测试的二叉树。

– 模式网络上的模式匹配过程就是上述二叉树的条件遍历过程

Page 28: 人工智能 Artificial Intelligence

Artificial Intelligence Expert System: 28

© G

rad

uat

e University

, C

hin

ese

acad

emy

of

Sci

ence

s.

CLIPS 匹配算法( 8 )– 模式网络上的模式匹配过程一旦结束,便开始连接网络

上的部分匹配过程,其作用是:根据每一模式寄存器的变化,激活相应的连接网络,并修改寄存器的内容。

Page 29: 人工智能 Artificial Intelligence

Artificial Intelligence Expert System: 29

© G

rad

uat

e University

, C

hin

ese

acad

emy

of

Sci

ence

s.

CLIPS 匹配算法( 9 )

• Rete 算法也存在很大的局限性 – 这对于大型专家系统,特别是专家数据库系统的实现,弄

不好易导致组合爆炸 – 采用固定的模式连接次序,从而影响了执行效率的提高

Page 30: 人工智能 Artificial Intelligence

Artificial Intelligence Expert System: 30

© G

rad

uat

e University

, C

hin

ese

acad

emy

of

Sci

ence

s.

本章主要内容

• 概述• 专家系统基本结构• 专家系统工具 CLIPS

• 面向对象专家系统工具 OKPS

Page 31: 人工智能 Artificial Intelligence

Artificial Intelligence Expert System: 31

© G

rad

uat

e University

, C

hin

ese

acad

emy

of

Sci

ence

s.

面向对象专家系统工具 OKPS

• OKPS 是中国科学院计算技术研究所智能科学开放实验室研制的面向对象知识处理系统( Object-oriented Knowledge Processing System ,简称 OKPS )。

• 它采用面向对象的知识表示方法来描述和存贮知识,可以通过所见即所得的可视化工具,对具体的应用建立专家知识库。

Page 32: 人工智能 Artificial Intelligence

Artificial Intelligence Expert System: 32

© G

rad

uat

e University

, C

hin

ese

acad

emy

of

Sci

ence

s.

OKPS 中的知识表示 ( 1 )• OKPS 采用面向对象的概念和技术实现了一种知识表示方法

,并且还吸收了框架理论和语义网络中的一些特点。• OKPS 的知识库是由对象组成的。一个对象可以拥有自己的属性( Property )和方法( Method )。对象的属性可以存贮整型、浮点型或字符串型的值。方法用来存贮这个对象在推理过程中所要执行的操作。这些操作可以是访问对象的属性,向系统发送消息,也可以是使用系统提供的资源和服务等。

• 知识库中的对象有序地组成一种树型结构

Page 33: 人工智能 Artificial Intelligence

Artificial Intelligence Expert System: 33

© G

rad

uat

e University

, C

hin

ese

acad

emy

of

Sci

ence

s.

OKPS 中的知识表示 ( 2 )• 现在假设我们要将羊这种动物在分类树中进行定位。在专家

系统推理过程中,根据知识库中存贮的各种分类知识,系统将由最顶层开始,根据羊这一对象所具有的各种属性,与分类树中各个类的属性进行匹配,层层深入,直到不需要再进一步区分为止

动物

脊椎动物 无脊椎动物

哺乳动物 鸟类 鱼类

鹰 企鹅羊 鲤鱼 鲨鱼老虎

Page 34: 人工智能 Artificial Intelligence

Artificial Intelligence Expert System: 34

© G

rad

uat

e University

, C

hin

ese

acad

emy

of

Sci

ence

s.

OKPS 中的知识表示 ( 3 )• 正向推理时,要先解决其下层的子问题,才能解决该问题本身的目标。推理过程是一个自下而上的过程。求解过程最后终结于根结点的对象

• 为了能够适应灵活的推理方式, OKPS 在每个对象中加入不同的方法,来针对不同的推理阶段作相应的处理。每个节点的对象都有三种方法:先序、中序和后序。这三种方法在推理过程中是按照不同的次序执行的。在默认的控制下,这个过程是一个从问题根节点对象开始的深度优先遍历。

• OKPS 中采用的面向对象的知识表示方法也结合了语义网络和框架系统的一些特点。

Page 35: 人工智能 Artificial Intelligence

Artificial Intelligence Expert System: 35

© G

rad

uat

e University

, C

hin

ese

acad

emy

of

Sci

ence

s.

OKPS 推理控制语言

• 为了提供功能足够强大的推理机制,并最大限度地保持灵活性和方便性, OKPS 系统提供了一种专用的推理控制语言( Inference Control Language , ICL ),用来描述专家知识与规则,以及控制推理过程。

• ICL 采用解释执行的方式,应用于每个对象的方法中


Recommended