PLOGHELP CHATTY                                         R.Evans May 1983
                              Revised by Kathryn Seifert  September 1986

Debugging tool to make clauses print commentary during their execution

Keywords: debugging, tracing


CHATTY is a Prolog library file for tracing Prolog programs.  It is
loaded by the command

    ?- library(chatty).

This makes the following predicates available:

chatty
    Operator, used like spy (see PLOGHELP * SPY). The arguments to
    'chatty' are predicate names. The predicate names may be in '/'
    notation (eg foo/3), or they may be predicate names which do not
    specify the arity (eg foo). Each predicate specified is made chatty:
    see below.

unchatty
    Operator, used like nospy (see PLOGHELP * NOSPY). Arguments are as
    for chatty. Each predicate specified is restored to its unchatty
    form.

chattyset
    Goal which takes no arguments - reset the chatty indentation to 0
    (see note 2, below).

A predicate which is chatty prints out various messages as it is
executed, namely a 'starting' message when it is first called, a 'try
clause' message as each clause is tried, a 'clause succeeded' or 'clause
failed' message when the clause finished, a 'retry clause' message if
the system backtracks into a clause and finally a 'no more clauses'
message if all clauses of a predicate fail.  All such messages include
the clause number (where appropriate) and the predicate name (and
arguments where appropriate), and are preceded by '###' and an
indentation which follows the calling structure (as in POP-11 TRACE -
see HELP *TRACE).


-- NOTES --------------------------------------------------------------

1) CHATTY works by modifying all the clauses for a predicate; in
particular any predicate which is, or has been 'chattified' will be
interpreted, not compiled.  This may result in a loss of speed.

2) If you ask for ALL solutions to a goal, then the indentation of
chatty messages will be 0 when you finish.  Usually, however, you don't
want more than the first few solutions, in which case the final
indentation may not be 0.  Thus your NEXT goal will start off with the
wrong indentation set.  This is when you use the goal 'chattyset',
immediately prior to your goal, to reset the indentation.


-- RELATED DOCUMENTATION ----------------------------------------------

PLOGHELP * DEBUG
 Overview of the debugging facilities provided by POPLOG Prolog

PLOGHELP * NOSPY
 Predicate to remove spypoints from specified predicates

PLOGHELP * SPY
 Main predicate used to invoke and control the SPY package

HELP * TRACE
 POP-11 debugging package
