_Synthesis__________________ __Of_______________________ ___First-Order_____Dynamic___ _____________Programming___ _______________Algorithms___ Yewen (Evan)

Slides:



Advertisements
Similar presentations
Greedy Algorithms (Chap. 16)
Advertisements

Syntax-Guided Synthesis Rajeev Alur Joint work with R.Bodik, G.Juniwal, M.Martin, M.Raghothaman, S.Seshia, R.Singh, A.Solar-Lezama, E.Torlak, A.Udupa 1.
From Verification to Synthesis Sumit Gulwani Microsoft Research, Redmond August 2013 Marktoberdorf Summer School Lectures: Part 1.
Syntax-Guided Synthesis Rajeev Alur Joint work with R.Bodik, G.Juniwal, M.Martin, M.Raghothaman, S.Seshia, R.Singh, A.Solar-Lezama, E.Torlak, A.Udupa 1.
Syntax-Guided Synthesis Rajeev Alur Joint work with R.Bodik, G.Juniwal, M.Martin, M.Raghothaman, S.Seshia, R.Singh, A.Solar-Lezama, E.Torlak, A.Udupa 1.
Knapsack Problem Section 7.6. Problem Suppose we have n items U={u 1,..u n }, that we would like to insert into a knapsack of size C. Each item u i has.
Constraint Based Synthesis for Beginners PSY 2012 Armando Solar-Lezama.
Programming with Constraint Solvers CS294: Program Synthesis for Everyone Ras Bodik Emina Torlak Division of Computer Science University of California,
Technology from seed Weakest Precondition Synthesis for Compiler Optimizations Nuno Lopes and José Monteiro.
Programming Model for Spatial Low-Power Architectures Phitchaya Mangpo Phothilimthana and Nishant Totla with Prof. Ras Bodik mentored by Dinakar Dhurjati.
Chess Review November 21, 2005 Berkeley, CA Edited and presented by Optimal Control of Stochastic Hybrid Systems Robin Raffard EECS Berkeley.
The Future of Correct Software George Necula. 2 Software Correctness is Important ► Where there is software, there are bugs ► It is estimated that software.
2.5 Piecewise- defined Functions
StreamBit: Sketching high-performance implementations of bitstream programs Armando Solar-Lezama, Rastislav Bodik UC Berkeley.
Sketching high-performance implementations of bitstream programs. Armando Solar-Lezama, Rastislav Bodik UC Berkeley.
Center for Embedded Computer Systems Dynamic Conditional Branch Balancing during the High-Level Synthesis of Control-Intensive.
EE291E - UC BERKELEY EE291E: Hybrid Systems T. John Koo and S. Shankar Sastry Department of EECS University of California at Berkeley Spring 2002
VS 3 : Verification and Synthesis using SMT Solvers SMT Solvers for Program Verification Saurabh Srivastava * Sumit Gulwani ** Jeffrey S. Foster * * University.
Program Synthesis for Low-Power Accelerators Ras Bodik Mangpo Phitchaya Phothilimthana Tikhon Jelvis Rohin Shah Nishant Totla Computer Science UC Berkeley.
Course Overview CS294: Program Synthesis for Everyone Ras Bodik Emina Torlak Division of Computer Science University of California, Berkeley.
Templates of slides for P3 1. A brief update on your problem (important) Describe in English -what artifacts (programs, etc) will you synthesize, -what.
Programming by Sketching Armando Solar-Lezama, Liviu Tancau, Gilad Arnold, Rastislav Bodik, Sanjit Seshia UC Berkeley, Rodric Rabbah MIT, Kemal Ebcioglu,
Author: Lornet LD team Reuse freely – Just quote Desired Properties of a MOT Graphic Representation Formalism Simplicity and User Friendliness (win spec,
Kestrel Tools for Producing Reliable Software: Synthesis and Analysis Kestrel Institute Palo Alto, California Douglas R. Smith.
Combined Task and Motion Planning for Mobile Manipulation Jason Wolfe, etc. University of California, Berkeley Mozi Song INFOTECH 1.
Constraint Satisfaction Problems/Programming ZUI 2012/2013.
Abstractions and small languages in synthesis CS294: Program Synthesis for Everyone Ras Bodik Emina Torlak Division of Computer Science University of California,
The inverse function of an Exponential functions is a log function. The inverse function of an Exponential functions is a log function. Domain: Range:
Automated Controller Synthesis in QFT Designs … IIT Bombay P.S.V. Nataraj and Sachin Tharewal 1 An Interval Analysis Algorithm for Automated Controller.
Templates of slides for P2 1. A very brief refresher of your problem Describe in English -what artifacts (programs, etc) you wish to synthesize, -from.
Programming by Sketching Ras Bodik. 2 The Problem Problem: k-line algorithm translates to k lines of code. 30-year-old idea: Can we synthesize the.
“islands of California in a sea of sub-Saharan Africa.
Rohit Singh, Armando Solar-Lezama Automatic Generation of Formula Simplifiers based on Conditional Rewrite Rules Research Qualifying Examination 9-Oct-15Automatic.
Syntax-Guided Synthesis University of Pennsylvania
New applications of program synthesis
Introduction to Sketching
Making synthesis practical Are we there yet?
MULTISCALE OPTIMIZATION Desired Multiscale Objectives
Affiliation of presenter
You may choose to use any one of these provide slide templates and make changes as desired.
You may choose to use any one of these provide slide templates and make changes as desired. 1.
פחת ורווח הון סוגיות מיוחדות תהילה ששון עו"ד (רו"ח) ספטמבר 2015
أنماط الإدارة المدرسية وتفويض السلطة الدكتور أشرف الصايغ
You may choose to use any one of these provide slide templates and make changes as desired.
You may choose to use any one of these provide slide templates and make changes as desired. 1.
Programming by Sketching
Operational Rules Model – step-by-step instructions and template
Templates of slides for P4 Experiments with your synthesizer
You may choose to use any one of these provide slide templates and make changes as desired. 1.
Query Optimization.
You may choose to use any one of these provide slide templates and make changes as desired.
Armando Solar-Lezama, Rastislav Bodik UC Berkeley
You may choose to use any one of these provide slide templates and make changes as desired. 1.
You may choose to use any one of these provide slide templates and make changes as desired.
You may choose to use any one of these provide slide templates and make changes as desired.
You may choose to use any one of these provide slide templates and make changes as desired.
You may choose to use any one of these provide slide templates and make changes as desired.
More on Functions.
Synthesis with the Sketch System
You may choose to use any one of these provide slide templates and make changes as desired.
_Synthesis__________________ __Of_______________________ ___First-Order_____Dynamic___ _____________Programming___ _______________Algorithms___ Yewen (Evan)
MULTISCALE OPTIMIZATION Desired Multiscale Objectives
You may choose to use any one of these provide slide templates and make changes as desired.
You may choose to use any one of these provide slide templates and make changes as desired.
You may choose to use any one of these provide slide templates and make changes as desired.
You may choose to use any one of these provide slide templates and make changes as desired.
You may choose to use any one of these provide slide templates and make changes as desired.
You may choose to use any one of these provide slide templates and make changes as desired.
You may choose to use any one of these provide slide templates and make changes as desired.
You may choose to use any one of these provide slide templates and make changes as desired.
Presentation transcript:

_Synthesis__________________ __Of_______________________ ___First-Order_____Dynamic___ _____________Programming___ _______________Algorithms___ Yewen (Evan) Pu Rastislav Bodik Saurabh Srivastava University of California, Berkeley

Do you feel lucky?

A new way to build an island? Conventional Domain Specific Compiler: Require deep domain theories Takes a long time to implement Constraint Based Synthesizer: Write a template for desired algorithm Constraint solver fills in the template

Make Templates not Theories Suppose we want to optimize x+x+x+x With domain-specific rewrite rules: With a template in SKETCH [Solar-Lezama]: spec(x): return x+x+x+x sketch(x): return x << ?? program equivalence found using bounded model checking

A Search for a Correct Program Synthesizer finds in a space of candidate programs a correct one (it matches the specification)

Research Question in This Talk Can we write a synthesizer for an entire problem domain using a single template (sketch)?

The Challenge How do we write a template that covers all of our domain, yet the constraints it induces can be efficiently solved?

Our Approach Define a general template that contains the entire domain Optimize the search by reducing the search space

Dynamic Programming Algorithms A well-defined domain We have no DSL compiler for it (taught as an art) Difficulties: inventing sub-problems inventing recurrences We focus on a first-order sub-class, FORDP, which captures many O(n) DP algorithms

An Easy Problem Fibonacci Sequence: fib(n) = fib(n-1) + fib(n-2)

A Harder Problem Maximal Independent Sum (MIS) Input: Array of positive integers Output: Maximum sum of a non-consecutive selections of its elements.

What does the user do? mis(A): best = 0 forall selections: if non_consec(selection): best = max(best, value(A[selection])) return best

What does the template do? Define a general template that contains the entire domain

A General Template Covers every FORDP algorithm

General Template for update All possible compositions of user provided operators

Space Reduction: Optimality All FORDP recurrences have this syntactic form

Space Reduction: Optimality Recurrence for MIS:

Space Reduction: Symmetry Many operators are commutative Pick a canonical representative syntactically

Space Reduction: Recap All possible compositions Syntactically Reduced

DEMO

Benchmarks Here are some synthesized recurrences

Experiments Synthesizer solving time, in seconds out of memory

Conclusion It is possible to build a domain-specific synthesizer for FORDPA Synthesizer developer only find a syntactic domain structure The lessons learned in building the synthesizer may be general If so, we can build more islands with constraint-based synthesis