Shape Analysis Overview presented by Greta Yorsh.

Slides:



Advertisements
Similar presentations
Partially Disjunctive Shape Analysis Josh Berdine Byron Cook MSR Cambridge Tal Lev-Ami Roman Manevich Mooly Sagiv Ran Shaham Tel Aviv University Ganesan.
Advertisements

Shape Analysis for Fine-Grained Concurrency using Thread Quantification Josh Berdine Microsoft Research Joint work with: Tal Lev-Ami, Roman Manevich, Mooly.
Guy Golan-GuetaTel-Aviv University Nathan Bronson Stanford University Alex Aiken Stanford University G. Ramalingam Microsoft Research Mooly Sagiv Tel-Aviv.
Abstract Interpretation Part II
Predicate Abstraction and Canonical Abstraction for Singly - linked Lists Roman Manevich Mooly Sagiv Tel Aviv University Eran Yahav G. Ramalingam IBM T.J.
Shape Analysis by Graph Decomposition R. Manevich M. Sagiv Tel Aviv University G. Ramalingam MSR India J. Berdine B. Cook MSR Cambridge.
Interprocedural Shape Analysis for Recursive Programs Noam Rinetzky Mooly Sagiv.
Pointer Analysis – Part I Mayur Naik Intel Research, Berkeley CS294 Lecture March 17, 2009.
Heap Decomposition for Concurrent Shape Analysis R. Manevich T. Lev-Ami M. Sagiv Tel Aviv University G. Ramalingam MSR India J. Berdine MSR Cambridge Dagstuhl.
Abstract Transformers for Thread Correlation Analysis Michal Segalov, TAU Tal Lev-Ami, TAU Roman Manevich, TAU G. Ramalingam, MSR India Mooly Sagiv, TAU.
1 A Logic of Reachable Patterns in Linked Data-Structures Greta Yorsh joint work with Alexander Rabinovich, Mooly Sagiv Tel Aviv University Antoine Meyer,
Relational Inductive Shape Analysis Bor-Yuh Evan Chang University of California, Berkeley Xavier Rival INRIA POPL 2008.
Reduction in End-User Shape Analysis Dagstuhl - Typing, Analysis, and Verification of Heap-Manipulating Programs – July 24, 2009 Xavier Rival INRIA and.
1 E. Yahav School of Computer Science Tel-Aviv University Verifying Safety Properties using Separation and Heterogeneous Abstractions G. Ramalingam IBM.
1 Lecture 07 – Shape Analysis Eran Yahav. Previously  LFP computation and join-over-all-paths  Inter-procedural analysis  call-string approach  functional.
1 Lecture 08(a) – Shape Analysis – continued Lecture 08(b) – Typestate Verification Lecture 08(c) – Predicate Abstraction Eran Yahav.
Compile-Time Verification of Properties of Heap Intensive Programs Mooly Sagiv Thomas Reps Reinhard Wilhelm
Static Program Analysis via Three-Valued Logic Thomas Reps University of Wisconsin Joint work with M. Sagiv (Tel Aviv) and R. Wilhelm (U. Saarlandes)
Local Heap Shape Analysis Noam Rinetzky Tel Aviv University Joint work with Jörg Bauer Universität des Saarlandes Thomas Reps University of Wisconsin Mooly.
Shape Analysis via 3-Valued Logic Mooly Sagiv Tel Aviv University
Specialized Reference Counting Garbage Collection using Data Structure Annotations By Eric Watkins and Dzin Avots for CS 343 Spring 2002.
Counterexample-Guided Focus TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AAA A A A AA A A Thomas Wies Institute of.
Establishing Local Temporal Heap Safety Properties with Applications to Compile-Time Memory Management Ran Shaham Eran Yahav Elliot Kolodner Mooly Sagiv.
Purity Analysis : Abstract Interpretation Formulation Ravichandhran Madhavan, G. Ramalingam, Kapil Vaswani Microsoft Research, India.
Finite Differencing of Logical Formulas for Static Analysis Thomas Reps University of Wisconsin Joint work with M. Sagiv and A. Loginov.
1 Verifying Temporal Heap Properties Specified via Evolution Logic Eran Yahav, Tom Reps, Mooly Sagiv and Reinhard Wilhelm
Model Checking of Concurrent Software: Current Projects Thomas Reps University of Wisconsin.
Modular Shape Analysis for Dynamically Encapsulated Programs Noam Rinetzky Tel Aviv University Arnd Poetzsch-HeffterUniversität Kaiserlauten Ganesan RamalingamMicrosoft.
Modular Shape Analysis for Dynamically Encapsulated Programs Noam Rinetzky Tel Aviv University Arnd Poetzsch-HeffterUniversität Kaiserlauten Ganesan RamalingamMicrosoft.
Comparison Under Abstraction for Verifying Linearizability Daphna Amit Noam Rinetzky Mooly Sagiv Tom RepsEran Yahav Tel Aviv UniversityUniversity of Wisconsin.
A Semantics for Procedure Local Heaps and its Abstractions Noam Rinetzky Tel Aviv University Jörg Bauer Universität des Saarlandes Thomas Reps University.
Static Program Analysis via Three-Valued Logic Thomas Reps University of Wisconsin Joint work with M. Sagiv (Tel Aviv) and R. Wilhelm (U. Saarlandes)
Dagstuhl Seminar "Applied Deductive Verification" November Symbolically Computing Most-Precise Abstract Operations for Shape.
Program Analysis and Verification Noam Rinetzky Lecture 10: Shape Analysis 1 Slides credit: Roman Manevich, Mooly Sagiv, Eran Yahav.
Thread Quantification for Concurrent Shape Analysis Josh BerdineMSR Cambridge Tal Lev-AmiTel Aviv University Roman ManevichTel Aviv University Mooly Sagiv.
T. Lev-Ami, R. Manevich, M. Sagiv TVLA: A System for Generating Abstract Interpreters A. Loginov, G. Ramalingam, E. Yahav.
TVLA: A system for inferring Quantified Invariants Tal Lev-Ami Tom Reps Mooly Sagiv Reinhard Wilhelm Greta Yorsh.
1 Employing decision procedures for automatic analysis and verification of heap-manipulating programs Greta Yorsh under the supervision of Mooly Sagiv.
1 Testing, Abstraction, Theorem Proving: Better Together! Greta Yorsh joint work with Thomas Ball and Mooly Sagiv.
Shape Analysis via 3-Valued Logic Mooly Sagiv Thomas Reps Reinhard Wilhelm
Symbolically Computing Most-Precise Abstract Operations for Shape Analysis Greta Yorsh Thomas Reps Mooly Sagiv Tel Aviv University University of Wisconsin.
Model construction and verification for dynamic programming languages Radu Iosif
Symbolic Execution with Abstract Subsumption Checking Saswat Anand College of Computing, Georgia Institute of Technology Corina Păsăreanu QSS, NASA Ames.
1 Shape Analysis via 3-Valued Logic Mooly Sagiv Tel Aviv University Shape analysis with applications Chapter 4.6
Pointer Analysis Survey. Rupesh Nasre. Aug 24, 2007.
Model Checking Linearizability via Refinement 1 ICFEM 2008 Model Checking Linearizability via Refinement Yang LIU, Wei CHEN, Yanhong A. LIU, and Jun SUN.
Beyond Reachability: Shape Abstraction in the presence of Pointer Arithmetic Hongseok Yang (Queen Mary, University of London) (Joint work with Dino Distefano,
Schedule 27/12 Shape Analysis 3/1 Static Analysis in Soot 10/1 Static Analysis in LLVM 17/1 Advanced Topics: Concurrent programs and TAU research topics.
Data Structures and Algorithms for Efficient Shape Analysis by Roman Manevich Prepared under the supervision of Dr. Shmuel (Mooly) Sagiv.
Quantified Data Automata on Skinny Trees: an Abstract Domain for Lists Pranav Garg 1, P. Madhusudan 1 and Gennaro Parlato 2 1 University of Illinois at.
Program Analysis via 3-Valued Logic Thomas Reps University of Wisconsin Joint work with Mooly Sagiv and Reinhard Wilhelm.
1 Simulating Reachability using First-Order Logic with Applications to Verification of Linked Data Structures Tal Lev-Ami 1, Neil Immerman 2, Tom Reps.
Interprocedural shape analysis for cutpoint-free programs Noam Rinetzky Tel Aviv University Joint work with Mooly Sagiv Tel Aviv University Eran Yahav.
Static Analysis of Concurrent Programs Mooly Sagiv.
Putting Static Analysis to Work for Verification A Case Study Tal Lev-Ami Thomas Reps Mooly Sagiv Reinhard Wilhelm.
Partially Disjunctive Shape Analysis Roman Manevich Mooly Sagiv Ganesan Ramalingam advisor: consultant:
Interprocedural shape analysis for cutpoint-free programs
Shape Analysis Termination Analysis Linear Time
Partially Disjunctive Heap Abstraction
Compactly Representing First-Order Structures for Static Analysis
Spring 2016 Program Analysis and Verification
Program Analysis and Verification
Compile-Time Verification of Properties of Heap Intensive Programs
Symbolic Implementation of the Best Transformer
Parametric Shape Analysis via 3-Valued Logic
Parametric Shape Analysis via 3-Valued Logic
Reduction in End-User Shape Analysis
Program Analysis and Verification
Symbolic Characterization of Heap Abstractions
A Semantics for Procedure Local Heaps and its Abstractions
Presentation transcript:

Shape Analysis Overview presented by Greta Yorsh

Shape Analysis [Jones and Muchnick 1981] Program analysis to determine all possible shapes of the heap at every program point Applications – Compiler optimizations – Automatic verification

Programs and Properties Dynamically allocated memory (heap) Destructive updates Recursive data structures Recursive procedures Concurrency Memory safety Preservation of data structure invariants Partial correctness Linearizability Termination

Mark and Sweep void Mark(Node root) { if (root != null) { pending =  pending = pending  {root} marked =  while (pending   ) { x = SelectAndRemove(pending) marked = marked  {x} t = x.left if (t  NULL) and (t  marked) pending = pending  {t} t = x.right if (t  NULL) and (t  marked) pending = pending  {t} } assert marked = = Reachset(root) } void Sweep() { unexplored = Universe collected =  while (unexplored   ) { x = SelectAndRemove(unexplored) if (x  marked) collected = collected  {x} }  v: marked(v)  successor*(root,v) assert collected == all – Reachset(root)  r. root(r)  (p(r)  m(r))  v. (m(v)  p(v))  successor*(root,v)  v.  (p(v)  m(v))  v, w. (m(v)   m(w)   p(w)   successor(v, w))

5 Tel Aviv University (Sagiv) Tel Aviv University (Sagiv) University of Wisconsin (Reps) University of Wisconsin (Reps) Universität des Saarlandes (Wilhelm) Universität des Saarlandes (Wilhelm) MSRC Queen Mary IBM Berkeley Inria MSRI MSR... and others... Parametric Shape Analysis via 3-valued Logic LIAFA

Timeline: Shape Analysis Parametric Shape Analysis via 3-valued Logic [Sagiv, Reps, Wilhelm POPL’99,TOPLAS’02] Verifying Concurrent Heap Manipulating Programs [Yahav et al, POPL’01] Interprocedural and Recursive Programs [Rinetzky et al, CC‘01] Numerical Abstractions [Gopan et al, TACAS’04] Logical Characterization of Heap Abstractions 2008 Verifying Linearizability with Heap Decomposition [Manevich, Lev Ami et al, SAS’08, CAV’08] Flow analysis and optimization of Lisp-like structures [Jones and Muchnick 1981] 1981 Analysis of pointers and structures 1990 A Local Shape Analysis Based on Separation Logic [Distefano et al, TACAS’06] Verifying Linearizability [Amit et al, CAV’07] Thread Modular Shape Analysis [Gotsman et al, PLDI 07] Procedure Local Heaps and cutpoints [Rinetzky et al, POPL’05] TVLA [Lev Ami et al, SAS‘00] 2009

Applications Memory safety & preservation of data structure invariants [Dor SAS’00, Loginov ISSTA’08] Compile-time garbage collection [Shaham et al, SAS’03] Correct API usage [Ramalingam at al PLDI’02, Yahav et al PLDI’04] Typestate verification [Yahav et al, ISSTA’06] Sorting implementations [Lev-Ami ISTTA’00, Rinetzky SAS’05] Deutsch-Shorr-Waite [Loginov et al, SAS’06] Linearizability [Amit et al, CAV’07, Manevich at al, SAS’08,CAV’08] Device drivers [ Yang et al, CAV’08]

Outline Shape abstractions in a nutshell Computing transformers Challenges in shape analysis

Concrete Stores as Logical Structures x 64 p stack heap x n n n n p n

Concrete Stores as Logical Structures Locations  Individuals Program variables  Unary relations Fields  Binary relations Instrumentation predicates defined in FOTC  v. r p (v)   w. p(w)  n*(w,v) x n n n n p n rprp rprp rprp

Canonical Abstraction x n n n n p n rprp rprp rprp

n n n x n n n n p n x p n n n n n n n rprp rprp rprp rprp rprp Abstract stores are 3-valued logical structures {0, 1, ½} values for relations with 0  1 = 1/2

Canonical Abstraction with Reachability x n n n n p n rprp rprp rprp n n n p x n rprp rprp

Canonical Abstraction without Reachability n n x n n n n p n x p n n n n n n p x

... Logical Characterization in FOTC [Yorsh’03] [Kuncak’04] [Wies’07 ]  v: ( x(v)   p(v)  r p (v))  (  x(v)   p(x)  r p (v))  (  x(v)  p(v)  r p (v))  (  x(v)   p(v)  r p (v))) n n n p x n r x,r p,  shared r x,r p rxrx rxrx  v, w.  x(v)   p(v)  r p (v)  x(w)  p(w)  r p (w)   n(v, w)  v. shared (v)   v 1,v 2. n(v 1,v)  n(v 2,v)  v 1 =v 2  v. r p (v)   w. p(w)  n*(w, v)

Logical Characterization in Separation Logic  v, w. x  v   lseg(v,p)  p  w  lseg(w,null) n n n p x n r x,r p,  shared lseg(x,y) =  v. x  v   (y = v  emp  lseg(v,y) ) r x,r p rxrx rxrx

Canonical Abstraction Limited form of quantified invariants – quantifier alternation only in instrumentation Not a static memory partition – The same memory location can be represented by different abstract nodes in different shape graphs

x y Non-Static Partition y x y x y x x = x  n

Outline Shape Abstractions in the nutshell Computing abstract transformers Challenges in shape analysis

y x y x y x y x x y y x x y Best Transformer concretization concrete semantics canonical abstraction x = x  n

y x y x y x y x x y y x x y Transformer using Partial Concretization partial concretization concrete semantics canonical abstraction x = x  n

y x y x x y Symbolic Transformer symbolic concretization concrete semantics decision procedure foo()     foo

Partial Concretization Temporarily refine the abstract domain per statement Employed in other shape analysis algorithms [Distefano, TACAS’06, Evan, SAS’07, POPL’08] Soundness is immediate Precision depends on the heap mutation – Locality – Uniformity Can even guarantee precision under certain conditions [Lev-Ami, VMCAI’07]

Challenges in shape analysis Programming language features – Procedures – Modularity and encapsulation – Concurrency Properties Complex data structures – Hierarchy – Mixture of data and heap – Array of heaps Scaling to larger programs

Handling Procedures Complicated sharing patterns [Rinetzky, CC’01] Relational shape analysis [Jeannet, SAS’04] New semantics for procedures (Cutpoints) [Rinetzky, POPL’05] Tabulation for cutpoint free programs [Rinetzky, SAS’05] Handling cutpoints [Gotsman, SAS’06]

Concurrency Models threads as ordinary objects [Yahav, POPL’01] Thread-modular shape analysis [Gotsman, PLDI’07] Heap decomposition and thread quantification [Manevich et al SAS’08, CAV’08] Enforcing a locking regime [Rinetzky]

Handling Larger Programs ? Staged analysis Specialized abstractions – Counterexample guided refinement Coercer abstractions – Weaker summary nodes [Arnold, SAS’06] – Special join operator [Manevich, SAS’04, TACAS’07, Yang’08] – Heterogeneous abstractions [Yahav, PLDI’04] Implementation techniques – Optimizing transformers [Bogodlov, CAV’07] – Optimizing GC – Reducing static size – Partial evaluation – Persistent data structures [Manevich, SAS’04] – …

Conclusion Limited forms of quantified invariants can prove interesting properties Partial concretization is useful for transformers Scaling shape analysis is still an open problem Like a Swiss army knife or a Unix utility – Only for experts –... but at least it’s very useful to them