Results 1 - 10
of
47
Program Analysis and Specialization for the C Programming Language
, 1994
"... Software engineers are faced with a dilemma. They want to write general and wellstructured programs that are flexible and easy to maintain. On the other hand, generality has a price: efficiency. A specialized program solving a particular problem is often significantly faster than a general program. ..."
Abstract
-
Cited by 472 (0 self)
- Add to MetaCart
Software engineers are faced with a dilemma. They want to write general and wellstructured programs that are flexible and easy to maintain. On the other hand, generality has a price: efficiency. A specialized program solving a particular problem is often significantly faster than a general program. However, the development of specialized software is time-consuming, and is likely to exceed the production of today’s programmers. New techniques are required to solve this so-called software crisis. Partial evaluation is a program specialization technique that reconciles the benefits of generality with efficiency. This thesis presents an automatic partial evaluator for the Ansi C programming language. The content of this thesis is analysis and transformation of C programs. We develop several analyses that support the transformation of a program into its generating extension. A generating extension is a program that produces specialized programs when executed on parts of the input. The thesis contains the following main results.
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...
Reasoning about Programs in Continuation-Passing Style
- Lisp and Symbolic Computation
"... Plotkin's v -calculus for call-by-value programs is weaker than the fij- calculus for the same programs in continuation-passing style (CPS). To identify the callby -value axioms that correspond to fij on CPS terms, we define a new CPS transformation and an inverse mapping, both of which are interes ..."
Abstract
-
Cited by 150 (11 self)
- Add to MetaCart
Plotkin's v -calculus for call-by-value programs is weaker than the fij- calculus for the same programs in continuation-passing style (CPS). To identify the callby -value axioms that correspond to fij on CPS terms, we define a new CPS transformation and an inverse mapping, both of which are interesting in their own right. Using the new CPS transformation, we determine the precise language of CPS terms closed under fij-transformations, as well as the call-by-value axioms that correspond to the so-called administrative fij-reductions on CPS terms. Using the inverse mapping, we map the remaining fi and j equalities on CPS terms to axioms on call-by-value terms. On the pure (constant free) set of-terms, the resulting set of axioms is equivalent to Moggi's computational -calculus. If the call-by-value language includes the control operators abort and call-with-current-continuation, the axioms are equivalent to an extension of Felleisen et al.'s v-C-calculus and to the equational subtheory of Talcott's logic IOCC. Contents 1 Compiling with and without Continuations 4 2 : Calculi and Semantics 7 3 The Origins and Practice of CPS 10 3.1 The Original Encoding : : : : : : : : : : : : : : : : : : : : : 10 3.2 The Universe of CPS Terms : : : : : : : : : : : : : : : : : : 11 4 A Compacting CPS Transformation 13
Multi-Stage Programming: Its Theory and Applications
, 1999
"... MetaML is a statically typed functional programming language with special support for program generation. In addition to providing the standard features of contemporary programming languages such as Standard ML, MetaML provides three staging annotations. These staging annotations allow the construct ..."
Abstract
-
Cited by 79 (18 self)
- Add to MetaCart
MetaML is a statically typed functional programming language with special support for program generation. In addition to providing the standard features of contemporary programming languages such as Standard ML, MetaML provides three staging annotations. These staging annotations allow the construction, combination, and execution of object-programs. Our thesis is that MetaML's three staging annotations provide a useful, theoretically sound basis for building program generators. This dissertation reports on our study of MetaML's staging constructs, their use, their implementation, and their formal semantics. Our results include an extended example of where MetaML allows us to produce efficient programs, an explanation of why implementing these constructs in traditional ways can be challenging, two formulations of MetaML's semantics, a type system for MetaML, and a proposal for extending ...
A Compilation and Optimization Model for Aspect-Oriented Programs
- IN COMPILER CONSTRUCTION, VOLUME 2622 OF SPRINGER LECTURE NOTES IN COMPUTER SCIENCE
, 2003
"... This paper presents a semantics based compilation model for an aspect oriented programming language based on its operational se mantics. Using partial evaluation,th model can explain several issues in compilation processes, including how to find places in program text to in sert aspect code and how ..."
Abstract
-
Cited by 72 (4 self)
- Add to MetaCart
This paper presents a semantics based compilation model for an aspect oriented programming language based on its operational se mantics. Using partial evaluation,th model can explain several issues in compilation processes, including how to find places in program text to in sert aspect code and how to remove unnecessary run time checks. It also illustrates optimization of calling context sensitive pointcuts (cflow), im plemented in real compilers.
A Tour of Schism: A Partial Evaluation System For Higher-Order Applicative Languages
- Proceedings of the Second ACM SIGPLAN Symposium on Partial Evaluation and Semantics-Based Program Manipulation
, 1993
"... ion Parameters Expr)) (b) Standard Syntax Figure 5: Abstract Syntax (define (spec ae env prog cache) (caseType ae [(Id e) (specId e cache)] [(Ev e) (specEv e env prog cache)] [(AType tn) (specType tn cache)] [(ParLookup n) (dParLookup n env cache)] [(ParLookupFreeze n) (dParLookupFreeze n env cache) ..."
Abstract
-
Cited by 68 (12 self)
- Add to MetaCart
ion Parameters Expr)) (b) Standard Syntax Figure 5: Abstract Syntax (define (spec ae env prog cache) (caseType ae [(Id e) (specId e cache)] [(Ev e) (specEv e env prog cache)] [(AType tn) (specType tn cache)] [(ParLookup n) (dParLookup n env cache)] [(ParLookupFreeze n) (dParLookupFreeze n env cache)] [(IfReduce ae1 ae2 ae3) (dIfReduce ae1 ae2 ae3 env prog cache)] [(IfRecons ae1 ae2 ae3) (dIfRecons ae1 ae2 ae3 env prog cache)] [(IfFreeze ae1 ae2 ae3) (dIfFreeze ae1 ae2 ae3 env prog cache)] [(OpSelect idValue) (dOpSelect idValue prog cache)] [(AbsSelect absId statFreeVars liftFreeVars) (dAbsSelect absId statFreeVars liftFreeVars env prog cache)] [(AbsFreeze absId) (dAbsFreeze absId env prog cache)] [(Appl instPat propPat sbtPat ae aes) (dAppl instPat propPat sbtPat ae aes env prog cache)] [(AppFreeze instPat propPat sbtPat ae aes) (dAppFreeze instPat propPat sbtPat ae aes env prog cache)] [(AppRecons ae aes) (dAppRecons ae aes env prog cache)])) Figure 6: Main Specialization Function F...
Efficient analyses for realistic off-line partial evaluation
- Journal of Functional Programming
, 1993
"... Based on Henglein’s efficient binding-time analysis for the lambda calculus (with constants and “fix”) [Hen91], we develop four efficient analyses for use in the preprocessing phase of Similix, a self-applicable partial evaluator for a higher-order subset of Scheme. The analyses developed in this pa ..."
Abstract
-
Cited by 46 (1 self)
- Add to MetaCart
Based on Henglein’s efficient binding-time analysis for the lambda calculus (with constants and “fix”) [Hen91], we develop four efficient analyses for use in the preprocessing phase of Similix, a self-applicable partial evaluator for a higher-order subset of Scheme. The analyses developed in this paper are almost-linear in the size of the analysed program. (1) A flow analysis determines possible value flow between lambda-abstractions and function applications and between constructor applications and selector/predicate applications. The flow analysis is not particularly biased towards partial evaluation; the analysis corresponds to the closure analysis of [Bon91b]. (2) A (monovariant) binding-time analysis distinguishes static from dynamic values; the analysis treats both higher-order functions and partially static data structures. (3) A new is-used analysis, not present in [Bon91b], finds a non-minimal bindingtime annotation which is “safe ” in a certain way: a first-order value may only become static if its result is “needed ” during specialization; this “poor man’s generalization ” [Hol88] increases termination of specialization. (4) Finally, an evaluation-order dependency analysis ensures that the order of side-effects is preserved in the residual program. The four analyses are performed
Compilation Semantics of Aspect-Oriented Programs
, 2002
"... This paper present a semantan(7W1W2 compilat2( framework for an aspect716C7 tt programming language based on it operat'W(/ semantma model. Usingpart(1 evaluatlua tl framework can explain several issues incompilat]2 processes, including howt o find places in programtog t insert aspect code and howt o ..."
Abstract
-
Cited by 39 (0 self)
- Add to MetaCart
This paper present a semantan(7W1W2 compilat2( framework for an aspect716C7 tt programming language based on it operat'W(/ semantma model. Usingpart(1 evaluatlua tl framework can explain several issues incompilat]2 processes, including howt o find places in programtog t insert aspect code and howt o remove unnecessaryrun-tes checks.It also illustW(/2 optstW(/2' of calling-contal sensit - e pointn(' (cflow), implementp in real compilers. Keywords Aspect SandBox, dynamic join point model,part12 evaluatu -( FutC ura project2C1 compile-t2] weaving, contn(1 sensit] e point(7 designat21 cflow) 1.
A gentle introduction to multi-stage programming
- Domain-specific Program Generation, LNCS
, 2004
"... ..."
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.

