Term rewriting with traversal functions

  • Authors:
  • Mark G. J. van den Brand;Paul Klint;Jurgen J. Vinju

  • Affiliations:
  • Centrum voor Wiskunde en Informatica, Amsterdam, The Netherlands;Centrum voor Wiskunde en Informatica, Amsterdam, The Netherlands;Centrum voor Wiskunde en Informatica, Amsterdam, The Netherlands

  • Venue:
  • ACM Transactions on Software Engineering and Methodology (TOSEM)
  • Year:
  • 2003

Quantified Score

Hi-index 0.00

Visualization

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.