Abstract
Continuation-based partial evaluation is an implementation technique for program specializers that allows generated code contexts to commute with specialization-time values. Thus it enables additional specialization-time computations. Its most general implementation known to date is based on the manipulation of continuations. We show that a substitution monad provides an alternative implementation of the context manipulation performed by continuation-based partial evaluation. We prove its equivalence to the original continuation-based implementation. A type-based binding-time analysis that is augmented with effects provides static information about the generated code contexts. We prove the soundness of the resulting type and effect system with respect to our implementation and point out how a binding-time analysis extended with this effect information may avoid code duplication and enable the generation of more efficient generating extensions.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Anders Bondorf. Improving binding times without explicit CPS-conversion. In Proc. 1992 ACM Conference on Lisp and Functional Programming, pages 1–10, San Francisco, California, USA, June 1992.
Anders Bondorf and Olivier Danvy. Automatic autoprojection of recursive equations with global variables and abstract data types. Science of Computer Programming, 16(2):151–195, 1991.
Charles Consel and Olivier Danvy. For a better support of static data flow. In John Hughes, editor, Proc. Functional Programming Languages and Computer Architecture 1991, number 523 in Lecture Notes in Computer Science, pages 496–519, Cambridge, MA, 1991. Springer-Verlag.
Charles Consel and Olivier Danvy. Tutorial notes on partial evaluation. In Proceedings of the 1993 ACM SIGPLAN Symposium on Principles of Programming Languages, pages 493–501, Charleston, South Carolina, January 1993. ACM Press.
Olivier Danvy. Type-directed partial evaluation. In Proceedings of the 1996 ACM SIGPLAN Symposium on Principles of Programming Languages, pages 242–257, St. Petersburg, Fla., January 1996. ACM Press.
Olivier Danvy and Andrzej Filinski. Representing control: A study of the CPS transformation. Mathematical Structures in Computer Science, 2:361–391, 1992.
Olivier Danvy, Robert Glück, and Peter Thiemann, editors. Dagstuhl Seminar on Partial Evaluation 1996, number 1110 in Lecture Notes in Computer Science, Schloß Dagstuhl, Germany, February 1996. Springer-Verlag.
Olivier Danvy, Karoline Malmkjær, and Jens Palsberg. Eta-expansion does The Trick. ACM Transactions on Programming Languages and Systems, 18(6):730–751, November 1996.
Dirk Dussart, Eddy Bevers, and Karel De Vlaminck. Polyvariant constructor specialization. In William Scherlis, editor, Proc. ACM SIGPLAN Symposium on Partial Evaluation and Semantics-Based Program Manipulation PEPM’ 95, pages 54–63, La Jolla, CA, June 1995. ACM Press.
Dirk Dussart, Fritz Henglein, and Christian Mossin. Polymorphic recursion and subtype qualifications: Polymorphic binding-time analysis in polynomial time. In Alan Mycroft, editor, Proceedings of the 1995 International Static Analysis Symposium, number 983 in Lecture Notes in Computer Science, pages 118–136, Glasgow, Scotland, September 1995. Springer-Verlag.
Andrzej Filinski. Representing layered monads. In Alexander Aiken, editor, Proceedings of the 1999 ACM SIGPLAN Symposium on Principles of Programming Languages, pages 175–188, San Antonio, Texas, USA, January 1999. ACM Press.
Andrzej Filinski. Normalization by evaluation for the computational lambda-calculus. In Samson Abramsky, editor, Proc. of 5th Int. Conf. on Typed Lambda Calculi and Applications, TLCA’01, number 2044 in Lecture Notes in Computer Science, pages 151–165, Krakow, Poland, 2001. Springer-Verlag.
Haskell 98, a non-strict, purely functional language. http://www.haskell.org/definition, December 1998.
John Hatcliff and Olivier Danvy. A computational formalization for partial evaluation. Mathematical Structures in Computer Science, 7(5):507–542, 1997.
John Hughes. Type specialisation for the λ-calculus; or, a new paradigm for partial evaluation based on type inference. In Robert Glück, and Peter Thiemann, editors. Dagstuhl Seminar on Partial Evaluation 1996, number 1110 in Lecture Notes in Computer Science, Schloß Dagstuhl, Germany, February 1996. Springer-Verlag Danvy et al. [7], pages 183–215.
Neil Jones, Carsten Gomard, and Peter Sestoft. Partial Evaluation and Automatic Program Generation. Prentice-Hall, 1993.
Julia Lawall and Olivier Danvy. Continuation-based partial evaluation. In Proceedings of the 1994 ACM Conference on Lisp and Functional Programming, pages 227–238, Orlando, Florida, USA, June 1994. ACM Press.
Julia Lawall and Peter Thiemann. Sound specialization in the presence of computational effects. In Proceedings of the Theoretical Aspects of Computer Software, number 1281 in Lecture Notes in Computer Science, pages 165–190, Sendai, Japan, September 1997. Springer-Verlag.
John M. Lucassen and David K. Gifford. Polymorphic effect systems. In Proc. 15th Annual ACM Symposium on Principles of Programming Languages, pages 47–57, San Diego, California, January 1988. ACM Press.
John Mitchell. Foundations for Programming Languages. MIT Press, 1996.
Torben Æ. Mogensen. Evolution of partial evaluators: Removing inherited limits. In Robert Glück, and Peter Thiemann, editors. Dagstuhl Seminar on Partial Evaluation 1996, number 1110 in Lecture Notes in Computer Science, Schloß Dagstuhl, Germany, February 1996. Springer-Verlag Danvy et al. [7], pages 303–321.
Eugenio Moggi. Notions of computations and monads. Information and Computation, 93:55–92, 1991.
Flemming Nielson, Hanne Riis Nielson, and Chris Hankin. Principles of Program Analysis. Springer Verlag, 1999.
Eijiro Sumii and Naoki Kobayashi. A hybrid approach to online and offline partial evaluation. Higher-Order and Symbolic Computation, 14(2/3):101–142, 2001.
Walid Taha and Tim Sheard. MetaML and multi-stage programming with explicit annotations. Theoretical Computer Science, 2000.
Peter Thiemann. A unified framework for binding-time analysis. In Michel Bidoit and Max Dauchet, editors, TAPSOFT’ 97: Theory and Practice of Software Development, number 1214 in Lecture Notes in Computer Science, pages 742–756, Lille, France, April 1997. Springer-Verlag.
Peter Thiemann. Combinators for program generation. Journal of Functional Programming, 9(5):483–525, September 1999.
Philip Wadler and Peter Thiemann. The marriage of monads and effects. ACM Transactions on Computational Logic, 4(1):1–32, January 2003.
Philip L. Wadler. Comprehending monads. In Proceedings of the 1990 ACM Conference on Lisp and Functional Programming, pages 61–78, Nice, France, 1990. ACM Press.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2003 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Thiemann, P. (2003). Continuation-Based Partial Evaluation without Continuations. In: Cousot, R. (eds) Static Analysis. SAS 2003. Lecture Notes in Computer Science, vol 2694. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-44898-5_21
Download citation
DOI: https://doi.org/10.1007/3-540-44898-5_21
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-40325-8
Online ISBN: 978-3-540-44898-3
eBook Packages: Springer Book Archive