11.1.3 Predicate Annotation
This section describes the annotations of predicates and how they are
indicated in the reference pages for predicates of each given
annotation. The annotations appear to the right of the title of the
- The behavior of the
predicate can be customized/redefined by defining one or more hooks.
The mode and type annotations of a hookable predicate might not be absolute,
since hooks added by the user can change the behavior.
- The predicate is user defined, and is called by a
hookable builtin. Most hooks must be defined in module
user. For a
hook, the mode and type annotations should be seen as guide-lines to
the user who wants to add his own hook; they describe how the
predicate is used by the system.
- A multifile predicate, to which new clauses
can be added by the user. For such a predicate, the mode and type
annotations should be seen as guide-lines to the user who wants to
extend the predicate; they describe how the predicate is used by the
- You cannot call these directly but they can appear in
files as ‘:- declaration’ and give information to the compiler.
The goal template is preceded by ‘:-’ in the Synopsis.
- A predicate that is defined in the development system only, i.e. not
in runtime systems.
- A predicate that is part of the ISO Prolog Standard.
- A predicate that is not recommended in new code and that
could be withdrawn in a future release.
Meta-predicates and operators are recognizable by the implicit
conventions described below.
- Meta-predicates are predicates that need to assume some module.
The reference pages of these predicates indicate which arguments are
in a module expansion position by prefixing such arguments by ‘:’
in the Arguments field. That is, the argument can be preceded by
a module prefix (an atom followed by a colon). For example:
If no module prefix is supplied, it will implicitly be set to the
calling module. If the module prefix is a variable, an instantiation
error will be raised. If it is not an atom a type error will be
raised. So in any meta-predicate reference page the following
exceptions are implicit:
- A module prefix is written as a variable.
- A module prefix is not an atom.
- Whenever the name of a built-in predicate is defined
as operator, the name is presented in the Synopsis as an
operator, for example
:- initialization +Goal (A)
@> +Term2 (B)
It is thus always possible to see if a name is an
operator or not. The predicate can, of course, be written using the
canonical representation, even when the name is an operator. Thus (A)
and (B) can be written as (C) and (D), respectively:
@>(+Term1, +Term2) (D)
Send feedback on this subject.