Skip to content

Research at St Andrews

Type-based cost analysis for lazy functional languages

Research output: Contribution to journalArticle

Author(s)

Steffen Jost, Pedro Vasconcelos, Mário Florido, Kevin Hammond

School/Research organisations

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 the first automatic static analysis for both recursive and co-recursive definitions. Furthermore, we generalize the analysis to determine cost bounds for an arbitrary measure assigned to syntactic constructs (e.g. evaluation steps, applications, allocations, etc.). Notably, automatic inference only relies on first-order unification and linear programming solving. Our publicly available implementation demonstrates the practicability of our technique on editable non-trivial examples.
Close

Details

Original languageEnglish
Pages (from-to)87-120
Number of pages34
JournalJournal of Automated Reasoning
Volume59
Issue number1
Early online date6 Jan 2017
DOIs
StatePublished - Jun 2017

    Research areas

  • Automated static analysis, Lazy evaluation, Corecursion, Amortised analysis, Type systems, Functional programming

Discover related content
Find related publications, people, projects and more using interactive charts.

View graph of relations

Related by author

  1. Automatically deriving cost models for structured parallel processes using hylomorphisms

    Castro, D., Hammond, K., Sarkar, S. & Alguwaifli, Y. Feb 2018 In : Future Generation Computer Systems. 79, Part 2, p. 653-668

    Research output: Contribution to journalArticle

  2. The Missing Link! A new skeleton for evolutionary multi-agent systems in Erlang

    Stypka, J., Turek, W., Byrski, A., Kisiel-Dorohinicki, M., Barwell, A. D., Brown, C. M., Hammond, K. & Janjic, V. Feb 2018 In : International Journal of Parallel Programming. 46, 1, p. 4-22 19 p.

    Research output: Contribution to journalArticle

  3. Proof-relevant Horn clauses for dependent type inference and term synthesis

    Farka, F., Komendantskya, E. & Hammond, K. 2018 In : Theory and Practice of Logic Programming. 18, 3-4, p. 484-501

    Research output: Contribution to journalArticle

  4. Coinductive soundness of corecursive type class resolution

    Farka, F., Komendantskaya, E. & Hammond, K. 2017 Logic-Based Program Synthesis and Transformation: 26th International Symposium, LOPSTR 2016, Edinburgh, Scotland, UK, September 6-8, 2016. Revised Selected Papers. Hermenegildo, M. V. & Lopez-Garcia, P. (eds.). Cham: Springer, p. 311-327 (Lecture Notes in Computer Science (Theoretical Computer Science and General Issues); vol. 10184)

    Research output: Chapter in Book/Report/Conference proceedingConference contribution

Related by journal

  1. Satisfiability in the year 2000

    Gent, I. P. & Walsh, T. Feb 2002 In : Journal of Automated Reasoning. 28, 2, p. 99-99 1 p.

    Research output: Contribution to journalEditorial

  2. Satisfiability in the Year 2000

    Gent, I. P. & Walsh, T. Feb 2000 In : Journal of Automated Reasoning. 24, 1-2, p. 1-3 3 p.

    Research output: Contribution to journalEditorial

  3. Some Group Theoretic Examples with Completion Theorem Provers

    Linton, S. A. & Shand, DD. Oct 1996 In : Journal of Automated Reasoning. 17, 2, p. 145-169 25 p.

    Research output: Contribution to journalArticle

  4. Unification in Boolean Rings

    Martin, U. H. M. & Nipkow, T. 1988 In : Journal of Automated Reasoning. 4, p. 381-396

    Research output: Contribution to journalArticle

ID: 244421291