Annals of Mathematics and Artificial Intelligence

, Volume 29, Issue 1, pp 1–34

Warm fusion in Stratego: A case study in generation of program transformation systems

  • Patricia Johann
  • Eelco Visser

DOI: 10.1023/A:1018956702672

Cite this article as:
Johann, P. & Visser, E. Annals of Mathematics and Artificial Intelligence (2000) 29: 1. doi:10.1023/A:1018956702672


Stratego is a domain-specific language for the specification of program transformation systems. The design of Stratego is based on the paradigm of rewriting strategies: user-definable programs in a little language of strategy operators determine where and in what order transformation rules are (automatically) applied to a program. The separation of rules and strategies supports modularity of specifications. Stratego also provides generic features for specification of program traversals.

In this paper we present a case study of Stratego as applied to a non-trivial problem in program transformation. We demonstrate the use of Stratego in eliminating intermediate data structures from (also known as deforesting) functional programs via the warm fusion algorithm of Launchbury and Sheard. This algorithm has been specified in Stratego and embedded in a fully automatic transformation system for kernel Haskell. The entire system consists of about 2600 lines of specification code, which breaks down into 1850 lines for a general framework for Haskell transformation and 750 lines devoted to a highly modular, easily extensible specification of the warm fusion transformer itself. Its successful design and construction provides further evidence that programs generated from Stratego specifications are suitable for integration into real systems, and that rewriting strategies are a good paradigm for the implementation of such systems.

Copyright information

© Kluwer Academic Publishers 2000

Authors and Affiliations

  • Patricia Johann
    • 1
  • Eelco Visser
    • 2
  1. 1.Department of MathematicsBates CollegeLewistonUSA E-mail
  2. 2.Institute of Information and Computing SciencesUniversiteit UtrechtUtrechtThe Netherlands E-mail