Skip to main content
×
×
Home

Interval-based resource usage verification by translation into Horn clauses and an application to energy consumption

  • P. LOPEZ-GARCIA (a1) (a2), L. DARMAWAN (a3), M. KLEMEN (a4) (a5), U. LIQAT (a4) (a5), F. BUENO (a6) and M. V. HERMENEGILDO (a4) (a7)...
Abstract

Many applications require conformance with specifications that constrain the use of resources, such as execution time, energy, bandwidth, etc. We present a configurable framework for static resource usage verification where specifications can include data size-dependent resource usage functions, expressing both lower and upper bounds. Ensuring conformance with respect to such specifications is an undecidable problem. Therefore, to statically check such specifications, our framework infers the same type of resource usage functions, which safely approximate the actual resource usage of the program, and compares them against the specification. We review how this framework supports several languages and compilation output formats by translating them to an intermediate representation based on Horn clauses and using the configurability of the framework to describe the resource semantics of the input language. We provide a detailed formalization and extend the framework so that both resource usage specification and analysis/verification output can include preconditions expressing intervals for the input data sizes for which assertions are intended to hold, proved, or disproved. Most importantly, we also extend the classes of functions that can be checked. We also report on and provide results from an implementation within the Ciao/CiaoPP framework, as well as on a practical tool built by instantiating this framework for the verification of energy consumption specifications for imperative/embedded programs. Finally, we show as an example how embedded software developers can use this tool, in particular, for determining values for program parameters that ensure meeting a given energy budget while minimizing the loss in quality of service.

Copyright
References
Hide All
Albert, E., Arenas, P., Genaim, S., Herraiz, I. and Puebla, G. 2010. Comparing cost functions in resource analysis. In Proc. of 1st International Workshop on Foundational and Practical Aspects of Resource Analysis (FOPARA'09). Lecture Notes in Computer Science, vol. 6234. Springer, 1–17.
Albert, E., Arenas, P., Genaim, S. and Puebla, G. 2015. A Practical Comparator of Cost Functions and its Applications. Science of Computer Programming 111, 483504. Special Issue on Foundational and Practical Aspects of Resource Analysis (FOPARA 2009).
Bjørner, N., Fioravanti, F., Rybalchenko, A. and Senni, V., Eds. 2014. In Proc. of Workshop on Horn Clauses for Verification and Synthesis. Electronic Proceedings in Theoretical Computer Science.
Bourdoncle, F. 1993. Abstract debugging of higher-order imperative languages. In Programming Languages Design and Implementation. Cartwright, R., Ed. ACM, 4655.
Bueno, F., Deransart, P., Drabent, W., Ferrand, G., Hermenegildo, M. V., Maluszynski, J. and Puebla, G. 1997. On the role of semantic approximations in validation and diagnosis of constraint logic programs. In Proc. of the 3rd International Workshop on Automated Debugging (AADEBUG'97). University of Linköping Press, Linköping, Sweden, 155–170.
Comini, M., Levi, G., Meo, M. C. and Vitiello, G. 1999. Abstract diagnosis. Journal of Logic Programming 39, 1–3, 4393.
Comini, M., Levi, G. and Vitiello, G. 1995. Declarative diagnosis revisited. In 1995 International Logic Programming Symposium. MIT Press, Cambridge, MA, Portland, Oregon, 275287.
Cousot, P. 2003. Automatic verification by abstract interpretation, invited tutorial. In Proc of 4th International Conference on Verification, Model Checking and Abstract Interpretation (VMCAI'03). Number 2575 in Lecture Notes in Computer Science. Springer, 20–24.
Cousot, P. and Cousot, R. 1977. Abstract interpretation: A unified lattice model for static analysis of programs by construction or approximation of fixpoints. In Proc. of ACM Symposium on Principles of Programming Languages (POPL'77). ACM Press, 238–252.
Dart, P. and Zobel, J. 1992. A regular type language for logic programs. In Types in Logic Programming. MIT Press, 157187.
de Moura, L. M. and Bjørner, N. 2008. Z3: An efficient SMT solver. In Proc of 14th International Conference on Tools and Algorithms for the Construction and Analysis of Systems (TACAS'08), Ramakrishnan, C. R. and Rehof, J., Eds. Lecture Notes in Computer Science, vol. 4963. Springer, 337–340.
Debray, S. K. and Lin, N. W. 1993. Cost analysis of logic programs. ACM Transactions on Programming Languages and Systems 15, 5 (November), 826875.
Debray, S. K., Lin, N.-W. and Hermenegildo, M. V. 1990. Task granularity analysis in logic programs. In Proc. of ACM Conference on Programming Language Design and Implementation (PLDI'90). ACM Press, 174–188.
Debray, S. K., López-García, P., Hermenegildo, M. V. and Lin, N.-W. 1997. Lower bound cost estimation for logic programs. In Proc. of International Logic Programming Symposium. MIT Press, Cambridge, MA, 291–305.
Fähndrich, M. and Logozzo, F. 2011. Static contract checking with abstract interpretation. In Proc. of International Conference on Formal Verification of Object-oriented Software (FoVeOOS'10). Lecture Notes in Computer Science, vol. 6528. Springer, 10–30.
Galassi, M., Davies, J., Theiler, J., Gough, B., Jungman, G., Alken, P., Booth, M. and Rossi, F. 2009. GNU Scientific Library Reference Manual - 3rd ed. (v1.12). Network Theory Ltd. Available at http://www.gnu.org/software/gsl/.
Georgiou, K., Kerrison, S., Chamski, Z. and Eder, K. 2017. Energy transparency for deeply embedded programs. ACM Transactions on Architecture and Code Optimization 14, 1 (March), 8:18:26.
Gleich, D. F. 2005. Finite Calculus: A Tutorial for Solving Nasty Sums. Combinatorics, Stanford University.
Grebenshchikov, S., Gupta, A., Lopes, N. P., Popeea, C. and Rybalchenko, A. 2012. HSF(C): A software verifier based on Horn clauses — (competition contribution). In TACAS, Flanagan, C. and König, B., Eds. Lecture Notes in Computer Science, vol. 7214. Springer, 549551.
Hermenegildo, M. V., Bueno, F., Carro, M., López, P., Mera, E., Morales, J. and Puebla, G. 2012. An overview of Ciao and its design philosophy. Theory and Practice of Logic Programming 12, 1–2 (January), 219252. http://arxiv.org/abs/1102.5497.
Hermenegildo, M. V., Puebla, G. and Bueno, F. 1999. Using global analysis, partial specifications, and an extensible assertion language for program validation and debugging. In The Logic Programming Paradigm: A 25–Year Perspective, Apt, K. R., Marek, V., Truszczynski, M., and Warren, D. S., Eds. Springer-Verlag, 161–192.
Hermenegildo, M. V., Puebla, G., Bueno, F. and Lopez-Garcia, P. 2005. Integrated program debugging, verification, and optimization using abstract interpretation (and the Ciao system preprocessor). Science of Computer Programming 58, 1–2 (October), 115140.
Hojjat, H., Konecný, F., Garnier, F., Iosif, R., Kuncak, V. and Rümmer, P. 2012. A verification toolkit for numerical transition systems—Tool paper. In Proc. of Formal Methods (FM'12). Lecture Notes in Computer Science, vol. 7436. Springer, 247–251.
Kafle, B., Gallagher, J. P. and Morales, J. F. 2016. RAHFT: A tool for verifying Horn clauses using abstract interpretation and finite tree automata. In Proc. of 28th International Conference on Computer Aided Verification Part I (CAV'16), Toronto, ON, Canada, July 17–23, Chaudhuri, S. and Farzan, A., Eds. Lecture Notes in Computer Science, vol. 9779. Springer, 261–268.
Kerrison, S. and Eder, K. 2015. Energy modeling of software for a hardware multithreaded embedded microprocessor. ACM Transactions on Embedded Computing Systems 14, 3 (April), 125.
Lattner, C. and Adve, V. 2004. LLVM: A compilation framework for lifelong program analysis and transformation. In Proc. of the International Symposium on Code Generation and Optimization (CGO'04). IEEE Computer Society, 75–88.
Lichtenstein, Y. and Shapiro, E. Y. 1988. Abstract algorithmic debugging. In Proc. of 5th International Conference and Symposium on Logic Programming, Kowalski, R. A. and Bowen, K. A., Eds. MIT, Seattle, Washington, 512–531.
Liqat, U., Georgiou, K., Kerrison, S., Lopez-Garcia, P., Hermenegildo, M. V., Gallagher, J. P. and Eder, K. 2016. Inferring parametric energy consumption functions at different software levels: ISA vs. LLVM IR. In Proc. of 4th International Workshop on Foundational and Practical Aspects of Resource Analysis (FOPARA'15), London, UK, April 11, 2015. Revised Selected Papers, Eekelen, M. V. and Lago, U. D., Eds. Lecture Notes in Computer Science, vol. 9964. Springer, 81–100.
Liqat, U., Kerrison, S., Serrano, A., Georgiou, K., Lopez-Garcia, P., Grech, N., Hermenegildo, M. V. and Eder, K. 2014. Energy consumption analysis of programs based on XMOS ISA-level models. In Proc. of 23rd International Symposium on Logic-Based Program Synthesis and Transformation (LOPSTR'13), Revised Selected Papers, G. Gupta and R. Peña, Eds. Lecture Notes in Computer Science, vol. 8901. Springer, 72–90.
López-García, P., Ed. 2014. Initial Energy Consumption Analysis. ENTRA Project: Whole-Systems Energy Transparency (FET project 318337). Deliverable 3.2, http://entraproject.eu.
López-García, P., Darmawan, L. and Bueno, F. 2010. A framework for verification and debugging of resource usage properties. In Proc. of Technical Communications of the 26th International Conference on Logic Programming (ICLP'10), Hermenegildo, M. V. and Schaub, T., Eds. Leibniz International Proceedings in Informatics (LIPIcs), vol. 7. Schloss Dagstuhl–Leibniz-Zentrum fuer Informatik, Dagstuhl, Germany, 104–113.
Lopez-Garcia, P., Darmawan, L., Bueno, F. and Hermenegildo, M. V. 2012. Interval-based resource usage verification: Formalization and prototype. In Proc. of 2nd International Workshop on Foundational and Practical Aspects of Resource Analysis (FOPARA'11), Revised Selected Papers, na, R. P., Eekelen, M., and Shkaravska, O., Eds. Lecture Notes in Computer Science, vol. 7177. Springer-Verlag, 54–71.
Lopez-Garcia, P., Haemmerlé, R., Klemen, M., Liqat, U. and Hermenegildo, M. V. 2015. Towards energy consumption verification via static analysis. In Proc. of Workshop on High Performance Energy Efficient Embedded Systems (HIP3ES'15), arXiv:1501.03064. arXiv:1512.09369.
Méndez-Lojo, M., Navas, J. and Hermenegildo, M. 2007. A flexible (C)LP-based approach to the analysis of object-oriented programs. In Proc. of 17th International Symposium on Logic-based Program Synthesis and Transformation (LOPSTR'07). Number 4915 in Lecture Notes in Computer Science. Springer-Verlag, 154–168.
Mera, E., López-García, P. and Hermenegildo, M. V. 2009. Integrating software testing and run-time checking in an assertion verification framework. In Proc. of 25th International Conference on Logic Programming (ICLP'09). Lecture Notes in Computer Science, vol. 5649. Springer-Verlag, 281–295.
Muthukumar, K. and Hermenegildo, M. 1992. Compile-time derivation of variable dependency using abstract interpretation. Journal of Logic Programming 13, 2/3 (July), 315347.
Navas, J., Méndez-Lojo, M. and Hermenegildo, M. 2008. Safe upper-bounds inference of energy consumption for Java Bytecode applications. In Proc of The 6th NASA Langley Formal Methods Workshop (LFM'08). 29–32. Extended Abstract.
Navas, J., Méndez-Lojo, M. and Hermenegildo, M. V. 2009. User-definable resource usage bounds analysis for Java Bytecode. In Proc. of the Workshop on Bytecode Semantics, Verification, Analysis and Transformation (BYTECODE'09). Electronic Notes in Theoretical Computer Science, vol. 253. Elsevier–North Holland, 65–82.
Navas, J., Mera, E., López-García, P. and Hermenegildo, M. 2007. User-definable resource bounds analysis for logic programs. In Proc. of 23rd International Conference on Logic Programming (ICLP'07). Lecture Notes in Computer Science, vol. 4670. Springer.
Nguyen, P. and Horn, D. V. 2015. Relatively complete counterexamples for higher-order programs. In Proc. of Programming Language Design and Implementation (PLDI'15). ACM, 446–456.
Puebla, G., Bueno, F. and Hermenegildo, M. V. 2000a. An assertion language for constraint logic programs. In Analysis and Visualization Tools for Constraint Programming, Deransart, P., Hermenegildo, M. V., and Maluszynski, J., Eds. Number 1870 in Lecture Notes in Computer Science. Springer-Verlag, 23–61.
Puebla, G., Bueno, F. and Hermenegildo, M. V. 2000b. Combined static and dynamic assertion-based debugging of constraint logic programs. In Proc. of Logic-based Program Synthesis and Transformation (LOPSTR'99). Number 1817 in Lecture Notes in Computer Science. Springer-Verlag, 273–292.
Serrano, A., Lopez-Garcia, P. and Hermenegildo, M. V. 2014. Resource usage analysis of logic programs via abstract interpretation using sized types. In Theory and Practice of Logic Programming, 30th International. Conference on Logic Programming (ICLP'14) Special Issue 14, 4–5, 739754.
Tobin-Hochstadt, S. and Van Horn, D. 2012. Higher-order symbolic execution via contracts. In Proc. of Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA'12). ACM, 537–554.
Vaucheret, C. and Bueno, F. 2002. More precise yet efficient type inference for logic programs. In Proc. of 9th International Static Analysis Symposium (SAS'02). Lecture Notes in Computer Science, vol. 2477. Springer-Verlag, 102–116.
Watt, D. 2009. Programming XC on XMOS Devices. XMOS Limited.
Recommend this journal

Email your librarian or administrator to recommend adding this journal to your organisation's collection.

Theory and Practice of Logic Programming
  • ISSN: 1471-0684
  • EISSN: 1475-3081
  • URL: /core/journals/theory-and-practice-of-logic-programming
Please enter your name
Please enter a valid email address
Who would you like to send this to? *
×

Keywords

Metrics

Full text views

Total number of HTML views: 0
Total number of PDF views: 0 *
Loading metrics...

Abstract views

Total abstract views: 0 *
Loading metrics...

* Views captured on Cambridge Core between <date>. This data will be updated every 24 hours.

Usage data cannot currently be displayed