% This LaTeX document was generated using the LaTeX backend of PlDoc,
% The SWI-Prolog documentation system



\subsection{library(explain): Describe Prolog Terms}

\label{sec:explain}

The \verb$library(explain)$ describes prolog-terms. The most useful
functionality is its cross-referencing function.

\begin{code}
?- explain(subset(_,_)).
"subset(_, _)" is a compound term
        Referenced from 2-th clause of lists:subset/2
        Referenced from 46-th clause of prolog_xref:imported/3
        Referenced from 68-th clause of prolog_xref:imported/3
lists:subset/2 is a predicate defined in
        /staff/jan/lib/pl-5.6.17/library/lists.pl:307
        Referenced from 2-th clause of lists:subset/2
        Possibly referenced from 2-th clause of lists:subset/2
\end{code}

Note that the help-tool for XPCE provides a nice graphical
cross-referencer.\vspace{0.7cm}

\begin{description}
    \predicate[det]{explain}{1}{@Term}
Give an explanation on \arg{Term}. The argument may be any Prolog data
object. If the argument is an atom, a term of the form \verb$Name/Arity$
or a term of the form \verb$Module:Name/Arity$, \predref{explain}{1} describes the
predicate as well as possible references to it. See also \predref{gxref}{0}.

    \predicate[nondet]{explain}{2}{@Term, -Explanation}
True when \arg{Explanation} is an explanation of \arg{Term}.
\end{description}

