1 / 5

Ch. 9 – FOL Inference

Ch. 9 – FOL Inference. Supplemental slides for CSE 327 Prof. Jeff Heflin. Backward Chaining. function FOL-BC-ASK ( KB , goals ,  ) returns a set of substitutions local answers, a set of substitutions, initially empty

curt
Download Presentation

Ch. 9 – FOL Inference

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Ch. 9 – FOL Inference Supplemental slides for CSE 327 Prof. Jeff Heflin

  2. Backward Chaining function FOL-BC-ASK (KB, goals, ) returns a set of substitutionslocalanswers, a set of substitutions, initially empty if goals is empty then return { }q’ SUBST( ,FIRST(goals))for each sentence rin KB where STANDARDIZE-APART(r) = (p1… pn  q) and ’ UNIFY(q,q’) succeedsnew_goals  PREPEND([p1,…,pn],REST(goals))answers  FOL-BC-ASK(KB, new_goals, COMPOSE(’, ))  answersreturnanswers From Figure 9.6, p. 288

  3. Backward Chaining Example Set of sentences: S1: x1,y1 child(x1,y1)  parent(y1,x1) S2: x2,y2 parent(x2,y2)  female(x2)  mother(x2,y2) S3: child(Lisa,Homer) S4: child(Lisa,Marge) S5: female(Marge) Note: variables have already been standardized apart using subscripts Query: x mother(x,Lisa)

  4. Backward Chaining Search Tree mother(x0,Lisa) match rule S2’={x2/x0, y2/Lisa} parent(x0,Lisa), female(x0) match rule S1’={y1/x0, x1/Lisa} child(Lisa,x0), female(x0) match S4 ’={x0/Marge} match S3 ’={x0/Homer} female(homer) female(marge) matches S5 ’={ x0/Marge} no matches answers={} (FAIL!)  answers={ x0/Marge}

  5. Forward Chaining function FOL-FC-ASK (KB,) returns a substitution or falselocalnew, the new sentences inferred on each iteration repeat until new is emptynew  {}for each sentence rin KBdo (p1… pn  q )  STANDARDIZE-APART(r)for each  such that SUBST( , p1… pn)= SUBST( , p1’ … pn’) for some p1’ ,…, pn’ in KBq’ SUBST( ,q)if q’ is not a renaming of some sentence already in KB or newthen do add q’ to new UNIFY(q’, ) if  is not failthen return add new to KBreturnanswers From Figure 9.3, p. 282

More Related