Modelling, Specification and Formal Analysis of Complex Software Systems
Precise Static Analysis of Programs with Dynamic Memory Mihaela Sighireanu
IRIF, University Paris Diderot & CNRS
VTSA 2015
1 / 149
Modelling, Specification and Formal Analysis of Complex Software - - PowerPoint PPT Presentation
Modelling, Specification and Formal Analysis of Complex Software Systems Precise Static Analysis of Programs with Dynamic Memory Mihaela Sighireanu IRIF, University Paris Diderot & CNRS VTSA 2015 1 / 149 Outline Introduction 1 Formal
1 / 149
99 / 149
100 / 149
101 / 149
102 / 149
102 / 149
103 / 149
104 / 149
105 / 149
106 / 149
107 / 149
108 / 149
109 / 149
110 / 149
110 / 149
110 / 149
110 / 149
110 / 149
110 / 149
111 / 149
112 / 149
113 / 149
114 / 149
114 / 149
114 / 149
114 / 149
115 / 149
116 / 149
116 / 149
116 / 149
116 / 149
class fun nesting
AM AU
Examples of summaries synthesized (loop,rec) t (s)
P
t (s) create (0,−) < 1 P=,P1 < 1 addfst – < 1 P= < 1 sll addlst (0,1) < 1 P= < 1 ρ#
U(create(&x,)) : hd(x) = 0∧len(x) = ∧∀y ∈ tl(x) ⇒ x[y] = 0
delfst – < 1 P= < 1 dellst (0,1) < 1 P= < 1 init(v) (0,1) < 1 P=,P1 < 1 ρ#
U(init(v,x)) : len(x0) = len(x)∧hd(x) = v∧∀y ∈ tl(x). x[y] = v
map initSeq (0,1) < 1 P=,P1 < 1 ρ#
U(add(v,x)) : len(x0) = len(x)∧hd(x) = hd(x0)+v∧
add(v) (0,1) < 1 P= < 1 ∀y1 ∈ tl(x),y2 ∈ tl(x0). y1 = y2 ⇒ x[y1] = x0[y2]+v map2 add(v) (0,1) < 1 P= < 1 ρ#
U(add(v,x,z)) : len(x0) = len(x)∧len(z0) = len(z)∧eq(x,x0)∧
copy (0,1) < 1 P= < 1 ∀y1 ∈ tl(x),y2 ∈ tl(z). y1 = y2 ⇒ x[y1]+v = z[y2] delPred (0,1) < 1 P=,P1 < 1 ρ#
M(split(v,x,&l,&u)) : ms(x) = ms(x0) = ms(l)∪ms(u)
fold max (0,1) < 1 P=,P1 < 1 ρ#
U(split(v,x,&l,&u)) : equal(x,x0)∧len(x) = len(l)+len(u)∧
clone (0,1) < 1 P= < 1 l[0] ≤ v∧∀y ∈ tl(l) ⇒ l[y] ≤ v∧ split (0,1) < 1 P=,P1 < 1 u[0] > v∧∀y ∈ tl(u) ⇒ u[y] > v equal (0,1) < 1 P= < 1 ρ#
M(merge(x,z,&r)) : ms(x)∪ms(z) = ms(r)∧ms(x0) = ms(x)∧...
fold2 concat (0,1) < 1 P=,P1,P2 < 3 ρ#
U(merge(x,z,&r)) : equal(x,x0)∧equal(z,z0)∧sorted(x0)∧sorted(z0)∧
merge (0,1) < 1 P=,P1,P2 < 3 sorted(r)∧len(x)+len(z) = len(r) bubble (1,−) < 1 P=,P1,P2 < 3 sort insert (1,−) < 1 P=,P1,P2 < 3 ρ#
M(quicksort(x)) : ms(x) = ms(x0) = ms(res)
quick (−,2) < 2 P=,P1,P2 < 4 ρ#
U(quicksort(x)) : equal(x,x0)∧sorted(res)
merge (−,2) < 2 P=,P1,P2 < 4 117 / 149
118 / 149
119 / 149
120 / 149
121 / 149
122 / 149
123 / 149
124 / 149
125 / 149
126 / 149
127 / 149
128 / 149
129 / 149
130 / 149
131 / 149
132 / 149
133 / 149
134 / 149
135 / 149
136 / 149
137 / 149
138 / 149
139 / 149
139 / 149
139 / 149
140 / 149
140 / 149
141 / 149
142 / 149
143 / 149
144 / 149
145 / 149
146 / 149
147 / 149
dl
2 ¡ 1 ¡ 0 ¡ 6 ¡ 4 ¡ 2 ¡ 2 ¡ 2 ¡ 4 ¡
148 / 149
149 / 149