CSE505/Assignment1/Extra/cycle.lp
2024-02-23 14:09:42 -05:00

11 lines
243 B
Plaintext

#include "randompath1000". % 2nd way of reading input facts
path(X,Y) :- edge(X,Y).
% Way 1
%path(X,Y) :- edge(X,Z), path(Z,Y).
% Way 2
%path(X,Y) :- path(X,Z), edge(Z,Y).
% Way 3
%path(X,Y) :- path(X,Z), path(Z,Y).
%cycle(X) :- path(X,X).