

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


Logic Programming and Artificial Intelligence 14 February 2010 LPA Problem Sheet 6 Due: 13:15 on 1 March
f (x, x) f (y, g(y)) f (a, y) f (a, b) f (y, g(x)) f (x′, x′) f (y′, g(y′)) XXXXX f (a, y′) XXXXX XXXXX f (a, b) XXXXX XXXXX XXXXX f (y, g(x′)) XXXXX XXXXX XXXXX XXXXX
(a) [8 marks] Using the leftmost selection function, give the SLD search space to depth 3 for the argument whose premises are P and whose conclusion is A(x, j). Explain what the rest of the search space looks like. Does it contain any answers? If you gave this problem to PROLOG, what do you expect its behaviour would be? (Note: A tree with a single node has depth 0.) (b) [2 marks] Repeat the previous question, except this time replace premise 4 with 4 ′. P (y, z) ∧ A(x, y) → A(x, z) (Your ancestors’ parents are ancestors of yours.)
(c) [8 marks] Using the leftmost selection function, give the SLD search space to depth 4 for the argument whose premises are P and whose conclusion is A(j, x). Show an answer box for all nodes in the search space. Explain what the rest of the search space looks like. Does it contain any answers? (d) [4 marks] Suppose you gave the last problem to PROLOG. What answer do you expect it would give first? Explain what this answer means. What if you asked for another answer? What if you continued asking for more and more answers? (e) [4 marks] Suppose we gave PROLOG the premises P and the goal clause A(x, y). Draw the part of the SLD search space (including an answer box for all nodes) that PROLOG would grow up to the point when it finds the second answer. Explain what these two answers mean. (f) [4 marks] Using the leftmost selection function, give the SLD search space for the argument whose premises are P and whose conclusion is P (x, x). What would happen if you gave this problem to PROLOG. (Think carefully!)
[challenge problem]