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 条
[1]  
ADITYA S, 1991, LECT NOTES COMPUTER
[2]  
AIKEN A, 1993, C FUNCT PROGR LANG C, P31
[3]  
[Anonymous], ACM COMPUTING SURVEY
[4]  
Boehm H.-J., 1985, 26th Annual Symposium on Foundations of Computer Science (Cat. No.85CH2224-4), P339, DOI 10.1109/SFCS.1985.44
[5]  
BOEHM HJ, 1989, P ACM SIGPLAN C PROG, P192
[6]   Making the future safe for the past:: Adding genericity to the Java']Java™ programming language [J].
Bracha, G ;
Odersky, M ;
Stoutamire, D ;
Wadler, P .
ACM SIGPLAN NOTICES, 1998, 33 (10) :183-200
[7]  
Cardelli L., 1991, Journal of Functional Programming, V1, P417, DOI 10.1017/S0956796800000198
[8]   AN EXTENSION OF SYSTEM-F WITH SUBTYPING [J].
CARDELLI, L ;
MARTINI, S ;
MITCHELL, JC ;
SCEDROV, A .
INFORMATION AND COMPUTATION, 1994, 109 (1-2) :4-56
[9]  
CARDELLI L, 1990, UNPUB NOTES F LESS T
[10]  
CARDELLI L, 1993, 97 DEC SYST RES CTR