Term-graph Rewriting in Tom Using Relative Positions

Emilie Balland, Paul Brauner
2008 Electronical Notes in Theoretical Computer Science  
In this paper, we present the implementation in Tom of a de Bruijn indices generalization allowing the representation of term-graphs over an algebraic signature. By adding pattern matching and traversal controls to Java, Tom is a well-suited environment for defining program transformations or analyses. As some analyses, e.g. based on control flow, require graph-like structures, the use of this formalism is a natural way of expressing them by graph rewriting. Definition 2.1 (Relative position)
more » ... e set Rpos of relative positions is the monoid (Z * , .) with neutral element Λ where Z * = Z \ {0}. We note n, p the elements of Z * and ω r , ω r , . . . the elements of Rpos. Definition 2.2 (Referenced subterm) Given an absolute position ω and a relative position ω r , the absolute position accessed by ω r from ω is written pos(ω, ω r ) and is defined as follows: • if ω r = Λ, then pos(ω, ω r ) = ω E. Balland, P. Brauner /
doi:10.1016/j.entcs.2008.03.030 fatcat:jkkw4inc4bcivkwxuqtamqeuri