# SampleFinalSolutions - SAMPLE FINAL SOLUTIONS 1 Inference...

• Test Prep
• 13
• 100% (6) 6 out of 6 people found this document helpful

This preview shows page 1 - 5 out of 13 pages.

SAMPLE FINAL SOLUTIONS
1) Inference in First Order Logic Consider the following 5 facts that are added to a knowledge base in turn. Hobbit, HeroHaflingare predicates, FinalBattleis a function, Frodoand Mount Doomconstants, and xand yare variables that are universally quantified. 1.Journey(Frodo, Mount Doom) 2.Hafling(x) Hobbit(x) 3.Journey(x, y) FinalBattle(x, y) 4.Hafling(Frodo) 5.Hobbit(x) ^ FinalBattle(x, Mount Doom) Hero(x) a)Show how forward chainingcan be used to infer whether Frodo is a Hero (i.e. Hero(Frodo)). Describe each step of the inference in detail in terms of unifications, rule firings, etc. , are
b) Show how backward chainingcan be used to infer whether Frodo is a Hero (i.e. Hero(Frodo)). Describe each step of the inference in detail in terms of unifications, rule firings, etc
c) Consider the Prolog list given below. What is the result after the following Prolog query is executed? [Frodo, Bilbo, Samwise, Gollum, Meriadoc, Peregrin] ?- [X, Y, _ | Z] = [Frodo, Bilbo, Samwise, Gollum, Meriadoc, Peregrin].