Martin Rinard, Jiasi Shen, Varun Mangalick

Slides:



Advertisements
Similar presentations
Chapter 1 Writing a Program Fall Class Overview Course Information –On the web page and Blackboard –
Advertisements

Input Validation For Free Text Fields ADD Project Members: Hagar Offer & Ran Mor Academic Advisor: Dr Gera Weiss Technical Advisors: Raffi Lipkin & Nadav.
©Brooks/Cole, 2003 Chapter 12 Abstract Data Type.
Feb. 23, 2004CS WPI1 CS 509 Design of Software Systems Lecture #5 Monday, Feb. 23, 2004.
Software Architecture Patterns (2). what is architecture? (recap) o an overall blueprint/model describing the structures and properties of a "system"
Chapter 4 Relational Databases Copyright © 2012 Pearson Education 4-1.
1 Functional Testing Motivation Example Basic Methods Timing: 30 minutes.
Information storage: Introduction of database 10/7/2004 Xiangming Mu.
CS370 Spring 2007 CS 370 Database Systems Lecture 2 Overview of Database Systems.
Database Chess A server-based web gaming application by Jordan Arnold.
Putting it all together Dynamic Data Base Access Norman White Stern School of Business.
1 CS 350 Data Structures Chaminade University of Honolulu.
Chapter 10: The Data Tier We discuss back-end data storage for Web applications, relational data, and using the MySQL database server for back-end storage.
Introduction CS 3358 Data Structures. What is Computer Science? Computer Science is the study of algorithms, including their  Formal and mathematical.
10/25/20151 Single Sign-On Web Service Supervisors: Viktor Kulikov Alexander Sherman Liana Lipstov Pavel Bilenko.
Chapter 1 Data Structures and Algorithms. Primary Goals Present commonly used data structures Present commonly used data structures Introduce the idea.
INFO1408 Database Design Concepts Week 15: Introduction to Database Management Systems.
Data Structures and Algorithms Lecture 1 Instructor: Quratulain Date: 1 st Sep, 2009.
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.
Database Management Systems (DBMS)
Data Structures and Algorithms Dr. Tehseen Zia Assistant Professor Dept. Computer Science and IT University of Sargodha Lecture 1.
SQL Based Knowledge Representation And Knowledge Editor UMAIR ABDULLAH AFTAB AHMED MOHAMMAD JAMIL SAWAR (Presented by Lei Jiang)
Data Structure Introduction Dr. Bernard Chen Ph.D. University of Central Arkansas Fall 2010.
March 1, 2004CS WPI1 CS 509 Design of Software Systems Lecture #6 Monday, March 1, 2004.
Concept mining for programming automation. Problem ➲ A lot of trivial tasks that could be automated – Add field Patronim on Customer page. – Remove field.
1 A Practical Introduction to Data Structures and Algorithm Analysis Chaminade University of Honolulu Department of Computer Science Text by Clifford Shaffer.
CS223: Software Engineering Lecture 19: Unit Testing.
INTRODUCTION TO COMPUTER PROGRAMMING(IT-303) Basics.
Review A program is… a set of instructions that tell a computer what to do. Programs can also be called… software. Hardware refers to… the physical components.
Introduction: Databases and Database Systems Lecture # 1 June 19,2012 National University of Computer and Emerging Sciences.
Maitrayee Mukerji. INPUT MEMORY PROCESS OUTPUT DATA INFO.
Fundamentals of DBMS Notes-1.
Chapter 0: Introduction
Column-Based.
System.
Generating Pieces of Web Applications with Type-Level Programming
Chapter 6 - Database Implementation and Use
Key Ideas from day 1 slides
Introduction to Visual Basic 2008 Programming
MongoDB Er. Shiva K. Shrestha ME Computer, NCIT
GC211Data Structure Lecture2 Sara Alhajjam.
Applied CyberInfrastructure Concepts Fall 2017
Accsess 2013 Creating Database.
Database Systems: Design, Implementation, and Management Tenth Edition
Architecture Components
Unit Test Pattern.
Tapping the Power of Your Historical Data
The relational operators
Chapter 6 System and Application Software
Lec 3: Object-Oriented Data Modeling
GENERAL VIEW OF KRATOS MULTIPHYSICS
Recitation Outline C++ STL associative containers Examples
Adaptable User Interfaces It’s so easy with SNAPI!
Computer Science Projects Database Theory / Prototypes
Spreadsheets, Modelling & Databases
Introduction to Data Structure
How to use hash tables to solve olympiad problems
Chapter 6 System and Application Software
Chaitali Gupta, Madhusudhan Govindaraju
FileMaker Pro: Using Advanced Features & Working with Layouts
Web APIs In computer programming, an application programming interface (API) is a set of subroutine definitions, protocols, and tools for building application.
Chapter 6 System and Application Software
CSE 1020:Software Development
Database SQL.
Chapter 6 System and Application Software
CO4301 – Advanced Games Development Week 12 Using Trees
COmputeR ScIenCe wait-list User Stories Presentation
ServiceDesk 7 Preview.
Jiasi Shen, Martin Rinard MIT EECS & CSAIL
SDMX IT Tools SDMX Registry
Presentation transcript:

Martin Rinard, Jiasi Shen, Varun Mangalick Active Learning for Inference and Regeneration of Computer Programs that Store and Retrieve Data Martin Rinard, Jiasi Shen, Varun Mangalick 11/7/18 Active Learning for Inference and Regeneration of Computer Programs that Store and Retrieve Data. Onward! '18

Everyone is learning to program Average number of CS majors per department Source: Computing Research Association, CS Undergraduate Enrollments Surge Since 2006, https://cra.org/data/generation-cs/ 11/7/18 Active Learning for Inference and Regeneration of Computer Programs that Store and Retrieve Data. Onward! '18

Everyone is learning to program Cumulative nonmajor enrollment (red) and major enrollment (blue) in computing courses Source: Computing Research Association, CS Undergraduate Enrollments Surge Since 2006, https://cra.org/data/generation-cs/ 11/7/18 Active Learning for Inference and Regeneration of Computer Programs that Store and Retrieve Data. Onward! '18

They are learning to write basic programs in simple programming languages “ ” 11/7/18 Active Learning for Inference and Regeneration of Computer Programs that Store and Retrieve Data. Onward! '18

Complex computing environments Source: http://www.justscience.in/articles/hardware-software-borderline-cloud-computing/2018/01/22 Source: http://drquincy.com/building-a-smart-home-tips-and-the-unique-concept/41/ Source: https://www.bespokesoftwaredevelopment.com/blog/what-is-web-application-software/ Source: https://jasondhall.com/self-driving-cars/ 11/7/18 Active Learning for Inference and Regeneration of Computer Programs that Store and Retrieve Data. Onward! '18

No clue about more complex platforms 11/7/18 Active Learning for Inference and Regeneration of Computer Programs that Store and Retrieve Data. Onward! '18

Even experience programmers 11/7/18 Active Learning for Inference and Regeneration of Computer Programs that Store and Retrieve Data. Onward! '18

Our system What we need What we have _____________ _____________________ ___________ _________________ ________ _____ _______ _________ ______________________ ____ ______________ _________________________ __________ What we have _________________________ _____ __________ _______ ____ ___________ Our system 11/7/18 Active Learning for Inference and Regeneration of Computer Programs that Store and Retrieve Data. Onward! '18

Program inference and regeneration Simple functionality Works with complex platforms _____ __________ ? Infer program Regenerate program Representation of functionality _______ ____ ___________ ______________________ _____________ ________ _____ __________ 11/7/18 Active Learning for Inference and Regeneration of Computer Programs that Store and Retrieve Data. Onward! '18

Black box inference with active learning ? Choose inputs Algorithm Representation of functionality 11/7/18 Active Learning for Inference and Regeneration of Computer Programs that Store and Retrieve Data. Onward! '18

Can’t possibly do this! if x == 21734873: A else: B 11/7/18 Active Learning for Inference and Regeneration of Computer Programs that Store and Retrieve Data. Onward! '18

Degenerate solution if input == i1: print o1 else if input == i2: print o2 else if input == i3: ... 11/7/18 Active Learning for Inference and Regeneration of Computer Programs that Store and Retrieve Data. Onward! '18

What we need is a model of computation Rules out uninferrable computations Rules out degenerate solutions Use domain-specific language to capture model of computation Precisely structure the model of computation so it can be inferred If the given program conforms to the DSL, guarantee correct inference 11/7/18 Active Learning for Inference and Regeneration of Computer Programs that Store and Retrieve Data. Onward! '18

Model of computation in this talk: CRUD Create – store data indexed by keys Read – retrieve data by key Update – update data by keys Delete – delete data by keys Basic Abstraction: Program implements a collection of maps Each map stores key-to-value mappings Operations insert, retrieve, update, and delete mappings Many programs implement this basic pattern 11/7/18 Active Learning for Inference and Regeneration of Computer Programs that Store and Retrieve Data. Onward! '18

Student Registration Application Example Starting point: Simple text-based implementation Interface: store/retrieve operations What we infer: Number of maps How operations store values into maps How operations retrieve values from maps How we do it: Active Learning ? enroll add drop rename Store Operations id ? name classes Retrieve Operations ? Algorithm ? 11/7/18 Active Learning for Inference and Regeneration of Computer Programs that Store and Retrieve Data. Onward! '18

Inferred store/retrieve pairs Maps initially empty Inferred store/retrieve pairs A 7 2018 enroll 7 A id A id x z enroll y 7 y Distinct 7 Algorithm 11/7/18 Active Learning for Inference and Regeneration of Computer Programs that Store and Retrieve Data. Onward! '18

Inferred store/retrieve pairs Maps initially empty Inferred store/retrieve pairs 2018 enroll 7 A id x z enroll y y id 7 Algorithm 11/7/18 Active Learning for Inference and Regeneration of Computer Programs that Store and Retrieve Data. Onward! '18

Inferred store/retrieve pairs Maps initially empty Inferred store/retrieve pairs 2018 enroll 7 A id x z enroll y y id 2018 Algorithm 11/7/18 Active Learning for Inference and Regeneration of Computer Programs that Store and Retrieve Data. Onward! '18

Inferred store/retrieve pairs Maps initially empty Inferred store/retrieve pairs 2018 enroll 7 A id x y z enroll name 7 7 A A name A x name y z enroll name 2018 A Algorithm 11/7/18 Active Learning for Inference and Regeneration of Computer Programs that Store and Retrieve Data. Onward! '18

Inferred store/retrieve pairs Maps initially empty Inferred store/retrieve pairs 2018 enroll 7 A id x y z enroll classes A 7 x name y z enroll classes A 2018 classes 7 A classes 7 2018 classes A 2018 classes 7 2018 Algorithm 11/7/18 Active Learning for Inference and Regeneration of Computer Programs that Store and Retrieve Data. Onward! '18

Inferred store/retrieve pairs Maps initially empty Inferred store/retrieve pairs id x y z enroll rename A 7 name 7 A x name y z enroll A 7 A rename x y name Algorithm 11/7/18 Active Learning for Inference and Regeneration of Computer Programs that Store and Retrieve Data. Onward! '18

Inferred store/retrieve pairs Maps initially empty Inferred store/retrieve pairs id x y z enroll add cs101 7 classes 7 2018 x name y z enroll cs101 cs101 rename x y name Algorithm 7 cs101 add c y classes w 11/7/18 Active Learning for Inference and Regeneration of Computer Programs that Store and Retrieve Data. Onward! '18

Inferred store/retrieve pairs x name y z enroll add c classes w rename id A 7 cs101 2018 enroll add drop rename id name classes 11/7/18 Active Learning for Inference and Regeneration of Computer Programs that Store and Retrieve Data. Onward! '18

Inferred store/retrieve pairs x name y z enroll add c classes w rename id 2018 enroll 7 A name 7 7 A A 11/7/18 Active Learning for Inference and Regeneration of Computer Programs that Store and Retrieve Data. Onward! '18

Inferred store/retrieve pairs x name y z enroll add c classes w rename id rename A 7 name 7 A 7 A 11/7/18 Active Learning for Inference and Regeneration of Computer Programs that Store and Retrieve Data. Onward! '18

Inferred store/retrieve pairs x name y z enroll add c classes w rename id Maps initially empty 2018 enroll 7 A rename A 7 name 7 A 11/7/18 Active Learning for Inference and Regeneration of Computer Programs that Store and Retrieve Data. Onward! '18

Inferred store/retrieve pairs x name y z enroll add c classes w rename id Maps initially empty rename A 7 name 7 A 7 A 11/7/18 Active Learning for Inference and Regeneration of Computer Programs that Store and Retrieve Data. Onward! '18

Inferred store/retrieve pairs x name y z enroll add c classes w rename id Maps initially empty add cs101 7 classes 7 2018 cs101 7 cs101 11/7/18 Active Learning for Inference and Regeneration of Computer Programs that Store and Retrieve Data. Onward! '18

Inferred store/retrieve pairs x name y z enroll add c classes w rename id Maps initially empty rename A 7 name 7 add A 7 A 11/7/18 Active Learning for Inference and Regeneration of Computer Programs that Store and Retrieve Data. Onward! '18

Inferred store/retrieve pairs x name y z enroll add c classes w rename id 11/7/18 Active Learning for Inference and Regeneration of Computer Programs that Store and Retrieve Data. Onward! '18

Inferred program in DSL Maps NameToId, IdToName, IdToClasses Store enroll x y z => NameToId[x] = y, IdToName[y] = x Store rename x y => IdToName[x] = y Store add x y => IdToClasses[x] = y Retrieve id x => return NameToId[x] Retrieve name x => return IdToName[x] Retrieve classes x => return IdToClasses[x] 11/7/18 Active Learning for Inference and Regeneration of Computer Programs that Store and Retrieve Data. Onward! '18

Inferred program in DSL Maps NameToId, IdToName, IdToClasses Store enroll x y z => NameToId[x] = y, IdToName[y] = x Store rename x y => IdToName[x] = y Store add x y => IdToClasses[x] = y Retrieve id x => return NameToId[x] Retrieve name x => return IdToName[x] Retrieve classes x => return IdToClasses[x] 11/7/18 Active Learning for Inference and Regeneration of Computer Programs that Store and Retrieve Data. Onward! '18

Inferred program in DSL Maps NameToId, IdToName, IdToClasses Store enroll x y z => NameToId[x] = y, IdToName[y] = x Store rename x y => IdToName[x] = y Store add x y => IdToClasses[x] = y Retrieve id x => return NameToId[x] Retrieve name x => return IdToName[x] Retrieve classes x => return IdToClasses[x] 11/7/18 Active Learning for Inference and Regeneration of Computer Programs that Store and Retrieve Data. Onward! '18

Inferred program in DSL Maps NameToId, IdToName, IdToClasses Store enroll x y z => NameToId[x] = y, IdToName[y] = x Store rename x y => IdToName[x] = y Store add x y => IdToClasses[x] = y Retrieve id x => return NameToId[x] Retrieve name x => return IdToName[x] Retrieve classes x => return IdToClasses[x] 11/7/18 Active Learning for Inference and Regeneration of Computer Programs that Store and Retrieve Data. Onward! '18

Inferred program in DSL _______ ____ ___________ ______________________ _____________ ________ _____ __________ Seed program Maps NameToId, IdToName, IdToClasses Store enroll x y z => NameToId[x] = y, IdToName[y] = x Store rename x y => IdToName[x] = y Store add x y => IdToClasses[x] = y Retrieve id x => return NameToId[x] Retrieve name x => return IdToName[x] Retrieve classes x => return IdToClasses[x] _______ ____ ___________ ______________________ _____________ ________ _____ __________ Existing program _______________________ ? 11/7/18 Active Learning for Inference and Regeneration of Computer Programs that Store and Retrieve Data. Onward! '18

Correctness if the original program conforms to our model of computation If original program is expressible in our DSL: Algorithm finds unique program Algorithm ends in finite time (by enumerating pairs of operations) Takeaway: Design the DSL and inference algorithm together 11/7/18 Active Learning for Inference and Regeneration of Computer Programs that Store and Retrieve Data. Onward! '18

What we do not (and don’t want to) know Irrelevant implementation detail: Internal structure of original program Packages/libraries original program uses Language in which the original program is implemented 11/7/18 Active Learning for Inference and Regeneration of Computer Programs that Store and Retrieve Data. Onward! '18

Generalizations Maps NameToId, IdToName, IdToClasses Store enroll x y z => NameToId[x] = y, IdToName[y] = x Store rename x y => IdToName[x] = y Store add x y => IdToClasses[x] = y Retrieve id x => return NameToId[x] Retrieve name x => return IdToName[x] Retrieve classes x => return IdToClasses[x] 11/7/18 Active Learning for Inference and Regeneration of Computer Programs that Store and Retrieve Data. Onward! '18

Generalizations: Accumulate lists Maps NameToId, IdToName, IdToClasses Store enroll x y z => NameToId[x] = y, IdToName[y] = x Store rename x y => IdToName[x] = y Store add x y => IdToClasses[x] = IdToClasses[x] + y Retrieve id x => return NameToId[x] Retrieve name x => return IdToName[x] Retrieve classes x => return IdToClasses[x] 11/7/18 Active Learning for Inference and Regeneration of Computer Programs that Store and Retrieve Data. Onward! '18

Generalizations: Remove elements Maps NameToId, IdToName, IdToClasses Store enroll x y z => NameToId[x] = y, IdToName[y] = x Store rename x y => IdToName[x] = y Store add x y => IdToClasses[x] = IdToClasses[x] + y Store drop x y => IdToClasses[x] = IdToClasses[x] - y Retrieve id x => return NameToId[x] Retrieve name x => return IdToName[x] Retrieve classes x => return IdToClasses[x] 11/7/18 Active Learning for Inference and Regeneration of Computer Programs that Store and Retrieve Data. Onward! '18

Generalizations: Retrieve only when inputs satisfy some condition Maps NameToId, IdToName, IdToClasses, IdToYear Store enroll x y z => NameToId[x] = y, IdToName[y] = x, IdToYear[y] = z Store rename x y => IdToName[x] = y Store add x y => IdToClasses[x] = IdToClasses[x] + y Store drop x y => IdToClasses[x] = IdToClasses[x] - y Retrieve id x => return NameToId[x] Retrieve name x => return IdToName[x] Retrieve classes x => return IdToClasses[x] Retrieve nameByYear x y => return IdToName[y] if IdToYear[x] >= y 11/7/18 Active Learning for Inference and Regeneration of Computer Programs that Store and Retrieve Data. Onward! '18

Potential regenerations Encapsulated expert knowledge - Implement once Automatically generated safety/security checks Automatically generated code for data storage Databases, fault tolerant replications, other data structure implementations Automatically generated user interfaces GUI, web apps, mobile apps Automatically generated configuration files Database table schema, library versions, etc. 11/7/18 Active Learning for Inference and Regeneration of Computer Programs that Store and Retrieve Data. Onward! '18

Inference and Regeneration _______ ____ ___________ ______________________ _____________ ________ _____ __________ _______ ____ ___________ _______________________ _____ __________ ? 11/7/18 Active Learning for Inference and Regeneration of Computer Programs that Store and Retrieve Data. Onward! '18

Future Broader range of applications Legacy programs, obfuscated programs More sophisticated inference algorithms More features – conditionals, loops, more sophisticated state Black box, gray box, white box 11/7/18 Active Learning for Inference and Regeneration of Computer Programs that Store and Retrieve Data. Onward! '18

Representation of functionality Black box inference ? Choose inputs Algorithm Representation of functionality 11/7/18 Active Learning for Inference and Regeneration of Computer Programs that Store and Retrieve Data. Onward! '18

Gray box inference: Exploiting component decompositions ? Choose inputs Algorithm Representation of functionality ? ? 11/7/18 Active Learning for Inference and Regeneration of Computer Programs that Store and Retrieve Data. Onward! '18

Gray box inference (Konure): Exploiting component decompositions ? Choose inputs Algorithm Representation of functionality DB 11/7/18 Active Learning for Inference and Regeneration of Computer Programs that Store and Retrieve Data. Onward! '18

Inference and Regeneration Conclusion What we need _____________ _____________________ ___________ _________________ ________ _____ _______ _________ ______________________ ____ ______________ _________________________ __________ What we have _________________________ _____ __________ _______ ____ ___________ Inference and Regeneration _______ ____ ___________ _______________________ _____ __________ ? 11/7/18 Active Learning for Inference and Regeneration of Computer Programs that Store and Retrieve Data. Onward! '18