Byrd box tracing model

Author(s): Francisco Bueno.

This module can be used to spy predicates in a program. Spying means here to display messages at the call, exit, fail, and redo ports of goals for the predicate spied.

In order to spy a predicate using this module a program expansion has to be performed on the program module defining the predicate. This is achieved by the byrdbox package.

This library is a programming exercise in Ciao expansion packages. It is mainly intended as an auxiliary library for library(tracing).

Please note that this is not a replacement for the standard debugger (and which can also be embedded in executables), since it has more limited functionality.

Usage and interface

  • Library usage:
    :- use_package(byrdbox).

    in the program module defining the code to be spied; or

    :- use_module(library(byrdbox/byrd)).

    to call the predicates exported by this module.

  • Exports:

Documentation on exports

PREDICATEspy/1
spy(M:F/A)

Turns spying of predicate F/A in module M on. Declarations of the form spy(F/A) (where M is implicitly taken as the module where the declaration appears) can also be used, as long as the byrdbox package is included.

PREDICATEnospy/1
nospy(M:F/A)

Turns spying of predicate F/A in module M off.

PREDICATEtrace/1
trace(Goal)

Displays messages at the ports of Goal, as long as spying is on for its predicate. Meta-predicate with arguments: trace(goal).

PREDICATEtrace0/1
trace0(Goal)

Displays messages at the ports of Goal. Meta-predicate with arguments: trace0(goal).

Documentation on imports

This module has the following direct dependencies: