Skip to main content

Resource Usage Analysis and Its Application to Resource Certification

  • Chapter
Book cover Foundations of Security Analysis and Design V (FOSAD 2009, FOSAD 2007, FOSAD 2008)

Abstract

Resource usage is one of the most important characteristics of programs. Automatically generated information about resource usage can be used in multiple ways, both during program development and deployment. In this paper we discuss and present examples on how such information is obtained in COSTA, a state of the art static analysis system. COSTA obtains safe symbolic upper bounds on the resource usage of a large class of general-purpose programs written in a mainstream programming language such as Java (bytecode). We also discuss the application of resource-usage information for code certification, whereby code not guaranteed to run within certain user-specified bounds is rejected.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 49.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. The Timber Language, http://www.timber-lang.org

  2. Aho, A.V., Sethi, R., Ullman, J.D.: Compilers – Principles, Techniques and Tools. Addison-Wesley, Reading (1986)

    MATH  Google Scholar 

  3. Albert, E., Arenas, P., Codish, M., Genaim, S., Puebla, G., Zanardini, D.: Termination analysis of java bytecode. In: Barthe, G., de Boer, F.S. (eds.) FMOODS 2008. LNCS, vol. 5051, pp. 2–18. Springer, Heidelberg (2008)

    Chapter  Google Scholar 

  4. Albert, E., Arenas, P., Genaim, S., Puebla, G.: Dealing with numeric fields in termination analysis of java-like languages. In: Huisman, M. (ed.) 10th Workshop on Formal Techniques for Java-like Programs (July 2008)

    Google Scholar 

  5. Albert, E., Arenas, P., Genaim, S., Puebla, G., Zanardini, D.: The COSTA System web site, http://costa.ls.fi.upm.es

  6. Albert, E., Arenas, P., Genaim, S., Puebla, G., Zanardini, D.: Cost analysis of java bytecode. In: De Nicola, R. (ed.) ESOP 2007. LNCS, vol. 4421, pp. 157–172. Springer, Heidelberg (2007)

    Chapter  Google Scholar 

  7. Albert, E., Puebla, G., Hermenegildo, M.: Abstraction-Carrying Code: A Model for Mobile Code Safety. New Generation Computing 26(2), 171–204 (2008)

    Article  MATH  Google Scholar 

  8. Albert, E., Arenas, P., Genaim, S., Puebla, G.: Automatic inference of upper bounds for recurrence relations in cost analysis. In: Alpuente, M., Vidal, G. (eds.) SAS 2008. LNCS, vol. 5079, pp. 221–237. Springer, Heidelberg (2008)

    Chapter  Google Scholar 

  9. Aspinall, D., Gilmore, S., Hofmann, M.O., Sannella, D., Stark, I.: Mobile resource guarantees for smart devices. In: Barthe, G., Burdy, L., Huisman, M., Lanet, J.-L., Muntean, T. (eds.) CASSIS 2004. LNCS, vol. 3362, pp. 1–26. Springer, Heidelberg (2005)

    Chapter  Google Scholar 

  10. Bagnara, R., Pescetti, A., Zaccagnini, A., Zaffanella, E.: PURRS: Towards computer algebra support for fully automatic worst-case complexity analysis. Technical report (2005) arXiv:cs/0512056, http://arxiv.org/

  11. Bartoletti, M., Degano, P., Ferrari, G.-L., Zunino, R.: Types and effects for resource usage analysis. In: Seidl, H. (ed.) FOSSACS 2007. LNCS, vol. 4423, pp. 32–47. Springer, Heidelberg (2007)

    Chapter  Google Scholar 

  12. Ben-Amram, A.M., Jones, N.D., Kristiansen, L.: Linear, polynomial or exponential? Complexity inference in polynomial time. In: Beckmann, A., Dimitracopoulos, C., Löwe, B. (eds.) CiE 2008. LNCS, vol. 5028, pp. 67–76. Springer, Heidelberg (2008)

    Chapter  Google Scholar 

  13. Benoy, F., King, A.: Inferring Argument Size Relationships with CLP(R). In: Gallagher, J.P. (ed.) LOPSTR 1996. LNCS, vol. 1207, pp. 204–223. Springer, Heidelberg (1997)

    Chapter  Google Scholar 

  14. Benzinger, R.: Automated Higher-Order Complexity Analysis. Theor. Comput. Sci. 318(1-2) (2004)

    Google Scholar 

  15. Bjerner, B., Holmstrom, S.: A Compositional Approach to Time Analysis of First Order Lazy Functional Programs. In: Proc. ACM Functional Programming Languages and Computer Architecture, pp. 157–165. ACM Press, New York (1989)

    Google Scholar 

  16. Braberman, V., Fernández, F., Garbervetsky, D., Yovine, S.: Parametric Prediction of Heap Memory Requirements. In: Proceedings of the International Symposium on Memory management (ISMM). ACM, New York (2008)

    Google Scholar 

  17. Cachera, D., Jensen, T., Pichardie, D., Schneider, G.: Certified memory usage analysis. In: Fitzgerald, J.S., Hayes, I.J., Tarlecki, A. (eds.) FM 2005. LNCS, vol. 3582, pp. 91–106. Springer, Heidelberg (2005)

    Chapter  Google Scholar 

  18. Chander, A., Espinosa, D., Islam, N., Lee, P., Necula, G.C.: Enforcing resource bounds via static verification of dynamic checks. In: Sagiv, M. (ed.) ESOP 2005. LNCS, vol. 3444, pp. 311–325. Springer, Heidelberg (2005)

    Chapter  Google Scholar 

  19. Chin, W.-N., Nguyen, H.H., Popeea, C., Qin, S.: Analysing Memory Resource Bounds for Low-Level Programs. In: Proceedings of the International Symposium on Memory management (ISMM). ACM, New York (2008)

    Google Scholar 

  20. Cousot, P., Cousot, R.: Abstract Interpretation: a Unified Lattice Model for Static Analysis of Programs by Construction or Approximation of Fixpoints. In: Fourth ACM Symposium on Principles of Programming Languages, pp. 238–252 (1977)

    Google Scholar 

  21. Crary, K., Weirich, S.: Resource Bound Certification. In: POPL 2000, pp. 184–198. ACM Press, New York (2000)

    Google Scholar 

  22. Debray, S.K., Lin, N.W.: Cost Analysis of Logic Programs. ACM Transactions on Programming Languages and Systems 15(5), 826–875 (1993)

    Article  Google Scholar 

  23. Eisinger, J., Polian, I., Becker, B., Metzner, A., Thesing, S., Wilhelm, R.: Automatic identification of timing anomalies for cycle-accurate worst-case execution time analysis. In: Proceedings of IEEE Workshop on Design & Diagnostics of Electronic Circuits & Systems (DDECS), pp. 15–20. IEEE Computer Society, Los Alamitos (2006)

    Google Scholar 

  24. Gulavani, B.S., Gulwani, S.: A numerical abstract domain based on expression abstraction and max operator with application in timing analysis. In: Gupta, A., Malik, S. (eds.) CAV 2008. LNCS, vol. 5123, pp. 370–384. Springer, Heidelberg (2008)

    Chapter  Google Scholar 

  25. Gulwani, S., Mehra, K.K., Chilimbi, T.M.: Speed: precise and efficient static estimation of program computational complexity. In: POPL, pp. 127–139. ACM, New York (2009)

    Google Scholar 

  26. Gulwani, S., Tiwari, A.: An abstract domain for analyzing heap-manipulating low-level software. In: Damm, W., Hermanns, H. (eds.) CAV 2007. LNCS, vol. 4590, pp. 379–392. Springer, Heidelberg (2007)

    Chapter  Google Scholar 

  27. Hammond, K., Michaelson, G.J.: Hume: A domain-specific language for real-time embedded systems. In: Pfenning, F., Smaragdakis, Y. (eds.) GPCE 2003. LNCS, vol. 2830, pp. 37–56. Springer, Heidelberg (2003)

    Chapter  Google Scholar 

  28. Hermenegildo, M., Puebla, G., Bueno, F., López-García, P.: Integrated Program Debugging, Verification, and Optimization Using Abstract Interpretation (and The Ciao System Preprocessor). Science of Computer Programming 58(1-2), 115–140 (2005)

    Article  MathSciNet  MATH  Google Scholar 

  29. Hickey, T., Cohen, J.: Automating program analysis. J. ACM 35(1) (1988)

    Google Scholar 

  30. Hofmann, M., Jost, S.: Static prediction of heap space usage for first-order functional programs. In: POPL (2003)

    Google Scholar 

  31. Hughes, J., Pareto, L., Sabry, A.: Proving the correctness of reactive systems using sized types. In: POPL, pp. 410–423 (1996)

    Google Scholar 

  32. Jones, N.D., Gomard, C.K., Sestoft, P.: Partial Evaluation and Automatic Program Generation. Prentice Hall, New York (1993)

    MATH  Google Scholar 

  33. Jouannaud, J., Xu, W.: Automatic Complexity Analysis for Programs Extracted from Coq Proof. ENTCS (2006)

    Google Scholar 

  34. Kristiansen, L., Jones, N.D.: The flow of data and the complexity of algorithms. In: Cooper, S.B., Löwe, B., Torenvliet, L. (eds.) CiE 2005. LNCS, vol. 3526, pp. 263–274. Springer, Heidelberg (2005)

    Chapter  Google Scholar 

  35. Le Metayer, D.: ACE: An Automatic Complexity Evaluator. ACM Transactions on Programming Languages and Systems 10(2), 248–266 (1988)

    Article  Google Scholar 

  36. Lehner, H., Müller, P.: Formal translation of bytecode into BoogiePL. In: Bytecode 2007. ENTCS, pp. 35–50. Elsevier, Amsterdam (2007)

    Google Scholar 

  37. Lindholm, T., Yellin, F.: The Java Virtual Machine Specification. Addison-Wesley, Reading (1996)

    Google Scholar 

  38. Luca, B., Andrei, S., Anderson, H., Khoo, S.-C.: Program transformation by solving recurrences. In: PEPM 2006: Proceedings of the 2006 ACM SIGPLAN symposium on Partial evaluation and semantics-based program manipulation, pp. 121–129. ACM, New York (2006)

    Chapter  Google Scholar 

  39. Marion, J.-Y., Pèchoux, R.: Resource control of object-oriented programs. In: International LICS affiliated Workshop on Logic and Computational Complexity (LCC 2007), Wroclaw, Poland (2007)

    Google Scholar 

  40. Navas, J., Mera, E., López-García, P., Hermenegildo, M.V.: User-definable resource bounds analysis for logic programs. In: Dahl, V., Niemelä, I. (eds.) ICLP 2007. LNCS, vol. 4670, pp. 348–363. Springer, Heidelberg (2007)

    Chapter  Google Scholar 

  41. Necula, G.: Proof-Carrying Code. In: Proc. of ACM Symposium on Principles of programming languages (POPL), pp. 106–119. ACM Press, New York (1997)

    Google Scholar 

  42. Nielson, F., Nielson, H.R., Hankin, C.: Principles of Program Analysis, 2nd edn. Springer, Heidelberg (2005)

    MATH  Google Scholar 

  43. Niggl, K.-H., Wunderlich, H.: Certifying Polynomial Time and Linear/Polynomial Space for Imperative Programs. SIAM J. Comput. 35(5), 1122–1147 (2006)

    Article  MathSciNet  MATH  Google Scholar 

  44. Rosendahl, M.: Automatic Complexity Analysis. In: Proc. ACM Conference on Functional Programming Languages and Computer Architecture, pp. 144–156. ACM, New York (1989)

    Google Scholar 

  45. Rosendahl, M.: Simple Driving Techniques. In: Mogensen, T.Æ., Schmidt, D.A., Sudborough, I.H. (eds.) The Essence of Computation. LNCS, vol. 2566, pp. 404–419. Springer, Heidelberg (2002)

    Chapter  Google Scholar 

  46. Rossignoli, S., Spoto, F.: Detecting non-cyclicity by abstract compilation into boolean functions. In: Emerson, E.A., Namjoshi, K.S. (eds.) VMCAI 2006. LNCS, vol. 3855, pp. 95–110. Springer, Heidelberg (2005)

    Chapter  Google Scholar 

  47. Sands, D.: A naïve time analysis and its theory of cost equivalence. J. Log. Comput. 5(4) (1995)

    Google Scholar 

  48. Secci, S., Spoto, F.: Pair-sharing analysis of object-oriented programs. In: Hankin, C., Siveroni, I. (eds.) SAS 2005. LNCS, vol. 3672, pp. 320–335. Springer, Heidelberg (2005)

    Chapter  Google Scholar 

  49. Simões, H.R., Hammond, K., Florido, M., Vasconcelos, P.B.: Using intersection types for cost-analysis of higher-order polymorphic functional programs. In: Altenkirch, T., McBride, C. (eds.) TYPES 2006. LNCS, vol. 4502, pp. 221–236. Springer, Heidelberg (2007)

    Chapter  Google Scholar 

  50. Spoto, F.: Julia: A Generic Static Analyser for the Java Bytecode. In: Proc. of the 7th Workshop on Formal Techniques for Java-like Programs, FTfJP 2005, Glasgow, Scotland (July 2005)

    Google Scholar 

  51. Spoto, F., Jensen, T.: Class analyses as abstract interpretations of trace semantics. ACM Trans. Program. Lang. Syst. 25(5), 578–630 (2003)

    Article  Google Scholar 

  52. Spoto, F., Hill, P.M., Payet, E.: Path-length analysis of object-oriented programs. In: Proc. International Workshop on Emerging Applications of Abstract Interpretation (EAAI). Electronic Notes in Theoretical Computer Science. Elsevier, Amsterdam (2006)

    Google Scholar 

  53. Turchin, V.F.: The concept of a supercompiler. ACM Transactions on Programming Languages and Systems 8(3), 292–325 (1986)

    Article  MATH  Google Scholar 

  54. Vallee-Rai, R., Hendren, L., Sundaresan, V., Lam, P., Gagnon, E., Co, P.: Soot - a Java optimization framework. In: Proc. of Conference of the Centre for Advanced Studies on Collaborative Research (CASCON), pp. 125–135 (1999)

    Google Scholar 

  55. Vasconcelos, P.B., Hammond, K.: Inferring cost equations for recursive, polymorphic and higher-order functional programs. In: Trinder, P., Michaelson, G.J., Peña, R. (eds.) IFL 2003. LNCS, vol. 3145, pp. 86–101. Springer, Heidelberg (2004)

    Chapter  Google Scholar 

  56. Wadler, P.: Strictness analysis aids time analysis. In: Proc. ACM Symposium on Principles of Programming Languages (POPL), pp. 119–132. ACM Press, New York (1988)

    Google Scholar 

  57. Wegbreit, B.: Mechanical Program Analysis. Comm. of the ACM 18(9) (1975)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2009 Springer-Verlag Berlin Heidelberg

About this chapter

Cite this chapter

Albert, E., Arenas, P., Genaim, S., Puebla, G., Zanardini, D. (2009). Resource Usage Analysis and Its Application to Resource Certification. In: Aldini, A., Barthe, G., Gorrieri, R. (eds) Foundations of Security Analysis and Design V. FOSAD FOSAD FOSAD 2009 2007 2008. Lecture Notes in Computer Science, vol 5705. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-03829-7_9

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-03829-7_9

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-03828-0

  • Online ISBN: 978-3-642-03829-7

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics