R O O T S Field-Sensitive Points-to-Analysis Eda GÜNGÖR

Slides:



Advertisements
Similar presentations
BellRigner – 1/30/2012 Match the graph to the function: f(x) = x 3 – 2x + 2 g(x) = -2x h(x) = x 4 – 2 i(x) = -x 3 – 1 A B C D.
Advertisements

You have been given a mission and a code. Use the code to complete the mission and you will save the world from obliteration…
Algebra Problem Solving with the new Common Core Standards
Path-Sensitive Analysis for Linear Arithmetic and Uninterpreted Functions SAS 2004 Sumit Gulwani George Necula EECS Department University of California,
Simplifications of Context-Free Grammars
Constraint Satisfaction Problems
Analysis of Computer Algorithms
1 Copyright © 2010, Elsevier Inc. All rights Reserved Fig 2.1 Chapter 2.
Analysis of Algorithms
Business Transaction Management Software for Application Coordination 1 Business Processes and Coordination.
and 6.855J Cycle Canceling Algorithm. 2 A minimum cost flow problem , $4 20, $1 20, $2 25, $2 25, $5 20, $6 30, $
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Title Subtitle.
DIVIDING INTEGERS 1. IF THE SIGNS ARE THE SAME THE ANSWER IS POSITIVE 2. IF THE SIGNS ARE DIFFERENT THE ANSWER IS NEGATIVE.
Year 6 mental test 5 second questions
BALANCING 2 AIM: To solve equations with variables on both sides.
SQL: The Query Language Part 2
Programming Language Concepts
Reductions Complexity ©D.Moshkovitz.
Lecture 10: Context-Free Languages Contextually David Evans
Evaluating Window Joins over Unbounded Streams Author: Jaewoo Kang, Jeffrey F. Naughton, Stratis D. Viglas University of Wisconsin-Madison CS Dept. Presenter:
Solve Multi-step Equations
Solve Both Sides Day 1 Teacher Notes
Notes 15 ECE Microwave Engineering
Randomized Algorithms Randomized Algorithms CS648 1.
ITEC200 Week04 Lists and the Collection Interface.
ABC Technology Project
Shadow Prices vs. Vickrey Prices in Multipath Routing Parthasarathy Ramanujam, Zongpeng Li and Lisa Higham University of Calgary Presented by Ajay Gopinathan.
Summary Subsets of Real Numbers
1 Breadth First Search s s Undiscovered Discovered Finished Queue: s Top of queue 2 1 Shortest path from s.
Differential Forms for Target Tracking and Aggregate Queries in Distributed Networks Rik Sarkar Jie Gao Stony Brook University 1.
Squares and Square Root WALK. Solve each problem REVIEW:
Routing and Congestion Problems in General Networks Presented by Jun Zou CAS 744.
Abdullah Aldahami ( ) Jan 29,  This paper propose a new resynthesis algorithm for FPGA area reduction.  The existing resynthesis techniques.
Lecture plan Outline of DB design process Entity-relationship model
1 Chapter 4 The while loop and boolean operators Samuel Marateck ©2010.
Chapter 5 Test Review Sections 5-1 through 5-4.
GG Consulting, LLC I-SUITE. Source: TEA SHARS Frequently asked questions 2.
Addition 1’s to 20.
25 seconds left…...
Copyright © Cengage Learning. All rights reserved.
Copyright © Cengage Learning. All rights reserved.
Complexity ©D.Moshkovits 1 Where Can We Draw The Line? On the Hardness of Satisfiability Problems.
Week 1.
We will resume in: 25 Minutes.
Depth-First and Breadth-First Search CS 5010 Program Design Paradigms “Bootcamp” Lesson 9.2 TexPoint fonts used in EMF. Read the TexPoint manual before.
Foundations of Data Structures Practical Session #7 AVL Trees 2.
Introduction to Recursion and Recursive Algorithms
1 Functions and Applications
Techniques for proving programs with pointers A. Tikhomirov.
1 Decidability continued…. 2 Theorem: For a recursively enumerable language it is undecidable to determine whether is finite Proof: We will reduce the.
Epp, section 10.? CS 202 Aaron Bloomfield
The Pumping Lemma for CFL’s
Overview Structural Testing Introduction – General Concepts
R O O T S Interprocedural Analysis Aleksandra Biresev
Context-Sensitive Interprocedural Points-to Analysis in the Presence of Function Pointers Presentation by Patrick Kaleem Justin.
Pointer Analysis – Part I Mayur Naik Intel Research, Berkeley CS294 Lecture March 17, 2009.
Type-Based Flow Analysis: From Polymorphic Subtyping to CFL-Reachability Jakob Rehof and Manuel Fähndrich Microsoft Research.
Demand-driven Alias Analysis Implementation Based on Open64 Xiaomi An
Refinement-Based Context-Sensitive Points-To Analysis for JAVA Soonho Kong 17 January Work of Manu Sridharan and Rastislav Bodik, UC Berkeley.
Scaling CFL-Reachability-Based Points- To Analysis Using Context-Sensitive Must-Not-Alias Analysis Guoqing Xu, Atanas Rountev, Manu Sridharan Ohio State.
1 Refinement-Based Context-Sensitive Points-To Analysis for Java Manu Sridharan, Rastislav Bodík UC Berkeley PLDI 2006.
Java Alias Analysis for Online Environments Manu Sridharan 2004 OSQ Retreat Joint work with Rastislav Bodik, Denis Gopan, Jong-Deok Choi.
PRESTO: Program Analyses and Software Tools Research Group, Ohio State University Merging Equivalent Contexts for Scalable Heap-cloning-based Points-to.
Pointer Analysis Survey. Rupesh Nasre. Aug 24, 2007.
1PLDI 2000 Off-line Variable Substitution for Scaling Points-to Analysis Atanas (Nasko) Rountev PROLANGS Group Rutgers University Satish Chandra Bell Labs.
Harry Xu University of California, Irvine & Microsoft Research
Demand-Driven Context-Sensitive Alias Analysis for Java
Context Sensitive Points-to Analysis
Presentation transcript:

R O O T S Field-Sensitive Points-to-Analysis Eda GÜNGÖR

Enterprise Software Engineering 2010/11Field-Sensitive Points-to-Analysis 2 R O O T S Outline CFL-reachability Aim of the PointsTo Analysis Field-sensitive Versus Field-based Context-Insensitive Formulation Graph representation Analysis Grammar Context-Insensitive Points-To Analysis Refinement algorithm Regular Approximation Refinement with Regular Reachability Evaluation

Enterprise Software Engineering 2010/11Field-Sensitive Points-to-Analysis 3 R O O T S What is CFL-reachability? Context-free language reachability An extension of traditional graph reachability Interesting paths in G are described by the language L The CFL-reachability problem requires determining for all node pairs, if there is an L-path between these nodes

Enterprise Software Engineering 2010/11Field-Sensitive Points-to-Analysis 4 R O O T S CFL-reachability with an Input Graph Each path p has a string s(p), constructed by edge labels s(p) = (()) p is an L-path iff s(p) Є L There is an L-path from s to t There is not any L-path from u to t t is L-reachable from s (simply, s L t) t is not L-reachable from u

Enterprise Software Engineering 2010/11Field-Sensitive Points-to-Analysis 5 R O O T S The Aim of the PointsTo Analysis Computing the best possible (most precise) flow-insensitive points-to information Flow-insensitive: treats each method as if its control-flow graph contains all possible edges Requires a subset-based, field-sensitive manner Input program with No arrays No recursive method calls

Enterprise Software Engineering 2010/11Field-Sensitive Points-to-Analysis 6 R O O T S Field-sensitive versus Field-based x = new Obj(); // o1 y = new Obj(); // o2 x.f = new Obj(); // o3 y.f = new Obj(); // o4 z = x.f; // pt(z)=? pt(z): points-to set of variable z Field-sensitive analysis: Reasons separately about the instance fields of each abstract object. Since, x and y cannot be aliased, the result is pt(z) = {o3} Field-based analysis: Treats each instance field as a global variable, yielding pt(z) = {o3, o4}

Field-Sensitive Points-to-Analysis R O O T S Context-Insensitive Formulation Graph Representation Analysis Grammar

Enterprise Software Engineering 2010/11Field-Sensitive Points-to-Analysis 8 R O O T S Graph Representation Value flow of the statement from right-hand side to left-hand side The field name f is part of the edge label

Enterprise Software Engineering 2010/11Field-Sensitive Points-to-Analysis 9 R O O T S A Code Example and Its Graph Representation 1 x = new Obj(); //o 1 2 z = new Obj(); //o 2 3 w = x; 4 y = x; 5 y.f = z; 6 v = w.f; o1o1 y new (1) z w x v o2o2 getfield[f] (6) assign (4) putfield[f] (5) assign (3) new (2)

Enterprise Software Engineering 2010/11Field-Sensitive Points-to-Analysis 10 R O O T S Grammar of the Analysis The language L F is defined by the grammar flowsTo new (assign)* x is L F -reachable from o iff o Є pt(x) To track value flow through the heap via putfield[f] and getfield[f] statements, L F is extended Extended flowsTo grammar flowsTo new (assign | putfield[f] alias getfield[f])* o1o1 new x flowsTo w assign o 1 Є pt(w)

Enterprise Software Engineering 2010/11Field-Sensitive Points-to-Analysis 11 R O O T S May-aliasing Aliasing by the means of flowsTo-paths: x and y are may-aliased iff o flowsTo x o flowsTo y o Є pt(x) pt(y) for an object o Problem: May-aliasing is unsuitable for CFL-reachability since it can only check language membership of a single path Solution: Extending the graph representation to allow for inverse paths o1o1 y new (1) w x assign (4) assign (3) alias flowsTo

Enterprise Software Engineering 2010/11Field-Sensitive Points-to-Analysis 12 R O O T S Enable alias paths by introducing reversed flowsTo paths (flowsTo) Connect two may-aliased variables and allow for a single path The grammar: An (x alias y)-path can be defined as a path x flowsTo n flowsTo y (for some node n) Inverse Paths

Enterprise Software Engineering 2010/11Field-Sensitive Points-to-Analysis 13 R O O T S A Context-free Grammar for L F

Enterprise Software Engineering 2010/11Field-Sensitive Points-to-Analysis 14 R O O T S A Context-free Grammar for L F Each flowsTo inverts the edges of flowsTo production The ciAssign and ciAssign non-terminals treat edges Determining a points-to set for a variable x requires solving a backwards L F -reachability problem from x pointsTo flowsTo production makes this backwards-reachability correspondence explicit: o Є pt(x) iff x pointsTo o (x flowsTo o)

Enterprise Software Engineering 2010/11Field-Sensitive Points-to-Analysis 15 R O O T S Example: flowsTo-path from o 2 to v y assign x new o 1 new x assign w y ciAssign x flowsTo o 1 flowsTo x ciAssign w y flowsTo o 1 flowsTo w y alias w o 2 new z putfield[f] y alias w getfield[f] v o 2 flowsTo z putfield[f] y alias w getfield[f] v o 2 flowsTo v o1o1 y new (1) z w x vo2o2 getfield[f] (6) assign (4) putfield[f] (5) assign (3) new (2) alias

Field-Sensitive Points-to-Analysis R O O T S Context-Insensitive Points-To Analysis Refinement Algorithm Regular Approximation Refinement with Regular Reachability Evaluation

Enterprise Software Engineering 2010/11Field-Sensitive Points-to-Analysis 17 R O O T S Refinement-based Algorithm Solves the Lsf-reachability, simplified Lf-reachability, problem Quickly proves that a node is not Lsf-reachable from another node Focuses on unbalanced parentheses in the graph and skipping over the rest of it Improves performance through approximation and refinement Approximate analysis: must answer correctly when p is an Lsf-path, but can answer incorrectly when it is not Refinement: gradually removes the imprecision of this analysis, eventually yielding the correct answer when p is not an Lsf-path. To maintain correctness, the algorithm only skips sub-paths beginning and ending with matched parentheses

Enterprise Software Engineering 2010/11Field-Sensitive Points-to-Analysis 18 R O O T S Regular Approximation Computes only the initial approximation of the refinement algorithm i.e., reachability over a graph with all possible match edges Approximation requires regular reachability over a regular language R F Asymptotically less expensive than CFL-reachability Has a simple and efficient demand-driven algorithm RegularPT to find points-to information based on RF-reachability A demand-driven: determining which nodes are L-reachable from some specific source node

Enterprise Software Engineering 2010/11Field-Sensitive Points-to-Analysis 19 R O O T S Regular Reachability A regular approximation of L F -reachability via match edges flowsTo path for L F flowsTo new (assign | putfield[f] alias getfield[f])* LF-reachability is checking putfield[f] and getfield[f] edges (the balanced parentheses of LF) for the field-sensitivity conditions The most expensive part of field-sensitivity Checking for an alias-path between the base variables of putfield[f] and getfield[f] edges Match edges: are used instead of putfield[f] alias getfield[f] path R F is defined by the grammar flowsTo new (assign | match)*

Enterprise Software Engineering 2010/11Field-Sensitive Points-to-Analysis 20 R O O T S A Graph with All Possible Match Edges Match edges: from the source of putfield[f] edge to the target of getfield[f] edge v is R F -reachable from o 2 but not L F -reachable, Since, there is no alias-path from q to p Match edges are added without checking the base variables are connected by an alias-path or not Results: R F -reachability over-approximates L F -reachability Precision is lost in cases where an R F -path includes an invalid match edge

Enterprise Software Engineering 2010/11Field-Sensitive Points-to-Analysis 21 R O O T S Refinement with Regular Reachability Lost of precision can be recovered by Refinement technique Has an algorithm RefinedRegularPT, an extension of the RegularPT Removes match edges by checking the existence of an alias-path between the base variables of the corresponding putfield[f] and getfield[f] edges Instead of searching for alias-paths, refines a match edge by looking for aliasReg-paths, defined as

Enterprise Software Engineering 2010/11Field-Sensitive Points-to-Analysis 22 R O O T S Example: Removing invalid match edges Refinement by removing invalid match edges 1. Search for an aliasReg-path from q to p 2. No such path exists 3. Match edge w v can be safely removed from the graph 4. This removal eliminates the aliasReg-path from w to v 5. Match edge z y can also be safely removed

Enterprise Software Engineering 2010/11Field-Sensitive Points-to-Analysis 23 R O O T S Evaluation: Benchmark Results Percentage results of measuring the precision of the algorithms Intra: An intraprocedural field-based analysis Reg: RegularPT Refreg: RefinedRegularPT with a 5 second time limit per query

Enterprise Software Engineering 2010/11Field-Sensitive Points-to-Analysis 24 R O O T S Conclusions The algorithms are precise RegularPT and RefinedRegularPT have nearly precision of field-sensitive Andersens. RefinedRegularPT provides more precision than RegularPT Precision is retained under early termination RegularPT and RefinedRegularPT retain almost all their precision when they run with small time budgets Good performance

Enterprise Software Engineering 2010/11Field-Sensitive Points-to-Analysis 25 R O O T S Refinement-Based Program Analysis Tools, by Sridharan, 2007, University of California, Berkeley Refinement-Based Context-Sensitive Points-To Analysis for Java, by Sridharan and Bodík, 2006, University of California, Berkeley References

Enterprise Software Engineering 2010/11Field-Sensitive Points-to-Analysis 26 R O O T S Thank you for your attention!