## A Naïve Time Analysis and its Theory of Cost Equivalence (1995)

### Cached

### Download Links

- [www.cs.chalmers.se]
- [repository.readscheme.org]
- [ftp.diku.dk]
- [www.cs.chalmers.se]
- [www.cse.chalmers.se]
- DBLP

### Other Repositories/Bibliography

Venue: | Journal of Logic and Computation |

Citations: | 39 - 7 self |

### BibTeX

@ARTICLE{Sands95anaïve,

author = {David Sands},

title = {A Naïve Time Analysis and its Theory of Cost Equivalence},

journal = {Journal of Logic and Computation},

year = {1995},

volume = {5},

pages = {495--541}

}

### Years of Citing Articles

### OpenURL

### Abstract

Techniques for reasoning about extensional properties of functional programs are well understood, but methods for analysing the underlying intensional or operational properties have been much neglected. This paper begins with the development of a simple but useful calculus for time analysis of non-strict functional programs with lazy lists. One limitation of this basic calculus is that the ordinary equational reasoning on functional programs is not valid. In order to buy back some of these equational properties we develop a non-standard operational equivalence relation called cost equivalence, by considering the number of computation steps as an `observable' component of the evaluation process. We define this relation by analogy with Park's definition of bisimulation in CCS. This formulation allows us to show that cost equivalence is a contextual congruence (and thus is substitutive with respect to the basic calculus) and provides useful proof techniques for establishing cost-equivalen...

### Citations

1347 | Imperative functional programming
- Jones, Wadler
- 1993
(Show Context)
Citation Context ...y smaller than h, respectively, and ++ is infix list-append. Functional accounts of quicksort 1Originally due to Richard Bird, it appears as an exercise in informal reasoning about lazy evaluation in =-=[BW88]-=-[Ch. 6], and in the majority(!) of papers on time analysis of non-strict evaluation. 3 are also quadratic time algorithms, but conventional wisdom would label quicksort as a better algorithm than inse... |

693 | Concurrency and automata on infinite sequences - Park - 1981 |

597 | A transformation system for developing recursive programs - Burstall, Darlington - 1977 |

557 | Concrete Mathematics
- Graham, Knuth, et al.
- 1994
(Show Context)
Citation Context ...rather than to present interesting asymptotic analyses, for which the reader may consult a standard text on the analysis of algorithms (e.g. [Knu68,AHU74]) or associated mathematical techniques (e.g. =-=[GKP89]-=-). To reason about complexity we consider expressions containing some non-specified input value (i.e. normal form), which we will denote by a (meta-)variable (written in an italic font). We sometimes ... |

554 | The Implementation of Functional Programming Languages - Jones - 1987 |

455 | Computational lambda-calculus and monads - Moggi - 1989 |

328 | Calculi for synchrony and asynchrony - Milner - 1983 |

243 | The lazy lambda calculus
- Abramsky
- 1990
(Show Context)
Citation Context ...83]. In the theory of concurrency a central idea is that processes that cannot be distinguished by observation should be identified. This "observational " viewpoint is adopted in the "l=-=azy" -calculus [Abr90]-=-, where an equivalence called applicative bisimulation is introduced. In the lazy -calculus, the observable properties are just the convergence of untyped lambda-terms. For our purposes we need to tre... |

196 | Introduction to lambda calculus - Barendregt - 1988 |

123 | Fundamental Algorithms. The Art of Computer Programming - Knuth - 1973 |

113 | Equivalence in functional languages with effects - Mason, Talcott - 1991 |

109 | Term graph rewriting - Barendregt, Eekelen, et al. - 1987 |

100 | Projections for strictness analysis - Wadler, Hughes - 1987 |

100 | Equality in lazy computation systems
- Howe
- 1989
(Show Context)
Citation Context ...duces a simulation-style preordering on expressions (the definitions of cost simulation and program refinement are simple instances). Borrowing some syntactic conventions and semantic techniques from =-=[How89]-=-, some improvement extensionality conditions on the operators of the language are given which guarantee that the improvement ordering is a precongruence. The conditions appear relatively easy to check... |

90 | Mechanical Program Analysis - Wegbreit - 1975 |

88 |
The design and analysis of computer algorithms, Addison-Wesley Reading MA
- Aho, Hopcroft, et al.
- 1974
(Show Context)
Citation Context ...“algorithmic structure” of operationally opaque lazy functional programs to permit the use of the more traditional techniques developed in the context of the analysis of imperative programs (see e.g. =-=[AHU74]-=-), and initial experiments with this calculus suggest that it is of both practical and pedagogical use. A desire for substitutive equivalences for the time-rules led to a theory of cost equivalence, v... |

80 | Automatic Complexity Analysis - Rosendahl - 1989 |

79 | Co-induction in relational semantics - Milner, Tofte - 1991 |

52 | ACE: An Automatic Complexity Evaluator - Métayer - 1988 |

48 | Complexity Analysis for a Lazy Higher-Order Language - Sands - 1990 |

47 | Constructive Versions of Tarskis Fixed Point Theorems - Cousot, Cousot - 1979 |

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

36 |
The Lambda-Calculus. Volume 103
- Barendregt
- 1984
(Show Context)
Citation Context ... ; . . . ; e n . In a case expression case e 1 of nil ) e 2 x : xs ) e 3 the variables x and xs are considered bound in e 3 . A formal definition of substitution is omitted, but is standard (see e.g. =-=[Bar84]). We will-=- also assume the following substitution property (the standard "substitution lemma"): if variables ~x and ~y are distinct, then pf~q=~xgf~r=~yg = pf~r=~ygf~qf~r=~yg=~xg where ~qf~r=~yg = q 1... |

35 | Automatic Program Analysis - Hickey, Cohen - 1985 |

34 |
Context Dependent Bisimulations Between Processes
- Larsen
- 1986
(Show Context)
Citation Context ...eeded to strengthen the relationship between cost-equivalence and the compo37 sitional approach. The idea of a context dependent bisimulation between processes, as studied by Larsen (originating with =-=[Lar86]-=-), seems appropriate here since it suggests the introduction of context (= demand)-dependent cost-simulation. Acknowledgements Thanks to Sebastian Hunt for the numerous discussions which prompted the ... |

33 | Calculi for time analysis of functional programs - Sands - 1990 |

29 | Computational comonads and intensional semantics
- Brookes, Geva
- 1991
(Show Context)
Citation Context ... some aspects of (asymptotic) complexity, which is outside the scope of this work. Another, perhaps more abstract category-theoretic approach to intensional semantics is presented by Brookes and Geva =-=[BG92]-=-. This work places a heavy emphasis on the relationship between the intesional semantics and its underlying extensional one. The key structure is the use of a co-monad, in contrast to Gurr’s use of Mo... |

27 |
A compositional approach to time analysis of first order lazy functional programs
- Bjerner, Holmström
- 1989
(Show Context)
Citation Context ... former approach, whilst simplifying the task of reasoning about context (assuming that an implementation is available), can lead to unacceptable approximations in time-cost. The latter approach (see =-=[BH89]-=-) can be impractically cumbersome for many relatively simple problems, and is unlikely to extend usefully to higher-order languages. The Naive Approach In the following three sections, we explore a co... |

23 |
The Semantics of Destructive Lisp
- Mason
- 1986
(Show Context)
Citation Context ...parison relations (essentially, the more usual operational approximation and equivalence relations) and their application are considered in detail. Following on from other aspects of this work, Mason =-=[Mas86]-=- sketches the definition a family of equivalence relations involving a variety of operation execution-counts. However, as this is for a pure language with neither higher-order functions nor lazy data-... |

22 | Operational theories of improvement in functional languages (extended abstract - Sands - 1991 |

18 |
The theory and practice of strictness analysis for higher order functions
- Burn, Hankin, et al.
- 1986
(Show Context)
Citation Context ...tor [Bur91]. An evaluator is an operational concept which provides a link from information provided by strictness analysis, to the operational semantics. In particular, strictness analysis (see, e.g. =-=[BHA86]-=-) will tell us that when an application of average is being evaluated, it is safe to evaluate the argument to normal-form (since this evaluation will occur anyway). In terms of our calculus, by taking... |

17 |
On computational open-endedness in Martin-Löf’s type theory
- Howe
- 1991
(Show Context)
Citation Context ...never the property satisfies a simple monotonicity requirement with respect to the rules of the operational semantics. This result can be generalised to Howe’s class of structured computation systems =-=[How91]-=-. 12 Conclusions This paper has presented a direct approach to reasoning about time cost under lazy evaluation. The calculus takes the form of time rules extracted from a suitably simple operational s... |

16 | A syntactic approach to program transformation - Ariola, Arvind - 1991 |

13 |
Semantic Frameworks for Complexity
- Gurr
- 1991
(Show Context)
Citation Context ...ively uninteresting structure. Moggi’s categorical semantics of computation [Mog89] is intended to be suitable for capturing broader descriptions of computation than just input-output behaviour. Gurr =-=[Gur91]-=- has studied extensions of denotational semantics to take account of resource-use, and has shown howMoggi’s approach can be used to model computation in such a way that program equivalence also captur... |

11 | The evaluation transformer model of reduction and its correctness
- Burn
- 1991
(Show Context)
Citation Context ... in [San90b] (which differs from that of [Wad88] in its use of genuine strictness rather than absence information) from and the operational approach of this paper is via Burn’s notion of an evaluator =-=[Bur91]-=-. An evaluator is an operational concept which provides a link from information provided by strictness analysis, to the operational semantics. In particular, strictness analysis (see, e.g. [BHA86]) wi... |

11 | Inverse image analysis generalises strictness analysis - Dybjer - 1991 |

9 |
Time Complexity of Programs in Type Theory
- Bjerner
- 1989
(Show Context)
Citation Context ... to parameterise the description of the cost of computing an expression by a description of the amount of the result that is needed by the context in which it appears. This approach is due to Bjerner =-=[Bje89]-=-, where a compositional theory for time analysis of the (primitive recursive) programs of Martin-Löf type-theory is developed. A characterisation of “need” (more accurately “not-need”) provided by a ... |

7 |
Static evaluation of functional programs
- Lindstrom
- 1986
(Show Context)
Citation Context ...roximation to its denotation. Their language of demands is too “precise” for our purposes. The language of demands which we use will be closer to that of, for example, Lindström’s lattice of demands =-=[Lin86]-=- or Dybjer’s formal opens [Dyb87], and our interpretation of demand, as in [Dyb87], will be closely related to strictness. The operational interpretation of demand as an evaluator is in turn reminisce... |

7 | Complexity analysis for higher order language - Sands - 1988 |

6 |
Inverse image analysis
- Dybjer
- 1987
(Show Context)
Citation Context ...eir language of demands is too "precise" for our purposes. The language of demands which we use will be closer to that of, for example, Lindstrom's lattice of demands [Lin86] or Dybjer's for=-=mal opens [Dyb87]-=-, and our interpretation of demand, as in [Dyb87], will be closely related to strictness. The operational interpretation of demand as an evaluator is in turn reminiscent to Bjerner's definition of com... |

5 | Total Correctness and Improvement in the Transformation of Functional Programs - Sands - 1994 |