Results 11 - 20
of
35
Optimizing Lazy Functional Programs Using Flow Inference
, 1995
"... . Nonstrict higher order functional programming languages are notorious for their low run time efficiency. Optimizations based on flow analysis, which determines for each variable x in a program which expressions could have originated the value of x, can improve the situation by removing redundant ..."
Abstract
-
Cited by 19 (5 self)
- Add to MetaCart
. Nonstrict higher order functional programming languages are notorious for their low run time efficiency. Optimizations based on flow analysis, which determines for each variable x in a program which expressions could have originated the value of x, can improve the situation by removing redundant eval and thunk operations, avoiding thunk updates, and allowing the use of unboxed representations of some data. We formulate flow analysis as an inference problem in a type system built using type inclusion constraints and an algorithm for solving these constraints is also given. 1 Introduction Polymorphically typed nonstrict higher order functional programming languages are a boon to the programmer because they provide powerful mechanisms for abstraction [11]. Equally, and for the same reasons, they are very difficult to compile to efficient code. Among the main obstacles are the frequent need to build thunks (representations for unevaluated expressions), test whether objects are thunks o...
Modular Static Program Analysis
- Proceedings of Compiler Construction
, 2002
"... Abstract. The purpose of this paper is to present four basic methods for interpretation: – simplification-based separate analysis; – worst-case separate analysis; – separate analysis with (user-provided) interfaces; – symbolic relational separate analysis; as well as a fifth category which is essent ..."
Abstract
-
Cited by 18 (1 self)
- Add to MetaCart
Abstract. The purpose of this paper is to present four basic methods for interpretation: – simplification-based separate analysis; – worst-case separate analysis; – separate analysis with (user-provided) interfaces; – symbolic relational separate analysis; as well as a fifth category which is essentially obtained by composition of the above separate local analyses together with global analysis methods. 1
The Effectiveness of Flow Analysis for Inlining
- In Proceedings of the 1997 ACM SIGPLAN International Conference on Functional Programming
, 1997
"... An interprocedural flow analysis can justify inlining in higher-order languages. In principle, more inlining can be performed as analysis accuracy improves. This paper compares four flow analyses to determine how effectively they justify inlining in practice. The paper makes two contributions. First ..."
Abstract
-
Cited by 18 (2 self)
- Add to MetaCart
An interprocedural flow analysis can justify inlining in higher-order languages. In principle, more inlining can be performed as analysis accuracy improves. This paper compares four flow analyses to determine how effectively they justify inlining in practice. The paper makes two contributions. First, the relative merits of the flow analyses are measured with all other variables held constant. The four analyses include two monovariant and two polyvariant analyses that cover a wide range of the accuracy/cost spectrum. Our measurements show that the effectiveness of the inliner improves slightly as analysis accuracy improves, but the improvement is offset by the compile-time cost of the accurate analyses. The second contribution is an improvement to the previously reported inlining algorithm used in our experiments. The improvement causes flow information provided by a polyvariant analysis to be selectively merged. By merging flow information depending on the inlining context, the algorit...
Systematic Realisation of Control Flow Analyses for CML
- In Proceedings of ICFP'97
, 1997
"... We present a methodology for the systematic realisation of control flow analyses and illustrate it for Concurrent ML. We start with an abstract specification of the analysis that is next proved semantically sound with respect to a traditional small-step operational semantics; this result holds for t ..."
Abstract
-
Cited by 17 (8 self)
- Add to MetaCart
We present a methodology for the systematic realisation of control flow analyses and illustrate it for Concurrent ML. We start with an abstract specification of the analysis that is next proved semantically sound with respect to a traditional small-step operational semantics; this result holds for terminating as well as non-terminating programs. The analysis is defined coinductively and it is shown that all programs have a least analysis result (that is indeed the best one). To realise the analysis we massage the specification in three stages: (i) to explicitly record reachability of subexpressions, (ii) to be defined in a syntax-directed manner, and (iii) to generate a set of constraints that subsequently can be solved by standard techniques. We prove equivalence results between the different versions of the analysis; in particular it follows that the least solution to the constraints generated will be the least analysis result also to the initial specification. 1 Introduction Many c...
Modular set-based analysis from contracts
- In Morrisett and Peyton Jones [27
"... In PLT Scheme, programs consist of modules with contracts. The latter describe the inputs and outputs of functions and objects via predicates. A run-time system enforces these predicates; if a predicate fails, the enforcer raises an exception that blames a specific module with an explanation of the ..."
Abstract
-
Cited by 16 (1 self)
- Add to MetaCart
In PLT Scheme, programs consist of modules with contracts. The latter describe the inputs and outputs of functions and objects via predicates. A run-time system enforces these predicates; if a predicate fails, the enforcer raises an exception that blames a specific module with an explanation of the fault. In this paper, we show how to use such module contracts to turn set-based analysis into a fully modular parameterized analysis. Using this analysis, a static debugger can indicate for any given contract check whether the corresponding predicate is always satisfied, partially satisfied, or (potentially) completely violated. The static debugger can also predict the source of potential errors, i.e., it is sound with respect to the blame assignment of the contract system.
Demand-Driven Type Inference with Subgoal Pruning: Trading Precision for Scalability
, 2004
"... After two decades of effort, type inference for dynamically typed languages scales to programs of a few tens of thousands of lines of code, but no further. For larger programs, this paper proposes using a kind of demand-driven analysis where the number of active goals is carefully restricted. To ach ..."
Abstract
-
Cited by 13 (2 self)
- Add to MetaCart
After two decades of effort, type inference for dynamically typed languages scales to programs of a few tens of thousands of lines of code, but no further. For larger programs, this paper proposes using a kind of demand-driven analysis where the number of active goals is carefully restricted. To achieve this restriction, the algorithm occasionally prunes goals by giving them solutions that are trivially true and thus require no further subgoals to be solved; the previous subgoals of a newly pruned goal may often be discarded from consideration, reducing the total number of active goals. A specific algorithm DDP is described which uses this approach. An experiment on DDP shows that it infers precise types for roughly 30 % to 45 % of the variables in a program with hundreds of thousands of lines; the percentage varies with the choice of pruning threshold, a parameter of the algorithm. The time required varies from an average of one-tenth of one second per variable to an unknown maximum, again depending on the pruning threshold. These data suggest that 50 and 2000 are both good choices of pruning threshold, depending on whether speed or precision is more important.
Fixpoint Computation for Polyvariant Static Analyses of Higher-Order Applicative Programs
- ACM Transactions on Programming Languages and Systems
, 1994
"... interpretation [Abramsky and Hankin 1987; Cousot 1981; Jones and Nielson 1990] has been used to formulate a wide variety of static analyses aimed at optimizing programs in practical programming languages. Research in the area has been focusing on the conceptual and formal aspects of the topic. Speci ..."
Abstract
-
Cited by 11 (5 self)
- Add to MetaCart
interpretation [Abramsky and Hankin 1987; Cousot 1981; Jones and Nielson 1990] has been used to formulate a wide variety of static analyses aimed at optimizing programs in practical programming languages. Research in the area has been focusing on the conceptual and formal aspects of the topic. Special emphasis has been put on such issues as accuracy, termination, and relating non-standard and standard semantic definitions. However, the practical aspects involved in implementing an abstract interpreter have not received as much attention. This situation is even more pronounced for analyses of languages with higher-order functions. A static analysis includes a critical phase that consists of finding a fixpoint to a set of (possibly) recursive abstract functions derived from the analyzed program. To be of any practical use, an analysis should include an efficient and accurate fixpoint algorithm. The efficiency depends mostly on this accuracy. For example, some analyses only determine one ...
The Costs and Benefits of Cloning in a Lazy Functional Language
, 2001
"... Cloning is a transformation where several copies are made of some functions in a program in order to improve the effectiveness of optimizations of these functions. Cloning may thus lead to a reduction in the number of executed instructions, but it does in general also lead to an increase in the size ..."
Abstract
-
Cited by 10 (3 self)
- Add to MetaCart
Cloning is a transformation where several copies are made of some functions in a program in order to improve the effectiveness of optimizations of these functions. Cloning may thus lead to a reduction in the number of executed instructions, but it does in general also lead to an increase in the size of the executable program. Depending on the characteristics of the memory hierarchy of the target machine, this may increase the instruction cache miss rate enough that the cloned program executes slower than the original. In this paper we try to quantify both the benefits and costs of cloning in the context of an optimizing compiler for a simple lazy functional language. We will also evaluate a few techniques for reducing the number of instruction cache misses. 1 Introduction Cloning is a program transformation where functions called from multiple call sites are duplicated. In general, this increases the effectiveness of optimizations which depend on properties which may hold at some, b...
Rewriting Approximations for Fast Prototyping of Static Analyzers
- Research Report RR 5997, INRIA
, 2006
"... Abstract. This paper shows how to construct static analyzers using tree automata and rewriting techniques. Starting from a term rewriting system representing the operational semantics of the target programming language and given a program to analyze, we automatically construct an over-approximation ..."
Abstract
-
Cited by 10 (6 self)
- Add to MetaCart
Abstract. This paper shows how to construct static analyzers using tree automata and rewriting techniques. Starting from a term rewriting system representing the operational semantics of the target programming language and given a program to analyze, we automatically construct an over-approximation of the set of reachable terms, i.e. of the program states that can be reached. The approach enables fast prototyping of static analyzers because modifying the analysis simply amounts to changing the set of rewrite rules defining the approximation. A salient feature of this approach is that the approximation is correct by construction and hence does not require an explicit correctness proof. To illustrate the framework proposed here on a realistic programming language we instantiate it with the Java Virtual Machine semantics and perform class analysis on Java bytecode programs. 1
Flow Logics for Constraint Based Analysis
- In Proc. CC'98, number 1383 in Lecture Notes in Computer Science
, 1998
"... Flow logic offers a compact and versatile notation for expressing the acceptability of solutions to program analysis problems. In contrast to previous logical formulations of program analysis it aims at integrating existing approaches to data flow analysis and control flow analysis. It is able to de ..."
Abstract
-
Cited by 9 (4 self)
- Add to MetaCart
Flow logic offers a compact and versatile notation for expressing the acceptability of solutions to program analysis problems. In contrast to previous logical formulations of program analysis it aims at integrating existing approaches to data flow analysis and control flow analysis. It is able to deal with a broad variety of language paradigms, program properties, kinds of formal semantics, and methods used for computing the best solution. In this paper we illustrate how a compositional flow logic (in "succinct" form) can be systematically transformed into an efficient exhaustive procedure for computing the best solution of a set of constraints generated. This involves transformations to attribute grammars and to specifications of the ("verbose") form used in control flow analysis.

