Skip to main content
Erschienen in: Journal of Automated Reasoning 5/2020

18.02.2020

The MetaCoq Project

verfasst von: Matthieu Sozeau, Abhishek Anand, Simon Boulier, Cyril Cohen, Yannick Forster, Fabian Kunze, Gregory Malecha, Nicolas Tabareau, Théo Winterhalter

Erschienen in: Journal of Automated Reasoning | Ausgabe 5/2020

Einloggen

Aktivieren Sie unsere intelligente Suche, um passende Fachinhalte oder Patente zu finden.

search-config
loading …

Abstract

The MetaCoq project aims to provide a certified meta-programming environment in Coq. It builds on Template-Coq, a plugin for Coq originally implemented by Malecha (Extensible proof engineering in intensional type theory, Harvard University, http://​gmalecha.​github.​io/​publication/​2015/​02/​01/​extensible-proof-engineering-in-intensional-type-theory.​html, 2014), which provided a reifier for Coq terms and global declarations, as represented in the Coq kernel, as well as a denotation command. Recently, it was used in the CertiCoq certified compiler project (Anand et al., in: CoqPL, Paris, France, http://​conf.​researchr.​org/​event/​CoqPL-2017/​main-certicoq-a-verified-compiler-for-coq, 2017), as its front-end language, to derive parametricity properties (Anand and Morrisett, in: CoqPL’18, Los Angeles, CA, USA, 2018). However, the syntax lacked semantics, be it typing semantics or operational semantics, which should reflect, as formal specifications in Coq, the semantics of Coq ’s type theory itself. The tool was also rather bare bones, providing only rudimentary quoting and unquoting commands. We generalize it to handle the entire polymorphic calculus of cumulative inductive constructions, as implemented by Coq, including the kernel’s declaration structures for definitions and inductives, and implement a monad for general manipulation of Coq ’s logical environment. We demonstrate how this setup allows Coq users to define many kinds of general purpose plugins, whose correctness can be readily proved in the system itself, and that can be run efficiently after extraction. We give a few examples of implemented plugins, including a parametricity translation and a certified extraction to call-by-value \(\lambda \)-calculus. We also advocate the use of MetaCoq as a foundation for higher-level tools.

Sie haben noch keine Lizenz? Dann Informieren Sie sich jetzt über unsere Produkte:

Springer Professional "Wirtschaft+Technik"

Online-Abonnement

Mit Springer Professional "Wirtschaft+Technik" erhalten Sie Zugriff auf:

  • über 102.000 Bücher
  • über 537 Zeitschriften

aus folgenden Fachgebieten:

  • Automobil + Motoren
  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Elektrotechnik + Elektronik
  • Energie + Nachhaltigkeit
  • Finance + Banking
  • Management + Führung
  • Marketing + Vertrieb
  • Maschinenbau + Werkstoffe
  • Versicherung + Risiko

Jetzt Wissensvorsprung sichern!

Springer Professional "Wirtschaft"

Online-Abonnement

Mit Springer Professional "Wirtschaft" erhalten Sie Zugriff auf:

  • über 67.000 Bücher
  • über 340 Zeitschriften

aus folgenden Fachgebieten:

  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Finance + Banking
  • Management + Führung
  • Marketing + Vertrieb
  • Versicherung + Risiko




Jetzt Wissensvorsprung sichern!

Springer Professional "Technik"

Online-Abonnement

Mit Springer Professional "Technik" erhalten Sie Zugriff auf:

  • über 67.000 Bücher
  • über 390 Zeitschriften

aus folgenden Fachgebieten:

  • Automobil + Motoren
  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Elektrotechnik + Elektronik
  • Energie + Nachhaltigkeit
  • Maschinenbau + Werkstoffe




 

Jetzt Wissensvorsprung sichern!

Fußnoten
2
An upcoming extension of Coq [7] with such features could address this mismatch.
 
3
Note that we use a context of arities and de Bruijn indices to refer to the inductive types because they are not yet defined in the current global environment.
 
5
In Coq a proof obligation is a goal which has to be solved to complete a definition. Obligations were introduced by Sozeau [42] in the Program mode.
 
6
The tactic defined in Coq is slightly more general as it allows to consider arbitrary non-propositional formulae as black boxes but this is rather a matter of instrumentation as it just amounts to some abstraction before applying the tactic.
 
8
One exception is with https://static-content.springer.com/image/art%3A10.1007%2Fs10817-019-09540-0/MediaObjects/10817_2019_9540_Figado_HTML.gif which requires recursion that cannot be proved well-founded in order to implement it inside Coq.
 
9
This is inspired by lenses in Haskell: http://​lens.​github.​io.
 
Literatur
3.
Zurück zum Zitat Anand, A., Morrisett, G.: Revisiting parametricity: inductives and uniformity of propositions. In: CoqPL’18. Los Angeles, CA, USA (2018) Anand, A., Morrisett, G.: Revisiting parametricity: inductives and uniformity of propositions. In: CoqPL’18. Los Angeles, CA, USA (2018)
6.
7.
Zurück zum Zitat Armand, M., Grégoire, B., Spiwack, A., Théry, L.: Extending Coq with imperative features and its application to SAT verification. In: Kaufmann, M., Paulson, L.C., (eds.) Interactive Theorem Proving, pp. 83–98. Springer (2010) Armand, M., Grégoire, B., Spiwack, A., Théry, L.: Extending Coq with imperative features and its application to SAT verification. In: Kaufmann, M., Paulson, L.C., (eds.) Interactive Theorem Proving, pp. 83–98. Springer (2010)
8.
Zurück zum Zitat Avigad, J., Mahboubi, A.: Interactive theorem proving. In: 9th International Conference, ITP 2018, Held as Part of the Federated Logic Conference, FloC 2018, Oxford, UK, July 9–12, 2018, Proceedings. Lecture Notes in Computer Science, vol. 10895. Springer (2018). https://doi.org/10.1007/978-3-319-94821-8 Avigad, J., Mahboubi, A.: Interactive theorem proving. In: 9th International Conference, ITP 2018, Held as Part of the Federated Logic Conference, FloC 2018, Oxford, UK, July 9–12, 2018, Proceedings. Lecture Notes in Computer Science, vol. 10895. Springer (2018). https://​doi.​org/​10.​1007/​978-3-319-94821-8
10.
Zurück zum Zitat Bernardy, J.P., Jansson, P., Paterson, R.: Proofs for free: parametricity for dependent types. J. Funct. Program. 22(2), 107–152 (2012)MathSciNetCrossRef Bernardy, J.P., Jansson, P., Paterson, R.: Proofs for free: parametricity for dependent types. J. Funct. Program. 22(2), 107–152 (2012)MathSciNetCrossRef
11.
Zurück zum Zitat Boespflug, M., Dénès, M., Grégoire, B.: Full reduction at full throttle. In: International Conference on Certified Programs and Proofs, pp. 362–377. Springer (2011) Boespflug, M., Dénès, M., Grégoire, B.: Full reduction at full throttle. In: International Conference on Certified Programs and Proofs, pp. 362–377. Springer (2011)
12.
Zurück zum Zitat Boulier, S., Pédrot, P.M., Tabareau, N.: The next 700 syntactical models of type theory. In: CPP’17, pp. 182–194. ACM, Paris, France (2017) Boulier, S., Pédrot, P.M., Tabareau, N.: The next 700 syntactical models of type theory. In: CPP’17, pp. 182–194. ACM, Paris, France (2017)
15.
Zurück zum Zitat Chlipala, A.: Certified Programming with Dependent Types. MIT Press, Cambridge (2011)MATH Chlipala, A.: Certified Programming with Dependent Types. MIT Press, Cambridge (2011)MATH
16.
Zurück zum Zitat Christiansen, D., Brady, E.: Elaborator reflection: extending Idris in Idris. In: ICFP’16, p. 284 (2016) Christiansen, D., Brady, E.: Elaborator reflection: extending Idris in Idris. In: ICFP’16, p. 284 (2016)
17.
Zurück zum Zitat Cormen, T.H., Leiserson, C.E., Rivest, R.L., Stein, C.: Introduction to algorithms. MIT Press, Cambridge (2009)MATH Cormen, T.H., Leiserson, C.E., Rivest, R.L., Stein, C.: Introduction to algorithms. MIT Press, Cambridge (2009)MATH
19.
Zurück zum Zitat Ebner, G., Ullrich, S., Roesch, J., Avigad, J., de Moura, L.: A metaprogramming framework for formal verification. In: Proceedings of the 22st ACM SIGPLAN Conference on Functional Programming (ICFP 2017), pp. 34:1–34:29. ACM Press, Oxford, UK (2017) Ebner, G., Ullrich, S., Roesch, J., Avigad, J., de Moura, L.: A metaprogramming framework for formal verification. In: Proceedings of the 22st ACM SIGPLAN Conference on Functional Programming (ICFP 2017), pp. 34:1–34:29. ACM Press, Oxford, UK (2017)
20.
Zurück zum Zitat Feferman, S.: Typical Ambiguity: Trying to Have Your Cake and Eat it Too, Invited Lecture for the Conference, One Hundred Years of Russell’s Paradox (2001) Feferman, S.: Typical Ambiguity: Trying to Have Your Cake and Eat it Too, Invited Lecture for the Conference, One Hundred Years of Russell’s Paradox (2001)
22.
Zurück zum Zitat Forster, Y., Kunze, F.: A certifying extraction with time bounds from Coq to call-by-value Lambda calculus. In: Harrison, J., O’Leary, J., Tolmach, A. (eds.) 10th International Conference on Interactive Theorem Proving (ITP 2019), Schloss Dagstuhl–Leibniz-Zentrum fuer Informatik, Dagstuhl, Germany, Leibniz International Proceedings in Informatics (LIPIcs), vol. 141, pp. 17:1–17:19 (2019) Forster, Y., Kunze, F.: A certifying extraction with time bounds from Coq to call-by-value Lambda calculus. In: Harrison, J., O’Leary, J., Tolmach, A. (eds.) 10th International Conference on Interactive Theorem Proving (ITP 2019), Schloss Dagstuhl–Leibniz-Zentrum fuer Informatik, Dagstuhl, Germany, Leibniz International Proceedings in Informatics (LIPIcs), vol. 141, pp. 17:1–17:19 (2019)
23.
Zurück zum Zitat Forster, Y., Smolka, G.: Weak call-by-value lambda calculus as a model of computation in Coq. In: ITP 2017, pp. 189–206. Springer (2017) Forster, Y., Smolka, G.: Weak call-by-value lambda calculus as a model of computation in Coq. In: ITP 2017, pp. 189–206. Springer (2017)
24.
Zurück zum Zitat Grégoire, B., Leroy, X.: A compiled implementation of strong reduction. ACM 37, 235–246 (2002)MATH Grégoire, B., Leroy, X.: A compiled implementation of strong reduction. ACM 37, 235–246 (2002)MATH
28.
Zurück zum Zitat Jansen, J.M.: Programming in the \(\lambda \)-calculus: from Church to Scott and back. In: The Beauty of Functional Code. LNCS, vol .8106, pp. 168–180. Springer (2013) Jansen, J.M.: Programming in the \(\lambda \)-calculus: from Church to Scott and back. In: The Beauty of Functional Code. LNCS, vol .8106, pp. 168–180. Springer (2013)
34.
Zurück zum Zitat Mogensen, T.Æ.: Efficient self-interpretations in lambda calculus. J. Funct. Program. 2(3), 345–363 (1992)MathSciNetCrossRef Mogensen, T.Æ.: Efficient self-interpretations in lambda calculus. J. Funct. Program. 2(3), 345–363 (1992)MathSciNetCrossRef
37.
Zurück zum Zitat Pédrot, P.M.: Ltac2: tactical warfare. CoqPL 2019 (2019) Pédrot, P.M.: Ltac2: tactical warfare. CoqPL 2019 (2019)
38.
Zurück zum Zitat Reynolds, J.C.: Types, abstraction and parametric polymorphism. In: IFIP Congress, pp. 513–523 (1983) Reynolds, J.C.: Types, abstraction and parametric polymorphism. In: IFIP Congress, pp. 513–523 (1983)
45.
Zurück zum Zitat Wadler, P.: Theorems for free! In: Functional Programming Languages and Computer Architecture, pp. 347–359. ACM Press, New York City (1989) Wadler, P.: Theorems for free! In: Functional Programming Languages and Computer Architecture, pp. 347–359. ACM Press, New York City (1989)
46.
Zurück zum Zitat Van der Walt, P., Swierstra, W.: Engineering proof by reflection in Agda. In: Implementation and Application of Functional Languages. Springer (2013) Van der Walt, P., Swierstra, W.: Engineering proof by reflection in Agda. In: Implementation and Application of Functional Languages. Springer (2013)
Metadaten
Titel
The MetaCoq Project
verfasst von
Matthieu Sozeau
Abhishek Anand
Simon Boulier
Cyril Cohen
Yannick Forster
Fabian Kunze
Gregory Malecha
Nicolas Tabareau
Théo Winterhalter
Publikationsdatum
18.02.2020
Verlag
Springer Netherlands
Erschienen in
Journal of Automated Reasoning / Ausgabe 5/2020
Print ISSN: 0168-7433
Elektronische ISSN: 1573-0670
DOI
https://doi.org/10.1007/s10817-019-09540-0

Weitere Artikel der Ausgabe 5/2020

Journal of Automated Reasoning 5/2020 Zur Ausgabe

Premium Partner