% iterative deepening % works in SWI-Prolog. % Written by Tim Finin, http://umbc.edu/~finin/, finin@Umbc.edu :- ensure_loaded(showPath). id :- id(Path), showPath(Path). id(Path) :- start(S), id(S,Path). id(S,Path) :- from(Limit,1,5), id1(S,0,Limit,Path). id1(S,Depth,Limit,[S]) :- Depth 10,12,14,16,18,... from(X,X,_). from(X,N,Inc) :- N2 is N+Inc, from(X,N2,Inc).