Hostname: page-component-8448b6f56d-c4f8m Total loading time: 0 Render date: 2024-04-19T23:55:50.377Z Has data issue: false hasContentIssue false

On-line and off-line partial evaluation: semantic specifications and correctness proofs

Published online by Cambridge University Press:  07 November 2008

Charles Consel
Affiliation:
Department of Computer Science, Yale UniversityNew Haven, CT 06520, USA‡
Siau Cheng Khoo
Affiliation:
Department of Computer Science, Yale UniversityNew Haven, CT 06520, USA‡
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.

This paper presents semantic specifications and correctness proofs for both on-line and offline partial evaluation of strict first-order functional programs. To do so, our strategy consists of defining a core semantics as a basis for the specification of three non-standard evaluations: instrumented evaluation, on-line and off-line partial evaluation. We then use the technique of logical relations to prove the correctness of both on-line and off-line partial evaluation semantics.

The contributions of this work are as follows:

1. We provide a uniform framework to defining and proving correct both on-line and off-line partial evaluation.

2. This work required a formal specification of on-line partial evaluation with polyvariant specialization. We define criteria for its correctness with respect to an instrumented standard semantics. As a by-product, on-line partial evaluation appears to be based on a fixpoint iteration process, just like binding-time analysis.

3. We show that binding-time analysis, the preprocessing phase of off-line partial evaluation, is an abstraction of on-line partial evaluation. Therefore, its correctness can be proved with respect to on-line partial evaluation, instead of with respect to the standard semantics, as is customarily done.

4. Based on the binding-time analysis, we formally derive the specialization semantics for off-line partial evaluation. This strategy ensures the correctness of the resulting semantics.

Type
Articles
Copyright
Copyright © Cambridge University Press 1995

References

Abramsky, A. (1990) Abstract interpretation, logical relations and Kan extensions. Logic and Computation, 1(1):540.CrossRefGoogle Scholar
Bondorf, A. (1991) Automatic autoprojection of higher-order recursive equations. Science of Computer Programming, 17:334.CrossRefGoogle Scholar
Bondorf, A., Jones, N. D., Mogensen, T. and Sestoft, P. (1988) Binding Time Analysis and the Taming of Self-Application. DIKU Report, University of Copenhagen, Denmark.Google Scholar
Colby, C. and Lee, P. (1991) An implementation of parameterized partial evaluation. In: Workshop on Static Analysis, pp. 8289, Bigre Journal.Google Scholar
Consel, C. (1988) New insights into partial evaluation: the Schism experiment. In: Ganzinger, H. (ed.), ESOP'88: 2nd European Symposium on Programming, pp. 236246. Springer-Verlag.CrossRefGoogle Scholar
Consel, C. (1993a) Polyvariant binding-time analysis for higher-order, applicative languages. In: ACM Symposium on Partial Evaluation and Semantics-Based Program Manipulation, pap. 145–154.CrossRefGoogle Scholar
Consel, C. (1993b) A tour of Schism: a partial evaluation system for higher-order applicative languages. In: ACM Symposium on Partial Evaluation and Semantics-Based Program Manipulation, pp. 6677.CrossRefGoogle Scholar
Consel, C. and Danvy, D. (1990) From interpreting to compiling binding times. In: Jones, N. D. (ed.), ESOP'90: 3rd European Symposium on Programming, pp. 88105. Springer-Verlag.CrossRefGoogle Scholar
Consel, C. and Danvy, D. (1993) Tutorial notes on partial evaluation. In: ACM Symposium on Principles of Programming Languages, pp. 493501.CrossRefGoogle Scholar
Consel, C. and Khoo, S. C. (1991) Parameterized partial evaluation. In: ACM SIGPLAN Conference on Programming Language Design and Implementation, pp. 92106.CrossRefGoogle Scholar
Consel, C. and Khoo, S. C. (1993) Parameterized partial evaluation. ACM Transactions on Programming Languages and Systems, 15(3):463493. (Extended version of Consel and Khoo (1991).)CrossRefGoogle Scholar
Futamura, Y. (1971) Partial evaluation of computation process – an approach to a compiler-compiler. Systems, Computers, Controls, 2(5):4550.Google Scholar
Ganzinger, H. and Jones, N. D. (eds.) (1985) Programs as Data Objects. Lecture Notes in Computer Science 217. Springer-Verlag.Google Scholar
Gomard, C. K. (1992) A self-applicable partial evaluator for the lambda-calculus: correctness and pragmatics. ACM Transactions on Programming Languages and Systems, 14(2):147172.CrossRefGoogle Scholar
Hannan, J. and Miller, D. (1989) Deriving Mixed Evaluation From Standard Evaluation For a Simple Functional Language. Technical Report MS-CIS-89-28, University of Pennsylvania, Philadelphia, PA.CrossRefGoogle Scholar
Holst, C. K. (1989) Program Specialization for Compiler Generation. Master's thesis, University of Copenhagen, DIKU, Denmark.Google Scholar
Hudak, P. and Young, J. (1988) A collecting interpretation of expressions (without Powerdomains). In: ACM Symposium on Principles of Programming Languages, pp. 107118.CrossRefGoogle Scholar
Jones, N. D. (1988a) Automatic program specialization: a re-examination from basic principles. In: Bjørner, D., Ershov, A. P. and Jones, N. D. (eds.), Partial Evaluation and Mixed Computation, pp. 225282. North-Holland.Google Scholar
Jones, N. D. (1988b) Binding Time Analysis and Static Semantics (extended abstract). DIKU Report, University of Copenhagen, Denmark.Google Scholar
Jones, N. D. (1990) Partial evaluation, self-application and types. In: Paterson, M.S. (ed.), 17th International Colloquium on Automata, Languages and Programming, pp. 639659. Springer-Verlag.CrossRefGoogle Scholar
Jones, N. D. (1991) A minimal function graph semantics as a basis for abstract interpretation of higher order programs. Presented at the 1991 Workshop on Static Analysis of Equational, Functional and Logic Programs.Google Scholar
Jones, N. D. and Muchnick, S. S. (1976) Some thoughts towards the design of an ideal language. In: ACM Conference on Principles of Programming Languages, pp. 7794.Google Scholar
Jones, N. D. and Mycroft, A. (1986) Data flow analysis of applicative programs using minimal function graphs. In: ACM Symposium on Principles of Programming Languages.CrossRefGoogle Scholar
Jones, N. D. and Nielson, F. (1990) Abstract Interpretation: a Semantics-Based Tool for Program Analysis. Technical Report, University of Copenhagen and Aarhus University, Denmark.Google Scholar
Jones, N. D., Sestoft, P. and Søndergaard, H. (1989) Mix: a self-applicable partial evaluator for experiments in compiler generation. LISP and Symbolic Computation, 2(1):950.CrossRefGoogle Scholar
Kleene, S. C.. Introduction to Metamathematics. Van Nostrand, 1952.Google Scholar
Khoo, S. C. (1992) Parameterized Partial Evaluation: Theory and Practice. PhD thesis, Yale University. (Research Report 926.)Google Scholar
Launchbury, J. (1990) Projection Factorisation in Partial Evaluation. PhD thesis, Department of Computing Science, University of Glasgow, Scotland.Google Scholar
Mogensen, T. (1992) Self-applicable partial evaluation for pure Lambda Calculus. In: Consel, C. (ed.), ACM Workshop on Partial Evaluation and Semantics-Based Program Manipulation, pp 116121. Yale University. (Research Report 909.)Google Scholar
Mizuno, M. and Schmidt, D. (1990) A Security Flow Control Algorithm and Its Denotational Semantics Correctness Proof. Technical Report CS-90-21, Kansas State University, Manhattan, KS.Google Scholar
Nielson, F. (1989) Two-level semantics and abstract interpretation. Theoretical Computer Science, 69:117242, 1989.CrossRefGoogle Scholar
Nielson, H. R. and Nielson, F. (1988a) Automatic binding time analysis for a typed λ-calculus. Science of Computer Programming, 10:139176.CrossRefGoogle Scholar
Nielson, H. R. and Nielson, F. (1988b) Automatic binding time analysis for a typed λ-calculus. In: ACM Symposium on Principles of Programming Languages, pp. 98106.CrossRefGoogle Scholar
Nielson, F. and Nielson, H. R. (1992) Two-Level Functional Languages. Cambridge Tracts in Theoretical Computer Science 34. Cambridge University Press.CrossRefGoogle Scholar
Sestoft, P. (1985) The structure of a self-applicable partial evaluator. In: Ganzinger, H. and Jones, N. D. (eds.) Programs as Data Objects. Lecture Notes in Computer Science 217, pp. 236256. Springer-Verlag.Google Scholar
Sestoft, P. (1988) Automatic call unfolding in a partial evaluator. In: Bjørner, D., Ershov, A. P. and Jones, N. D. (eds.), Partial Evaluation and Mixed Computation. North-Holland.Google Scholar
Wand, M. (1993) Specifying the correctness of binding-time analysis. In: ACM Symposium on Principles of Programming Languages, pp. 137143.CrossRefGoogle Scholar
Weise, D. and Ruf, E. (1990) Computing Types During Program Specialization. Technical Report 441, Stanford University, CA.Google Scholar
Submit a response

Discussions

No Discussions have been published for this article.