Dimensions in Synthesis Part 2: Applications (Intelligent Tutoring Systems) Sumit Gulwani Microsoft Research, Redmond May 2012.

Slides:



Advertisements
Similar presentations
Automated Theorem Proving Lecture 1. Program verification is undecidable! Given program P and specification S, does P satisfy S?
Advertisements

From Verification to Synthesis Sumit Gulwani Microsoft Research, Redmond August 2013 Marktoberdorf Summer School Lectures: Part 1.
Satisfiability Modulo Theories (An introduction)
Synthesizing Geometry Constructions Sumit Gulwani MSR, Redmond Vijay Korthikanti UIUC Ashish Tiwari SRI.
Abstraction and Modular Reasoning for the Verification of Software Corina Pasareanu NASA Ames Research Center.
Constraint Based Synthesis for Beginners PSY 2012 Armando Solar-Lezama.
Automated Grading of DFA Constructions Rajeev Alur (Penn), Loris D’Antoni (Penn), Sumit Gulwani (MSR), Bjoern Hartmann (Berkeley), Dileep Kini (UIUC),
Sumit Gulwani Microsoft Research, Redmond Dimensions in Program Synthesis ACM Symposium on Principles and Practice of Declarative.
Teaching Finite Automata with AutomataTutor Rajeev Alur (Penn), Loris D’Antoni (Penn), Sumit Gulwani (MSR), Bjoern Hartmann (Berkeley), Dileep Kini (UIUC),
The Z Specification Language
Formal Methods in Software Engineering Credit Hours: 3+0 By: Qaisar Javaid Assistant Professor Formal Methods in Software Engineering1.
January 5, 2015CS21 Lecture 11 CS21 Decidability and Tractability Lecture 1 January 5, 2015.
1 Undecidability Andreas Klappenecker [based on slides by Prof. Welch]
Finite Automata Great Theoretical Ideas In Computer Science Anupam Gupta Danny Sleator CS Fall 2010 Lecture 20Oct 28, 2010Carnegie Mellon University.
CPSC 411, Fall 2008: Set 12 1 CPSC 411 Design and Analysis of Algorithms Set 12: Undecidability Prof. Jennifer Welch Fall 2008.
CSE 830: Design and Theory of Algorithms
Snick  snack CPSC 121: Models of Computation 2010 Winter Term 2 DFAs in Depth Benjamin Israel Notes heavily borrowed from Steve Wolfman’s,
Synthesis of Interface Specifications for Java Classes Rajeev Alur University of Pennsylvania Joint work with P. Cerny, G. Gupta, P. Madhusudan, W. Nam,
1 Decidability continued. 2 Undecidable Problems Halting Problem: Does machine halt on input ? State-entry Problem: Does machine enter state halt on input.
Automata & Formal Languages, Feodor F. Dragan, Kent State University 1 CHAPTER 5 Reducibility Contents Undecidable Problems from Language Theory.
Problem Generation & Feedback Generation Invited ASSESS 2014 Workshop collocated with KDD 2014 Sumit Gulwani Microsoft Research, Redmond.
Recursion Chapter 7. Chapter 7: Recursion2 Chapter Objectives To understand how to think recursively To learn how to trace a recursive method To learn.
Synthesis of Loop-free Programs Sumit Gulwani (MSR), Susmit Jha (UC Berkeley), Ashish Tiwari (SRI) and Ramarathnam Venkatesan(MSR) Susmit Jha 1.
Copyright © Cengage Learning. All rights reserved. CHAPTER 11 ANALYSIS OF ALGORITHM EFFICIENCY ANALYSIS OF ALGORITHM EFFICIENCY.
Automating Grammar Comparison by Ravichandhran Madhavan, EPFL Mikael Mayër, EPFL Sumit Gulwani, MSR Viktor Kuncak, EPFL.
Recursion Chapter 7. Chapter 7: Recursion2 Chapter Objectives To understand how to think recursively To learn how to trace a recursive method To learn.
MCA –Software Engineering Kantipur City College. Topics include  Formal Methods Concept  Formal Specification Language Test plan creation Test-case.
Final Exam Review Cummulative Chapters 0, 1, 2, 3, 4, 5 and 7.
272: Software Engineering Fall 2012 Instructor: Tevfik Bultan Lecture 4: SMT-based Bounded Model Checking of Concurrent Software.
Mathematics throughout the CS Curriculum Support by NSF #
Data Structures and Programming.  John Edgar2.
Dimensions in Synthesis Sumit Gulwani Microsoft Research, Redmond May 2012.
Intelligent Tutoring Systems Traditional CAI Fully specified presentation text Canned questions and associated answers Lack the ability to adapt to students.
Relational Verification to SIMD Loop Synthesis Mark Marron – IMDEA & Microsoft Research Sumit Gulwani – Microsoft Research Gilles Barthe, Juan M. Crespo,
A Visual Interactive Tool For the Course “Automata and Formal Languages” Holon Institute of Technology Mark Trakhtenbrot, Vladimir Nodelman, Avi Lamai.
CMPS 3223 Theory of Computation Automata, Computability, & Complexity by Elaine Rich ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Slides provided.
Recursion Chapter 7. Chapter Objectives  To understand how to think recursively  To learn how to trace a recursive method  To learn how to write recursive.
Generative Programming Meets Constraint Based Synthesis Armando Solar-Lezama.
Dimensions in Synthesis Part 3: Ambiguity (Synthesis from Examples & Keywords) Sumit Gulwani Microsoft Research, Redmond May 2012.
Ethan Jackson, Nikolaj Bjørner and Wolfram Schulte Research in Software Engineering (RiSE), Microsoft Research 1. A FORMULA for Abstractions and Automated.
Major objective of this course is: Design and analysis of modern algorithms Different variants Accuracy Efficiency Comparing efficiencies Motivation thinking.
Synthesis with the Sketch System D AY 1 Armando Solar-Lezama.
Computer Science School of Computing Clemson University Discrete Math and Reasoning about Software Correctness Joseph E. Hollingsworth
Introduction to Problem Solving. Steps in Programming A Very Simplified Picture –Problem Definition & Analysis – High Level Strategy for a solution –Arriving.
MA/CSSE 474 Theory of Computation Decision Problems DFSMs.
December 2013 Technology for Education (T4E) Conference Sumit Gulwani Affiliations: Microsoft Research Adjunct Faculty.
3.2 Semantics. 2 Semantics Attribute Grammars The Meanings of Programs: Semantics Sebesta Chapter 3.
Storyboard Programming Rishabh Singh and Armando Solar-Lezama.
1 CSCD 326 Data Structures I Software Design. 2 The Software Life Cycle 1. Specification 2. Design 3. Risk Analysis 4. Verification 5. Coding 6. Testing.
Learning Symbolic Interfaces of Software Components Zvonimir Rakamarić.
Scientific Debugging. Errors in Software Errors are unexpected behaviors or outputs in programs As long as software is developed by humans, it will contain.
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.
Random Interpretation Sumit Gulwani UC-Berkeley. 1 Program Analysis Applications in all aspects of software development, e.g. Program correctness Compiler.
CS 208: Computing Theory Assoc. Prof. Dr. Brahim Hnich Faculty of Computer Sciences Izmir University of Economics.
Static Techniques for V&V. Hierarchy of V&V techniques Static Analysis V&V Dynamic Techniques Model Checking Simulation Symbolic Execution Testing Informal.
CES 592 Theory of Software Systems B. Ravikumar (Ravi) Office: 124 Darwin Hall.
Finite Automata Great Theoretical Ideas In Computer Science Victor Adamchik Danny Sleator CS Spring 2010 Lecture 20Mar 30, 2010Carnegie Mellon.
TCSS 342 Autumn 2004 Version TCSS 342 Data Structures & Algorithms Autumn 2004 Ed Hong.
1 Undecidability Andreas Klappenecker [based on slides by Prof. Welch]
CS/APMA 202 Spring 2005 Aaron Bloomfield. Sequences in Nature
CS Class 04 Topics  Selection statement – IF  Expressions  More practice writing simple C++ programs Announcements  Read pages for next.
Advanced Higher Computing Science The Project. Introduction Worth 60% of the total marks for the course Must include: An appropriate interface using input.
Sub-fields of computer science. Sub-fields of computer science.
Complexity Analysis (Part I)
Data Structures and Algorithms
CSCE 411 Design and Analysis of Algorithms
Complexity Analysis (Part I)
Rich Model Toolkit – An Infrastructure for Reliable Computer Systems
Complexity Analysis (Part I)
Presentation transcript:

Dimensions in Synthesis Part 2: Applications (Intelligent Tutoring Systems) Sumit Gulwani Microsoft Research, Redmond May 2012

Domain Insight Bit-vector Algorithms Geometry Constructions Testing & Verification Symbolic verification runs in reasonable time Testing is probabilistically sound Synthesis Strategy Counter-example guided inductive synthesis Brute-force search: Generate and Test 1 Recap

Students and Teachers End-Users Algorithm Designers Software Developers Most Transformational Target Potential Users of Synthesis Technology 2 Most Useful Target Vision for End-users: Enable people to have (automated) personal assistants. Vision for Education: Enable every student to have access to free & high-quality education.

Motivation –Online learning sites: Khan academy, Edx, Udacity, Coursera Increasing class sizes with even less personal attention –New technologies: Tablets/Smartphones, NUI, Cloud Various Aspects –Solution Generation –Problem Generation –Automated Grading/Feedback –Content Entry Various Domains –K-12: Mathematics, Physics, Chemistry –Undergraduate: Introductory Programming, Automata Theory –Language Learning 3 Intelligent Tutoring Systems

4 Joint work with: Cerny, Henzinger, Radhakrishna, Zufferey

5 Classic Problem in Automata Theory Course Solution Generation Engine Let L be the language containing all strings over {a,b} that have the same number of occurrences of “ab” as occurrences of “ba”. Construct an automata that accepts L, or prove that L is non-regular. “Regular”,

6 Classic Problem in Automata Theory Course Solution Generation Engine Let L be the language containing all strings over {a,b} that have the same number of occurrences of “a” as occurrences of “b”. Construct an automata that accepts L, or prove that L is non-regular. “Non-regular”,

 Formal Description of Input Regular Languages –Algorithm for automata synthesis. Non-regular Languages –Formal description of non-regularity proof. –Algorithm for proof synthesis. 7 Outline

Problem Description Languages Examples User-friendly logic Context-free grammar Interfaces Membership Test –Required for inductive synthesis of automata or non-regularity proof. Symbolic Membership Test –Required for verification of non-regularity proof. 8 Formal Description of Input

9 User-friendly Logic

Formal Description of Input Regular Languages  Algorithm for automata synthesis. Non-regular Languages –Formal description of non-regularity proof. –Algorithm for proof synthesis. 10 Outline

11 Automata Generation for Regular Languages

12 Distribution of Automata sizes The automata size of educational problems is small!

13 Distribution of counterexample lengths (relative to automata size) The counterexample lengths are quite smaller than worst-case possibility of twice the automata size.

Formal Description of Input Regular Languages –Algorithm for automata synthesis. Non-regular Languages  Formal description of non-regularity proof. –Algorithm for proof synthesis. 14 Outline

15 Myhill-Nerode Theorem: Non-regularity Condition

16 Examples of Congruence/Witness Functions

17 Language for Congruence/Witness Functions

Formal Description of Input Regular Languages –Algorithm for automata synthesis. Non-regular Languages –Formal description of non-regularity proof.  Algorithm for proof synthesis. 18 Outline

19 Algorithm for constructing Congruence/Witness Fns.

20 Experimental Results IdPDLGeneration Congruence Fn.Witness Fn. TestVerify 1UFPDL50.1 2UFPDL UFPDL CFG UFPDL CFG CFG50.1 9CFG UFPDL UFPDL UFPDL UFPDL CFG CFG UFPDL CFG UFPDL CFG

21 Intelligent Tutoring Systems AAAI 2012: Singh, Gulwani, Rajamani.

22 Trigonometry Problem

23 Algebra Problem Generation Example Problem Query Generation Query Query Execution New Problems Query Refinement Results OK? Refined Query No Yes Similar Problems

24 Limits/Series Problem

25 Integration Problem

26 Determinant Problem

27 Intelligent Tutoring Systems Arxiv TR 2012: Rishabh Singh, Gulwani, Armando Solar-Lezama.

28 Background: PexForFun

using System; public class Program { public static int[] Puzzle(int[] a) { int[] b = new int[a.Length]; int count = 0; for(int i=a.Length; i < a.Length; i--) { b[count] = a[i]; count++; } return b; } 29 Buggy Program for Array Reverse 6:28::50 AM

using System; public class Program { public static int[] Puzzle(int[] a) { int[] b = new int[a.Length]; int count = 0; for(int i=a.Length-1; i < a.Length-1; i--) { b[count] = a[i]; count++; } return b; } 30 Buggy Program for Array Reverse 6:32::01 AM

using System; public class Program { public static int[] Puzzle(int[] a) { int[] b = new int[a.Length]; int count = 0; for(int i=a.Length-1; i < a.Length-1; i--) { b[count] = a[i]; count++; } return b; } 31 Buggy Program for Array Reverse 6:32::32 AM No change! Sign of Frustation?

using System; public class Program { public static int[] Puzzle(int[] a) { int[] b = new int[a.Length]; int count = 0; for(int i=a.Length; i <= a.Length; i--) { b[count] = a[i]; count++; } return b; } 32 Buggy Program for Array Reverse 6:33::19 AM

using System; public class Program { public static int[] Puzzle(int[] a) { int[] b = new int[a.Length]; int count = 0; for(int i=a.Length; i < a.Length; i--) {Console.Writeline(i); b[count] = a[i]; count++; } return b; } 33 Buggy Program for Array Reverse 6:33::55 AM Same as initial attempt except Console.Writeline!

using System; public class Program { public static int[] Puzzle(int[] a) { int[] b = new int[a.Length]; int count = 0; for(int i=a.Length; i < a.Length; i--) {Console.Writeline(i); b[count] = a[i]; count++; } return b; } 34 Buggy Program for Array Reverse 6:34::06 AM No change! Sign of Frustation?

using System; public class Program { public static int[] Puzzle(int[] a) { int[] b = new int[a.Length]; int count = 0; for(int i=a.Length; i <= a.Length; i--) {Console.Writeline(i); b[count] = a[i]; count++; } return b; } 35 Buggy Program for Array Reverse 6:34::56 AM The student has tried this before!

using System; public class Program { public static int[] Puzzle(int[] a) { int[] b = new int[a.Length]; int count = 0; for(int i=a.Length; i < a.Length; i--) { b[count] = a[i]; count++; } return b; } 36 Buggy Program for Array Reverse 6:36::24 AM Same as initial attempt!

using System; public class Program { public static int[] Puzzle(int[] a) { int[] b = new int[a.Length]; int count = 0; for(int i=a.Length-1; i < a.Length-1; i--) { b[count] = a[i]; count++; } return b; } 37 Buggy Program for Array Reverse 6:37::39 AM The student has tried this before!

using System; public class Program { public static int[] Puzzle(int[] a) { int[] b = new int[a.Length]; int count = 0; for(int i=a.Length; i > 0; i--) { b[count] = a[i]; count++; } return b; } 38 Buggy Program for Array Reverse 6:38::11 AM Almost correct! (a[i-1] instead of a[i] in loop body)

using System; public class Program { public static int[] Puzzle(int[] a) { int[] b = new int[a.Length]; int count = 0; for(int i=a.Length; i >= 0; i--) { b[count] = a[i]; count++; } return b; } 39 Buggy Program for Array Reverse 6:38::44 AM Student going in wrong direction!

using System; public class Program { public static int[] Puzzle(int[] a) { int[] b = new int[a.Length]; int count = 0; for(int i=a.Length; i < a.Length; i--) { b[count] = a[i]; count++; } return b; } 40 Buggy Program for Array Reverse 6:39::33 AM Back to bigger error!

using System; public class Program { public static int[] Puzzle(int[] a) { int[] b = new int[a.Length]; int count = 0; for(int i=a.Length; i < a.Length; i--) { b[count] = a[i]; count++; } return b; } 41 Buggy Program for Array Reverse 6:39::45 AM No change! Frustation!

using System; public class Program { public static int[] Puzzle(int[] a) { int[] b = new int[a.Length]; int count = 0; for(int i=a.Length; i < a.Length; i--) { b[count] = a[i]; count++; } return b; } 42 Buggy Program for Array Reverse 6:40::27 AM No change! More Frustation!!

using System; public class Program { public static int[] Puzzle(int[] a) { int[] b = new int[a.Length]; int count = 0; for(int i=a.Length; i < a.Length; i--) { b[count] = a[i]; count++; } return b; } 43 Buggy Program for Array Reverse 6:40::57 AM No change! Too Frustated now!!! Gives up.

Provides additional value over counterexample feedback. More friendly feedback. –Helpful for students who give up after several tries (with only counterexample feedback). Grading –Counterexample feedback does not distinguish between a slightly incorrect solution and one that is very far off from being correct. 44 Proposal: Semantic Grading

45 Demo

Simplifying Assumptions Correct solution is known. Errors are predictable. Programs are small. Challenging Aspects No logical specification. –Instead program equivalence. Higher density of errors than production code. Generate multiple fixes –To remain faithful to the student’s thought process. 46 Relation with Automated Bug Fixing

Teacher provides: –A reference implementation –Model of errors that students make Sketch encoding: –Fuzz the program using error model. –Use a counter to keep track of number of changes. Sketch solving: –To generate minimal fixes, assert (counter = i) for increasing values of i. –Use off-the-shelf SAT solver to explore the state space of possible corrections. 47 Technique

Array Index Fuzzing: v[a] -> v[{a+1, a-1, v.Length-a-1}] Initialization Fuzzing: v=n -> v={n+1, n-1, 0} Increment Fuzzing: v++ -> { ++v, v--, --v } Return Value Fuzzing: return v -> return ?v Conditional Fuzzing: a op b -> a’ ops { a+1, a-1, 0 } where ops = {, =, ==, != } 48 Error Model for Array Reverse Problem

49 Effectiveness of Error Models

50 Efficiency of Error Models

51 Generality of Error Models

BenchmarkTotalFixedChangesTime(s) Array Reverse String Palindrome Array Maximum Is Increasing Order Array Sort Factorial Friday Rush Experimental Results

53 Potential Workflow Teacher grades an ungraded answer-script. System generalizes corrections into error models. System performs automated grading by considering all possible combinations and instantiations of all error models. Any ungraded answer scripts? Yes No

54 Intelligent Tutoring Systems Joint work with: Alex Polozov and Sriram Rajamani

State-of-the-art Mathematical Editors Text editors like Latex –Unreadable text in prefix notation WYSIWIG editors like Microsoft Word –Change of cursor positions multiple times. –Back and forth switching between mouse & keyboard Our proposal: An intelligent predictive editor. Mathematical text has low entropy and hence amenable to prediction! 55 Mathematical Intellisense

Terms connected by the same AC operator can be thought of as terms belonging to a sequence. There are 2 opportunities for predicting such terms. Sequence Creation: T 1, T 2, T 3, … Learn a function F such that F(T i ) = T i+1 Sequence Transformation: T 1, T 2, T 3, T 4 -> S 1, S 2, … Learn a function F such that F(T i ) = S i 56 Reducing (Term) Prediction to Learning-By-Examples

57 Mathematical (Syntactic) Intellisense

58 Mathematical (Semantic) Intellisense

Long-term Goals Ultra-intelligent computer Model of human mind Inter-stellar travel 59