Skip to main content

A Hoare Logic for Energy Consumption Analysis

  • Conference paper
  • First Online:
Foundational and Practical Aspects of Resource Analysis (FOPARA 2013)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 8552))

Abstract

Energy inefficient software implementations may cause battery drain for small systems and high energy costs for large systems. Dynamic energy analysis is often applied to mitigate these issues. However, this is often hardware-specific and requires repetitive measurements using special equipment.

We present a static analysis deriving upper-bounds for energy consumption based on an introduced energy-aware Hoare logic. Software is considered together with models of the hardware it controls. The Hoare logic is parametric with respect to the hardware. Energy models of hardware components can be specified separately from the logic. Parametrised with one or more of such component models, the analysis can statically produce a sound (over-approximated) upper-bound for the energy-usage of the hardware controlled by the software.

This work is partially financed by the IOP GenCom GoGreen project, sponsored by the Dutch Ministry of Economic Affairs, Agriculture and Innovation.

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 34.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 44.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

Notes

  1. 1.

    A proof-of-concept implementation for our While language is described in [24] and available at http://resourceanalysis.cs.ru.nl/energy.

References

  1. Albers, S.: Energy-efficient algorithms. Commun. ACM 53(5), 86–96 (2010)

    Article  MathSciNet  Google Scholar 

  2. Saxe, E.: Power-efficient software. Commun. ACM 53(2), 44–48 (2010)

    Article  Google Scholar 

  3. Ranganathan, P.: Recipe for efficiency: principles of power-aware computing. Commun. ACM 53(4), 60–67 (2010)

    Article  Google Scholar 

  4. te Brinke, S., Malakuti, S., Bockisch, C., Bergmans, L., Akşit, M.: A design method for modular energy-aware software. In: Proceedings of the 28th Annual ACM Symposium on Applied Computing, pp. 1180–1182. ACM, New York (2013)

    Google Scholar 

  5. Cohen, M., Zhu, H.S., Senem, E.E., Liu, Y.D.: Energy types. SIGPLAN Not. 47(10), 831–850 (2012)

    Article  Google Scholar 

  6. Sampson, A., Dietl, W., Fortuna, E., Gnanapragasam, D., Ceze, L., Grossman, D.: EnerJ: approximate data types for safe and general low-power computation. SIGPLAN Not. 46(6), 164–174 (2011)

    Article  Google Scholar 

  7. Zhurikhin, D., Belevantsev, A., Avetisyan, A., Batuzov, K., Lee, S.: Evaluating power aware optimizations within GCC compiler. In: GROW-2009: International Workshop on GCC Research Opportunities (2009)

    Google Scholar 

  8. Gheorghita, S.V., Corporaal, H., Basten, T.: Iterative compilation for energy reduction. J. Embed. Comput. 1(4), 509–520 (2005)

    Google Scholar 

  9. Junior, M.N.O., Neto, S., Maciel, P.R.M., Lima, R., Ribeiro, A., Barreto, R.S., Tavares, E., Braga, F.: Analyzing software performance and energy consumption of embedded systems by probabilistic modeling: an approach based on coloured petri nets. In: Donatelli, S., Thiagarajan, P.S. (eds.) ICATPN 2006. LNCS, vol. 4024, pp. 261–281. Springer, Heidelberg (2006)

    Chapter  Google Scholar 

  10. Nogueira, B., Maciel, P., Tavares, E., Andrade, E., Massa, R., Callou, G., Ferraz, R.: A formal model for performance and energy evaluation of embedded systems. EURASIP J. Embed. Syst. 2011, 2:1–2:12 (2011)

    Article  Google Scholar 

  11. 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)

    Chapter  Google Scholar 

  12. Hoffmann, J., Aehlig, K., Hofmann, M.: Multivariate amortized resource analysis. In: POPL’11, pp. 357–370. ACM (2011)

    Google Scholar 

  13. Atkey, R.: Amortised resource analysis with separation logic. In: Gordon, A.D. (ed.) ESOP 2010. LNCS, vol. 6012, pp. 85–103. Springer, Heidelberg (2010)

    Chapter  Google Scholar 

  14. Aspinall, D., Beringer, L., Hofmann, M., Loidl, H.W., Momigliano, A.: A program logic for resources. Theor. Comput. Sci. 389(3), 411–445 (2007)

    Article  MathSciNet  MATH  Google Scholar 

  15. Jayaseelan, R., Mitra, T., Li, X.: Estimating the worst-case energy consumption of embedded software. In: RTAS’06, pp. 81–90. IEEE (2006)

    Google Scholar 

  16. Kerrison, S., Liqat, U., Georgiou, K., Mena, A.S., Grech, N., Lopez-Garcia, P., Eder, K., Hermenegildo, M.V.: Energy consumption analysis of programs based on XMOS ISA-level models. In: LOPSTR’13, September 2013. Springer (2013)

    Google Scholar 

  17. Wilhelm, R., Engblom, J., Ermedahl, A., Holsti, N., Thesing, S., Whalley, D.B., Bernat, G., Ferdinand, C., Heckmann, R., Mitra, T., Mueller, F., Puaut, I., Puschner, P.P., Staschulat, J., Stenström, P.: The worst-case execution-time problem-overview of methods and survey of tools. ACM Trans. Embed. Comput. Syst. 7(3), 1–53 (2008)

    Article  Google Scholar 

  18. Shkaravska, O., van Eekelen, M.C.J.D., van Kesteren, R.: Polynomial size analysis of first-order shapely functions. Log. Methods Comput. Sci. 5(2), 1–35 (2009)

    Article  Google Scholar 

  19. Shkaravska, O., Kersten, R., Van Eekelen, M.: Test-based inference of polynomial loop-bound functions. In: PPPJ’10: Proceedings of the 8th International Conference on the Principles and Practice of Programming in Java, pp. 99–108. ACM (2010)

    Google Scholar 

  20. Kersten, R., van Gastel, B.E., Shkaravska, O., Montenegro, M., van Eekelen, M.: ResAna: a resource analysis toolset for (real-time) JAVA. Concurrency Comput.: Pract. Exper. 26(14), 2432–2455 (2013)

    Article  Google Scholar 

  21. 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)

    Chapter  Google Scholar 

  22. Hunt, J.J., Tonin, I., Siebert, F.: Using global data flow analysis on bytecode to aid worst case execution time analysis for real-time Java programs. In: Bollella, G., Locke, C.D. (eds.) JTRES. ACM International Conference Proceeding Series, vol. 343, pp. 97–105. ACM (2008)

    Google Scholar 

  23. Parisen Toldin, P., Kersten, R., van Gastel, B., van Eekelen, M.: Soundness proof for a Hoare logic for energy consumption analysis. Technical report ICIS-R13009, Radboud University Nijmegen, October 2013

    Google Scholar 

  24. Schoolderman, M., Neutelings, J., Kersten, R., van Eekelen, M.: ECAlogic: hardware-parametric energy-consumption analysis of algorithms. In: FOAL ’14, pp. 19–22. ACM (2014)

    Google Scholar 

Download references

Acknowledgements

We would like to thank the anonymous referees for their extensive feedback which helped us to considerably improve the paper.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Rody Kersten .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2014 Springer International Publishing Switzerland

About this paper

Cite this paper

Kersten, R., Toldin, P.P., van Gastel, B., van Eekelen, M. (2014). A Hoare Logic for Energy Consumption Analysis. In: Dal Lago, U., Peña, R. (eds) Foundational and Practical Aspects of Resource Analysis. FOPARA 2013. Lecture Notes in Computer Science(), vol 8552. Springer, Cham. https://doi.org/10.1007/978-3-319-12466-7_6

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-12466-7_6

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-12465-0

  • Online ISBN: 978-3-319-12466-7

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics