Title: Termination,%20heaps,%20and%20hardware
1Termination, heaps, and hardware Byron Cook
Microsoft Research Cambridge w/ Satnam Singh,
Ashutosh Gupta, and the SLAyer crew
2Introduction
- Advances in automatic program verification and
analysis - Heap
- e.g. automatic memory-safety proofs found for
Windows device drivers CAV07,CAV08 - Concurrency
- e.g. linearizability of fine-grained concurrent
algorithms SAS07 -
- Termination and liveness
- e.g. Termination liveness automatically
properties proved of Windows device drivers
PLDI06,POPL07 - e.g. Non-blocking algorithms automatically
proved non-blocking POPL09 -
3Introduction
- Advances in automatic program verification and
analysis - Heap
- e.g. automatic memory-safety proofs found for
Windows device drivers CAV07,CAV08 - Concurrency heap
- e.g. linearizability of fine-grained concurrent
algorithms SAS07 -
- Termination/liveness concurrency heap
- e.g. Termination liveness automatically
properties proved of Windows device drivers
PLDI06,POPL07 - e.g. Non-blocking algorithms automatically
proved non-blocking POPL09 -
4Introduction
- Advances in automatic program verification and
analysis - Heap
- e.g. automatic memory-safety proofs found for
Windows device drivers CAV07,CAV08 - Concurrency heap
- e.g. linearizability of fine-grained concurrent
algorithms SAS07 -
- Termination/liveness concurrency heap
- e.g. Termination liveness automatically
properties proved of Windows device drivers
PLDI06,POPL07 - e.g. Non-blocking algorithms automatically
proved non-blocking POPL09 -
5Introduction
- Advances in automatic program verification and
analysis - Heap
- e.g. automatic memory-safety proofs found for
Windows device drivers CAV07,CAV08 - Concurrency heap
- e.g. linearizability of fine-grained concurrent
algorithms SAS07 -
- Termination/liveness concurrency heap
- e.g. Termination liveness automatically
properties proved of Windows device drivers
PLDI06,POPL07 - e.g. Non-blocking algorithms automatically
proved non-blocking POPL09 -
6Introduction
7Introduction
8Introduction
- How does this impact hardware design/verification?
- Infinite-state abstractions often useful when
verifying large finite-state systems - More complex assumptions can be made about the
software running on hardware - Opens doors to new strategies in hardware
synthesis?
9Introduction
- How does this impact hardware design/verification?
- Infinite-state abstractions often useful when
verifying large finite-state systems - More complex assumptions can be made about the
software running on hardware - Opens doors to new strategies in hardware
synthesis?
10Introduction
- How does this impact hardware design/verification?
- Infinite-state abstractions often useful when
verifying large finite-state systems - More complex assumptions can be made about the
software running on hardware - Opens doors to new strategies in hardware
synthesis?
11Introduction
- How does this impact hardware design/verification?
- Infinite-state abstractions often useful when
verifying large finite-state systems - More complex assumptions can be made about the
software running on hardware - Opens doors to new strategies in hardware
synthesis?
12Introduction
- How does this impact hardware design/verification?
- Infinite-state abstractions often useful when
verifying large finite-state systems - More complex assumptions can be made about the
software running on hardware - Opens doors to new strategies in hardware
synthesis?
13Introduction
- How does this impact hardware design/verification?
- Infinite-state abstractions often useful when
verifying large finite-state systems - More complex assumptions can be made about the
software running on hardware - Opens doors to new strategies in hardware
synthesis?
14Outline
- Discussion on new directions for hardware
synthesis - Tutorial on the newly available techniques
- Separation-logic based shape analysis
- Termination analysis/proving
-
15Outline
- Discussion on new directions for hardware
synthesis - Tutorial on the newly available techniques
- Separation-logic based shape analysis
- Termination analysis/proving
-
16Outline
- Discussion on new directions for hardware
synthesis - Tutorial on the newly available techniques
- Separation-logic based shape analysis
- Termination analysis/proving
-
17Hardware synthesis
C file
Hardware Synthesis
18Hardware synthesis
C file
Hardware Synthesis
19Hardware synthesis
C file
Hardware Synthesis
20Hardware synthesis
error
error
C file
a file
Shape Analysis
Termination Analysis
pass
pass
Bounds Synthesis
Hardware Synthesis
failure
21Hardware synthesis
C file
22Hardware synthesis
error
C file
a file
Shape Analysis
pass
23Hardware synthesis
error
C file
a file
Shape Analysis
pass
24Hardware synthesis
error
error
C file
a file
Shape Analysis
Termination Analysis
ü
pass
pass
25Hardware synthesis
error
error
C file
a file
Shape Analysis
Termination Analysis
pass
pass
Bounds Synthesis
pass
ü
failure
26Hardware synthesis
error
error
C file
a file
Shape Analysis
Termination Analysis
pass
pass
Bounds Synthesis
Hardware Synthesis
failure
27Hardware synthesis
error
error
a file
C file
Shape Analysis
Termination Analysis
pass
pass
Bounds Synthesis
Hardware Synthesis
failure
28Hardware synthesis
error
error
a file
C file
Shape Analysis
Termination Analysis
pass
pass
Bounds Synthesis
Precondition Synthesis
failure
29Hardware synthesis
error
error
a file
C file
Shape Analysis
Termination Analysis
pass
pass
Bounds Synthesis
Precondition Synthesis
failure
30Hardware synthesis
31Hardware synthesis
32Hardware synthesis
33Hardware synthesis
error
error
a file
C file
Shape Analysis
Termination Analysis
pass
pass
Bounds Synthesis
Hardware Synthesis
failure
34Hardware synthesis
35Hardware synthesis
36Hardware synthesis
37Hardware synthesis
38Hardware synthesis
39Hardware synthesis
error
error
a file
C file
Shape Analysis
Termination Analysis
pass
pass
Bounds Synthesis
Hardware Synthesis
failure
40Hardware synthesis
41Hardware synthesis
42Hardware synthesis
43Hardware synthesis
44Hardware synthesis
error
error
a file
C file
Shape Analysis
Termination Analysis
pass
pass
Bounds Synthesis
Hardware Synthesis
failure
45Hardware synthesis
46Hardware synthesis
47Hardware synthesis
48Hardware synthesis
49Hardware synthesis
50Hardware synthesis
int af(sz) 2
51Hardware synthesis
int af(sz) 2
aprev1 x
52Hardware synthesis
53Hardware synthesis
54Hardware synthesis
55Hardware synthesis
56Hardware synthesis
57Hardware synthesis
58Hardware synthesis
59Hardware synthesis
60Hardware synthesis
61Outline
- Discussion on new directions for hardware
synthesis - Tutorial on the newly available techniques
- Separation-logic based shape analysis
- Termination analysis/proving
62Outline
- Discussion on new directions for hardware
synthesis - Tutorial on the newly available techniques
- Separation-logic based shape analysis
- Termination analysis/proving
63Separation-logic based shape analysis
- Possibilities
- Separation Logic LICS02
- Concurrent Separation Logic CONCUR04
- Shape analysis with the separation domain
TACAS06 - Practical shape analysis (joins, widening, etc)
CAV08 - Dynamic predicate synthesis CAV07
- Precondition synthesis CAV08, Abduction
POPL09 - Recursion SAS06
- Arithmetic abstractions SAS07
- Thread-modular techniques PLDI07
- Rely/Guarantee Separation Logic (RGSep)
CONCUR07
64Separation-logic based shape analysis
- Possibilities
- Separation Logic LICS02
- Concurrent Separation Logic CONCUR04
- Shape analysis with the separation domain
TACAS06 - Practical shape analysis (joins, widening, etc)
CAV08 - Dynamic predicate synthesis CAV07
- Precondition synthesis CAV08, Abduction
POPL09 - Recursion SAS06
- Arithmetic abstractions SAS07
- Thread-modular techniques PLDI07
- Rely/Guarantee Separation Logic (RGSep)
CONCUR07
65Separation logic based shape analysis
- Shape analysis abstract interpretation for
programs with heap - Goal to prove memory safety
- To prove memory safety you need to know A LOT
about the shape of memory - Thus, we get other properties about the
heap-shapes constructed during execution - Example at line 35 x is a pointer to a
well-formed cyclic doubly-linked list
66Separation logic based shape analysis
- Microsoft SLAyer
- Similar to SpaceInvader (Queen Mary), THOR (CMU),
etc. - Shape analysis using abstract domain drawn from
Separation Logic (Separation Domain) - Used to prove memory safety of device drivers,
and make arithmetic abstractions for
safety/liveness proving for T2
67Separation logic based shape analysis
- Separation logic
- Classical logic (quantifers, conjunction, etc)
- Extension
- The heaplet is empty
- The heaplet has
exactly one cell x, holding a record with field
fy and field d5. - The heaplet can be divided so A is
true of exactly one partition, and B is true of
the other - Induction definitions
68Separation logic based shape analysis
- Separation logic
- Classical logic (quantifers, conjunction, etc)
- Extension
- The heaplet is empty
- The heaplet has
exactly one cell x, holding a record with field
fy and field d5. - The heaplet can be divided so A is
true of exactly one partition, and B is true of
the other - Induction definitions
69Separation logic based shape analysis
- Separation logic
- Classical logic (quantifers, conjunction, etc)
- Extension
- emp The heaplet is empty
- x -gt fy,d5 The heaplet has exactly one cell
x, holding a record with field fy and field
d5. - A B The heaplet can be divided so A is true
of exactly one partition, and B is true of the
other - Induction definitions using emp, -gt,
70Separation logic based shape analysis
- Cyclic lists?
-
- Acyclic lists?
-
- Pan handle lists?
-
71Separation logic based shape analysis
ü
- Double linked lists?
- Sorted lists?
- Lists of lists?
- Lists with back edges to head nodes?
- Trees? Balanced trees?
- Skiplists?
- DAGs? BDDs?
ü
ü
ü
ü
ü
72Separation logic based shape analysis
- Separation logic based shape analysis
- Sets of -conjuncted formulae represent abstract
heaps at program locations - e.g. The programs heap
when executing the command at location
consists only of an acyclic list pointed to by x
- Forward symbolic simulation, e.g.
73Separation logic based shape analysis
- Separation logic based shape analysis
- Use of abstraction to improve the chance of
analysis-termination, e.g. - Summaries for procedures, and Frame Rule
-
74Separation logic based shape analysis
75Separation logic based shape analysis
76Separation logic based shape analysis
77Separation logic based shape analysis
78Separation logic based shape analysis
79Separation logic based shape analysis
80Separation logic based shape analysis
81Separation logic based shape analysis
82Separation logic based shape analysis
83Separation logic based shape analysis
84Separation logic based shape analysis
85Separation logic based shape analysis
86Separation logic based shape analysis
87Separation logic based shape analysis
88Separation logic based shape analysis
89Separation logic based shape analysis
ü
90Separation logic based shape analysis
91Separation logic based shape analysis
92Separation logic based shape analysis
93Separation logic based shape analysis
94Separation logic based shape analysis
95Separation logic based shape analysis
96Separation logic based shape analysis
97Separation logic based shape analysis
ü
98Separation-logic based shape analysis
- Possibilities
- Separation Logic LICS02
- Concurrent Separation Logic CONCUR04
- Shape analysis with the separation domain
TACAS06 - Practical shape analysis (joins, widening, etc)
CAV08 - Dynamic predicate synthesis CAV07
- Precondition synthesis CAV08, Abduction
POPL09 - Recursion SAS06
- Arithmetic abstractions SAS07
- Thread-modular techniques PLDI07
- Rely/Guarantee Separation Logic (RGSep)
CONCUR07
99Separation logic based shape analysis
100Separation logic based shape analysis
101Separation logic based shape analysis
102Separation logic based shape analysis
103Separation logic based shape analysis
104Outline
- Discussion on new directions for hardware
synthesis - Tutorial on the newly available techniques
- Separation-logic based shape analysis
- Termination analysis/proving
105Termination
- Possibilities
- Variance analysis POPL07a
- Induction-based techniques ESOP08
- Termination argument refinement PLDI06
- Precondition synthesis CAV08
- Recursion FMSD
- Non-termination POPL08
- Rank function synthesis VMCAI04
- Liveness/fair termination POPL07b
- Rely/guarantee for liveness PLDI07a,POPL09
- Termination arguments for heap CAV06,SAS06
106Well-founded relations
107Well-founded relations
108Well-founded relations
109Well-founded relations
110Well-founded relations
111Well-founded relations
112Well-founded relations
113Well-founded relations
114Termination proof rules
115Termination proof rules
116Termination proof rules
117Termination proof rules
118Termination proof rule
119Termination proof rule
120Termination proof rule
121Termination proof rule
122Termination proof rule
123Termination proof rule
124Termination proof rule
125Termination proof rule
126Termination proof rule
assume(xgt1)
x x y
assume(ygt1)
127Termination proof rule
assume(xgt1)
x x y
assume(ygt1)
128Termination proof rule
assume(xgt1)
x x y
assume(ygt1)
129Termination proof rule
assume(xgt1)
x x y
assume(ygt1)
130Termination proof rule
assume(xgt1)
x x y
assume(ygt1)
131Termination proof rule
132Termination proof rule
133Variance analysis
134Variance analysis
135Variance analysis
136Variance analysis
137Variance analysis
138Variance analysis
139Variance analysis
140Variance analysis
1
2
3
141Variance analysis
1
2
3
142Variance analysis
1
2
3
143Variance analysis
1
2
3
144Variance analysis
1
2
3
145Variance analysis
1
2.1
2.2
2
3
146Variance analysis
1
0
2.1
2.2
2
3
147Variance analysis
1
0
2.1
2.2
2
3
148Variance analysis
1
0
2.1
2.2
2
3
149Variance analysis
1
0
2.1
2.2
2
3
150Variance analysis
1
0
2.1
2.2
2
3
151Variance analysis
1
0
2.1
2.2
2
3
152Variance analysis
1
0
2.1
2.2
2
3
153Variance analysis
1
0
2.1
2.2
2
3
154Variance analysis
1
0
2.1
2.2
2
3
155Variance analysis
ü
1
0
ü
2.1
2.2
2
3
156Termination
- Possibilities
- Variance analysis POPL07a
- Induction-based techniques ESOP08
- Termination argument refinement PLDI06
- Precondition synthesis CAV08
- Recursion FMSD
- Non-termination POPL08
- Rank function synthesis VMCAI04
- Liveness/fair termination POPL07b
- Rely/guarantee for liveness PLDI07a,POPL09
- Termination arguments for heap CAV06,SAS06
157Underapproximating weakest preconditions
158Underapproximating weakest preconditions
159Underapproximating weakest preconditions
160Underapproximating weakest preconditions
161Underapproximating weakest preconditions
162Underapproximating weakest preconditions
163Motivation
- Automatic termination/liveness proving is now a
reality - Advanced termination/liveness tools now
supporting - Concurrency,
- Pointers,
- Heap,
- Recursion,
- Omega-regular properties,
- Counterexample-generation,
- etc
- Tools
- Terminator (currently being transferred into
Windows SDV product) - ARMC (Andreys publicly available version)
- Polyrank (from Bradley, Manna, Sipma)
- T2 (in development for my book and CMU course)
164Motivation
- Automatic termination/liveness proving is now a
reality - Advanced termination/liveness tools now
supporting - Concurrency,
- Pointers,
- Heap,
- Recursion,
- Omega-regular properties,
- Counterexample-generation,
- etc
- Tools
- Terminator (currently being transferred into
Windows SDV product) - ARMC (Andreys publicly available version)
- Polyrank (from Bradley, Manna, Sipma)
- T2 (in development for my book and CMU course)
165Motivation
- Automatic termination/liveness proving is now a
reality - Advanced termination/liveness tools now
supporting - Concurrency,
- Pointers,
- Heap,
- Recursion,
- Omega-regular properties,
- Counterexample-generation,
- etc
- Tools
- Terminator (currently being transferred into
Windows SDV product) - ARMC (Andreys publicly available version)
- Polyrank (from Bradley, Manna, Sipma)
- T2 (in development for my book and CMU course)
166Motivation
- Automatic termination/liveness proving is now a
reality - Advanced termination/liveness tools now
supporting - Concurrency,
- Pointers,
- Heap,
- Recursion,
- Omega-regular properties,
- Counterexample-generation,
- etc
- Tools
- Terminator (currently being transferred into
Windows SDV product) - ARMC (Andreys publicly available version)
- Polyrank (from Bradley, Manna, Sipma)
- T2 (in development for my book and CMU course)
167Motivation
- Automatic termination/liveness proving is now a
reality - Advanced termination/liveness tools now
supporting - Concurrency,
- Pointers,
- Heap,
- Recursion,
- Omega-regular properties,
- Counterexample-generation,
- etc
- Tools
- Terminator (currently being transferred into
Windows SDV product) - ARMC (Andreys publicly available version)
- Polyrank (from Bradley, Manna, Sipma)
- T2 (in development for my book and CMU course)
168Motivation
- Automatic termination/liveness proving is now a
reality - Advanced termination/liveness tools now
supporting - Concurrency,
- Pointers,
- Heap,
- Recursion,
- Omega-regular properties,
- Counterexample-generation,
- etc
- Tools
- Terminator (currently being transferred into
Windows SDV product) - ARMC (Andreys publicly available version)
- Polyrank (from Bradley, Manna, Sipma)
- T2 (in development for my book and CMU course)
169Motivation
- Automatic termination/liveness proving is now a
reality - Advanced termination/liveness tools now
supporting - Concurrency,
- Pointers,
- Heap,
- Recursion,
- Omega-regular properties,
- Counterexample-generation,
- etc
- Tools
- Terminator (currently being transferred into
Windows SDV product) - ARMC (Andreys publicly available version)
- Polyrank (from Bradley, Manna, Sipma)
- T2 (in development for my book and CMU course)
170Motivation
- Automatic termination/liveness proving is now a
reality - Advanced termination/liveness tools now
supporting - Concurrency,
- Pointers,
- Heap,
- Recursion,
- Omega-regular properties,
- Counterexample-generation,
- etc
- Tools
- Terminator (currently being transferred into
Windows SDV product) - ARMC (Andreys publicly available version)
- Polyrank (from Bradley, Manna, Sipma)
- T2 (in development for my book and CMU course)
171Motivation
172Motivation
173Motivation
174Motivation
175Motivation
176PreSynth algorithm
177PreSynth algorithm
178Implementation
179Example
180Motivation
- Automatic termination/liveness proving is now a
reality - Advanced termination/liveness tools now
supporting - Concurrency,
- Pointers,
- Heap,
- Recursion,
- Omega-regular properties,
- Counterexample-generation,
- etc
- Tools
- Terminator (currently being transferred into
Windows SDV product) - ARMC (Andreys publicly available version)
- Polyrank (from Bradley, Manna, Sipma)
- T2 (in development for my book and CMU course)
181Example
182Example
183Example
184Example
185Example
186Example
187Example
188Example
189Example
190Other examples
191Other examples
192Other examples
193Other examples
194Other examples
195Other examples
196Other examples
197(No Transcript)
198Introduction
- Advances in automatic verification and analysis
- Heap
- Concurrency
- Termination/liveness
- Impact on hardware synthesis verification
- Infinite-state abstractions often useful when
verifying large finite-state systems - More complex assumptions can be made about the
software running on hardware? - Opens doors to new strategies in hardware
synthesis? - Allows us to use general purpose software on
circuits, given preconditions expressed in
main(..) function - Properties proved (more easily!) of
infinite-state systems could be preserved during
compilation to finite-state
199Conclusion
- See research.microsoft.com/Terminator
- See also research.microsoft.com/SLAyer
- Write to bycook_at_microsoft.com
- Thank you for your attention