CPL - Chalmers Publication Library
| Utbildning | Forskning | Styrkeområden | Om Chalmers | In English In English Ej inloggad.

Generalising Tree Traversals to DAGs - Exploiting Sharing Without the Pain

Patrick Bahr ; Emil Axelsson (Institutionen för data- och informationsteknik, Programvaruteknik (Chalmers))
Proceedings of the 2015 Workshop on Partial Evaluation and Program Manipulation p. 27-38. (2015)
[Konferensbidrag, refereegranskat]

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.

Nyckelord: attribute grammars, graph traversal, haskell, sharing



Den här publikationen ingår i följande styrkeområden:

Läs mer om Chalmers styrkeområden  

Denna post skapades 2015-01-12. Senast ändrad 2016-06-16.
CPL Pubid: 210493

 

Läs direkt!


Länk till annan sajt (kan kräva inloggning)