9 lines
123 B
OpenEdge ABL
9 lines
123 B
OpenEdge ABL
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), !.
|