[ Predicate Database and Compiler | Reference Manual | Alphabetic Index ]


Specifies the meta-arguments for the given predicates
Callable term with meta-argument indicators, or a comma-separated list of such.


This declaration is normally used as a directive in compiled code, to specify if and how the arguments of a predicate refer to other predicates (meta-arguments). In ECLiPSe 6.1, this declaration does not affect the semantics of the program, and is only used by development tools like the cross-referencer or coverage analyser. In future releases, the compiler may make use of the information.

The meta-argument indicators describes the control flow through the arguments of a meta-predicate. The functor and arity of MetaSpec correspond to the functor and arity of the meta-predicate. The arguments are each populated with one of the following atomic descriptors:

A goal that is called as a subgoal of the declared predicate.

A positive integer

A subgoal is constructed by appending the number of specified arguments, and then called.
A clause (a fact or a rule).
A PredSpec of the form Name/Arity.
A module-sensitive argument, but none of the above.
An argument that is not one of the above.
Instead of the '*', which marks a non-meta argument, a mode indicator can be given. The effect is the same as specifying '*', and giving the mode in a separate mode/1 declaration:
The argument is instantiated, i.e. it is not a variable.
The argument is ground, i.e. contains no variables.
The argument is not instantiated, it must be a free variable without any constraints or aliases.
The mode is not known or it is neither of the above.

If one of the declared predicates does not exist, a local undefined predicate is created.

The declared meta-predicate information can be accessed by retrieving the predicate's 'meta_predicate' and 'mode' properties with get_flag/3.

Modes and Determinism


This predicate is sensitive to its module context (tool predicate, see @/2).


(4) instantiation fault
MetaSpecs is not ground
(5) type error
MetaSpecs is not a callable term, or a comma list of such
(6) out of range
The callable term arguments are not meta-argument indicators


:- meta_predicate p(:,*,*).

:- meta_predicate q(0,+,-).

:- meta_predicate

See Also

compile / 1, get_flag / 3, mode / 1, library(instrument), library(xref), library(coverage), library(lint)