문제

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?

도움이 되었습니까?

해결책

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.

다른 팁

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top