Successively unifies Name with the name of predicates
currently defined and Head with the most general term built
from Name and the arity of the predicate. This predicate
succeeds for all predicates defined in the specified module, imported to
it, or in one of the modules from which the predicate will be imported
if it is called.
Succeeds if Head refers to a predicate that has property
Property. Can be used to test whether a predicate has a
certain property, obtain all properties known for Head, find
all predicates having property or even obtaining all
information available about the current program. Property is
Is 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.
Is 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.
Is true if the predicate is defined in the C language.
Is true if the predicate is declared dynamic using the dynamic/1
Is true if the predicate is declared multifile using the multifile/1
Is true if a procedure definition block for the predicate exists, but
there are no clauses in it and it is not declared dynamic. 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
check for example usage.
`Do What I Mean' (`dwim') support predicate. Term is a term,
which name and arity are used as a predicate specification. Dwim
is instantiated with the most general term built from Name
and the arity of a defined predicate that matches the predicate
Term in the `Do What I Mean' sense. See dwim_match/2
for `Do What I Mean' string matching. Internal system predicates are not
generated, unless style_check(+dollar) is active.
Backtracking provides all alternative matches.
Succeeds when Head can be unified with a clause head and Body
with the corresponding clause body. Gives alternative clauses on
backtracking. For facts Body is unified with the atom true.
is used to find clause definitions for a predicate, but it can also be
used to find clause heads for some body template.
Equivalent to clause/2,
but unifies Reference with a unique reference to the clause
(see also assert/2, erase/1).
If Reference is instantiated to a reference the clause's head
and body will be unified with Head and Body.
Provides access to the clauses of a predicate using their index number.
Counting starts at 1. If Reference is specified it unifies Pred
with the most general term with the same name/arity as the predicate and
Index with the index-number of the clause. Otherwise the name
and arity of Pred are used to determine the predicate. If Index
is provided Reference will be unified with the clause
reference. If Index is unbound, backtracking will yield both
the indices and the references of all clauses of the predicate. The
following example finds the 2nd clause of member/2:
?- nth_clause(member(_,_), 2, Ref), clause(Head, Body, Ref).
Ref = 160088
Head = system : member(G575, [G578|G579])
Body = member(G575, G579)