Automatic time-bound analysis for high-level languages

Analysis of program running time is important for reactive systems, interactive environments, compiler optimizations, performance evaluation, and many other computer applications. Automatic and efficient prediction of accurate time bounds is particularly important, and being able to do so for high-level languages is particularly desirable. This dissertation presents a general approach for automatic and accurate time-bound analysis for high-level languages, combining methods and techniques studied in theory, languages, and systems. The approach consists of transformations for building time-bound functions in the presence of partially known input structures, symbolic evaluation of the time-bound function based on input parameters, optimizations to make the analysis efficient as well as accurate, and measurements of primitive parameters, all at the source-language level. We describe analysis and transformation algorithms and explain how they work. We have implemented this approach and performed a large number of experiments analyzing Scheme programs. The measured worst-case times are closely bounded by the calculated bounds. We describe our prototype system, ALPA, as well as the analysis and measurement results.

[1]  Richard J. Lipton,et al.  Social processes and proofs of theorems and programs , 1979, CACM.

[2]  Yanhong A. Liu,et al.  Automatic Accurate Live Memory Analysis for Garbage-Collected Languages , 2001, OM '01.

[3]  Andy J. Wellings,et al.  Deriving Java Virtual Machine Timing Models for Portable Worst-Case Execution Time Analysis , 2003, OTM Workshops.

[4]  Bernd Grobauer,et al.  Cost recurrences for DML programs , 2001, ICFP '01.

[5]  Yanhong A. Liu,et al.  Systematic Derivation of Incremental Programs , 1995, Sci. Comput. Program..

[6]  J Gregory,et al.  Reening First-class Stores , 1993 .

[7]  R. Kent Dybvig,et al.  Revised5 Report on the Algorithmic Language Scheme , 1986, SIGP.

[8]  Lars-Olof Burchard,et al.  Estimating decoding times of MPEG-2 video streams , 2000, Proceedings 2000 International Conference on Image Processing (Cat. No.00CH37101).

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

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

[11]  David B. Whalley,et al.  Bounding worst-case instruction cache performance , 1994, 1994 Proceedings Real-Time Systems Symposium.

[12]  Donald Ervin Knuth,et al.  The Art of Computer Programming , 1968 .

[13]  Yanhong A. Liu,et al.  Automatic Accurate Stack Space and Heap Space Analysis for High-Level Languages , 2000 .

[14]  Jakob Engblom,et al.  Clustered calculation of worst-case execution times , 2003, CASES '03.

[15]  Richard P. Gabriel,et al.  Performance and evaluation of Lisp systems , 1985 .

[16]  M. D. MacLaren The Art of Computer Programming—Volume 1: Fundamental Algorithms (Donald E. Knuth) , 1969 .

[17]  William L. Scherlis,et al.  Program improvement by internal specialization , 1981, POPL '81.

[18]  Björn Lisper,et al.  Fully Automatic, Parametric Worst-Case Execution Time Analysis , 2003, WCET.

[19]  Mark N. Wegman,et al.  Analysis of pointers and structures , 1990, SIGP.

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

[21]  David K. Gifford,et al.  Static dependent costs for estimating execution time , 1994, LFP '94.

[22]  Yanhong A. Liu,et al.  Static caching for incremental computation , 1998, TOPL.

[23]  R. J. M. Hughes,et al.  Design and Implementation of Programming Languages , 1977, Lecture Notes in Computer Science.

[24]  Somnath Ghosh,et al.  Cache Miss Equations: Compiler Analysis Framework for Tuning Memory Behavior , 2001, PPSC.

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

[26]  Robin Milner,et al.  Definition of standard ML , 1990 .

[27]  Thomas R. Gross,et al.  Approximation of Worst-Case Execution Time for Preemptive Multitasking Systems , 2000, LCTES.

[28]  Simon L. Peyton Jones,et al.  The Implementation of Functional Programming Languages , 1987 .

[29]  Sang Lyul Min,et al.  An Accurate Worst Case Timing Analysis for RISC Processors , 1995, IEEE Trans. Software Eng..

[30]  Stefan M. Petters,et al.  Making worst case execution time analysis for hard real-time tasks on state of the art processors feasible , 1999, Proceedings Sixth International Conference on Real-Time Computing Systems and Applications. RTCSA'99 (Cat. No.PR00306).

[31]  Jacques Cohen,et al.  Computer-assisted microanalysis of programs , 1982, CACM.

[32]  Per Stenström,et al.  Integrating Path and Timing Analysis Using Instruction-Level Simulation Techniques , 1998, LCTES.

[33]  Raimund Kirner,et al.  Timing analysis of optimised code , 2003 .

[34]  Jan Gustafsson Worst case execution time analysis of object-oriented programs , 2002, Proceedings of the Seventh IEEE International Workshop on Object-Oriented Real-Time Dependable Systems. (WORDS 2002).

[35]  Yanhong A. Liu,et al.  Automatic Accurate Time-Bound Analysis for High-Level Languages , 1998, LCTES.

[36]  Wei-Ngan Chin,et al.  Calculating Sized Types , 1999, PEPM '00.

[37]  Michael D. Ernst,et al.  Value dependence graphs: representation without taxation , 1994, POPL '94.

[38]  Chang Yun Park,et al.  Predicting program execution times by analyzing static and dynamic program paths , 1993, Real-Time Systems.

[39]  Jan Gustafsson,et al.  Automatic Derivation of Path and Loop Annotations in Object-Oriented Real-Time Programs , 1998, Scalable Comput. Pract. Exp..

[40]  Friedhelm Stappert,et al.  Worst-case execution times analysis of MPEG-2 decoding , 2000, Proceedings 12th Euromicro Conference on Real-Time Systems. Euromicro RTS 2000.

[41]  David B. Whalley,et al.  Parametric Timing Analysis , 2001, OM '01.

[42]  Gregory F. Johnson,et al.  Stores and partial continuations as first-class objects in a language and its environment , 1988, POPL '88.

[43]  Peter Altenbernd,et al.  On the false path problem in hard real-time programs , 1996, Proceedings of the Eighth Euromicro Workshop on Real-Time Systems.

[44]  Yanhong A. Liu,et al.  Optimized Live Heap Bound Analysis , 2002, VMCAI.

[45]  Amr Sabry,et al.  Proving the correctness of reactive systems using sized types , 1996, POPL '96.

[46]  Jan Gustafsson,et al.  A tool for automatic flow analysis of C-programs for WCET calculation , 2003, Proceedings of the Eighth International Workshop on Object-Oriented Real-Time Dependable Systems, 2003. (WORDS 2003)..

[47]  Alexandru Nicolau,et al.  Abstractions for recursive pointer data structures: improving the analysis and transformation of imperative programs , 1992, PLDI '92.

[48]  Alan C. Shaw,et al.  Reasoning About Time in Higher-Level Language Software , 1989, IEEE Trans. Software Eng..

[49]  Martin Hofmann,et al.  Static prediction of heap space usage for first-order functional programs , 2003, POPL '03.

[50]  Valentin F. Turchin,et al.  The concept of a supercompiler , 1986, TOPL.

[51]  M.N. Sastry,et al.  Structure and interpretation of computer programs , 1986, Proceedings of the IEEE.

[52]  Yanhong A. Liu,et al.  Automatic Accurate Cost-Bound Analysis for High-Level Languages , 2001, IEEE Trans. Computers.

[53]  Guillem Bernat,et al.  pWCET: a Tool for Probabilistic Worst-Case Execution Time Analysis of Real-Time Systems , 2003 .

[54]  Jakob Engblom,et al.  Facilitating worst-case execution times analysis for optimized code , 1998, Proceeding. 10th EUROMICRO Workshop on Real-Time Systems (Cat. No.98EX168).

[55]  Michele Bugliesi,et al.  A Calculus of Bounded Capacities , 2003, ASIAN.

[56]  Jonathan Rees,et al.  Revised3 report on the algorithmic language scheme , 1986, SIGP.

[57]  William C. Kreahling,et al.  Improving WCET by optimizing worst-case paths , 2005, 11th IEEE Real Time and Embedded Technology and Applications Symposium.

[58]  Jan Gustafsson Analyzing execution-time of object-oriented programs using abstract interpretation , 2000 .

[59]  Jakob Engblom,et al.  Analysis of the execution time unpredictability caused by dynamic branch prediction , 2003, The 9th IEEE Real-Time and Embedded Technology and Applications Symposium, 2003. Proceedings..

[60]  Dines Bjørner,et al.  Partial Evaluation and Mixed Computation , 1987 .

[61]  Thomas Reps,et al.  The Synthesizer Generator: A System for Constructing Language-Based Editors , 1988 .

[62]  John Hughes,et al.  Recursion and dynamic data-structures in bounded space: towards embedded ML programming , 1999, ICFP '99.

[63]  Patrick Cousot,et al.  Abstract interpretation: a unified lattice model for static analysis of programs by construction or approximation of fixpoints , 1977, POPL.

[64]  Robert Hieb,et al.  Destination-Driven Code Generation , 1990 .

[65]  R. Kent Dybvig,et al.  The Scheme Programming Language , 1995 .

[66]  Klaus Schneider,et al.  Exact high level WCET analysis of synchronous programs by symbolic state space exploration , 2003, 2003 Design, Automation and Test in Europe Conference and Exhibition.

[67]  Alan Jay Smith,et al.  Machine Characterization Based on an Abstract High-Level Language Machine , 1989, IEEE Trans. Computers.

[68]  David B. Whalley,et al.  Supporting Timing Analysis by Automatic Bounding of Loop Iterations , 2000, Real-Time Systems.

[69]  Alan Jay Smith,et al.  Analysis of benchmark characteristics and benchmark performance prediction , 1996, TOCS.

[70]  Karl Crary,et al.  Resource bound certification , 2000, POPL '00.

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

[72]  David B. Whalley,et al.  Timing analysis for sensor network nodes of the Atmega processor family , 2005, 11th IEEE Real Time and Embedded Technology and Applications Symposium.

[73]  Ben Wegbreit Goal-Directed Program Transformation , 1976, IEEE Trans. Software Eng..

[74]  Peter Sestoft,et al.  Partial evaluation and automatic program generation , 1993, Prentice Hall international series in computer science.

[75]  Heinz Schmidt,et al.  A Complexity Calculus for Object-Oriented Programs , 1994 .

[76]  StatePeter Thiemann Partial Evaluation for Higher-Order Languages with , 1996 .

[77]  Robert E. Tarjan,et al.  Making data structures persistent , 1986, STOC '86.

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

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

[80]  Jakob Engblom,et al.  Efficient longest executable path search for programs with complex flows and pipeline effects , 2001, CASES '01.

[81]  Frank Mueller,et al.  Bounding worst-case data cache behavior by analytically deriving cache reference patterns , 2005, 11th IEEE Real Time and Embedded Technology and Applications Symposium.

[82]  Thomas R. Gross,et al.  Approximation of the worst-case execution time using structural analysis , 2004, EMSOFT '04.

[83]  David B. Whalley,et al.  A retargetable technique for predicting execution time , 1992, [1992] Proceedings Real-Time Systems Symposium.

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

[85]  Michael Ditze,et al.  Improving Resource Utilization for MPEG-4 Decoding in Embedded End-Devices , 2004, ACSC.

[86]  David B. Whalley,et al.  Bounding loop iterations for timing analysis , 1998, Proceedings. Fourth IEEE Real-Time Technology and Applications Symposium (Cat. No.98TB100245).

[87]  Yanhong A. Liu,et al.  Automatic time-bound analysis for a higher-order language , 2002, PEPM '02.

[88]  Thomas Johnsson,et al.  Lambda Lifting: Treansforming Programs to Recursive Equations , 1985, FPCA.

[89]  Jan Gustafsson,et al.  Deriving Annotations for Tight Calculation of Execution Time , 1997, Euro-Par.

[90]  Michael J. C. Gordon,et al.  The denotational description of programming languages - an introduction , 1979 .

[91]  Santosh Pande,et al.  Compact and efficient code generation through program restructuringon limited memory embedded DSPs , 2001, IEEE Trans. Comput. Aided Des. Integr. Circuits Syst..

[92]  Reinhard Wilhelm,et al.  Applying Compiler Techniques to Cache Behavior Prediction , 2007 .

[93]  Jan Gustafsson Eliminating annotations by automatic flow analysis of real-time programs , 2000, Proceedings Seventh International Conference on Real-Time Computing Systems and Applications.

[94]  Hans-Wolfgang Loidl,et al.  Cost Analysis Using Automatic Size and Time Inference , 2002, IFL.

[95]  Alan C. Shaw,et al.  Experiments with a program timing tool based on source-level timing schema , 1990, [1990] Proceedings 11th Real-Time Systems Symposium.

[96]  G. Goos Applied Algebra, Algebraic Algorithms and Error-Correcting Codes , 2003, Lecture Notes in Computer Science.

[97]  Hans A. Hansson,et al.  Using measurements to derive the worst-case execution time , 2000, Proceedings Seventh International Conference on Real-Time Computing Systems and Applications.