Module trace

Predicates for tracing execution of a program

Contents

Predicate


Top of this page Contents Index of this package LiLFeS Documents LiLFeS Home Page Tsujii laboratory

Predicate

trace/1

Formattrace(+$PRED)
Arguments
+$PREDpred or list predicate or list of predicate
Note$CPRED must be specified with arity.And don't forget ":-"
Make progress of executing $PRED output.
> :- trace('append/3').
 > :- trace(['append/3', 'reverse/2', '=/2']).
 This is a example after specify append/3 to TRACE. 
 > append([],X,X).
 > append([A|X], Y, [A|Z]) :- append(X,Y,Z).
 > ?- append(X,Y,[a]).
 TRACE: ENTER append/3(1)    - enter the first clause of append.
 bot, bot, < a >             - arity is (bot, bot, [a]) .
 TRACE: SUCCESS append/3(1)  - success the first clause of append.
 < >, < a >, < a >           - arity become ([], [a], [a]). 
 X: < >                      - output of result.
 Y: < a >
 Enter ';' for more choices, otherwise press ENTER --> ;
 TRACE: REENTER append/3(2)  - backtrack and reenter the second clause of append.
 bot, bot, < a >             - arity is (bot, bot, [a]) .
 TRACE: ENTER append/3(1)    --- enter the first clause of append.
 list, bot, < >              --- arity is (list, bot, []) .
 TRACE: SUCCESS append/3(1)  --- success the first clause of append.
 < >, < >, < >               --- arity is  ([], [], []). 
 TRACE: SUCCESS append/3(2)  - success the cause of call,append.
 < a >, < >, < a >           - arity is ([a], [], [a]).
 X: < a >                    - output of result.
 Y: < >
 Enter ';' for more choices, otherwise press ENTER --> ;
 TRACE: REENTER append/3(2)  --- backtrack append that called in front. 
 list, bot, < >              --- arity is  (list, bot, []).
 TRACE: FAIL append/3        --- fail that append.
 list, bot, < >              --- arity is (list, bot, []) .
 TRACE: FAIL append/3        - fail the cause of call, append
 bot, bot, < a >             - arity is (bot, bot, [a]).
 no                          - return no.

notrace/1

Formatnotrace(+$PRED)
Arguments
+$PREDpred or list predicate or list of predicate
Note$CPRED must be specified with arity.
Disable tracing of $PRED.
> :- notrace('append/3').
 > :- notrace(['append/3', 'reverse/2', '=/2']).

Top of this page Contents Index of this package LiLFeS Documents LiLFeS Home Page Tsujii laboratory

This document is automatically created by lildoc on Fri Sep 24 14:13:58 2004