Question

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?

Était-ce utile?

La 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.

Autres conseils

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

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top