12 backward chaining example xknows john x loves

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: makes least commitment about binding variables to constants 10 Proof Procedures •  Suppose we have a knowledge base: KB •  We want to prove q •  Forward Chaining –  Like search: Keep proving new things and adding them to the KB un<l we are able to prove q •  Backward Chaining –  Find p1…pn s.t. knowing p1…pn would prove q –  Recursively try to prove p1…pn Forward Chaining Example ∀xKnows( John, x ) ⇒ Loves( John, x ) Knows( John, Jane) ∀yKnows( y, Leonid ) ∀yKnows( y, Mother ( y )) ∀xKnows( x, Elizabeth) € •  •  •  •  Loves(John, Jane) Loves(John, Leonid) Loves(John,Mother(John)) Loves(John, Elizabeth) 11 Forward Chaining Procedure Forward_Chain(KB,p) If p is in KB then return Add p to KB For each (p1 ^ … ^ pn=>q) in KB such that for some i, Unify(pi,p)=q succeeds do Find_And_Infer(KB,[p1,…,pi ­1,pi+1,…,pn],q,q) end Procedure Find_and_Infer(KB,premises,conclusion,q) If premises= then Forward_Chain(KB,Subst(q,conclusion)) Else for each p’ in KB such that Unify(p’,Subst(q,Head(premises)))=q2 do Find_And_Infer(KB,Tail(premises),conclusion,[q,q2])) end A Note About Forward Chaining •  As presented, forward chaining seems undirected •  Can view forward chaining as a search problem •  Can apply heuris<cs to guide this search •  If you’re trying to prove that Barack Obama is a natural born ci<zen, should you should start by proving that square127 is also a rectangle??? 12 Backward Chaining Example ∀xKnows( John, x ) ⇒ Loves( John, x ) Knows( John, Jane) ∀yKnows( y, Leonid ) ∀yKnows( y, Mother ( y )) ∀xKnows( x, Elizabeth) € •  Goal: Loves(John, Jane)? •  Subgoal: Knows(John,Jane) Backward Chaining Func<on Back_Chain(KB,q) Back_Chain_List(K...
View Full Document

This note was uploaded on 02/17/2012 for the course COMPSCI 170 taught by Professor Parr during the Spring '11 term at Duke.

Ask a homework question - tutors are online