Abstract
In his book “The Art of Computer Programming”, Donald Knuth gives an algorithm to compute the first n prime numbers. Surprisingly, proving the correctness of this simple algorithm from basic principles is far from being obvious and requires a wide range of verification techniques. In this paper, we explain how the verification has been mechanised in the Coq proof system.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Agrawal, M., Kayal, N., Saxena, N.: PRIMES is in P. Preprint (2002), Available at http://www.cse.iit.ac.in/primality.pdf
Aigner, M., Ziegler, G.M.: Proofs from THE BOOK. Springer, Heidelberg (1998)
Almeida, J.C., Théry, L.: Correctness of the RSA algorithm. Coq contribution (1999), Available at http://coq.inria.fr/contribs/summary.html
Bertot, Y., Magaud, N., Zimmermann, P.: A GMP program computing square roots and its proof within Coq. Journal of Automated Reasoning 29(3-4) (2002)
Caprotti, O., Oostdijk, M.: Formal and Efficient Primality Proofs by Use of Computer Algebra Oracles. Journal of Symbolic Computation 32(1), 55–70 (2001)
Erdös, P.: Beweis eines Satzes von Tschebyschef. Acta Scientifica Mathematica 5, 194–198 (1932)
Filliâtre, J.-C.: Proof of Imperative Programs in Type Theory. In: Altenkirch, T., Naraschewski, W., Reus, B. (eds.) TYPES 1998. LNCS, vol. 1657, p. 78. Springer, Heidelberg (1999)
Harrison, J.: Floating Point Verification in HOL. In: Schubert, E.T., Alves-Foss, J., Windley, P. (eds.) HUG 1995. LNCS, vol. 971, pp. 186–199. Springer, Heidelberg (1995)
Harrison, J., Théry, L.: A Skeptic’s Approach to Combining HOL and Maple. Journal of Automated Reasoning 21(3), 279–294 (1998)
Hoare, C.A.R.: An Axiomatic Basis for Computer Programming. Communication of the ACM 12(10), 576–580, 583 (1969)
Hurd, J.: Formal Verification of Probabilistic Algorithms. Phd Thesis, University of Cambridge (2002)
Knuth, D.E.: The Art of Computer Programming: Fundamental Algorithms, pp. 147–149. Addison-Wesley, Reading (1997)
PCoq. A Graphical User-interface to Coq, Available at http://www-sop.inria.fr/lemme/pcoq/
Quaife, A.: Automated development of fundamental mathematical theories. Automated reasoning series, vol. 2. Kluwer, Dordrecht (1992)
Slinko, A.: Number Theory. Tutorial 5: Bertrand’s Postulate, Available at http://matholymp.com/tutorials/bertrand.pdf
Théry, L.: A Tour of Formal Verification with Coq: Knuth’s Algorithm for Prime Numbers. Research Report 4600, INRIA (2002)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2003 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Théry, L. (2003). Proving Pearl: Knuth’s Algorithm for Prime Numbers. In: Basin, D., Wolff, B. (eds) Theorem Proving in Higher Order Logics. TPHOLs 2003. Lecture Notes in Computer Science, vol 2758. Springer, Berlin, Heidelberg. https://doi.org/10.1007/10930755_20
Download citation
DOI: https://doi.org/10.1007/10930755_20
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-40664-8
Online ISBN: 978-3-540-45130-3
eBook Packages: Springer Book Archive