next up previous contents
Next: Interacting with the Up: The Tracer Outlined Previous: The Tracer Outlined

Activating the Tracer

First, we outline the facilities for altering the behaviour of the system with regard to the tracer.

spy(predicate_name)
Mark any clause with the given predicate_name as ``spyable''. Does not work for built-in predicates.
debug
If a spied predicate is encountered, switch on the tracer.
nodebug
Remove all spypoints. The tracer will therefore not be invoked.
nospy(predicate_name)
Undo the effect of spy --- i.e. remove the spy point.
debugging
Shows which predicates are marked for spying plus some other information.
trace
Switches on the tracer.
notrace
Switches the tracer off. Does not remove spypoints.

Note that both spy/1 and nospy/1 can also take a list of predicates for their argument. The predicates can also be specified as, for example, foo/1. This allows for the distinction between (distinct) definitions for two or more predicates all with different arities.

There is also the concept of leashing. The tracer provides for the possibility of various decisions to be made by the user at each of the four ports. There is also a facility for stopping interactions at the ports. This is done via leash/1. This predicate can take one of five arguments: full, tight, half, loose and off.

The default is full.

The system is set up to default to full leashing: to change this, You can set your system up using the prolog.ini file by putting a line such as ?- leash([call,exit]). in it.

Note that the ports of spy-points are always leashed (and cannot be unleashed).



Paul Brna
Mon May 24 20:14:48 BST 1999