Skip to main content

A complete type inference system for subtyped recursive types

  • Conference paper
  • First Online:
Theoretical Aspects of Computer Software (TACS 1994)

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

Included in the following conference series:

Abstract

Since record polymorphism is one of essential factors for object-oriented languages, various approaches to incorporate record polymorphism into type systems have been proposed to lay the foundation for object-oriented languages. Recursive types, which are essentially types of lists or trees, are major programming tools. In object-oriented languages, a pseudo variable “self” has a recursive type, which requires that type systems be able to treat recursive types. The purpose of this paper is to provide a type system and its type inference algorithm which can handle subtyping, recursive types and parametric polymorphism without any kind of type declaration or unnatural restrictions. We prove soundness and completeness of the type inference algorithm. Our system integrates subtyping and recursive types into Damas and Milner's type system and preserves important properties such as existence of principal typing. The basic idea is that we consider a type as a regular tree.

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.

Similar content being viewed by others

References

  1. Robert M. Amadio and Luca Cardelli. Subtyping Recursive Types. In Conference Record of the Eighteenth Annual ACM Symposium on Principles of Programming Languages, pages 104–118, January 1991.

    Google Scholar 

  2. Robert M. Amadio and Luca Cardelli. Subtyping Recursive Types. In ACM Transactions on Programming Languages and Systems, volume 15, pages 575–631, 1993.

    Google Scholar 

  3. Gerald Baumgartner and Vincent F. Russo. Signatures: A C++ Extension for Type Abstraction and Subtype Polymorphism. Technical report, Purdue University, 1993. CSD-TR-03-059.

    Google Scholar 

  4. Kim Bruce and John C. Mitchell. PER models of subtyping, recursive types and higher-order polymorphism. In Conference Record of the Nineteenth Annual ACM Symposium on Principles of Programming Languages, pages 316–327, January 1992.

    Google Scholar 

  5. Peter Canning, William Cook, Walter Hill, and Walter Olthoff. F-Bounded Polymorphism for Object-Oriented Programming. In The Fourth International Conference on Functional Programming Languages and Computer Architecture, pages 273–280, September 1989.

    Google Scholar 

  6. Luca Cardelli. A Semantics of Multiple Inheritance. In D.B. MacQueen G. Kahn and G. Plotkin, editors, Semantics of Data Types, volume 173 of Lecture Notes in Computer Science, pages 51–67. Springer-Verlag, 1984.

    Google Scholar 

  7. Luca Cardelli and Peter Wegner. On Understanding Types, Data Abstraction, and Polymorphism. In Computing Surveys, volume 17, 1985.

    Google Scholar 

  8. Alain Colmerauer. Prolog and Infinite Trees. In K. L. Clark and S.-A. Tärnlund, editors, Logic Programming, number 16 in APIC Studies in Data Processing, pages 231–251. Academic Press, New York, 1982.

    Google Scholar 

  9. Alain Colmerauer. Equations and Inequations on Finite and Infinite Trees. In Proceedings of the International Conference of Fifth Generation Computer Systems, pages 85–99, Tokyo, 1984.

    Google Scholar 

  10. Bruno Courcelle. Fundamental Properties of Infinite Trees. In Theoretical Computer Science, volume 25, pages 95–169, March 1983.

    Google Scholar 

  11. Stefan Kaes. Type Inference in the Presence of Overloading, Subtyping and Recursive Types. In Proceedings of the 1992 ACM Conference on Lisp and Functional Programming, pages 193–204, 1992.

    Google Scholar 

  12. Dexter Kozen, Jens Palsberg, and Michael I. Schwartzbach. Efficient Recursive Subtyping. In Conference Record of the Twentieth Annual ACM Symposium on Principle of Programming Languages, 1993.

    Google Scholar 

  13. David MacQueen, Gordon Plotkin, and Ravi Sethi. An Ideal Model for Recursive Polymorphic Types. In Information and Control, volume 71, pages 95–130, 1986.

    Google Scholar 

  14. John C. Mitchell. Coercion and Type Inference. In Conference Record of the Eleventh Annual ACM Symposium on Principles of Programming Languages, pages 175–185, 1984.

    Google Scholar 

  15. Nicholas Oxhøj, Jens Palsberg, and Michael I. Schwartzbach. Making Type Inference Practical. In ECOOP'92 European Conference on Object-Oriented Programming, volume 615 of Lecture Notes in Computer Science, pages 329–349. Springer-Verlag, 1992.

    Google Scholar 

  16. Ryan Stansifer. Type Inference with Subtypes. In Conference Record of the Fifteenth Annual ACM Symposium on Principles of Programming Languages, pages 88–97, 1988.

    Google Scholar 

  17. Satish Thatte. Type Inference with Partial Types. In Proceedings of International Colloquium on Automata, Languages, and Programming, volume 317 of Lecture Notes in Computer Science, pages 615–629. Springer-Verlag, 1988.

    Google Scholar 

  18. Mitchell Wand. Complete Type Inference for Simple Objects. In Proceedings of Second Symposium on Logic in Computer Science, pages 37–44, 1987.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Masami Hagiya John C. Mitchell

Rights and permissions

Reprints and permissions

Copyright information

© 1994 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Sekiguchi, T., Yonezawa, A. (1994). A complete type inference system for subtyped recursive types. In: Hagiya, M., Mitchell, J.C. (eds) Theoretical Aspects of Computer Software. TACS 1994. Lecture Notes in Computer Science, vol 789. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-57887-0_120

Download citation

  • DOI: https://doi.org/10.1007/3-540-57887-0_120

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-57887-1

  • Online ISBN: 978-3-540-48383-0

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics