During my implementation of the Adventure game in Prolog I was wondering when the redo-port is called with new variables during backtracking and when it is called with the s
This is just a comment posted as a answer because it has a picture.
If you use the graphical debugger you can see when choice points are created.
?- gtrace.
true.
[trace] ?- (location(X,Y),door(kitchen,Y)).
In the following image of the debugger I highlighted the choice point with a green rectangle.
To exit out of trace mode in top-level enter nodebug.
[trace] ?- nodebug.
true.
?-
Note: It is the choice points that lead to using the redo port.
Note: Another way to debug prolog is via use of failure slice. Also read questions tagged with failure slice