Deciding ML typability is complete for deterministic exponential time
POPL '90 Proceedings of the 17th ACM SIGPLAN-SIGACT symposium on Principles of programming languages
Polymorphic type inference and assignment
POPL '91 Proceedings of the 18th ACM SIGPLAN-SIGACT symposium on Principles of programming languages
Type inference for polymorphic references
Information and Computation
The revised report on the syntactic theories of sequential control and state
Theoretical Computer Science
Polymorphism by name for references and continuations
POPL '93 Proceedings of the 20th ACM SIGPLAN-SIGACT symposium on Principles of programming languages
Simple imperative polymorphism
Lisp and Symbolic Computation - Special issue on state in programming languages (part I)
Polymorphic typing of variables and references
ACM Transactions on Programming Languages and Systems (TOPLAS)
POPL '98 Proceedings of the 25th ACM SIGPLAN-SIGACT symposium on Principles of programming languages
Proofs about a folklore let-polymorphic type inference algorithm
ACM Transactions on Programming Languages and Systems (TOPLAS)
Definitional interpreters for higher-order programming languages
ACM '72 Proceedings of the ACM annual conference - Volume 2
A rewriting semantics for type inference
ESOP'07 Proceedings of the 16th European conference on Programming
Defunctionalized interpreters for programming languages
Proceedings of the 13th ACM SIGPLAN international conference on Functional programming
Flexible types: robust type inference for first-class polymorphism
Proceedings of the 36th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languages
Hi-index | 0.00 |
The Damas-Milner type inference algorithm (commonly known as algorithm W) is at the core of all ML type checkers. Although the algorithm is known to have poor worst-case behavior [8], in practice well-engineered type checkers will run in approximately linear time. To achieve this efficiency, implementations need to improve on algorithm W's method of scanning the complete type environment to determine whether a type variable can be generalized at a let binding. Following a suggestion of Damas, most ML type checkers use an alternative method based on ranking unification variables to track their position in the type environment. Here we formalize two such ranking systems, one based on lambda depth (used in the SML/NJ compiler), and the other based on let depth (used in OCaml, for instance). Each of these systems is formalized both with and without the value restriction, and they are proved correct relative to the classic algorithm W. Our formalizations of the various algorithms use simple abstract machines that are similar to small-step evaluation semantics.