Home Contents Index Summary Previous Next

2.6 Online Help

Online help provides a fast lookup and browsing facility to this manual. The online manual can show predicate definitions as well as entire sections of the manual.

The online help is displayed from the file library('MANUAL'). The file library(helpidx) provides an index into this file. library('MANUAL') is created from the LaTeX sources with a modified version of dvitty, using overstrike for printing bold text and underlining for rendering italic text. XPCE is shipped with library(swi_help), presenting the information from the online help in a hypertext window. The prolog-flag write_help_with_overstrike controls whether or not help/1 writes its output using overstrike to realise bold and underlined output or not. If this prolog-flag is not set it is initialised by the help library to true if the TERM variable equals xterm and false otherwise. If this default does not satisfy you, add the following line to your personal startup file (see section 2.2):


:- set_prolog_flag(write_help_with_overstrike, true).

help
Equivalent to help(help/1).

help(+What)
Show specified part of the manual. What is one of:
<Name>/<Arity> Give help on specified predicate
<Name> Give help on named predicate with any arity or C interface function with that name
<Section> Display specified section. Section numbers are dash-separated numbers: 2-3 refers to section 2.3 of the manual. Section numbers are obtained using apropos/1.

Examples:

?- help(assert). Give help on predicate assert
?- help(3-4). Display section 3.4 of the manual
?- help('PL_retry').Give help on interface function PL_retry()

See also apropos/1, and the SWI-Prolog home page at http://www.swi-prolog.org, which provides a FAQ, an HTML version of manual for online browsing and HTML and PDF versions for downloading.

apropos(+Pattern)
Display all predicates, functions and sections that have Pattern in their name or summary description. Lowercase letters in Pattern also match a corresponding uppercase letter. Example:
?- apropos(file). Display predicates, functions and sections that have `file' (or `File', etc.) in their summary description.

explain(+ToExplain)
Give an explanation on the given `object'. 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 will try to explain the predicate as well as possible references to it.

explain(+ToExplain, -Explanation)
Unify Explanation with an explanation for ToExplain. Backtracking yields further explanations.