Skip to main content

Type inference and type containment

  • Conference paper
  • First Online:
Semantics of Data Types (SDT 1984)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 173))

Included in the following conference series:

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  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. Barendregt, H.P. The Lambda Calculus: Its Syntax and Semantics. North Holland, 1981.

    Google Scholar 

  3. Bruce, K. and Meyer, A. A Completeness Theorem for Second-Order Polymorphic Lambda Calculus. These proceedings.

    Google Scholar 

  4. Curry, H.B and Feys, R. Combinatory Logic I. North-Holland, 1958.

    Google Scholar 

  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. Fortune, S., Leivant, D. and O'Donnel, M. The Expressiveness of Simple and Second Order Type Structures. JACM 30, 1 (1983). pp 151–185

    Google Scholar 

  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. 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. Hindley, R. The Principal Type-Scheme of an Object in Combinatory Logic. Trans. AMS 146 (1969). pp 29–60.

    Google Scholar 

  10. Hindley, R. The Completeness Theorem for Typing Lambda Terms. Theor. Comp. Sci. 22 (1983). pp 1–17.

    Google Scholar 

  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. 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. Leivant, D. Polymorphic Type Inference. Proc. 10-th ACM Symp. on Principles of Programming Languages, 1983, pp. 88–98.

    Google Scholar 

  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. 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. 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. McCracken, N. An Investigation of a Programming Language with a Polymorphic Type Structure. Ph.D. Th., Syracuse Univ., 1979.

    Google Scholar 

  18. Meyer, A.R. What Is A Model of the Lambda Calculus?. Information and Control 52, 1 (1982). pp 87–122.

    Google Scholar 

  19. Milner, R. A Theory of Type Polymorphism in Programming. JCSS 17 (1978). pp 348–375.

    Google Scholar 

  20. Mitchell, J.C. Combinatory Models of Polymorphic Lambda Calculus. Manuscript (1984).

    Google Scholar 

  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. Reynolds, J.C. Towards a Theory of Type Structure. Paris Colloq. on Programming, 1974, pp. 408–425.

    Google Scholar 

  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 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Gilles Kahn David B. MacQueen Gordon Plotkin

Rights and permissions

Reprints and permissions

Copyright information

© 1984 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Mitchell, J. (1984). Type inference and type containment. In: Kahn, G., MacQueen, D.B., Plotkin, G. (eds) Semantics of Data Types. SDT 1984. Lecture Notes in Computer Science, vol 173. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-13346-1_13

Download citation

  • DOI: https://doi.org/10.1007/3-540-13346-1_13

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-13346-9

  • Online ISBN: 978-3-540-38891-3

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics