当前位置:文档之家› 逻辑智能体-人工智能培训课件

逻辑智能体-人工智能培训课件

feature
13
人工智能原理2010年春季 广西大学 计算机学院 Dr.Ou
Exploring the Wumpus World
1. The KB initially contains the rules of the environment.
2. [1,1] The first percept is [none, none,none,none,none], Move to safe cell e.g. 2,1
16
人工智能原理2010年春季 广西大学 计算机学院 Dr.Ou
What is a logic?
• 一种格式化的语言
• 语法 Syntax – 怎样的表达是合法的 • 语义 Semantics – 一个合法的表达式表示什么样的意义
— 逻辑中每一条语句的真值都对应着世界里的一种可能
• 例如算数语言
• X+2 >= y is a sentence, x2+y is not a sentence • X+2 >= y is true in a world where x=7 and y =1 • X+2 >= y is false in a world where x=0 and y =6
怪兽问题 Wumpus World
怪兽 Wumpus
11
人工智能原理2010年春季 广西大学 计算机学院 Dr.Ou
怪兽问题的 PEAS 描述
• Performance measure 性能度量
• gold: +1000, death: -1000 • -1 per step, -10 for using the arrow
• 下图为探测到方格[1,1]什么都没有,然后向右到方格[2,1],感 知到[2,1]有微风之后的情形
20
人工智能原理2010年春季 广西大学 计算机学院 Dr.Ou
Wumpus models I
Pit Breeze
All possible models (exactly 8) in this reduced Wumpus world.
21
人工智能原理2010年春季 广西大学 计算机学院 Dr.Ou
Wumpus models II
• KB = 怪兽世界的规则 +由感知得到的观察
22
人工智能原理2010年春季 广西大学 计算机学院 Dr.Ou
Wumpus models III
α1 = “[1,2] is safe”, KB ╞ α1, 通过模型检验(model checking)得证
• Sensors 传感: Stench, Breeze, Glitter, Bump, Scream • Actuators 执行: Left turn, Right turn, Forward, Grab, Release,Shoot
12
人工智能原理2010年春季 广西大学 计算机学院 Dr.Ou
• Environment 环境
• Squares adjacent to wumpus are smelly • Squares adjacent to pit are breezy • Glitter iff gold is in the same square • Shooting kills wumpus if you are facing it. It screams • Shooting uses up the only arrow • Grabbing picks up gold if in same square • Releasing drops the gold in same square • You bump if you walk into a wall
• Environment • 9 x 9 board, each square has a mine with probability 0.1
• Actuators • Agent can mark a location as containing a mine, can mark a location as unknown, or select a location for viewing
9
人工智能原理2010年春季 广西大学 计算机学院 Dr.Ou
PEAS Analysis Mine Sweeper
• Performance measure • +1 for each mine correctly identified, -1 for incorrectly identifying a mine, -1000 for selecting a location containing a mine, +1000 for identifying all mines.
• 根据推理的规则( rules of inference )由 旧的事实推出新事实
• 逻辑 Logic 表示知识,并进行推理
5
人工智能原理2010年春季 广西大学 计算机学院 Dr.Ou
知识库 Knowledge Base
知识库 : • 一系列 语句 • 以一种 知识表示语言 的格式 • 来 表示(有关世界的)断言
rationally • Computational systems that behave
rationally
2
人工智能原理2010年春季 广西大学 计算机学院 Dr.Ou
逻辑智能体
• 逻辑(基于知识)智能体 Logic (Knowledge-Based)
agents • 通用知识 + • 当前的感知 • 在决定动作前推理(infer)出当前状态的隐含状况 • 这在部分可观察环境中至关重要
3
人工智能原理2010年春季 广西大学 计算机学院 Dr.Ou
要点
• 基于知识的智能体 Knowledge-based agents • 怪兽世界 Wumpus world • 逻辑 Logic in general • 命题逻辑与一阶逻辑
Propositional and first-order logic
3. [2,1] Breeze indicates that there is a pit in [2,2] or [3,1]
4.
Return to [1,1] to try next safe cell
14
人工智能原理2010年春季 广西大学 计算机学院 Dr.Ou
Exploring the Wumpus World
tell
ask
基于知识的智能体:
• Tell it what it needs to know. • Ask it what to do 应遵循推理的规则由知识库得
到答案
6
人工智能原理2010年春季 广西大学 计算机学院 Dr.Ou
通用的基于知识智能体 Generic KB-Based Agent
15
人工智能原理2010年春季 广西大学 计算机学院 Dr.Ou
Exploring the Wumpus World
[2,2] Detect nothing Move to unvisited safe cell e.g. [2,3]
[2,3] Detect glitter , smell, breeze Thus… pick up gold Thus… pit in [3,3] or [2,4]

可靠 Soundness: 称i 是可靠的
只要
KB
├i
α,
就有KB╞
α为真
,则
(推理不会出错,但不一定能够导出所有的正确结论)
• Sensors • Agent can sense the number of mines surrounding adjacent locations • Agent knows number of mines remaining
10
人工智能原理2010年春季 广西大学 计算机学院 Dr.Ou
7
人工智能原理2010年春季 广西大学 计算机学院 Dr.Ou
基于知识智能体的特性 • 能够:
• 表示状态和动作 • 综合新的感知 • 更新关于世界的内部认识 • 推导出世界的隐含性质 • 推导出适合的动作
8
人工智能原理2010年春季 广西大学 计算机学院 Dr.Ou
Mine Sweeper
• Design a logical agent to play minesweeper
• 则 KB ╞ α iff M(KB) M(α) • 例如 KB = Giants won and Reds won α = Giants won
19
人工智能原理2010年春季 广西大学 计算机学院 Dr.Ou
怪兽问题里的蕴涵 Entailment in the wumpus world
• 为说明方便,对Wumpus world进行简化,只考虑有关陷阱的 模型
• 又如, x+y = 4 蕴涵 4 = x+y
• 蕴涵其实就是语句之间基于语义的一种关系
18
人工智能原理2010年春季 广西大学 计算机学院 Dr.Ou
ห้องสมุดไป่ตู้
模型 models
• 逻辑学家的就是以模型的方式来进行思维的 • 如果α在m中为真,则m是语句α的一个模型 • M(α) 表示语句α的所有模型的集合
• 推理,合法,等价,可满足 • 模式推理 Reasoning patterns
—归结 Resolution —前向/后向链 Forward/backward chaining
4
人工智能原理2010年春季 广西大学 计算机学院 Dr.Ou
知识和推理 Knowledge & Reasoning
相关主题