Results 1 -
7 of
7
Tutorial Notes on Partial Evaluation
- Proceedings of the Twentieth Annual ACM Symposium on Principles of Programming Languages
, 1993
"... The last years have witnessed a flurry of new results in the area of partial evaluation. These tutorial notes survey the field and present a critical assessment of the state of the art. 1 Introduction Partial evaluation is a source-to-source program transformation technique for specializing program ..."
Abstract
-
Cited by 230 (60 self)
- Add to MetaCart
The last years have witnessed a flurry of new results in the area of partial evaluation. These tutorial notes survey the field and present a critical assessment of the state of the art. 1 Introduction Partial evaluation is a source-to-source program transformation technique for specializing programs with respect to parts of their input. In essence, partial evaluation removes layers of interpretation. In the most general sense, an interpreter can be defined as a program whose control flow is determined by its input data. As Abelson points out, [43, Foreword], even programs that are not themselves interpreters have important interpreter-like pieces. These pieces contain both compile-time and run-time constructs. Partial evaluation identifies and eliminates the compile-time constructs. 1.1 A complete example We consider a function producing formatted text. Such functions exist in most programming languages (e.g., format in Lisp and printf in C). Figure 1 displays a formatting functio...
Axiomatizing Reflective Logics and Languages
- Proceedings of Reflection'96
, 1996
"... The very success and breadth of reflective techniques underscores the need for a general theory of reflection. At present what we have is a wide-ranging variety of reflective systems, each explained in its own idiosyncratic terms. Metalogical foundations can allow us to capture the essential aspects ..."
Abstract
-
Cited by 33 (19 self)
- Add to MetaCart
The very success and breadth of reflective techniques underscores the need for a general theory of reflection. At present what we have is a wide-ranging variety of reflective systems, each explained in its own idiosyncratic terms. Metalogical foundations can allow us to capture the essential aspects of reflective systems in a formalismindependent way. This paper proposes metalogical axioms for reflective logics and declarative languages based on the theory of general logics [34]. In this way, several strands of work in reflection, including functional, equational, Horn logic, and rewriting logic reflective languages, as well as a variety of reflective theorem proving systems are placed within a common theoretical framework. General axioms for computational strategies, and for the internalization of those strategies in a reflective logic are also given. 1 Introduction Reflection is a fundamental idea. In logic it has been vigorously pursued by many researchers since the fundamental wor...
Lazy rewriting on eager machinery
- ACM Transactions on Programming Languages and Systems
, 2000
"... The article introduces a novel notion of lazy rewriting. By annotating argument positions as lazy, redundant rewrite steps are avoided, and the termination behaviour of a term rewriting system can be improved. Some transformations of rewrite rules enable an implementation using the same primitives a ..."
Abstract
-
Cited by 23 (1 self)
- Add to MetaCart
The article introduces a novel notion of lazy rewriting. By annotating argument positions as lazy, redundant rewrite steps are avoided, and the termination behaviour of a term rewriting system can be improved. Some transformations of rewrite rules enable an implementation using the same primitives as an implementation of eager rewriting. 1
Higher-Order Rewriting and Partial Evaluation
- REWRITING TECHNIQUES AND APPLICATIONS, LECTURE NOTES IN COMPUTER SCIENCE
, 1998
"... We demonstrate the usefulness of higher-order rewriting techniques for specializing programs, i.e., for partial evaluation. More precisely, we demonstrate how casting program specializers as combinatory reduction systems (CRSs) makes it possible to formalize the corresponding program transformat ..."
Abstract
-
Cited by 6 (4 self)
- Add to MetaCart
We demonstrate the usefulness of higher-order rewriting techniques for specializing programs, i.e., for partial evaluation. More precisely, we demonstrate how casting program specializers as combinatory reduction systems (CRSs) makes it possible to formalize the corresponding program transformations as meta-reductions, i.e., reductions in the internal "substitution calculus." For partial-evaluation problems, this means that instead of having to prove on a case-by-case basis that one's "two-level functions" operate properly, one can concisely formalize them as a combinatory reduction system and obtain as a corollary that static reduction does not go wrong and yields a well-formed residual program.
Fine-Grain Partial Evaluation of Intermediate Code from Equational Programs
, 1991
"... Partial evaluation is greatly simplified if the target language is simple. In [SS90] we define an extremely simple language that is used as an intermediate language for equational programming [O'D85]. Although the intermediate language is a general graph manipulation language, we take advantage of t ..."
Abstract
-
Cited by 2 (2 self)
- Add to MetaCart
Partial evaluation is greatly simplified if the target language is simple. In [SS90] we define an extremely simple language that is used as an intermediate language for equational programming [O'D85]. Although the intermediate language is a general graph manipulation language, we take advantage of the particular properties of programs generated from equational programs. For partial evaluation to be successful, we need both a set of transformations that preserve the semantics of the program and a strategy that tells us when to apply a particular transformation. The strategy includes termination criteria to avoid infinite computations. In this paper we concentrate on a set of transformations that preserve the semantics of the program. We also show a small example of how these transformations can be applied to a program in order to improve its execution speed. The strategy, however, is only sketchy at the present time. The complete strategy is left for a future paper. Furthermore, we do n...
Call Unfolding Strategies for Equational Logic Programs
- In Proceedings of the ACM SIGPLAN Workshop on Partial Evaluation and Semantics-Based Program Manipulation
, 1992
"... For a programming system based on term rewrite rules such as equational logic programming, a serious efficiency problem of the generated code is the creation of terms that only serve to drive further pattern matching. In this paper, we define a terminating call unfolding strategy based on finegrain ..."
Abstract
-
Cited by 1 (1 self)
- Add to MetaCart
For a programming system based on term rewrite rules such as equational logic programming, a serious efficiency problem of the generated code is the creation of terms that only serve to drive further pattern matching. In this paper, we define a terminating call unfolding strategy based on finegrain partial evaluation that removes much of this unnecessary term allocation for programs in intermediate EM code generated from equational logic programs. Our approach is based on calculation, for each instruction, of two sets that reflect the usage of registers in finite execution paths of the program. These sets are calculated using fixed-point iteration over the graph representation of the intermediate code. 1 Introduction Finding call unfolding strategies for partial evaluation is an annoying problem. On the one hand, the basic problem--- knowing how much unfolding is necessary to expose a particular computation if it occurs---is undecidable. Nearly any recursive definition can lead to u...
EM code Semantics, Analysis, and Optimization
"... This paper is a complete presentation of EM code, an intermediate code for representing the pattern-matching automata produced by the Equational Logic Programming system. We present the abstract syntax and operational and denotational semantics of EM code. We then describe in detail methods for ..."
Abstract
- Add to MetaCart
This paper is a complete presentation of EM code, an intermediate code for representing the pattern-matching automata produced by the Equational Logic Programming system. We present the abstract syntax and operational and denotational semantics of EM code. We then describe in detail methods for analysis, optimization, and partial evaluation of EM code programs. This paper is intended as a general reference, and does not assume any prior knowledge of EM code or equational logic programming (except as motivation for reading this paper). Familiarity with term-rewriting systems and lazy evaluation is helpful. Contents 1 Introduction 3 2 Abstract Syntax and Operational Semantics 5 2.1 Abstract Machine : : : : : : : : : : : : : : : : : : : : : : : : : : : 5 2.2 Abstract Syntax : : : : : : : : : : : : : : : : : : : : : : : : : : : 7 2.3 Operational Semantics : : : : : : : : : : : : : : : : : : : : : : : : 8 2.3.1 Heap Memory : : : : : : : : : : : : : : : : : : : : : : : : : 8 2.3.2...

