Introduction to
Logic Programming
What
versus
How
 

Exercise 8.3- Trace


Suppose we were to run our top-down evaluation method on the dataset shown below and the ruleset shown on the right with the goal r(a,d). Show a trace of subgoals in the order in which they are processed and the results.

p(a,b)
p(a,c)
p(c,d)
r(X,Z) :- p(X,Y) & p(Y,Z)