ProSy: API-Based Synthesis with Probabilistic Model
Autor: | Yating Zhang, Wei Dong, Daiyan Wang, Jiaxin Liu, Binbin Liu |
---|---|
Rok vydání: | 2020 |
Předmět: |
Application programming interface
Java Programming language Process (engineering) Computer science Probabilistic logic 020207 software engineering Javadoc 02 engineering and technology Construct (python library) computer.software_genre Computer Science Applications Theoretical Computer Science Computational Theory and Mathematics Hardware and Architecture 0202 electrical engineering electronic engineering information engineering Stack overflow Graph (abstract data type) computer Software Program synthesis computer.programming_language |
Zdroj: | Journal of Computer Science and Technology. 35:1234-1257 |
ISSN: | 1860-4749 1000-9000 |
DOI: | 10.1007/s11390-020-0520-4 |
Popis: | Program synthesis is an exciting topic that desires to generate programs satisfying user intent automatically. But in most cases, only small programs for simple or domain-specific tasks can be synthesized. The major obstacle of synthesis lies in the huge search space. A common practice in addressing this problem is using a domain-specific language, while many approaches still wish to synthesize programs in general programming languages. With the rapid growth of reusable libraries, component-based synthesis provides a promising way, such as synthesizing Java programs which are only composed of APIs (application programming interfaces). However, the efficiency of searching for proper solutions for complex tasks is still a challenge. Given an unfamiliar programming task, programmers would search for API usage knowledge from various coding resources to reduce the search space. Considering this, we propose a novel approach named ProSy to synthesize API-based programs in Java. The key novelty is to retrieve related knowledge from Javadoc and Stack Overflow and then construct a probabilistic reachability graph. It assigns higher probabilities to APIs that are more likely to be used in implementing the given task. In the synthesis process, the program sketch with a higher probability will be considered first; thus, the number of explored reachable paths would be decreased. Some extension and optimization strategies are further studied in the paper. We implement our approach and conduct several experiments on it. We compare ProSy with SyPet and other state-of-the-art API-based synthesis approaches. The experimental results show that ProSy reduces the synthesis time of SyPet by up to 80%. |
Databáze: | OpenAIRE |
Externí odkaz: |