正在加载图片...
Example knowledge base contd. Example knowledge base contd. .it isa crimefor an American tosellw nal(r issiles e,3x (Nono.)Missile() no)and An enemy of A Example knowledge base contd. Example knowledge base contd. inal(z ninal(r) (Nono.M)and old to it by Colonel West (an Example knowledge base contd. Forward chaining algorithm n FOL-FC-ASK()retur repeat unt NDA gof a sentence already in or new then do a returnExample knowledge base contd. . . . it is a crime for an American to sell weapons to hostile nations: American(x)∧Weapon(y)∧Sells(x, y, z)∧Hostile(z) ⇒ Criminal(x) Nono . . . has some missiles Chapter 9 19 Example knowledge base contd. . . . it is a crime for an American to sell weapons to hostile nations: American(x)∧Weapon(y)∧Sells(x, y, z)∧Hostile(z) ⇒ Criminal(x) Nono . . . has some missiles, i.e., ∃ x Owns(Nono, x) ∧ Missile(x): Owns(Nono,M1) and Missile(M1) . . . all of its missiles were sold to it by Colonel West Chapter 9 20 Example knowledge base contd. . . . it is a crime for an American to sell weapons to hostile nations: American(x)∧Weapon(y)∧Sells(x, y, z)∧Hostile(z) ⇒ Criminal(x) Nono . . . has some missiles, i.e., ∃ x Owns(Nono, x) ∧ Missile(x): Owns(Nono,M1) and Missile(M1) . . . all of its missiles were sold to it by Colonel West ∀ x Missile(x) ∧ Owns(Nono, x) ⇒ Sells(West, x, Nono) Missiles are weapons: Chapter 9 21 Example knowledge base contd. . . . it is a crime for an American to sell weapons to hostile nations: American(x)∧Weapon(y)∧Sells(x, y, z)∧Hostile(z) ⇒ Criminal(x) Nono . . . has some missiles, i.e., ∃ x Owns(Nono, x) ∧ Missile(x): Owns(Nono,M1) and Missile(M1) . . . all of its missiles were sold to it by Colonel West ∀ x Missile(x) ∧ Owns(Nono, x) ⇒ Sells(West, x, Nono) Missiles are weapons: Missile(x) ⇒ Weapon(x) An enemy of America counts as “hostile”: Chapter 9 22 Example knowledge base contd. . . . it is a crime for an American to sell weapons to hostile nations: American(x)∧Weapon(y)∧Sells(x, y, z)∧Hostile(z) ⇒ Criminal(x) Nono . . . has some missiles, i.e., ∃ x Owns(Nono, x) ∧ Missile(x): Owns(Nono,M1) and Missile(M1) . . . all of its missiles were sold to it by Colonel West ∀ x Missile(x) ∧ Owns(Nono, x) ⇒ Sells(West, x, Nono) Missiles are weapons: Missile(x) ⇒ Weapon(x) An enemy of America counts as “hostile”: Enemy(x, America) ⇒ Hostile(x) West, who is American . . . American(West) The country Nono, an enemy of America . . . Enemy(Nono, America) Chapter 9 23 Forward chaining algorithm function FOL-FC-Ask(KB,α) returns a substitution or false repeat until new is empty new ← { } for each sentence r in KB do ( p1 ∧ . . . ∧ pn ⇒ q) ← Standardize-Apart(r) for each θ such that (p1 ∧ . . . ∧ pn)θ = (p 0 1 ∧ . . . ∧ p 0 n )θ for some p 0 1 , . . . , p 0 n in KB q 0 ← Subst(θ, q) if q 0 is not a renaming of a sentence already in KB or new then do add q 0 to new φ ← Unify(q 0 ,α) if φ is not fail then return φ add new to KB return false Chapter 9 24
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有