Type checking, universe polymorphism, and typical ambiguity in the calculus of constructions draft

  • Robert Harper
  • Robert Pollack
Communications
Part of the Lecture Notes in Computer Science book series (LNCS, volume 352)

Abstract

The Generalized Calculus of Constructions (CCω) of Coquand and Huet is a system for formalizing constructive mathematics. CCω includes a cumulative hierarchy of universes, with each universe closed under the type forming operations. Universe hierarchies are tedious to use in practice. Russell and Whitehead introduced a convention for dealing with stratification, called “typical ambiguity”, in which universe levels are not explicitly mentioned, but it is tactily asserted that some correctly stratified level assignment exists. Using an “operational semantics” for type synthesis, we study type checking and typical ambiguity for CCω. We show type synthesis is effective in CCω. Even if explicit universe levels are erased from a term it is possible to compute a “schematic type” for that term, and a set of constraints, that characterize all types of all well-typed instances of the term. We also consider the extension with δ-reductions, which introduces a form of “universe polymorphism” induced by the failure of type unicity in CCω.

References

  1. [Bar84]
    H. P. Barendregt. The Lambda Calculus: Its Syntax and Semantics, volume 103 of Studies in Logic and the Foundations of Mathematics. North-Holland, Amsterdam, revised edition, 1984.Google Scholar
  2. [BL84]
    R. Burstall and Butler Lampson. A kernel language for abstract data types and modules. In G. Kahn, D. MacQueen, and G. Plotkin, editors, Semantics of Data Types, volume 173 of Lecture Notes in Computer Science, pages 1–50. Springer-Verlag, 1984.Google Scholar
  3. [Car]
    Luca Cardelli. Phase distinctions in type theory. unpublished manuscript.Google Scholar
  4. [Car86]
    Luca Cardelli. A polymorphic λ-calculus with Type:Type. Technical report, DEC SRC, 1986.Google Scholar
  5. [CDD+85]
    D. Clément, J. Despeyroux, T. Despeyroux, L. Hascoet, and G. Kahn. Natural semantics on the computer. Technical Report RR 416, INRIA, Sophia-Antipolis, France, June 1985.Google Scholar
  6. [CDDK86]
    D. Clément, J. Despeyroux, T. Despeyroux, and G. Kahn. A simple applicative language: Mini-ML. In Proceedings of the Conference on Lisp and Functional Programming, 1986.Google Scholar
  7. [CH85]
    Thierry Coquand and Gérard Huet. Constructions: a higher-order proof system for mechanizing mathematics. In B. Buchberger, editor, EUROCAL '85: European Conference on Computer Algebra, volume 203 of Lecture Notes in Computer Science, pages 151–184. Springer-Verlag, 1985.Google Scholar
  8. [Cha77]
    Tat-Hung Chan. An algorithm for checking PL/CV arithmetical inferences. Technical Report 77-236, Computer Science Department, University, Ithaca, New York, 1977.Google Scholar
  9. [Chu40]
    Alonzo Church. A formulation of the simple theory of types. Journal of Symbolic Logic, 5:56–68, 1940.Google Scholar
  10. [Con86]
    Robert L. Constable, et al. Implementing Mathematics with the NuPRL Proof Development System. Prentice-Hall, Englewood Cliffs, NJ, 1986.Google Scholar
  11. [Coq85]
    Thierry Coquand. Une théorie des constructions. PhD thesis, Université Paris VII, January 1985.Google Scholar
  12. [Coq86]
    Thierry Coquand. An analysis of Girard's paradox. In Proc. of the Symposium on Logic in Computer Science, pages 227–236, Boston, June 1986.Google Scholar
  13. [Coq88]
    Thierry Coquand. Private communication.Google Scholar
  14. [CZ82]
    Robert L. Constable and Daniel R. Zlatin. Report on the type theory (V3) of the programming logic PL/CV3. In Logics of Programs, volume 131 of Lecture Notes in Computer Science. Springer-Verlag, 1982.Google Scholar
  15. [CZ84]
    Robert L. Constable and Daniel R. Zlatin. The type theory of PL/CV3. ACM Transactions on Programming Languages and Systems, 7(1):72–93, January 1984.Google Scholar
  16. [Des84]
    T. Despeyroux. Executable specifications of static semantics. In G. Kahn, D. MacQueen, and G. Plotkin, editors, Semantics of Data Types, volume 173 of Lecture Notes in Computer Science. Springer-Verlag, June 1984.Google Scholar
  17. [DM82]
    Luis Damas and Robin Milner. Principal type schemes for functional programs. In Proceedings of the 9th ACM Symposium on the Principles of Programming Languages, pages 207–212, 1982.Google Scholar
  18. [Erh88]
    Thomas Erhard. A categorical semantics of Constructions. In Proceedings of the Third Annual Symposium on Logic in Computer Science, pages 264–273, Edinburgh, July 1988.Google Scholar
  19. [GdR88]
    Paola Giannini and Simona Ronchi della Rocca. Characterization of typings in polymorphic type discipline. In Proceedings of the Third Annual Symposium on Logic in Computer Science, pages 61–71, July 1988.Google Scholar
  20. [HH86]
    James G. Hook and Douglas Howe. Impredicative strong existential equivalent to Type:Type. Technical Report TR 86–760, Cornell University, Ithaca, New York, 1986.Google Scholar
  21. [HMT87]
    Robert Harper, Robin Milner, and Mads Tofte. A type discipline for program modules. In TAPSOFT '87, volume 250 of Lecture Notes in Computer Science. Springer-Verlag, March 1987.Google Scholar
  22. [HMT88]
    Robert Harper, Robin Milner, and Mads Tofte. The definition of Standard ML (version 2). Technical Report ECS-LFCS-88-62, Laboratory for the Foundations of Computer Science, Edinburgh University, August 1988.Google Scholar
  23. [How87]
    Douglas Howe. The computational behavior of Girard's paradox. In Proceedings of the Second Symposium on Logic in Computer Science, pages 205–214, Ithaca, New York, June 1987.Google Scholar
  24. [HP88]
    J. Martin E. Hyland and Andrew M. Pitts. The Theory of Constructions: categorical semantics and topos-theoretic models. In Proceedings of the Boulder Conference on Categories in Computer Science, 1988. To appear.Google Scholar
  25. [Hue87]
    Gérard Huet. Extending the Calculus of Constructions with Type:Type. unpublished manuscript, April 1987.Google Scholar
  26. [Luo88a]
    Zhaolui Luo. A higher-order calculus and theory abstraction. Technical Report ECS-LFCS-88-57, Laboratory for the Foundations of Computer Science, Edinburgh University, July 1988.Google Scholar
  27. [Luo88b]
    Zhaolui Luo. and its metatheory. Technical Report ECS-LFCS-88-58, Laboratory for the Foundations of Computer Science, Edinburgh University, July 1988.Google Scholar
  28. [Mac86]
    David MacQueen. Using dependent types to express modular structure. In Proceedings of the 13th ACM Symposium on the Principles of Programming Languages, 1986.Google Scholar
  29. [Mar]
    Per Martin-Löf. A theory of types. Unpublished manuscript.Google Scholar
  30. [Mar73]
    Per Martin-Löf. An intuitionistic theory of types: predicative part. In H. E. Rose and J. C. Shepherdson, editors, Logic Colloquium, '73, pages 73–118, Amsterdam, 1973. North-Holland.Google Scholar
  31. [Mar82]
    Per Martin-Löf. Constructive mathematics and computer programming. In Sixth International Congress for Logic, Methodology, and Philosophy of Science, pages 153–175, Amsterdam, 1982. North-Holland.Google Scholar
  32. [Mar84]
    Per Martin-Löf. Intuitionistic Type Theory, volume 1 of Studies in Proof Theory. Bibliopolis, Naples, 1984.Google Scholar
  33. [MH88]
    John Mitchell and Robert Harper. The essence of ML. In Proceedings of the Fifteenth ACM Symposium on Principles of Programming Languages, San Diego, California, January 1988.Google Scholar
  34. [Mit84]
    John C. Mitchell. Type inference and type containment. In G. Kahn, D. MacQueen, and G. Plotkin, editors, Semantics of Data Types, volume 173 of Lecture Notes in Computer Science, pages 257–278. Springer-Verlag, 1984.Google Scholar
  35. [MP85]
    John C. Mitchell and Gordon Plotkin. Abstract types have existential type. In Proceedings of the 12th ACM Symposium on the Principles of Programming Languages, 1985.Google Scholar
  36. [MR86]
    Albert Meyer and Mark Reinhold. ‘Type’ is not a type: preliminary report. In Proceedings of the 13th ACM Symposium on the Principles of Programming Languages, 1986.Google Scholar
  37. [Pol88]
    Robert Pollack. The theory of lego. Technical report, Laboratory for the Foundations of Computer Science, Edinburgh University, 1988. To appear.Google Scholar
  38. [Rus08]
    Bertrand Russell. Mathematical logic as based on a theory of types. American Journal of Mathematics, 30:222–262, 1908.Google Scholar
  39. [vD80]
    Diedrik T. van Daalen. The Language Theory of AUTOMATH. PhD thesis, Technical University of Eindhoven, Eindhoven, Netherlands, 1980.Google Scholar
  40. [WR25]
    Alfred North Whitehead and Bertrand Russell. Principia Mathematica, Volume 1. Cambridge University Press, Cambridge, 1925.Google Scholar

Copyright information

© Springer-Verlag 1989

Authors and Affiliations

  • Robert Harper
    • 1
  • Robert Pollack
    • 2
  1. 1.Dept. of Computer ScienceCarnegie-Mellon UniversityUSA
  2. 2.Laboratory for Foundations of Computer ScienceUniversity of EdinburghUK

Personalised recommendations