[ Predicate Database and Compiler | Reference Manual | Alphabetic Index ]
Used to enumerate all predicates with given property in the caller module
- An atom.
- A variable or an expression of the form Atom/Integer.
This predicate is mainly used to enumerate all predicates in the caller
module with one of the following properties (for testing, use get_flag/3):
This predicate is more efficient than current_predicate/1 and
current_built_in/1 when one is not interested in imported predicates.
In particular, it does not complain about ambiguous imports.
predicates that have been referenced but are neither
declared nor defined in this module.
predicates whose module of origin is known (through import or qualified
reference), but that module does not exist.
predicates whose module of origin exists, but the predicate is not
exported from there.
defined predicates that are local
defined predicates that are exported
defined predicates that are reexported
defined predicates that are exported or reexported
predicates defined in this module (local or exported)
local or exported predicates that have not been defined (no clauses)
predicates that are imported or referenced via qualification, but have
their deprecated-flag set.
Modes and Determinism
- current_module_predicate(+, -) is nondet
- current_module_predicate(+, ++) is semidet
This predicate is sensitive to its module context (tool predicate, see @/2).
Fails if there is no predicate with the given property
- (4) instantiation fault
- Property is not instantiated
- (5) type error
- Property is not an atom
- (5) type error
- PredSpec is instantiated, but not to the form Atom/Integer.
[eclipse 1]: [user].
:- local r/0.
p :- q, r.
[eclipse 2]: current_module_predicate(defined,P).
P = p / 0
[eclipse 3]: current_module_predicate(undefined,P).
P = r / 0
[eclipse 4]: current_module_predicate(undeclared,P).
P = q / 0
current_built_in / 1, current_predicate / 1, get_flag / 3