<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">\subsection{Debugging}

\gloss{pfcTrace\\
	pfcTrace(+Term)\\
	pfcTrace(+Term,+Mode)\\
	pfcTrace(+Term,+Mode,+Condition)}

This predicate causes the addition and/or removal of \pfc\ terms to be
traced if a specified condition is met. The arguments are as follows:
\begin{itemize}

\item term - Specifies which terms will be traced.  Defaults to
\prolog{\_} (i.e. all terms).

\item mode - Specifies whether the tracing will be done on the addition (i.e.
\prolog{add}, removal (i.e. \prolog{rem}) or both (i.e. \prolog{\_}) of
the term.  Defaults to \prolog{\_}.

\item condition - Specifies an additional condition which must be met
in order for the term to be traced.  For example, in order to trace
both the addition and removal of assertions of the age of people just
when the age is greater than 100, you can do
\prolog{pfcTrace(age(\_,N),\_,N&gt;100)}.
\end{itemize}

Thus, calling \prolog{pfcTrace} will cause all terms to be traced when
they are added and removed from the database.  When a fact is added or
removed from the database, the lines
\example
1
2
\end{verbatim}\end{quote}
are displayed, respectively.  


\gloss{pfcUntrace\\
	pfcUntrace(+Term)\\
	pfcUntrace(+Term,+Mode)\\
	pfcUntrace(+Term,+Mode,+Condition)}

The \prolog{pfcUntrace} predicate is used to stop tracing \pfc\ facts.
Calling \prolog{pfcUntrace(P,M,C)} will stop all tracing
specifications which match.  The arguments default as described above.

\gloss{pfcSpy(+Term)\\
	pfcSpy(+Term,+Mode)\\
	pfcSpy(+Term,+Mode,+Condition)}

These predicates set spypoints, of a sort.

\gloss{pfcQueue}

Displays the current queue of facts in the \pfc\ queue.

\gloss{showState} Displays the state of Pfc, including the queue, all
triggers, etc.

\gloss{pfcFact(+P)\\pfcFacts(+L)}

pfcFact(P) unifies P with a fact that has been added to the database
via \pfc\.  You can backtrac into it to find more facts.  pfcFacts(L)
unified L with a list of all of the facts asserted by add.

\gloss{pfcPrintDb\\pfcPrintFacts\\pfcPrintRules}

These predicates diaply the the entire \pfc\ database (facts and
rules) or just the facts or just the rules.

</pre></body></html>