arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1812.05265cs.SE
收藏

用于代码搜索的有源归纳逻辑程序设计

Active Inductive Logic Programming for Code Search

Aishwarya Sivaraman, Tianyi Zhang, Guy Van den Broeck, Miryung Kim

摘要:

现代搜索技术要么不能有效地结合人工反馈来细化搜索结果,要么不能表达所需代码的结构或语义属性。我们的交互式代码搜索技术ALICE的关键见解是,用户的反馈可以积极纳入,让用户轻松地表达和细化搜索查询。我们设计了一种查询语言来将代码的结构和语义建模为逻辑事实。给定一个带有用户注释的代码示例,ALICE自动从标记为重要的特征中提取逻辑查询。用户可以通过将一个或多个示例标记为期望的(积极的)或不相关的(消极的)来细化搜索查询。然后,ALICE通过主动归纳逻辑程序设计推断出一个新的逻辑查询,该逻辑查询将正例与反例分开。我们的全面和系统的模拟实验表明,ALICE消除了大量的误报迅速积极纳入用户的反馈。它的搜索算法对噪声和用户标记错误也具有鲁棒性。我们选择利用正面和负面示例以及所选代码的嵌套包含结构,这在细化搜索查询方面是有效的。与现有的技术相比,评论家,ALICE不需要用户手动构建一个搜索模式,但实现了相当的精度和召回率与平均更少的搜索迭代。用户案例研究表明,ALICE易于使用,并有助于表达复杂的代码模式。

英文摘要:

Modern search techniques either cannot efficiently incorporate human feedback to refine search results or to express structural or semantic properties of desired code. The key insight of our interactive code search technique ALICE is that user feedback could be actively incorporated to allow users to easily express and refine search queries. We design a query language to model the structure and semantics of code as logic facts. Given a code example with user annotations, ALICE automatically extracts a logic query from features that are tagged as important. Users can refine the search query by labeling one or more examples as desired (positive) or irrelevant (negative). ALICE then infers a new logic query that separates the positives from negative examples via active inductive logic programming. Our comprehensive and systematic simulation experiment shows that ALICE removes a large number of false positives quickly by actively incorporating user feedback. Its search algorithm is also robust to noise and user labeling mistakes. Our choice of leveraging both positive and negative examples and the nested containment structure of selected code is effective in refining search queries. Compared with an existing technique, Critics, ALICE does not require a user to manually construct a search pattern and yet achieves comparable precision and recall with fewer search iterations on average. A case study with users shows that ALICE is easy to use and helps express complex code patterns.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑