The  Prolog  interpreter  provides  a  tracing facility.  Procedures may be
individually traced enabling each call the procedure to be displayed on the
terminal with the current values of its arguments.

Tracing of procedure procedure is enabled by the command:-

                                trace procedure!

Tracing is disabled by the command:-

                               untrace procedure!

Trace and untrace may also be given lists of procedure names are arguments.
Then all the procedures in the list will be traced or untraced.

At  the  beginning  of  a line output by the trace procedure, Prolog prints
either of the following:


     C>
     E<
     F<
     R>


'C'  indicates that a procedure is being called for the first time.  A line
beginning  with  'E'  shows  the interpreter exiting a clause after all the
goals  have  been  satisfied.  'F' indicates an exit from a clause due to a
failure in satisfying a goal.  After a failure, Prolog will attempt to redo
a  procedure  call  if  there are alternative clauses left in the procedure
definition.  This is shown by an 'R'.

An example of tracing output is shown below:


     : f(A, b) :- g(A).

     : g(A) :- A = a.
     : g(c).

     : trace [f, g]!
     : f(c, b)?

     C|>f(c, b)
     C||>g(c)
     R||>g(c)
     E||<g(c)
     E|<f(c, b)
