Automated complexity analysis of Nuprl extracted programs

This paper describes the Automated Complexity Analysis Prototype (ACAp) system for automated complexity analysis of functional programs synthesized with the Nuprl proof development system. We define a simple abstract cost model for NUPRL's term language based on the current call-by-name evaluator. The framework uses abstract functions and abstract lists to facilitate reasoning about primitive recursive programs with first-order functions, lazy lists and a subclass of higher-order functions. The ACAp system automatically derives upper bounds on the time complexity of NUPRL extracts relative to a given profiling semantics. Analysis proceeds by abstract interpretation of the extract, where symbolic evaluation rules extend standard evaluation to terms with free variables. Symbolic evaluation of recursive programs generates systems of multi-variable difference equations, which are solved using the MATHEMATICA computer algebra system. The use of the system is exemplified by analyzing a proof extract that computes the maximum segment sum of a list and a functional program that determines the minimum of a list via sorting. For both results, we compare call-by-name to call-by-value evaluation.

[1]  A. Haller,et al.  Automatic Program Analysis , 1974 .

[2]  P. Martin-Löf An Intuitionistic Theory of Types: Predicative Part , 1975 .

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

[4]  David Gries,et al.  A Note on a Standard Strategy for Developing Loop Invariants and Loops , 1982, Sci. Comput. Program..

[5]  Thierry Coquand,et al.  Constructions: A Higher Order Proof System for Mechanizing Mathematics , 1985, European Conference on Computer Algebra.

[6]  Rance Cleaveland,et al.  Implementing mathematics with the Nuprl proof development system , 1986 .

[7]  Jacques Cohen,et al.  Automating program analysis , 1988, JACM.

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

[9]  Philip Wadler,et al.  Strictness analysis aids time analysis , 1988, POPL '88.

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

[11]  S. Holmström,et al.  A composition approach to time analysis of first order lazy functional programs , 1989, FPCA.

[12]  J. Michael Spivey,et al.  The Z notation - a reference manual , 1992, Prentice Hall International Series in Computer Science.

[13]  David Sands,et al.  Complexity Analysis for a Lazy Higher-Order Language , 1989, Functional Programming.

[14]  Jan Madey,et al.  The Z notation: A reference manual , 1990 .

[15]  Douglas R. Smith,et al.  KIDS: A Semiautomatic Program Development System , 1990, IEEE Trans. Software Eng..

[16]  D. Andrews The Vienna development method , 1990 .

[17]  Rodney J. Douglas KIDS: A Semi-Automatic Program Development System , 1990 .

[18]  Philippe Flajolet,et al.  Automatic Average-Case Analysis of Algorithm , 1991, Theor. Comput. Sci..

[19]  Natarajan Shankar,et al.  PVS: A Prototype Verification System , 1992, CADE.

[20]  Christine Paulin-Mohring,et al.  Synthesis of ML Programs in the System Coq , 1993, J. Symb. Comput..

[21]  M. Gordon,et al.  Introduction to HOL: a theorem proving environment for higher order logic , 1993 .

[22]  Lawrence Charles Paulson,et al.  Isabelle: A Generic Theorem Prover , 1994 .

[23]  David Sands,et al.  A Naïve Time Analysis and its Theory of Cost Equivalence , 1995, J. Log. Comput..

[24]  D. T. Kaplan,et al.  Finite-Difference Equations , 1995 .

[25]  Optimality and Inefficiency: What Isn't a Cost Model of the Lambda Calculus? , 1996, ICFP.

[26]  Harry G. Mairson,et al.  Optimality and inefficiency: what isn't a cost model of the lambda calculus? , 1996, ICFP '96.

[27]  Stephen Wolfram,et al.  The Mathematica Book , 1996 .

[28]  John Greiner,et al.  Semantics-Based Parallel Cost Models and Their Use in Provably Efficient Implementations , 1997 .

[29]  James L. Caldwell,et al.  Moving proofs-as-programs into practice , 1997, Proceedings 12th IEEE International Conference Automated Software Engineering.

[30]  A. Nogin Improving the Efficiency of Nuprl Proofs , 1997 .

[31]  Christoph Kreitz,et al.  Dead Code Elimination Through Type Inference , 1998 .

[32]  G. Plotkin,et al.  Proof, language, and interaction: essays in honour of Robin Milner , 2000 .

[33]  Automated Complexity Analysis of NuPRL Extracts , 2001 .