Inference in FOL - PowerPoint PPT Presentation

1 / 17
About This Presentation
Title:

Inference in FOL

Description:

... g., Dentist(Bill), Likes ... E.g., x Dentist(x) Likes(x, Candy) D. Goforth, COSC 4117, fall 2006 ... instantiation: substituting a reference to an object ... – PowerPoint PPT presentation

Number of Views:16
Avg rating:3.0/5.0
Slides: 18
Provided by: davidg89
Category:
Tags: fol | dentist | find | inference

less

Transcript and Presenter's Notes

Title: Inference in FOL


1
Inference in FOL
  • Compared to predicate logic,
  • more abstract reasoning and specific conclusions

2
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
Deductive reasoningfrom 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
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
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
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
Direct reasoning
  • ?x man(x) ? mortal(x)
  • man(Socrates)
  • Substitute for instantiation
  • subst( x/Socrates, man(x) ? mortal(x))
  • man(Socrates) ? mortal(Socrates)
  • modus ponens
  • mortal(Socrates)

8
Substitutions for reasoning
  • generalized modus ponens
  • p1, p2, p3, (p1 p2 p3 )gt q
  • subst( x1/k1, x2/k2.., q)
  • Unification substitutions so that the sentences
    are consistently instantiated

9
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
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
Application
  • example
  • ?x likes(Bill, x)
  • ?y likes(y, Mary) gt trusts(y,Father(Mary))
  • subst( Bill/y, Mary/x, likes(Bill, Mary))
  • makes two predicates identical
  • likes(Bill, Mary),
  • likes(Bill, Mary) gt trusts(Bill,Father(Mary))
  • ? trusts(Bill,Father(Mary))

12
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, cant subst x for Art and Bart

13
Examples
  • unify
  • Likes(x,Art), Likes(Bart, x)
  • fails, cant 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 ?z0 Likes(Bart, z0)
  • then Likes(Bart, Art) is OK with
  • subst ( Bart/x, Art/z0 )

14
Unification algorithm
  • Unify(L1, L2) // L1, L2 are both predicates or
    both objects
  • If (L1 or L2 is variable or constant)
  • if (L1L2) return (no subst required)
  • if (L1 is variable) if L1 in L2 return fail
    else return L2/L1
  • if (L2 is variable) if L2 in L1 return fail
    else return L1/L2
  • return fail // both constants or functions
  • // L1,L2 are predicates if we get to here
  • If predicate symbols of L1,L2 not identical,
    return fail
  • If L1,L2 have different number of arguments,
    return fail
  • Subst
  • For (i 1 to number of arguments in L1,L2)
  • S Unify(L1.argumenti,L2.argumenti)
  • if (Sfail) return fail
  • if (S!)
  • apply S to remainder of L1,L2
  • Subst Subst U S
  • Return Subst

15
Unification algorithm - examples
  • Unify(L1, L2) // L1, L2 are predicates or
    objects
  • If (L1 or L2 is variable or constant)
  • if (L1L2) Art, Art x,x
  • if (L1 is variable) if L1 in L2 return fail
    else return L2/L1
  • x, Father(x) x, Mother(y)
  • if (L2 is variable) if L2 in L1 return fail
    else return L1/L2 ltsimilargt
  • return fail Art, Bart
  • // L1,L2 are predicates if we get to here
  • If predicates of L1,L2 not identical Likes(x,y)
    Brother(z,w)
  • If L1,L2 have different of arguments
    Band(x,y,z), Band(t,v)
  • Subst
  • For (i 1 to of args in L1,L2)
  • S Unify(L1.argi,L2.argi) Likes(Bill,x)
    Likes(y,Father(y))
  • if (Sfail) return fail
  • if (S!)
  • apply S to remainder of L1,L2 Likes(Bill,x)
    Likes(Bill,Father(Bill))
  • Subst Subst U S
  • Return Subst

16
Inference Reasoning methods
  • Forward chaining
  • Backward chaining
  • Resolution

17
Resolution
  1. convert sentences to equivalent conjunctive
    normal form (CNF)
  2. apply resolution refutation
Write a Comment
User Comments (0)
About PowerShow.com