ch9 一阶逻辑中的推理 人工智能课程 北大计算机研究所

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
American(x) Weapon(y) Sells(x,y,z) Hostile(z) Criminal(x) Owns(Nono,M1) and Missile(M1)
… all of its missiles were sold to it by Colonel West
Missiles are weapons:
Missile(x) Owns(Nono,x) Sells(West,x,Nono) Missile(x) Weapon(x)

p Knows(John,x) Knows(John,x) Knows(John,x) Knows(John,x)
q Knows(John,Jane) Knows(y,OJ) Knows(y,Mother(y)) Knows(x,OJ)
θ {x/Jane}} {x/OJ,y/John}} {y/John,x/Mother(John)}} {fail}
Problems with propositionalization

Propositionalization seems to generate lots of irrelevant sentences.
E.g., from:
x King(x) Greedy(x) Evil(x) King(John) y Greedy(y) Brother(Richard,John)

量词的实例化(和) 如何将一阶推理简化为命题推理(命题化) 构造直接用于一阶语句的推理规则

合一与提升


前向链接 反向链接 归结
A first-order inference rule

We can get the inference immediately if we can find a substitution θ such that King(x) and Greedy(x) match King(John) and Greedy(y)

θ = {x/John,y/John} works

Represent the above inference process as a single inference rule—Generalized Modus Ponens (GMP)
Generalized Modus Ponens
p1', p2', … , pn', ( p1 p2 … pn q) where subst(p ‘, θ )= subst(p θ) for all i i i, subst(q,θ) p1' is King(John) p1 is King(x) p2' is Greedy(y) p2 is Greedy(x) θ is {x/John,y/John} q is Evil(x) subst(q, θ) is Evil(John)
第九章、一阶逻辑中的推理

命题与一阶推理

量词的实例化(和) 如何将一阶推理简化为命题推理(命题化) 构造直接用于一阶语句的推理规则

合一与提升


前向链接 反向链接 归结
Universal instantiation (UI)

Every instantiation of a universally quantified sentence is entailed by it:
Crown(C1) OnHead(C1,John)
Reduction(简化) to propositional inference
Suppose the KB contains just the following:
x King(x) Greedy(x) Evil(x) King(John) Greedy(John) Brother(Richard,John)

The new KB is propositionalized(命题化): proposition symbols are

Reduction contd.

Every FOL KB can be propositionalized so as to preserve entailment (中文书翻译不准确!) (A ground sentence is entailed by new KB iff entailed by original KB)
Reduction contd.
Theorem: Herbrand (1930). If a sentence α is entailed by an FOL KB, it is entailed by a finite subset of the propositionalized KB
Idea: For n = 0 to ∞ do
• Standardizing apart eliminates overlap of variables, e.g., Knows(z17,OJ) •
Unification
• To unify Knows(John,x) and Knows(y,z), •
θ = {y/John, x/z } or θ = {y/John, x/John, z/John}
Soundness of GMP
• • Need to show that p1', …, pn', (p1 … pn q) ╞ subst(q,θ) provided that subst(pi',θ) =subst( pi,θ) for all i • • Lemma: For any sentence p, we have p ╞ pθ by UI

量词的实例化(和) 如何将一阶推理简化为命题推理(命题化) 构造直接用于一阶语句的推理规则

合一与提升


前向链接 反向链接 归结
Example knowledge base

The law says that it is a crime for an American to sell weapons to hostile nations. The country Nono, an enemy of America, has some missiles, and all of its missiles were sold to it by Colonel West, who is American.

Instantiating the universal sentence in all possible ways, we have:
King(John) Greedy(John) Evil(John) King(Richard) Greedy(Richard) Evil(Richard) King(John) Greedy(John) Brother(Richard,John)
• GMP used with KB of definite clauses (exactly one positive literal) • All variables assumed universally quantified •
• GMP is called a lifted version of Modus Ponens
v α Subst({v/g}, α)

for any variable v and ground term g

E.g., x King(x) Greedy(x) Evil(x) yields:
King(John) Greedy(John) Evil(John)
Existential instantiation (EI)
create a propositional KB by instantiating with depth n terms see if α is entailed by this KB
Problem: works if α is entailed, loops if α is not entailed Theorem: Turing (1936), Church (1936) Entailment for FOL is semidecidable (algorithms exist that say yes to every entailed sentence, but no algorithm exists that also says no to every nonentailed sentence.)
1. (p1 … pn q) ╞ subst(p1 … pn q,θ) , which is equal to subst(p1θ) … subst( pnθ) subst( qθ) 2. p1', …, pn' ╞ p1' … pn' ╞ subst(p1‘,θ) … subst(pn‘,θ) 3. From 1 and 2, and the assunption, subst(qθ ) follows by ordinary Modus Ponens


it seems obvious that Evil(John), but propositionalization produces lots of facts such as Greedy(Richard) that are irrelevant

第九章、一阶逻辑中的推理

命题与一阶推理
Algorithm for finding MGU
在复合表达式如F(A, B)中,函数OP提取函数符F,ARGS提取参数表(A,B)。
Algorithm (contd)
OCCUR-CHECK:当将一个变量和一个复合过程进行匹配时,必须检查该变量是否 在该项中出现。
第九章、一阶逻辑中的推理

命题与一阶推理
Idea: propositionalize KB and query, apply resolution, return result Problem: with function symbols, there are infinitely many ground terms,



e.g., Father(Father(Father(John)))


Prove that Col. West is a criminal
Example knowledge base contd.
... it is a crime for an American to sell weapons to hostile nations:
Nono … has some missiles, i.e., x Owns(Nono,x) Missile(x):
UnificБайду номын сангаасtion
• Lifted inference rules require finding substitutions that make different logical expressions look identical. This process is called unification. • Unify(α,β) = θ if subst(α, θ )= subst(β,θ)

For any sentence α, variable v, and constant symbol k that does not appear elsewhere in the knowledge base:
v α Subst({v/k}, α)


E.g., x Crown(x) OnHead(x,John) yields:
• The first unifier is more general than the second. • • There is a single most general unifier (MGU) that is unique up to renaming of variables. •
MGU = { y/John, x/z }
相关文档
最新文档