Skip to main content

Defining and Reasoning About Recursive Functions: A Practical Tool for the Coq Proof Assistant

  • Conference paper
Book cover Functional and Logic Programming (FLOPS 2006)

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

Included in the following conference series:

Abstract

We present a practical tool for defining and proving properties of recursive functions in the Coq proof assistant. The tool generates from pseudo-code the graph of the intended function as an inductive relation. Then it proves that the relation actually represents a function, which is by construction the function that we are trying to define. Then, we generate induction and inversion principles, and a fixpoint equation for proving other properties of the function. Our tool builds upon state-of-the-art techniques for defining recursive functions, and can also be used to generate executable functions from inductive descriptions of their graph. We illustrate the benefits of our tool on two case studies.

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

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Balaa, A., Bertot, Y.: Fix-point equations for well-founded recursion in type theory. In: Aagaard, M.D., Harrison, J. (eds.) TPHOLs 2000. LNCS, vol. 1869, pp. 1–16. Springer, Heidelberg (2000)

    Chapter  Google Scholar 

  2. Barthe, G., Courtieu, P.: Efficient Reasoning about Executable Specifications in Coq. In: Carreño, V.A., Muñoz, C.A., Tahar, S. (eds.) TPHOLs 2002. LNCS, vol. 2410, pp. 31–46. Springer, Heidelberg (2002)

    Chapter  Google Scholar 

  3. Barthe, G., Dufay, G., Jakubiec, L., Serpette, B., de Sousa, S.M.: A Formal Executable Semantics of the JavaCard Platform. In: Sands, D. (ed.) ESOP 2001. LNCS, vol. 2028, pp. 302–319. Springer, Heidelberg (2001)

    Chapter  Google Scholar 

  4. Barthe, G., Frade, M.J., Giménez, E., Pinto, L., Uustalu, T.: Type-based termination of recursive definitions. Mathematical Structures in Computer Science 14, 97–141 (2004)

    Article  MathSciNet  MATH  Google Scholar 

  5. Berghofer, S., Nipkow, T.: Executing higher order logic. In: Callaghan, P., Luo, Z., McKinna, J., Pollack, R. (eds.) TYPES 2000. LNCS, vol. 2277, pp. 24–40. Springer, Heidelberg (2002)

    Chapter  Google Scholar 

  6. Bertot, Y., Capretta, V., Das Barman, K.: Type-theoretic functional semantics. In: Carreño, V.A., Muñoz, C.A., Tahar, S. (eds.) TPHOLs 2002. LNCS, vol. 2410, pp. 83–98. Springer, Heidelberg (2002)

    Chapter  Google Scholar 

  7. Bertot, Y., Castéran, P.: Interactive Theorem Proving and Program Development— Coq’Art: The Calculus of Inductive Constructions. Texts in Theoretical Computer Science. Springer, Heidelberg (2004)

    Book  MATH  Google Scholar 

  8. Blanqui, F.: Definitions by rewriting in the calculus of constructions. Mathematical Structures in Computer Science 15(1), 37–92 (2005)

    Article  MathSciNet  MATH  Google Scholar 

  9. Bove, A., Capretta, V.: Modelling general recursion in type theory. Mathematical Structures in Computer Science 15, 671–708 (2005)

    Article  MathSciNet  MATH  Google Scholar 

  10. Cachera, D., Jensen, T., Pichardie, D., Rusu, V.: Extracting a data flow analyzer in constructive logic. Theoretical Computer Science 342 (2005) (to appear)

    Google Scholar 

  11. Cachera, D., Pichardie, D.: Embedding of Systems of Affine Recurrence Equations in Coq. In: Basin, D., Wolff, B. (eds.) TPHOLs 2003. LNCS, vol. 2758, pp. 155–170. Springer, Heidelberg (2003)

    Chapter  Google Scholar 

  12. Capretta, V.: General recursion via coinductive types. Logical Methods in Computer Science 1(2), 1–18 (2005)

    Article  MathSciNet  MATH  Google Scholar 

  13. Coq Development Team. The Coq Proof Assistant User’s Guide. Version 8.0 (January 2004)

    Google Scholar 

  14. Dybjer, P.: A general formulation of simultaneous inductive-recursive definitions in type theory. Journal of Symbolic Logic 65(2), 525–549 (2000)

    Article  MathSciNet  MATH  Google Scholar 

  15. Gordon, M.J.C., Melham, T.F. (eds.): Introduction to HOL: A theorem proving environment for higher-order logic. Cambridge University Press, Cambridge (1993)

    MATH  Google Scholar 

  16. Grégoire, B., Mahboubi, A.: Proving equalities in a commutative ring done right in coq. In: Hurd, J., Melham, T. (eds.) TPHOLs 2005. LNCS, vol. 3603, pp. 98–113. Springer, Heidelberg (2005)

    Chapter  Google Scholar 

  17. Katsushige, M., Kiyoshi, N., Hitoshi, K.: Pipelined LMS Adaptative Filter Using a New Look-Ahead Transformation. IEEE Transactions on Circuits and Systems 46, 51–55 (1999)

    Article  Google Scholar 

  18. Leroy, X.: Formal certification of a compiler back-end, or: programming a compiler with a proof assistant. In: Proceedings of POPL 2006. ACM Press, New York (2006)

    Google Scholar 

  19. McBride, C., McKinna, J.: The view from the left. Journal of Functional Programming 14, 69–111 (2004)

    Article  MathSciNet  MATH  Google Scholar 

  20. Nipkow, T., Paulson, L.C., Wenzel, M.T.: Isabelle/HOL: A Proof Assistant for Higher-Order Logic. LNCS, vol. 2283. Springer, Heidelberg (2002)

    MATH  Google Scholar 

  21. Nordström, B.: Terminating general recursion. BIT 28(3), 605–619 (1988)

    Article  MathSciNet  MATH  Google Scholar 

  22. Color Project, http://color.inria.fr

  23. Shankar, N., Owre, S., Rushby, J.M.: The PVS Proof Checker: A Reference Manual. Computer Science Laboratory, SRI International (February 1993); Supplemented with the PVS2 Quick Reference Manual (1997)

    Google Scholar 

  24. Slind, K.: Reasoning about Terminating Functional Programs. PhD thesis, TU Münich (1999)

    Google Scholar 

  25. Xi, H.: Dependent types for program termination verification. Higher-Order and Symbolic Computation 15(1), 91–131 (2002)

    Article  MATH  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2006 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Barthe, G., Forest, J., Pichardie, D., Rusu, V. (2006). Defining and Reasoning About Recursive Functions: A Practical Tool for the Coq Proof Assistant. In: Hagiya, M., Wadler, P. (eds) Functional and Logic Programming. FLOPS 2006. Lecture Notes in Computer Science, vol 3945. Springer, Berlin, Heidelberg. https://doi.org/10.1007/11737414_9

Download citation

  • DOI: https://doi.org/10.1007/11737414_9

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-33438-5

  • Online ISBN: 978-3-540-33439-2

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics