Download presentation
Presentation is loading. Please wait.
Published byClinton Miles Modified over 9 years ago
1
Inference in FOL Compared to predicate logic, more abstract reasoning and specific conclusions
2
D. Goforth, COSC 4117, fall 2006 FOL knowledge bases Facts about environment involve statements about specific objects E.g., Dentist(Bill), Likes(Mary, Candy) General knowledge is mainly statements about sets of objects involving quantifiers E.g., x Dentist(x) ⇒ Likes(x, Candy)
3
D. Goforth, COSC 4117, fall 2006 Deductive reasoning from general to specific how do quantified sentences get applied to facts? universal quantifier existential quantifier instantiation: substituting a reference to an object for a variable inference: conclusions entailed in KB
4
D. Goforth, COSC 4117, fall 2006 Instantiating Universal quantifier (UI) x p(x) statement is always true any substitution makes a legitimate statement format: x p(x) subst( {x/k}, p(x) ) (K is any constant or function from KB) p(K)
5
D. Goforth, COSC 4117, fall 2006 Instantiating Existential quantifier (UI) x p(x) statement is true for some object name the object for which it is true format: x p(x) subst( {x/k}, p(x) ) (k is a new constant, never used before Skolem constant) p(k)
6
D. Goforth, COSC 4117, fall 2006 Brute force reasoning use instantiation to create a ‘propositional’ logic KB complete BUT... presence of functions causes infinitely large set of sentences (Father(Al), Father(Father(Al)) semi-decidable (disproofs never end)
7
D. Goforth, COSC 4117, fall 2006 Direct reasoning x man(x) mortal(x) man(Socrates) 1.Substitute for instantiation: subst( {x/Socrates}, man(x) mortal(x)) man(Socrates) mortal(Socrates) 2.modus ponens mortal(Socrates)
8
D. Goforth, COSC 4117, fall 2006 Substitutions for reasoning generalized modus ponens p 1, p 2, p 3, (p 1 ^ p 2 ^ p 3 )=> q subst( {x 1 /k 1, x 2 /k 2..}, q) Unification: substitutions so that the sentences are consistently instantiated
9
D. Goforth, COSC 4117, fall 2006 Substitutions for reasoning generalized modus ponens example Parent(Art,Barb), Parent(Barb,Carl), (Parent(x,y) ^ Parent(y,z ) ⇒ Grandparent(x,z) subst( {x/Art, y/Barb,z/Carl}, q) (Parent(Art,Barb) ^ Parent(Barb,Carl ) ⇒ Grandparent(Art,Carl) Grandparent(Art,Carl)
10
D. Goforth, COSC 4117, fall 2006 Consistent substitutions unification algorithm – p.278 or variant here example x likes(Bill, x)(Bill likes everyone) y likes(y, Mary) (everyone likes Mary) subst( {Bill/y, Mary/x}, likes(Bill, Mary)) makes two predicates identical
11
D. Goforth, COSC 4117, fall 2006 Application example x likes(Bill, x) y likes(y, Mary) => ~trusts(y,Father(Mary)) subst( {Bill/y, Mary/x}, likes(Bill, Mary)) makes two predicates identical likes(Bill, Mary), likes(Bill, Mary) => ~trusts(Bill,Father(Mary)) ~trusts(Bill,Father(Mary))
12
D. Goforth, COSC 4117, fall 2006 Examples unify: Likes(x,Art), Likes(Father(y), y) {Art/y} Likes(x,Art), Likes(Father(Art), Art) {Art/y, Father(Art)/x} unify: Likes(x,Art), Likes(Bart, x) fails, can’t subst x for Art and Bart
13
D. Goforth, COSC 4117, fall 2006 Examples unify: Likes(x,Art), Likes(Bart, x) fails, can’t subst x for Art and Bart BUT where did ‘x’ come from? Art likes everybody: x Likes(x, Art) Everybody likes Bart: x Likes(Bart, x) standardize apart: z 0 Likes(Bart, z 0 ) then Likes(Bart, Art) is OK with subst ( {Bart/x, Art/z 0 } )
14
Unify(L 1, L 2 ) // L 1, L 2 are both predicates or both objects 1.If (L 1 or L 2 is variable or constant) i.if (L 1 ==L 2 ) return {} (no subst required) ii.if (L 1 is variable) – if L 1 in L 2 return fail else return {L 2 /L 1 } iii.if (L 2 is variable) – if L 2 in L 1 return fail else return {L 1 /L 2 } iv.return fail // both constants or functions // L 1,L 2 are predicates if we get to here 2.If predicate symbols of L 1,L 2 not identical, return fail 3.If L 1,L 2 have different number of arguments, return fail 4.Subst = {} 5.For (i = 1 to number of arguments in L 1,L 2 ) i.S = Unify(L 1.argument[i],L 2.argument[i]) ii.if (S==fail) return fail iii.if (S!={}) apply S to remainder of L 1,L 2 Subst = Subst U S 6.Return Subst Unification algorithm
15
Unify(L 1, L 2 ) // L 1, L 2 are predicates or objects 1.If (L1 or L2 is variable or constant) i.if (L 1 ==L 2 ) Art, Art x,x ii.if (L 1 is variable) – if L 1 in L 2 return fail else return {L 2 /L 1 } x, Father(x) x, Mother(y) i.if (L 2 is variable) – if L 2 in L 1 return fail else return {L 1 /L 2 } ii.return fail Art, Bart // L 1,L 2 are predicates if we get to here 2.If predicates of L 1,L 2 not identical Likes(x,y) Brother(z,w) 3.If L 1,L 2 have different # of arguments Band(x,y,z), Band(t,v) 4.Subst = {} 5.For (i = 1 to # of args in L 1,L 2 ) i.S = Unify(L 1.arg[i],L 2.arg[i]) Likes(Bill,x) Likes(y,Father(y)) ii.if (S==fail) return fail iii.if (S!={}) apply S to remainder of L 1,L 2 Likes(Bill,x) Likes(Bill,Father(Bill)) Subst = Subst U S 6.Return Subst Unification algorithm - examples
16
D. Goforth, COSC 4117, fall 2006 Inference: Reasoning methods Forward chaining Backward chaining Resolution
17
D. Goforth, COSC 4117, fall 2006 Resolution 1.convert sentences to equivalent conjunctive normal form (CNF) 2.apply resolution refutation
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.