CPS transformation of beta-redexes

https://doi.org/10.1016/j.ipl.2005.02.002Get rights and content

Abstract

The extra compaction of the most compacting CPS transformation in existence, which is due to Sabry and Felleisen, is generally attributed to (1) making continuations occur first in CPS terms and (2) classifying more redexes as administrative. We show that this extra compaction is actually independent of the relative positions of values and continuations and furthermore that it is solely due to a context-sensitive transformation of beta-redexes. We stage the more compact CPS transformation into a first-order uncurrying phase and a context-insensitive CPS transformation. We also define a context-insensitive CPS transformation that provides the extra compaction. This CPS transformation operates in one pass and is dependently typed.

References (26)

  • R. Bloo et al.

    The Barendregt cube with definitions and generalised reduction

    Inform. and Comput.

    (1996)
  • E. Moggi

    Notions of computation and monads

    Inform. and Comput.

    (1991)
  • G.D. Plotkin

    Call-by-name, call-by-value and the λ-calculus

    Theoret. Comput. Sci.

    (1975)
  • A.W. Appel

    Compiling with Continuations

    (1992)
  • D. Damian et al.

    Syntactic accidents in program analysis: On the impact of the CPS transformation

    J. Funct. Programming

    (2003)
  • O. Danvy

    A new one-pass transformation into monadic normal form

  • O. Danvy et al.

    Representing control, a study of the CPS transformation

    Math. Structures Comput. Sci.

    (1992)
  • O. Danvy et al.

    A higher-order colon translation

  • M.J. Fischer

    Lambda-calculus schemata

    LISP and Symbolic Comput.

    (1993)

    Proc. ACM Conf. on Proving Assertions about Programs

    SIGPLAN Notices

    (1972)
  • C. Flanagan et al.

    The essence of compiling with continuations

    Proc. ACM SIGPLAN'93, Conf. on Programming Languages Design and Implementation, Albuquerque, NM, June 1993

    SIGPLAN Notices

    (1993)
  • D.P. Friedman et al.

    Essentials of Programming Languages

    (1991)
  • J. Hannan et al.

    Higher-order uncurrying

    Higher-Order and Symbolic Comput.

    (2000)
  • J. Hatcliff, The structure of continuation-passing styles, PhD thesis, Department of Computing and Information...
  • Cited by (9)

    View all citing articles on Scopus
    1

    Basic Research in Computer Science (http://www.brics.dk), funded by the Danish National Research Foundation.

    View full text