Generalising tree traversals to DAGs: exploiting sharing without the pain

Patrick Bahr, Emil Axelsson

1 Citationer (Scopus)

Abstract

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 and then apply it to compact graph representations of trees instead. The resulting graph traversals avoid 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.

OriginalsprogEngelsk
TitelProceedings of the 2015 Workshop on Partial Evaluation and Program Manipulation
Antal sider12
ForlagAssociation for Computing Machinery
Publikationsdato13 jan. 2015
Sider27-38
ISBN (Trykt)978-1-4503-3297-2
DOI
StatusUdgivet - 13 jan. 2015
BegivenhedWorkshop on Partial Evaluation and Program Manipulation - Mumbai, Indien
Varighed: 12 jan. 201518 jan. 2015

Konference

KonferenceWorkshop on Partial Evaluation and Program Manipulation
Land/OmrådeIndien
ByMumbai
Periode12/01/201518/01/2015

Emneord

  • attribute grammars, graph traversal, haskell, sharing

Fingeraftryk

Dyk ned i forskningsemnerne om 'Generalising tree traversals to DAGs: exploiting sharing without the pain'. Sammen danner de et unikt fingeraftryk.

Citationsformater