Skip to main content

Continuation-Based Partial Evaluation without Continuations

  • Conference paper
  • First Online:
Book cover Static Analysis (SAS 2003)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 2694))

Included in the following conference series:

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 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.

    Google Scholar 

  2. 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.

    Article  MATH  Google Scholar 

  3. 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.

    Google Scholar 

  4. 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.

    Google Scholar 

  5. 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.

    Google Scholar 

  6. Olivier Danvy and Andrzej Filinski. Representing control: A study of the CPS transformation. Mathematical Structures in Computer Science, 2:361–391, 1992.

    Article  MATH  MathSciNet  Google Scholar 

  7. 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.

    Google Scholar 

  8. 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.

    Article  Google Scholar 

  9. 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.

    Google Scholar 

  10. 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.

    Google Scholar 

  11. 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.

    Google Scholar 

  12. 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.

    Chapter  Google Scholar 

  13. Haskell 98, a non-strict, purely functional language. http://www.haskell.org/definition, December 1998.

    Google Scholar 

  14. John Hatcliff and Olivier Danvy. A computational formalization for partial evaluation. Mathematical Structures in Computer Science, 7(5):507–542, 1997.

    Article  MATH  MathSciNet  Google Scholar 

  15. 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.

    Google Scholar 

  16. Neil Jones, Carsten Gomard, and Peter Sestoft. Partial Evaluation and Automatic Program Generation. Prentice-Hall, 1993.

    Google Scholar 

  17. 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.

    Google Scholar 

  18. 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.

    Chapter  Google Scholar 

  19. 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.

    Google Scholar 

  20. John Mitchell. Foundations for Programming Languages. MIT Press, 1996.

    Google Scholar 

  21. 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.

    Google Scholar 

  22. Eugenio Moggi. Notions of computations and monads. Information and Computation, 93:55–92, 1991.

    Article  MATH  MathSciNet  Google Scholar 

  23. Flemming Nielson, Hanne Riis Nielson, and Chris Hankin. Principles of Program Analysis. Springer Verlag, 1999.

    Google Scholar 

  24. 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.

    Article  MATH  Google Scholar 

  25. Walid Taha and Tim Sheard. MetaML and multi-stage programming with explicit annotations. Theoretical Computer Science, 2000.

    Google Scholar 

  26. 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.

    Chapter  Google Scholar 

  27. Peter Thiemann. Combinators for program generation. Journal of Functional Programming, 9(5):483–525, September 1999.

    Article  MATH  MathSciNet  Google Scholar 

  28. Philip Wadler and Peter Thiemann. The marriage of monads and effects. ACM Transactions on Computational Logic, 4(1):1–32, January 2003.

    Article  MathSciNet  Google Scholar 

  29. 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.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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

Publish with us

Policies and ethics