What is redo in Prolog when you trace?
问题 I have this code(iterative deepening to find shortest path) : arc(a, g). arc(a, b). arc(b, g). path(X, Z, Path) :- length(Path, _), path_r(X, Z, Path). path_r(Z, Z, []). path_r(X, Z, [X|Path]) :- arc(X, Y), path(Y, Z, Path). And when I trace it, in one of the traces it gives me : 2 2 Redo: length([],0) ? What's happening here? Also, what is 2 2 in the left of the line? The rest of the tracing: 1 1 Call: path(a,g,_23) ? 2 2 Call: length(_23,_55) ? 2 2 Exit: length([],0) ? 3 2 Call: path_r(a,g,