Generalising tree traversals and tree transformations to DAGs: Exploiting sharing without the pain
- ,
- Emil Axelsson
- ,
- Chalmers University of Technology
Publikation:
Artikel i tidsskrift og konference artikel i tidsskrift
Tidsskriftartikel
Forskning
Peer-reviewOpen Access
Resume
We present a recursion scheme based on attribute grammars that can be transparently applied to trees and acyclic graphs. Our recursion scheme allows the programmer to implement a tree traversal or a tree transformation and then apply it to compact graph representations of trees instead. The resulting graph traversal or graph transformation avoids recomputation of intermediate results for shared nodes – even if intermediate results are used in different contexts. Consequently, this approach leads to asymptotic speedup proportional to the compression provided by the graph representation. In general, however, this sharing of intermediate results is not sound. Therefore, we complement our implementation of the recursion scheme with a number of correspondence theorems that ensure soundness for various classes of traversals. We illustrate the practical applicability of the implementation as well as the complementing theory with a number of examples.
Publikation information
Produktionstype
Publikation:
Artikel i tidsskrift og konference artikel i tidsskrift
Tidsskriftartikel
Forskning
Peer-reviewOriginalsprog
EngelskSider fra-til (Antal sider)
Sider 63-97Tidsskrift (Bind, Nummer)
Science of Computer Programming (Bind 137)Publikationsmilepæle
- Udgivet - 04/04/2017
Publikationsstatus
Udgivet - 04/04/2017
ISSN
0167-6423Publikations IDer
- Scopus: 84962109549