While working on a javascript-based Prolog implementation (Proscript) I realized it needed an interactive debugger. Since Proscript is implemented using the Warren Abstract Machine (WAM) creating the standard Prolog debugger is complicated. I was not able to find any information on how people have solved this problem aside from reading the source of other Prolog implementations (e.g. GNU Prolog, SWI-Prolog).
I have created a technical note that describes how to integrate interactive debugging in Prolog with the WAM. This is presented in a tutorial fashion inspired by Hassan Aït-Kaci’s “Warren’s abstract machine: a tutorial reconstruction.”