Chapter

Implementation of Functional Languages

Volume 3145 of the series Lecture Notes in Computer Science pp 86-101

Inferring Cost Equations for Recursive, Polymorphic and Higher-Order Functional Programs

  • Pedro B. VasconcelosAffiliated withSchool of Computer Science, University of St Andrews
  • , Kevin HammondAffiliated withSchool of Computer Science, University of St Andrews

* Final gross prices may vary according to local VAT.

Get Access

Abstract

This paper presents a type-based analysis for inferring size- and cost-equations for recursive, higher-order and polymorphic functional programs without requiring user annotations or unusual syntax. Our type reconstruction algorithm is capable of inferring first-order cost equations for a non-trivial subset of higher-order, recursive and polymorphic functions. We illustrate the approach with reference to some standard examples of recursive programs.