Skip to main content

Ilinva: Using Abduction to Generate Loop Invariants

  • Conference paper
  • First Online:
Frontiers of Combining Systems (FroCoS 2019)

Part of the book series: Lecture Notes in Computer Science ((LNAI,volume 11715))

Included in the following conference series:

Abstract

We describe a system to prove properties of programs. The key feature of this approach is a method to automatically synthesize inductive invariants of the loops contained in the program. The method is generic, i.e., it applies to a large set of programming languages and application domains; and lazy, in the sense that it only generates invariants that allow one to derive the required properties. It relies on an existing system called GPiD for abductive reasoning modulo theories [14], and on the platform for program verification Why3 [16]. Experiments show evidence of the practical relevance of our approach.

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

    An implicant of a formula \(\psi \) is a formula \(\phi \) such that \(\phi \models \psi \). It is the dual notion of that of implicates.

  2. 2.

    However, Theorem 2 only holds if the proof procedure is terminating and complete.

  3. 3.

    This can be checked by computing the weakest precondition of \(\phi \) w.r.t. Lines 1, 2. The obtained formula is \(\mathbf {head}(\mathbf {list}(1,\mathbf {nil})) = \mathbf {length}(\mathbf {list}(1,\mathbf {nil}))\) which is equivalent to \(\top \) (w.r.t. the usual definitions of \(\mathbf {list}\) and \(\mathbf {head}\)).

  4. 4.

    https://arxiv.org/abs/1906.11033.

  5. 5.

    Those are the three solvers the Why3 documentation recommends to work with as an initial setup. (see also http://why3.lri.fr/@External Provers.).

  6. 6.

    The AltErgo interface provided by the tool uses an SMTlib2 interface that is under heavy development and that, in practice, does not work well with the examples we send it.

  7. 7.

    The translation was done by hand.

References

  1. http://toccata.lri.fr/gallery/

  2. http://pauillac.inria.fr/~levy//why3/sorting/

  3. https://www.lri.fr/~sboldo/research.html

  4. Invgen tool. http://pub.ist.ac.at/agupta/invgen/

  5. Neclabs NECLA verification benchmarks. http://www.nec-labs.com/research/system/systemsSAV-website/benchmarks.php

  6. SATCONV benchmarks

    Google Scholar 

  7. Abdulot framework/GPiD-Ilinva tool suite. https://github.com/sellamiy/GPiD-Framework

  8. Beyer, D., Henzinger, T.A., Majumdar, R., Rybalchenko, A.: Invariant synthesis for combined theories. In: Proceedings of 8th International Conference on Verification, Model Checking, and Abstract Interpretation, VMCAI 2007, Nice (2007)

    Google Scholar 

  9. Bradley, A.R.: IC3 and beyond: incremental, inductive verification. In: Madhusudan, P., Seshia, S.A. (eds.) CAV 2012. LNCS, vol. 7358, pp. 4–4. Springer, Heidelberg (2012). https://doi.org/10.1007/978-3-642-31424-7_4

    Chapter  Google Scholar 

  10. Bradley, A.R., Manna, Z.: Property-directed incremental invariant generation. Formal Asp. Comput. 20(4–5), 379–405 (2008)

    Article  Google Scholar 

  11. Cousot, P., Halbwachs, N.: Automatic discovery of linear restraints among variables of a program. In: Proceedings of the 5th ACM SIGACT-SIGPLAN Symposium on Principles of Programming Languages, POPL 1978. ACM, New York (1978)

    Google Scholar 

  12. Dijkstra, E.W.: A Discipline of Programming, 1st edn. Prentice Hall PTR, Upper Saddle River (1997)

    MATH  Google Scholar 

  13. Dillig, I., Dillig, T., Li, B., McMillan,: Inductive invariant generation via abductive inference. In: Hosking, A.L., Eugster, P.T., Lopes, C.V. (eds.) Proceedings of OOPSLA 2013, Indianapolis, pp. 443–456. ACM (2013)

    Google Scholar 

  14. Echenim, M., Peltier, N., Sellami, Y.: A generic framework for implicate generation modulo theories. In: Galmiche, D., Schulz, S., Sebastiani, R. (eds.) IJCAR 2018. LNCS (LNAI), vol. 10900, pp. 279–294. Springer, Cham (2018). https://doi.org/10.1007/978-3-319-94205-6_19

    Chapter  Google Scholar 

  15. Ernst, M.D., Cockrell, J., Griswold, W.G., Notkin, D.: Dynamically discovering likely program invariants to support program evolution. In: Proceedings of the 21st International Conference on Software Engineering, ICSE 1999, pp. 213–224. ACM, New York (1999)

    Google Scholar 

  16. Filliâtre, J.-C., Paskevich, A.: Why3 — where programs meet provers. In: Felleisen, M., Gardner, P. (eds.) ESOP 2013. LNCS, vol. 7792, pp. 125–128. Springer, Heidelberg (2013). https://doi.org/10.1007/978-3-642-37036-6_8

    Chapter  Google Scholar 

  17. Flanagan, C., Leino, K.R.M.: Houdini, an annotation assistant for ESC/Java. In: Oliveira, J.N., Zave, P. (eds.) FME 2001. LNCS, vol. 2021, pp. 500–517. Springer, Heidelberg (2001). https://doi.org/10.1007/3-540-45251-6_29. Kindly provide volume number for Ref. [18]

    Chapter  Google Scholar 

  18. Ghilardi, S., Ranise, S.: Backward reachability of array-based systems by SMT solving: termination and invariant synthesis. Logical Methods Comput. Sci. 6(4) (2010)

    Google Scholar 

  19. Henzinger, T.A., Jhala, R., Majumdar, R., Sutre, G.: Software verification with BLAST. In: Ball, T., Rajamani, S.K. (eds.) SPIN 2003. LNCS, vol. 2648, pp. 235–239. Springer, Heidelberg (2003). https://doi.org/10.1007/3-540-44829-2_17

    Chapter  MATH  Google Scholar 

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

    Article  Google Scholar 

  21. Kapur, D.: A quantifier-elimination based heuristic for automatically generating inductive assertions for programs. J. Syst. Sci. Complex. 19, 307–330 (2006)

    Article  MathSciNet  Google Scholar 

  22. Karbyshev, A., Bjørner, N., Itzhaky, S., Rinetzky, N., Shoham, S.: Property-directed inference of universal invariants or proving their absence. J. ACM 64(1), 71–733 (2017)

    Article  MathSciNet  Google Scholar 

  23. Kovács, L., Voronkov, A.: Finding loop invariants for programs over arrays using a theorem prover. In: Proceedings of the 12th International Conference on Fundamental Approaches to Software Engineering, FASE 2009, Held as Part of the Joint European Conferences on Theory and Practice of Software, ETAPS 2009, York, UK, 22–29 March 2009, pp. 470–485 (2009)

    Google Scholar 

  24. Kovács, L., Voronkov, A.: Interpolation and symbol elimination. In: Schmidt, R.A. (ed.) CADE 2009. LNCS (LNAI), vol. 5663, pp. 199–213. Springer, Heidelberg (2009). https://doi.org/10.1007/978-3-642-02959-2_17

    Chapter  Google Scholar 

  25. Miné, A.: The octagon abstract domain. Higher Order Symbol. Comput. 19, 31–100 (2006)

    Article  Google Scholar 

  26. Padon, O., Immerman, N., Shoham, S., Karbyshev, A., Sagiv, M.: Decidability of inferring inductive invariants. In: Proceedings of the 43rd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2016, St. Petersburg, FL, USA, 20–22 January 2016, pp. 217–231 (2016)

    Google Scholar 

  27. Suzuki, N., Ishihata, K.: Implementation of an array bound checker (1977)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Yanis Sellami .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2019 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Echenim, M., Peltier, N., Sellami, Y. (2019). Ilinva: Using Abduction to Generate Loop Invariants. In: Herzig, A., Popescu, A. (eds) Frontiers of Combining Systems. FroCoS 2019. Lecture Notes in Computer Science(), vol 11715. Springer, Cham. https://doi.org/10.1007/978-3-030-29007-8_5

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-29007-8_5

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-29006-1

  • Online ISBN: 978-3-030-29007-8

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics