Exercise 12.13 Consider the following logic program: rd(cons(H, cons(H, T)), T). rd(cons(H, T), cons(H, R)) rd(T,

Question:

Exercise 12.13 Consider the following logic program:

rd(cons(H, cons(H, T)), T).

rd(cons(H, T), cons(H, R)) ←

rd(T, R).

Give a top-down derivation, showing all substitutions for the query ask rd(cons

(a, cons(cons(a,X), cons(B, cons

(c, Z)))),W).

What is the answer corresponding to this derivation?

Is there a second answer? If yes, show the derivation; if not, explain why.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: