Transform driver (monolithic)

This module provides the main entry points for for performing program transformations. It requires loading the program before (e.g., with frontend_driver).

Adding new transformation

To include a new program transformation, add a clause for transform/2 (and for transformation/1).

As an alternative, you can add clauses for the multifile predicates transformation/4 and transformation/1, directly in your own sources.

See the file examples/Extending/myspecializer.pl in the source directory for an example of this.


Usage and interface

Documentation on exports

PREDICATEtransform/1

Usage 1:transform(Trans)

Returns on backtracking all available program transformation identifiers.

  • The following properties should hold at call time:
    (var/1)Trans is a free variable.
  • The following properties should hold upon exit:
    (transformation/1)Trans is a valid transformation identifier.

Usage 2:transform(Trans)

Performs transformation Trans on the current module.

  • The following properties should hold at call time:
    (nonvar/1)Trans is currently a term which is not a free variable.
    (transformation/1)Trans is a valid transformation identifier.

PREDICATEtransform/2

Usage:transform(Trans,Info)

Same as transform(Trans) but returns information that can be used to check the results of the transformation.

  • The following properties should hold at call time:
    (nonvar/1)Trans is currently a term which is not a free variable.
    (var/1)Info is a free variable.

Documentation on multifiles

Usage:transformation(Transformation,Clauses,Dictionaries,Info)

Performs Transformation on program Clauses.

  • The following properties should hold at call time:
    (transformation/1)Transformation is a valid transformation identifier.
The predicate is multifile.

Usage:transformation(Transformation)

Transformation is a valid transformation identifier.

    The predicate is multifile.