View source with formatted comments or as raw
    1% Path in graph
    2
    3%#table path/2.
    4
    5edge(a,b).
    6edge(b,c).
    7edge(a,d) :- not path(c,d).
    8
    9path(X,Y) :-
   10    edge(X,Y).
   11path(X,Y) :-
   12    edge(X,Z),
   13    path(Z,Y).
   14
   15
   16?- path(a,Y).