The final assignment for the program transformation course is a little research project in which
you have to implement a transformation in Stratego with teams of two students.
Study the following projects and discuss with Eelco Visser about an appropriate project for
Study the literature to find out what transformation is required.
- working implementation (for identified subset if necessary)
- paper documenting the transformation and solution
Embedding of XQuery/XPath/XSLT in Java
Create an embedding (ala MetaBorg?
) of one or all of these languages
in Java and develop an assimilation to plain Java.
Strategies for device driver evolution
Encode changes to device driver code as a strategy. Model the
problem in Tiger (based on slides and paper), and come up with ways
to define the transformations in Stratego.
Refactoring is a transformation to improve the design of a program.
Implement several refactorings for Java in Stratego using
java-front. Include at least Extract Method.
Note: Refactoring is really an interactive process that requires to
a region in the code. To emulate this you can extend the syntax of
Java to indicate the selected region.
Desugaring / Weaving
Lifting Inner Classes in Java
Implement a transformation that lifts inner classes to
top-level. This requires that any local variables visible in the
lifted inner class is passed on to the constructor of the lifted class.
Implement a (subset of) AspectJ?
Create an extension of Tiger with aspects (a la AspectJ?
Implement aspect weaving as a preprocessor.
Simplification of conditional expressions
Develop a simplifier for pure Tiger expressions including arithmetic
and relational operators and if-then-else. Simplify by constant
folding and other appropriate laws. The challenge is to take into
account the Boolean expressions in the condition of the
if-then-else. For example, in the expression 'if x = 0 then e1 else
e2', the expression e1 can be optimized knowing that x equals 0 and
e2 can be transforming knowing the negation of that
expression. Consider equalities, inequalities, conjunctions and
disjunctions. Extend this with common-subexpression elimination as
described in the paper by De Moor and Secher.
- Bernd Fischer (NASA/Ames)
Partial evaluation with records and arrays (alias analysis)
Extend Tiger partial evaluator to cope with records and arrays.
- M. Bravenboer, A. van Dam, K. Olmos, and E. Visser. Program Transformation with Scoped Dynamic Rewrite Rules. Fundamenta Informaticae, 2005. Section 8 defines a simple online partial evaluator that forms the basis of your partial evaluator.
Inlining and tail call and tail recursion elimination
Extend your Tiger compiler with these optimizations at different
stages in compilation.