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

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.

[1]  Amy P. Felty,et al.  The Coq proof assistant user's guide : version 5.6 , 1990 .

[2]  M. Gordon,et al.  Introduction to HOL: a theorem proving environment for higher order logic , 1993 .

[3]  Frédéric Blanqui Definitions by rewriting in the Calculus of Constructions , 2005, Math. Struct. Comput. Sci..

[4]  Xavier Leroy,et al.  Formal certification of a compiler back-end or: programming a compiler with a proof assistant , 2006, POPL '06.

[5]  Venanzio Capretta,et al.  Modelling general recursion in type theory , 2005, Mathematical Structures in Computer Science.

[6]  Bas Luttik,et al.  Split-2 bisimilarity has a finite axiomatization over CCS with Hennessy's merge , 2004, Log. Methods Comput. Sci..

[7]  Lawrence Charles Paulson,et al.  Isabelle/HOL: A Proof Assistant for Higher-Order Logic , 2002 .

[8]  Benjamin Grégoire,et al.  Proving Equalities in a Commutative Ring Done Right in Coq , 2005, TPHOLs.

[9]  Venanzio Capretta,et al.  Type-Theoretic Functional Semantics , 2002, TPHOLs.

[10]  Pierre Courtieu,et al.  Efficient Reasoning about Executable Specifications in Coq , 2002, TPHOLs.

[11]  Gilles Barthe,et al.  A Formal Executable Semantics of the JavaCard Platform , 2001, ESOP.

[12]  Venanzio Capretta,et al.  General recursion via coinductive types , 2005, Log. Methods Comput. Sci..

[13]  Peter Dybjer,et al.  A general formulation of simultaneous inductive-recursive definitions in type theory , 2000, Journal of Symbolic Logic.

[14]  Tobias Nipkow,et al.  Executing Higher Order Logic , 2000, TYPES.

[15]  Hitoshi Kiya,et al.  Pipelined LMS adaptive filter using a new look-ahead transformation , 1999 .

[16]  Luís Pinto,et al.  Type-based termination of recursive definitions , 2004, Mathematical Structures in Computer Science.

[17]  Hitoshi Kiya,et al.  Pipelined LMS adaptive filter using a new look-ahead transformation , 1997, Proceedings of 1997 IEEE International Symposium on Circuits and Systems. Circuits and Systems in the Information Age ISCAS '97.

[18]  David Cachera,et al.  Embedding of Systems of Affine Recurrence Equations in Coq , 2003, TPHOLs.

[19]  P. Medawar A view from the left , 1984, Nature.

[20]  David Aspinall,et al.  Formalising Java's Data Race Free Guarantee , 2007, TPHOLs.

[21]  Bengt Nordström Terminating general recursion , 1988, BIT Comput. Sci. Sect..

[22]  Hongwei Xi Dependent Types for Program Termination Verification , 2002, High. Order Symb. Comput..

[23]  Konrad Slind,et al.  Reasoning about terminating functional programs , 1999 .

[24]  Hongwei Xi,et al.  Dependent Types for Program Termination Verification , 2001, Proceedings 16th Annual IEEE Symposium on Logic in Computer Science.

[25]  Pierre Castéran,et al.  Interactive Theorem Proving and Program Development , 2004, Texts in Theoretical Computer Science An EATCS Series.

[26]  David Cachera,et al.  Extracting a Data Flow Analyser in Constructive Logic , 2004, ESOP.

[27]  Yves Bertot,et al.  Fix-Point Equations for Well-Founded Recursion in Type Theory , 2000, TPHOLs.

[28]  Maribel Fernández,et al.  Curry-Style Types for Nominal Terms , 2006, TYPES.