Skip to main content

Call-by-name CPS-translation as a binding-time improvement

  • Contributed Papers
  • Conference paper
  • First Online:
Static Analysis (SAS 1995)

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

Included in the following conference series:

Abstract

Much attention has been given to the call-by-value continuation passing style (CBV CPS) translation as a tool in partial evaluation, but the call-by-name (CBN) CPS translation has not been investigated. We undertake a systematic investigation of the effect of CBN CPS in connection with partial evaluation and deforestation.

First, we give an example where CBN CPS translation acts as a binding time improvement to achieve the effects of deforestation using partial evaluation. The same effect cannot be achieved with CBV CPS. Second, we prove formally that the CBN CPS translation together with partial evaluation has the power to achieve all the effects of deforestation.

The consequence of these results is a practical tool (the CBN CPS) for improving the results of partial evaluation, as well as an improved understanding of the relation between partial evaluation and deforestation.

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

Access this chapter

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. A. Bondorf, O. Danvy. Automatic Autoprojection of Higher-Order Recursive Equations. ESOP '90. LNCS vol. 432 pp. 70–87, 1990

    Google Scholar 

  2. A. Bondorf. Self-Applicable Partial Evaluation. Ph.D. thesis, DIKU-Rapport 90/17, Department of Computer Science, University of Copenhagen, 1990.

    Google Scholar 

  3. A. Bondorf. Improving Binding Times without Explicit CPS-Conversion. In ACM Lisp and Functional Programming Conference. San Francisco, California, June 1992.

    Google Scholar 

  4. A. Bondorf, D. Dussart. Improving CPS-Based Partial Evaluation: Writing Cogen by Hand. In PEPM '94. Orlando, Florida, 1994.

    Google Scholar 

  5. C. Consel, O. Danvy. For a Better Support of Static Data Flow. In FPCA '91. (Ed.) John Hughes, LNCS Vol.523, pp.495–519, 1991.

    Google Scholar 

  6. O. Danvy. Semantics-Directed Compilation of Non-Linear Patterns. In Information Processing Letters. Vol. 37, pp. 315–322, March 1991.

    Google Scholar 

  7. O. Danvy, J. Hatcliff. CPS-Transformation After Strictness Analysis. In ACM Letters on Programming Languages and Systems. Vol.1, No.3, September 1992.

    Google Scholar 

  8. D. Dussart. Proving Program Transformers Correct by Program Transformation. In Workshop on Logic, Domains, and Programming Languages, Darmstadt Germany (May 24–27). 1995.

    Google Scholar 

  9. R. Glück, J. Jørgensen. Generating Transformers for Deforestation and Driving. In Static Analysis Symposium, Namur, Belgium. LNCS vol 864, 1994.

    Google Scholar 

  10. R. Glück, M. H. Sørensen. Partial Deduction and Driving are Equivalent. In PLILP '94, Madrid, Spain. LNCS vol 844, 1994.

    Google Scholar 

  11. G. W. Hamilton. Higher Order Deforestation. Unpublished manuscript. 1994.

    Google Scholar 

  12. J. Hatcliff, O. Danvy. Thunks and the λ-calculus. DIKU-Rapport 95/3, Department of Computer Science, University of Copenhagen, 1995.

    Google Scholar 

  13. N. D. Jones, C. K. Gomard, P. Sestoft. Partial Evaluation and Automatic Program Generation. Prentice-Hall, 1993.

    Google Scholar 

  14. N. D. Jones. The Essence of Program Transformation by Partial Evaluation and Driving. In N. D. Jones and M. Hagiya and M. Sato (eds.), Logic, Language and Computation. LNCS Vol. 792, 206–224, Springer-Verlag 1994.

    Google Scholar 

  15. J. L. Lawall, O. Danvy. Continuation-Based Partial Evaluation. In ACM SIGPLAN Symposium on LISP and Functional Programming, June 27–29. Orlando, Florida, 1994.

    Google Scholar 

  16. S. Marlow, P. L. Wadler. Deforestation for Higher-Order functions. In Functional Programming, Glasgow 1992. Ed. J. Launchbury, Workshops in Computing, 1992.

    Google Scholar 

  17. G. D. Plotkin. Call-by-Name, Call-by-Value and the λ-Calculus. In Theoretical Computer Science. 1, 1975.

    Google Scholar 

  18. A. Sabry, M. Felleisen. Reasoning about Programs in Continuation-Passing Style. In Lisp and Symbolic Computation. Kluwer Academic Publishers, 1993.

    Google Scholar 

  19. D. Sands. Total Correctness and Improvement in the Transformation of Recursive Functions. In TAPSOFT '95. To appear in LNCS, 1995.

    Google Scholar 

  20. M. H. Sørensen, R. Glück, N. D. Jones. Towards Unifying Deforestation, Supercompilation, Partial Evaluation, and Generalized Partial Computation. In ESOP '94. LNCS vol. 788, 1994.

    Google Scholar 

  21. V. F. Turchin. The Concept of a Supercompiler. In ACM Transactions on Programming Languages and Systems. Vol. 8, No. 3, pp. 292–325, 1986.

    Google Scholar 

  22. P. L. Wadler. Deforestation: Transforming Programs to Eliminate Trees. In Theoretical Computer Science. 73, pp. 231–248, 1990.

    Google Scholar 

  23. D. Weise, R. Conybeare, E. Ruf, S. Seligman. Automatic Online Partial Evaluation. In FPCA '91. (Ed.) John Hughes, LNCS Vol.523, pp.495–519, 1991.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Alan Mycroft

Rights and permissions

Reprints and permissions

Copyright information

© 1995 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Nielsen, K., Sørensen, M.H. (1995). Call-by-name CPS-translation as a binding-time improvement. In: Mycroft, A. (eds) Static Analysis. SAS 1995. Lecture Notes in Computer Science, vol 983. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-60360-3_46

Download citation

  • DOI: https://doi.org/10.1007/3-540-60360-3_46

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-60360-3

  • Online ISBN: 978-3-540-45050-4

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics