Skip to main content

Introduction to the Coq Proof-Assistant for Practical Software Verification

  • Chapter

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

Abstract

This paper is a tutorial on using the Coq proof-assistant for reasoning on software correctness. It illustrates features of Coq like inductive definitions and proof automation on a few examples including arithmetic, algorithms on functional and imperative lists and cryptographic protocols.

Coq is not a tool dedicated to software verification but a general purpose environment for developing mathematical proofs. However, it is based on a powerful language including basic functional programming and high-level specifications. As such it offers modern ways to literally program proofs in a structured way with advanced data-types, proofs by computation, and general purpose libraries of definitions and lemmas.

Coq is well suited for software verification of programs involving advanced specifications like language semantics and real numbers. The Coq architecture is also based on a small trusted kernel, making possible to use third-party libraries while being sure that proofs are not compromised.

This is a preview of subscription content, log in via an institution.

Buying options

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

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Gonthier, G., Mahboubi, A., Tassi, E.: A small scale reflection extension for the Coq system. Technical report, Microsoft Research - Inria Joint Centre (MSR - INRIA) (2011), http://hal.inria.fr/inria-00258384

  2. Armand, M., Faure, G., Grégoire, B., Keller, C., Théry, L., Werner, B.: A Modular Integration of SAT/SMT Solvers to Coq through Proof Witnesses. In: Jouannaud, J.-P., Shao, Z. (eds.) CPP 2011. LNCS, vol. 7086, pp. 135–150. Springer, Heidelberg (2011)

    Chapter  Google Scholar 

  3. Armand, M., Grégoire, B., Spiwack, A., Théry, L.: Extending Coq with Imperative Features and Its Application to SAT Verification. In: Kaufmann, M., Paulson, L.C. (eds.) ITP 2010. LNCS, vol. 6172, pp. 83–98. Springer, Heidelberg (2010)

    Chapter  Google Scholar 

  4. Asperti, A., Coen, C.S., et al.: Matita, http://matita.cs.unibo.it/

  5. Aspinall, D.: Proof general, http://proofgeneral.inf.ed.ac.uk/

  6. Audebaud, P., Paulin-Mohring, C.: Proofs of randomized algorithms in Coq. Science of Computer Programming 74(8), 568–589 (2009)

    Article  MathSciNet  MATH  Google Scholar 

  7. Barthe, G., Grégoire, B., Béguelin, S.Z.: Formal certification of code-based cryptographic proofs. In: 36th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2009, pp. 90–101. ACM (2009), http://www.msr-inria.inria.fr/projects/sec/certicrypt

  8. Bertot, Y.: Coq in a Hurry. Technical report, MARELLE - INRIA Sophia Antipolis (May 2010)

    Google Scholar 

  9. Bertot, Y., Castéran, P.: Interactive Theorem Proving and Program Development. Coq’Art: The Calculus of Inductive Constructions. Springer (2004), http://www.labri.fr/perso/casteran/CoqArt

  10. Bobot, F., Filliâtre, J.-C., Marché, C., Paskevich, A.: Why3: Shepherd your herd of provers. In: Boogie 2011: First International Workshop on Intermediate Verification Languages, Wrocław, Poland (August 2011)

    Google Scholar 

  11. Boldo, S., Clément, F., Filliâtre, J.-C., Mayero, M., Melquiond, G., Weis, P.: Formal Proof of a Wave Equation Resolution Scheme: The Method Error. In: Kaufmann, M., Paulson, L.C. (eds.) ITP 2010. LNCS, vol. 6172, pp. 147–162. Springer, Heidelberg (2010), http://hal.inria.fr/hal-00649240/PDF/RR-7826.pdf

    Chapter  Google Scholar 

  12. Boldo, S., Melquiond, G.: Flocq: A unified library for proving floating-point algorithms in Coq. In: Antelo, E., Hough, D., Ienne, P. (eds.) Proceedings of the 20th IEEE Symposium on Computer Arithmetic, Tübingen, Germany, pp. 243–252 (2011), http://flocq.gforge.inria.fr/

  13. Bolignano, D.: An approach to the formal verification of cryptographic protocols. In: CCS 1996 Proceedings of the 3rd ACM Conference on Computer and Communications Security (1996)

    Google Scholar 

  14. Chetali, B., Nguyen, Q.-H.: About the world-first smart card certificate with EAL7 formal assurances. In: Slides 9th ICCC, Jeju, Korea (September 2008), www.commoncriteriaportal.org/iccc/9iccc/pdf/B2404.pdf

  15. Chlipala, A.: Certified Programming with Dependent Types. MIT Press (2011), http://adam.chlipala.net/cpdt/

  16. Constable, R.L., Bates, J.L., Kreitz, C., van Renesse, R., et al.: Prl: Proof/program refinement logic, http://www.cs.cornell.edu/info/projects/nuprl/

  17. Contejean, E., Paskevich, A., Urbain, X., Courtieu, P., Pons, O., Forest, J.: A3pat, an approach for certified automated termination proofs. In: Gallagher, J.P., Voigtländer, J. (eds.) Proceedings of the 2010 ACM SIGPLAN Workshop on Partial Evaluation and Program Manipulation, PEPM 2010, pp. 63–72. ACM (2010)

    Google Scholar 

  18. Coquand, C., Coquand, T., Nurell, U., et al.: Agda, http://wiki.portal.chalmers.se/agda

  19. Coquand, T., Huet, G.: Constructions: a Higher-order Proof System for Mechanizing Mathematics. In: Buchberger, B. (ed.) ISSAC 1985 and EUROCAL 1985. LNCS, vol. 203, pp. 151–184. Springer, Heidelberg (1985)

    Google Scholar 

  20. Daumas, M., Melquiond, G.: Certification of bounds on expressions involving rounded operators. Transactions on Mathematical Software 37(1) (2010)

    Google Scholar 

  21. Delahaye, D.: A Proof Dedicated Meta-Language. In: Pfenning, F. (ed.) Logical Frameworks and Meta-Languages (LFM), Copenhagen (Denmark). Electronic Notes in Theoretical Computer Science (ENTCS), vol. 70(2), pp. 96–109. Elsevier (2002)

    Google Scholar 

  22. The Frama-C platform for static analysis of C programs, http://www.frama-c.cea.fr/

  23. Geuvers, H., Wiedijk, F., Zwanenburg, J.: A Constructive Proof of the Fundamental Theorem of Algebra without Using the Rationals. In: Callaghan, P., Luo, Z., McKinna, J., Pollack, R. (eds.) TYPES 2000. LNCS, vol. 2277, pp. 96–111. Springer, Heidelberg (2002), http://www.cs.ru.nl/~freek/fta/

    Chapter  Google Scholar 

  24. Gonthier, G.: Formal proof the four-color theorem. Notices of the AMS 55(11), 1382–1393 (2008), http://www.ams.org/notices/200811/tx081101382p.pdf

    MathSciNet  MATH  Google Scholar 

  25. Gonthier, G.: Advances in the Formalization of the Odd Order Theorem. In: van Eekelen, M., Geuvers, H., Schmaltz, J., Wiedijk, F. (eds.) ITP 2011. LNCS, vol. 6898, p. 2. Springer, Heidelberg (2011)

    Chapter  Google Scholar 

  26. Hales, T.: Flyspeck project. The purpose of the flyspeck project is to produce a formal proof of the Kepler Conjecture, http://code.google.com/p/flyspeck/

  27. Harrison, J.: The HOL Light theorem prover, http://www.cl.cam.ac.uk/~jrh13/hol-light/

  28. Harrison, J.V.: A Machine-Checked Theory of Floating Point Arithmetic. In: Bertot, Y., Dowek, G., Hirschowitz, A., Paulin, C., Théry, L. (eds.) TPHOLs 1999. LNCS, vol. 1690, pp. 113–130. Springer, Heidelberg (1999)

    Chapter  Google Scholar 

  29. Leroy, X.: Formal verification of a realistic compiler. Communications of the ACM 52(7), 107–115 (2009), http://compcert.inria.fr/

    Article  Google Scholar 

  30. Letouzey, P.: Extraction in Coq: An Overview. In: Beckmann, A., Dimitracopoulos, C., Löwe, B. (eds.) CiE 2008. LNCS, vol. 5028, pp. 359–369. Springer, Heidelberg (2008)

    Chapter  Google Scholar 

  31. McBride, C., et al.: Epigram 2: an experimental dependently typed functional programming language, http://www.e-pig.org/darcs/Pig09/web/

  32. Morrisett, G., et al.: The Ynot project, http://ynot.cs.harvard.edu/

  33. Norrish, M., Slind, K., et al.: HOL theorem-proving system (HOL4), http://hol.sourceforge.net/

  34. University of Pennsylvania & University of Cambridge. The POPLmark challenge (2006), https://alliance.seas.upenn.edu/~plclub/cgi-bin/poplmark/

  35. Owre, S., Rushby, J., Shankar, N., et al.: PVS specification and verification system, http://pvs.csl.sri.com/

  36. Paulson, L., Nipkow, T., Wenzel, M.: Isabelle, http://www.cl.cam.ac.uk/research/hvg/isabelle

  37. Pierce, B.C., Casinghino, C., Greenberg, M., Sjöberg, V., Yorgey, B.: Software Foundations. University of Pennsylvania (2011), http://www.cis.upenn.edu/~bcpierce/sf/

  38. Sozeau, M.: Programing finger trees in Coq. In: Hinze, R., Ramsey, N. (eds.) Proceedings of the 12th ACM SIGPLAN International Conference on Functional Programming, ICFP 2007, pp. 13–24. ACM (2007)

    Google Scholar 

  39. The Coq Development Team. The Coq Proof Assistant Reference Manual – Version V8.3 (2010), http://coq.inria.fr

  40. Théry, L., Hanrot, G.: Primality Proving with Elliptic Curves. In: Schneider, K., Brandt, J. (eds.) TPHOLs 2007. LNCS, vol. 4732, pp. 319–333. Springer, Heidelberg (2007), http://coqprime.gforge.inria.fr/

    Chapter  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2012 Springer-Verlag Berlin Heidelberg

About this chapter

Cite this chapter

Paulin-Mohring, C. (2012). Introduction to the Coq Proof-Assistant for Practical Software Verification. In: Meyer, B., Nordio, M. (eds) Tools for Practical Software Verification. LASER 2011. Lecture Notes in Computer Science, vol 7682. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-35746-6_3

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-35746-6_3

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-35745-9

  • Online ISBN: 978-3-642-35746-6

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics