Projects per year
Abstract
We present a static analysis for determining the execution costs of lazily evaluated functional languages, such as Haskell. Time- and space-behaviour of lazy functional languages can be hard to predict, creating a significant barrier to their broader acceptance. This paper applies a type-based analysis employing amortisation and cost effects to statically determine upper bounds on evaluation costs. While amortisation performs well with finite recursive data, we significantly improve the precision of our analysis for co-recursive programs (i.e. dealing with potentially infinite data structures) by tracking self-references. Combining these two approaches gives a fully automatic static analysis for both recursive and co-recursive definitions. The analysis is formally proven correct against an operational semantic that features an exchangeable parametric cost-model. An arbitrary measure can be assigned to all syntactic constructs, allowing to bound, for example, evaluation steps, applications, allocations, etc. Moreover, automatic inference only relies on first-order unification and standard linear programming solving. Our publicly available implementation demonstrates the practicability of our technique on editable non-trivial examples.
Original language | English |
---|---|
Pages (from-to) | 87-120 |
Number of pages | 34 |
Journal | Journal of Automated Reasoning |
Volume | 59 |
Issue number | 1 |
Early online date | 6 Jan 2017 |
DOIs | |
Publication status | Published - Jun 2017 |
Keywords
- Automated static analysis
- Lazy evaluation
- Corecursion
- Amortised analysis
- Type systems
- Functional programming
Fingerprint
Dive into the research topics of 'Type-based cost analysis for lazy functional languages'. Together they form a unique fingerprint.Projects
- 2 Finished
-
Discovery: Pattern Discovery and Program: Discovery: Pattern Discovery and Program Shaping for Manycore Systems
Thomson, J. D. (PI), Hammond, K. (CoI) & Sarkar, S. (CoI)
1/07/17 → 31/12/20
Project: Standard
-
H2020 Collaboration REPHRASE: H2020 Collaboration 2014 - RePhrase
Hammond, K. (PI)
1/04/15 → 31/03/18
Project: Standard
Datasets
-
Type-based cost analysis for lazy functional languages (dataset)
Jost, S. (Creator), Vasconcelos, P. (Creator), Florido, M. (Creator) & Hammond, K. (Creator), Universidade do Porto, 6 Jan 2017
http://kashmir.dcc.fc.up.pt/cgi/lazy.cgi
Dataset