2.7 Online Help
AllApplicationManualNameSummaryHelp

  • Documentation
    • Reference manual
      • Overview
        • Online Help
          • library(help): Text based manual
          • library(explain): Describe Prolog Terms
            • explain/1
            • explain/2
    • Packages

2.7.2 library(explain): Describe Prolog Terms

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

?- explain(subset(_,_)).
"subset(_, _)" is a compound term
    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

Note that PceEmacs can jump to definitions and gxref/0 can be used for an overview of dependencies.

[det]explain(@Term)
Give an explanation on Term. The argument may be any Prolog data object. If the argument is an atom, a term of the form Name/Arity or a term of the form Module:Name/Arity, explain/1 describes the predicate as well as possible references to it. See also gxref/0.
[nondet]explain(@Term, -Explanation)
True when Explanation is an explanation of Term. The explaination is a list of elements that is printed using print_message(information, explain(Explanation)).