## Strictification of Computations on Trees (1997)

Citations: | 2 - 0 self |

### BibTeX

@MISC{Saraiva97strictificationof,

author = {João Saraiva and Doaitse Swierstra and Matthijs Kuiper},

title = {Strictification of Computations on Trees},

year = {1997}

}

### OpenURL

### Abstract

An attribute grammars describes a computation over a recursive data structure (syntax tree). The corresponding evaluator can be directly encoded as a set of lazy evaluated functions. In this paper we show how this set may be converted into a larger set of strict functions and a collection of new data types. We call this process, which is based on a global data flow analysis, strictification. The resulting set of small functions and the new data types are amenable to further analysis and optimization. Especially the elimination transformation leads to very efficient programs, both in time and space, and which are much more suited for incremental (i.e. memoized) and parallel evaluation.

### Citations

81 | Incremental context-dependent analysis for language-based editors
- Reps, Teitelbaum, et al.
- 1983
(Show Context)
Citation Context ...was developed in the context of incremental attribute evaluation of Higher Order Attribute Grammars. Traditional techniques for incremental attribute evaluations which are based on change propagation =-=[RTD83]-=- do not handle higher order attribute grammars e ciently [CP96]. An e cient and elegant incremental attribute evaluator can be implemented through visit function memoization [CP96]. After all the tran... |

79 |
Using circular programs to eliminate multiple traversals of data
- Bird
- 1984
(Show Context)
Citation Context ...current Lrc-attribute grammar based program synthesizer. 1 The Class of Functions Considered The class of functions we are considering are the so-called circular functional programs, as introduced in =-=[Bir84]-=-. Although such programs have proved to be surprisingly hard to explain to the average functional programmer, they actually become a lot simpler to understand and design if one considers them as the r... |

78 |
Ordered Attribute Grammars
- Kastens
- 1980
(Show Context)
Citation Context ...n machinery. 2.1 Computing Visit Sequences In this section, we showhow to derive visit sequences from the circular programs. We use Kastens' ordered scheduling algorithm to derive the visit sequences =-=[Kas80]-=-. Our presentation in this paper is necessarily short. Full de nitions can be found in [Kas80] and [Pen94] (page 122). We start by brie y describing visit sequences since they are the result of this s... |

74 | Attribute grammars as a functional programming paradigm - Johnsson - 1987 |

70 |
Incremental computation via function caching
- Pugh, Teitelbaum
- 1989
(Show Context)
Citation Context ...mputation of circular programs and the implementation of higher order attribute grammars. 5.1 Incremental Computation Function memoization is a e cient technique to implement incremental computations =-=[PT89]-=-. Circular programs relying on lazy evaluation cannot use standard memoization techniques to achieve such incremental behaviour, since comparing unevaluated arguments is not likely to work in our situ... |

68 | Attribute grammar paradigms - a high-level methodology in language implementation - Paakki - 1995 |

14 | Introduction to attribute grammars - Alblas - 1991 |

10 |
Using Cached Functions and Constructors for Incremental Attribute Evaluation
- Pennings, Swierstra, et al.
- 1992
(Show Context)
Citation Context ... these visit sequences into visit functions. To combine the e ects of the individual traversals we introduce visit trees. These visist trees are a small adaption of our previously introduced bindings =-=[PSV92]-=-. Visit trees are needed to pass values that are computed in one traversal and that are used in a subsequent one 1 . We call such dependencies between traversals inter-traversal dependencies. In the c... |

10 |
An improved replacement strategy for function caching
- Pugh
- 1988
(Show Context)
Citation Context ...imative of the computations needed to be performed on a traversal than using a total tree. This more accurate information can be used dynamically to decide if a function call is to be memoized or not =-=[Pug88]-=-. 5.2 Parallel Computation Implicit parallelism exhibit by multiple traversal algorithms may be hidden by the circular de nitions. In a circular program it may be impossible to discover 12 8k 6k 4k 2k... |

8 |
A survey of parallel attribute evaluation methods
- Jourdan
- 1991
(Show Context)
Citation Context ...clo ( error_aux) = error errors2 ( errors3) = eval2Items Items 3 env ( errors) = error_aux errors3 The static detection of independent visit functions per se can lead to a too ne grain of parallelism =-=[Jou91]-=-. The size of a visit tree can be used dynamically to decide whether two independent function calls may be computed in parallel or not. 5.3 Implementation of Attribute Grammars Our work was developed ... |

7 |
Generating Incremental Evaluators
- Pennings
- 1994
(Show Context)
Citation Context ...circular programs. We use Kastens' ordered scheduling algorithm to derive the visit sequences [Kas80]. Our presentation in this paper is necessarily short. Full de nitions can be found in [Kas80] and =-=[Pen94]-=- (page 122). We start by brie y describing visit sequences since they are the result of this step. A visit sequence describes the operations which must be performed by a tree walk automata when visiti... |

6 | On the Optimality of Change Propagation for Incremental Evaluation of Hierarchical Attribute Grammars - Carle, Pollock - 1996 |

6 | and Doaitse Swierstra. Using attribute grammars to derive efficient functional programs - Kuiper - 1987 |

5 |
E cient incremental evaluation of higher order attribute grammars
- Vogt, Swierstra, et al.
- 1991
(Show Context)
Citation Context ..., and to make the remaining run-time data structures as lean as possible. The work described here originates from our work on constructing an incremental evaluator for higher-order attribute grammars =-=[VSK91]-=-; the traditional approaches for evaluating attribute grammars i.e. the decoration of an abstract syntax tree by means of a generated tree-walking automaton proved to be no longer applicable due to th... |

4 | and Oege de Moor. Algebra of Programming, volume 100 - Bird - 1997 |

2 | Using attribute grammars to derive e cient functional programs - Kuiper, Swierstra - 1987 |

1 |
and Oegerikus de Moor. Algebra ofprogramming, volume 100
- Bird
- 1996
(Show Context)
Citation Context ... catamorphisms got their name (i.e. the formal derivation of functional programs) usually restricts itself to recursive functions which take only one parameter of one speci c data type as an argument =-=[BdM96]-=-. In attribute grammar terms one would say that one is dealing with a grammar which has only a single non-terminal. Attribute grammars are usually thought to be implemented by using socalled tree-walk... |

1 |
On the optimality ofchange propagation for incremental evaluation of hierarchical attribute grammars
- Carle, Pollock
- 1996
(Show Context)
Citation Context ... of Higher Order Attribute Grammars. Traditional techniques for incremental attribute evaluations which are based on change propagation [RTD83] do not handle higher order attribute grammars e ciently =-=[CP96]-=-. An e cient and elegant incremental attribute evaluator can be implemented through visit function memoization [CP96]. After all the transformations have been performed the resulting programs show a s... |

1 |
Runciman and Niklas Röjemo. Heap pro ling for space e ciency
- Colin
- 1996
(Show Context)
Citation Context ...s required, i.e. until the end of the evaluation. Figure 3 shows a pro le of the use of heap memory of the lazy program processing a Block source text. The pro le was produced by the nhc heap pro ler =-=[RR96]-=-. block_circ_flags +RTS -p -RTS 152353 bytes x seconds byte 40k 35k 30k 25k 20k 15k 10k 5k 0k 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 second 69% Main.lrc_cons_env 11% Main.consAST:167:21 7% Main.visit_Ite... |

1 | Runciman and Niklas R#jemo. Heap proling for space eOEciency - Colin - 1996 |