This Article 
   
 Share 
   
 Bibliographic References 
   
 Add to: 
 
Digg
Furl
Spurl
Blink
Simpy
Google
Del.icio.us
Y!MyWeb
 
 Search 
   
Automatic Accurate Cost-Bound Analysis for High-Level Languages
December 2001 (vol. 50 no. 12)
pp. 1295-1309

This paper describes a language-based approach for automatic and accurate cost-bound analysis. The approach consists of transformations for building cost-bound functions in the presence of partially known input structures, symbolic evaluation of the cost-bound function based on input size parameters, and optimizations to make the overall analysis efficient as well as accurate, all at the source-language level. The calculated cost bounds are expressed in terms of primitive cost parameters. These parameters can be obtained based on the language implementation or can be measured conservatively or approximately, yielding accurate, conservative, or approximate time or space bounds. We have implemented this approach and performed a number of experiments for analyzing Scheme programs. The results helped confirm the accuracy of the analysis.

[1] H. Abelson et al., “Revised Report on the Algorithmic Language Scheme,” Higher-Order and Symbolic Computation, vol. 11, no. 1, pp. 7-105, Aug. 1998.
[2] H. Abelson, G.J. Sussman, and J. Sussman, Structure and Interpretation of Computer Programs. MIT Press and McGraw-Hill, 1985.
[3] P. Altenbernd, “On the False Path Problem in Hard Real-Time Programs,” Proc. Eighth EuroMicro Workshop Real-Time Systems, pp. 102-107, June 1996.
[4] R. Arnold, F. Mueller, D. Whalley, and M. Harmon, “Bounding Worst-Case Instruction Cache Performance,” Proc. 15th IEEE Real-Time Systems Symp., pp. 172-181, Dec. 1994.
[5] Partial Evaluation and Mixed Computation, B. Bjørner, A.P. Ershov, and N.D. Jones, eds. Amsterdam: North-Holland, 1988.
[6] J. Blieberger, “Data-Flow Frameworks for Worst-Case Execution Time Analysis,” Real-Time Systems, to appear.
[7] J. Blieberger and R. Lieger, “Worst-Case Space and Time Complexity of Recursive Procedures,” Real-Time Systems, vol. 11, no. 2, pp. 115-144, 1996.
[8] Cadence Research Systems, Chez Scheme System Manual, revision 2.4, Cadence Research Systems, Bloomington, Ind., July 1994.
[9] D. R. Chase, M. Wegman, and F. K. Zadeck,“Analysis of pointers and structures,”inProc. SIGPLAN '90 Conf. Programming Languages Design and Implementation,June 1990, pp. 296–310;SIGPLAN Notices, vol. 25, no. 6.
[10] J. Cohen, “Computer-Assisted Microanalysis of Programs,” Comm. ACM, vol. 25, no. 1, pp. 724-733, Oct. 1982.
[11] R.K. Dybvig, The Scheme Programming Language. Englewood Cliffs, N.J.: Prentice Hall, 1987.
[12] J. Engblom, P. Altenbernd, and A. Ermedahl, “Facilitating Worst-Case Execution Time Analysis for Optimized Code,” Proc. 10th EuroMicro Workshop Real-Time Systems, June 1998.
[13] A. Ermedahl and J. Gustafsson, “Deriving Annotations for Tight Calculation of Execution Time,” Proc. Euro-Par '97, pp. 1298-1307, Aug. 1997.
[14] C. Ferdinand, F. Martin, and R. Wilhelm, “Applying Compiler Techniques to Cache Behavior Prediction,” Proc. ACM SIGPLAN 1997 Workshop Languages, Compilers, and Tools for Real-Time Systems, pp. 37-46, 1997.
[15] C. Ferdinand and R. Wilhelm, “Efficient and Precise Cache Behavior Prediction for Real-Time Systems,” Real-Time Systems, vol. 17, nos. 2-3, pp. 131-181, Nov. 1999.
[16] P. Flajolet, B. Salvy, and P. Zimmermann, “Lambda-Upsilon-Omega: An Assistant Algorithms Analyzer,” Applied Algebra, Algebraic Algorithms and Error-Correcting Codes, T. Mora, ed., pp. 201-212, July 1989.
[17] P. Flajolet, B. Salvy, and P. Zimmermann, “Automatic Average-Case Analysis of Algorithms,” Theoretical Computer Science, Series A, vol. 79, no. 1, pp. 37-109, Feb. 1991.
[18] Y. Futamura and K. Nogi, “Generalized Partial Evaluation,” Partial Evaluation and Mixed Computation, B. Bjørner, A.P. Ershov, and N.D. Jones, eds., pp. 133-151, Amsterdam: North-Holland, 1988.
[19] J. Gustafsson and A. Ermedahl, “Automatic Derivation of Path and Loop Annotations in Object-Oriented Real-Time Programs,” J. Parallel and Distributed Computing Practices, vol. 1, no. 2, June 1998.
[20] M.G. Harmon, T.P. Baker, and D.B. Whalley, “A Retargetable Technique for Predicting Execution Time,” Proc. 11th IEEE Real-Time Systems Symp., pp. 68-77, Dec. 1992.
[21] C.A. Healy, M. Sjödin, V. Rustagi, and D.B. Whalley, “Bounding Loop Iterations for Timing Analysis,” Proc. IEEE Real-Time Technology and Applications Symp., pp. 12-21, June 1998.
[22] L.J. Hendren, J. Hummel, and A. Nicolau, “Abstractions for Recursive Pointer Data Structures: Improving the Analysis and Transformation of Imperative programs,” Proc. SIGPLAN '92 Conf. Programming Language Design and Implementation, pp. 249–260, June 1992.
[23] N.D. Jones, “An Introduction to Partial Evaluation,” ACM Computing Surveys, vol. 28, no. 3, pp. 480–503, Sept. 1996.
[24] N.D. Jones, C. Gomard, and P. Sestoft, Partial Evaluation and Automatic Program Generation, Int'l Series in Computer Science, Englewood Cliffs, N.J.: Prentice Hall, June 1993.
[25] D.E. Knuth, The Art of Computer Programming, vol. 1,Addison Wesley, second ed. 1973.
[26] D. Le Métayer, “Ace: An Automatic Complexity Evaluator,” ACM Trans. Programing Languages and Systems, vol. 10, no. 2, pp. 248-266, Apr. 1988.
[27] C.S. Lee, N.D. Jones, and A.M. Ben-Amram, “The Size-Change Principle for Program Termination,” Conf. Record 28th Ann. ACM Symp. Principles of Programming Languages, Jan. 2001.
[28] S.-S. Lim et al., "An Accurate Worst Case Timing Analysis for RISC Processors," IEEE Trans. Software Eng., Vol. 21, No. 7, July 1995, pp. 593-604.
[29] Y.A. Liu, “Efficiency by Incrementalization: An Introduction,” Higher-Order and Symbolic Computation, vol. 13, no. 4, pp. 289-313, Dec. 2000.
[30] Y.A. Liu and G. Gómez, “Automatic Accurate Time-Bound Analysis for High-Level Languages,” Proc. ACM SIGPLAN 1998 Workshop Languages, Compilers, and Tools for Embedded Systems, pp. 31-40, June 1998.
[31] Y.A. Liu, S.D. Stoller, and T. Teitelbaum, “Static Caching for Incremental Computation,” ACM Trans. Programming Languages and Systems, vol. 20, no. 3, pp. 546-585, May 1998.
[32] Y.A. Liu and T. Teitelbaum, “Systematic Derivation of Incremental Programs,” Scientific Computer Programming, vol. 24, no. 1, pp. 1-39, Feb. 1995.
[33] T. Lundqvist and P. Stenström, “Integrating Path and Timing Analysis Using Instruction-Level Simulation Techniques,” Proc. ACM SIGPLAN 1998 Workshop Languages, Compilers, and Tools for Embedded Systems, pp. 1-15, June 1998.
[34] T. Lundqvist and P. Stenström, “An Integrated Path and Timing Analysis Method Based on Cycle-Level Symbolic Execution,” Real-Time Systems, vol. 17, nos. 2-3, pp. 183-207, Nov. 1999.
[35] R. Milner, M. Tofte, and R. Harper, The Definition of Standard ML. MIT Press, 1990.
[36] C. Park, "Predicting Program Execution Times by Analyzing Static and Dynamic Program Paths," J. Real-Time Systems, vol. 5, no. 1, pp. 31-62, Mar. 1993.
[37] C.Y. Park and A.C. Shaw, "Experiments With a Program Timing Tool Based on Source-Level Timing Schema," Computer, pp. 48-57, May 1991.
[38] P. Persson, “Live Memory Analysis for Garbage Collection in Embedded Systems,” Proc. ACM SIGPLAN 1999 Workshop Languages, Compilers, and Tools for Embedded Systems, pp. 45-54, May 1999.
[39] P.P. Puschner and A.V. Schedl, “Computing Maximum Task Execution Times—A Graph-Based Approach,” Real-Time Systems, vol. 13, no. 1, pp. 67-91, 1997.
[40] T. Reps and T. Teitelbaum, The Synthesizer Generator: A System for Constructing Language-Based Editors. New York: Springer-Verlag, 1988.
[41] M. Rosendahl, “Automatic Complexity Analysis,” Proc. Fourth Int'l Conf. Functional Programming Languages and Computer Architecture, pp. 144-156, Sept. 1989.
[42] R.H. Saavedra and A.J. Smith,"Analysis of Benchmark Characteristics and Benchmark Performance Prediction," ACM Trans. Computer Systems, vol. 14, no. 4, 1996, pp. 344-384.
[43] R.H. Saavedra-Barrera, A.J. Smith, and E. Miya, “Machine Characterization Based on an Abstract High-Level Language Machine,” IEEE Trans. Computers, vol. 38, no. 12, pp. 1,659-1,679, Dec. 1989.
[44] D. Sands, “Complexity Analysis for a Lazy Higher-Order Language,” Proc. Third European Symp. Programming, N.D. Jones, ed., pp. 361-376, May 1990.
[45] W.L. Scherlis, “Program Improvement by Internal Specialization,” Conf. Record Eighth Ann. ACM Symp. Principles of Programming Languages, pp. 41-49, Jan. 1981.
[46] A.C. Shaw, "Reasoning About Time in Higher-Level Language Software," IEEE Trans. Software Eng., vol. 15, no. 7, pp. 875-889, 1989.
[47] V.F. Turchin, “The Concept of a Supercompiler,” ACM Trans. Programming Languages and Systems, vol. 8, no. 3, pp. 292-325, July 1986.
[48] L. Unnikrishnan, S.D. Stoller, and Y.A. Liu, “Automatic Accurate Live Memory Analysis for Garbage-Collected Languages,” Proc. ACM SIGPLAN 2001 Workshop Languages, Compilers, and Tools for Embedded Systems, June 2001.
[49] P. Wadler, “Strictness Analysis Aids Time Analysis,” Conf. Record 15th Ann. ACM Symp. Principles of Programming Languages, Jan. 1988.
[50] B. Wegbreit, “Mechanical Program Analysis,” Comm. ACM, vol. 18, no. 9, pp. 528-538, Sept. 1975.
[51] B. Wegbreit, “Goal-Directed Program Transformation,” IEEE Trans. Software Eng., vol. 2, no. 2, pp. 69-80, June 1976.
[52] D. Weise, R.F. Crew, M. Ernst, and B. Steensgaard, “Value Dependence Graphs: Representation without Taxation,” Conf. Record 21st Ann. ACM Symp. Principles of Programming Languages, Jan. 1994.
[53] P. Zimmermann and W. Zimmermann, “The Automatic Complexity Analysis of Divide-and-Conquer Algorithms,” Computer and Information Sciences VI, Elsevier, 1991.

Index Terms:
Cost analysis, cost bound, performance analysis and measurements, program analysis and transformation, program optimization, timing analysis, time analysis, space analysis, worst-case execution time.
Citation:
Y.A. Liu, G. Gómez, "Automatic Accurate Cost-Bound Analysis for High-Level Languages," IEEE Transactions on Computers, vol. 50, no. 12, pp. 1295-1309, Dec. 2001, doi:10.1109/TC.2001.970569
Usage of this product signifies your acceptance of the Terms of Use.