Hostname: page-component-89b8bd64d-j4x9h Total loading time: 0 Render date: 2026-05-08T12:48:45.854Z Has data issue: false hasContentIssue false

Efficient analyses for realistic off-line partial evaluation

Published online by Cambridge University Press:  07 November 2008

Anders Bondorf
Affiliation:
DIKU, Department of Computer Science, University of CopenhagenUniversitetsparken 1, DK-2100 Copenhagen ø, Denmark (e-mail: anders@diku.dk)
Jesper Jørgensen
Affiliation:
DIKU, Department of Computer Science, University of CopenhagenUniversitetsparken 1, DK-2100 Copenhagen ø, Denmark (e-mail: knud@diku.dk)
Rights & Permissions [Opens in a new window]

Abstract

Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the 'Save PDF' action button.

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.

Information

Type
Articles
Copyright
Copyright © Cambridge University Press 1993
Submit a response

Discussions

No Discussions have been published for this article.