All Manuals > KnowledgeWorks and Prolog User Guide > 5 The Programming Environment

5.8 Debugging with the Environment

5.8.1 Spy Windows

KnowledgeWorks Gspy Window

Spy Windows display graphically the actions or subgoals a rule (either forward or backward chaining) will invoke when it fires. A Spy Window may be obtained by selecting a rule in the Rule Browser and choosing Works > Rule > Gspy or choosing Gspy from the context menu.or by choosing KnowledgeWorks > Spy > Gspy in the KnowledgeWorks Listener. Spying can be cancelled by closing the Spy Window or by choosing KnowledgeWorks > Spy > NoSpy or KnowledgeWorks > Spy > NoSpy All from the KnowledgeWorks Listener.

Selecting one of the graph nodes in the top pane of the Spy Window displays the full text of the box in the pane below. Choosing Gspy from the context menu brings up a Spy Window for the goal in the box.

When the rule being displayed fires, execution stops and the buttons at the bottom of the KnowledgeWorks Listener allow the rule to be single-stepped. Clicking on the Creep button steps through the rule, and Leap advances to the end of the rule (unless any of the intervening goals invoke another rule which has been spied). When single-stepping, a highlight marks the action or goal being performed. When execution is suspended in this manner, any of the KnowledgeWorks tools or browsers may be used.

More details on single stepping through rules are in Appendix A: Common Prolog.


KnowledgeWorks and Prolog User Guide (Windows version) - 01 Dec 2021 19:36:03