Title: Generating Precise and Concise Procedure Summaries
1Generating Precise and Concise Procedure
Summaries
- Greta Yorsh
- Eran Yahav
- Satish Chandra
2Our Framework
Summary Generator
function from input to output abstract values
3Our Framework
Summary Generator
summary of foo
4Our Framework
(restricted)
client
client
Summary Generator
client
Summaries
- precise
- efficient
- concise
5Example
class DataReader FileComp f ... void
setComponent(FileComp p) this.f p
FileComp getComponent() return this.f ...
void nop() FileComp t t
getComponent() setComponent(t)
A1 A2 A3
- Composition of transformers tr13 ? tr12 ? tr23
6Main Challenge
- Composition of transformers
- Finite representation of iterated composition of
transformers
calling contexts
loop iterations
7Our Approach
- Express constraints on intermediate states in
terms of initial and final states - Restrict the representation of transformers
- covers all basic statements
- closed under composition
- finite language
8Our Contributions
- Framework for generating precise, efficient and
concise summaries - language of transformers
- composition algorithm
- Instances of the framework include
- known classes IFDS, IDE
- modular constant propagation with aliasing
- modular typestate verification with aliasing
- Prototype and evaluation for typestate
9Key Ideas
- Transformers are defined using conditional
micro-transformers - partition values into finite number of classes
with uniform behavior - compose using case-splitting
- restrict the way partitions defined
- e.g., no quantifiers
- Lift to aggregate domains
- powerset, product, union
- transformers follow domain structure
- dependencies between components
10Simple Example Tracking Nullness
- Abstract value is a set of access paths
- e.g., x.f, y must have null value
- Abstract transformer tr operates pointwise on
individual access paths using trAPtr(X) ???X
trAP(?) - Conditional micro-transformer trAP maps an
access path ? to a set of access paths
11Example Conditional Micro-Transformer
t this.f
12Example Composition Algorithm
class DataReader FileComp f ... void
setComponent(FileComp p) this.f p
FileComp getComponent() return this.f ...
void nop() FileComp t t
getComponent() setComponent(t)
A1 A2 A3
13Example Composition Algorithm
t getComponent() setComponent(t)
?
?this.f
??t ? ??this.f
t getComponent()
?this.f
this.f
?
t
substitution
?this.f
? ?
? t
setComponent(t)
14Example Composition Algorithm
t getComponent() setComponent(t)
?
??t ? ??this.f
?this.f
?this.f
?this.f
?t
??
this.f?this.f ? this.f ?t
??this.f? ??t
t?this.f ? t?t
?t
this.ft
tt
?t
this.ft
tt
?
t
this.f
this.f
this.f
t
t
t
this.f
?
?
?
?
?
?
?
?
?
t?this.f
15Example Composition Algorithm
t getComponent() setComponent(t)
?
??t ? ??this.f
?this.f
??this.f? ??t
tt
tt
?
t
this.f
?
?
?
16Basic Ingredients of Composition
- Case splitting
- Substitution
- Consistency checking
- Simplification
- Invert operation
- (details in the paper)
17Related Work
- Static determination of dynamic properties of
recursive procedures Cousot-Cousot 79 - Functional approach Sharir-Pnueli 81
- IFDS problems Reps-Horwitz-Sagiv POPL95
- IDE problems Sagiv-Reps-Horwitz TCS 96
- Relevant Context Inference Chatterjee-Ryder-Land
i POPL99
18Summary
- Language of transformers
- Composition algorithm
- The language is closed under composition
- The language is expressive
- Precise and concise procedure summaries