9 lines
123 B
Plaintext
9 lines
123 B
Plaintext
|
edge(1,2).
|
||
|
edge(2,1).
|
||
|
edge(1,3).
|
||
|
|
||
|
path(X,Y) :- edge(X,Y).
|
||
|
path(X,Y) :- edge(X,Z), path(Z,Y), !.
|
||
|
|
||
|
cycle(X) :- path(X,X), !.
|