
A Selective CPS Transformation
Author(s) -
Lasse R. Nielsen
Publication year - 2001
Publication title -
brics report series
Language(s) - English
Resource type - Journals
eISSN - 1601-5355
pISSN - 0909-0878
DOI - 10.7146/brics.v8i30.21690
Subject(s) - continuation , transformation (genetics) , computer science , focus (optics) , semantics (computer science) , control (management) , programming language , program transformation , algebra over a field , theoretical computer science , mathematics , pure mathematics , artificial intelligence , biochemistry , chemistry , physics , optics , gene
The CPS transformation makes all functions continuation-passing, uniformly. Not all functions, however, need continuations: they only do if their evaluation includes computational effects. In this paper we focus on control operations, in particular ``call with current continuation'' and ``throw''. We characterize this involvement as a control effect and we present a selective CPS transformation that makes functions and expressions continuation-passing if they have a control effect, and that leaves the rest of the program in direct style. We formalize this selective CPS transformation with an operational semantics and a simulation theorem à la Plotkin.