Synthesizing Conjunctive Queries for Code Search

05/07/2023
by   Chengpeng Wang, et al.
0

This paper presents Squid, a new conjunctive query synthesis algorithm for searching code with target patterns. Given positive and negative examples along with a natural language description, Squid analyzes the relations derived from the examples by a Datalog-based program analyzer and synthesizes a conjunctive query expressing the search intent. The synthesized query can be further used to search for desired grammatical constructs in the editor. To achieve high efficiency, we prune the huge search space by removing unnecessary relations and enumerating query candidates via refinement. We also introduce two quantitative metrics for query prioritization to select the queries from multiple candidates, yielding desired queries for code search. We have evaluated Squid on over thirty code search tasks. It is shown that Squid successfully synthesizes the conjunctive queries for all the tasks, taking only 2.56 seconds on average.

READ FULL TEXT

page 2

page 24

research
12/13/2018

Active Inductive Logic Programming for Code Search

Modern search techniques either cannot efficiently incorporate human fee...
research
06/06/2021

Clone-Seeker: Effective Code Clone Search Using Annotations

Source code search plays an important role in software development, e.g....
research
12/25/2013

Description Logics based Formalization of Wh-Queries

The problem of Natural Language Query Formalization (NLQF) is to transla...
research
02/21/2018

Learning to Synthesize

In many scenarios we need to find the most likely program under a local ...
research
09/02/2022

Type-Directed Synthesis of Visualizations from Natural Language Queries

We propose a new technique based on program synthesis for automatically ...
research
12/07/2022

You Don't Know Search: Helping Users Find Code by Automatically Evaluating Alternative Queries

Tens of thousands of engineers use Sourcegraph day-to-day to search for ...
research
11/11/2019

Program Synthesis by Type-Guided Abstraction Refinement

We consider the problem of type-directed component based synthesis where...

Please sign up or login with your details

Forgot password? Click here to reset