Advertisement

Type inference and type containment

  • John Mitchell
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 173)

Abstract

Type inference, the process of assigning types to untyped expressions, may be motivated by the design of a typed language or semantical considerations on the meanings of types and expressions. A typed language GR with polymorphic functions leads to the GR inference rules. With the addition of an "oracle" rule for equations between expressions, the GR rules become complete for a general class of semantic models of type inference. These inference models are models of untyped lambda calculus with extra structure similar to models of the typed language GR. A more specialized set of type inference rules, the GRS rules, characterize semantic typing when the functional type σ → τ is interpreted as all elements of the model that map σ to τ and the polymorphic type ∀t.σ(t) is interpreted as the intersection of all σ(τ). Both inference systems may be reformulated using rules for deducing containments between types. The advantage of the type inference rules based on containments is that proofs correspond more closely to the structure of terms.

Keywords

Inference System Inference Rule Choice Function Inference Model Type Expression 
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.
    Barendregt, H., Coppo, M. and Dezani-Ciancaglini, M. A Filter Lambda Model and the Completeness of Type Assignment. J. Symbolic Logic 48, 4 (1983). pp 931–940.Google Scholar
  2. 2.
    Barendregt, H.P. The Lambda Calculus: Its Syntax and Semantics. North Holland, 1981.Google Scholar
  3. 3.
    Bruce, K. and Meyer, A. A Completeness Theorem for Second-Order Polymorphic Lambda Calculus. These proceedings.Google Scholar
  4. 4.
    Curry, H.B and Feys, R. Combinatory Logic I. North-Holland, 1958.Google Scholar
  5. 5.
    Damas, L. and Milner, R. Principal Type Schemes for Functional Programs. 9-th ACM Symposium on Principles of Programming Languages, 1982, pp. 207–212.Google Scholar
  6. 6.
    Fortune, S., Leivant, D. and O'Donnel, M. The Expressiveness of Simple and Second Order Type Structures. JACM 30, 1 (1983). pp 151–185Google Scholar
  7. 7.
    Girard, J.-Y. Une extension de l'interpretation de Gödel à l'analyse, et son application à l'élimination des coupures dans l'analyse et la théorie des types. In 2 nd Scandinavian Logic Symp., Fenstad, J.E., Ed., North-Holland, 1971, pp. 63–92.Google Scholar
  8. 8.
    Haynes, C.T. A Theory of Data Type Representation Independence. Ph.D. Th., Univ. of Iowa, Dept. of Computer Science, 1982. Technical Report 82-04.Google Scholar
  9. 9.
    Hindley, R. The Principal Type-Scheme of an Object in Combinatory Logic. Trans. AMS 146 (1969). pp 29–60.Google Scholar
  10. 10.
    Hindley, R. The Completeness Theorem for Typing Lambda Terms. Theor. Comp. Sci. 22 (1983). pp 1–17.Google Scholar
  11. 11.
    Hindley, R. Curry's Type Rules Are Complete with Respect to the F-Semantics Too. Theor. Comp. Sci. 22 (1983). pp 127–133.Google Scholar
  12. 12.
    Howard, W. The formulas-as-types notion of construction. In To H.B. Curry: Essays on Combinatory Logic, Lambda-Calculus and Formalism, Seldin, J.P. and J.R. Hindley, Eds., Academic Press, 1980, pp. 479–490.Google Scholar
  13. 13.
    Leivant, D. Polymorphic Type Inference. Proc. 10-th ACM Symp. on Principles of Programming Languages, 1983, pp. 88–98.Google Scholar
  14. 14.
    Leivant, D. Structural Semantics for Polymorphic Types. Proc. 10-th ACM Symp. on Principles of Programming Languages, 1983, pp. 155–166.Google Scholar
  15. 15.
    MacQueen, D. and Sethi, R. A Semantic Model of Types for Applicative Languages. ACM Symp. on LISP and Functional Programming, 1982, pp. 243–252.Google Scholar
  16. 16.
    MacQueen, D., Plotkin, G and Sethi, R. An Ideal Model for Polymorphic Types. Proc. 11-th ACM Symp. on Principles of Prog. Lang., January, 1984, pp. 165–174.Google Scholar
  17. 17.
    McCracken, N. An Investigation of a Programming Language with a Polymorphic Type Structure. Ph.D. Th., Syracuse Univ., 1979.Google Scholar
  18. 18.
    Meyer, A.R. What Is A Model of the Lambda Calculus?. Information and Control 52, 1 (1982). pp 87–122.Google Scholar
  19. 19.
    Milner, R. A Theory of Type Polymorphism in Programming. JCSS 17 (1978). pp 348–375.Google Scholar
  20. 20.
    Mitchell, J.C. Combinatory Models of Polymorphic Lambda Calculus. Manuscript (1984).Google Scholar
  21. 21.
    Mitchell, J.C. Coercion and Type Inference (Summary). Proc. 11-th ACM Symp. on Principles of Programming Languages, January, 1984, pp. 175–185.Google Scholar
  22. 22.
    Reynolds, J.C. Towards a Theory of Type Structure. Paris Colloq. on Programming, 1974, pp. 408–425.Google Scholar
  23. 23.
    Wand, M. A Types-as-Sets Semantics for Milner-Style Polymorphism. Proc. 11-th ACM Symp. on Principles of Programming Languages, January, 1984, pp. 158–164.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1984

Authors and Affiliations

  • John Mitchell
    • 1
  1. 1.Laboratory for Computer ScienceMassachusetts Institute of TechnologyCambridge

Personalised recommendations