Section "include"
It is also possible to include Prolog clauses from a text file,
resulting in predicates which pro-vide further optimizations such
as body indexing. To do so we provide ISO core standard
pred-icates such as include/1 and ensure_loaded/1. As a
convenience its also possible to ensure load multiple files by
invoking the list notation.
Prolog texts are subject to some common checks. Clauses or
directives are examined by the singleton check, which gives a
warning when the input text had a named variable appearing only
once. A further warning respective an error aborting the clause or
directive is given by the style checks concerning the
discontiguous and multifile constraints.
The following include predicates are provided:
- multifile I: [ISO 7.4.2.2]
- The predicate sets the predicate I to multifile.
- discontiguous I: [ISO 7.4.2.3]
- The predicate sets the predicate I to discontiguous.
- include(P): [ISO 7.4.2.7]
- The predicate succeeds. As a side effect, the path P is
included.
- ensure_loaded(P): [ISO 7.4.2.8]
- The predicate succeeds. As a side effect, the path P is ensure
loaded.
- [P1, .., Pn]:
- The predicate succeeds. As a side effect, the paths P1,
.., Pn are ensure loaded.
- current_source(P):
- The predicate succeeds in S with the current source paths.
- source_property(S, P):
- The predicate succeeds in P with the properties of the source
path S. The following properties are supported:
- sys_link(T): The path loaded the source path T.