Skip to main content

2003 | OriginalPaper | Buchkapitel

A Logical Algorithm for ML Type Inference

verfasst von : David McAllester

Erschienen in: Rewriting Techniques and Applications

Verlag: Springer Berlin Heidelberg

Aktivieren Sie unsere intelligente Suche, um passende Fachinhalte oder Patente zu finden.

search-config
loading …

This paper gives a bottom-up logic programming formulation of the Hindley-Milner polymorphic type inference algorithm. We show that for programs of bounded order and arity the given algorithm runs in O(nα(n) + dn) time where n is the length of the program, d is the “scheme depth” of the program, and α is the inverse of Ackermann’s function. It is argued that for practical programs d will not exceed 5 even for programs with hundreds of module layers. This formulation of the Hindley-Milner algorithm is intended as a case study in “logical algorithms”, i.e., algorithms presented and analyzed as bottom-up inference rules.

Metadaten
Titel
A Logical Algorithm for ML Type Inference
verfasst von
David McAllester
Copyright-Jahr
2003
Verlag
Springer Berlin Heidelberg
DOI
https://doi.org/10.1007/3-540-44881-0_31

Premium Partner