Skip to main content

A New Invariant Rule for the Analysis of Loops with Non-standard Control Flows

  • Conference paper
  • First Online:
Integrated Formal Methods (IFM 2017)

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

Included in the following conference series:

Abstract

Invariants are a standard concept for reasoning about unbounded loops since Floyd-Hoare logic in the late 1960s. For real-world languages like Java, loop invariant rules tend to become extremely complex. The main reason is non-standard control flow induced by return, throw, break, and continue statements, possibly combined and nested inside inner loops and try blocks. We propose the concept of a loop scope which gives rise to a new approach for the design of invariant rules. This permits “sandboxed” deduction-based symbolic execution of loop bodies which in turn allows a modular analysis even of complex loops. Based on the new concept we designed a loop invariant rule for Java that has full language coverage and implemented it in the program verification system KeY. Its main advantages are (1) much increased comprehensibility, which made it considerably easier to argue for its soundness, (2) simpler and easier to understand proof obligations, (3) a substantially decreased number of symbolic execution steps and sizes of resulting proofs in a representative set of experiments. We also show that the new rule, in combination with fully automatic symbolic state merging, realizes even greater proof size reduction and helps to address the state explosion problem of symbolic execution.

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 EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.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

References

  1. Ahrendt, W., Beckert, B. (eds.): Deductive Software Verification - The KeY Book. LNCS, vol. 10001. Springer, Cham (2016). doi:10.1007/978-3-319-49812-6

    Google Scholar 

  2. Barnett, M., Chang, B.-Y.E., DeLine, R., Jacobs, B., Leino, K.R.M.: Boogie: a modular reusable verifier for object-oriented programs. In: Boer, F.S., Bonsangue, M.M., Graf, S., Roever, W.-P. (eds.) FMCO 2005. LNCS, vol. 4111, pp. 364–387. Springer, Heidelberg (2006). doi:10.1007/11804192_17

    Chapter  Google Scholar 

  3. Bobot, F., Filliâtre, J.C., et al.: Why3: Shepherd your herd of provers. In: Boogie 2011: First International Workshop on IVL, pp. 53–64 (2011)

    Google Scholar 

  4. Cadar, C., Dunbar, D., et al.: KLEE: unassisted and automatic generation of high-coverage tests for complex systems programs. In: 8th USENIX Conference on OSDI, pp. 209–224. USENIX Association, Berkeley (2008)

    Google Scholar 

  5. Cadar, C., Sen, K.: Symbolic execution for software testing: three decades later. Commun. ACM 56(2), 82–90 (2013)

    Article  Google Scholar 

  6. Cok, D.R.: OpenJML: software verification for Java 7 using JML, OpenJDK, and Eclipse. In: Proceedings of the 1st Workshop on FIDE, pp. 79–92 (2014)

    Google Scholar 

  7. Cuoq, P., Kirchner, F., Kosmatov, N., Prevosto, V., Signoles, J., Yakobowski, B.: Frama-C. In: Eleftherakis, G., Hinchey, M., Holcombe, M. (eds.) SEFM 2012. LNCS, vol. 7504, pp. 233–247. Springer, Heidelberg (2012). doi:10.1007/978-3-642-33826-7_16

    Chapter  Google Scholar 

  8. Dannenberg, R., Ernst, G.: Formal program verification using symbolic execution. IEEE Trans. Softw. Eng. SE–8(1), 43–52 (1982)

    Article  MathSciNet  MATH  Google Scholar 

  9. Filliâtre, J.C.: Deductive software verification. Int. J. Softw. Tools Technol. Transf. (STTT) 13(5), 397–403 (2011)

    Article  Google Scholar 

  10. Flanagan, C., Saxe, J.B.: Avoiding exponential explosion: generating compact verification conditions. SIGPLAN Not. 36(3), 193–205 (2001)

    Article  MATH  Google Scholar 

  11. Gouw, S., Rot, J., Boer, F.S., Bubel, R., Hähnle, R.: OpenJDK’s Java.utils.Collection.sort() is broken: the good, the bad and the worst case. In: Kroening, D., Păsăreanu, C.S. (eds.) CAV 2015. LNCS, vol. 9206, pp. 273–289. Springer, Cham (2015). doi:10.1007/978-3-319-21690-4_16

    Chapter  Google Scholar 

  12. Hentschel, M., Hähnle, R., Bubel, R.: Visualizing unbounded symbolic execution. In: Seidl, M., Tillmann, N. (eds.) TAP 2014. LNCS, vol. 8570, pp. 82–98. Springer, Cham (2014). doi:10.1007/978-3-319-09099-3_7

    Google Scholar 

  13. Hoare, C.A.R.: An axiomatic basis for computer programming. Commun. ACM 12(10), 576–580 (1969)

    Article  MATH  Google Scholar 

  14. Jaffar, J., Murali, V., et al.: Boosting concolic testing via interpolation. In: Proceedings of 9th Joint Meeting on FSE, pp. 48–58. USA. ACM, New York (2013)

    Google Scholar 

  15. Marché, C., Paulin-Mohring, C., et al.: The KRAKATOA tool for certification of JAVA/JAVACARD programs annotated in JML. J. Logic Algebr. Program. 58(1–2), 89–106 (2004)

    Article  MATH  Google Scholar 

  16. Pariente, D., Ledinot, E.: Formal verification of industrial C code using Frama-C: a case study. In: Proceedings of the 1st International Conference on FoVeOOS, p. 205 (2010)

    Google Scholar 

  17. Păsăreanu, C.S., Visser, W.: Verification of Java programs using symbolic execution and invariant generation. In: Graf, S., Mounier, L. (eds.) SPIN 2004. LNCS, vol. 2989, pp. 164–181. Springer, Heidelberg (2004). doi:10.1007/978-3-540-24732-6_13

    Chapter  Google Scholar 

  18. Scheurer, D., Hähnle, R., Bubel, R.: A general lattice model for merging symbolic execution branches. In: Ogata, K., Lawford, M., Liu, S. (eds.) ICFEM 2016. LNCS, vol. 10009, pp. 57–73. Springer, Cham (2016). doi:10.1007/978-3-319-47846-3_5

    Chapter  Google Scholar 

  19. Steinhöfel, D., Wasser, N.: A new invariant rule for the analysis of loops with non-standard control flows. Technical report, TU Darmstadt (2017). http://tinyurl.com/loop-scopes-tr

  20. Stenzel, K.: Verification of Java card programs. Ph.D. thesis, University of Augsburg, Germany (2005)

    Google Scholar 

  21. Vogels, F., Jacobs, B., et al.: Featherweight VeriFast. LMCS 11(3), 1–57 (2015)

    MathSciNet  MATH  Google Scholar 

  22. Wasser, N.: Automatic generation of specifications using verification tools. Ph.D. thesis, Technische Universität Darmstadt, Darmstadt, January 2016

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Dominic Steinhöfel .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2017 Springer International Publishing AG

About this paper

Cite this paper

Steinhöfel, D., Wasser, N. (2017). A New Invariant Rule for the Analysis of Loops with Non-standard Control Flows. In: Polikarpova, N., Schneider, S. (eds) Integrated Formal Methods. IFM 2017. Lecture Notes in Computer Science(), vol 10510. Springer, Cham. https://doi.org/10.1007/978-3-319-66845-1_18

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-66845-1_18

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-66844-4

  • Online ISBN: 978-3-319-66845-1

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics