Hostname: page-component-586b7cd67f-gb8f7 Total loading time: 0 Render date: 2024-11-24T22:52:51.956Z Has data issue: false hasContentIssue false

Weak polymorphism can be sound

Published online by Cambridge University Press:  07 November 2008

John Greiner
Affiliation:
School of Computer Science, Carnegie Mellon University, 5000 Forbes Ave., Pittsburgh, PA 15213-3891, USA
Rights & Permissions [Opens in a new window]

Abstract

Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the ‘Save PDF’ action button.

The weak polymorphic type system of Standard ML of New Jersey (SML/NJ) (MacQueen, 1992) has only been presented as part of the implementation of the SML/NJ compiler, not as a formal type system. As a result, it is not well understood. And while numerous versions of the implementation have been shown unsound, the concept has not been proved sound or unsound. We present an explanation of weak polymorphism and show that a formalization of this is sound. We also relate this to the SML/NJ implementation of weak polymorphism through a series of type systems that incorporate elements of the SML/NJ type inference algorithm.

Type
Articles
Copyright
Copyright © Cambridge University Press 1996

References

Damas, L. and Milner, R. (1982) Principal type-schemes for functional programs. In 9th ACM Symposium on Principles of Programming Languages, pp. 207212. ACM Press.Google Scholar
Damas, L. (1985) Type Assignment in Programming Languages. PhD Thesis, University of Edinburgh.Google Scholar
Harper, R. (1993) A Simplified Account of Polymorphic References. Technical Report CMU-CS-93-169. Carnegie Mellon University.Google Scholar
Hindley, J. R. (1969) The principal type scheme of an object in combinatory logic. Trans. Am. Math. Soc., 146: 2960.Google Scholar
Hindley, J. R. and Seldin, J. P. (1986) Introduction to Combinators and λ-Calculus. London Mathematical Society Student Texts, 1. Cambridge University Press.Google Scholar
Hoang, M., Mitchell, J. and Viswanathan, R. (1993) Standard ML weak polymorphism and imperative constructs. In 8th Symposium on Logic in Computer Science, pp. 1525. IEEE Press.Google Scholar
Leroy, X. (1992) Polymorphic Typing of An Algorithmic Language. Technical Report 1778, Institute National de Recherche en Informatique et en Automatique. (English translation of PhD Thesis, Université Paris VII.)Google Scholar
Leroy, X. (1993) Polymorphism by name for references and continuations. In 20th ACM Symposium on Principles of Programming Languages, pp. 220231. ACM PressCrossRefGoogle Scholar
Leroy, X. and Weis, P. (1991) Polymorphic type inference and assignment. In 18th ACM Symposium on Principles of Programming Languages, pp. 291302. ACM Press.Google Scholar
MacQueen, D. (1992) Source code for SML/NJ type inference algorithm, Versions 0.66, 0.75, and 0.93.Google Scholar
Milner, R. (1978) A theory of type polymorphism in programming languages. J. Computer & System Sci., 17: 348375.CrossRefGoogle Scholar
Milner, R., Tofte, M. and Harper, R. (1990) The Definition of Standard ML. MIT Press.Google Scholar
O'Toole, J. W. Jr., (1989) Type Abstraction Rules for References: A Comparison of Four Which Have Achieved Notoriety. Technical report MIT-LCS-TM-390, Massachussets Institute of Technology.Google Scholar
Reynolds, J. C. (1989) Syntactic Control of Interference, Part 2. In 16th Int. Colloquium on Automata, Languages and Programming, pp. 704722. Springer-Verlag.CrossRefGoogle Scholar
Talpin, J.-P. and Jouvelot, P. (1992) The type and effect discipline. In 7th IEEE Symposium on Logic in Computer Science, pp. 162173. IEEE Press.Google Scholar
Talpin, J.-P. and Jouvelot, P. (1992) Polymorphic type, region and effect inference J. Functional Programming, 2(3): 245271.CrossRefGoogle Scholar
Tofte, M. (1988) Operational Semantics and Polymorphic Type Inference. PhD Thesis, University of Edinburgh.Google Scholar
Tofte, M. (1990) Type inference for polymorphic references. Infor. & Computation, 89: 134.CrossRefGoogle Scholar
Wright, A. K. (1992) Typing references by effect inference. In 4th Euro. Symposium on Programming: Lecture Notes in Computer Science 582, pp. 473491. Springer-Verlag.Google Scholar
Wright, A. K. (1993) Polymorphism for Imperative Languages without Imperative Types. Technical Report 93–200. Rice University.Google Scholar
Wright, A. K. and Felleisen, M. (1991) A Syntactic Approach to Type Soundness. Technical Report 91–160. Rice University.Google Scholar
Submit a response

Discussions

No Discussions have been published for this article.