[top] [up] [next]

Inspecting variable values


Values of variables can be inspected during the execution of a Prolog program by using the Watch window, this window can be opened by selecting the menu items 'View | Watches' or by pressing the ALT+F11 key combination. It is also opened automatically if a watch is added. A watch can be added by positioning the cursor of the text editor above a variable and pressing ALT+F5 key or selecting the 'Add Watch' menu item from the popup menu of the text editor.

pl_img82.gif (3525 bytes)

After a watch has been added information about the value and the type of the value of the variable are displayed, if the variable does not exist then the text '(Not accessible)' is displayed.

pl_img83.gif (3472 bytes)

As can be seen in the image above the values of variables are shown and enclosed by brackets the type of the variable value. If the right mouse button is pressed over the watch window a popup menu appears with which it is possible to add, delete and edit watches.

Inspecting variables in text editor

It is also possible to inspect values of variables by holding the mouse still in the text editor for a short time over a variable while stepping through a Prolog program. A small popup window will appear in which the current value and type of the value are displayed. In the image below the value of the variable named 'Tail' is displayed.

Pl_img84.gif (4732 bytes)

Only values are shown for variables in the current predicate that is being proven.

[top] [up] [next]

 

info@trinc-prolog.com