Efficient analyses for realistic off-line partial evaluation
- 1 July 1993
- journal article
- research article
- Published by Cambridge University Press (CUP) in Journal of Functional Programming
- Vol. 3 (3) , 315-346
- https://doi.org/10.1017/s0956796800000769
Abstract
Based on Henglein's efficient binding-time analysis for the lambda calculus (with constants and ‘fix’) (Henglein, 1991), we develop three efficient analyses for use in the preprocessing phase of Similix, a self-applicable partial evaluator for a higher-order subset of Scheme. The analyses developed in this paper are almost-linear in the size of the analysed program. (1) A flow analysis determines possible value flow between lambda-abstractions and function applications and between constructor applications and selector/predicate applications. The flow analysis is not particularly biased towards partial evaluation; the analysis corresponds to the closure analysis of Bondorf (1991b). (2) A (monovariant) binding-time analysis distinguishes static from dynamic values; the analysis treats both higher-order functions and partially static data structures. (3) A new is-used analysis, not present in Bondorf (1991b), finds a non-minimal binding-time annotation which is ‘safe’ in a certain way: a first-order value may only become static if its result is ‘needed’ during specialization; this ‘poor man's generalization’ (Holst, 1988) increases termination of specialization. The three analyses are performed sequentially in the above mentioned order since each depends on results from the previous analyses. The input to all three analyses are constraint sets generated from the program being analysed. The constraints are solved efficiently by a normalizing union/find-based algorithm in almost-linear time. Whenever possible, the constraint sets are partitioned into subsets which are solved in a specific order; this simplifies constraint normalization. The framework elegantly allows expressing both forwards and backwards components of analyses. In particular, the new is-used analysis is of backwards nature. The three constraint normalization algorithms are proved correct (soundness, completeness, termination, existence of a best solution). The analyses have been implemented and integrated in the Similix system. The new analyses are indeed much more efficient than those of Bondorf (1991b); the almost-linear complexity of the new analyses is confirmed by the implementation.Keywords
This publication has 14 references indexed in Scilit:
- Specifying the correctness of binding-time analysisJournal of Functional Programming, 1993
- Correctness of binding-time analysisJournal of Functional Programming, 1993
- Efficient analyses for realistic off-line partial evaluationJournal of Functional Programming, 1993
- Improving binding times without explicit CPS-conversionACM SIGPLAN Lisp Pointers, 1992
- Automatic autoprojection of higher order recursive equationsScience of Computer Programming, 1991
- Automatic autoprojection of recursive equations with global variables and abstract data typesScience of Computer Programming, 1991
- Efficient type inference for higher-order binding-time analysisPublished by Springer Nature ,1991
- A partial evaluator for the untyped lambda-calculusJournal of Functional Programming, 1991
- Mix: A self-applicable partial evaluator for experiments in compiler generationHigher-Order and Symbolic Computation, 1989
- An experiment in partial evaluation: The generation of a compiler generatorLecture Notes in Computer Science, 1985