arXiv (Cornell University) · 2020 · 47 citations · 18 references
ComputingComputer ScienceMachine LearningProgramming LanguagesSoftware EngineeringAbstract Syntax TreesAnnotationData TypesGraph-based LearningType SystemsAbstractionDependency Graph AnalysisDependency Graph ConstructionGraph Neural NetworksLogical ConstraintsSource Code AnalysisType InferenceUser-defined Types
As gradual typing becomes increasingly popular in languages like Python and TypeScript, there is a growing need to infer type annotations automatically. While type annotations help with tasks like code completion and static error catching, these annotations cannot be fully determined by compilers and are tedious to annotate by hand. This paper proposes a probabilistic type inference scheme for TypeScript based on a graph neural network. Our approach first uses lightweight source code analysis to generate a program abstraction called a type dependency graph, which links type variables with logical constraints as well as name and usage information. Given this program abstraction, we then use a graph neural network to propagate information between related type variables and eventually make type predictions. Our neural architecture can predict both standard types, like number or string, as well as user-defined types that have not been encountered during training. Our experimental results show that our approach outperforms prior work in this space by $14\%$ (absolute) on library types, while having the ability to make type predictions that are out of scope for existing techniques.
18
Describing objects by their attributes
Ali Farhadi, Ian Endres, Derek Hoiem et al. · 2009 IEEE Conference on Computer Vision and Pattern Recognition · 2009 · 1.9K citations
Zero-Shot Recognition via Semantic Embeddings and Knowledge Graphs
Xiaolong Wang, Yufei Ye, Abhinav Gupta · 2018 · 699 citations
Çağlar Gülçehre, Sungjin Ahn, Ramesh Nallapati et al. · 2016 · 475 citations · Full text
Predicting Program Properties from "Big Code"
Veselin Raychev, Martin Vechev, Andreas Krause · 2014 · 314 citations
Convolutional Neural Networks over Tree Structures for Programming Language Processing
Lili Mou, Ge Li, Lu Zhang et al. · arXiv (Cornell University) · 2014 · 295 citations · Full text