Interactive Program Synthesis by Augmented Examples

Programming-by-example (PBE) has become an increasingly popular component in software development tools, human-robot interaction, and end-user programming. A long-standing challenge in PBE is the inherent ambiguity in user-provided examples. This paper presents an interaction model to disambiguate user intent and reduce the cognitive load of understanding and validating synthesized programs. Our model provides two types of augmentations to user-given examples: 1) semantic augmentation where a user can specify how different aspects of an example should be treated by a synthesizer via light-weight annotations, and 2) data augmentation where the synthesizer generates additional examples to help the user understand and validate synthesized programs. We implement and demonstrate this interaction model in the domain of regular expressions, which is a popular mechanism for text processing and data wrangling and is often considered hard to master even for experienced programmers. A within-subjects user study with twelve participants shows that, compared with only inspecting and annotating synthesized programs, interacting with augmented examples significantly increases the success rate of finishing a programming task with less time and increases users? confidence of synthesized programs.

[1]  Nikolai Tillmann,et al.  Pex-White Box Test Generation for .NET , 2008, TAP.

[2]  Jeffrey Heer,et al.  Proactive wrangling: mixed-initiative end-user programming of data transformation scripts , 2011, UIST.

[3]  Gérard Berry,et al.  From Regular Expressions to Deterministic Automata , 1986, Theor. Comput. Sci..

[4]  Kathryn T. Stolee,et al.  How well are regular expressions tested in the wild? , 2018, ESEC/SIGSOFT FSE.

[5]  Allison Sauppé,et al.  Bodystorming Human-Robot Interactions , 2019, UIST.

[6]  Amos Azaria,et al.  SUGILITE: Creating Multimodal Smartphone Automation by Demonstration , 2017, CHI.

[7]  Rajesh Parekh,et al.  An Incremental Interactive Algorithm for Regular Grammar Inference , 1996, AAAI/IAAI, Vol. 2.

[8]  Kathryn T. Stolee,et al.  Exploring regular expression usage and context in Python , 2016, ISSTA.

[9]  Zohar Manna,et al.  Knowledge and Reasoning in Program Synthesis , 1974, IJCAI.

[10]  Sumit Gulwani,et al.  Program Synthesis , 2017, Software Systems Safety.

[11]  Ruzica Piskac,et al.  Synthesizing configuration file specifications with association rule learning , 2017, Proc. ACM Program. Lang..

[12]  D. Gentner,et al.  Learning and Transfer: A General Role for Analogical Encoding , 2003 .

[13]  Armando Solar-Lezama,et al.  Sampling for Bayesian Program Learning , 2016, NIPS.

[14]  Aws Albarghouthi,et al.  MapReduce program synthesis , 2016, PLDI.

[15]  Jeffrey D. Ullman,et al.  Introduction to Automata Theory, Languages and Computation , 1979 .

[16]  Kathryn T. Stolee,et al.  Exploring regular expression comprehension , 2017, 2017 32nd IEEE/ACM International Conference on Automated Software Engineering (ASE).

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

[18]  Eran Yahav,et al.  Programming Not Only by Example , 2017, 2018 IEEE/ACM 40th International Conference on Software Engineering (ICSE).

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

[20]  Alvin Cheung,et al.  Visualization by example , 2020, Proc. ACM Program. Lang..

[21]  Gordon Fraser,et al.  EvoSuite: automatic test suite generation for object-oriented software , 2011, ESEC/FSE '11.

[22]  Sumit Gulwani,et al.  FIDEX: filtering spreadsheet data using examples , 2016, OOPSLA.

[23]  Andreas Krause,et al.  Learning programs from noisy data , 2016, POPL.

[24]  Isil Dillig,et al.  Component-based synthesis for complex APIs , 2017, POPL.

[25]  Yifei Yuan,et al.  NetEgg: Programming Network Policies by Examples , 2014, HotNets.

[26]  Aws Albarghouthi,et al.  Efficient Synthesis with Probabilistic Constraints , 2019, CAV.

[27]  Sumit Gulwani,et al.  Learning Syntactic Program Transformations from Examples , 2016, 2017 IEEE/ACM 39th International Conference on Software Engineering (ICSE).

[28]  Sumit Gulwani,et al.  Oracle-guided component-based program synthesis , 2010, 2010 ACM/IEEE 32nd International Conference on Software Engineering.

[29]  GulwaniSumit Automating string processing in spreadsheets using input-output examples , 2011 .

[30]  S. Hart,et al.  Development of NASA-TLX (Task Load Index): Results of Empirical and Theoretical Research , 1988 .

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

[32]  C. Cordell Green,et al.  Application of Theorem Proving to Problem Solving , 1969, IJCAI.

[33]  Rishabh Singh,et al.  NoFAQ: synthesizing command repairs from examples , 2016, ESEC/SIGSOFT FSE.

[34]  Richard C. T. Lee,et al.  PROW: A Step Toward Automatic Program Writing , 1969, IJCAI.

[35]  Adam Kiezun,et al.  Grammar-based whitebox fuzzing , 2008, PLDI '08.

[36]  Michael D. Ernst,et al.  A type system for regular expressions , 2012, FTfJP@ECOOP.

[37]  Oleksandr Polozov,et al.  Program Synthesis and Semantic Parsing with Learned Code Idioms , 2019, NeurIPS.

[38]  Rishabh Singh,et al.  Learn&Fuzz: Machine learning for input fuzzing , 2017, 2017 32nd IEEE/ACM International Conference on Automated Software Engineering (ASE).

[39]  Rishabh Singh,et al.  Qlose: Program Repair with Quantitative Objectives , 2016, CAV.

[40]  Sumit Gulwani,et al.  Spreadsheet data manipulation using examples , 2012, CACM.

[41]  Isil Dillig,et al.  Multi-modal synthesis of regular expressions , 2019, PLDI.

[42]  Tom M. Mitchell,et al.  PUMICE: A Multi-Modal Agent that Learns Concepts and Conditionals from Natural Language and Demonstrations , 2019, UIST.

[43]  C. Cordell Green,et al.  What Is Program Synthesis? , 1985, J. Autom. Reason..

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

[45]  Butler W. Lampson,et al.  A colorful approach to text processing by example , 2013, UIST.

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

[47]  Rob Miller,et al.  Lightweight Structured Text Processing , 1999, USENIX Annual Technical Conference, General Track.

[48]  Tessa A. Lau,et al.  The Case Studies: Three Systems Why Programming by Demonstration Systems Fail: Lessons Learned for Usable Ai , 2022 .

[49]  Andreas Zeller,et al.  Fuzzing with Code Fragments , 2012, USENIX Security Symposium.

[50]  Sumit Gulwani,et al.  FlashExtract: a framework for data extraction by examples , 2014, PLDI.

[51]  Rastislav Bodík,et al.  Rousillon: Scraping Distributed Hierarchical Web Data , 2018, UIST.

[52]  Pedro M. Domingos,et al.  Programming by Demonstration Using Version Space Algebra , 2003, Machine Learning.

[53]  Xiang 'Anthony' Chen,et al.  Robiot: A Design Tool for Actuating Everyday Objects with Automatically Generated 3D Printable Mechanisms , 2019, UIST.

[54]  KrauseAndreas,et al.  Learning programs from noisy data , 2016 .

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

[56]  Benjamin B. Bederson,et al.  Towards Understanding Human Mistakes of Programming by Example: An Online User Study , 2017, IUI.

[57]  Allison Sauppé,et al.  Transforming Robot Programs Based on Social Context , 2020, CHI.

[58]  Sumit Gulwani,et al.  Wrex: A Unified Programming-by-Example Interaction for Synthesizing Readable Code for Data Scientists , 2020, CHI.

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

[60]  Jeffrey Heer,et al.  Wrangler: interactive visual specification of data transformation scripts , 2011, CHI.

[61]  Isil Dillig,et al.  Synthesizing database programs for schema refactoring , 2019, PLDI.

[62]  Tom M. Mitchell,et al.  APPINITE: A Multi-Modal Interface for Specifying Data Descriptions in Programming by Demonstration Using Natural Language Instructions , 2018, 2018 IEEE Symposium on Visual Languages and Human-Centric Computing (VL/HCC).

[63]  Regina Barzilay,et al.  Neural Generation of Regular Expressions from Natural Language with Minimal Domain Knowledge , 2016, EMNLP.

[64]  Sumit Gulwani,et al.  User Interaction Models for Disambiguation in Programming by Example , 2015, UIST.

[65]  Zohar Manna,et al.  Toward automatic program synthesis , 1971, Symposium on Semantics of Algorithmic Languages.