expand_term/3¶
expand_term( T,- X)*
This user-defined predicate is called by YAP after reading goals and clauses.
-
Module:
expand_term
( T , X) is called first on the current source module Module ; if i -
user:expand_term
( T , X)
is available on every module.
This predicate is used by YAP for preprocessing each top level term read when consulting a file and before asserting or executing it. It rewrites a term T to a term X according to the following rules: first try term_expansion//22 in the current module, and then try to use the user defined predicate user:term_expansion//22`. If this call fails then the translating process for DCG rules is applied, together with the arithmetic optimizer whenever the compilation of arithmetic expressions is in progress.