Complete Completion using Types and Weights

被引:78
作者
Gvero, Tihomir [1 ]
Kuncak, Viktor [1 ]
Kuraj, Ivan [1 ]
Piskac, Ruzica
机构
[1] Ecole Polytech Fed Lausanne, CH-1015 Lausanne, Switzerland
关键词
Languages; Algorithms; program synthesis; type inhabitation; code completion; type-driven synthesis; ranking;
D O I
10.1145/2499370.2462192
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Developing modern software typically involves composing functionality from existing libraries. This task is difficult because libraries may expose many methods to the developer. To help developers in such scenarios, we present a technique that synthesizes and suggests valid expressions of a given type at a given program point. As the basis of our technique we use type inhabitation for lambda calculus terms in long normal form. We introduce a succinct representation for type judgements that merges types into equivalence classes to reduce the search space, then reconstructs any desired number of solutions on demand. Furthermore, we introduce a method to rank solutions based on weights derived from a corpus of code. We implemented the algorithm and deployed it as a plugin for the Eclipse IDE for Scala. We show that the techniques we incorporated greatly increase the effectiveness of the approach. Our evaluation benchmarks are code examples from programming practice; we make them available for future comparisons.
引用
收藏
页码:27 / 38
页数:12
相关论文
共 23 条
[1]  
[Anonymous], OOPSLA
[2]  
Bove A., 2009, TPHOLS
[3]   INHERITANCE AS IMPLICIT COERCION [J].
BREAZUTANNEN, V ;
COQUAND, T ;
GUNTER, CA ;
SCEDROV, A .
INFORMATION AND COMPUTATION, 1991, 93 (01) :172-221
[4]   Learning from Examples to Improve Code Completion Systems [J].
Bruch, Marcel ;
Monperrus, Martin ;
Mezini, Mira .
7TH JOINT MEETING OF THE EUROPEAN SOFTWARE ENGINEERING CONFERENCE AND THE ACM SIGSOFT SYMPOSIUM ON THE FOUNDATIONS OF SOFTWARE ENGINEERING, 2009, :213-222
[5]  
Chatterjee S, 2009, LECT NOTES COMPUT SC, V5503, P385
[6]  
Delahaye D., 1999, TYPES, P131
[7]  
DOWEK G, 2001, HDB AUTOMATED REASON, V2, P1009, DOI DOI 10.1016/B978-044450813-3/50018-7
[8]   Enumerating Proofs of Positive Formulae [J].
Dowek, Gilles ;
Jiang, Ying .
COMPUTER JOURNAL, 2009, 52 (07) :799-807
[9]  
Ferrari M., 2010, LPAR
[10]  
Gvero T., 2011, 23 INT C COMP AID VE