Programming by Examples Marktoberdorf Lectures August 2015 Sumit Gulwani.

Slides:



Advertisements
Similar presentations
From Verification to Synthesis Sumit Gulwani Microsoft Research, Redmond August 2013 Marktoberdorf Summer School Lectures: Part 1.
Advertisements

Composition of functions constructing a function from 2 functions (g o f) = g[f(x)] –for all x in domain of f such that f(x) is in domain of g –f is applied.
FlashExtract : A General Framework for Data Extraction by Examples
Data Manipulation using Programming by Examples and Natural Language Invited Upenn April 2015 Sumit Gulwani.
Advanced Topics in Algorithms and Data Structures Page 1 Parallel merging through partitioning The partitioning strategy consists of: Breaking up the given.
T.Sharon - A.Frank 1 Internet Resources Discovery (IRD) Classic Information Retrieval (IR)
Algorithms and Problem Solving-1 Algorithms and Problem Solving.
Lecture 2: Fundamental Concepts
Lecture 14 Go over midterm results Algorithms Efficiency More on prime numbers.
Algorithms and Problem Solving. Learn about problem solving skills Explore the algorithmic approach for problem solving Learn about algorithm development.
TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A A Sumit Gulwani (MSR Redmond) Component-based Synthesis Susmit Jha.
Parallel Merging Advanced Algorithms & Data Structures Lecture Theme 15 Prof. Dr. Th. Ottmann Summer Semester 2006.
Modern Information Retrieval Chapter 4 Query Languages.
Programming by Example using Least General Generalizations Mohammad Raza, Sumit Gulwani & Natasa Milic-Frayling Microsoft Research.
Chapter 4 Query Languages.... Introduction Cover different kinds of queries posed to text retrieval systems Keyword-based query languages  include simple.
Cultivating Research Taste (illustrated via a journey in Program Synthesis research) Programming Languages Mentoring Workshop 2015 Sumit Gulwani Microsoft.
7.5 Inverse Function 3/13/2013. x2x+ 3 x What do you notice about the 2 tables (The original function and it’s inverse)? The.
Active Learning Strategies
Programming by Examples Marktoberdorf Lectures August 2015 Sumit Gulwani.
End-User Programming (using Examples & Natural Language) Sumit Gulwani Microsoft Research, Redmond August 2013 Marktoberdorf Summer.
Dimensions in Synthesis Part 3: Ambiguity (Synthesis from Examples & Keywords) Sumit Gulwani Microsoft Research, Redmond May 2012.
Querying Structured Text in an XML Database By Xuemei Luo.
1 University of Palestine Topics In CIS ITBS 3202 Ms. Eman Alajrami 2 nd Semester
A Little Language for Surveys: Constructing an Internal DSL in Ruby H. Conrad Cunningham Computer and Information Science University of Mississippi.
Selection Control Structures. Simple Program Design, Fourth Edition Chapter 4 2 Objectives In this chapter you will be able to: Elaborate on the uses.
WIRED Week 3 Syllabus Update (next week) Readings Overview - Quick Review of Last Week’s IR Models (if time) - Evaluating IR Systems - Understanding Queries.
Formal Methods in Invited CBSoft Sep 2015 Sumit Gulwani Data Wrangling & Education.
Comp 311 Principles of Programming Languages Lecture 3 Parsing Corky Cartwright August 28, 2009.
Lyne Guertin Census Data Processing and Estimation Section Social Survey Methods Division Methodology Branch, Statistics Canada UNECE April 28-30, 2014.
Theory of Programming Languages Introduction. What is a Programming Language? John von Neumann (1940’s) –Stored program concept –CPU actions determined.
Theme 2: Data & Models One of the central processes of science is the interplay between models and data Data informs model generation and selection Models.
CSE 311 Foundations of Computing I Lecture 27 FSM Limits, Pattern Matching Autumn 2012 CSE
FlashNormalize: Programming by Examples for Text Normalization International Joint Conference on Artificial Intelligence, Buenos Aires 7/29/2015FlashNormalize1.
Predicting a Correct Program in PBE Rishabh Singh, Microsoft Research Sumit Gulwani, Microsoft Research.
CSE 303 – Software Design and Architecture
Automating String Processing in Spreadsheets using Input-Output Examples Sumit Gulwani Microsoft Research, Redmond.
Compositional Program Synthesis from Natural Language and Examples Mohammad Raza, Sumit Gulwani & Natasa Milic-Frayling Microsoft.
FlashMeta Microsoft PROSE SDK: A Framework for Inductive Program Synthesis Oleksandr Polozov University of Washington Sumit Gulwani Microsoft Research.
CMPSC 16 Problem Solving with Computers I Spring 2014 Instructor: Tevfik Bultan Lecture 4: Introduction to C: Control Flow.
Flowcharts C++ Lab. Algorithm An informal definition of an algorithm is: a step-by-step method for solving a problem or doing a task. Input data A step-by-step.
CSE 311 Foundations of Computing I Lecture 24 FSM Limits, Pattern Matching Autumn 2011 CSE 3111.
Overview of Previous Lesson(s) Over View  A token is a pair consisting of a token name and an optional attribute value.  A pattern is a description.
ICS220 – Data Structures and Algorithms Analysis Lecture 14 Dr. Ken Cosh.
Instance Discovery and Schema Matching With Applications to Biological Deep Web Data Integration Tantan Liu, Fan Wang, Gagan Agrawal {liut, wangfa,
Dagstuhl Seminar Oct 2015 Sumit Gulwani Applications of Inductive Programming in Data Wrangling.
Programming by Examples applied to Data Wrangling Invited SYNT July 2015 Sumit Gulwani.
Deductive Techniques for synthesis from Inductive Specifications Dagstuhl Seminar Oct 2015 Sumit Gulwani.
Maitrayee Mukerji. INPUT MEMORY PROCESS OUTPUT DATA INFO.
Sumit Gulwani Spreadsheet Programming using Examples Keynote at SEMS July 2016.
Sumit Gulwani Programming by Examples Applications, Algorithms & Ambiguity Resolution Keynote at IJCAR June 2016.
Tackling Ambiguity in PBE Rishabh Singh
Outline Core Synthesis Architecture [1 hour by Sumit]
The Simple Corpus Tool Martin Weisser Research Center for Linguistics & Applied Linguistics Guangdong University of Foreign Studies
Programming by Examples
Theory of Computation Lecture 4: Programs and Computable Functions II
A Composition-Based Method for Combinatorial Test Design Eitan Farchi, IBM Research, Haifa Seri Khoury, Technion Amir Shwartz and Anna Zamansky, University.
Lesson Domain and Range: Let’s use proper notation
Usability Design Space in Programming by Examples
Programming by Examples
Theory of Computation Lecture 6: Primitive Recursive Functions I
Programming by Examples
Programming by Examples
إستراتيجيات ونماذج التقويم
CSc4730/6730 Scientific Visualization
CSE 311: Foundations of Computing
Algorithms and Problem Solving
Lab 8: Regular Expressions
Information Retrieval and Web Design
Objectives The student will be able to:
Prof. Onur Mutlu Carnegie Mellon University
Presentation transcript:

Programming by Examples Marktoberdorf Lectures August 2015 Sumit Gulwani

Domain-specific Languages 1 Lecture 2

2 PBE Architecture Example-based specification Search Algorithm Challenge 1: Ambiguous/under-specified intent may result in unintended programs. Challenge 2: Designing efficient search strategy. DSL Ranking Function Program Ordered set of Programs

Balanced Expressiveness –Expressive enough to cover wide range of tasks –Restricted enough to enable efficient search Restricted set of operators –those with small inverse sets Restricted syntactic composition of those operators Natural computation patterns –Increased user understanding/confidence –Enables selection between programs, editing 3 Domain-specific Language (DSL) Guiding Principle: Use composition (parallel or sequential) of simple operators

4 FlashFill DSL Concatenate(A, C) SubStr(X, …)

What is a good choice for … in SubStr(X, …) ? Regular expression –Not very expressive. Does not take context into account. –For instance: content within parenthesis, second word Extended regular expression –Too sophisticated for learning and readability. Desired computational pattern: Should involve simple regexes. Take context into account. 5 Substring Operator

position expr P := 6 Substring Operator Pos(X, R 1, R 2, K) SubStr(X, P, P’) K th position in X whose left/right side matches with R 1 /R 2.

Evaluation of Expr SubStr(x,p,p’), where p=Pos(x,r 1, r 2,k) & p’=Pos(x,r 1 ’,r 2 ’,k’) 7 Substring Operator x p p’ w matches r 1 matches r 2 matches r 1 ’ matches r 2 ’

8 Substring Operator SubStr(x, 0, 7) SubStr(x, -8, -1)

let x = X in SubStr(x, P, P) position expr P := Pos(x, R, R, K) | K 9 Substring Operator SubStr(X, P, P) position expr P := Pos(X, R, R, K) | K let x = X in let p 1 = P[x] in let p 2 = P[x] in SubStr(x, p 1, p 2 ) position expr P[y] := Pos(y, R, R, K) | K Restriction Elegance

10 Substring Operator let x = X in let p 1 = P[x] in let p 2 = P[x] in SubStr(x, p 1, p 2 ) position expr P[y] := Pos(y, R, R, K) | K First 7 chars in 2 nd Word: let x = X in let p 1 = P[x] in let p 2 = P[x] | p 1 + P[Suffix(x,p 1 )] in SubStr(x, p 1, p 2 ) position expr P[y] := Pos(y, R, R, K) | K Increased Expressiveness

11 Substring Operator 2nd word within brackets: let x = X in let p 1 = P[x] | let p 0 = P[x] in (p 0 + P[Suffix(s, p 0 )]) in let p 2 = P[x] | p 1 + P[Suffix(x,p 1 )] in SubStr(x, p 1, p 2 ) position expr P[y] := Pos(y, R, R, K) | K Increased Expressiveness let x = X in let p 1 = P[x] in let p 2 = P[x] | p 1 + P[Suffix(x,p 1 )] in SubStr(x, p 1, p 2 ) position expr P[y] := Pos(y, R, R, K) | K

12 FlashExtract DSL let x = X in let p 1 =P[x] | let p 0 =P[x] in (p 0 +P[Suffix(s,p 0 )]) in let p 2 = P[x] | p 1 + P[Suffix(x,p 1 )] in SubStr(x, p 1, p 2 ) position expr P[y] := Pos(y, R, R, K) | K substr expr S := [X]

13 FlashExtract DSL let x = X in SubStr(x, PP[x]) position pair PP[x] := let p 1 =P[x] | let p 0 =P[x] in (p 0 +P[Suffix(s,p 0 )]) in let p 2 = P[x] | p 1 + P[Suffix(x,p 1 )] in (p 1,p 2 ) position expr P[y] := Pos(y, R, R, K) | K substr expr S := [X]

14 FlashExtract DSL

15 FlashRelate DSL

Table Re-formatting Output: Relational table Input: Semi-structured spreadsheet

Output: Relational table Input: Semi-structured spreadsheet Table Re-formatting

18 FlashRelate DSL

Balanced Expressiveness –Expressive enough to cover wide range of tasks Build out iteratively from a simple core. –Restricted enough to enable efficient search Use “let” construct for syntactic restrictions. Natural computation patterns –Use function definitions for reusability. 19 Summary: Design of DSLs for Synthesis