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
Publication statusPublished - 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 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