Inproceedings,

Using Cached Functions and Constructors for Incremental Attribute Evaluation

, , and .
Proceedings of the 4th International Symposium of Programming Language Implementation and Logic Programming, Leuven, BE: PLILP '92, page 130--144. Berlin, DE, Springer-Verlag, (1992)

Abstract

A technique is presented for the efficient incremental evaluation of attribute grammars. Through its generality, the applied approach may be affective too in the evaluation of higher order attribute grammars. The authors' approach is an extension of a simpler algorithm for incremental evaluation, where functions, corresponding to visit sequences, are cached. Consequently, attributes are either found in the cache or they are recomputed, so there is no longer need to represent the attributed tree explicitly. One may share common subtrees, avoiding repeated attribute evaluation, thus solving a typical HAG problem. The authors propose the following change: instead of explicitly representing the tree and calling visit sequence functions to compute the attributes, the tree is represented through a set of visit functions corresponding to the successive visits. These functions are constructed using the visit sequences as building blocks. This technique has two major advantages. Firstly, a visit function characterizes precisely that part of the tree that would actually have been visited in the previous approach, thus increasing the number of cache hits. Secondly, copyrules may be removed during the construction phase. This results in shortcircuiting copychains and in minimizing the number of recomputed functions.

Tags

Users

  • @dparigot

Comments and Reviews