TVLA: A system for inferring Quantified Invariants Tal Lev-Ami Tom Reps Mooly Sagiv Reinhard Wilhelm Greta Yorsh.

Slides:



Advertisements
Similar presentations
Automated Theorem Proving Lecture 1. Program verification is undecidable! Given program P and specification S, does P satisfy S?
Advertisements

Partially Disjunctive Shape Analysis Josh Berdine Byron Cook MSR Cambridge Tal Lev-Ami Roman Manevich Mooly Sagiv Ran Shaham Tel Aviv University Ganesan.
Shape Analysis for Fine-Grained Concurrency using Thread Quantification Josh Berdine Microsoft Research Joint work with: Tal Lev-Ami, Roman Manevich, Mooly.
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.
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.
3-Valued Logic Analyzer (TVP) Tal Lev-Ami and Mooly Sagiv.
1 Eran Yahav Technion Joint work with Martin Vechev (ETH), Greta Yorsh (ARM), Michael Kuperstein (Technion), Veselin Raychev (ETH)
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
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.
Program analysis Mooly Sagiv html://
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.
1 Eran Yahav and Mooly Sagiv School of Computer Science Tel-Aviv University Verifying Safety Properties.
Modular Shape Analysis for Dynamically Encapsulated Programs Noam Rinetzky Tel Aviv University Arnd Poetzsch-HeffterUniversität Kaiserlauten Ganesan RamalingamMicrosoft.
Finding the Weakest Characterization of Erroneous Inputs Dzintars Avots and Benjamin Livshits.
Overview of program analysis Mooly Sagiv html://
Detecting Memory Errors using Compile Time Techniques Nurit Dor Mooly Sagiv Tel-Aviv University.
Modular Shape Analysis for Dynamically Encapsulated Programs Noam Rinetzky Tel Aviv University Arnd Poetzsch-HeffterUniversität Kaiserlauten Ganesan RamalingamMicrosoft.
1 Shape Analysis via 3-Valued Logic Mooly Sagiv Tel Aviv University Shape analysis with applications Chapter 4.6
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.
Overview of program analysis Mooly Sagiv html://
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.
June 27, 2002 HornstrupCentret1 Using Compile-time Techniques to Generate and Visualize Invariants for Algorithm Explanation Thursday, 27 June :00-13:30.
T. Lev-Ami, R. Manevich, M. Sagiv TVLA: A System for Generating Abstract Interpreters A. Loginov, G. Ramalingam, E. Yahav.
1 Employing decision procedures for automatic analysis and verification of heap-manipulating programs Greta Yorsh under the supervision of Mooly Sagiv.
Shape Analysis Overview presented by Greta Yorsh.
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.
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
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.
1 Program Analysis via 3-Valued Logic Mooly Sagiv, Tal Lev-Ami, Roman Manevich Tel Aviv University Thomas Reps, University of Wisconsin, Madison Reinhard.
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.
/ PSWLAB Thread Modular Model Checking by Cormac Flanagan and Shaz Qadeer (published in Spin’03) Hong,Shin Thread Modular Model.
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
Over-Approximating Boolean Programs with Unbounded Thread Creation
Parametric Shape Analysis via 3-Valued Logic
Program Analysis and Verification
Symbolic Characterization of Heap Abstractions
A Semantics for Procedure Local Heaps and its Abstractions
Presentation transcript:

TVLA: A system for inferring Quantified Invariants Tal Lev-Ami Tom Reps Mooly Sagiv Reinhard Wilhelm Greta Yorsh

Example: 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) if (t  marked) pending = pending  {t} t = x  right if (t  NULL) if (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} } assert(collected = = Universe – Reachset(root) ) }  v: marked(v)  r: root(r)  reach(w, v)

Example: Mark 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) if (t  marked) pending = pending  {t} t = x  right if (t  NULL) if (t  marked) pending = pending  {t} }  v: marked(v)  r: root(r)  reach(r, v)  r: root(r)  (pending(r)  marked(r))   v: ((marked(v)  pending(v))  reach(r, v))   (pending(v)  marked(v))   v, w: ((marked(v)   marked(w)   pending(w))   successor(v, w))

Example: Mark 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) if (t  marked) pending = pending  {t} /* t = x  right * if (t  NULL) * if (t  marked) * pending = pending  {t} */ } } assert(marked = = Reachset(root)) } Run Demo

 r: root(r)  reach(r, e)   pending(r)  marked(r))   e: reach(r, e)   marked(e))   root(e)   pending(v)  r, e: (( reach(r, e)   marked(e))   root(e)   pending(e))  ( root(r)  reach(r, e)   pending(r)  marked(r))   left(e, r)) Example: Mark 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) if (t  marked) pending = pending  {t} /* t = x  right * if (t  NULL) * if (t  marked) * pending = pending  {t} */ } } assert(marked = = Reachset(root)) }

A Singleton Buffer 6 Boolean empty = true; Object b = null; produce() { 1: Object p = new(); 2: await (empty) then { b = p; empty = false; } 3: } consume() { Object c; 4: await (!empty) then { c = b; empty = true; } 5: use(c); 6: dispose(c); 7: } Safe Dereference No Double free

7 Boolean empty = true; Object b = null; produce() { 1: Object p = new(); 2: await (empty) then { b = p; empty = false; } 3: } consume() { Object c; 4: await (!empty) then { c = b; empty = true; } 5: use(c); 6: dispose(c); 7: }  t, e, v: t  e  c(t, v)  c(e, w)  v  w

Quantified Invariants are hard Corner cases Sizes Nested loops Code updates First order reasoning is hard

Our approach Automatically infer sound invariants Library (PL) designers can define families of interesting invariants Limited form of invariants Sound but incomplete reasoning –Abstract interpretation over quantified invariants –Parameterized by the

Applications Memory safety & preservation of data structure invariants [Dor, SAS’00, Loginov, ISSTA’08] Compile-time garbage collection [Shaham, SAS’03] Correct API usage [Ramalingam, PLDI’02, Yahav. PLDI’04] Typestate verification [Yahav, ISSTA’06] Partial & total correctness –Sorting implementations [Lev-Ami, ISTTA’00, Rinetzky, SAS’05] –Deutsch-Shorr-Waite [Loginov, SAS’06] Thread modular shape analysis [Gotsman, PLDI’07] Linearizability [Amit, CAV’07, Berdine, CAV’08]

Example: Concrete Interpretation x t n n t x n x t n x t n n x t n n x t t x n t t n t x t x t x empty return x x = t t =malloc(..); t  next=x; x = NULL T F

Shape Analysis t x n x t n x t n n x t t x n t t n t x t x t x empty x t n n x t n n n x t n t n x n x t n n return x x = t t =malloc(..); t  next=x; x = NULL T F

Outline Canonical Abstraction [TOPLAS’02] Quantified Invariants Operating on Abstractions

Abstract Interpretation [Cousot & Cousot] Checking interesting program properties is undecidable Use abstractions Every verified property holds (sound) But may fail to prove properties which always hold (incomplete) –false alarms Minimal false alarms

Simplified Abstract Interpretation Concrete domain Abstract domain (unbounded) (bounded)    

Most Precise Abstract Transformer [Cousot, Cousot POPL 1979]   ## 

An example predicate abstraction predicates {x>0} x = 3 while (true) { x = x +1 ; } x=0, x=-1, x=-2,.. x=1, x=2, x=3,.. 1  0  x=0, x=-1, x=-2,.. x=1, x=2, x=3,.. x=3 1  0 

An example predicate abstraction predicates {x>0} x = 3 while (true) { x = x +1 ; } x=0, x=-1, x=-2,.. x=1, x=2, x=3,.. 1  0  x=0, x=-1, x=-2,.. x=1, x=2, x=3,.. x=x+1 1  0 

An example predicate abstraction predicates {x>0} x = 3 while (true) { x = x +1 ; } {0, 1} {1}

Shape Analysis as Abstract Interpretation Represent concrete stores as labeled directed graphs –2-valued structures {0, 1} –Abstract away Concrete locations Primitive values –But unbounded Represent abstract stores as labeled directed graphs –3-vaued structures {0, 1, ½} –Several concrete nodes are represented by a summary node –Abstract away field correlations

Representing Concrete Stores by Logical Structures Parametric vocabulary Heap –Locations  Individuals –Program variables  Unary relations –Fields  Binary relations

Representing Stores as Logical Structures (Example) u1u2u3u4u5 x n nn n p u1u1 1 u2u2 0 u3u3 0 u4u4 0 u5u5 0 x u1u1 0 u2u2 0 u3u3 1 u4u4 0 u5u5 0 p u1u1 u2u2 u3u3 u4u4 u5u5 u1u u2u u3u u4u u5u n

Representing Abstract Stores by 3-Valued Logical Structures A join semi-lattice: 0  1 = 1/2 {0, 1, ½} values for relations

Canonical Abstraction (  ) Partition the individuals into equivalence classes based on the values of their unary relations –Every individual is mapped into its equivalence class Collapse binary relations via  –p S (u’ 1, u’ 2 ) =  {p B (u 1, u 2 ) | f(u 1 )=u’ 1, f(u 2 )=u’ 2 ) } At most 2 A abstract individuals

Canonical Abstraction x = NULL; while (…) do { t = malloc(); t  next=x; x = t } u1 x t u2 u3 u1 x t u2,3 n n n n

x t n n u2 u1 u3 Canonical Abstraction x = NULL; while (…) do { t = malloc(); t  next=x; x = t } u1 x t u2,3 n n n   

Canonical Abstraction and Equality Summary nodes may represent more than one element (In)equality need not be preserved under abstraction Explicitly record equality Summary nodes are nodes with eq(u, u)=1/2

Canonical Abstraction and Equality x = NULL; while (…) do { t = malloc(); t  next=x; x = t } u1 x t u2 u3 u1 x t u2,3 eq n n n n  eq eq  u2,3  eq

Canonical Abstraction x = NULL; while (…) do { t = malloc(); t  next=x; x = t } u1 x t u2 u3 n n u1 x t u2,3 n n

Canonical Abstraction Partition the individuals into equivalence classes based on the values of their unary relations –Every individual is mapped into its equivalence class Collapse relations via  –p S (u’ 1,..., u’ k ) =  {p B (u 1,..., u k ) | f(u 1 )=u’ 1,..., f(u’ k )=u k ) } At most 2 A abstract individuals

Canonical Abstraction x = NULL; while (…) do { t = malloc(); t  next=x; x = t } u1 x t u2 u3 n n u1 x t u2,3 n n

Limitations Information on summary nodes is lost

Increasing Precision Global invariants –User-supplied, or consequence of the semantics of the programming language Record extra information in the concrete interpretation –Tunes the abstraction –Refines the concretization Naturally expressed in FO TC

Heap Sharing relation is(v)=0 u1u1 x t u2u2 unun … u1 x t u 2..n n n is(v) =  v 1,v 2 : n(v 1,v)  n(v 2,v)  v 1  v 2 is(v)=0 n n n

Heap Sharing relation is(v)=0 u1u1 x t u2u2 unun … is(v) =  v 1,v 2 : n(v 1,v)  n(v 2,v)  v 1  v 2 is(v)=1is(v)=0 n n n n u1 x t u2 n is(v)=0is(v)=1is(v)=0 n u 3..n n n

Reachability relation t[n](v1, v2) = n * (v1,v2) u1u1 x t u2u2 unun n n n t[n] u1 x t u 2..n n n t[n]...

List Segments u1u1 x u2u2 u5u5 n u3u3 u4u4 u6u6 u7u7 u8u8 n n nn n n y u1u1 x u 2,3,4,6,7,8 u5u5 n n y

Reachability from a variable r[n,y](v) =  w: y(w)  n*(w, v) u1u1 x u2u2 u5u5 n u3u3 u4u4 u6u6 u7u7 u8u8 n n nn n n y r[n,y]=0 r[n,y]=1 u1u1 x u 2,3,4 u5u5 n n n y u 6,7,8

inOrder(v) =  w: n(v, w)  data(v)  data(w) c fb (v) =  w: f(v, w)  b(w, v) tree(v) dag(v) Weakest Precondition [Ramalingam, PLDI’02] Learned via Inductive Logic Programming [Loginov, CAV’05] Counterexample guided refinement Additional Instrumentation relations

Most Precise Abstract Transformer [Cousot, Cousot POPL 1979]   ## 

Partial Concretization ##

## ##

y x y x y x y x x y y x x y Best Transformer (x = x  n)  Concrete Semantics canonical abstraction

y x y x x y Partial Concretization based Transformer (x = x  n)  Abstract Semantics canonical abstraction x y y x y x y x

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

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

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

Shape Analysis t x n x t n x t n n x t t x n t t n t x t x t x empty x t n n x t n n n x t n t n x n x t n n return x x = t t =malloc(..); t  next=x; x = NULL T F

[TOPLAS’02, Lev-Ami, SAS’00] Concrete transformers using first order formulas Effective algorithms for computing transformers –Partial concretization –3-valued logic Kleene evaluation –Finite differencing & incremental algorithms [Reps, ESOP’03] A parametric yacc like system[TVLA] –

Applications

Proving Correctness of Sorting Implementations (Lev-Ami, Reps, S, Wilhelm ISSTA 2000) Partial correctness –The elements are sorted –The list is a permutation of the original list Termination –At every loop iterations the set of elements reachable from the head is decreased

Sortedness u1u1 x t u2u2 unun n n n dle u1 x t u 2..n n n dle...

Example: Sortedness inOrder(v) =  v1: n(v,v1)  dle(v, v1) u1u1 x t u2u2 unun n n dle u1 x t u 2..n n n dle inOrder = 1 n...

Example: InsertSort Run Demo List InsertSort(List x) { List r, pr, rn, l, pl; r = x; pr = NULL; while (r != NULL) { l = x; rn = r  n; pl = NULL; while (l != r) { if (l  data > r  data) { pr  n = rn; r  n = l; if (pl = = NULL) x = r; else pl  n = r; r = pr; break; } pl = l; l = l  n; } pr = r; r = rn; } return x; } typedef struct list_cell { int data; struct list_cell *n; } *List;

Example: InsertSort Run Demo List InsertSort(List x) { if (x == NULL) return NULL pr = x; r = x->n; while (r != NULL) { pl = x; rn = r->n; l = x->n; while (l != r) { pr->n = rn ; r->n = l; pl->n = r; r = pr; break; } pl = l; l = l->n; } pr = r; r = rn; } typedef struct list_cell { int data; struct list_cell *n; } *List; 14

Lightweight Specification  "correct usage" rules a client must follow  "call open() before read()" Certification does the client program satisfy the lightweight specification? Verification of Safety Properties (PLDI’02, 04) Component a library with cleanly encapsulated state Client a program that uses the library The Canvas Project (with IBM Watson) (Component Annotation, Verification and Stuff)

Prototype Implementation Applied to several example programs –Up to 5000 lines of Java Used to verify –Absence of concurrent modification exception –JDBC API conformance –IOStreams API conformance

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

Correctness of concurrent ADT implementations [Amit CAV’07, Berdine, CAV’08] Small pointer manipulation programs Fine grained concurrency Benign data races Error prone Interesting properties –Memory safety –Partial correctness –Linearizability –Liveness

Treiber’s Non-blocking Stack [1] void push(Stack *S, data_type v) { [2] Node *x = alloc(sizeof(Node)); [3] x->d = v; [4] do { [5] Node *t = S->Top; [6] x->n = t; [7] } while (!CAS(&S->Top,t,x)); [8] } [9] data_type pop(Stack *S){ [10] do { [11] Node *t = S->Top; [12] if (t == NULL) [13] return EMPTY; [14] Node *s = t->n; [15] data_type r = s->d; [16] } while (!CAS(&S->Top,t,s)); [17] return r; [18] }

64 Verified Programs#statestime (sec.) Treiber’s stack [1986] Two-lock queue [Michael & Scott, PODC’96] 3, Non-blocking queue [Doherty & Groves, FORTE’04] 10, Experimental results First automatic verification of linearizability for unbounded number of threads

Handling Larger Programs Staged analysis Handling procedures Specialized abstractions –Counterexample guided refinement [McMillan, POPL’08] Coercer abstractions –Weaker summary nodes [Arnold, SAS’06] –Special join operator [Manevich, SAS’04, TACAS’07, SAS’08, 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] –…

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] Modularity [Rinezky, ESOP’07]

main() { append(y,z); } Procedure  input/output relation –Not reachable  Not effected –proc: local (  reachable) heap  local heap How to tabulate procedures? append(List p, List q) { … } n x n t y n z n p q p q n y z p q n x n t

main() { append(y,z); } y n n z n How to handle sharing? External sharing may break the functional view append(List p, List q) { … } n n t z x n p q n n p q n n t y p q n n n x

append(y,z); What’s the difference? n n t z y x 1 st Example2 nd Example append(y,z); n x n t y z

Cutpoints An object is a cutpoint for an invocation –Reachable from actual parameters –Not pointed to by an actual parameter –Reachable without going through a parameter append(y,z) y x n n t z y n n t z n n

Introducing local heap semantics Operational semantics Abstract transformer Local heap Operational semantics ~ ’’ ’’

Interprocedural shape analysis Procedure  input/output relation p q n n rqrq rprp rprp q p n n rprp rqrq n rprp q q rqrq rqrq q p rprp q p rprp rqrq n rprp rqrq … Input Output rprp

Interprocedural shape analysis Reusable procedure summaries –Heap modularity q p rprp rqrq n rprp q p rprp rqrq g h i k n n g h i k n rgrg rgrg rgrg rgrhrgrh rhrh riri rkrk rhrh rgrg riri rkrk append(h,i) y x z n n nn rxrx ryry rzrz y x z n n n rzrz rxrx ryry rxrx rxrx rxrx ryry rxrx rxrx append(y,z) y n z x y z x rxrx ryry rzrz ryry rxrx ryrzryrz

Summary Canonical abstraction is powerful –Intuitive –Adapts to the property of interest –More instrumentation may mean more efficient Used to verify interesting program properties –Very few false alarms But scaling is an issue