Results 1  10
of
10
A Generic Account of ContinuationPassing Styles
 Proceedings of the Twentyfirst Annual ACM Symposium on Principles of Programming Languages
, 1994
"... We unify previous work on the continuationpassing style (CPS) transformations in a generic framework based on Moggi's computational metalanguage. This framework is used to obtain CPS transformations for a variety of evaluation strategies and to characterize the corresponding administrative reducti ..."
Abstract

Cited by 87 (34 self)
 Add to MetaCart
We unify previous work on the continuationpassing style (CPS) transformations in a generic framework based on Moggi's computational metalanguage. This framework is used to obtain CPS transformations for a variety of evaluation strategies and to characterize the corresponding administrative reductions and inverse transformations. We establish generic formal connections between operational semantics and equational theories. Formal properties of transformations for specific evaluation orders follow as corollaries. Essentially, we factor transformations through Moggi's computational metalanguage. Mapping terms into the metalanguage captures computational properties (e.g., partiality, strictness) and evaluation order explicitly in both the term and the type structure of the metalanguage. The CPS transformation is then obtained by applying a generic transformation from terms and types in the metalanguage to CPS terms and types, based on a typed term representation of the continuation ...
From ML to Ada: Stronglytyped Language Interoperability via Source Translation
, 1993
"... We describe a system that supports sourcelevel integration of MLlike functional language code with ANSI C or Ada83 code. The system works by translating the functional code into typecorrect, "vanilla" C or Ada; it offers simple, efficient, typesafe interoperation between new functional code com ..."
Abstract

Cited by 65 (3 self)
 Add to MetaCart
We describe a system that supports sourcelevel integration of MLlike functional language code with ANSI C or Ada83 code. The system works by translating the functional code into typecorrect, "vanilla" C or Ada; it offers simple, efficient, typesafe interoperation between new functional code components and "legacy" thirdgenerationlanguage components. Our translator represents a novel synthesis of techniques including userparameterized specification of primitive types and operators; removal of polymorphism by code specialization; removal of higherorder functions using closure datatypes and interpretation; and aggressive optimization of the resulting firstorder code, which can be viewed as encoding the result of a closure analysis. Programs remain fully typed at every stage of the translation process, using only simple, standard type systems. Target code runs at speeds comparable to the output of current optimizing ML compilers, even though handicapped by a conservative garbage collector.
Back to Direct Style
, 1994
"... This paper describes the transformation of lambdaterms from continuationpassing style (CPS) to direct style. This transformation is the left inverse of Plotkin's lefttoright callbyvalue CPS encoding for the pure lambdacalculus. Not all terms are CPS terms, and not all CPS terms encode a left ..."
Abstract

Cited by 49 (22 self)
 Add to MetaCart
This paper describes the transformation of lambdaterms from continuationpassing style (CPS) to direct style. This transformation is the left inverse of Plotkin's lefttoright callbyvalue CPS encoding for the pure lambdacalculus. Not all terms are CPS terms, and not all CPS terms encode a lefttoright callbyvalue evaluation. These CPS terms are characterized here; they can be mapped back to direct style. In addition, the two transformations  to continuationpassing style and to direct style  are factored using a language where all intermediate values are named and their computation is sequentialized. The issue of proper tailrecursion is also addressed.
Static caching for incremental computation
 ACM Trans. Program. Lang. Syst
, 1998
"... A systematic approach is given for deriving incremental programs that exploit caching. The cacheandprune method presented in the article consists of three stages: (I) the original program is extended to cache the results of all its intermediate subcomputations as well as the nal result, (II) the e ..."
Abstract

Cited by 47 (19 self)
 Add to MetaCart
A systematic approach is given for deriving incremental programs that exploit caching. The cacheandprune method presented in the article consists of three stages: (I) the original program is extended to cache the results of all its intermediate subcomputations as well as the nal result, (II) the extended program is incrementalized so that computation on a new input can use all intermediate results on an old input, and (III) unused results cached by the extended program and maintained by the incremental program are pruned away, l e a ving a pruned extended program that caches only useful intermediate results and a pruned incremental program that uses and maintains only the useful results. All three stages utilize static analyses and semanticspreserving transformations. Stages I and III are simple, clean, and fully automatable. The overall method has a kind of optimality with respect to the techniques used in Stage II. The method can be applied straightforwardly to provide a systematic approach to program improvement via caching.
Reference Counting as a Computational Interpretation of Linear Logic
 Journal of Functional Programming
, 1996
"... We develop formal methods for reasoning about memory usage at a level of abstraction suitable for establishing or refuting claims about the potential applications of linear logic for static analysis. In particular, we demonstrate a precise relationship between type correctness for a language based o ..."
Abstract

Cited by 34 (0 self)
 Add to MetaCart
We develop formal methods for reasoning about memory usage at a level of abstraction suitable for establishing or refuting claims about the potential applications of linear logic for static analysis. In particular, we demonstrate a precise relationship between type correctness for a language based on linear logic and the correctness of a referencecounting interpretation of the primitives that the language draws from the rules for the `of course' operation. Our semantics is `lowlevel' enough to express sharing and copying while still being `highlevel ' enough to abstract away from details of memory layout. This enables the formulation and proof of a result describing the possible runtime reference counts of values of linear type. Contents 1 Introduction 1 2 Operational Semantics with Memory 4 3 A Programming Language Based on Linear Logic 9 4 Semantics 14 5 Properties of the Semantics 24 6 Linear Logic and Memory 27 7 Discussion 32 A Proofs of the Main Theorems 36 Acknowledgements...
The Occurrence of Continuation Parameters in CPS Terms
, 1995
"... We prove an occurrence property about formal parameters of continuations in ContinuationPassing Style (CPS) terms that have been automatically produced by CPS transformation of pure, callbyvalue terms. Essentially, parameters of continuations obey a stacklike discipline. This property was intro ..."
Abstract

Cited by 24 (18 self)
 Add to MetaCart
We prove an occurrence property about formal parameters of continuations in ContinuationPassing Style (CPS) terms that have been automatically produced by CPS transformation of pure, callbyvalue terms. Essentially, parameters of continuations obey a stacklike discipline. This property was introduced, but not formally proven, in an earlier work on the DirectStyle transformation (the inverse of the CPS transformation). The proof has been implemented in Elf, a constraint logic programming language based on the logical framework LF. In fact, it was the implementation that inspired the proof. Thus this note also presents a case study of machineassisted proof discovery. All the programs are available in ( ftp.daimi.aau.dk:pub/danvy/Programs/danvypfenningElf93.tar.gz ftp.cs.cmu.edu:user/fp/papers/cpsocc95.tar.gz Most of the research reported here was carried out while the first author visited Carnegie Mellon University in the Spring of 1993. Current address: Olivier Danvy, Ny Munkeg...
Caching intermediate results for program improvement
 In Proceedings of the 1995 ACM SIGPLAN Symposium on Partial Evaluation and SemanticsBased Program Manipulation, PEPM ’95
, 1995
"... A systematic approach is given for symbolically caching intermediate results useful for deriving incremental programs from nonincremental programs. We exploit a number of program analysis and transformation techniques, centered around e ective c a c hing based on its utilization in deriving increme ..."
Abstract

Cited by 22 (6 self)
 Add to MetaCart
A systematic approach is given for symbolically caching intermediate results useful for deriving incremental programs from nonincremental programs. We exploit a number of program analysis and transformation techniques, centered around e ective c a c hing based on its utilization in deriving incremental programs, in order to increase the degree of incrementality not otherwise achievable by using only the return values of programs that are of direct interest. Our method can be applied straightforwardly to provide a systematic approach to program improvement via caching. 1
Thunks and the λcalculus
 IN THE JOURNAL OF FUNCTIONAL PROGRAMMING. RS976 OLIVIER DANVY AND ULRIK
, 1997
"... Plotkin, in his seminal article Callbyname, callbyvalue and the λcalculus, formalized evaluation strategies and simulations using operational semantics and continuations. In particular, he showed how callbyname evaluation could be simulated under callbyvalue evaluation and vice versa. Si ..."
Abstract

Cited by 21 (9 self)
 Add to MetaCart
Plotkin, in his seminal article Callbyname, callbyvalue and the λcalculus, formalized evaluation strategies and simulations using operational semantics and continuations. In particular, he showed how callbyname evaluation could be simulated under callbyvalue evaluation and vice versa. Since Algol 60, however, callbyname is both implemented and simulated with thunks rather than with continuations. We recast
On the Transformation between Direct and Continuation Semantics
 Proceedings of the 9th Conference on Mathematical Foundations of Programming Semantics, number 802 in Lecture Notes in Computer Science
, 1993
"... . Proving the congruence between a direct semantics and a continuation semantics is often surprisingly complicated considering that directstyle terms can be transformed into continuation style automatically. However, transforming the representation of a directstyle semantics into continuation sty ..."
Abstract

Cited by 14 (11 self)
 Add to MetaCart
. Proving the congruence between a direct semantics and a continuation semantics is often surprisingly complicated considering that directstyle terms can be transformed into continuation style automatically. However, transforming the representation of a directstyle semantics into continuation style usually does not yield the expected representation of a continuationstyle 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 directstyle 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 ...
Reflections on Reflections
, 1997
"... In the functional programming literature, compiling is often expressed as a translation between source and target program calculi. In recent work, Sabry and Wadler proposed the notion of a reflection as a basis for relating the source and target calculi. A reflection elegantly describes the situati ..."
Abstract

Cited by 5 (1 self)
 Add to MetaCart
In the functional programming literature, compiling is often expressed as a translation between source and target program calculi. In recent work, Sabry and Wadler proposed the notion of a reflection as a basis for relating the source and target calculi. A reflection elegantly describes the situation where there is a kernel of the source language that is isomorphic to the target language. However, we believe that the reflection criteria is so strong that it often excludes the usual situation in compiling where one is compiling from a higherlevel to a lowerlevel language. We give a detailed analysis of several translations commonly used in compiling that fail to be reflections. We conclude that, in addition to the notion of reflection, there are several relations weaker a reflection that are useful for characterizing translations. We show that several familiar translations (that are not naturally reflections) form what we call a reduction correspondence. We introduce the more genera...