Abstract This paper presents a type-based analysis for inferring sizeand 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 cost equations for a subset of recursive programs whose costs can be expressed using primitive recursion. We illustrate the approach with reference to some standard examples of recursive programs.
Pedro B. Vasconcelos, Kevin Hammond