generate_built_in(Name/Arity) :- predicate_property(system:Head, built_in), functor(Head, Name, Arity), \+ sub_atom(Name, 0, _, _, $). % discard reserved names
Property is one of:
- True if the predicate can be autoloaded from the file File.
undefined, this property is not generated.
- True if the predicate is locked as a built-in predicate. This implies it cannot be redefined in its definition module and it can normally not be seen in the tracer.
- True if assert/1 and retract/1 may be used to modify the predicate. This property is set using dynamic/1.
- True if the predicate is in the public list of the context module.
- Is true if the predicate is imported into the context module from module Module.
- Unify FileName with the name of the source file in which the
predicate is defined. See also source_file/2
and the property
line_count. Note that this reports the file of the first clause of a predicate. A more robust interface can be achieved using nth_clause/3 and clause_property/2.
- True if the predicate is defined in the C language.
- Indexes56This predicate
property should be used for analysis and statistics only. The exact
representation of Indexes may change between versions.
is a list of additional (hash) indexes on the predicate. Each element of
the list is a term
ArgSpec-Index. Currently ArgSpec is an
integer denoting the argument position and Index is a term
hash(Buckets, Speedup, IsList). Here Buckets is the number of buckets in the hash and Speedup is the expected speedup relative to trying all clauses linearly. IsList indicates that a list is created for all clauses with the same key. This is currently not used.
- True if the predicate is defined in Prolog. We return true on this because, although the code is actually compiled, it is completely transparent, just like interpreted code.
- True if the predicate is covered by the ISO standard (ISO/IEC 13211-1).
- Unify LineNumber with the line number of the first clause of
the predicate. Fails if the predicate is not associated with a file. See
See also the
fileproperty above, notably the reference to clause_property/2.
- True if there may be multiple (or no) files providing clauses for the predicate. This property is set using multifile/1.
- If the predicate is declared as a meta-predicate using meta_predicate/1, unify Head with the head-pattern. The head-pattern is a compound term with the same name and arity as the predicate where each argument of the term is a meta-predicate specifier. See meta_predicate/1 for details.
- Details of the predicate are not shown by the debugger. This is the default for built-in predicates. User predicates can be compiled this way using the Prolog flag generate_debug_info.
- Do not show ports of this predicate in the debugger.
- Unify ClauseCount to the number of clauses associated with the predicate. Fails for foreign predicates.
- Unify RuleCount to the number of clauses associated with the
predicate. A rule is defined as a clauses that has a body that
is not just
true(i.e., a fact). Fails for foreign predicates. This property is used to avoid analysing predicates with only facts in
- Predicate is declared public using public/1. Note that without further definition, public predicates are considered undefined and this property is not reported.
- If true (only possible on the multithreaded version) each thread has its own clauses for the predicate. This property is set using thread_local/1.
- True if the predicate is declared transparent using the
declaration. In the latter case the property
meta_predicate(Head)is also provided. See chapter 5 for details.
- True if a procedure definition block for the predicate exists, but there
are no clauses for it and it is not declared dynamic or multifile. This
is true if the predicate occurs in the body of a loaded predicate, an
attempt to call it has been made via one of the meta-call predicates, or
the predicate had a definition in the past. See the library package
library(check)for example usage.
- True when predicate can be called without raising a predicate existence
error. This means that the predicate is (1) defined, (2) can be
inherited from one of the default modules (see default_module/2)
or (3) can be autoloaded. The behaviour is logically consistent iff the
visibleis provided explicitly. If the property is left unbound, only defined predicates are enumerated.
- If true, the clauses are not saved into a saved state by qsave_program/[1,2]. This property is set using volatile/1.