Program Extraction from Large Proof Developments

  • Luís Cruz-Filipe
  • Bas Spitters
Part of the Lecture Notes in Computer Science book series (LNCS, volume 2758)


It is well known that mathematical proofs often contain (abstract) algorithms, but although these algorithms can be understood by a human, it still takes a lot of time and effort to implement these algorithms on a computer; moreover, one runs the risk of making mistakes in the process.

From a fully formalized constructive proof one can automatically obtain a computer implementation of such an algorithm together with a proof that the program is correct. As an example we consider the fundamental theorem of algebra which states that every non-constant polynomial has a root. This theorem has been fully formalized in the Coq proof assistant. Unfortunately, when we first tried to extract a program, the computer ran out of resources. We will discuss how we used logical techniques to make it possible to extract a feasible program. This example is used as a motivation for a broader perspective on how the formalization of mathematics should be done with program extraction in mind.


Program extraction Constructive mathematics Formalized mathematics Type Theory 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Barendregt, H.P.: Lambda calculi with types. In: Handbook of logic in computer science, vol. 2, pp. 117–309. Oxford Univ. Press, New York (1992)Google Scholar
  2. 2.
    Bishop, E.: Foundations of Constructive Analysis. McGraw-Hill Book Company, New York (1967)zbMATHGoogle Scholar
  3. 3.
    Bishop, E.: Mathematics as a numerical language. In: Intuitionism and Proof Theory (Proceedings of the summer Conference at Buffalo, N.Y., 1968), pp. 53–71. North-Holland, Amsterdam (1970)CrossRefGoogle Scholar
  4. 4.
    Capretta, V.: Abstraction and Computation. PhD thesis, University of Nijmegen (2002)Google Scholar
  5. 5.
    Carlström, J.: Subsets, quotients and partial functions in martin-löf’s type theory. In: Geuvers, H., Wiedijk, F. (eds.) TYPES 2002. LNCS, vol. 2646, pp. 78–94. Springer, Heidelberg (2003) (to appear)CrossRefGoogle Scholar
  6. 6.
    Ciaffaglione, A., Gianantonio, P.D.: A co-inductive approach to real numbers. In: Coquand, T., Nordström, B., Dybjer, P., Smith, J. (eds.) TYPES 1999. LNCS, vol. 1956, pp. 114–130. Springer, Heidelberg (2000)CrossRefGoogle Scholar
  7. 7.
    Courant, J.: MC2: A module calculus for pure type systems. Technical Report 1292, LRI (September 2001)Google Scholar
  8. 8.
    Fernández, M., Mackie, I., Severi, P., Szasz, N.: A uniform approach to program extraction: Pure type systems with ultra σ-types,
  9. 9.
    Geuvers, H.: Inconsistency of classical logic in type theory,
  10. 10.
    Geuvers, H., Pollack, R., Wiedijk, F., Zwanenburg, J.: The algebraic hierarchy of the FTA Project. In: Linton, S.S. (ed.) Journal of Symbolic Computation, Special Issue on the Integration of Automated Reasoning and Computer Algebra Systems, pp. 271–286. Elsevier, Amsterdam (2002)Google Scholar
  11. 11.
    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)CrossRefGoogle Scholar
  12. 12.
    Grégoire, B., Leroy, X.: A compiled implementation of strong reduction. In: Proceedings ICFP 2002 (2002)Google Scholar
  13. 13.
    Letouzey, P.: A new extraction for Coq. In: Geuvers, H., Wiedijk, F. (eds.) TYPES 2002. LNCS, vol. 2646, pp. 200–219. Springer, Heidelberg (2003)CrossRefGoogle Scholar
  14. 14.
    Martin-Löf, P.: Constructive mathematics and computer science. In: Logic, Methodology and the Philosophy of Science VI, pp. 153–175. North-Holland, Amsterdam (1982)CrossRefGoogle Scholar
  15. 15.
    Niqui, M.: Exact arithmetic on Stern-Brocot tree, (2003) (submitted)Google Scholar
  16. 16.
    Paulin-Mohring, C.: Extracting ’s programs from proofs in the Calulus of Constructions. In: Sixteenth Annual ACM Symposium on Principles of Programming Languages, Austin. ACM, New York (1989)Google Scholar
  17. 17.
    Pottier, L.: Quotients dans le CCI. Technical Report RR-4053, INRIA (November 2000),
  18. 18.
    Prost, F.: Marking techniques for extraction. Technical Report 95-47, Laboratoire de l’informatique du Parallélisme, Ecole Normale Supérieure de Lyon (1995)Google Scholar
  19. 19.
    Schwichtenberg, H.: Minimal logic for computable functionals. Technical report, Mathematisches Institut der Universität München (2002)Google Scholar
  20. 20.
    The Coq Development Team. The Coq Proof Assistant Reference Manual Version 7.3. INRIA-Rocquencourt (2002)Google Scholar
  21. 21.
    Troelstra, A.S.: Realizability. Handbook of Proof Theory, pp. 407–473. North-Holland, Amsterdam (1998)Google Scholar
  22. 22.
    Troelstra, A.S., van Dalen, D.: Constructivism in mathematics. An introduction. Studies in Logic and the Foundations of Mathematics, vol. 123. North-Holland, Amsterdam (1988)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2003

Authors and Affiliations

  • Luís Cruz-Filipe
    • 1
    • 2
  • Bas Spitters
    • 1
  1. 1.University of NijmegenThe Netherlands
  2. 2.Center for Logic and ComputationPortugal

Personalised recommendations