Results 1 - 10
of
10
A Type System Equivalent to Flow Analysis
- ACM Transactions on Programming Languages and Systems
, 1995
"... Flow-based safety analysis of higher-order 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 subtyp ..."
Abstract
-
Cited by 84 (16 self)
- Add to MetaCart
Flow-based safety analysis of higher-order 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 higher-order 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 binding-time 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...
Simple Relational Correctness Proofs for Static Analyses and Program Transformations
, 2004
"... We show how some classical static analyses for imperative programs, and the optimizing transformations which they enable, may be expressed and proved correct using elementary logical and denotational techniques. The key ingredients are an interpretation of program properties as relations, rather tha ..."
Abstract
-
Cited by 57 (9 self)
- Add to MetaCart
We show how some classical static analyses for imperative programs, and the optimizing transformations which they enable, may be expressed and proved correct using elementary logical and denotational techniques. The key ingredients are an interpretation of program properties as relations, rather than predicates, and a realization that although many program analyses are traditionally formulated in very intensional terms, the associated transformations are actually enabled by more liberal extensional properties.
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
Thunks and the λ-calculus
- IN THE JOURNAL OF FUNCTIONAL PROGRAMMING. RS-97-6 OLIVIER DANVY AND ULRIK
, 1997
"... Plotkin, in his seminal article Call-by-name, call-by-value and the λ-calculus, formalized evaluation strategies and simulations using operational semantics and continuations. In particular, he showed how call-by-name evaluation could be simulated under call-by-value evaluation and vice versa. Si ..."
Abstract
-
Cited by 21 (9 self)
- Add to MetaCart
Plotkin, in his seminal article Call-by-name, call-by-value and the λ-calculus, formalized evaluation strategies and simulations using operational semantics and continuations. In particular, he showed how call-by-name evaluation could be simulated under call-by-value evaluation and vice versa. Since Algol 60, however, call-by-name is both implemented and simulated with thunks rather than with continuations. We recast
Selective Thunkification
- In Proceedings of the 1st International Static Analysis Symposium
"... . Recently, Amtoft presented an analysis and transformation for mapping typed call-by-name programs to call-by-value equivalents. Here, we present a comparable analysis and transformation for untyped programs using dataflow analysis. In the general case, the transformation generates thunks for call ..."
Abstract
-
Cited by 10 (1 self)
- Add to MetaCart
. Recently, Amtoft presented an analysis and transformation for mapping typed call-by-name programs to call-by-value equivalents. Here, we present a comparable analysis and transformation for untyped programs using dataflow analysis. In the general case, the transformation generates thunks for call site operands of a call-by-name program. Using strictness information derived as part of a larger flow analysis, we can determine that some operands are necessarily evaluated under call-byname, so the transformation does not need to generate thunks for them. The dataflow analysis is formulated as the solution to a set of constraints. We show that any solution to the constraints is sound, and that any such solution justifies the resulting transformation. 1 Introduction In [1], Amtoft presented a strictness analysis for typed programs, and based on that analysis, developed an algorithm to transform call-by-name programs into call-by-value equivalents. The algorithm was correct in that the tra...
Local Type Reconstruction by means of Symbolic Fixed Point Iteration
- In Proc. 5th European Symposium on Programming (ESOP
, 1994
"... . We convert, via a version that uses constraints, a type inference system for strictness analysis into an algorithm which given an expression finds the set of possible typings. Although this set in general does not possess a minimal element, it can be represented compactly by means of symbolic expr ..."
Abstract
-
Cited by 2 (0 self)
- Add to MetaCart
. We convert, via a version that uses constraints, a type inference system for strictness analysis into an algorithm which given an expression finds the set of possible typings. Although this set in general does not possess a minimal element, it can be represented compactly by means of symbolic expressions in normal form -- such expressions have the property that once values for the constraint variables with negative polarity have been supplied it is straight-forward to compute the minimal values for the constraint variables with positive polarity. The normalization process works on the fly, i.e. by a leaf-to-root traversal of the inference tree. 1 Background and Motivation Recently much interest has been devoted to the formulation of program analysis in terms of inference systems, as opposed to e.g. abstract interpretation (for the relationship between those methods see e.g. [Jen91]). This approach is appealing since it separates the question "what is done?" from the question "how is...
Compiling Laziness using Projections
"... Abstract. Projection-based strictness analysis is a powerful technique, able to cope with non-flat domains and latent demand. By analysing the projections as embedding-projection pairs, we develop an algorithm to translate lazy functions into a strict functional language with explicit closures. The ..."
Abstract
- Add to MetaCart
Abstract. Projection-based strictness analysis is a powerful technique, able to cope with non-flat domains and latent demand. By analysing the projections as embedding-projection pairs, we develop an algorithm to translate lazy functions into a strict functional language with explicit closures. The translated functions typically operate on simpler types than the originals, in particular types containing fewer liftings, which correspond to the operational notion of closures. Like the analysis on which it is based, our algorithm is restricted to first-order functions. 1 Introduction A lazy functional language provides great expressive power, but this comes ata cost in both space and time, for delayed computations must be stored as closures on the heap. The management of these closures also adds to executiontime, and the frequent context switches frustrate both compile-time optimization and efficient exploitation of hardware. Strictness analysis [17,3,20,14] aims to ameliorate this situation by identifyingstrict functions, which can be implemented using call-by-value. The arguments of
A Unified Approach to Strictness Analysis and Optimising Transformations
, 1996
"... We present an inference system for translating programs in a PCF-like source language into a variant of Moggi's computational lambda calculus. This translation combines a simple strictness analysis with its associated optimising transformations into a single system. The correctness of the translatio ..."
Abstract
- Add to MetaCart
We present an inference system for translating programs in a PCF-like source language into a variant of Moggi's computational lambda calculus. This translation combines a simple strictness analysis with its associated optimising transformations into a single system. The correctness of the translation is established using a logical relation between the denotational semantics of the source and target languages. 1 Introduction 1.1 Background Strictness analysis of lazy functional programs has been studied extensively during the the last 15 years or so, usually with the justification that the results of the analysis can be used in an optimising compiler [Myc81, BHA86, Ben92]. There has, however, been surprisingly little serious work on just how the results of strictness analysis can be used as the basis for optimising transformations. This is probably because it turns out to be rather more difficult to express and justify these optimisations than one might at first imagine. Roughly speak...
A Semantic Model of Binding Times for Safe Partial Evaluation
- Proc. Programming Languages: Implementations, Logics and Programs (PLILP
"... In program optimisation an analysis determines some information about a portion of a program, which is then used to justify certain transformations on the code. The correctness of the optimisation can be argued monolithically by considering the behaviour of the optimiser and a particular analysis i ..."
Abstract
- Add to MetaCart
In program optimisation an analysis determines some information about a portion of a program, which is then used to justify certain transformations on the code. The correctness of the optimisation can be argued monolithically by considering the behaviour of the optimiser and a particular analysis in conjunction. Alternatively, correctness can be established by finding an interface, a semantic property, between the analysis and the transformation. The semantic property provides modularity by giving a specification for a systematic construction of the analysis, and the program transformations are justified via the semantic properties. This paper considers the problem of partial evaluation. The safety of a partial evaluator ("it does not go wrong") has previously been argued in the monolithic style by considering the behaviour of a particular binding-time analysis and program specialiser in conjunction. In this paper we pursue the alternative approach of justifying the binding-time prop...
Lazy Rewriting on Eager Machinery
- Rewriting Techniques and Applications, number 914 in Lecture Notes in Computer Science
, 1995
"... We define Lazy Term Rewriting Systems and show that they can be realized by local adaptations of an eager implementation of conventional term rewriting systems. The overhead of lazy evaluation is only incurred when lazy evaluation is actually performed. Our method is modelled by a transformation ..."
Abstract
- Add to MetaCart
We define Lazy Term Rewriting Systems and show that they can be realized by local adaptations of an eager implementation of conventional term rewriting systems. The overhead of lazy evaluation is only incurred when lazy evaluation is actually performed. Our method is modelled by a transformation of term rewriting systems, which concisely expresses the intricate interaction between pattern matching and lazy evaluation. The method easily extends to term graph rewriting. CR Subject Classification (1991): D.3.4 [Programming languages]: Processors -- Compilers, Optimization; D.1.1 [Programming Techniques]: Applicative (Functional) Programming; D.1.6: Logic Programming. AMS Subject Classification (1991): 68N20: Compilers and generators; 68Q05: Models of Computation; 68Q42: Rewriting Systems Keywords & Phrases: lazy term rewriting, program transformation. Note: Partial support received from the European Communities under the ESPRIT project 5399 (Compiler Generation for Parallel M...

