Shape Analysis by Graph Decomposition - PowerPoint PPT Presentation

1 / 13
About This Presentation
Title:

Shape Analysis by Graph Decomposition

Description:

Our approach: develop abstraction for sub-heaps ... for Cartesian abstractions with multiple components ... Heap Decomposition Canonical abstraction ... – PowerPoint PPT presentation

Number of Views:39
Avg rating:3.0/5.0
Slides: 14
Provided by: RomanMa8
Category:

less

Transcript and Presenter's Notes

Title: Shape Analysis by Graph Decomposition


1
Heap Decomposition for Concurrent Shape Analysis
R. ManevichT. Lev-Ami Tel Aviv University
G. Ramalingam MSR India
J. Berdine MSR Cambridge
2
Overview
  • Challenge precise and efficient shape analyses
    for concurrent programs
  • Coarse-grained / fine-grained parallelism
  • Prove safety properties
  • Absence of nullderef
  • Absence of memory leaks
  • Data structure invariants
  • Observation
  • Threads operate on part of state
  • Correlations between different sub-states often
    irrelevant to prove safety properties
  • Our approach develop abstraction for sub-heaps
  • Abstract correlations between sub-states of
    different threads
  • Reduce exponential state space

3
Example non-blocking stack
1 void push(Stack S, data_type v) 2
Node x alloc(sizeof(Node))3 x-gtd
v4 do 5 Node t S-gtTop6
x-gtn t7 while
(!CAS(S-gtTop,t,x))8
9 data_type pop(Stack S)10 do 11
Node t S-gtTop12 if (t
NULL)13 return EMPTY14
Node s t-gtn15 data_type r
s-gtd16 while (!CAS(S-gtTop,t,s))1
7 return r18
4
Full state
prod1
cons1
Top
t
t
n
x
n
s
t
s
n
n
t
x
n
prod2
cons2
5
Sub-states
prod1
cons1
Top
Top
Top
Top
t
prod2
t
cons2
x
n
n
n
n
t
n
s
n
s
x
n
n
n
n
t
n
6
Full states
H2
H1
prod1
prod2
cons1
cons2
Top
Top
t
t
t
t
x
x
n
s
n
n
s
n
cons2
cons1
prod2
prod1
s
t
n
s
t
n
n
t
n
t
x
x
n
n
7
Sub-states 1 ? Sub-states 2
prod1
Top
cons1
Top
Top
Top
t
t
cons2
prod2
n
n
s
n
x
n
n
s
t
n
n
n
n
t
x
n
n
?
?
?
Top
prod2
Top
cons2
Top
Top
t
prod1
n
t
cons1
x
n
t
n
n
s
n
n
n
s
x
n
n
t
n
n
8
Main results
  • New parametric abstraction for heaps
  • Heap decomposition Cartesian product
  • Family of sound transformers for Cartesian
    abstractions with multiple components
  • Implementation in HeDec
  • Heap Decomposition Canonical abstraction
  • Used to prove interesting properties of
    heap-manipulating programs withfine-grained
    parallelism
  • Linearizability
  • Exponential state space reduction

9
Empirical results
  • Exponential time/space reduction
  • Non-blocking stack linearizability

10
Future/on-going work
  • Extend analysis for an unbounded number of
    threads
  • Extend ideas to non-shape analyses
  • Combine with interprocedural analysis

11
The End
12
Formal details
  • For each thread t define a sub-heap h(t)
  • By defining a location-selection predicate ?(H,v)
  • project(H, ?) keeps only locations in Hselected
    by ?
  • Abstraction for t is ?t(H) bound(
    project(H, ?) )
  • bound is some finitary heap abstraction
  • Final abstraction for threads t1,,tn
    ?(XH) ?t1(XH) ? ? ?tn(XH)

13
Abstract sub-states
prod1
cons1
Top
Top
Top
Top
t
prod2
t
cons2
x
n
n
n
n
t
n
s
n
s
x
n
n
n
n
t
n
Write a Comment
User Comments (0)
About PowerShow.com