A static cost analysis for a higher-order language

We develop a static complexity analysis for a higher-order functional language with structural list recursion. The complexity of an expression is a pair consisting of a cost and a potential. The former is defined to be the size of the expression's evaluation derivation in a standard big-step operational semantics. The latter is a measure of the "future" cost of using the value of that expression. A translation function {.} maps target expressions to complexities. Our main result is the following Soundness Theorem: If {t} is a term in the target language, then the cost component of {t} is an upper bound on the cost of evaluating t. The proof of the Soundness Theorem is formalized in Coq, providing certified upper bounds on the cost of any expression in the target language.

[1]  Daniel Le Métayer,et al.  ACE: an automatic complexity evaluator , 1988, TOPL.

[2]  Jonathan C. Shultis On the Complexity of Higher-Order Programs ; CU-CS-288-85 , 1985 .

[3]  Ralph Benzinger,et al.  Automated higher-order complexity analysis , 2004, Theor. Comput. Sci..

[4]  Elvira Albert,et al.  Closed-Form Upper Bounds in Static Cost Analysis , 2011, Journal of Automated Reasoning.

[5]  Paul Blain Levy,et al.  Call-by-Push-Value: A Subsuming Paradigm , 1999, TLCA.

[6]  Martin Hofmann,et al.  Static determination of quantitative resource usage for higher-order programs , 2010, POPL '10.

[7]  Hervé Grall,et al.  Coinductive big-step operational semantics , 2009, Inf. Comput..

[8]  John W. Backus,et al.  Can programming be liberated from the von Neumann style?: a functional style and its algebra of programs , 1978, CACM.

[9]  John C. Mitchell,et al.  Foundations for programming languages , 1996, Foundation of computing series.

[10]  David Sands,et al.  Calculi for time analysis of functional programs , 1990 .

[11]  James S. Royer,et al.  Two Algorithms in Search of a Type-System , 2009, Theory of Computing Systems.

[12]  Nils Anders Danielsson Lightweight semiformal time complexity analysis for purely functional data structures , 2008, POPL '08.

[13]  Ben Wegbreit,et al.  Mechanical program analysis , 1975, CACM.

[14]  Arthur Charguéraud Program verification through characteristic formulae , 2010, ICFP '10.

[15]  Martin Hofmann,et al.  Amortized Resource Analysis with Polynomial Potential , 2010, ESOP.

[16]  Peter Claussen Theories of programming languages , 2000, SOEN.

[17]  Nick Benton,et al.  Some Domain Theory and Denotational Semantics in Coq , 2009, TPHOLs.

[18]  Elvira Albert,et al.  Cost Analysis of Java Bytecode , 2007, ESOP.

[19]  Christine Paulin-Mohring A constructive denotational semantics for Kahn networks in Coq , 2009 .

[20]  Stephen Brookes,et al.  A denotational approach to measuring complexity in functional programs , 2003 .

[21]  Mads Rosendahl,et al.  Automatic complexity analysis , 1989, FPCA.