Advertisement

Finite Subtype Inference with Explicit Polymorphism

  • Dominic Duggan
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 1503)

Abstract

Finite subtype inference occupies a middle ground between Hindley-Milner type inference (as in ML) and subtype inference with recursively constrained types. It refers to subtype inference where only finite types are allowed as solutions. This approach avoids some open problems with general subtype inference, and has practical motivation where recursively constrained types are not appropriate. This paper presents algorithms for finite subtype inference, including checking for entailment of inferred types against explicitly declared polymorphic types. This resolves for finite types a problem that is still open for recursively constrained types. Some motivation for this work, particularly for finite types and explicit polymorphism, is in providing subtype inference for first-class container objects with polymorphic methods.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    Martin Abadi and Luca Cardelli. A Theory of Objects. Springer-Verlag, July 1996.Google Scholar
  2. 2.
    A. Aiken and E. Wimmers. Solving systems of set constraints. In Proceedings of IEEE Symposium on Logic in Computer Science, pages 329–340, June 1992.Google Scholar
  3. 3.
    A. Aiken and E. Wimmers. Type inclusion constraints and type inference. In Proceedings of ACM Symposium on Functional Programming and Computer Architecture, pages 31–41, Copenhagen, Denmark, June 1993.Google Scholar
  4. 4.
    Francois Bourdoncle and Stephan Merz. Type checking higher-order polymorphic multimethods. In Proceedings of ACM Symposium on Principles of Programming Languages, 1997.Google Scholar
  5. 5.
    Dominic Duggan. Object type constructors. In preparation. A preliminary version appeared in the Workshop on Foundations of Object-Oriented Languages, New Brunswick, New Jersey, July 1996.Google Scholar
  6. 6.
    Dominic Duggan. Unification with extended patterns. Theoretical Computer Science, 1997. To appear.Google Scholar
  7. 7.
    Jonathan Eifrig, Scott Smith, and V. Trifonov. Type inference for recursively constrained types and its application to oop. In Proceedings of the Conference on Mathematical Foundations of Programming Semantics, Lecture Notes in Computer Science. Springer-Verlag, 1995. To appear.Google Scholar
  8. 8.
    Cormac Flanagan and Matthias Felleisen. Componential set-based analysis. In Proceedings of ACMSIG-PLAN Conference on Programming Language Design and Implementation, 1997.Google Scholar
  9. 9.
    You-Chin Fuh and Prateek Mishra. Type inference with subtypes. Theoretical Computer Science, 73:155–175, 1990.zbMATHCrossRefMathSciNetGoogle Scholar
  10. 10.
    Mark Jones. First-class polymorphism with type inference. In Proceedings of ACM Symposium on Principles of Programming Languages. ACM Press, January 1997.Google Scholar
  11. 11.
    Xavier Leroy and Michel Mauny. Dynamics in ML. Journal of Functional Programming, 3(4):431–463, 1993.CrossRefGoogle Scholar
  12. 12.
    Patrick Lincoln and John C. Mitchell. Algorithmic aspects of type inference with subtypes. In Proceedings of ACM Symposium on Principles of Programming Languages, pages 293–304. ACM Press, 1992.Google Scholar
  13. 13.
    Dale Miller. Unification under a mixed prefix. Journal of Symbolic Computation, 14:321–358, 1992.zbMATHCrossRefMathSciNetGoogle Scholar
  14. 14.
    Robin Milner. A theory of type polymorphism in programming. Journal of Computer and Systems Sciences, 17:343–378, 1978.CrossRefMathSciNetGoogle Scholar
  15. 15.
    John C. Mitchell. Type inference with simple subtypes. Journal of Functional Programming, 1(3):245–286, July 1991.Google Scholar
  16. 16.
    Martin Odersky and Konstantin Läufer. Putting type annotations to work. In Proceedings of ACM Symposium on Principles of Programming Languages, 1996.Google Scholar
  17. 17.
    Jens Palsberg. Efficient inference of object types. In Proceedings of IEEE Symposium on Logic in Computer Science, pages 186–195, Paris, France, July 1994. IEEE.Google Scholar
  18. 18.
    Benjamin Pierce and David Turner. Local type inference. In Proceedings of ACM Symposium on Principles of Programming Languages, San Diego, California, January 1998. ACM Press.Google Scholar
  19. 19.
    Francois Pottier. Simplifying subtyping constraints. In Proceedings of ACM International Conference on Functional Programming, Philadelpha, Pennsylvania, May 1996. ACM Press.Google Scholar
  20. 20.
    Didier Rémy. Programming objects with ML-ART: An extension to ml with abstract and record types. In Masami Hagiya and John C. Mitchell, editors, International Symposium on Theoretical Aspects of Computer Software, pages 321–346, Sendai, Japan, April 1994. Springer-Verlag.Google Scholar
  21. 21.
    Marvin Solomon. Type definitions with parameters. In Proceedings of ACM Symposium on Principles of Programming Languages, pages 31–38. ACM Press, 1978.Google Scholar
  22. 22.
    Valery Trifonov and Scott Smith. Subtyping constrained types. In Static Analysis Symposium, number 1145 in LNCS, pages 349–365, 1996.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1998

Authors and Affiliations

  • Dominic Duggan
    • 1
  1. 1.Department of Computer ScienceStevens Institute of TechnologyHoboken

Personalised recommendations