Results 1  10
of
50
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 628 (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 timeconsuming, and is likely to exceed the production of today’s programmers. New techniques are required to solve this socalled 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.
A Type System Equivalent to Flow Analysis
 ACM Transactions on Programming Languages and Systems
, 1995
"... Flowbased safety analysis of higherorder languages has been studied by Shivers, and Palsberg and Schwartzbach. Open until now is the problem of finding a type system that accepts exactly the same programs as safety analysis. In this paper we prove that Amadio and Cardelli's type system with s ..."
Abstract

Cited by 94 (15 self)
 Add to MetaCart
Flowbased safety analysis of higherorder languages has been studied by Shivers, and Palsberg and Schwartzbach. Open until now is the problem of finding a type system that accepts exactly the same programs as safety analysis. In this paper we prove that Amadio and Cardelli's type system with subtyping and recursive types accepts the same programs as a certain safety analysis. The proof involves mappings from types to flow information and back. As a result, we obtain an inference algorithm for the type system, thereby solving an open problem. 1 Introduction 1.1 Background Many program analyses for higherorder languages are based on flow analysis, also known as closure analysis. Examples include various analyses in the Standard ML of New Jersey compiler [3], and the bindingtime analyses for Scheme in the partial evaluators Schism [5] and Similix [4]. Such analyses have the advantage that they can be applied to untyped languages. This is in contrast to more traditional abstract inter...
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 functiona ..."
Abstract

Cited by 73 (3 self)
 Add to MetaCart
(Show Context)
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.
Efficient Multilevel 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 offline partial evaluation and integrating the "cogen approach" with a multilevel binding ..."
Abstract

Cited by 64 (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 offline partial evaluation and integrating the "cogen approach" with a multilevel bindingtime analysis. This novel "multicogen approach" solves two fundamental problems of selfapplicable partial evaluation: the generationtime problem and the generatorsize problem. The multilevel program generator has been implemented for a higherorder subset of Scheme. Experimental results show a remarkable reduction of generation time and generator size compared to previous attempts of multiple selfapplication. 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...
Closure Analysis in Constraint Form
 ACM Transactions on Programming Languages and Systems
, 1995
"... Interpretation Bondorf's definition can be simplified considerably. To see why, consider the second component of CMap(E) \Theta CEnv(E). This component is updated only in Closure Analysis in Constraint Form \Delta 9 b(E 1 @ i E 2 )¯ae and read only in b(x l )¯ae. The key observation is that ..."
Abstract

Cited by 63 (5 self)
 Add to MetaCart
Interpretation Bondorf's definition can be simplified considerably. To see why, consider the second component of CMap(E) \Theta CEnv(E). This component is updated only in Closure Analysis in Constraint Form \Delta 9 b(E 1 @ i E 2 )¯ae and read only in b(x l )¯ae. The key observation is that both these operations can be done on the first component instead. Thus, we can omit the use of CEnv(E). By rewriting Bondorf's definition according to this observation, we arrive at the following definition. As with Bondorf's definition, we assume that all labels are distinct. Definition 2.3.1. We define m : (E : ) ! CMap(E) ! CMap(E) m(x l )¯ = ¯ m( l x:E)¯ = (m(E)¯) t h[[ l ]] 7! flgi m(E 1 @ i E 2 )¯ = (m(E 1 )¯) t (m(E 2 )¯) t F l2¯(var(E1 )) (h[[ l ]] 7! ¯(var(E 2 ))i t h[[@ i ]] 7! ¯(var(body(l)))i) . We can now do closure analysis of E by computing fix(m(E)). A key question is: is the simpler abstract interpretation equivalent to Bondorf's? We might attempt to prove this u...
Tractable Constraints in Finite Semilattices
 Science of Computer Programming
, 1996
"... . We introduce the notion of definite inequality constraints involving monotone functions in a finite meetsemilattice, generalizing the logical notion of Hornclauses, and we give a linear time algorithm for deciding satisfiability. We characterize the expressiveness of the framework of definit ..."
Abstract

Cited by 61 (3 self)
 Add to MetaCart
(Show Context)
. We introduce the notion of definite inequality constraints involving monotone functions in a finite meetsemilattice, generalizing the logical notion of Hornclauses, and we give a linear time algorithm for deciding satisfiability. We characterize the expressiveness of the framework of definite constraints and show that the algorithm uniformly solves exactly the set of all meetclosed relational constraint problems, running with small linear time constant factors for any fixed problem. We give an alternative technique which reduces inequalities to satisfiability of Hornclauses (hornsat) and study its efficiency. Finally, we show that the algorithm is complete for a maximal class of tractable constraints, by proving that any strict extension will lead to NPhard problems in any meetsemilattice. Keywords: Finite semilattices, constraint satisfiability, program analysis, tractability, algorithms. 1 Introduction Many program analysis problems can be solved by generating a...
Offline specialisation in Prolog using a handwritten compiler generator
, 2004
"... The so called âcogen approachâ to program specialisation, writing a compiler generator instead of a specialiser, has been used with considerable success in partial evaluation of both functional and imperative languages. This paper demonstrates that this approach is also applicable to partial eva ..."
Abstract

Cited by 47 (23 self)
 Add to MetaCart
(Show Context)
The so called âcogen approachâ to program specialisation, writing a compiler generator instead of a specialiser, has been used with considerable success in partial evaluation of both functional and imperative languages. This paper demonstrates that this approach is also applicable to partial evaluation of logic programming languages, also called partial deduction. Selfapplication has not been as much in focus in logic programming as for functional and imperative languages, and the attempts to selfapply partial deduction systems have, of yet, not been altogether that successful. So, especially for partial deduction, the cogen approach should prove to have a considerable importance when it comes to practical applications. This paper first develops a generic offline partial deduction technique for pure logic programs, notably supporting partially instantiated datastructures via binding types. From this a very efficient cogen is derived, which generates very efficient generating extensions (executing up to several orders of magnitude faster than current online systems) which in turn perform very good and nontrivial specialisation, even rivalling existing online systems. All this is supported by extensive benchmarks. Finally, it is shown how the cogen can be extended to directly support a large part of Prologâs declarative and nondeclarative features and how semionline specialisation can be efficiently integrated.
LambdaDropping: Transforming Recursive Equations into Programs with Block Structure
, 2001
"... Lambdalifting a blockstructured program transforms it into a set of recursive equations. We present the symmetric transformation: lambdadropping. Lambdadropping a set of recursive equations restores block structure and lexical scope. For lack ..."
Abstract

Cited by 42 (11 self)
 Add to MetaCart
(Show Context)
Lambdalifting a blockstructured program transforms it into a set of recursive equations. We present the symmetric transformation: lambdadropping. Lambdadropping a set of recursive equations restores block structure and lexical scope. For lack
BindingTime Analysis and the Taming of C Pointers
"... The aim of bindingtime analysis is to determine when variables, expressions, statements, etc. in a program can be evaluated by classifying these into static (compiletime) and dyamic (runtime). Explicit separation of binding times has turned out to be crucial for successful selfapplication of par ..."
Abstract

Cited by 35 (1 self)
 Add to MetaCart
(Show Context)
The aim of bindingtime analysis is to determine when variables, expressions, statements, etc. in a program can be evaluated by classifying these into static (compiletime) and dyamic (runtime). Explicit separation of binding times has turned out to be crucial for successful selfapplication of partial evaluators, and apparently, it is also an important steppingstone for profitable specialization of imperative languages with pointers and dynamic memory allocation. In this paper we present an automatic bindingtime analysis for a substantial subset of the C language. The paper has two parts. In the first part, the semantic issues of bindingtime separation is discussed with emphasis on pointers and classification of these. This leads to the introduction of a twolevel C language where binding times are explicit in the syntax. Finally, wellannotatedness rules are given which excludes nonconsistently annotated programs. In the second part, an automatic bindingtime analysis based on constraint system solving is developed. The constraints capture the bindingtime dependencies between expressions and subexpressions, and a solution to the system gives the binding times of all variables and expressions. We give rules for the generation of constraints, provide normalization rules, and describe how a solution can be found. Given the binding times of expressions, a wellannotated twolevel version of the program can easily be construted. A twolevel program can e.g. be input to an offline partial evaluator.
Handwriting program generator generators
 Sixth International Symposium on Programming Language Implementation and Logic Programming, number 844 in Lecture Notes in Computer Science
, 1994
"... Abstract. In this paper we argue that handwriting a program generator generator has a number of advantages compared to generating a program generator generator by selfapplication of a partial evaluator. We show the basic principles of how to construct a program generator generator by presenting a ..."
Abstract

Cited by 32 (0 self)
 Add to MetaCart
(Show Context)
Abstract. In this paper we argue that handwriting a program generator generator has a number of advantages compared to generating a program generator generator by selfapplication of a partial evaluator. We show the basic principles of how to construct a program generator generator by presenting a program generator generator for a skeletal language, and we argue that it is not more difficult to use the direct approach than the indirect approach. Moreover, we report on some promising experiments made with a prototype implementation of a program generator generator for most of the Standard ML Core Language. To the best of our knowledge, our prototype is the first succesfully implemented handwritten program generator generator for a statically typed language. 1