A survey of strategies in rule-based program transformation systems

Program transformation is the mechanical manipulation of a program in order to improve it relative to some cost function and is understood broadly as the domain of computation where programs are the data. The natural basic building blocks of the domain of program transformation are transformation rules expressing a 'one-step' transformation on a fragment of a program. The ultimate perspective of research in this area is a high-level, language parametric, rule-based program transformation system, which supports a wide range of transformations, admitting efficient implementations that scale to large programs. This situation has not yet been reached, as trade-offs between different goals need to be made. This survey gives an overview of issues in rule-based program transformation systems, focusing on the expressivity of rule-based program transformation systems and in particular on transformation strategies available in various approaches. The survey covers term rewriting, extensions of basic term rewriting, tree parsing strategies, systems with programmable strategies, traversal strategies, and context-sensitive rules.

[1]  T. B. Dinesh,et al.  Equations as a uniform framework for partial evaluation and abstract interpretation , 1998, CSUR.

[2]  Robert A. Kowalski,et al.  Logic Programming, Proceedings of the Fifth International Conference and Symposium, Seattle, Washington, USA, August 15-19, 1988 (2 Volumes) , 1988, ICLP/SPL.

[3]  J. Meseguer Rewriting Logic and its Applications First International Workshop, Asilomar Conference Center, Pacific Grove, California, 3-6 September 1996. Volume 4 Electronic Notes in Theoretical Computer Science. , 1996 .

[4]  Ton Vullinghs,et al.  Tool Support for the Interactive Derivation of Formally Correct Functional Programs , 2003, J. Univers. Comput. Sci..

[5]  Alan Bundy,et al.  Constructing Induction Rules for Deductive Synthesis Proofs , 2006, CLASE.

[6]  Terence J. Harmer,et al.  The TAMPR Program Transformation System: Simplifying the Development of Numerical Software , 1997, SciTools.

[7]  John Vlissides,et al.  Proceedings of the 16th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications , 2001, OOPSLA 2001.

[8]  Oege de Moor,et al.  Higher-order matching for program transformation , 2001, Theor. Comput. Sci..

[9]  Teodor Rus,et al.  AMAST series in computing , 1993 .

[10]  BravenboerMartin,et al.  Concrete syntax for objects , 2004 .

[11]  Eelco Visser,et al.  Fusing Logic and Control with Local Transformations: An Example Optimization , 2001, Electron. Notes Theor. Comput. Sci..

[12]  Andrew M. Pitts,et al.  A Metalanguage for Programming with Bound Names Modulo Renaming , 2000, MPC.

[13]  Patrick Brézillon,et al.  Lecture Notes in Artificial Intelligence , 1999 .

[14]  Eelco Visser,et al.  Strategic Pattern Matching , 1999, RTA.

[15]  Krzysztof Czarnecki,et al.  Generative programming - methods, tools and applications , 2000 .

[16]  Terese Term rewriting systems , 2003, Cambridge tracts in theoretical computer science.

[17]  Arie van Deursen,et al.  Origin Tracking , 1993, J. Symb. Comput..

[18]  A. Augusteijn,et al.  Functional programming, program transformations and compiler construction , 1993 .

[19]  Paul Klint,et al.  The syntax definition formalism SDF—reference manual— , 1989, SIGP.

[20]  Oege de Moor,et al.  Compiling embedded languages , 2000, Journal of Functional Programming.

[21]  Gérard P. Huet,et al.  The Zipper , 1997, Journal of Functional Programming.

[22]  Eelco Visser,et al.  Language Independent Traversals for Program Transformation , 2000 .

[23]  Paul Klint,et al.  Term rewriting with traversal functions , 2003, TSEM.

[24]  James M. Neighbors,et al.  The Draco Approach to Constructing Software from Reusable Components , 1984, IEEE Transactions on Software Engineering.

[25]  Claude Kirchner,et al.  ELAN from a rewriting logic point of view , 2002, Theor. Comput. Sci..

[26]  Eelco Visser,et al.  Turning dynamic typing into static typing by program specialization in a compiler front-end for Octave , 2003, Proceedings Third IEEE International Workshop on Source Code Analysis and Manipulation.

[27]  S. Jones,et al.  A Transformation-Based Optimiser for Haskell , 1998, Sci. Comput. Program..

[28]  Eelco Visser,et al.  A Survey of Strategies in Program Transformation Systems , 2001, WRS.

[29]  Philip Wadler,et al.  Views: a way for pattern matching to cohabit with data abstraction , 1987, POPL '87.

[30]  P. Klint,et al.  Efficient annotated terms , 2000 .

[31]  Richard C. Waters,et al.  The programmer's apprentice , 1990, ACM Press frontier series.

[32]  Hélène Kirchner,et al.  ELAN: A logical framework based on computational systems , 1996, WRLA.

[33]  Edsger W. Dijkstra,et al.  A constructive approach to the problem of program correctness , 1968 .

[34]  David Gries,et al.  Specification and Transformation of Programs: A Formal Approach to Software Development , 1990 .

[35]  Ralf Lämmel,et al.  Dealing with large bananas , 2000 .

[36]  John Darlington,et al.  A Transformation System for Developing Recursive Programs , 1977, J. ACM.

[37]  Robert Paige,et al.  Future directions in program transformations , 1997, SIGP.

[38]  Steven S. Muchnick,et al.  Advanced Compiler Design and Implementation , 1997 .

[39]  Wan Fokkink,et al.  Lazy rewriting on eager machinery , 2000, TOPL.

[40]  Simon L. Peyton Jones,et al.  Secrets of the Glasgow Haskell Compiler inliner , 2002, Journal of Functional Programming.

[41]  Simon L. Peyton Jones,et al.  Template meta-programming for Haskell , 2002, Haskell '02.

[42]  Lars-Henrik Eriksson,et al.  Extensions of Logic Programming , 1993, Lecture Notes in Computer Science.

[43]  Roland Carl Backhouse,et al.  Workshop on generic programming , 1998 .

[44]  J. M. Boyle,et al.  Abstract programming and program transformation—an approach to reusing programs , 1989 .

[45]  Simon L. Peyton Jones,et al.  Imperative functional programming , 1993, POPL '93.

[46]  Ralf Steinbrüggen,et al.  Program Transformation Systems , 1983, CSUR.

[47]  Arie van Deursen,et al.  Language Prototyping: An Algebraic Specification Approach , 1996, AMAST Series in Computing.

[48]  Robert Paige,et al.  Viewing A Program Transformation System At Work , 1994, Symposium on Programming Language Implementation and Logic Programming.

[49]  João Saraiva,et al.  Lrc - A Generator for Incremental Language-Oriented Tools , 1998, International Conference on Compiler Construction.

[50]  Greg Lamberson A constructive approach , 2007 .

[51]  Eelco Visser,et al.  Retrofitting the AutoBayes Program Synthesis System with Concrete Syntax , 2004, Domain-Specific Program Generation.

[52]  Ralf Lämmel,et al.  Prological Language Processing , 2001, LDTA@ETAPS.

[53]  Eelco Visser,et al.  Rewriting Strategies for Instruction Selection , 2002, RTA.

[54]  Enrico Gobbetti,et al.  Encyclopedia of Electrical and Electronics Engineering , 1999 .

[55]  Richard S. Bird,et al.  Two exercises found in a book on algorithmics , 1987 .

[56]  Andrew W. Appel,et al.  Modern Compiler Implementation in ML , 1997 .

[57]  Eelco Visser,et al.  Meta-programming with Concrete Object Syntax , 2002, GPCE.

[58]  Eelco Visser,et al.  Strategies for Source-to-Source Constant Progagation , 2002, Electron. Notes Theor. Comput. Sci..

[59]  Dale A. Miller,et al.  AN OVERVIEW OF PROLOG , 1988 .

[60]  Chris Verhoef,et al.  Generation of components for software renovation factories from context-free grammars , 2000, Sci. Comput. Program..

[61]  Rubén Prieto-Díaz,et al.  Software reusability , 1993 .

[62]  Giuseppe Castagna,et al.  CDuce: an XML-centric general-purpose language , 2003, ACM SIGPLAN Notices.

[63]  Eelco Visser,et al.  Generation of formatters for context-free languages , 1996, TSEM.

[64]  Krzysztof R. Apt,et al.  Logic Programming , 1990, Handbook of Theoretical Computer Science, Volume B: Formal Models and Sematics.

[65]  Frank Pfenning,et al.  Higher-order abstract syntax , 1988, PLDI '88.

[66]  Thomas Reps,et al.  The Synthesizer Generator: A System for Constructing Language-Based Editors , 1988 .

[67]  Ralf Lämmel,et al.  Strategic programming meets adaptive programming , 2003, AOSD '03.

[68]  Eelco Visser,et al.  Concrete syntax for objects: domain-specific language embedding and assimilation without restrictions , 2004, OOPSLA '04.

[69]  Robert Paige,et al.  Viewing A Program Transformation System At Work , 1994, PLILP.

[70]  Helmuth Partsch,et al.  Specification and Transformation of Programs - A Formal Approach to Software Development , 1990, Texts and Monographs in Computer Science.

[71]  Arie van Deursen,et al.  The Reengineering Wiki , 2002, Proceedings of the Sixth European Conference on Software Maintenance and Reengineering.

[72]  Walid Taha,et al.  MetaML and multi-stage programming with explicit annotations , 2000, Theor. Comput. Sci..

[73]  Simon Peyton Jones,et al.  Playing by the rules: rewriting as a practical optimisation technique in GHC , 2001 .

[74]  Ken Friis Larsen,et al.  Incremental execution of transformation specifications , 2004, POPL.

[75]  F. Dick A survey of the project Automath , 1980 .

[76]  J. Van Leeuwen,et al.  Handbook of theoretical computer science - Part A: Algorithms and complexity; Part B: Formal models and semantics , 1990 .

[77]  José Meseguer,et al.  Principles of OBJ2 , 1985, POPL.

[78]  Eelco Visser Scoped Dynamic Rewrite Rules , 2001, Electron. Notes Theor. Comput. Sci..

[79]  Ton Vullinghs,et al.  System Support for the Interactive Transformation of Functional Programs , 1999 .

[80]  Ralf Lämmel,et al.  Typed Combinators for Generic Traversal , 2002, PADL.

[81]  Oege de Moor,et al.  Imperative Program Transformation by Rewriting , 2001, CC.

[82]  Narciso Martí-Oliet,et al.  Maude: specification and programming in rewriting logic , 2002, Theor. Comput. Sci..

[83]  S. Doaitse Swierstra,et al.  First-class Attribute Grammars , 2000, Informatica.

[84]  Gérard P. Huet,et al.  Proving and applying program transformations expressed with second-order patterns , 1978, Acta Informatica.

[85]  Clark Thomborson,et al.  Manufacturing cheap, resilient, and stealthy opaque constructs , 1998, POPL '98.

[86]  Jan Willem Klop,et al.  Term Rewriting Systems: From Church-Rosser to Knuth-Bendix and Beyond , 1990, ICALP.

[87]  Claude Kirchner,et al.  Controlling rewriting by rewriting , 1996, WRLA.

[88]  S. P. Luttik,et al.  Specification of rewriting strategies , 1997 .

[89]  Martin S. Feather,et al.  A System for Assisting Program Transformation , 1982, TOPL.

[90]  Paul Klint,et al.  Rewriting-based languages and systems , 2003 .

[91]  S. Doaitse Swierstra Programming languages and systems : 8th European Symposium on Programming, ESOP '99, held as part of the Joint European Conferences on Theory and Practice of Software, ETAPS'99, Amsterdam, The Netherlands, March 22-28, 1999 : proceedings , 1999 .

[92]  Christopher W. Fraser,et al.  BURG: fast optimal instruction selection and tree parsing , 1992, SIGP.

[93]  P. Klint,et al.  Reverse engineering and system renovation—an annotated bibliography , 1997, SOEN.

[94]  Jan A. Bergstra,et al.  Term-Rewriting Systems with Rule Priorities , 1989, Theor. Comput. Sci..

[95]  James R. Cordy,et al.  The TXL Programming Language , 1995 .

[96]  Jean-Pierre Jouannaud,et al.  Rewrite Systems , 1991, Handbook of Theoretical Computer Science, Volume B: Formal Models and Sematics.

[97]  Ted J. Biggerstaff,et al.  International workshop on software transformation systems (STS'99) , 1999, Proceedings of the 1999 International Conference on Software Engineering (IEEE Cat. No.99CB37002).

[98]  Joseph A. Goguen,et al.  Initial Algebra Semantics and Continuous Algebras , 1977, J. ACM.

[99]  Joost Visser Visitor combination and traversal control , 2001, OOPSLA '01.

[100]  Douglas R. Smith,et al.  KIDS: A Semiautomatic Program Development System , 1990, IEEE Trans. Software Eng..

[101]  J. Roger Hindley,et al.  To H.B. Curry: Essays on Combinatory Logic, Lambda Calculus, and Formalism , 1980 .

[102]  Ralf Lämmel,et al.  Parse-tree annotations meet re-engineering concerns , 2003, Proceedings Third IEEE International Workshop on Source Code Analysis and Manipulation.

[103]  Giuseppe Castagna,et al.  CDuce: an XML-centric general-purpose language , 2003, ICFP '03.

[104]  James R. Cordy,et al.  The TXL Programming Language-Version 10 , 2000 .

[105]  Claude Kirchner,et al.  An overview of ELAN , 1998, WRLA.

[106]  Teodor Rus,et al.  CONTEXT-FREE ALGEBRAS , 1976 .

[107]  Amy P. Felty,et al.  A Logic Programming Approach to Implementing Higher-Order Term Rewriting , 1991, ELP.

[108]  Christopher W. Fraser,et al.  Engineering a simple, efficient code-generator generator , 1992, LOPL.

[109]  Helmut A. Partsch,et al.  Specification and transformation of programs , 1990 .

[110]  Robert Paige,et al.  Future directions in program transformations , 1996, CSUR.

[111]  Donald E. Knuth,et al.  Semantics of context-free languages , 1968, Mathematical systems theory.

[112]  Eelco Visser,et al.  Building Interpreters with Rewriting Strategies , 2002, LDTA@ETAPS.

[113]  Eelco Visser,et al.  The Essence of Strategic Programming , 2002 .

[114]  João Saraiva,et al.  Data Structure Free Compilation , 1999, CC.

[115]  Eelco Visser,et al.  Program Transformation with Stratego/XT: Rules, Strategies, Tools, and Systems in Stratego/XT 0.9 , 2003, Domain-Specific Program Generation.

[116]  James H. Cross,et al.  Reverse engineering and design recovery: a taxonomy , 1990, IEEE Software.

[117]  Alberto Pettorossi,et al.  Future directions in program transformation , 1997, SIGP.

[118]  Peter Sestoft,et al.  Partial evaluation and automatic program generation , 1993, Prentice Hall international series in computer science.

[119]  Simon L. Peyton Jones,et al.  Scrap your boilerplate: a practical design pattern for generic programming , 2003, TLDI '03.

[120]  Tobias Nipkow,et al.  Term rewriting and all that , 1998 .

[121]  Ralf Lämmel,et al.  Typed generic traversal with term rewriting strategies , 2002, J. Log. Algebraic Methods Program..

[122]  Patrick Cousot,et al.  Systematic design of program transformation frameworks by abstract interpretation , 2002, POPL '02.

[123]  Helmuth Partsch,et al.  Transformational Program Development in a Particular Program Domain , 1986, Sci. Comput. Program..

[124]  Thomas W. Reps,et al.  The synthesizer generator , 1984, SDE 1.

[125]  Alberto Pettorossi,et al.  Rules and strategies for transforming functional and logic programs , 1996, CSUR.

[126]  Richard C. Waters,et al.  The Programmer's Apprentice: Knowledge Based Program Editing , 1982, IEEE Transactions on Software Engineering.

[127]  Hans Petter Langtangen,et al.  Modern Software Tools for Scientific Computing , 1997, Birkhäuser Boston.

[128]  Ralph E. Johnson,et al.  A Refactoring Tool for Smalltalk , 1997, Theory Pract. Object Syst..

[129]  Alfred V. Aho,et al.  Compilers: Principles, Techniques, and Tools , 1986, Addison-Wesley series in computer science / World student series edition.

[130]  de Ng Dick Bruijn,et al.  A survey of the project Automath , 1980 .

[131]  M.P.A. Sellink,et al.  Proceedings of the 2nd International Workshop on the Theory and Practice of Algebraic Specifications (ASF+SDF'97) , 1997 .

[132]  Jan Heering Implementing higher-order algebraic specifications , 1991 .

[133]  Kazuhiro Ogata,et al.  Implementation of Term Rewritings with the Evaluation Strategy , 1997, PLILP.

[134]  Thomas Johnsson,et al.  Attribute grammars as a functional programming paradigm , 1987, FPCA.

[135]  Eelco Visser,et al.  Building program optimizers with rewriting strategies , 1998, ICFP '98.

[136]  Alan Stewart,et al.  An Algebra for Deriving Efficient Implementations for an Array Processor Parallel Computer from Functional Specifications , 1995 .

[137]  Jaco van de Pol,et al.  Just-in-time: On Strategy Annotations , 2001, WRS.

[138]  Todd A. Proebsting BURS automata generation , 1995, TOPL.

[139]  Andrew W. Appel,et al.  Shrinking lambda Expressions in Linear Time , 1997, J. Funct. Program..

[140]  S. Doaitse Swierstra,et al.  Higher order attribute grammars , 1989, PLDI '89.

[141]  Martin S. Feather,et al.  A survey and classification of some program transformation approaches and techniques , 1987 .