Synthesizing Queries via Interactive Sketching

We propose a novel approach to program synthesis, focusing on synthesizing database queries. At a high level, our proposed algorithm takes as input a sketch with soft constraints encoding user intent, and then iteratively interacts with the user to refine the sketch. At each step, our algorithm proposes a candidate refinement of the sketch, which the user can either accept or reject. By leveraging this rich form of user feedback, our algorithm is able to both resolve ambiguity in user intent and improve scalability. In particular, assuming the user provides accurate inputs and responses, then our algorithm is guaranteed to converge to the true program (i.e., one that the user approves) in polynomial time. We perform a qualitative evaluation of our algorithm, showing how it can be used to synthesize a variety of queries on a database of academic publications.

[1]  Sebastian Nowozin,et al.  DeepCoder: Learning to Write Programs , 2016, ICLR.

[2]  Leslie Pack Kaelbling,et al.  Selecting Representative Examples for Program Synthesis , 2017, ICML.

[3]  Isil Dillig,et al.  Automated Migration of Hierarchical Data to Relational Tables using Programming-by-Example , 2017, Proc. VLDB Endow..

[4]  Andreas Krause,et al.  Adaptive Submodularity: Theory and Applications in Active Learning and Stochastic Optimization , 2010, J. Artif. Intell. Res..

[5]  Isil Dillig,et al.  Component-based synthesis of table consolidation and transformation tasks from examples , 2016, PLDI.

[6]  Edsger W. Dijkstra,et al.  A constructive approach to the problem of program correctness , 1968 .

[7]  Alexander Aiken,et al.  Active learning of points-to specifications , 2017, PLDI.

[8]  Sanjit A. Seshia,et al.  Combinatorial sketching for finite programs , 2006, ASPLOS XII.

[9]  Armando Solar-Lezama,et al.  Programming by sketching for bit-streaming programs , 2005, PLDI '05.

[10]  Alexander Aiken,et al.  Stochastic optimization of floating-point programs with tunable precision , 2014, PLDI.

[11]  Isil Dillig,et al.  Synthesizing data structure transformations from input-output examples , 2015, PLDI.

[12]  Andrew McCallum,et al.  Toward Optimal Active Learning through Sampling Estimation of Error Reduction , 2001, ICML.

[13]  Alexander Aiken,et al.  Stochastic superoptimization , 2012, ASPLOS '13.

[14]  Eran Yahav,et al.  Synthesis with Abstract Examples , 2017, CAV.

[15]  Le Song,et al.  Learning a Meta-Solver for Syntax-Guided Program Synthesis , 2018, ICLR.

[16]  Zohar Manna,et al.  A Deductive Approach to Program Synthesis , 1979, TOPL.

[17]  NAVID YAGHMAZADEH,et al.  SQLizer: query synthesis from natural language , 2017, Proc. ACM Program. Lang..

[18]  Dan Klein,et al.  Learning from measurements in exponential families , 2009, ICML '09.

[19]  Alvin Cheung,et al.  Interactive Query Synthesis from Input-Output Examples , 2017, SIGMOD Conference.

[20]  Sanjoy Dasgupta,et al.  A General Agnostic Active Learning Algorithm , 2007, ISAIM.

[21]  John Langford,et al.  Importance weighted active learning , 2008, ICML '09.

[22]  Michael Norrish,et al.  seL4: formal verification of an OS kernel , 2009, SOSP '09.

[23]  Carroll Morgan,et al.  Programming from specifications , 1990, Prentice Hall International Series in computer science.

[24]  Alvin Cheung,et al.  Synthesizing highly expressive SQL queries from input-output examples , 2017, PLDI.

[25]  Isil Dillig,et al.  Program synthesis using conflict-driven learning , 2017, PLDI.

[26]  Sumit Gulwani,et al.  FlashMeta: a framework for inductive program synthesis , 2015, OOPSLA.

[27]  Alexander Aiken,et al.  Synthesizing program input grammars , 2016, PLDI.

[28]  Sumit Gulwani,et al.  Neural-Guided Deductive Search for Real-Time Program Synthesis from Examples , 2018, ICLR.

[29]  Armando Solar-Lezama,et al.  The Sketching Approach to Program Synthesis , 2009, APLAS.

[30]  Rajeev Alur,et al.  Accelerating search-based program synthesis using learned probabilistic models , 2018, PLDI.

[31]  Fei Li,et al.  Constructing an Interactive Natural Language Interface for Relational Databases , 2014, Proc. VLDB Endow..

[32]  Sanjoy Dasgupta,et al.  Analysis of a greedy active learning strategy , 2004, NIPS.

[33]  Sumit Gulwani,et al.  Interactive Program Synthesis , 2017, ArXiv.

[34]  Armando Solar-Lezama,et al.  Program synthesis from polymorphic refinement types , 2015, PLDI.

[35]  Sanjoy Dasgupta,et al.  Interactive Bayesian Hierarchical Clustering , 2016, ICML.

[36]  S. Chib,et al.  Understanding the Metropolis-Hastings Algorithm , 1995 .

[37]  Sumit Gulwani,et al.  Automating string processing in spreadsheets using input-output examples , 2011, POPL '11.