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
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsPreview
Unable to display preview. Download preview PDF.
References
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
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)
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)
Asperti, A., Coen, C.S., et al.: Matita, http://matita.cs.unibo.it/
Aspinall, D.: Proof general, http://proofgeneral.inf.ed.ac.uk/
Audebaud, P., Paulin-Mohring, C.: Proofs of randomized algorithms in Coq. Science of Computer Programming 74(8), 568–589 (2009)
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
Bertot, Y.: Coq in a Hurry. Technical report, MARELLE - INRIA Sophia Antipolis (May 2010)
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
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)
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
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/
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)
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
Chlipala, A.: Certified Programming with Dependent Types. MIT Press (2011), http://adam.chlipala.net/cpdt/
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/
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)
Coquand, C., Coquand, T., Nurell, U., et al.: Agda, http://wiki.portal.chalmers.se/agda
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)
Daumas, M., Melquiond, G.: Certification of bounds on expressions involving rounded operators. Transactions on Mathematical Software 37(1) (2010)
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)
The Frama-C platform for static analysis of C programs, http://www.frama-c.cea.fr/
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/
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
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)
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/
Harrison, J.: The HOL Light theorem prover, http://www.cl.cam.ac.uk/~jrh13/hol-light/
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)
Leroy, X.: Formal verification of a realistic compiler. Communications of the ACM 52(7), 107–115 (2009), http://compcert.inria.fr/
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)
McBride, C., et al.: Epigram 2: an experimental dependently typed functional programming language, http://www.e-pig.org/darcs/Pig09/web/
Morrisett, G., et al.: The Ynot project, http://ynot.cs.harvard.edu/
Norrish, M., Slind, K., et al.: HOL theorem-proving system (HOL4), http://hol.sourceforge.net/
University of Pennsylvania & University of Cambridge. The POPLmark challenge (2006), https://alliance.seas.upenn.edu/~plclub/cgi-bin/poplmark/
Owre, S., Rushby, J., Shankar, N., et al.: PVS specification and verification system, http://pvs.csl.sri.com/
Paulson, L., Nipkow, T., Wenzel, M.: Isabelle, http://www.cl.cam.ac.uk/research/hvg/isabelle
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/
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)
The Coq Development Team. The Coq Proof Assistant Reference Manual – Version V8.3 (2010), http://coq.inria.fr
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/
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights 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)