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)).
?