Proving Programs Robust Swarat Chaudhuri 1,3 Sumit Gulwani 2 Roberto Lublinerman 1 Sara Navidpour 1 1 Pennsylvania State University 2 Microsoft Research.

Slides:



Advertisements
Similar presentations
Lecture 15. Graph Algorithms
Advertisements

Algorithmic Mechanism Design: an Introduction VCG-mechanisms for some basic network optimization problems: The Minimum Spanning Tree problem Guido Proietti.
Lower Bound for Sparse Euclidean Spanners Presented by- Deepak Kumar Gupta(Y6154), Nandan Kumar Dubey(Y6279), Vishal Agrawal(Y6541)
Optimization Problems in Optical Networks. Wavelength Division Multiplexing (WDM) Directed: Symmetric: Undirected: Optic Fiber.
Algorithm Design Methodologies Divide & Conquer Dynamic Programming Backtracking.
1 Discrete Structures & Algorithms Graphs and Trees: III EECE 320.
Programming Abstractions for Approximate Computing Michael Carbin with Sasa Misailovic, Hank Hoffmann, Deokhwan Kim, Stelios Sidiroglou, Martin Rinard.
Discussion #33 Adjacency Matrices. Topics Adjacency matrix for a directed graph Reachability Algorithmic Complexity and Correctness –Big Oh –Proofs of.
Graph Traversals Visit vertices of a graph G to determine some property: Is G connected? Is there a path from vertex a to vertex b? Does G have a cycle?
Randomized Accuracy Aware Program Transformations for Efficient Approximate Computations Sasa Misailovic Joint work with Zeyuan Allen ZhuJonathan KelnerMartin.
Lifting Abstract Interpreters to Quantified Logical Domains Sumit Gulwani, MSR Bill McCloskey, UCB Ashish Tiwari, SRI 1.
Lecture 5: Linear Time Sorting Shang-Hua Teng. Sorting Input: Array A[1...n], of elements in arbitrary order; array size n Output: Array A[1...n] of the.
Data Structures Heaps and Graphs i206 Fall 2010 John Chuang Some slides adapted from Marti Hearst, Brian Hayes, or Glenn Brookshear.
CSE 421 Algorithms Richard Anderson Dijkstra’s algorithm.
Shortest Paths Definitions Single Source Algorithms –Bellman Ford –DAG shortest path algorithm –Dijkstra All Pairs Algorithms –Using Single Source Algorithms.
Spring 2010CS 2251 Graphs Chapter 10. Spring 2010CS 2252 Chapter Objectives To become familiar with graph terminology and the different types of graphs.
Chapter 9 Graph algorithms Lec 21 Dec 1, Sample Graph Problems Path problems. Connectedness problems. Spanning tree problems.
Utrecht, february 22, 2002 Applications of Tree Decompositions Stan van Hoesel KE-FdEWB Universiteit Maastricht
DAST 2005 Tirgul 12 (and more) sample questions. DAST 2005 Q.We’ve seen that solving the shortest paths problem requires O(VE) time using the Belman-Ford.
1 Parallel Algorithms III Topics: graph and sort algorithms.
CSE 421 Algorithms Richard Anderson Lecture 10 Minimum Spanning Trees.
Lecture 27 CSE 331 Nov 3, Combining groups Groups can unofficially combine in the lectures.
Greedy Algorithms Like dynamic programming algorithms, greedy algorithms are usually designed to solve optimization problems Unlike dynamic programming.
Cs466(Prasad)L8Norm1 Normal Forms Chomsky Normal Form Griebach Normal Form.
Dijkstra’s Algorithm Slide Courtesy: Uwash, UT 1.
Graphs & Graph Algorithms 2 Fawzi Emad Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
DAST, Spring © L. Joskowicz 1 Data Structures – LECTURE 1 Introduction Motivation: algorithms and abstract data types Easy problems, hard problems.
Math – Getting Information from the Graph of a Function 1.
Graphs – Shortest Path (Weighted Graph) ORD DFW SFO LAX
1 Quantum query complexity of some graph problems C. DürrUniv. Paris-Sud M. HeiligmanNational Security Agency P. HøyerUniv. of Calgary M. MhallaInstitut.
Lecture 12-2: Introduction to Computer Algorithms beyond Search & Sort.
On the Construction of Data Aggregation Tree with Minimum Energy Cost in Wireless Sensor Networks: NP-Completeness and Approximation Algorithms National.
Swarat Chaudhuri Roberto Lublinerman Pennsylvania State University Sumit Gulwani Microsoft Research CAUCHY Continuity analysis of programs.
Prof. Swarat Chaudhuri COMP 482: Design and Analysis of Algorithms Spring 2012 Lecture 10.
How to reform a terrain into a pyramid Takeshi Tokuyama (Tohoku U) Joint work with Jinhee Chun (Tohoku U) Naoki Katoh (Kyoto U) Danny Chen (U. Notre Dame)
Bounding Variance and Expectation of Longest Path Lengths in DAGs Jeff Edmonds, York University Supratik Chakraborty, IIT Bombay.
Solution to HW1. Problem 1 Need to find shortest path from a single source s to a single destination d. Have a condition in the Dijkstra algo loop which.
CSE 331: Review. Main Steps in Algorithm Design Problem Statement Algorithm Real world problem Problem Definition Precise mathematical def “Implementation”
INTRODUCTION. What is an algorithm? What is a Problem?
Lectures on Greedy Algorithms and Dynamic Programming
Runtime O(VE), for +/- edges, Detects existence of neg. loops
CSEP 521 Applied Algorithms Richard Anderson Winter 2013 Lecture 3.
CS6045: Advanced Algorithms Sorting Algorithms. Heap Data Structure A heap (nearly complete binary tree) can be stored as an array A –Root of tree is.
CSE 421 Algorithms Richard Anderson Lecture 8 Optimal Caching Dijkstra’s algorithm.
Dijkstra animation. Dijksta’s Algorithm (Shortest Path Between 2 Nodes) 2 Phases:initialization;iteration Initialization: 1. Included:(Boolean) 2. Distance:(Weight)
Rely: Verifying Quantitative Reliability for Programs that Execute on Unreliable Hardware Michael Carbin, Sasa Misailovic, and Martin Rinard MIT CSAIL.
Proof of correctness of Dijkstra’s algorithm: Basically, we need to prove two claims. (1)Let S be the set of vertices for which the shortest path from.
Certifying Algorithms [MNS11]R.M. McConnell, K. Mehlhorn, S. Näher, P. Schweitzer. Certifying algorithms. Computer Science Review, 5(2), , 2011.
Growth of Functions & Algorithms
Shortest Paths and Minimum Spanning Trees
Graph Algorithms BFS, DFS, Dijkstra’s.
COMP 6/4030 ALGORITHMS Prim’s Theorem 10/26/2000.
Greedy Algorithms / Minimum Spanning Tree Yin Tat Lee
Topological Sort (topological order)
Elementary graph algorithms Chapter 22
Lecture 26 CSE 331 Nov 1, 2017.
Basic Graph Algorithms
Richard Anderson Lecture 9 Dijkstra’s algorithm
Autumn 2015 Lecture 10 Minimum Spanning Trees
Minimum Spanning Tree Algorithms
Slide Courtesy: Uwash, UT
Lecture 28 CSE 331 Nov 7, 2012.
Lecture 27 CSE 331 Nov 2, 2010.
Autumn 2016 Lecture 10 Minimum Spanning Trees
Slide Courtesy: Uwash, UT
Winter 2019 Lecture 9 Dijkstra’s algorithm
Elementary graph algorithms Chapter 22
Winter 2019 Lecture 10 Minimum Spanning Trees
Algorithms.
More Graphs Lecture 19 CS2110 – Fall 2009.
Presentation transcript:

Proving Programs Robust Swarat Chaudhuri 1,3 Sumit Gulwani 2 Roberto Lublinerman 1 Sara Navidpour 1 1 Pennsylvania State University 2 Microsoft Research 3 Rice University

Uncertainty Uncertainty: stale satellite data, erroneous sensor measurements, … Does your program handle uncertainty robustly? FSE’11: Szeged, Hungary. 2 Proving programs robust

Robustness FSE’11: Szeged, Hungary. 3 Proving programs robust  Correctness in settings without uncertainty does not imply correctness in uncertain environments.

Before we “measure” robustness Proving programs robust FSE’11: Szeged, Hungary

How would we “measure” robustness? No “jumps” due to loops and branches Analytical continuity P Chaudhuri, Gulwani, Lublinerman. Continuity Analysis of Programs. POPL f(x) = e x

Quantitative robustness properties k-robustness: Change in output is bounded by K times the change in inputs. P FSE’11: Szeged, Hungary. 6 Proving programs robust

Distance on arrays Proving programs robust FSE’11: Szeged, Hungary = = 3 max

Distance on graphs Proving programs robust FSE’11: Szeged, Hungary = 2max - =

 Robustness of shortest path Proving programs robust FSE’11: Szeged, Hungary. 9 You are here

 Robustness of shortest path Proving programs robust FSE’11: Szeged, Hungary You are here        

 Robustness of shortest path Proving programs robust FSE’11: Szeged, Hungary You are here   1  2   

 Robustness of shortest path Proving programs robust FSE’11: Szeged, Hungary You are here    

 Robustness of shortest path Proving programs robust FSE’11: Szeged, Hungary You are here   

 Robustness of shortest path Proving programs robust FSE’11: Szeged, Hungary You are here  

 Robustness of shortest path Proving programs robust FSE’11: Szeged, Hungary You are here 

 Robustness of shortest path Proving programs robust FSE’11: Szeged, Hungary You are here

 Robustness of shortest path Proving programs robust FSE’11: Szeged, Hungary You are here

 Robustness of shortest path Proving programs robust FSE’11: Szeged, Hungary You are here

k-robustness and classical problems ProblemInputOutputk-robustness Max of an array elements in the array maximum element of the array 1-robust Minimum spanning tree graphcostN-robust Sorting elements in the array sorted array1-robust FSE’11: Szeged, Hungary. 19 Proving programs robust

Robustness matrices R[y,x] = k  -variation in initial value of x produces at most a k  -variation in final value of y Proving programs robust FSE’11: Szeged, Hungary. 20

How do we prove k-robustness FSE’11: Szeged, Hungary. 21 Proving programs robust

How do we prove k-robustness FSE’11: Szeged, Hungary. 22 Proving programs robust

Proving k-robustness if B FT P1P1 P1P1 P2P2 P2P2 P 1. P 1 has robustness matrix R 1 2.P 2 has robustness matrix R 2 3.P is continuous *1 P has robustness matrix max(R 1, R 2 ) FSE’11: Szeged, Hungary. 23 Proving programs robust *1 Chaudhuri, Gulwani, Lublinerman. Continuity Analysis of Programs. POPL 2010.

Proving k-robustness P1P1 P1P1 P2P2 P2P2 P 1. P 1 has robustness matrix R 1 2.P 2 has robustness matrix R 2 P has robustness matrix R 2 R 1 FSE’11: Szeged, Hungary. 24 Proving programs robust Analogous to the “chain rule”

Proving piecewise k-robustness while B Q Q P 1. Q has robustness matrix R 2.N is the bound on loop iterations 3.P is continuous * 1 P has robustness matrix R N FSE’11: Szeged, Hungary. 25 Proving programs robust *1 Chaudhuri, Gulwani, Lublinerman. Continuity Analysis of Programs. POPL 2010.

Example: Dijsktra’s shortest path algorithm FSE’11: Szeged, Hungary. 26 Proving programs robust procedure Dijkstra(G: graph, src: node): for each node v in G: d[v] =  d[src] = 0; W := edges of G while W is not empty remove G[w,v] from W s.t. d[w] is minimal z = d[w] + G[w,v] if z < d[v] d[v] = z; prev[v] = w

Example: Dijsktra’s shortest path algorithm FSE’11: Szeged, Hungary. 27 Proving programs robust procedure Dijkstra(G: graph, src: node): for each node v in G: d[v] =  d[src] = 0; W := edges of G while W is not empty remove G[w,v] from W s.t. d[w] is minimal z = d[w] + G[w,v] if z < d[v] d[v] = z; prev[v] = w d[0] =  d[src] = 0

Example: Dijsktra’s shortest path algorithm FSE’11: Szeged, Hungary. 28 Proving programs robust procedure Dijkstra(G: graph, src: node): for each node v in G: d[v] =  d[src] = 0; W := edges of G while W is not empty remove G[w,v] from W s.t. d[w] is minimal z = d[w] + G[w,v] if z < d[v] d[v] = z; prev[v] = w if d[v] > d[w] + G[w,v] TF d[v]=d[w] + G[w,v]

Example: Dijsktra’s shortest path algorithm FSE’11: Szeged, Hungary. 29 Proving programs robust procedure Dijkstra(G: graph, src: node): for each node v in G: d[v] =  d[src] = 0; W := edges of G while W is not empty remove G[w,v] from W s.t. d[w] is minimal z = d[w] + G[w,v] if z < d[v] d[v] = z; prev[v] = w while W not empty Q Q d is N-robust in G

Applications: Robustness Proofs for Embedded Systems FSE’11: Szeged, Hungary. 30 Proving programs robust

for i:= …. Approximate Computation: Trade accuracy for reduced cost FSE’11: Szeged, Hungary. 31 Proving programs robust P’

Approximate loop rewriting: Our static analysis can guide this sort of approximation Accuracy vs. Performance trade-off of loop perforation [Sidiroglou, Misailovic, Hoffman, Rinard FSE11] Applications: Approximate Computation FSE’11: Szeged, Hungary. 32 Proving programs robust for i := 1 to n by 1 z = f(x[i]) sum = sum + z 2

Differential privacy [Dwork] FSE’11: Szeged, Hungary. 33 Proving programs robust Applications: Privacy in Statistical Databases

Results Implemented the analysis in a tool. – use Z3 to discharge continuity judgments. Proved robustness for many classical algorithms Proving programs robust FSE’11: Szeged, Hungary. 34 Bubble sortDijkstraKnapsack Insertion sortBellman-fordSmall controller Selection sortKruskall Merge sortPrim

Related Work Work on interval polyhedra [Chen et al 2009] [Chen et al 2010] Continuity analysis of programs [Chaudhuri et al 2010] Testing for robustness [Majmudar et al 2010] Calculus for differential privacy [Reed and Pierce 2010] Proving programs robust FSE’11: Szeged, Hungary. 35

Conclusion Robustness is an important correctness property for programs operating under uncertainty. We provide a automated program analysis for robustness. k-robustness can be proved mechanically for many interesting programs. Applications in different domains. FSE’11: Szeged, Hungary. 36 Proving programs robust

Sorting 1-robust? Proving programs robust FSE’11: Szeged, Hungary