## On the Transformation between Direct and Continuation Semantics (1993)

Venue: | Proceedings of the 9th Conference on Mathematical Foundations of Programming Semantics, number 802 in Lecture Notes in Computer Science |

Citations: | 15 - 11 self |

### BibTeX

@INPROCEEDINGS{Danvy93onthe,

author = {Olivier Danvy and John Hatcliff},

title = {On the Transformation between Direct and Continuation Semantics},

booktitle = {Proceedings of the 9th Conference on Mathematical Foundations of Programming Semantics, number 802 in Lecture Notes in Computer Science},

year = {1993},

pages = {627--648},

publisher = {Springer-Verlag}

}

### Years of Citing Articles

### OpenURL

### Abstract

. Proving the congruence between a direct semantics and a continuation semantics is often surprisingly complicated considering that direct-style -terms can be transformed into continuation style automatically. However, transforming the representation of a direct-style semantics into continuation style usually does not yield the expected representation of a continuation-style semantics (i.e., one written by hand). The goal of our work is to automate the transformation between textual representations of direct semantics and of continuation semantics. Essentially, we identify properties of a direct-style representation (e.g., totality), and we generalize the transformation into continuation style accordingly. As a result, we can produce the expected representation of a continuation semantics, automatically. It is important to understand the transformation between representations of direct and of continuation semantics because it is these representations that get processed in any kind of ...

### Citations

762 | Notions of Computation and Monads
- Moggi
- 1991
(Show Context)
Citation Context ...he following notation. +n and + v respectively denote the relations defined by a call-by-name 8 The annotation scheme can also be phrased more elegantly in terms of Moggi's computational metalanguage =-=[17] --- serious-=- terms are typed as computations, trivial terms are typed as values. This point is developed elsewhere [10, 11]. 12 Identifiers: \Gamma [ fi : ��g `a i : (�� ; serious) \Gamma [ fiv : ��g ... |

491 |
Denotational semantics: The Scott-Strachey approach to programming language theory
- Stoy
- 1977
(Show Context)
Citation Context ...liff@cis.ksu.edu 2 1 Introduction Proving the congruence between a denotational-semantics specification in direct style and a denotational-semantics specification in continuation style is not trivial =-=[26, 28, 31]-=-. Yet, -- both direct-style and continuation-style specifications can be represented as typed -terms: semantic domains are represented with types, and valuation functions with -terms [22, 28]; -- type... |

344 |
Denotational Semantics: A Methodology for Language Development
- Schmidt
- 1986
(Show Context)
Citation Context ...liff@cis.ksu.edu 2 1 Introduction Proving the congruence between a denotational-semantics specification in direct style and a denotational-semantics specification in continuation style is not trivial =-=[26, 28, 31]-=-. Yet, -- both direct-style and continuation-style specifications can be represented as typed -terms: semantic domains are represented with types, and valuation functions with -terms [22, 28]; -- type... |

317 | Control-4ow analysis of higher-order languages
- Shivers
- 1991
(Show Context)
Citation Context ...ever following Reynolds again [25], we can enumerate the -abstractions that may occur in each higher-order application. This enumeration is achieved by control-flow analysis (a.k.a. closure analysis) =-=[29, 30]-=-. and to establish conditions that allow one to transform the text of Figure 4 into the text of Figure 5, automatically. 6 This is probably why Reynolds's definitional interpreters are uncurried [25].... |

308 | Definitional interpreters for higher-order programming languages
- Reynolds
- 1972
(Show Context)
Citation Context ...ents of these functions. Denotational specifications are customarily higher-order, so it is not obvious which expression occurs as the argument of which -abstraction. However following Reynolds again =-=[25]-=-, we can enumerate the -abstractions that may occur in each higher-order application. This enumeration is achieved by control-flow analysis (a.k.a. closure analysis) [29, 30]. and to establish conditi... |

239 | Tutorial notes on partial evaluation
- Consel, Danvy
- 1993
(Show Context)
Citation Context ...lows one to produce the representation of a continuation semantics automatically. Partial evaluators work better on continuation-passing programs, but again not all continuations are always necessary =-=[2, 3]-=-. Our extended transformation into continuation style makes it possible to reduce the occurrences of continuations in a source program. In addition, it also enables partial evaluation of call-by-name ... |

220 |
Call-by-name, call-by-value, and the *-calculus
- Plotkin
- 1975
(Show Context)
Citation Context ...nted with types, and valuation functions with -terms [22, 28]; -- typed -terms can be transformed into continuation style automatically using Plotkin's continuation-passing-style (CPS) transformation =-=[9, 15, 24]-=-. We have transformed the representation of several direct-style specifications into continuation style. Since the meta-language of denotational semantics obeys normal order [28], we have used the cal... |

179 |
The denotational semantics of programming languages
- Tennent
- 1976
(Show Context)
Citation Context ...s. We briefly mention how the present work can be adapted to other fashions. Partial functions are often used in place of total functions and lifted domains when modeling non-terminating computations =-=[23, 34]-=-. Our explanation of totality and partiality in terms of trivial and serious functions naturally applies to denotational specifications based on partial functions. Strict functions are often used to m... |

164 | Reasoning about programs in continuation-passing style
- Sabry, Felleisen
- 1993
(Show Context)
Citation Context ...ionality of Com is given as (Store ! Ans) ! Store ! Ans: It is very simple to specify a transformation into continuation style that "puts continuations first", as in Fischer's original trans=-=formation [7, 27]-=-. Such a transformation would naturally yield the functionality above. Finally, our work has relied on denotational definitions being stated using a simply-typed meta-language. This meta-language is s... |

115 | Continuations: A mathematical semantics for handling full jumps
- Strachey, Wadsworth
- 1974
(Show Context)
Citation Context ... the representation of a direct semantics from a continuation semantics where continuations 20 are second-class [31] --- for example, we could not produce a direct semantics for a language with jumps =-=[32]-=-, not without adding some kind of control operator to the -calculus [6]. Syntactic conditions over a continuation-passing -term to ensure that continuations are second-class can be found elsewhere [4]... |

93 |
Abstract Interpretation a d Optimising Transformation f rAp- plicative programs
- Mycroft
- 1981
(Show Context)
Citation Context ...o state that e.g., some applications are actually trivial. 2. The annotations are obtained by an automatic control-flow analysis that extends Mycroft's [ termination analysis to higher-order programs =-=[20, 21]-=-. This tool has applications in other areas such as compiling and partial evaluation. 3. Retaining Reynolds's method of introducing continuations in serious terms yields a transformation that introduc... |

87 | A generic account of continuationpassing styles
- Hatcliff, Danvy
- 1994
(Show Context)
Citation Context ...an also be phrased more elegantly in terms of Moggi's computational metalanguage [17] --- serious terms are typed as computations, trivial terms are typed as values. This point is developed elsewhere =-=[10, 11]. 12 Identifiers-=-: \Gamma [ fi : ��g `a i : (�� ; serious) \Gamma [ fiv : ��g `a i v : (�� ; trivial ) Primitive Operators: \Gamma `a op 0 : (' ; trivial ) \Gamma `a e1 : (' ; ff ) \Gamma `a op 1 e1 : ... |

86 |
A Theory of Programming Language Semantics
- Milne, Strachey
- 1976
(Show Context)
Citation Context ... a partially ordered set (AnnTag; v) where 7 This follows the spirit of the diacritical convention: only the terms whose meaning is farthest to the original meaning (i.e., call-by-name) are annotated =-=[16, 31]-=-. 11 ffl 2 Ann--exp a 2 Ann--abs r 2 ffi-rule ffl ::= i v j i j a j ffl 0 @ tv ffl 1 j ffl 0 @v ffl 1 j ffl 0 @ t ffl 1 j ffl 0 @ ffl 1 j if ffl 1 then ffl 2 else ffl 3 j let i = ffl 0 in ffl 1 j letr... |

84 | Replacing Function Parameters By Global Variables - Sestoft - 1989 |

78 |
The Theory and Practice of Transforming Call-by-Need into Call-by-Value
- Mycroft
- 1980
(Show Context)
Citation Context ...o state that e.g., some applications are actually trivial. 2. The annotations are obtained by an automatic control-flow analysis that extends Mycroft's [ termination analysis to higher-order programs =-=[20, 21]-=-. This tool has applications in other areas such as compiling and partial evaluation. 3. Retaining Reynolds's method of introducing continuations in serious terms yields a transformation that introduc... |

69 | Continuation semantics in typed lambda-calculi
- Meyer, Wand
- 1985
(Show Context)
Citation Context ...nted with types, and valuation functions with -terms [22, 28]; -- typed -terms can be transformed into continuation style automatically using Plotkin's continuation-passing-style (CPS) transformation =-=[9, 15, 24]-=-. We have transformed the representation of several direct-style specifications into continuation style. Since the meta-language of denotational semantics obeys normal order [28], we have used the cal... |

59 | For a better support of static data flow
- Consel, Danvy
- 1991
(Show Context)
Citation Context ...lows one to produce the representation of a continuation semantics automatically. Partial evaluators work better on continuation-passing programs, but again not all continuations are always necessary =-=[2, 3]-=-. Our extended transformation into continuation style makes it possible to reduce the occurrences of continuations in a source program. In addition, it also enables partial evaluation of call-by-name ... |

54 |
Realistic Compiler Generation
- Lee
- 1989
(Show Context)
Citation Context ...worthwhile property considering how counter-intuitive continuation-style specifications may look.) 8.3 Applications Semantics-directed compiler-generation systems often work on continuation semantics =-=[13, 14, 16, 18]-=-, thus forcing one to write a continuation semantics and to prove its congruence with the direct one. Our new transformation allows one to produce the representation of a continuation semantics automa... |

52 | Lawall “Back to Direct Style II: First-Class Continuations
- Danvy, L
- 1992
(Show Context)
Citation Context ...estigate it elsewhere [11]. 8.6 Transforming the representation of a continuation semantics into direct style The transformation from continuation style to direct style has been investigated recently =-=[4, 6, 12, 27]-=-, and enables one to transform the representation of a continuation semantics into direct style. Of course, we can only produce the representation of a direct semantics from a continuation semantics w... |

48 |
On the relation between direct and continuation semantics
- REYNOLDS
- 1974
(Show Context)
Citation Context ...liff@cis.ksu.edu 2 1 Introduction Proving the congruence between a denotational-semantics specification in direct style and a denotational-semantics specification in continuation style is not trivial =-=[26, 28, 31]-=-. Yet, -- both direct-style and continuation-style specifications can be represented as typed -terms: semantic domains are represented with types, and valuation functions with -terms [22, 28]; -- type... |

46 |
and Hanne Riis Nielson. Two-Level Functional Languages, volume 34 of Cambridge Tracts
- Nielson
- 1992
(Show Context)
Citation Context ...s. We briefly mention how the present work can be adapted to other fashions. Partial functions are often used in place of total functions and lifted domains when modeling non-terminating computations =-=[23, 34]-=-. Our explanation of totality and partiality in terms of trivial and serious functions naturally applies to denotational specifications based on partial functions. Strict functions are often used to m... |

45 |
Programming Language Concepts and Paradigms
- Watt
- 1990
(Show Context)
Citation Context ...n continuation style. Alternatively, one could define a core meta-language and parameterize it with the style of the interpretation. This approach is reminiscent of Mosses and Watt's Action Semantics =-=[19, 35]-=-, of the Nielsons's two-level meta-language [23], and of Moggi's computational -calculus [17]. We investigate it elsewhere [11]. 8.6 Transforming the representation of a continuation semantics into di... |

36 | Polymorphic Type Assignment and CPS Conversion
- Harper, Lillibridge
- 1993
(Show Context)
Citation Context ...nted with types, and valuation functions with -terms [22, 28]; -- typed -terms can be transformed into continuation style automatically using Plotkin's continuation-passing-style (CPS) transformation =-=[9, 15, 24]-=-. We have transformed the representation of several direct-style specifications into continuation style. Since the meta-language of denotational semantics obeys normal order [28], we have used the cal... |

29 |
Two-level semantics and code generation
- Nielson, Nielson
- 1988
(Show Context)
Citation Context ...vial [26, 28, 31]. Yet, -- both direct-style and continuation-style specifications can be represented as typed -terms: semantic domains are represented with types, and valuation functions with -terms =-=[22, 28]-=-; -- typed -terms can be transformed into continuation style automatically using Plotkin's continuation-passing-style (CPS) transformation [9, 15, 24]. We have transformed the representation of severa... |

27 | CPS transformation after strictness analysis
- Danvy, Hatcliff
- 1992
(Show Context)
Citation Context ...rmation after strictness analysis that generalizes the call-by-value CPS transformation (should all constructs be strict) and the call-by-name CPS transformation (should all constructs be non-strict) =-=[5]-=-. Tools producing a variety of continuation-style representations are valuable new ones in a programming-language workbench. 1.5 Organization The rest of this paper is organized as follows. Section 2 ... |

21 |
Action Semantics, volume 26 of Cambridge Tracts
- Mosses
- 1992
(Show Context)
Citation Context ...n continuation style. Alternatively, one could define a core meta-language and parameterize it with the style of the interpretation. This approach is reminiscent of Mosses and Watt's Action Semantics =-=[19, 35]-=-, of the Nielsons's two-level meta-language [23], and of Moggi's computational -calculus [17]. We investigate it elsewhere [11]. 8.6 Transforming the representation of a continuation semantics into di... |

13 | Separating stages in the continuation-passing style transformation
- Lawall, Danvy
- 1993
(Show Context)
Citation Context ...estigate it elsewhere [11]. 8.6 Transforming the representation of a continuation semantics into direct style The transformation from continuation style to direct style has been investigated recently =-=[4, 6, 12, 27]-=-, and enables one to transform the representation of a continuation semantics into direct style. Of course, we can only produce the representation of a direct semantics from a continuation semantics w... |

7 |
to direct style
- Back
- 1992
(Show Context)
Citation Context ...estigate it elsewhere [11]. 8.6 Transforming the representation of a continuation semantics into direct style The transformation from continuation style to direct style has been investigated recently =-=[4, 6, 12, 27]-=-, and enables one to transform the representation of a continuation semantics into direct style. Of course, we can only produce the representation of a direct semantics from a continuation semantics w... |

6 |
Correct flow analysis in continuation semantics
- Montenyohl, Wand
- 1988
(Show Context)
Citation Context ...ticism goes as follows. Why would one want a continuation semantics when one already has a brave and honest direct semantics? 10 Not for the love of mathematics alone, but for implementation purposes =-=[16, 18]-=-! But then one does not need the continuation semantics, but its representation --- which is precisely what our new transformation produces automatically. Therefore our approach enables the language d... |

5 |
On the use of LISP in implementing denotational semantics
- Pleban, Lee
- 1986
(Show Context)
Citation Context ...worthwhile property considering how counter-intuitive continuation-style specifications may look.) 8.3 Applications Semantics-directed compiler-generation systems often work on continuation semantics =-=[13, 14, 16, 18]-=-, thus forcing one to write a continuation semantics and to prove its congruence with the direct one. Our new transformation allows one to produce the representation of a continuation semantics automa... |

2 |
Forthcoming
- Hatcliff
- 1994
(Show Context)
Citation Context ...an also be phrased more elegantly in terms of Moggi's computational metalanguage [17] --- serious terms are typed as computations, trivial terms are typed as values. This point is developed elsewhere =-=[10, 11]. 12 Identifiers-=-: \Gamma [ fi : ��g `a i : (�� ; serious) \Gamma [ fiv : ��g `a i v : (�� ; trivial ) Primitive Operators: \Gamma `a op 0 : (' ; trivial ) \Gamma `a e1 : (' ; ff ) \Gamma `a op 1 e1 : ... |

1 |
Lambda calculus schemata. In Talcott [33]. An earlier version appeared
- Fischer
- 1972
(Show Context)
Citation Context ...ionality of Com is given as (Store ! Ans) ! Store ! Ans: It is very simple to specify a transformation into continuation style that "puts continuations first", as in Fischer's original trans=-=formation [7, 27]-=-. Such a transformation would naturally yield the functionality above. Finally, our work has relied on denotational definitions being stated using a simply-typed meta-language. This meta-language is s... |