Definition of a path/trail/walk
How about defining path/4 like this? path(R_2, Xs, A,Z) :- % A path `Xs` from `A` to `Z` is … walk(R_2, Xs, A,Z), % … a walk `Xs` from `A` to `Z` … all_dif(Xs). % … with no duplicates in `Xs`. To aid universal termination, we swap the two goals in above conjunction … path(R_2, … Read more