Term rewriting with traversal functions
- 1 April 2003
- journal article
- Published by Association for Computing Machinery (ACM) in ACM Transactions on Software Engineering and Methodology
- Vol. 12 (2) , 152-190
- https://doi.org/10.1145/941566.941568
Abstract
Term rewriting is an appealing technique for performing program analysis and program transformation. Tree (term) traversal is frequently used but is not supported by standard term rewriting. We extend many-sorted, first-order term rewriting with traversal functions that automate tree traversal in a simple and type-safe way. Traversal functions can be bottom-up or top-down traversals and can either traverse all nodes in a tree or can stop the traversal at a certain depth as soon as a matching node is found. They can either define sort-preserving transformations or mappings to a fixed sort. We give small and somewhat larger examples of traversal functions and describe their operational semantics and implementation. An assessment of various applications and a discussion conclude the article.Keywords
This publication has 14 references indexed in Scilit:
- Typed generic traversal with term rewriting strategiesThe Journal of Logic and Algebraic Programming, 2003
- Compiling language definitionsACM Transactions on Programming Languages and Systems, 2002
- A slicing-based approach for locating type errorsACM Transactions on Software Engineering and Methodology, 2001
- Compilation and Memory Management for ASF+SDFPublished by Springer Nature ,1999
- An Overview of ELANElectronic Notes in Theoretical Computer Science, 1998
- Second-Order Term Rewriting Specification of Static Semantics: An ExercisePublished by World Scientific Pub Co Pte Ltd ,1996
- Core technologies for system renovationPublished by Springer Nature ,1996
- TXL: A rapid prototyping system for programming language dialectsComputer Languages, 1991
- The syntax definition formalism SDF—reference manual—ACM SIGPLAN Notices, 1989
- Proving and applying program transformations expressed with second-order patternsActa Informatica, 1978