AI Unit - 6 - (WWW - Jntumaterials.in) PDF
AI Unit - 6 - (WWW - Jntumaterials.in) PDF
org
100% free SMS:- ON<space>UandiStar to 9870807070 for JNTU, Job Alerts, Tech News , GK News directly to ur Mobile
for more :- http://www.UandiStar.org
Outline
♦ Reducing first-order inference to propositional inference
♦ Unification
♦ Generalized Modus Ponens
♦ Forward and backward chaining
♦ Logic programming
♦ Resolution
Chapter 9 2
100% free SMS:- ON<space>UandiStar to 9870807070 for JNTU, Job Alerts, Tech News , GK News directly to ur Mobile
for more :- http://www.UandiStar.org
Chapter 9 3
100% free SMS:- ON<space>UandiStar to 9870807070 for JNTU, Job Alerts, Tech News , GK News directly to ur Mobile
for more :- http://www.UandiStar.org
Chapter 9 4
100% free SMS:- ON<space>UandiStar to 9870807070 for JNTU, Job Alerts, Tech News , GK News directly to ur Mobile
for more :- http://www.UandiStar.org
Chapter 9 5
100% free SMS:- ON<space>UandiStar to 9870807070 for JNTU, Job Alerts, Tech News , GK News directly to ur Mobile
for more :- http://www.UandiStar.org
Chapter 9 6
100% free SMS:- ON<space>UandiStar to 9870807070 for JNTU, Job Alerts, Tech News , GK News directly to ur Mobile
for more :- http://www.UandiStar.org
Chapter 9 7
100% free SMS:- ON<space>UandiStar to 9870807070 for JNTU, Job Alerts, Tech News , GK News directly to ur Mobile
for more :- http://www.UandiStar.org
Reduction contd.
Claim: a ground sentence∗ is entailed by new KB iff entailed by original KB
Claim: every FOL KB can be propositionalized so as to preserve entailment
Idea: propositionalize KB and query, apply resolution, return result
Problem: with function symbols, there are infinitely many ground terms,
e.g., F ather(F ather(F ather(John)))
Theorem: Herbrand (1930). If a sentence α is entailed by an FOL KB,
it is entailed by a finite subset of the propositional KB
Idea: For n = 0 to ∞ do
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 in FOL is semidecidable
Chapter 9 8
100% free SMS:- ON<space>UandiStar to 9870807070 for JNTU, Job Alerts, Tech News , GK News directly to ur Mobile
for more :- http://www.UandiStar.org
Chapter 9 9
100% free SMS:- ON<space>UandiStar to 9870807070 for JNTU, Job Alerts, Tech News , GK News directly to ur Mobile
for more :- http://www.UandiStar.org
Unification
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
Unify(α, β) = θ if αθ = βθ
p q θ
Knows(John, x) Knows(John, Jane)
Knows(John, x) Knows(y, OJ)
Knows(John, x) Knows(y, M other(y))
Knows(John, x) Knows(x, OJ)
Chapter 9 10
100% free SMS:- ON<space>UandiStar to 9870807070 for JNTU, Job Alerts, Tech News , GK News directly to ur Mobile
for more :- http://www.UandiStar.org
Unification
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
Unify(α, β) = θ if αθ = βθ
p q θ
Knows(John, x) Knows(John, Jane) {x/Jane}
Knows(John, x) Knows(y, OJ)
Knows(John, x) Knows(y, M other(y))
Knows(John, x) Knows(x, OJ)
Chapter 9 11
100% free SMS:- ON<space>UandiStar to 9870807070 for JNTU, Job Alerts, Tech News , GK News directly to ur Mobile
for more :- http://www.UandiStar.org
Unification
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
Unify(α, β) = θ if αθ = βθ
p q θ
Knows(John, x) Knows(John, Jane) {x/Jane}
Knows(John, x) Knows(y, OJ) {x/OJ, y/John}
Knows(John, x) Knows(y, M other(y))
Knows(John, x) Knows(x, OJ)
Chapter 9 12
100% free SMS:- ON<space>UandiStar to 9870807070 for JNTU, Job Alerts, Tech News , GK News directly to ur Mobile
for more :- http://www.UandiStar.org
Unification
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
Unify(α, β) = θ if αθ = βθ
p q θ
Knows(John, x) Knows(John, Jane) {x/Jane}
Knows(John, x) Knows(y, OJ) {x/OJ, y/John}
Knows(John, x) Knows(y, M other(y)) {y/John, x/M other(John)}
Knows(John, x) Knows(x, OJ)
Chapter 9 13
100% free SMS:- ON<space>UandiStar to 9870807070 for JNTU, Job Alerts, Tech News , GK News directly to ur Mobile
for more :- http://www.UandiStar.org
Unification
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
Unify(α, β) = θ if αθ = βθ
p q θ
Knows(John, x) Knows(John, Jane) {x/Jane}
Knows(John, x) Knows(y, OJ) {x/OJ, y/John}
Knows(John, x) Knows(y, M other(y)) {y/John, x/M other(John)}
Knows(John, x) Knows(x, OJ) f ail
Standardizing apart eliminates overlap of variables, e.g., Knows(z17, OJ)
Chapter 9 14
100% free SMS:- ON<space>UandiStar to 9870807070 for JNTU, Job Alerts, Tech News , GK News directly to ur Mobile
for more :- http://www.UandiStar.org
Chapter 9 15
100% free SMS:- ON<space>UandiStar to 9870807070 for JNTU, Job Alerts, Tech News , GK News directly to ur Mobile
for more :- http://www.UandiStar.org
Soundness of GMP
Need to show that
p10, . . . , pn0, (p1 ∧ . . . ∧ pn ⇒ q) |= qθ
provided that pi0θ = piθ for all i
Lemma: For any definite clause p, we have p |= pθ by UI
1. (p1 ∧ . . . ∧ pn ⇒ q) |= (p1 ∧ . . . ∧ pn ⇒ q)θ = (p1θ ∧ . . . ∧ pnθ ⇒ qθ)
2. p10, . . . , pn0 |= p10 ∧ . . . ∧ pn0 |= p10θ ∧ . . . ∧ pn0θ
3. From 1 and 2, qθ follows by ordinary Modus Ponens
Chapter 9 16
100% free SMS:- ON<space>UandiStar to 9870807070 for JNTU, Job Alerts, Tech News , GK News directly to ur Mobile
for more :- http://www.UandiStar.org
Chapter 9 17
100% free SMS:- ON<space>UandiStar to 9870807070 for JNTU, Job Alerts, Tech News , GK News directly to ur Mobile
for more :- http://www.UandiStar.org
Chapter 9 18
100% free SMS:- ON<space>UandiStar to 9870807070 for JNTU, Job Alerts, Tech News , GK News directly to ur Mobile
for more :- http://www.UandiStar.org
Chapter 9 19
100% free SMS:- ON<space>UandiStar to 9870807070 for JNTU, Job Alerts, Tech News , GK News directly to ur Mobile
for more :- http://www.UandiStar.org
Chapter 9 20
100% free SMS:- ON<space>UandiStar to 9870807070 for JNTU, Job Alerts, Tech News , GK News directly to ur Mobile
for more :- http://www.UandiStar.org
Chapter 9 21
100% free SMS:- ON<space>UandiStar to 9870807070 for JNTU, Job Alerts, Tech News , GK News directly to ur Mobile
for more :- http://www.UandiStar.org
Chapter 9 22
100% free SMS:- ON<space>UandiStar to 9870807070 for JNTU, Job Alerts, Tech News , GK News directly to ur Mobile
for more :- http://www.UandiStar.org
Chapter 9 23
100% free SMS:- ON<space>UandiStar to 9870807070 for JNTU, Job Alerts, Tech News , GK News directly to ur Mobile
for more :- http://www.UandiStar.org
Chapter 9 24
100% free SMS:- ON<space>UandiStar to 9870807070 for JNTU, Job Alerts, Tech News , GK News directly to ur Mobile
for more :- http://www.UandiStar.org
Chapter 9 25
100% free SMS:- ON<space>UandiStar to 9870807070 for JNTU, Job Alerts, Tech News , GK News directly to ur Mobile
for more :- http://www.UandiStar.org
Chapter 9 26
100% free SMS:- ON<space>UandiStar to 9870807070 for JNTU, Job Alerts, Tech News , GK News directly to ur Mobile
for more :- http://www.UandiStar.org
Criminal(West)
Chapter 9 27
100% free SMS:- ON<space>UandiStar to 9870807070 for JNTU, Job Alerts, Tech News , GK News directly to ur Mobile
for more :- http://www.UandiStar.org
Chapter 9 28
100% free SMS:- ON<space>UandiStar to 9870807070 for JNTU, Job Alerts, Tech News , GK News directly to ur Mobile
for more :- http://www.UandiStar.org
Chapter 9 29
100% free SMS:- ON<space>UandiStar to 9870807070 for JNTU, Job Alerts, Tech News , GK News directly to ur Mobile
for more :- http://www.UandiStar.org
Chapter 9 30
100% free SMS:- ON<space>UandiStar to 9870807070 for JNTU, Job Alerts, Tech News , GK News directly to ur Mobile
for more :- http://www.UandiStar.org
Chapter 9 31
100% free SMS:- ON<space>UandiStar to 9870807070 for JNTU, Job Alerts, Tech News , GK News directly to ur Mobile
for more :- http://www.UandiStar.org
Criminal(West)
Chapter 9 32
100% free SMS:- ON<space>UandiStar to 9870807070 for JNTU, Job Alerts, Tech News , GK News directly to ur Mobile
for more :- http://www.UandiStar.org
Criminal(West) {x/West}
Chapter 9 33
100% free SMS:- ON<space>UandiStar to 9870807070 for JNTU, Job Alerts, Tech News , GK News directly to ur Mobile
for more :- http://www.UandiStar.org
Criminal(West) {x/West}
Chapter 9 34
100% free SMS:- ON<space>UandiStar to 9870807070 for JNTU, Job Alerts, Tech News , GK News directly to ur Mobile
for more :- http://www.UandiStar.org
Criminal(West) {x/West}
Missile(y)
Chapter 9 35
100% free SMS:- ON<space>UandiStar to 9870807070 for JNTU, Job Alerts, Tech News , GK News directly to ur Mobile
for more :- http://www.UandiStar.org
Missile(y)
{ y/M1 }
Chapter 9 36
100% free SMS:- ON<space>UandiStar to 9870807070 for JNTU, Job Alerts, Tech News , GK News directly to ur Mobile
for more :- http://www.UandiStar.org
Chapter 9 37
100% free SMS:- ON<space>UandiStar to 9870807070 for JNTU, Job Alerts, Tech News , GK News directly to ur Mobile
for more :- http://www.UandiStar.org
Chapter 9 38
100% free SMS:- ON<space>UandiStar to 9870807070 for JNTU, Job Alerts, Tech News , GK News directly to ur Mobile
for more :- http://www.UandiStar.org
Chapter 9 39
100% free SMS:- ON<space>UandiStar to 9870807070 for JNTU, Job Alerts, Tech News , GK News directly to ur Mobile
for more :- http://www.UandiStar.org
Logic programming
Sound bite: computation as inference on logical KBs
Logic programming Ordinary programming
1. Identify problem Identify problem
2. Assemble information Assemble information
3. Tea break Figure out solution
4. Encode information in KB Program solution
5. Encode problem instance as facts Encode problem instance as data
6. Ask queries Apply program to data
7. Find false facts Debug procedural errors
Should be easier to debug Capital(N ewY ork, U S) than x := x + 2 !
Chapter 9 40
100% free SMS:- ON<space>UandiStar to 9870807070 for JNTU, Job Alerts, Tech News , GK News directly to ur Mobile
for more :- http://www.UandiStar.org
Prolog systems
Basis: backward chaining with Horn clauses + bells & whistles
Widely used in Europe, Japan (basis of 5th Generation project)
Compilation techniques ⇒ approaching a billion LIPS
Program = set of clauses = head :- literal1, . . . literaln.
criminal(X) :- american(X), weapon(Y), sells(X,Y,Z), hostile(Z).
Chapter 9 41
100% free SMS:- ON<space>UandiStar to 9870807070 for JNTU, Job Alerts, Tech News , GK News directly to ur Mobile
for more :- http://www.UandiStar.org
Prolog examples
Depth-first search from a start state X:
dfs(X) :- goal(X).
dfs(X) :- successor(X,S),dfs(S).
No need to loop over S: successor succeeds for each
Appending two lists to produce a third:
append([],Y,Y).
append([X|L],Y,[X|Z]) :- append(L,Y,Z).
query: append(A,B,[1,2]) ?
answers: A=[] B=[1,2]
A=[1] B=[2]
A=[1,2] B=[]
Chapter 9 42
100% free SMS:- ON<space>UandiStar to 9870807070 for JNTU, Job Alerts, Tech News , GK News directly to ur Mobile
for more :- http://www.UandiStar.org
Chapter 9 43
100% free SMS:- ON<space>UandiStar to 9870807070 for JNTU, Job Alerts, Tech News , GK News directly to ur Mobile
for more :- http://www.UandiStar.org
Conversion to CNF
Everyone who loves all animals is loved by someone:
∀ x [∀ y Animal(y) ⇒ Loves(x, y)] ⇒ [∃ y Loves(y, x)]
1. Eliminate biconditionals and implications
∀ x [¬∀ y ¬Animal(y) ∨ Loves(x, y)] ∨ [∃ y Loves(y, x)]
2. Move ¬ inwards: ¬∀ x, p ≡ ∃ x ¬p, ¬∃ x, p ≡ ∀ x ¬p:
∀ x [∃ y ¬(¬Animal(y) ∨ Loves(x, y))] ∨ [∃ y Loves(y, x)]
∀ x [∃ y ¬¬Animal(y) ∧ ¬Loves(x, y)] ∨ [∃ y Loves(y, x)]
∀ x [∃ y Animal(y) ∧ ¬Loves(x, y)] ∨ [∃ y Loves(y, x)]
Chapter 9 44
100% free SMS:- ON<space>UandiStar to 9870807070 for JNTU, Job Alerts, Tech News , GK News directly to ur Mobile
for more :- http://www.UandiStar.org
Chapter 9 45
100% free SMS:- ON<space>UandiStar to 9870807070 for JNTU, Job Alerts, Tech News , GK News directly to ur Mobile
for more :- http://www.UandiStar.org
>
>
>
L
L
American(West) American(West) Weapon(y) Sells(West,y,z) Hostile(z)
>
>
>
L
L
Missile(x) Weapon(x) Weapon(y) Sells(West,y,z) Hostile(z)
>
>
>
L
L
Missile(M1) Missile(y) Sells(West,y,z) Hostile(z)
>
>
L
L
Missile(x) Owns(Nono,x) Sells(West,x,Nono) Sells(West,M1,z) Hostile(z)
>
>
>
L
L
Missile(M1) Missile(M1) Owns(Nono,M1) Hostile(Nono)
>
>
L
L
Owns(Nono,M1) Owns(Nono,M1) Hostile(Nono)
>
L
L
Enemy(x,America) Hostile(x) Hostile(Nono)
>
L
Enemy(Nono,America) Enemy(Nono,America)
Chapter 9 46
100% free SMS:- ON<space>UandiStar to 9870807070 for JNTU, Job Alerts, Tech News , GK News directly to ur Mobile