Advertisement

Universe Polymorphism in Coq

  • Matthieu Sozeau
  • Nicolas Tabareau
Part of the Lecture Notes in Computer Science book series (LNCS, volume 8558)

Abstract

Universes are used in Type Theory to ensure consistency by checking that definitions are well-stratified according to a certain hierarchy. In the case of the Coq proof assistant, based on the predicative Calculus of Inductive Constructions (pCIC), this hierachy is built from an impredicative sort Prop and an infinite number of predicative Type i universes. A cumulativity relation represents the inclusion order of universes in the core theory. Originally, universes were thought to be floating levels, and definitions to implicitely constrain these levels in a consistent manner. This works well for most theories, however the globality of levels and constraints precludes generic constructions on universes that could work at different levels. Universe polymorphism extends this setup by adding local bindings of universes and constraints, supporting generic definitions over universes, reusable at different levels. This provides the same kind of code reuse facilities as ML-style parametric polymorphism. However, the structure and hierarchy of universes is more complex than bare polymorphic type variables. In this paper, we introduce a conservative extension of pCIC supporting universe polymorphism and treating its whole hierarchy. This new design supports typical ambiguity and implicit polymorphic generalization at the same time, keeping it mostly transparent to the user. Benchmarking the implementation as an extension of the Coq proof assistant on real-world examples gives encouraging results.

Keywords

Universe Variable Typing Judgment Inductive Construction Intermediate Language Existential Variable 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    Coquand, T.: An analysis of Girard’s Paradox. In: Proceedings of the First Symposium on Logic in Computer Science, HC, vol. 145. IEEE Comp. Soc. Press (June 1986)Google Scholar
  2. 2.
    The Univalent Foundations Program: Homotopy Type Theory: Univalent Foundations for Mathematics, Institute for Advanced Study (2013)Google Scholar
  3. 3.
    The Coq development team: Coq 8.2 Reference Manual. INRIA (2008)Google Scholar
  4. 4.
    Herbelin, H.: Type Inference with Algebraic Universes in the Calculus of Inductive Constructions (2005) (manuscript)Google Scholar
  5. 5.
    Chan, T.H.: Appendix D. In: An Introduction to the PL/CV2 Programming Logic. LNCS, vol. 135, pp. 227–264. Springer (1982), http://dx.doi.org/10.1007/3-540-11492-0
  6. 6.
    Luo, Z.: An Extended Calculus of Constructions. PhD thesis, Department of Computer Science, University of Edinburgh (June 1990)Google Scholar
  7. 7.
    Harper, R., Pollack, R.: Type Checking with Universes. Theor. Comput. Sci. 89(1), 107–136 (1991)CrossRefzbMATHMathSciNetGoogle Scholar
  8. 8.
    Abel, A., Pientka, B.: Higher-Order Dynamic Pattern Unification for Dependent Types and Records. In: Ong, L. (ed.) TLCA 2001. LNCS, vol. 6690, pp. 10–26. Springer, Heidelberg (2011)CrossRefGoogle Scholar
  9. 9.
    Pierce, B.C., Turner, D.N.: Local Type Inference. ACM Transactions on Programming Languages and Systems 22(1), 1–44 (2000)CrossRefGoogle Scholar
  10. 10.
    Asperti, A., Ricciotti, W., Coen, C.S., Tassi, E.: A compact kernel for the calculus of inductive constructions. Journal Sadhana 34, 71–144 (2009)CrossRefzbMATHGoogle Scholar
  11. 11.
    Courant, J.: Explicit Universes for the Calculus of Constructions. In: Carreño, V.A., Muñoz, C.A., Tahar, S. (eds.) TPHOLs 2002. LNCS, vol. 2410, pp. 115–130. Springer, Heidelberg (2002)CrossRefGoogle Scholar
  12. 12.
    Lee, G., Werner, B.: Proof-irrelevant model of CC with predicative induction and judgmental equality. Logical Methods in Computer Science 7(4) (2011)Google Scholar
  13. 13.
    Herbelin, H., Spiwack, A.: The Rooster and the Syntactic Bracket. CoRR abs/1309.5767 (2013)Google Scholar

Copyright information

© Springer International Publishing Switzerland 2014

Authors and Affiliations

  • Matthieu Sozeau
    • 1
  • Nicolas Tabareau
    • 2
  1. 1.Inria Paris, PiR2, Univ Paris Diderot, Sorbonne Paris CitéLe ChesnayFrance
  2. 2.Laboratoire d’Informatique de Nantes Altantique (LINA)Inria RennesFrance

Personalised recommendations