Top Banner
CS.462 Artificial Intelligence SOMCHAI THANGSATHITYANGKUL Lecture 06 : First Order Logic Resolution Prove
16

CS.462 Artificial Intelligence SOMCHAI THANGSATHITYANGKUL Lecture 06 : First Order Logic Resolution Prove.

Dec 14, 2015

Download

Documents

Ruby Stratton
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: CS.462 Artificial Intelligence SOMCHAI THANGSATHITYANGKUL Lecture 06 : First Order Logic Resolution Prove.

CS.462Artificial Intelligence

SOMCHAI THANGSATHITYANGKUL

Lecture 06 : First Order Logic Resolution Prove

Page 2: CS.462 Artificial Intelligence SOMCHAI THANGSATHITYANGKUL Lecture 06 : First Order Logic Resolution Prove.

2

Proving Theorem in FOL

• Proving theorem in FOL raises two additional problems:– Need to remove quantifiers– Need to be able to compare variable

(which represent unknown values)

Page 3: CS.462 Artificial Intelligence SOMCHAI THANGSATHITYANGKUL Lecture 06 : First Order Logic Resolution Prove.

3

Substitution and Unification

• A substitution is a set of variable/ term pairs that one can apply to sentences to perform some needed unification or other manipulation

SUBST(, ) denoted the result of applying substitution to sentence

e.g., SUBST({x/A, y/ f(x)}, P (x,y)) = P(A, f(A))

• Unification is the process of taking 2 atomic statements and finding a substitution that make them equivalent

UNIFY(p,q) = where SUBST(, p) = SUBST(, q)

e.g. UNIFY(P(x), P(A) = { x/A }

Page 4: CS.462 Artificial Intelligence SOMCHAI THANGSATHITYANGKUL Lecture 06 : First Order Logic Resolution Prove.

4

Unification ExampleKnows(John, x) Hates(John, x)Knows(John, Jane)Knows(y, Leonid)Knows(y, Mother(y))Knows(x, Elizabeth)

UNIFY(Knows(John, x), Knows(John, Jane)) = {x/John}

UNIFY(Knows(John, x), Knows(y, Leonid)) = {x/John, y/Leonid}

UNIFY(Knows(John, x), Knows(y, Mother(y))) = {y/John, x/Mother(John)}

UNIFY(Knows(John, x), Knows(x, Elizabeth) = fail

Page 5: CS.462 Artificial Intelligence SOMCHAI THANGSATHITYANGKUL Lecture 06 : First Order Logic Resolution Prove.

5

Unification Example• Before beginning unification, all variable

names must be uniqueUNIFY(Knows(John, x1), Knows(x2, Elizabeth) = {x1/Elizabeth, x2/John}

• Unification makes as few commitments about variable bindings as possible

UNIFY(Knows(John, x), Knows(y, z) = {y/John, x/z}Or {y/John, x/z, w/Freda}Or {y/John, x/John, z/John}Or …

{y/John, x/z} is the most general unifier (MGU)

Page 6: CS.462 Artificial Intelligence SOMCHAI THANGSATHITYANGKUL Lecture 06 : First Order Logic Resolution Prove.

6

First Order Resolution

Page 7: CS.462 Artificial Intelligence SOMCHAI THANGSATHITYANGKUL Lecture 06 : First Order Logic Resolution Prove.

7

Convert to Clausal Form

Page 8: CS.462 Artificial Intelligence SOMCHAI THANGSATHITYANGKUL Lecture 06 : First Order Logic Resolution Prove.

8

Convert to Clausal Form

Page 9: CS.462 Artificial Intelligence SOMCHAI THANGSATHITYANGKUL Lecture 06 : First Order Logic Resolution Prove.

9

Convert to Clausal Form

Page 10: CS.462 Artificial Intelligence SOMCHAI THANGSATHITYANGKUL Lecture 06 : First Order Logic Resolution Prove.

10

Example : Convert to Clausal Form

Page 11: CS.462 Artificial Intelligence SOMCHAI THANGSATHITYANGKUL Lecture 06 : First Order Logic Resolution Prove.

11

Resolution Using Unification

Given: P(A) (x) (P(x) Q(f(x))), prove: (z) (Q(z))• Negate the theorem: (z) (Q(z))• Drop universal quantifiers and separate into disjunctive

clauses.1. P(A) 2. (P(x) Q(f(x)))3. Q(z)

• Clause 1 and 2 are resolved by substituting A for x {x/A}. Resulting clause is Q(f(A)), which is added to original set.

• Q(f(A)) is resolved against clause 3, using {z/f(A)}. Result is Q(f(A)) and Q(f(A))

• Contradiction proves original theorem.

Page 12: CS.462 Artificial Intelligence SOMCHAI THANGSATHITYANGKUL Lecture 06 : First Order Logic Resolution Prove.

12

Resolution Proof• Question (informal): Is Marcus alive in the year 2001?• Axioms (informal)

1.Marcus was a man.2.Marcus was a Pompeian.3.Marcus was born in 40 A.D.4.All man are mortal.5.The volcano erupted in 79 A.D.6.All Pompeians died when the volcano erupted.7.No mortal lives longer than 150 years.

• Additional axioms are required.

8. Alive means not dead9. If someone dies, they remain dead.

Page 13: CS.462 Artificial Intelligence SOMCHAI THANGSATHITYANGKUL Lecture 06 : First Order Logic Resolution Prove.

13

Resolution ProofAxioms in clause form

1. Man(Marcus)2. Pompeian(Marcus)3. Born(Marcus, 40)4. Man(x1) Mortal(x1)

from... x Man(x) Mortal(x)5. Erupted(Volcano, 79)6. Pomepeian(x2) Died(x2, 79)

from... x Pompeian(x) Died(x, 79)7. Mortal(x3) Born(x3, t1) Gt(t2-t1, 150)

Dead(x3, t2)from... x,t1,t2 (Mortal(x)Born(x,t)Gt(t2-t1, 150) Dead(x, t2))

Page 14: CS.462 Artificial Intelligence SOMCHAI THANGSATHITYANGKUL Lecture 06 : First Order Logic Resolution Prove.

14

Resolution Proof

8a. Alive(x4, t3) Dead(x4, t3)

8b. Dead(x4, t3) Alive(x4, t3)

from... x,t Alive(x, t) Dead(x, t)9. Died(x6, t5) Gt(t6,t5) Dead(x6,t6)

from... x,t1,t2 Died(x, t1) Gt(t2,t1) Dead(x, t2)

Prove: alive(Marcus, 2001)

Negate clause to be proved and add to list:alive(Marcus, 2001)

Page 15: CS.462 Artificial Intelligence SOMCHAI THANGSATHITYANGKUL Lecture 06 : First Order Logic Resolution Prove.

15

Alive(Marcus, 2001) Alive(x4, t3)Dead(x4, t3)

Dead(x4, 2001)

{x4/Marcus, t3/2001} Mortal(x3) Born(x3, t1) Gt(t2-t1, 150) Dead(x3, t2)

Mortal(Marcus) Born(Marcus, t1) Gt(2001-t1, 150)

Man(x1) Mortal(x1)

Man(Marcus) Born(Marcus, t1) Gt(2001-t1, 150)

Man(Marcus)

Born(Marcus, t1) Gt(2001-t1, 150) Born(Marcus, 40)

Gt(2001-40, 150)

Gt(1961, 150)

{x3/Marcus, t2/2001}

{x1/Marcus}

{t1/40}

Page 16: CS.462 Artificial Intelligence SOMCHAI THANGSATHITYANGKUL Lecture 06 : First Order Logic Resolution Prove.

16

Try this• Use Resolution prove that West is a

criminal