## Continuation Semantics and Self-adjointness (1997)

Venue: | In Proceedings MFPS XIII, Electronic Notes in Theoretical Computer Science |

Citations: | 7 - 2 self |

### BibTeX

@INPROCEEDINGS{Thielecke97continuationsemantics,

author = {Hayo Thielecke},

title = {Continuation Semantics and Self-adjointness},

booktitle = {In Proceedings MFPS XIII, Electronic Notes in Theoretical Computer Science},

year = {1997},

publisher = {Elsevier}

}

### OpenURL

### Abstract

We give an abstract categorical presentation of continuation semantics by taking the continuation type constructor : (or cont in Standard ML of New Jersey) as primitive. This constructor on types extends to a contravariant functor on terms which is adjoint to itself on the left; restricted to the subcategory of those programs that do not manipulate the current continuation, it is adjoint to itself on the right. The motivating example of such a category is built from (equivalence classes of typing judgements for) continuation passing style (CPS) terms. A call-by-value -calculus with the control operator callcc as well as a call-byname -calculus can be interpreted. Arrow types are broken down into continuation types for argument/result-continuations pairs. Specialising the semantics to the CPS term model allows a reconstruction of CPS transforms. 1 Introduction The task of finding a semantic infrastructure for continuation semantics is somewhat analogous to that of interpreting -calcul...

### Citations

634 |
Compiling with continuations
- Appel
- 1992
(Show Context)
Citation Context ... (first f , then g). 3 Thielecke 2 Continuation-passing style We consider the target language of CPS transforms as a calculus in its own right (similar to the intermediate language of the compiler in =-=[1]). This is-=- a (name-passing) calculus in which the only form of application is a "jump with arguments" [1] (for history see also [10],[11]). 2.1 CPS calculus The BNF of CPS terms is as follows. M ::= x... |

250 | Typing and subtyping for mobile processes
- Pierce, Sangiorgi
- 1993
(Show Context)
Citation Context ...t can be translated to the -calculus quite easily. A jump kh~xi corresponds to a -calculus output particle. The continuation binding construct is translated into Sangiorgi's "local environment id=-=iom" [6]-=-. khx 1 : : : x i i ffl = khx 1 : : : x i i Mfnhx 1 : : : x i i(Ng ffl = (n)(M ffl j !n(x 1 : : : x i ):N ffl ) 2.3 CPS transforms The typing for first-class continuations in Standard ML of New Jersey... |

220 | Call-by-name, call-by-value, and the *-calculus - Plotkin - 1975 |

129 |
Rabbit: A compiler for Scheme
- Steele
- 1978
(Show Context)
Citation Context ...s own right (similar to the intermediate language of the compiler in [1]). This is a (name-passing) calculus in which the only form of application is a "jump with arguments" [1] (for history=-= see also [10]-=-,[11]). 2.1 CPS calculus The BNF of CPS terms is as follows. M ::= xh~xi j Mfxh~xi(Mg Here kh~xi is a jump to the continuation k with actual parameters ~x, while Mfnh~xi=Ng binds the continuation with... |

102 | Premonoidal categories and notions of computation
- Power, Robinson
- 1997
(Show Context)
Citation Context ...tle notion than would at first appear. In particular, it is not enough to exclude straightforward jumps like throw k 42. In our framework, environments are modelled by means of a premonoidal category =-=[9]-=-: this is a categorical framework which provides enough parallelism on types to accommodate programs of multiple arity, but no real parallelism c fl1997 Published by Elsevier Science B. V. Thielecke o... |

95 | Typing First Class Continuations in ML
- Duba, Harper, et al.
- 1993
(Show Context)
Citation Context ... khx 1 : : : x i i ffl = khx 1 : : : x i i Mfnhx 1 : : : x i i(Ng ffl = (n)(M ffl j !n(x 1 : : : x i ):N ffl ) 2.3 CPS transforms The typing for first-class continuations in Standard ML of New Jersey =-=[2]-=- is given by that of simply-typed -calculus and the two rules for the continuation primitives callcc and throw. \Gamma ` M : : !s\Gamma ` callcc M :s\Gamma ` M : : \Gamma ` N :s\Gamma ` throw M N : oe... |

50 | Controlling Effects
- Filinski
- 1996
(Show Context)
Citation Context ...y the full j law. (Unfortunately, "lazy" is sometimes used to mean call-by-need.) A genuinely call-by-name CPS transform not suffering from laziness can be given by uncurrying all function t=-=ypes. (In [4]-=- a related transform is given. But as the target language is a -calculus, it is, apart from the thunking of base types, the identity. ) Definition 2.4 The (uncurrying) call-by-name CPS transform is de... |

40 |
Declarative continuations: an investigation of duality in programming language semantics (lecture notes in computer science 389
- Filinski
- 1989
(Show Context)
Citation Context ... effect-free program phrases in the presence of first-class continuations. 5.1 Copying and discarding Those morphisms that are discardable in the sense of f ; ! B = ! A : A \Gamma! 1 (called total in =-=[3]-=-) are not sufficiently effect-free to be copyable. Consider the following morphism in K(CPS). twicecc def = [~xhk ` kh~xliflh~yi(kh~yhig] : A\Omega :A \Gamma! A\Omega :A Informally, in terms of contin... |

39 |
Lambda: The Ultimate Imperative
- Sussman
- 1976
(Show Context)
Citation Context ... right (similar to the intermediate language of the compiler in [1]). This is a (name-passing) calculus in which the only form of application is a "jump with arguments" [1] (for history see =-=also [10],[11]-=-). 2.1 CPS calculus The BNF of CPS terms is as follows. M ::= xh~xi j Mfxh~xi(Mg Here kh~xi is a jump to the continuation k with actual parameters ~x, while Mfnh~xi=Ng binds the continuation with body... |

17 |
Premonoidal categories as categories with algebraic structure
- Power
- 2000
(Show Context)
Citation Context ...( )), respectively. apply : A\Omega :(A\Omega :B) \Gamma! B pair : C \Gamma! :(A\Omega :(A\Omega C)) Although a \Omega\Gamma -category is not monoidally closed, it is centrally closed in the sense of =-=[8]-=-. Proposition 3.8 '(( )\Omega A) a :(A\Omega :( )) where ' : Z(K) ,! K is the inclusion of the centre. It has already been mentioned that apply can be seen as a call-by-name application map that does ... |

4 |
Sound and complete axiomatizations of call-by-value control operators
- Hofmann
- 1994
(Show Context)
Citation Context ...\Gamma ` MN : K def = hVJ\Gamma ` N : oeK; VJ\Gamma ` M : oe ! Ki; apply Perhaps the most canonical property of control operators is the naturality of callcc, in the sense of the following axiom from =-=[5]-=-. V (callcc M)= callcc(k:V (M(x:k (V x)))) where V ranges over values, i.e. V ::= x j x:M . However, this relies on continuations being a special case of procedures, as in Scheme. With a typing for co... |