The predicate goal_expansion/2
is first called in the module that is being compiled, and then on the
module. If Goal is of the form Module:Goal
where Module is instantiated,
is called on Goal using rules from module
Module followed by
Only goals appearing in the body of clauses when reading a source file are expanded using this mechanism, and only if they appear literally in the clause, or as an argument to a defined meta-predicate that is annotated using `0' (see meta_predicate/1). Other cases need a real predicate definition.