Professional Documents
Culture Documents
Motivation
Desired Properties
Inherited sharing
Incidental sharing due to program invariants
Outline
Background
First-order structure representations
Empirical evaluation
Conclusion
Structure copy(Structure)
print_all Example
/* list.h */
typedef struct node {
struct node * n;
int data;
} * L;
/* print.c */
#include list.h
void print_all(L y) {
L x;
x = y;
while (x != NULL) {
/* assert(x != NULL) */
printf(elem=%d, xdata);
x = xn;
}
}
print_all Example
n=
x = y
x(v) := y(v)
copy(S0) : S1
nodeset(S0) : {u1, u}
eval(S0, y, u1) : 1
update(S1, x, u1, 1)
eval(S0, y, u) : 0
update(S1, x, u, 0)
S0
u1
y=1
n=
u
sm=
n=
S1
u1
y=1
x=1
n=
u
sm=
print_all Example
n=
while (x != NULL)
precondition : v x(v)
x = x n
focus : v1 x(v1) n(v1, v)
x(v) := v1 x(v1) n(v1, v)
S1
u1
u
n=
x=1
sm=
y=1
n=
S2.0
u
sm=
u1
y=1
n=
S2.1
u1
y=1
n=1
u
x=1
n=
S2.2
u1
y=1
n=1
u.1
x=1
n=
n=
u.0
sm=
2.
3.
Implementation techniques
Empirical evaluation
Base Representation
(Tal Lev-Ami SAS 2000)
Two-Level Map :
Predicate (Node Tuple Kleene)
Sparse Representation
Limited inherited sharing by
Copy-On-Write
x2
x3
x1
x2
x2
x3
0
x3
0
x3
1
x3
1
x1
x1
x2
x3
x2
x3
x3
x3
1
Duplicate Terminals
x1
x2
x2
x3
x3
Duplicate Nonterminals
x2
x3
0
Redundant Tests
Static encoding of
Predicates
Kleene values
0, 1, , n-1
Characteristic function
S={1,5}
1=<001>
=
5=<101>
(x1x2x3) (x1x2x3)
x2
x1
x2
x3
Characteristic function
S={1,5}
1=<001>
=
5=<101>
(x1x2x3) (x1x2x3)
x2
x1
x2
x3
1
S0
u
u1 n=
sm=
y=1
S0
S0
u
u1 n=
sm=
y=1
S0
S1
x=y
n=
S1
u1
u
n=
x=1
sm=
y=1
S0
u
u1 n=
sm=
y=1
S0
S1
x=y
n=
S1
u1
u
n=
x=1
sm=
y=1
x=xn
n=
S2.2
u1
y=1
n=1
u.1
x=1
n=
n=
u.0
sm=
S2.2
S0
u
u1 n=
sm=
y=1
S0
S1
x=y
n=
S1
u1
u
n=
x=1
sm=
y=1
x=xn
n=
S2.2
u1
y=1
n=1
u.1
x=1
n=
n=
u.0
sm=
S2.2
Our heuristics
Hybrid representation
Functional Representation
Empirical Evaluation
Benchmarks:
Space Results
450
402.8
400
350
300
Base
OBDD total
Functional
250
200
187.7
168.2
150
100
50
51.6
12.8
5.5
22.7 16.7
12.9
9.6
0
JFE
KERNEL
CA
MA
GC
Abstract Counters
25,000,000
20,000,000
15,000,000
10,000,000
5,000,000
0
JFE
KERNEL
CA
MA
GC
Trends in the
Cleanness Analysis Benchmark
600
500
564
505
400
Base
OBDD
Functional
300
200
100
0
74
54
42
50
1
10
Conclusions
Implementation techniques
Empirical evaluation
Conclusions
The End