Results 11 - 20
of
52
Set Constraints and Set-Based Analysis
- In Proceedings of the Workshop on Principles and Practice of Constraint Programming, LNCS 874
, 1994
"... This paper contains two main parts. The first examines the set constraint calculus, discusses its history, and overviews the current state of known algorithms and related issues. Here we will also survey the uses of set constraints, starting from early work in (imperative) program analysis, to more ..."
Abstract
-
Cited by 33 (0 self)
- Add to MetaCart
This paper contains two main parts. The first examines the set constraint calculus, discusses its history, and overviews the current state of known algorithms and related issues. Here we will also survey the uses of set constraints, starting from early work in (imperative) program analysis, to more recent work in logic and functional programming systems. The second part describes set-based analysis. The aim here is a declarative interpretation of what it means to approximate the meaning of a program in just one way: ignore dependencies between variables, and instead, reason about each variable as the set of its possible runtime values. The basic approach starts with some description of the operational semantics, and then systematically replaces descriptions of environments (mappings from program variables to values) by set environments (mappings from program variables to sets
Lambda-Dropping: Transforming Recursive Equations into Programs with Block Structure
, 2001
"... Lambda-lifting a block-structured program transforms it into a set of recursive equations. We present the symmetric transformation: lambda-dropping. Lambdadropping a set of recursive equations restores block structure and lexical scope. For lack ..."
Abstract
-
Cited by 32 (10 self)
- Add to MetaCart
Lambda-lifting a block-structured program transforms it into a set of recursive equations. We present the symmetric transformation: lambda-dropping. Lambdadropping a set of recursive equations restores block structure and lexical scope. For lack
Safety Analysis versus Type Inference for Partial Types
- Information Processing Letters
, 1992
"... Safety analysis is an algorithm for determining if a term in an untyped lambda calculus with constants is safe, i.e., if it does not cause an error during evaluation. We prove that safety analysis accepts strictly more safe lambda terms than does type inference for Thatte's partial types. 1 Introduc ..."
Abstract
-
Cited by 29 (10 self)
- Add to MetaCart
Safety analysis is an algorithm for determining if a term in an untyped lambda calculus with constants is safe, i.e., if it does not cause an error during evaluation. We prove that safety analysis accepts strictly more safe lambda terms than does type inference for Thatte's partial types. 1 Introduction We will compare two techniques for analyzing the safety of terms in an untyped lambda calculus with constants, see figure 1. The safety we are concerned with is the absence of those run-time errors that arise from the misuse of constants. In this paper we consider just the two constants 0 and succ. They can be misused either by applying a number to an argument, or by applying succ to an abstraction. Safety is undecidable so any analysis algorithm must reject some safe programs. E ::= x j x:E j E 1 E 2 j 0 j succ E Figure 1: The lambda calculus. One way of achieving a safety guarantee is to perform type inference (TI), because "well-typed programs cannot go wrong". Two examples of type ...
Eta-Expansion does the Trick
- ACM TRANSACTIONS ON PROGRAMMING LANGUAGES AND SYSTEMS
, 1996
"... Partial-evaluation folklore has it that massaging one's source programs can make them specialize better. In Jones, Gomard, and Sestoft's recent textbook, a whole chapter is dedicated to listing such "binding-time improvements": nonstandard use of continuationpassing style, eta-expansion, and a popul ..."
Abstract
-
Cited by 22 (6 self)
- Add to MetaCart
Partial-evaluation folklore has it that massaging one's source programs can make them specialize better. In Jones, Gomard, and Sestoft's recent textbook, a whole chapter is dedicated to listing such "binding-time improvements": nonstandard use of continuationpassing style, eta-expansion, and a popular transformation called "The Trick". We provide a unified view of these binding-time improvements, from a typing perspective. Just as a
Correctness of Monadic State: An Imperative Call-by-Need Calculus
- In Proc. 25th ACM Symposium on Principles of Programming Languages
, 1998
"... The extension of Haskell with a built-in state monad combines mathematical elegance with operational efficiency: ffl Semantically, at the source language level, constructs that act on the state are viewed as functions that pass an explicit store data structure around. ffl Operationally, at the imp ..."
Abstract
-
Cited by 20 (2 self)
- Add to MetaCart
The extension of Haskell with a built-in state monad combines mathematical elegance with operational efficiency: ffl Semantically, at the source language level, constructs that act on the state are viewed as functions that pass an explicit store data structure around. ffl Operationally, at the implementation level, constructs that act on the state are viewed as statements whose evaluation has the side-effect of updating the implicit global store in place. There are several unproven conjectures that the two views are consistent. Recently, we have noted that the consistency of the two views is far from obvious: all it takes for the implementation to become unsound is one judiciously-placed beta-step in the optimization phase of the compiler. This discovery motivates the current paper in which we formalize and show the correctness of the implementation of monadic state. For the proof, we first design a typed call-by-need language that models the intermediate language of the compiler, to...
Constraint Systems for Useless Variable Elimination
, 1998
"... A useless variable is one whose value contributes nothing to the final outcome of a computation. Such variables are unlikely to occur in human-produced code, but may be introduced by various program transformations. We would like to eliminate useless parameters from procedures and eliminate the corr ..."
Abstract
-
Cited by 19 (1 self)
- Add to MetaCart
A useless variable is one whose value contributes nothing to the final outcome of a computation. Such variables are unlikely to occur in human-produced code, but may be introduced by various program transformations. We would like to eliminate useless parameters from procedures and eliminate the corresponding actual parameters from their call sites. This transformation is the extension to higher-order programming of a variety of dead-code elimination optimizations that are important in compilers for first-order imperative languages. Shivers has presented such a transformation. We reformulate the transformation and prove its correctness. We believe that this correctness proof can be a model for proofs of other analysis-based transformations. We proceed as follows: ffl We reformulate Shivers' analysis as a set of constraints; since the constraints are conditional inclusions, they can be solved using standard algorithms. ffl We prove that any solution to the constraints is sound: that tw...
Order-of-evaluation Analysis for Destructive Updates in Strict Functional Languages with Flat Aggregates
- In Conference on Functional Programming Languages and Computer Architecture
, 1993
"... The aggregate update problem in functional languages is concerned with detecting cases where a functional array update operation can be implemented destructively in constant time. Previous work on this problem has assumed a fixed order of evaluation of expressions. In this paper, we devise a simple ..."
Abstract
-
Cited by 19 (1 self)
- Add to MetaCart
The aggregate update problem in functional languages is concerned with detecting cases where a functional array update operation can be implemented destructively in constant time. Previous work on this problem has assumed a fixed order of evaluation of expressions. In this paper, we devise a simple analysis, for strict functional languages with flat aggregates, that derives a good order of evaluation for making the updates destructive. Our work improves Hudak's work [14] on abstract reference counting, which assumes fixed order of evaluation and uses the domain of sticky reference counts. Our abstract reference counting uses a 2-point domain. We show that for programs with no aliasing, our analysis is provably more precise than Hudak's approach (even if the fixed order of evaluation chosen by Hudak happens to be the right order). We also show that our analysis algorithm runs in polynomial time. To the best of our knowledge, no previous work shows polynomial time complexity. We suggest ...
Correctness of Binding-time Analysis
, 1993
"... A binding-time analysis is correct if it always produces consistent binding-time information. Consistency prevents partial evaluators from "going wrong". A sufficient and decidable condition for consistency, called well-annotatedness, was first presented by Gomard and Jones. In this paper we prove t ..."
Abstract
-
Cited by 17 (6 self)
- Add to MetaCart
A binding-time analysis is correct if it always produces consistent binding-time information. Consistency prevents partial evaluators from "going wrong". A sufficient and decidable condition for consistency, called well-annotatedness, was first presented by Gomard and Jones. In this paper we prove that a weaker condition implies consistency. Our condition is decidable, subsumes the one of Gomard and Jones, and was first studied by Schwartzbach and the present author. Our result implies the correctness of the binding-time analysis of Mogensen, and it indicates the correctness of the core of the binding-time analyses of Bondorf and Consel. We also prove that all partial evaluators will on termination have eliminated all "eliminable"-marked parts of an input which satisfies our condition. This generalizes a result of Gomard. Our development is for the pure -calculus with explicit binding-time annotations. 1 Introduction A partial evaluator is an implementation of Kleene's S m n theorem....
A New Approach to Control Flow Analysis
- Lecture
, 1998
"... We develop a control flow analysis algorithm for PCF based on game semantics. The analysis is closely related to Shivers' 0-CFA analysis and the algorithm is shown to be cubic. The game semantics basis for the algorithm means that it can be naturally extended to handle strict languages and languages ..."
Abstract
-
Cited by 15 (3 self)
- Add to MetaCart
We develop a control flow analysis algorithm for PCF based on game semantics. The analysis is closely related to Shivers' 0-CFA analysis and the algorithm is shown to be cubic. The game semantics basis for the algorithm means that it can be naturally extended to handle strict languages and languages with imperative features. These extensions are discussed in the paper. We sketch the correctness proof for the algorithm. We also illustrate an algorithm for computing k-limited CFA.
On Static and Dynamic Control-Flow Information in Program Analysis and Transformation
, 2001
"... interpretation and fixed-point computation . . . 71 5.1.2 The time-stamping technique . . . . . . . . . . . . . . . . 72 5.2 The time-stamps-based approximation algorithm . . . . . . . . . 73 5.2.1 A class of recursive equations . . . . . . . . . . . . . . . . 73 5.2.2 The intuition behind time stam ..."
Abstract
-
Cited by 13 (6 self)
- Add to MetaCart
interpretation and fixed-point computation . . . 71 5.1.2 The time-stamping technique . . . . . . . . . . . . . . . . 72 5.2 The time-stamps-based approximation algorithm . . . . . . . . . 73 5.2.1 A class of recursive equations . . . . . . . . . . . . . . . . 73 5.2.2 The intuition behind time stamps . . . . . . . . . . . . . 74 5.3 A formalization of the time-stamps-based algorithm . . . . . . . 75 5.3.1 State-passing recursive equations . . . . . . . . . . . . . . 75 5.3.2 Correctness . . . . . . . . . . . . . . . . . . . . . . . . . . 77 5.3.3 Complexity estimates . . . . . . . . . . . . . . . . . . . . 78 5.4 An extension . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78 5.6 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 Appendix 5.A Operational specification . . . . . . . . . . . . . . . . . 81 6 Static Transition Compression 85 6.2 Source and target languages . . . . . . . . . . . . . . . . . . . . . 86 6.2.1 An unstructured target language . . . . . . . . . . . . . . 86 6.2.2 A structured source language . . . . . . . . . . . . . . . . 86 6.3 A context-insensitive translation . . . . . . . . . . . . . . . . . . 87 6.3.4 Chains of jumps . . . . . . . . . . . . . . . . . . . . . . . 91 6.4 Context awareness . . . . . . . . . . . . . . . . . . . . . . . . . . 92 6.4.1 Continuations and duplication . . . . . . . . . . . . . . . 92 6.4.2 Towards the right thing . . . . . . . . . . . . . . . . . . . 92 6.5 A context-sensitive translation . . . . . . . . . . . . . . . . . . . 93 6.6 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98

