Question: 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
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.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
