0

a ↔ b
 ↙ ↑
c → d

path(X, X, Y).                                  
path(X, Y, s(Z)) :- edge(X, A), path(A, Y, Z).  
path(X, Y, Z) :- eps(X, A), path(A, Y, Z).      
edge(a, b).
edge(b, a).
edge(c, d).
edge(d, b).
eps(b, c).

And path(X,Y,k) is true if there is a path from X to Y in the graph where at most k non-ℇ-edges are used along the path. How can I draw an SLD tree for the query ?-path(a,a,s(s(0)). ?

false
  • 10,264
  • 13
  • 101
  • 209

1 Answers1

0

I'm not 100% sure but it should look somewhat like this

enter image description here

DuDa
  • 3,718
  • 4
  • 16
  • 36