Stepping through a program is allowing the Prolog inference engine to execute the next step(s) of a Prolog program and then stop the execution again. There are two different ways of stepping through a program: stepping into and stepping over.
Stepping through a program is done by pressing the F7 key, the Start Step button or the Next Step button.
If the next step is calling a user-defined Prolog predicate then the debugger stops on finding the first candidate for a match, if there is one. If there is no candidate then the debugger stops after failing the call statement. After a match the debugger enters the user-defined predicate.
The difference between stepping over and stepping into a program is that with stepping over no user defined predicate is entered and its prove tree is not displayed. Stepping over is useful for skipping predicates that have been tested but still debug the current predicate or some other predicate.
While the debugger is stepping through Prolog source code it attempts to display the current execution point in a file in the text editor. In the gutter of the text editor a small image is used to show the state of the inference engine: the possible images displayed are:
![]() |
FIND and CALL A darkblue arrow pointing to the current clause is used for the FIND and CALL state. FIND: a candidate for a match is found CALL: start for a search is started |
![]() |
EXIT A darkgreen arrow pointing upwards is used for the EXIT state. EXIT: an expression was completely proved and thus exited |
![]() |
FAIL A darkred arrow pointing upwards is used for the FAIL state. FAIL: an expression could not be proven |
![]() |
REDO A lightblue arrow pointing to a clause is used for the REDO state. REDO: another attempt to find a solution for a (sub)goal is started. |
![]() |
MISMATCH A red arrow pointing to a clause is used for the MISMATCH state. MISMATCH: a match between two predicates failed, the reason for the mismatch is shown in the execution trace. |