Search code examples
debuggingprologsicstus-prolog

Sicstus Prolog: display current bindings during debugging


I'm very new to Prolog and have been using Sicstus to help debug my code. Is there a way to view all the bindings while you are stepping through a query using trace/0? Or is there some other way to print out during the steps?


Solution

  • This is done automatically if you use the SPIDER IDE. You can also show the bindings when running SICStus from within the Emacs mode and, finally, the debugger can print the bindings using the 'v' debugger command.

    Not all variables are available since some variables may disappear due to compiler optimization. If this is a problem you can use consult/1 to run the code interpreted. This is slower but sometimes gives somewhat more details in the debugger.