- Program transformation
A program transformation is any operation that takes a program and generates another program. It is often important that the derived program be semantically equivalent to the original, relative to a particular formal semantics. Other program transformations may generate programs that semantically differ from the original in predictable ways.
A generalisation of semantic equivalence is the notion of
program refinement :one program is a refinement of another if it terminates on all the initial statesfor which the original program terminates, and for eachsuch state it is guaranteed to terminate in a possible final state for the original program.In other words, a refinement of a program is "more defined" and "more deterministic"than the original program. If two programs are refinements of each other,then the programs are equivalent.While program transformations can be defined as manual procedures, it is more useful in practice to use program transformation system, a tool that can accept and apply specifications of program transformations. Program transformations may be specified as automated procedures that modify compiler data structures (e.g.
abstract syntax trees ) representing the program text, or may be specified more conveniently using patterns representing parameterized source code text fragments.A practical requirement for program transformation systems is that they be ableto process the source code for the programming language of the application systemto be transformed. For many languages, the problem of building an adequatefront end for the transformation tool may overshadow the value of the tool itself.For instance, transforming C++ is a notoriously hard problem.For a program transformation system to be used in a wide variety of circumstances,it must be able to handle a wide variety of languages.
ee also
*
Transformation language
*Source-to-source compiler
*Source code generation
*Code generation (compiler)
*Data transformation External links
* [http://www.program-transformation.org The Program transformation Wiki]
Wikimedia Foundation. 2010.