Proofs about a folklore let-polymorphic type inference algorithm
- 1 July 1998
- journal article
- Published by Association for Computing Machinery (ACM) in ACM Transactions on Programming Languages and Systems
- Vol. 20  (4) , 707-723
- https://doi.org/10.1145/291891.291892
Abstract
The Hindley/Milner let-polymorphic type inference system has two different algorithms: one is the de facto standard Algorithm 𝒲 that is bottom-up (or context-insensitive), and the other is a “folklore” algorithm that is top-down (or context-sensitive). Because the latter algorithm has not been formally presented with its soundness and completeness proofs, and its relation with the 𝒲 algorithm has not been rigorously investigated, its use in place of (or in combination with) 𝒲 is not well founded. In this article, we formally define the context-sensitive, top-down type inference algorithm (named “M”), prove its soundness and completeness, and show a distinguishing property that M always stops earlier than 𝒲 if the input program is ill typed. Our proofs can be seen as theoretical justifications for various type-checking strategies being used in practice.Keywords
This publication has 9 references indexed in Scilit:
- A theory of type polymorphism in programmingPublished by Elsevier ,2003
- Local type inferencePublished by Association for Computing Machinery (ACM) ,1998
- Explaining type inferenceScience of Computer Programming, 1996
- Explaining type errors in polymorphic languagesACM Letters on Programming Languages and Systems, 1993
- Basic polymorphic typecheckingScience of Computer Programming, 1987
- A maximum-flow approach to anomaly isolation in unification-based incremental type inferencePublished by Association for Computing Machinery (ACM) ,1986
- Finding the source of type errorsPublished by Association for Computing Machinery (ACM) ,1986
- Principal type-schemes for functional programsPublished by Association for Computing Machinery (ACM) ,1982
- A Machine-Oriented Logic Based on the Resolution PrincipleJournal of the ACM, 1965