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.
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
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)
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)
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)
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)
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)
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)
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)
Blanqui, F.: Definitions by rewriting in the calculus of constructions. Mathematical Structures in Computer Science 15(1), 37–92 (2005)
Bove, A., Capretta, V.: Modelling general recursion in type theory. Mathematical Structures in Computer Science 15, 671–708 (2005)
Cachera, D., Jensen, T., Pichardie, D., Rusu, V.: Extracting a data flow analyzer in constructive logic. Theoretical Computer Science 342 (2005) (to appear)
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)
Capretta, V.: General recursion via coinductive types. Logical Methods in Computer Science 1(2), 1–18 (2005)
Coq Development Team. The Coq Proof Assistant User’s Guide. Version 8.0 (January 2004)
Dybjer, P.: A general formulation of simultaneous inductive-recursive definitions in type theory. Journal of Symbolic Logic 65(2), 525–549 (2000)
Gordon, M.J.C., Melham, T.F. (eds.): Introduction to HOL: A theorem proving environment for higher-order logic. Cambridge University Press, Cambridge (1993)
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)
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)
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)
McBride, C., McKinna, J.: The view from the left. Journal of Functional Programming 14, 69–111 (2004)
Nipkow, T., Paulson, L.C., Wenzel, M.T.: Isabelle/HOL: A Proof Assistant for Higher-Order Logic. LNCS, vol. 2283. Springer, Heidelberg (2002)
Nordström, B.: Terminating general recursion. BIT 28(3), 605–619 (1988)
Color Project, http://color.inria.fr
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)
Slind, K.: Reasoning about Terminating Functional Programs. PhD thesis, TU Münich (1999)
Xi, H.: Dependent types for program termination verification. Higher-Order and Symbolic Computation 15(1), 91–131 (2002)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights 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)