Spreadsheet table transformations from examples

Every day, millions of computer end-users need to perform tasks over large, tabular data, yet lack the programming knowledge to do such tasks automatically. In this work, we present an automatic technique that takes from a user an example of how the user needs to transform a table of data, and provides to the user a program that implements the transformation described by the example. In particular, we present a language of programs TableProg that can describe transformations that real users require.We then present an algorithm ProgFromEx that takes an example input and output table, and infers a program in TableProg that implements the transformation described by the example. When the program is applied to the example input, it reproduces the example output. When the program is applied to another, potentially larger, table with a 'similar' layout as the example input table, then the program produces a corresponding table with a layout that is similar to the example output table. A user can apply ProgFromEx interactively, providing multiple small examples to obtain a program that implements the transformation that the user desires. Moreover, ProgFromEx can help identify 'noisy' examples that contain errors. To evaluate the practicality of TableProg and ProgFromEx, we implemented ProgFromEx as a module for the Microsoft Excel spreadsheet program. We applied the module to automatically implement over 50 table transformations specified by endusers through examples on online Excel help forums. In seconds, ProgFromEx found programs that satisfied the examples and could be applied to larger input tables. This experience demonstrates that TableProg and ProgFromEx can significantly automate the tasks over tabular data that users need to perform.

[1]  Srinivasan Parthasarathy,et al.  Query by output , 2009, SIGMOD Conference.

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

[3]  Robert P. Nix,et al.  Editing by example , 1984 .

[4]  Sumit Gulwani,et al.  Synthesis of loop-free programs , 2011, PLDI '11.

[5]  Neil Immerman,et al.  A simple inductive synthesis methodology and its applications , 2010, OOPSLA.

[6]  Benjamin C. Pierce,et al.  Matching lenses: alignment and view update , 2010, ICFP '10.

[7]  Ian H. Witten,et al.  TELS: learning text editing tasks from examples , 1993 .

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

[9]  Sanjit A. Seshia,et al.  Sketching stencils , 2007, PLDI '07.

[10]  Sumit Gulwani,et al.  Synthesizing switching logic using constraint solving , 2010, International Journal on Software Tools for Technology Transfer.

[11]  David Walker,et al.  From dirt to shovels: fully automatic tool generation from ad hoc data , 2008, POPL '08.

[12]  Sumit Gulwani,et al.  Path-based inductive synthesis for program inversion , 2011, PLDI '11.

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

[14]  Henry Lieberman,et al.  Watch what I do: programming by demonstration , 1993 .

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

[16]  Sumit Gulwani Dimensions in Program Synthesis (Invited Talk Paper) , 2010 .

[17]  Jennifer Widom,et al.  Synthesizing view definitions from data , 2010, ICDT '10.

[18]  Sumit Gulwani,et al.  Dimensions in program synthesis , 2010, Formal Methods in Computer Aided Design.

[19]  Martin Erwig,et al.  Header and Unit Inference for Spreadsheets Through Spatial Analyses , 2004, 2004 IEEE Symposium on Visual Languages - Human Centric Computing.

[20]  Pedro M. Domingos,et al.  Version Space Algebra and its Application to Programming by Demonstration , 2000, ICML.

[21]  Sumit Gulwani,et al.  From program verification to program synthesis , 2010, POPL '10.