☰

The interactive abstract debugger

Author(s): Marco Ciccalè, Daniel Jurjo-Rivas.

This module implements an abstract debugger that, during the fixpoint execution, relates the (traced) fixpoint operations with the source code of the module that is being analyzed.

Requirements

  1. Uncomment the :- use_module(ciaopp(plai/notrace)) directive in the fixpoint_options.pl configuration file, and recompile ciaopp.
  2. Set the trace_fixp preprocess flag to debug.
See Tracing/monitoring of PLAI analyses for instructions on how to use the debugger.

Notes

The actual highlighting of the source lines is handled by the editor (Emacs, VS Code, or Playground). In all three, only the ciao top-level interprets the debugging messages (i.e., the source lines won't be highlighted if analyzing from the ciaopp or lpdoc top-levels).

Usage and interface

Usage:

Initialize a clean state.

  • The following properties should hold globally:
    (det/1)Calls of the form fixpo_debug_init are deterministic.
    (sideff/2)fixpo_debug_init is side-effect hard.

Usage:debug_fixpoint(Mess,Id,Key1,Key2,Goal,ASub,Extra)

Given an invokation to the fixpoint_trace/7 predicate during the Mess step of a (PLAI) fixpoint computation, prompt a debugging message for such step.

  • The following properties should hold at call time:
    (nonvar/1)Mess is currently a term which is not a free variable.
    (nonvar/1)Id is currently a term which is not a free variable.
    (nonvar/1)Key1 is currently a term which is not a free variable.
    (nonvar/1)Key2 is currently a term which is not a free variable.
    (nonvar/1)Goal is currently a term which is not a free variable.
    (nonvar/1)ASub is currently a term which is not a free variable.
    (nonvar/1)Extra is currently a term which is not a free variable.
  • The following properties should hold globally:
    (det/1)Calls of the form debug_fixpoint(Mess,Id,Key1,Key2,Goal,ASub,Extra) are deterministic.
    (sideff/2)debug_fixpoint(Mess,Id,Key1,Key2,Goal,ASub,Extra) is side-effect hard.

Ports

REGTYPEport/1

Usage:port(Port)

Port is an abstract debugging port.

PREDICATEfixpo_leash/1

Usage:fixpo_leash(Ports)

Leash on (abstract debugging) ports Ports, some of call, entry, exit, prime, succ, widen. By default, all ports are on leash.

  • The following properties should hold globally:
    (det/1)Calls of the form fixpo_leash(Ports) are deterministic.
    (sideff/2)fixpo_leash(Ports) is side-effect hard.

PREDICATEfixpo_hide/1

Usage:fixpo_hide(Ports)

Hide the (abstract debugging) ports Ports, some of call, entry, exit, prime, succ, widen. By default, no ports are hidden.

  • The following properties should hold globally:
    (det/1)Calls of the form fixpo_hide(Ports) are deterministic.
    (sideff/2)fixpo_hide(Ports) is side-effect hard.

Spypoints

PREDICATEfixpo_spy/1

Usage:fixpo_spy(Spec)

Set spy-point on a predicate Spec belonging to one of the currently loaded modules.

  • The following properties should hold globally:
    (det/1)Calls of the form fixpo_spy(Spec) are deterministic.
    (sideff/2)fixpo_spy(Spec) is side-effect hard.

PREDICATEfixpo_nospy/1

Usage:fixpo_nospy(Spec)

Unset spy-point on a predicate Spec belonging to one of the currently loaded modules.

  • The following properties should hold globally:
    (det/1)Calls of the form fixpo_nospy(Spec) are deterministic.
    (sideff/2)fixpo_nospy(Spec) is side-effect hard.

Usage:

Unset all spy-points.

  • The following properties should hold globally:
    (det/1)Calls of the form fixpo_nospyall are deterministic.
    (sideff/2)fixpo_nospyall is side-effect hard.

Top-Level interaction & commands

Hook for printing the source-debug information messages. Useful, for example, for the Playground. The predicate is multifile.