## Complexity Analysis for a Lazy Higher-Order Language (1990)

Venue: | In Proceedings of the 3rd European Symposium on Programming |

Citations: | 47 - 2 self |

### BibTeX

@INPROCEEDINGS{Sands90complexityanalysis,

author = {David Sands},

title = {Complexity Analysis for a Lazy Higher-Order Language},

booktitle = {In Proceedings of the 3rd European Symposium on Programming},

year = {1990},

pages = {361--376},

publisher = {Springer-Verlag}

}

### Years of Citing Articles

### OpenURL

### Abstract

This paper is concerned with the time-analysis of functional programs. Techniques which enable us to reason formally about a program's execution costs have had relatively little attention in the study of functional programming. We concentrate here on the construction of equations which compute the time-complexity of expressions in a lazy higher-order language. The problem with higher-order functions is that complexity is dependent on the cost of applying functional parameters. Structures called cost-closures are introduced to allow us to model both functional parameters and the cost of their application. The problem with laziness is that complexity is dependent on context. Projections are used to characterise the context in which an expression is evaluated, and cost-equations are parameterised by this context-description to give a compositional time-analysis. Using this form of context information we introduce two types of time-equation: sufficient-time equations and nece...

### Citations

1309 | A Structural Approach to Operational Semantics
- Plotkin
- 1981
(Show Context)
Citation Context ...e intensional properties of programs in a more straightforward way, without the need for any extra machinery other than the relatively familiar "symbol pushing" involved in operational seman=-=tics (see [17]-=-). Lazy Evaluation A (non-compositional) means of analysing a call-by-name language is considered in [15]. Le M'etayer's solution involves transforming a call-by-name program into a strongly equivalen... |

309 | Natural semantics
- Kahn
- 1987
(Show Context)
Citation Context ...ional behaviour of the original program. Semantics The (dynamic) operational semantics for our language is defined by an inference system (a set of rules and axioms) in the style of Natural Semantics =-=[8]-=-. Step-counting In order to reason about complexity we define a dynamic semantics so that the evaluation of an expression gives a pair of the value, and the number of reductions of non-primitive funct... |

99 | Economic Analysis of
- Radtke, Davis
- 2000
(Show Context)
Citation Context ... must take into account some description of context. 3.1 Modelling Contexts with Projections The formulation of a context which will be used in our time analysis is that provided by Wadler and Hughes =-=[9]-=- in the analysis of strictness. Wadler shows how this formulation of context can be useful for time analysis in [7]. Here we provide an introduction to the use of projections to model contexts. For a ... |

89 |
Mechanical program analysis
- Wegbreit
- 1975
(Show Context)
Citation Context ...xecution costs have had relatively little attention in the study of functional programming. There has been some interest in the mechanisation of program cost analysis, perhaps the main examples being =-=[1, 2, 3]-=-. These works describe systems which analyse cost by first constructing (recursive) equations which describe the time-complexity of a functional program in a strict first-order language. A closed form... |

66 |
Backwards analysis of functional programs
- Hughes
- 1988
(Show Context)
Citation Context ... analysis) by additional parameterization of the context transformers to include the context transformers for functional arguments. An approach to fully higher-order backwards analysis is outlined in =-=[13]-=-. This is based on a mixture of abstract interpretation (forwards analysis) and first-order backwards analysis. For the purposes of this section it will not be necessary to introduce these devices. In... |

36 | Strictness Analysis Aids Time Analysis - Wadler - 1988 |

35 |
Automatic Program Analysis
- Hickey, Cohen
- 1985
(Show Context)
Citation Context ..., and in an abridged form in the proceedings of ESOP 90, LNCS 432. y This work was partially supported by ESPRIT Basic Research Action P3124 1 average-case solution of such equations is considered in =-=[4, 5]-=-. We concentrate here on the first part of this process---the construction of equations which compute the time-complexity of a given program. For programs written a first-order strict (i.e. call-by-va... |

27 |
A compositional approach to time analysis of first order lazy functional programs
- Bjerner, Holmström
- 1989
(Show Context)
Citation Context ...es, and provided inspiration for Wadler's work. His operational model of contexts, evaluation degrees could form an alternative basis for the work presented here. More recently, Bjerner and Holmstrom =-=[19]-=- have adapted the ideas in [18] to give a calculus for the time analysis of a first-order functional language. The equations used to describe context are precise, thus specifying an exact time-analysi... |

17 |
Mathematical methods in the analysis of algorithms and data structures
- FLAJOLET
- 1988
(Show Context)
Citation Context ..., and in an abridged form in the proceedings of ESOP 90, LNCS 432. y This work was partially supported by ESPRIT Basic Research Action P3124 1 average-case solution of such equations is considered in =-=[4, 5]-=-. We concentrate here on the first part of this process---the construction of equations which compute the time-complexity of a given program. For programs written a first-order strict (i.e. call-by-va... |

16 |
A relationship between abstract interpretation and projection analysis (extended abstract
- Burn
- 1990
(Show Context)
Citation Context ...To make this work, we must have ? ! ? and all functions are naturally-extended to be strict in ? , i.e., f(u 1 ; : : : ; ? ; : : : ; u n ) = ? . These technical devices are explained more formally in =-=[11]-=- in terms of lifting. The Projection Lattice A projection ff : D ? ! D ? , is called a projection over D. Projections over any domain form a lattice, with ordering v, containing at least the points gi... |

13 |
Mechanical analysis of program complexity
- LeM'etayer
- 1985
(Show Context)
Citation Context ...xecution costs have had relatively little attention in the study of functional programming. There has been some interest in the mechanisation of program cost analysis, perhaps the main examples being =-=[1, 2, 3]-=-. These works describe systems which analyse cost by first constructing (recursive) equations which describe the time-complexity of a functional program in a strict first-order language. A closed form... |

13 | Backwards strictness analysis: Proved and improved
- Davis, Wadler
- 1990
(Show Context)
Citation Context ... an introduction to the use of projections to model contexts. For a fuller development the reader is referred to [9]; a more formal development, together with enhanced analysis techniques is given in =-=[10]-=-. The basic problem is, given a function, how much information do we require from the argument in order to determine a certain amount of information about the result. Projections, in the domain theore... |

10 |
Implementation and Programming Techniques for Functional Languages
- Wray
- 1986
(Show Context)
Citation Context ...some context ff. The problem here is that there is no useful context information that can be propagated to x (by any context function apply #2 ) which is independent of the function f . Wray's thesis =-=[12] shows how-=- to handle a "second order" language (for strictness analysis) by additional parameterization of the context transformers to include the context transformers for functional arguments. An app... |

9 |
Time Complexity of Programs in Type Theory
- Bjerner
- 1989
(Show Context)
Citation Context ...ore complex, and it not clear that the translation preserves the number of steps that are being counted in the analysis. Bjerner's time analysis for programs in the language of Martin-Lof type-theory =-=[18]-=- has relevance to the analysis of first-order lazy functional languages, and provided inspiration for Wadler's work. His operational model of contexts, evaluation degrees could form an alternative bas... |

7 |
Complexity analysis for higher order language
- Sands
- 1988
(Show Context)
Citation Context ...-order strict (i.e. call-by-value) language this is very straightforward. In the first part of this paper we show how to deal with a strict higher-order language (a fuller development can be found in =-=[6]-=-). In the remainder of the paper we adapt these ideas to a lazy language. This extension is based on Wadler's use of context-analysis in the construction of time equations for a lazy first-order langu... |

7 |
On the complexity of higher-order programs
- Shultis
- 1985
(Show Context)
Citation Context ...ry-time equations, which together provide bounds on the exact time-complexity. 7.1 Related Work Higher-Order Functions Analysing the time-complexity of higher-order functions is considered by Shultis =-=[14]-=-. He begins with a non-standard denotational semantics which models both value and cost. A slightly less cumbersome logic is then defined for reasoning about cost by the direct manipulation of express... |

2 |
Analysis of Functional Programs by Program Transformations
- Métayer
- 1988
(Show Context)
Citation Context ...ge to typable expressions, although this is not mentioned in the paper). A means of analysing higher-order functions, rather more in the "functional" style of the approach taken here, can be=-= found in [15]-=-. Le M'etayer's solution involves defining a family of cost-functions for each function in the original script, for which the i th cost-function computes the cost of applying the function to its i th ... |

1 |
Automatic complexity analysis. In Functional Programming Languages and computer architecture, conference proceedings
- Rosendahl
- 1989
(Show Context)
Citation Context ...xecution costs have had relatively little attention in the study of functional programming. There has been some interest in the mechanisation of program cost analysis, perhaps the main examples being =-=[1, 2, 3]-=-. These works describe systems which analyse cost by first constructing (recursive) equations which describe the time-complexity of a functional program in a strict first-order language. A closed form... |

1 |
Derived properties and derived programs
- Talcott
- 1985
(Show Context)
Citation Context ...at cost function definitions are constructed dynamically. In addition, unlike the techniques presented here the analysis cannot handle lists of functions, or non-polymorphically typable functions. In =-=[16]-=- Talcott is concerned with providing tools for reasoning about intensional properties of programs (like cost). To this end, computation structures, derived properties and derived programs are introduc... |