-Property)Queries properties of a clause. ClauseRef is a reference to a
clause as produced by clause/3, nth_clause/3
Unlike most other predicates that access clause references, clause_property/2
may be used to get information about erased clauses that have not yet
been reclaimed. Property is one of the following:
- Unify FileName with the name of the file from which the
clause is loaded. Fails if the clause was not created by loading a file
(e.g., clauses added using assertz/1).
- Unify LineNumber with the line number of the clause. Fails if
the clause is not associated to a file.
- True when SizeInBytes is the size that the clause uses in
memory in bytes. The size required by a predicate also includes the
predicate data record, a linked list of clauses, clause selection
instructions and optionally one or more clause indexes.
- Unify FileName with the name of the source file that created
the clause. This is the same as the
file property, unless
the file is loaded from a file that is textually included into source
In this scenario,
file is the included file, while the
property refers to the main file.
- True if the clause has no body.
- True if the clause has been erased, but not yet reclaimed because it is
- PredicateIndicator denotes the predicate to which this clause
belongs. This is needed to obtain information on erased clauses because
the usual way to obtain this information using clause/3
fails for erased clauses.
- Module is the context module used to execute the body of the
clause. For normal clauses, this is the same as the module in which the
predicate is defined. However, if a clause is compiled with a module
qualified head, the clause belongs to the predicate with the
qualified head, while the body is executed in the context of the module
in which the clause was defined.