Next: Determinacy declaration
Up: Directives
Previous: Directives
  Contents
  Index
For Edinburgh style programs, the programmer can provide the compiler
with modes to help it generate efficient code. The mode of a predicate
indicates how the arguments of any call to
are instantiated just
before the call is evaluated. The mode of a predicate
of
arguments
is declared as
:-mode p(
,
,
).
where
is
(or
),
(or
),
,
(or
), or a
structured mode. The mode
means a closed term that cannot be changed
by the predicate;
means a free (uninstantiated) variable;
means a
non-variable term; and
means a don't-know term. The structured mode
means a list whose head and tail have modes
and
respectively; the structured mode
means a compound
term whose arguments have modes
, ..., and
respectively.
Neng-Fa Zhou
1999-11-24