Producing Certified Functional Code from Inductive Specifications

  • Pierre-Nicolas Tollitte
  • David Delahaye
  • Catherine Dubois
Part of the Lecture Notes in Computer Science book series (LNCS, volume 7679)


Proof assistants based on type theory allow the user to adopt either a functional style, or a relational style (e.g., by using inductive types). Both styles have pros and cons. Relational style may be preferred because it allows the user to describe only what is true, discard momentarily the termination question, and stick to a rule-based description. However, a relational specification is usually not executable. This paper proposes to turn an inductive specification into a functional one, in the logical setting itself, more precisely Coq in this work. We define for a certain class of inductive specifications a way to extract functions from them and automatically produce the proof of soundness of the extracted function w.r.t. its inductive specification. In addition, using user-defined modes which label inputs and outputs, we are able to extract several computational contents from a single inductive type.


Executable Specifications Inductive Relations Functional Code Generation Soundness Proof Generation Coq 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    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)CrossRefGoogle Scholar
  2. 2.
    Berghofer, S., Bulwahn, L., Haftmann, F.: Turning Inductive into Equational Specifications. In: Berghofer, S., Nipkow, T., Urban, C., Wenzel, M. (eds.) TPHOLs 2009. LNCS, vol. 5674, pp. 131–146. Springer, Heidelberg (2009)CrossRefGoogle Scholar
  3. 3.
    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)CrossRefGoogle Scholar
  4. 4.
    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)CrossRefGoogle Scholar
  5. 5.
    Blazy, S., Leroy, X.: Mechanized Semantics for the Clight Subset of the C Language. Journal of Automated Reasoning (JAR) 43(3), 263–288 (2009)zbMATHCrossRefMathSciNetGoogle Scholar
  6. 6.
    Delahaye, D., Dubois, C., Étienne, J.-F.: Extracting Purely Functional Contents from Logical Inductive Types. In: Schneider, K., Brandt, J. (eds.) TPHOLs 2007. LNCS, vol. 4732, pp. 70–85. Springer, Heidelberg (2007)CrossRefGoogle Scholar
  7. 7.
    Le Fessant, F., Maranget, L.: Optimizing Pattern-Matching. In: Pierce, B.C. (ed.) International Conference on Functional Programming (ICFP). SIGPLAN, pp. 26–37. ACM (2001)Google Scholar
  8. 8.
    Leroy, X., Grall, H.: Coinductive Big-Step Operational Semantics. Information and Computation (IC) 207(2), 284–304 (2009)zbMATHCrossRefMathSciNetGoogle Scholar
  9. 9.
    Pfenning, F., Schürmann, C.: System Description: Twelf - A Meta-Logical Framework for Deductive Systems. In: Ganzinger, H. (ed.) CADE 1999. LNCS (LNAI), vol. 1632, pp. 202–206. Springer, Heidelberg (1999)CrossRefGoogle Scholar
  10. 10.
    The Coq Development Team. Coq, version 8.4. INRIA (August 2012),

Copyright information

© Springer-Verlag Berlin Heidelberg 2012

Authors and Affiliations

  • Pierre-Nicolas Tollitte
    • 1
  • David Delahaye
    • 2
  • Catherine Dubois
    • 3
  1. 1.CEDRIC/ENSIIEÉvryFrance
  2. 2.CEDRIC/CNAMParisFrance

Personalised recommendations