Title: Proving program termination and liveness
1 Proving program termination and liveness Byron
Cook Cambridge theory mini-course October 19th,
2007 Lecture II of III
TexPoint fonts used in EMF. Read the TexPoint
manual before you delete this box. A
2Outline
- Foundations
- Checking termination
- Termination analysis
- Refinement synthesis
- Liveness
- Concurrency
3Outline
- Foundations
- Checking termination
- Termination analysis
- Refinement synthesis
- Liveness
- Concurrency
4Outline
- Foundations
- Checking termination
- Rank function synthesis
- Termination analysis
- Counterexamples refinement
- Liveness
- Concurrency
5Outline
- Foundations
- Checking termination
- Rank function synthesis
- Termination analysis
- Counterexamples refinement
- Liveness
- Concurrency
6Outline
- Foundations
- Checking termination
- Rank function synthesis
- Termination analysis
- Counterexamples refinement
- Liveness
- Concurrency
7Questions
8Questions
9Questions
10Outline
- Foundations
- Checking termination
- Rank function synthesis
- Termination analysis
- Counterexamples refinement
- Liveness
- Concurrency
11Outline
- Foundations
- Checking termination
- Rank function synthesis
- Termination analysis
- Counterexamples refinement
- Liveness
- Concurrency
12Rank function synthesis
-
- Question can we automatically synthesize fs if
we limit their form? - Linear ranking functions from linear convex
relations Yes, always! - Linear ranking functions from linear non-convex
relations Yes, sometimes.. - Linear ranking functions from non-linear convex
relations Yes, sometimes.. - ..
13Rank function synthesis
-
- Question can we automatically synthesize fs if
we limit their form? - Linear ranking functions from linear convex
relations Yes, always! - Linear ranking functions from linear non-convex
relations Yes, sometimes.. - Linear ranking functions from non-linear convex
relations Yes, sometimes.. - ..
14Rank function synthesis
15Rank function synthesis
16Rank function synthesis
17Rank function synthesis
18Rank function synthesis
19Rank function synthesis
20Rank function synthesis
21Rank function synthesis
22Rank function synthesis
23Rank function synthesis
24Rank function synthesis
25Rank function synthesis
26Rank function synthesis
27Rank function synthesis
28Rank function synthesis
29Rank function synthesis
30Rank function synthesis
31Rank function synthesis
32Rank function synthesis
33Rank function synthesis
34Rank function synthesis
35Rank function synthesis
36Rank function synthesis
37Rank function synthesis
38Rank function synthesis
39Rank function synthesis
40Rank function synthesis
41Rank function synthesis
42Rank function synthesis
43Rank function synthesis
44Rank function synthesis
45Rank function synthesis
46Rank function synthesis
47Rank function synthesis
48Rank function synthesis
49Rank function synthesis
50Rank function synthesis
51Rank function synthesis
52Rank function synthesis
53Rank function synthesis
54Rank function synthesis
55Rank function synthesis
56Rank function synthesis
57Rank function synthesis
58Rank function synthesis
59Rank function synthesis
- Question can we automatically synthesize fs if
we limit their form? - Linear ranking functions from linear convex
relations Yes, always! - Linear ranking functions from linear non-convex
relations Yes, sometimes - Linear ranking functions from non-linear convex
relations Yes, sometimes.. - Linear ranking functions with invariants from
convex relations Yes, always.. - Non-linear ranking functions from non-linear
convex relations Yes, sometimes.. - ..
60Rank function synthesis
- Question can we automatically synthesize fs if
we limit their form? - Linear ranking functions from linear convex
relations Yes, always! - Linear ranking functions from linear non-convex
relations Yes, sometimes - Linear ranking functions from non-linear convex
relations Yes, sometimes.. - Linear ranking functions with invariants from
convex relations Yes, always.. - Non-linear ranking functions from non-linear
convex relations Yes, sometimes.. - ..
61Rank function synthesis
x x 1
assume(xgt0)
assume(xz)
assume(wgt0)
y 33 z
x x 1
x x 1
r r e
x x 1
assume(xgt0)
assume(rtrue)
y y 1
x x 1
w w - x
w 5 w
assume(wgtz)
z -z
x x 1
y 100
assume(k2gt0)
assume(glt100)
assume(tlt0)
assume(ggt0)
w w k
w g g
x x 1
x x 1
z w
p p3
k k / 3
y 3 y
62Rank function synthesis
x x 1
assume(xgt0)
assume(xz)
assume(wgt0)
y 33 z
x x 1
x x 1
r r e
x x 1
assume(xgt0)
assume(rtrue)
y y 1
x x 1
w w - x
w 5 w
assume(wgtz)
z -z
x x 1
y 100
assume(k2gt0)
assume(glt100)
assume(tlt0)
assume(ggt0)
w w k
w g g
x x 1
x x 1
z w
p p3
k k / 3
y 3 y
63Rank function synthesis
x x 1
assume(xgt0)
assume(xz)
assume(wgt0)
y 33 z
x x 1
x x 1
r r e
x x 1
assume(xgt0)
assume(rtrue)
y y 1
x x 1
w w - x
w 5 w
assume(wgtz)
z -z
x x 1
y 100
assume(k2gt0)
assume(glt100)
assume(tlt0)
assume(ggt0)
w w k
w g g
x x 1
x x 1
z w
p p3
k k / 3
y 3 y
64Rank function synthesis
x x 1
assume(xgt0)
assume(xz)
assume(wgt0)
y 33 z
x x 1
x x 1
r r e
x x 1
assume(xgt0)
assume(rtrue)
y y 1
x x 1
w w - x
w 5 w
assume(wgtz)
z -z
x x 1
y 100
assume(k2gt0)
assume(glt100)
assume(tlt0)
assume(ggt0)
w w k
w g g
x x 1
x x 1
z w
p p3
k k / 3
y 3 y
65Outline
- Foundations
- Checking termination
- Rank function synthesis
- Termination analysis
- Counterexamples refinement
- Liveness
- Concurrency
66Outline
- Foundations
- Checking termination
- Rank function synthesis
- Termination analysis
- Counterexamples refinement
- Liveness
- Concurrency
67Termination analysis
- Program analysis vs. automatic program
verification - Automatic program verifiers attempt to
prove/falsify a single given property or die
trying! - Examples SLAM, ESC/Java, Boogie, Murf, Zing,
SPIN, Java Pathfinder, F-Soft, BLAST, etc. - Program invariance analyses prove what they want
to prove, but many location-specific lemmas at
once - Examples Astree, x86/Codesurfer, Sting, OctAnal,
SLAyer, TVLA, etc.
68Termination analysis
69Termination analysis
70Termination analysis
71Termination analysis
72Termination analysis
73Termination analysis
74Termination analysis
75Termination analysis
76Termination analysis
77Termination analysis
- Program analysis vs. automatic program
verification - Automatic program verifiers attempt to
prove/falsify a single given property or die
trying! - Examples SLAM, ESC/Java, Boogie, Murf, Zing,
SPIN, Java Pathfinder, F-Soft, BLAST, etc. - Program invariance analyses prove what they want
to prove, but many location-specific lemmas at
once - Examples Astree, x86/Codesurfer, Sting, OctAnal,
SLAyer, TVLA, etc.
78Termination analysis
- Program analysis vs. automatic program
verification - Automatic program verifiers attempt to
prove/falsify a single given property or die
trying! - Examples SLAM, ESC/Java, Boogie, Murf, Zing,
SPIN, Java Pathfinder, F-Soft, BLAST, etc. - Program invariance analyses prove what they want
to prove, but many location-specific lemmas at
once - Examples Astree, x86/Codesurfer, Sting, OctAnal,
SLAyer, TVLA, etc.
79Termination analysis
- A variance assertion is a transition predicate
that holds between any state at location n and
any previous state also at location n - An isolated variance assertion is a transition
predicate that holds between any state at
location n and any previous state also at
location n such that execution does not leave the
enclosing loop. - A variance analysis produces variance assertions
for each location in a program
80Variance analyses
81Variance analyses
82Variance analyses
83Variance analyses
84Variance analyses
85Variance analyses
86Variance analyses
87Variance analyses
88Variance analyses
89Variance analyses
90Variance analyses
91Variance analyses
92Variance analyses
93Variance analyses
94Variance analyses
95Variance analyses
- Variance assertions/analyses are a relatively
modern invention - POPL07
- CAV06
- State of the art will (I expect) improve
significantly - Today
- How to make variance analyses from invariance
analyses - Some words on a native variance analysis
96Variance analyses from invariance analyses
97Variance analyses from invariance analyses
98Variance analyses from invariance analyses
99Variance analyses from invariance analyses
100Variance analyses from invariance analyses
101Variance analyses from invariance analyses
102Variance analyses from invariance analyses
103Variance analyses from invariance analyses
104Variance analyses from invariance analyses
105Variance analyses from invariance analyses
106Variance analyses from invariance analyses
107Variance analyses from invariance analyses
108Proving termination with variance assertions
109Proving termination with variance assertions
110Proving termination with variance assertions
111Proving termination with variance assertions
112Numerical domains
113Numerical domains
114Numerical domains
115Numerical domains
116Numerical domains
117Numerical domains
118Numerical domains
119Numerical domains
120Numerical domains
121Separation domain
122Separation domain
123Separation domain
124Separation domain
125Separation domain
126Separation domain
127Separation domain
128Complete example
129Complete example
130Complete example
131Complete example
132Complete example
133Complete example
134Complete example
135Complete example
136Complete example
137Complete example
138Complete example
139Complete example
140Complete example
141Big problem
142Complete example
143Complete example
144Complete example
145Complete example
146Complete example
147Variance analyses
- Variance assertions/analyses are a relatively
modern invention - POPL07
- CAV06
- State of the art will (I expect) improve
significantly - Today
- How to make variance analyses from invariance
analyses - Some words on native variance analysis
148Variance analyses
149Outline
- Foundations
- Checking termination
- Rank function synthesis
- Termination analysis
- Counterexamples refinement
- Liveness
- Concurrency
150Outline
- Foundations
- Checking termination
- Rank function synthesis
- Termination analysis
- Counterexamples refinement
- Liveness
- Concurrency
151Outline
- Foundations
- Checking termination
- Rank function synthesis
- Termination analysis
- Counterexamples refinement
- Liveness
- Concurrency