Finding Optimal Program Abstractions Mayur Naik Georgia Tech Xin Zhang (Georgia Tech) Hongseok Yang...
-
Upload
gretchen-cortner -
Category
Documents
-
view
214 -
download
0
Transcript of Finding Optimal Program Abstractions Mayur Naik Georgia Tech Xin Zhang (Georgia Tech) Hongseok Yang...
![Page 1: Finding Optimal Program Abstractions Mayur Naik Georgia Tech Xin Zhang (Georgia Tech) Hongseok Yang (Oxford) Percy Liang (Stanford) Mooly Sagiv (Tel-Aviv.](https://reader037.fdocuments.in/reader037/viewer/2022103121/56649c6d5503460f9491f9ba/html5/thumbnails/1.jpg)
Finding Optimal Program Abstractions
Mayur NaikGeorgia Tech
Xin Zhang(Georgia Tech)
Hongseok Yang(Oxford)
Percy Liang(Stanford)
Mooly Sagiv(Tel-Aviv U)
Joint work with:
![Page 2: Finding Optimal Program Abstractions Mayur Naik Georgia Tech Xin Zhang (Georgia Tech) Hongseok Yang (Oxford) Percy Liang (Stanford) Mooly Sagiv (Tel-Aviv.](https://reader037.fdocuments.in/reader037/viewer/2022103121/56649c6d5503460f9491f9ba/html5/thumbnails/2.jpg)
Dagstuhl
Static Analysis: 70’s to 90’s
April 2013 2
• client-oblivious
“Because clients have different precision and scalability needs, future work should identify the client they are addressing …” M. Hind, Pointer Analysis: Haven’t We Solved This Problem Yet?, 2001
abstraction a
program p
query q1
query q2
p ² q1?
p ² q2?
![Page 3: Finding Optimal Program Abstractions Mayur Naik Georgia Tech Xin Zhang (Georgia Tech) Hongseok Yang (Oxford) Percy Liang (Stanford) Mooly Sagiv (Tel-Aviv.](https://reader037.fdocuments.in/reader037/viewer/2022103121/56649c6d5503460f9491f9ba/html5/thumbnails/3.jpg)
Dagstuhl 3
p ² q1?
p ² q2?
Static Analysis: 00’s to Present
April 2013
• client-driven– demand-driven points-to analysis
Heintze & Tardieu ’01, Guyer & Lin ’03, Sridharan & Bodik ’06, …
– CEGAR model checkers: SLAM, BLAST, …
abstraction a
program p
query q1
query q2
![Page 4: Finding Optimal Program Abstractions Mayur Naik Georgia Tech Xin Zhang (Georgia Tech) Hongseok Yang (Oxford) Percy Liang (Stanford) Mooly Sagiv (Tel-Aviv.](https://reader037.fdocuments.in/reader037/viewer/2022103121/56649c6d5503460f9491f9ba/html5/thumbnails/4.jpg)
Dagstuhl 4
Static Analysis: 00’s to Present
April 2013
abstraction a2abstraction a1q1 p q2
p ² q1? p ² q2?
• client-driven– demand-driven points-to analysis
Heintze & Tardieu ’01, Guyer & Lin ’03, Sridharan & Bodik ’06, …
– CEGAR model checkers: SLAM, BLAST, …
![Page 5: Finding Optimal Program Abstractions Mayur Naik Georgia Tech Xin Zhang (Georgia Tech) Hongseok Yang (Oxford) Percy Liang (Stanford) Mooly Sagiv (Tel-Aviv.](https://reader037.fdocuments.in/reader037/viewer/2022103121/56649c6d5503460f9491f9ba/html5/thumbnails/5.jpg)
Dagstuhl 5
Our Static Analysis Setting
April 2013
• client-driven + parametric– new search algorithms: testing, machine learning, …– new analysis questions: optimality, impossibility, …
abstraction a2abstraction a1q1 p q2
p ² q1? p ² q2?
0 1 0 0 0 1 0 0 0 1
![Page 6: Finding Optimal Program Abstractions Mayur Naik Georgia Tech Xin Zhang (Georgia Tech) Hongseok Yang (Oxford) Percy Liang (Stanford) Mooly Sagiv (Tel-Aviv.](https://reader037.fdocuments.in/reader037/viewer/2022103121/56649c6d5503460f9491f9ba/html5/thumbnails/6.jpg)
Dagstuhl 6
Example 1: Predicate Abstraction (CEGAR)
April 2013
abstraction a2abstraction a1q1 p q2
Predicates touse in predicate
abstraction
p ² q1? p ² q2?
0 1 0 0 0 1 0 0 0 1
![Page 7: Finding Optimal Program Abstractions Mayur Naik Georgia Tech Xin Zhang (Georgia Tech) Hongseok Yang (Oxford) Percy Liang (Stanford) Mooly Sagiv (Tel-Aviv.](https://reader037.fdocuments.in/reader037/viewer/2022103121/56649c6d5503460f9491f9ba/html5/thumbnails/7.jpg)
Dagstuhl 7
Example 2: Shape Analysis (TVLA)
April 2013
Predicates touse as abstraction
predicates
abstraction a2abstraction a1q1 p q2
p ² q1? p ² q2?
0 1 0 0 0 1 0 0 0 1
![Page 8: Finding Optimal Program Abstractions Mayur Naik Georgia Tech Xin Zhang (Georgia Tech) Hongseok Yang (Oxford) Percy Liang (Stanford) Mooly Sagiv (Tel-Aviv.](https://reader037.fdocuments.in/reader037/viewer/2022103121/56649c6d5503460f9491f9ba/html5/thumbnails/8.jpg)
Dagstuhl 8
Example 3: Cloning-based Pointer Analysis
April 2013
abstraction a2abstraction a1q1 p q2
K value to use for each call and each
allocation site
p ² q1? p ² q2?
0 1 0 0 0 1 0 0 0 1
![Page 9: Finding Optimal Program Abstractions Mayur Naik Georgia Tech Xin Zhang (Georgia Tech) Hongseok Yang (Oxford) Percy Liang (Stanford) Mooly Sagiv (Tel-Aviv.](https://reader037.fdocuments.in/reader037/viewer/2022103121/56649c6d5503460f9491f9ba/html5/thumbnails/9.jpg)
Dagstuhl 9
Problem Statement
• An efficient algorithm with:
INPUTS:– program p and query q– abstractions A = { a1, …, an }– boolean function S(p, q, a)
OUTPUT:– Impossibility: @ a 2 A: S(p, q, a) = true– Proof: a 2 A: S(p, q, a) = true
8 a’ 2 A: (a’ · a Æ S(p, q, a’) = true) ) a’ = a
April 2013
qp S
p ` q p 0 q
a
Optimal Abstraction
AND
![Page 10: Finding Optimal Program Abstractions Mayur Naik Georgia Tech Xin Zhang (Georgia Tech) Hongseok Yang (Oxford) Percy Liang (Stanford) Mooly Sagiv (Tel-Aviv.](https://reader037.fdocuments.in/reader037/viewer/2022103121/56649c6d5503460f9491f9ba/html5/thumbnails/10.jpg)
Dagstuhl 10
• An efficient algorithm with:
INPUTS:– program p and query q– abstractions A = { a1, …, an }– boolean function S(p, q, a)
OUTPUT:– Impossibility: @ a 2 A: S(p, q, a) = true– Proof: a 2 A: S(p, q, a) = true
8 a’ 2 A: (a’ · a Æ S(p, q, a’) = true) ) a’ = a
Problem Statement
April 2013
: S(p, q, a)
S(p, q, a)
1111 finest
0100optimal
0000 coarsest
AND
Optimal Abstraction
![Page 11: Finding Optimal Program Abstractions Mayur Naik Georgia Tech Xin Zhang (Georgia Tech) Hongseok Yang (Oxford) Percy Liang (Stanford) Mooly Sagiv (Tel-Aviv.](https://reader037.fdocuments.in/reader037/viewer/2022103121/56649c6d5503460f9491f9ba/html5/thumbnails/11.jpg)
Dagstuhl 11
Orderings on A
• Efficiency Partial Ordering– a1 ·cost a2 , sum of a1’s bits · sum of a2’s bits
– S(p, q, a1) runs faster than S(p, q, a2)
• Precision Partial Ordering– a1 ·prec a2 , a1 is pointwise · a2
– S(p, q, a1) = true ) S(p, q, a2) = true
April 2013
![Page 12: Finding Optimal Program Abstractions Mayur Naik Georgia Tech Xin Zhang (Georgia Tech) Hongseok Yang (Oxford) Percy Liang (Stanford) Mooly Sagiv (Tel-Aviv.](https://reader037.fdocuments.in/reader037/viewer/2022103121/56649c6d5503460f9491f9ba/html5/thumbnails/12.jpg)
Dagstuhl 12
Why Optimality?
• Empirical lower bounds for static analysis
• Efficient to compute
• Better for user consumption– analysis imprecision facts– assumptions about missing program parts
• Better for machine learning
April 2013
![Page 13: Finding Optimal Program Abstractions Mayur Naik Georgia Tech Xin Zhang (Georgia Tech) Hongseok Yang (Oxford) Percy Liang (Stanford) Mooly Sagiv (Tel-Aviv.](https://reader037.fdocuments.in/reader037/viewer/2022103121/56649c6d5503460f9491f9ba/html5/thumbnails/13.jpg)
Dagstuhl 13
Why is this Hard in Practice?
• |A| exponential in size of p, or even infinite
• S(p, q, a) = false for most p, q, a
• Different a is optimal for different p, q
April 2013
![Page 14: Finding Optimal Program Abstractions Mayur Naik Georgia Tech Xin Zhang (Georgia Tech) Hongseok Yang (Oxford) Percy Liang (Stanford) Mooly Sagiv (Tel-Aviv.](https://reader037.fdocuments.in/reader037/viewer/2022103121/56649c6d5503460f9491f9ba/html5/thumbnails/14.jpg)
Dagstuhl 14
Talk Outline
• Abstraction Coarsening [POPL’11]
• Abstractions from Tests [POPL’12]
• Abstraction Refinement [PLDI’13]
April 2013
![Page 15: Finding Optimal Program Abstractions Mayur Naik Georgia Tech Xin Zhang (Georgia Tech) Hongseok Yang (Oxford) Percy Liang (Stanford) Mooly Sagiv (Tel-Aviv.](https://reader037.fdocuments.in/reader037/viewer/2022103121/56649c6d5503460f9491f9ba/html5/thumbnails/15.jpg)
Dagstuhl 15
Talk Outline
• Abstraction Coarsening [POPL’11]
• Abstractions from Tests [POPL’12]
• Abstraction Refinement [PLDI’13]
April 2013
![Page 16: Finding Optimal Program Abstractions Mayur Naik Georgia Tech Xin Zhang (Georgia Tech) Hongseok Yang (Oxford) Percy Liang (Stanford) Mooly Sagiv (Tel-Aviv.](https://reader037.fdocuments.in/reader037/viewer/2022103121/56649c6d5503460f9491f9ba/html5/thumbnails/16.jpg)
Dagstuhl 16
Abstraction Coarsening [POPL’11]
• For given p, q: start with finest a, incrementally replace 1’s with 0’s
• Two algorithms:– deterministic vs. randomized
• In practice, use combinationof the algorithms
April 2013
: S(p, q, a)
S(p, q, a)
1111 finest
0100optimal
0000 coarsest
![Page 17: Finding Optimal Program Abstractions Mayur Naik Georgia Tech Xin Zhang (Georgia Tech) Hongseok Yang (Oxford) Percy Liang (Stanford) Mooly Sagiv (Tel-Aviv.](https://reader037.fdocuments.in/reader037/viewer/2022103121/56649c6d5503460f9491f9ba/html5/thumbnails/17.jpg)
Dagstuhl 17
Randomized Coarsening Algorithm
April 2013
a à (1, …, 1)Loop:
Remove each component from a with probability (1 - ®)
Run S(p, q, a)If :S(p, q, a) then add components back
Else remove components permanently
![Page 18: Finding Optimal Program Abstractions Mayur Naik Georgia Tech Xin Zhang (Georgia Tech) Hongseok Yang (Oxford) Percy Liang (Stanford) Mooly Sagiv (Tel-Aviv.](https://reader037.fdocuments.in/reader037/viewer/2022103121/56649c6d5503460f9491f9ba/html5/thumbnails/18.jpg)
Dagstuhl 18
Performance of Randomized Coarsening
Let:n = total # componentss = # components in largest optimal abstraction
If set probability ® = e(-1/s) then outputs optimal abstraction in O(s log n) expected time
• Significance: s is small, only log dependenceon total # components
April 2013
![Page 19: Finding Optimal Program Abstractions Mayur Naik Georgia Tech Xin Zhang (Georgia Tech) Hongseok Yang (Oxford) Percy Liang (Stanford) Mooly Sagiv (Tel-Aviv.](https://reader037.fdocuments.in/reader037/viewer/2022103121/56649c6d5503460f9491f9ba/html5/thumbnails/19.jpg)
Dagstuhl 19
Application: Pointer Analysis Abstractions
• Client: static datarace detector [PLDI’06]– Pointer analysis using k-CFA with heap cloning– Uses call graph, may-alias, thread-escape, and
may-happen-in-parallel analyses
April 2013
# components(x 1000)
# unproven queries (dataraces)(x 1000)
alloc sites
call sites
0-CFA 1-CFA diff 1-obj 2-obj diff
hedc 1.6 7.2 21.3 17.8 3.5 17.1 16.1 1.0weblech 2.6 12.4 27.9 8.2 19.7 8.1 5.5 2.5lusearch 2.9 13.9 37.6 31.9 5.7 31.4 20.9 10.5
![Page 20: Finding Optimal Program Abstractions Mayur Naik Georgia Tech Xin Zhang (Georgia Tech) Hongseok Yang (Oxford) Percy Liang (Stanford) Mooly Sagiv (Tel-Aviv.](https://reader037.fdocuments.in/reader037/viewer/2022103121/56649c6d5503460f9491f9ba/html5/thumbnails/20.jpg)
Dagstuhl 20
Experimental Results: All Queries
April 2013
K-CFA # components(x 1000)
BasicRefine(x 1000)
ActiveCoarsen
hedc 8.8 7.2 (83%) 90 (1.0%)
weblech 15.0 12.7 (85%) 157 (1.0%)
lusearch 16.8 14.9 (88%) 250 (1.5%)
K-obj # components(x 1000)
BasicRefine(x 1000)
ActiveCoarsen
hedc 1.6 0.9 (57%) 37 (2.3%)
weblech 2.6 1.8 (68%) 48 (1.9%)
lusearch 2.9 2.1 (73%) 56 (1.9%)
![Page 21: Finding Optimal Program Abstractions Mayur Naik Georgia Tech Xin Zhang (Georgia Tech) Hongseok Yang (Oxford) Percy Liang (Stanford) Mooly Sagiv (Tel-Aviv.](https://reader037.fdocuments.in/reader037/viewer/2022103121/56649c6d5503460f9491f9ba/html5/thumbnails/21.jpg)
Dagstuhl 21
Empirical Results: Per Query
April 2013
![Page 22: Finding Optimal Program Abstractions Mayur Naik Georgia Tech Xin Zhang (Georgia Tech) Hongseok Yang (Oxford) Percy Liang (Stanford) Mooly Sagiv (Tel-Aviv.](https://reader037.fdocuments.in/reader037/viewer/2022103121/56649c6d5503460f9491f9ba/html5/thumbnails/22.jpg)
Dagstuhl 22
Empirical Results: Per Query, contd.
April 2013
![Page 23: Finding Optimal Program Abstractions Mayur Naik Georgia Tech Xin Zhang (Georgia Tech) Hongseok Yang (Oxford) Percy Liang (Stanford) Mooly Sagiv (Tel-Aviv.](https://reader037.fdocuments.in/reader037/viewer/2022103121/56649c6d5503460f9491f9ba/html5/thumbnails/23.jpg)
Dagstuhl 23
Talk Outline
• Abstraction Coarsening [POPL’11]
• Abstractions from Tests [POPL’12]
• Abstraction Refinement [PLDI’13]
April 2013
![Page 24: Finding Optimal Program Abstractions Mayur Naik Georgia Tech Xin Zhang (Georgia Tech) Hongseok Yang (Oxford) Percy Liang (Stanford) Mooly Sagiv (Tel-Aviv.](https://reader037.fdocuments.in/reader037/viewer/2022103121/56649c6d5503460f9491f9ba/html5/thumbnails/24.jpg)
Dagstuhl 24
Talk Outline
• Abstraction Coarsening [POPL’11]
• Abstractions from Tests [POPL’12]
• Abstraction Refinement [PLDI’13]
April 2013
![Page 25: Finding Optimal Program Abstractions Mayur Naik Georgia Tech Xin Zhang (Georgia Tech) Hongseok Yang (Oxford) Percy Liang (Stanford) Mooly Sagiv (Tel-Aviv.](https://reader037.fdocuments.in/reader037/viewer/2022103121/56649c6d5503460f9491f9ba/html5/thumbnails/25.jpg)
Dagstuhl 25
Abstractions From Tests [POPL’12]
April 2013
p, q
dynamic analysis
p ² q?
and optimal!
0 1 0 0 0
static analysis
![Page 26: Finding Optimal Program Abstractions Mayur Naik Georgia Tech Xin Zhang (Georgia Tech) Hongseok Yang (Oxford) Percy Liang (Stanford) Mooly Sagiv (Tel-Aviv.](https://reader037.fdocuments.in/reader037/viewer/2022103121/56649c6d5503460f9491f9ba/html5/thumbnails/26.jpg)
Dagstuhl 26
Combining Dynamic and Static Analysis
• Previous work:– Counterexamples: query is false on some input• suffices if most queries are expected to be false
– Likely invariants: a query true on some inputs islikely true on all inputs [Ernst 2001]
• Our approach:– Proofs: a query true on some inputs is likely true
on all inputs and for likely the same reason!
April 2013
![Page 27: Finding Optimal Program Abstractions Mayur Naik Georgia Tech Xin Zhang (Georgia Tech) Hongseok Yang (Oxford) Percy Liang (Stanford) Mooly Sagiv (Tel-Aviv.](https://reader037.fdocuments.in/reader037/viewer/2022103121/56649c6d5503460f9491f9ba/html5/thumbnails/27.jpg)
Dagstuhl 27
Example: Thread-Escape Analysis
April 2013
L L L L
h1 h2 h3 h4
local(pc, w)?
// u, v, w are local variables// g is a global variable// start() spawns new threadfor (i = 0; i < N; i++) { u = new h1; v = new h2; g = new h3; v.f = g; w = new h4; u.f2 = w;pc: w.id = i; u.start();}
![Page 28: Finding Optimal Program Abstractions Mayur Naik Georgia Tech Xin Zhang (Georgia Tech) Hongseok Yang (Oxford) Percy Liang (Stanford) Mooly Sagiv (Tel-Aviv.](https://reader037.fdocuments.in/reader037/viewer/2022103121/56649c6d5503460f9491f9ba/html5/thumbnails/28.jpg)
Dagstuhl 28
Example: Thread-Escape Analysis
// u, v, w are local variables// g is a global variable// start() spawns new threadfor (i = 0; i < N; i++) { u = new h1; v = new h2; g = new h3; v.f = g; w = new h4; u.f2 = w;pc: w.id = i; u.start();}
April 2013
L L E L
h1 h2 h3 h4
but not optimallocal(pc, w)?
![Page 29: Finding Optimal Program Abstractions Mayur Naik Georgia Tech Xin Zhang (Georgia Tech) Hongseok Yang (Oxford) Percy Liang (Stanford) Mooly Sagiv (Tel-Aviv.](https://reader037.fdocuments.in/reader037/viewer/2022103121/56649c6d5503460f9491f9ba/html5/thumbnails/29.jpg)
Dagstuhl 29
Example: Thread-Escape Analysis
April 2013
L E E L
h1 h2 h3 h4
and optimal!local(pc, w)?
// u, v, w are local variables// g is a global variable// start() spawns new threadfor (i = 0; i < N; i++) { u = new h1; v = new h2; g = new h3; v.f = g; w = new h4; u.f2 = w;pc: w.id = i; u.start();}
![Page 30: Finding Optimal Program Abstractions Mayur Naik Georgia Tech Xin Zhang (Georgia Tech) Hongseok Yang (Oxford) Percy Liang (Stanford) Mooly Sagiv (Tel-Aviv.](https://reader037.fdocuments.in/reader037/viewer/2022103121/56649c6d5503460f9491f9ba/html5/thumbnails/30.jpg)
Dagstuhl 30
Benchmarks
April 2013
classes bytecodes(x 1000)
alloc. sites(x 1000)
app total app total
hedc 44 355 16 161 1.6
weblech 57 579 20 237 2.6
lusearch 229 648 100 273 2.9
sunflow 164 1,018 117 480 5.2
avrora 1,159 1,525 223 316 4.9
hsqldb 199 837 221 491 4.6
![Page 31: Finding Optimal Program Abstractions Mayur Naik Georgia Tech Xin Zhang (Georgia Tech) Hongseok Yang (Oxford) Percy Liang (Stanford) Mooly Sagiv (Tel-Aviv.](https://reader037.fdocuments.in/reader037/viewer/2022103121/56649c6d5503460f9491f9ba/html5/thumbnails/31.jpg)
Dagstuhl 31
Precision: Thread-Escape Analysis
April 2013
![Page 32: Finding Optimal Program Abstractions Mayur Naik Georgia Tech Xin Zhang (Georgia Tech) Hongseok Yang (Oxford) Percy Liang (Stanford) Mooly Sagiv (Tel-Aviv.](https://reader037.fdocuments.in/reader037/viewer/2022103121/56649c6d5503460f9491f9ba/html5/thumbnails/32.jpg)
Dagstuhl 32
Running Time (seconds) CDFs
April 2013
![Page 33: Finding Optimal Program Abstractions Mayur Naik Georgia Tech Xin Zhang (Georgia Tech) Hongseok Yang (Oxford) Percy Liang (Stanford) Mooly Sagiv (Tel-Aviv.](https://reader037.fdocuments.in/reader037/viewer/2022103121/56649c6d5503460f9491f9ba/html5/thumbnails/33.jpg)
Dagstuhl 33
Running Time (seconds) CDFs
April 2013
![Page 34: Finding Optimal Program Abstractions Mayur Naik Georgia Tech Xin Zhang (Georgia Tech) Hongseok Yang (Oxford) Percy Liang (Stanford) Mooly Sagiv (Tel-Aviv.](https://reader037.fdocuments.in/reader037/viewer/2022103121/56649c6d5503460f9491f9ba/html5/thumbnails/34.jpg)
Dagstuhl 34
Talk Outline
• Abstraction Coarsening [POPL’11]
• Abstractions from Tests [POPL’12]
• Abstraction Refinement [PLDI’13]
April 2013
![Page 35: Finding Optimal Program Abstractions Mayur Naik Georgia Tech Xin Zhang (Georgia Tech) Hongseok Yang (Oxford) Percy Liang (Stanford) Mooly Sagiv (Tel-Aviv.](https://reader037.fdocuments.in/reader037/viewer/2022103121/56649c6d5503460f9491f9ba/html5/thumbnails/35.jpg)
Dagstuhl 35
Talk Outline
• Abstraction Coarsening [POPL’11]
• Abstractions from Tests [POPL’12]
• Abstraction Refinement [PLDI’13]
April 2013
![Page 36: Finding Optimal Program Abstractions Mayur Naik Georgia Tech Xin Zhang (Georgia Tech) Hongseok Yang (Oxford) Percy Liang (Stanford) Mooly Sagiv (Tel-Aviv.](https://reader037.fdocuments.in/reader037/viewer/2022103121/56649c6d5503460f9491f9ba/html5/thumbnails/36.jpg)
Dagstuhl 36
`21.548`
Example: Type-State Analysis
x = new File;y = x;if (*) z = x;x.open();y.close();if (*) check1(x, closed);else check2(x, opened);
April 2013
Query Abstraction
check1 Any >= { x, y }
check2 None
`21.548`
`21.548`
`21.548`
`21.548`
Query Abstraction
check1 { }
check2
![Page 37: Finding Optimal Program Abstractions Mayur Naik Georgia Tech Xin Zhang (Georgia Tech) Hongseok Yang (Oxford) Percy Liang (Stanford) Mooly Sagiv (Tel-Aviv.](https://reader037.fdocuments.in/reader037/viewer/2022103121/56649c6d5503460f9491f9ba/html5/thumbnails/37.jpg)
Dagstuhl 37
Example: Type-State Analysis
April 2013
x = new File;y = x;if (*) z = x;x.open();y.close();if (*) check1(x, closed);else check2(x, opened);
Query Abstraction
check1 Any >= { x, y }
check2 None
Query Abstraction
check1 { }
check2{ x }
`21.548`
`21.548`
`21.548`
`21.548`
`21.548`
{ x, y }
![Page 38: Finding Optimal Program Abstractions Mayur Naik Georgia Tech Xin Zhang (Georgia Tech) Hongseok Yang (Oxford) Percy Liang (Stanford) Mooly Sagiv (Tel-Aviv.](https://reader037.fdocuments.in/reader037/viewer/2022103121/56649c6d5503460f9491f9ba/html5/thumbnails/38.jpg)
Dagstuhl 38
Example: Type-State Analysis
April 2013
x = new File;y = x;if (*) z = x;x.open();y.close();if (*) check1(x, closed);else check2(x, opened);
Query Abstraction
check1 Any >= { x, y }
check2 None
Query Abstraction
check1 { }
check2 { }
`21.548`
`21.548`
`21.548`
`21.548`
`21.548`
{ x } { x, y }
{ x }
![Page 39: Finding Optimal Program Abstractions Mayur Naik Georgia Tech Xin Zhang (Georgia Tech) Hongseok Yang (Oxford) Percy Liang (Stanford) Mooly Sagiv (Tel-Aviv.](https://reader037.fdocuments.in/reader037/viewer/2022103121/56649c6d5503460f9491f9ba/html5/thumbnails/39.jpg)
Dagstuhl 39
Precision: Thread-Escape Analysis
April 2013
![Page 40: Finding Optimal Program Abstractions Mayur Naik Georgia Tech Xin Zhang (Georgia Tech) Hongseok Yang (Oxford) Percy Liang (Stanford) Mooly Sagiv (Tel-Aviv.](https://reader037.fdocuments.in/reader037/viewer/2022103121/56649c6d5503460f9491f9ba/html5/thumbnails/40.jpg)
Dagstuhl 40
Comparison with Abstractions from Tests
April 2013
![Page 41: Finding Optimal Program Abstractions Mayur Naik Georgia Tech Xin Zhang (Georgia Tech) Hongseok Yang (Oxford) Percy Liang (Stanford) Mooly Sagiv (Tel-Aviv.](https://reader037.fdocuments.in/reader037/viewer/2022103121/56649c6d5503460f9491f9ba/html5/thumbnails/41.jpg)
Dagstuhl 41
Number of Iterations
April 2013
proven queries impossible queries
min max avg min max avg
hsqldb 2 27 3 1 13 2
antlr 2 18 9 1 47 8
avrora 2 82 48 1 30 4
lusearch 2 32 2 1 23 2
![Page 42: Finding Optimal Program Abstractions Mayur Naik Georgia Tech Xin Zhang (Georgia Tech) Hongseok Yang (Oxford) Percy Liang (Stanford) Mooly Sagiv (Tel-Aviv.](https://reader037.fdocuments.in/reader037/viewer/2022103121/56649c6d5503460f9491f9ba/html5/thumbnails/42.jpg)
Dagstuhl 42
Running Time
April 2013
proven queries impossible queries
min max avg min max avg
hsqldb 20s 25m 94s 4s 50m 55s
antlr 18s 77m 98s 6s 21m 64s
avrora 16s 28m 67s 5s 3h 41s
lusearch 14s 13m 112s 6s 45m 131s
![Page 43: Finding Optimal Program Abstractions Mayur Naik Georgia Tech Xin Zhang (Georgia Tech) Hongseok Yang (Oxford) Percy Liang (Stanford) Mooly Sagiv (Tel-Aviv.](https://reader037.fdocuments.in/reader037/viewer/2022103121/56649c6d5503460f9491f9ba/html5/thumbnails/43.jpg)
Dagstuhl 43
Size of Optimal Abstraction
April 2013
![Page 44: Finding Optimal Program Abstractions Mayur Naik Georgia Tech Xin Zhang (Georgia Tech) Hongseok Yang (Oxford) Percy Liang (Stanford) Mooly Sagiv (Tel-Aviv.](https://reader037.fdocuments.in/reader037/viewer/2022103121/56649c6d5503460f9491f9ba/html5/thumbnails/44.jpg)
Dagstuhl 44
Size of Optimal Abstraction
April 2013
![Page 45: Finding Optimal Program Abstractions Mayur Naik Georgia Tech Xin Zhang (Georgia Tech) Hongseok Yang (Oxford) Percy Liang (Stanford) Mooly Sagiv (Tel-Aviv.](https://reader037.fdocuments.in/reader037/viewer/2022103121/56649c6d5503460f9491f9ba/html5/thumbnails/45.jpg)
Dagstuhl 45
Key Takeaways
• New questions: optimality, impossibility, …
• New applications: lower bounds, lib assumptions, …
• New techniques: search algorithms, abstractions, …
• New tools: meta-analysis, parallelism, …
pag.gatech.edu/prism
April 2013