Automatic Inference of Bounds on Resource Consumption

  • Elvira Albert
  • Diego Esteban Alonso-Blas
  • Puri Arenas
  • Jesús Correas
  • Antonio Flores-Montoya
  • Samir Genaim
  • Miguel Gómez-Zamalloa
  • Abu Naser Masud
  • German Puebla
  • José Miguel Rojas
  • Guillermo Román-Díez
  • Damiano Zanardini

Abstract

In this tutorial paper, we overview the techniques that underlie the automatic inference of resource consumption bounds. We first explain the basic techniques on a Java-like sequential language. Then, we describe the extensions that are required to apply our method on concurrent ABS programs. Finally, we discuss some advanced issues in resource analysis, including the inference of non-cumulative resources and the treatment of shared mutable data.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    Adachi, A., Kasai, T., Moriya, E.: A Theoretical Study of the Time Analysis of Programs. In: Becvar, J. (ed.) MFCS 1979. LNCS, vol. 74, pp. 201–207. Springer, Heidelberg (1979)CrossRefGoogle Scholar
  2. 2.
    Albert, E., Arenas, P., Alonso, D., Genaim, S., Puebla, G.: Asymptotic Resource Usage Bounds. In: Hu, Z. (ed.) APLAS 2009. LNCS, vol. 5904, pp. 294–310. Springer, Heidelberg (2009)CrossRefGoogle Scholar
  3. 3.
    Albert, E., Arenas, P., Genaim, S., Gómez-Zamalloa, M., Puebla, G.: Cost Analysis of Concurrent OO programs. In: Yang, H. (ed.) APLAS 2011. LNCS, vol. 7078, pp. 238–254. Springer, Heidelberg (2011)CrossRefGoogle Scholar
  4. 4.
    Albert, E., Arenas, P., Genaim, S., Gómez-Zamalloa, M., Puebla, G.: COSTABS: A Cost and Termination Analyzer for ABS. In: Procs. of PEPM 2012, pp. 151–154. ACM Press (2012)Google Scholar
  5. 5.
    Albert, E., Arenas, P., Genaim, S., Puebla, G.: Field-Sensitive Value Analysis by Field-Insensitive Analysis. In: Cavalcanti, A., Dams, D.R. (eds.) FM 2009. LNCS, vol. 5850, pp. 370–386. Springer, Heidelberg (2009)CrossRefGoogle Scholar
  6. 6.
    Albert, E., Arenas, P., Genaim, S., Puebla, G.: Closed-Form Upper Bounds in Static Cost Analysis. Journal of Automated Reasoning 46(2), 161–203 (2011)MathSciNetMATHCrossRefGoogle Scholar
  7. 7.
    Albert, E., Arenas, P., Genaim, S., Puebla, G., Ramírez Deantes, D.V.: From Object Fields to Local Variables: a Practical Approach to Field-Sensitive Analysis. In: Cousot, R., Martel, M. (eds.) SAS 2010. LNCS, vol. 6337, pp. 100–116. Springer, Heidelberg (2010)CrossRefGoogle Scholar
  8. 8.
    Albert, E., Arenas, P., Genaim, S., Puebla, G., Zanardini, D.: Cost Analysis of Object-Oriented Bytecode Programs. Theoretical Computer Science (Special Issue on Quantitative Aspects of Programming Languages) 413(1), 142–159 (2012)MathSciNetMATHGoogle Scholar
  9. 9.
    Albert, E., Arenas, P., Genaim, S., Zanardini, D.: Task-Level Analysis for a Language with Async-Finish parallelism. In: Proc. of LCTES 2011, pp. 21–30. ACM Press (2011)Google Scholar
  10. 10.
    Albert, E., Correas, J., Puebla, G., Román-Díez, G.: Incremental Resource Usage Analysis. In: Procs. of PEPM 2012, pp. 25–34. ACM Press (2012)Google Scholar
  11. 11.
    Albert, E., Flores-Montoya, A.E., Genaim, S.: Analysis of May-Happen-in-Parallel in Concurrent Objects. In: Giese, H., Rosu, G. (eds.) FORTE 2012 and FMOODS 2012. LNCS, vol. 7273, pp. 35–51. Springer, Heidelberg (2012)CrossRefGoogle Scholar
  12. 12.
    Albert, E., Flores-Montoya, A., Genaim, S.: Maypar: A May-Happen-in-Parallel Analyzer for Concurrent Objects. In: Proc. of FSE-20, SIGSOFT/FSE 2012, pp. 1–4. ACM (2012)Google Scholar
  13. 13.
    Albert, E., Genaim, S., Gómez-Zamalloa, M.: Heap Space Analysis for Garbage Collected Languages. Science of Computer Programming (2012) (to appear)Google Scholar
  14. 14.
    Albert, E., Genaim, S., Masud, A.N.: More Precise yet Widely Applicable Cost Analysis. In: Jhala, R., Schmidt, D. (eds.) VMCAI 2011. LNCS, vol. 6538, pp. 38–53. Springer, Heidelberg (2011)CrossRefGoogle Scholar
  15. 15.
    Albert, E., Genaim, S., Román-Díez, G.: Conditional Termination of Loops over Arrays. In: Proc. of Bytecode 2012 (2012)Google Scholar
  16. 16.
    Alonso-Blas, D.E., Genaim, S.: On the Limits of the Classical Approach to Cost Analysis. In: Miné, A., Schmidt, D. (eds.) SAS 2012. LNCS, vol. 7460, pp. 405–421. Springer, Heidelberg (2012)CrossRefGoogle Scholar
  17. 17.
    Bagnara, R., Hill, P.M., Zaffanella, E.: The Parma Polyhedra Library: Toward a Complete Set of Numerical Abstractions for the Analysis and Verification of Hardware and Software Systems. Science of Computer Programming 72(1-2), 3–21 (2008)MathSciNetCrossRefGoogle Scholar
  18. 18.
    Benzinger, R.: Automated Higher-Order Complexity Analysis. Theoretical Computer Science 318(1-2), 79–103 (2004)MathSciNetMATHCrossRefGoogle Scholar
  19. 19.
    Bruynooghe, M., Codish, M., Gallagher, J.P., Genaim, S., Vanhoof, W.: Termination analysis of logic programs through combination of type-based norms. ACM Transactions on Programming Languages and Systems 29(2) (2007)Google Scholar
  20. 20.
    Cousot, P., Cousot, R.: Abstract Interpretation: A Unified Lattice Model for Static Analysis of Programs by Construction or Approximation of Fixpoints. In: Proc. of POPL 1977, pp. 238–252. ACM Press (1977)Google Scholar
  21. 21.
    Debray, S.K., Lin, N.W.: Cost Analysis of Logic Programs. ACM Transactions on Programming Languages and Systems 15(5), 826–875 (1993)CrossRefGoogle Scholar
  22. 22.
    Feautrier, P.: Parametric Integer Programming. RAIRO Recherche Opérationnelle 22(3), 243–268 (1988)MathSciNetMATHGoogle Scholar
  23. 23.
    Genaim, S., Zanardini, D.: The Acyclicity Inference of COSTA. In: 11th International Workshop on Termination (2010)Google Scholar
  24. 24.
    Giachino, E., Laneve, C.: Analysis of Deadlocks in Object Groups. In: Bruni, R., Dingel, J. (eds.) FORTE 2011 and FMOODS 2011. LNCS, vol. 6722, pp. 168–182. Springer, Heidelberg (2011)CrossRefGoogle Scholar
  25. 25.
    Hermenegildo, M., Puebla, G., Marriott, K., Stuckey, P.: Incremental Analysis of Constraint Logic Programs. ACM Transactions on Programming Languages and Systems 22(2), 187–223 (2000)CrossRefGoogle Scholar
  26. 26.
    Hermenegildo, M.V., Bueno, F., Carro, M., López, P., Mera, E., Morales, J.F., Puebla, G.: An Overview of Ciao and its Design Philosophy. Theory and Practice of Logic Programming 12(1-2), 219–252 (2012), http://arxiv.org/abs/1102.5497 MathSciNetMATHCrossRefGoogle Scholar
  27. 27.
    Hoffmann, J., Aehlig, K., Hofmannn, M.: Multivariate Amortized Resource Analysis. ACM Transactions on Programming Languages and Systems 34(3), 14:1–14:62 (2012)Google Scholar
  28. 28.
    Johnsen, E.B., Hähnle, R., Schäfer, J., Schlatte, R., Steffen, M.: ABS: A Core Language for Abstract Behavioral Specification. In: Aichernig, B.K., de Boer, F.S., Bonsangue, M.M. (eds.) FMCO 2010. LNCS, vol. 6957, pp. 142–164. Springer, Heidelberg (2011)CrossRefGoogle Scholar
  29. 29.
    Jones, N.D., Gomard, C.K., Sestoft, P.: Partial Evaluation and Automatic Program Generation. Prentice-Hall (1993)Google Scholar
  30. 30.
    Jost, S.: Automated Amortised Analysis. PhD thesis, Ludwig-Maximilians-Universität (August. 2010)Google Scholar
  31. 31.
    Le Metayer, D.: ACE: An Automatic Complexity Evaluator. ACM Transactions on Programming Languages and Systems 10(2), 248–266 (1988)CrossRefGoogle Scholar
  32. 32.
    Lindholm, T., Yellin, F.: The Java Virtual Machine Specification. Addison-Wesley (1996)Google Scholar
  33. 33.
    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)CrossRefGoogle Scholar
  34. 34.
    Podelski, A., Rybalchenko, A.: A complete Method for the Synthesis of Linear Ranking Functions. In: Steffen, B., Levi, G. (eds.) VMCAI 2004. LNCS, vol. 2937, pp. 239–251. Springer, Heidelberg (2004)CrossRefGoogle Scholar
  35. 35.
    Rodriguez, D.: Amortised Resource Analysis for Object-Oriented Programs. Phd thesis, LMU Munich (October 2012)Google Scholar
  36. 36.
    Rosendahl, M.: Automatic Complexity Analysis. In: Proc. of FPCA 1989, pp. 144–156. ACM Press (1989)Google Scholar
  37. 37.
    Sands, D.: A Naïve Time Analysis and its Theory of Cost Equivalence. Journal of Logic and Computation 5(4), 495–541 (1995)MathSciNetMATHCrossRefGoogle Scholar
  38. 38.
    Schäfer, J., Poetzsch-Heffter, A.: Jcobox: Generalizing Active Objects to Concurrent Components. In: D’Hondt, T. (ed.) ECOOP 2010. LNCS, vol. 6183, pp. 275–299. Springer, Heidelberg (2010)CrossRefGoogle Scholar
  39. 39.
    Srinivasan, S., Mycroft, A.: Kilim: Isolation-Typed Actors for Java. In: Vitek, J. (ed.) ECOOP 2008. LNCS, vol. 5142, pp. 104–128. Springer, Heidelberg (2008)CrossRefGoogle Scholar
  40. 40.
    Tarjan, R.E.: Amortized Computational Complexity. SIAM Journal on Algebraic and Discrete Methods 6(2), 306–318 (1985)MathSciNetMATHCrossRefGoogle Scholar
  41. 41.
    Wadler, P.: Strictness Analysis Aids Time Analysis. In: ACM Symposium on Principles of Programming Languages (POPL 1988). ACM Press (1988)Google Scholar
  42. 42.
    Wegbreit, B.: Mechanical Program Analysis. Communications of the ACM 18(9), 528–539 (1975)MathSciNetMATHCrossRefGoogle Scholar
  43. 43.
    Wielemaker, J., Schrijvers, T., Triska, M., Lager, T.: SWI-Prolog. Theory and Practice of Logic Programming 12(1-2), 67–96 (2012)MathSciNetMATHCrossRefGoogle Scholar
  44. 44.
    Genaim, S., Zanardini, D.: Reachability-based Acyclicity Analysis by Abstract Interpretation. Theoretical Computer Science (2013)Google Scholar
  45. 45.
    Albert, E., Arenas, P., Genaim, S., Puebla, G.: Closed-Form Upper Bounds in Static Cost Analysis. Journal of Automated Reasoning 46(2), 161–203 (2011)MathSciNetMATHCrossRefGoogle Scholar
  46. 46.
    Albert, E., Arenas, P., Genaim, S., Puebla, G., Zanardini, D.: COSTA: Design and implementation of a cost and termination analyzer for java bytecode. In: de Boer, F.S., Bonsangue, M.M., Graf, S., de Roever, W.-P. (eds.) FMCO 2007. LNCS, vol. 5382, pp. 113–132. Springer, Heidelberg (2008)CrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2013

Authors and Affiliations

  • Elvira Albert
    • 1
  • Diego Esteban Alonso-Blas
    • 1
  • Puri Arenas
    • 1
  • Jesús Correas
    • 1
  • Antonio Flores-Montoya
    • 2
  • Samir Genaim
    • 1
  • Miguel Gómez-Zamalloa
    • 1
  • Abu Naser Masud
    • 3
  • German Puebla
    • 3
  • José Miguel Rojas
    • 3
  • Guillermo Román-Díez
    • 3
  • Damiano Zanardini
    • 3
  1. 1.Complutense University of Madrid (UCM)Spain
  2. 2.Technische Universität Darmstadt (TUD)Germany
  3. 3.Technical University of Madrid (UPM)Spain

Personalised recommendations