[ Predicate Database and Compiler | The ECLiPSe Built-In Predicates | Reference Manual | Alphabetic Index ]

# expand_goal(+Term, -TransTerm)

Apply goal inline expansion to Term

Term
  A callable term.
TransTerm
  A variable or callable term.

## Description

Applies a goal inline expansion to Term, if any is visible in the caller module. If no inline declaration is visible, TransTerm is identical to Term.

Normally, goal inline expansion is performed implicitly by the compiler. For certain meta-programming applications (e.g. for writing other compilers) it can be performed explicitly using expand_goal/2. Goal inline expansion is the third transformation which is applied during the compilation process: macro expansion, then clause expansion, then goal inline expansion.

### Modes and Determinism

- expand_goal(+, -) is det

### Modules

This predicate is sensitive to its module context (tool predicate, see @/2).

## Examples

        [eclipse 1]: lib(fd).
        yes.

        [eclipse 5]: expand_goal(X#>Y, G).
        X = X
        Y = Y
        G = fd_arith : fd_gec(X, -1, Y, -1, 0)
        yes.

## See Also

inline / 2, portray / 3, expand_clause / 2