Sicstus Prolog: display current bindings during debugging

171 Views Asked by At

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?

2

There are 2 best solutions below

1
On BEST ANSWER

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.

0
On

If using Sicstus with Emacs then C-c C-g will open a buffer that will display prolog bindings as you step through with trace