当前位置: X-MOL 学术J. Comput. Sci. Tech. › 论文详情
Our official English website, www.x-mol.net, welcomes your feedback! (Note: you will need to create a separate account there.)
ProSy: API-Based Synthesis with Probabilistic Model
Journal of Computer Science and Technology ( IF 1.2 ) Pub Date : 2020-11-30 , DOI: 10.1007/s11390-020-0520-4
Bin-Bin Liu , Wei Dong , Jia-Xin Liu , Ya-Ting Zhang , Dai-Yan Wang

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%.



中文翻译:

ProSy:基于概率模型的基于API的综合

程序合成是一个令人兴奋的话题,它希望自动生成满足用户意图的程序。但是在大多数情况下,只能合成用于简单任务或特定领域任务的小型程序。合成的主要障碍在于巨大的搜索空间。解决此问题的常用方法是使用领域特定的语言,而许多方法仍希望以通用编程语言来合成程序。随着可重用库的快速增长,基于组件的合成提供了一种有前途的方法,例如合成仅由API(应用程序编程接口)组成的Java程序。但是,为复杂任务寻找适当解决方案的效率仍然是一个挑战。鉴于您不熟悉编程任务,程序员将从各种编码资源中搜索API使用知识,以减少搜索空间。考虑到这一点,我们提出了一种名为ProSy的新颖方法来合成Java中基于API的程序。关键的新颖性是从Javadoc和Stack Overflow检索相关知识,然后构造一个概率可达性图。它将较高的概率分配给更可能用于实现给定任务的API。在综合过程中,将首先考虑具有较高概率的程序草图。因此,探索的可达路径的数量将减少。本文进一步研究了一些扩展和优化策略。我们实施了我们的方法并对此进行了一些实验。我们将ProSy与SyPet和其他基于API的最新合成方法进行了比较。

更新日期:2020-12-07
down
wechat
bug