Results 1 - 10
of
13
Efficient Multi-level Generating Extensions for Program Specialization
, 1995
"... . Multiple program specialization can stage a computation into several computation phases. This paper presents an effective solution for multiple program specialization by generalizing conventional off-line partial evaluation and integrating the "cogen approach" with a multi-level binding-time analy ..."
Abstract
-
Cited by 54 (5 self)
- Add to MetaCart
. Multiple program specialization can stage a computation into several computation phases. This paper presents an effective solution for multiple program specialization by generalizing conventional off-line partial evaluation and integrating the "cogen approach" with a multi-level binding-time analysis. This novel "multi-cogen approach" solves two fundamental problems of self-applicable partial evaluation: the generation-time problem and the generator-size problem. The multilevel program generator has been implemented for a higher-order subset of Scheme. Experimental results show a remarkable reduction of generation time and generator size compared to previous attempts of multiple self-application. 1 Introduction Stages of computation arise naturally in many programs, depending on the availability of data or the frequency with which the input changes. Code for later stages can be optimized based on values available in earlier stages. Partial evaluation has received much attention beca...
The essence of eta-expansion in partial evaluation
- LISP AND SYMBOLIC COMPUTATION
, 1995
"... Selective eta-expansion is a powerful "binding-time improvement", i.e., a source-program modification that makes a partial evaluator yield better results. But like most binding-time improvements, the exact problem it solves and the reason why have not been formalized and are only understood by few. ..."
Abstract
-
Cited by 32 (11 self)
- Add to MetaCart
Selective eta-expansion is a powerful "binding-time improvement", i.e., a source-program modification that makes a partial evaluator yield better results. But like most binding-time improvements, the exact problem it solves and the reason why have not been formalized and are only understood by few. In this paper, we describe the problem and the effect of eta-redexes in terms of monovariant binding-time propagation: eta-redexes preserve the static data ow of a source program by interfacing static higher-order values in dynamic contexts and dynamic higher-order values in static contexts. They contribute to two distinct binding-time improvements. We present two extensions of Gomard's monovariant binding-time analysis for the pure-calculus. Our extensions annotate and eta-expand-terms. The rst one eta-expands static higher-order values in dynamic contexts. The second also eta-expands dynamic higher-order values in static contexts. As a significant application, we show that our first binding-time analysis suffices to reformulate the traditional formulation of a CPS transformation into a modern onepass CPS transformer. This binding-time improvement is known, but it is still left unexplained in contemporary literature, e.g., about "cps-based" partial evaluation. We also outline the counterpart of eta-expansion for partially static data structures.
An Automatic Program Generator for Multi-Level Specialization
- LISP AND SYMBOLIC COMPUTATION
, 1997
"... Program specialization can divide a computation into several computation stages. This paper investigates the theoretical limitations and practical problems of standard specialization tools, presents multi-level specialization, and demonstrates that, in combination with the cogen approach, it is far ..."
Abstract
-
Cited by 27 (4 self)
- Add to MetaCart
Program specialization can divide a computation into several computation stages. This paper investigates the theoretical limitations and practical problems of standard specialization tools, presents multi-level specialization, and demonstrates that, in combination with the cogen approach, it is far more practical than previously supposed. The program generator which we designed and implemented for a higher-order functional language converts programs into very compact multi-level generating extensions that guarantee fast successive specialization. Experimental results show a remarkable reduction of generation time and generator size compared to previous attempts of multi-level specialization by self-application. Our approach to multi-level specialization seems well-suited for applications where generation time and program size are critical.
Cogen in Six Lines
- Proc. International Conference on Functional Programming
, 1996
"... We have designed and implemented a program-generator generator (PGG) for an untyped higher-order functional programming language. The program generators perform continuation-based multi-level offline specialization and thus combine the most powerful and general offline partial evaluation techniques. ..."
Abstract
-
Cited by 27 (10 self)
- Add to MetaCart
We have designed and implemented a program-generator generator (PGG) for an untyped higher-order functional programming language. The program generators perform continuation-based multi-level offline specialization and thus combine the most powerful and general offline partial evaluation techniques. The correctness of the PGG is ensured by deriving it from a multi-level specializer. Our PGG is extremely simple to implement due to the use of multi-level techniques and higher-order abstract syntax. Keywords: partial evaluation, multi-level computation, continuations. 1 Introduction An attractive feature of partial evaluation is the ability to generate generating extensions. A generating extension for a program p with two inputs inp s and inp d is a program p-gen which accepts the static input inp s of p and produces a residual program p s which accepts the dynamic input inp d and produces the same result as JpK inp s inp d , provided both p and p s terminate. Jp-genK inp ...
Sound Specialization in the Presence of Computational Effects
- In Theoretical Aspects of Computer Software
, 1997
"... Moggi's computational lambda calculus c is a well-established model of computation. We define a two-level version c of the computational lambda calculus and demonstrate that it is an inevitable description for sound specialization. We implement the calculus in terms of a standard two-level lambda c ..."
Abstract
-
Cited by 14 (5 self)
- Add to MetaCart
Moggi's computational lambda calculus c is a well-established model of computation. We define a two-level version c of the computational lambda calculus and demonstrate that it is an inevitable description for sound specialization. We implement the calculus in terms of a standard two-level lambda calculus via a continuation-passing style transformation. This transformation is sound and complete with respect to c ; it forms a reflection in the two-level lambda calculus of c . As a practical ramification of this work we show that several published specialization algorithms are unsound and develop a sound specializer similar to continuation-based specializers. Keywords: lambda calculus, partial evaluation, functional programming, continuations. 1 Introduction What is a correct partial evaluator for the lambda calculus? Most of the work addressing this question has focused on the relationship between the bindingtime analysis and the specializer [20, 21, 23,30,32,38] using a variety of ...
A self-applicable partial evaluator for the lambda calculus
- International Conference on Computer Languages
, 1990
"... This paper (essentially [12, Chapter 8]) describes partial evaluation for the lambda calculus, augmented with an explicit fixed-point operator. The techniques used here diverge from those used in [12, Chapters 4, 5] and [11] in that they are not based on specialization of named program points. The a ..."
Abstract
-
Cited by 11 (3 self)
- Add to MetaCart
This paper (essentially [12, Chapter 8]) describes partial evaluation for the lambda calculus, augmented with an explicit fixed-point operator. The techniques used here diverge from those used in [12, Chapters 4, 5] and [11] in that they are not based on specialization of named program points. The algorithm essentially leaves some operators (applications, lambdas, etc.) untouched and reduces others as standard evaluation would do it. This simple scheme is able to handle programs that rely heavily on higher-order facilities. The requirements on binding-time analysis are formulated via a type system and an ecient binding-time analysis via constraint solving is outlined. The partial evaluator is proven correct.
Online Partial Evaluation for Shift and Reset
, 2002
"... This paper presents an online partial evaluator for the lambda-calculus with the delimited continuation constructs shift and reset. We first give the semantics of the delimited continuation constructs in two ways: one by writing a continuation passing style (CPS) interpreter and the other by transfo ..."
Abstract
-
Cited by 10 (1 self)
- Add to MetaCart
This paper presents an online partial evaluator for the lambda-calculus with the delimited continuation constructs shift and reset. We first give the semantics of the delimited continuation constructs in two ways: one by writing a continuation passing style (CPS) interpreter and the other by transforming them into CPS. We then combine them to obtain a partial evaluator written in CPS which produces the result in CPS. By transforming this partial evaluator back into a direct style (DS) in two steps, we obtain a DS to DS partial evaluator written in DS. The correctness of the partial evaluator is not yet formally proven. The difficulty comes from the fact that the partial evaluator is written using shift and reset. The method for reasoning about such programs is not yet established. However, the development of the partial evaluator is detailed in the paper to give a degree of confidence that it behaves as we expect.
The Second Futamura Projection for Type-Directed Partial Evaluation
- HIGHER-ORDER AND SYMBOLIC COMPUTATION
, 1999
"... A generating extension of a program specializes it with respect to some specified part of the input. A generating extension of a program can be formed trivially by applying a partial evaluator to the program; the second Futamura projection describes the automatic generation of non-trivial genera ..."
Abstract
-
Cited by 8 (2 self)
- Add to MetaCart
A generating extension of a program specializes it with respect to some specified part of the input. A generating extension of a program can be formed trivially by applying a partial evaluator to the program; the second Futamura projection describes the automatic generation of non-trivial generating extensions by applying a partial evaluator to itself with respect to the programs. We derive
Call-By-Name CPS-Translation as a Binding-Time Improvement
- STATIC ANALYSIS, NUMBER 983 IN LECTURE NOTES IN COMPUTER SCIENCE
, 1995
"... Much attention has been given to the call-by-value continuation passing style (CBV CPS) translation as a tool in partial evaluation, but the call-by-name (CBN) CPS translation has not been investigated. We undertake a systematic investigation of the effect of CBN CPS in connection with partial evalu ..."
Abstract
-
Cited by 6 (1 self)
- Add to MetaCart
Much attention has been given to the call-by-value continuation passing style (CBV CPS) translation as a tool in partial evaluation, but the call-by-name (CBN) CPS translation has not been investigated. We undertake a systematic investigation of the effect of CBN CPS in connection with partial evaluation and deforestation. First, we give an example where CBN CPS translation acts as a binding time improvement to achieve the effects of deforestation using partial evaluation. The same effect cannot be achieved with CBV CPS. Second, we prove formally that the CBN CPS translation together with partial evaluation has the power to achieve all the effects of deforestation. The consequence of these results is a practical tool (the CBN CPS) for improving the results of partial evaluation, as well as an improved understanding of the relation between partial evaluation and deforestation.
Implementing Memoization for Partial Evaluation
- In Herbert Kuchen and Doaitse Swierstra, editors, International Symposium on Programming Languages, Implementations, Logics and Programs (PLILP '96
, 1997
"... . Memoization is a key ingredient in every partial evaluator. It enables folding by caching previously specialized functions. It is essential to make polyvariant specialization terminate. Its implementation is reasonably straightforward in a standard specializer that represents functions by closures ..."
Abstract
-
Cited by 5 (4 self)
- Add to MetaCart
. Memoization is a key ingredient in every partial evaluator. It enables folding by caching previously specialized functions. It is essential to make polyvariant specialization terminate. Its implementation is reasonably straightforward in a standard specializer that represents functions by closures. With the advent of handwritten programgenerator generators (PGGs), implementing memoization gets harder, because PGGs use efficient standard representations of data at specialization time. We present several implementations of memoization for PGGs that are able to deal with all features of current partial evaluators, specifically partially static data and functions. The first implementation is based on message passing. It is simple, portable, and efficient, but only suitable for untyped higher-order languages such as Scheme. The second implementation is geared towards typed language such as SML. Whereas the first two implementations are completely portable, our third implementation exploit...

