Local type inference

被引:152
作者
Pierce, BC
Turner, DN
机构
[1] Univ Penn, Dept Comp & Informat Sci, Philadelphia, PA 19104 USA
[2] Teallach Ltd, Technol Transfer Ctr, Edinburgh EH9 3JL, Midlothian, Scotland
来源
ACM TRANSACTIONS ON PROGRAMMING LANGUAGES AND SYSTEMS | 2000年 / 22卷 / 01期
关键词
languages; theory; polymorphism; subtyping; type inference;
D O I
10.1145/345099.345100
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
We study two partial type inference methods for a language combining subtyping and impredicative polymorphism. Both methods are local in the sense that missing annotations are recovered using only information from adjacent nodes in the syntax tree, without long-distance constraints such as unification variables. One method infers type arguments in polymorphic applications using a local constraint solver. The other infers annotations on bound variables in function abstractions by propagating type constraints downward from enclosing application nodes. We motivate our design choices by a statistical analysis of the uses of type inference in a sizable body of existing ML code.
引用
收藏
页码:1 / 44
页数:44
相关论文
共 54 条
[51]  
WAND M, 1988, P IEEE S LOG COMP SC
[52]  
WAND M., 1994, THEORETICAL ASPECTS, P97
[53]  
Wells J. B., 1994, Proceedings Symposium on Logic in Computer Science LICS '94 (Cat. No.94CH3464-5), P176, DOI 10.1109/LICS.1994.316068
[54]  
[No title captured]