75
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
1 |
\documentclass[dvipsnames,14pt,t]{beamer}
|
331
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
2 |
\usepackage{../slides}
|
332
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
3 |
\usepackage{../langs}
|
331
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
4 |
\usepackage{../graphics}
|
332
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
5 |
\usepackage{../grammar}
|
337
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
6 |
\usepackage{soul}
|
75
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
7 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
8 |
% beamer stuff
|
381
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
9 |
\renewcommand{\slidecaption}{SEN 09, King's College London}
|
75
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
10 |
\newcommand{\bl}[1]{\textcolor{blue}{#1}}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
11 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
12 |
\begin{document}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
13 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
14 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
331
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
15 |
\begin{frame}[t]
|
75
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
16 |
\frametitle{%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
17 |
\begin{tabular}{@ {}c@ {}}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
18 |
\\
|
381
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
19 |
\LARGE Security Engineering (9)\\[-3mm]
|
75
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
20 |
\end{tabular}}\bigskip\bigskip\bigskip
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
21 |
|
146
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
22 |
\normalsize
|
75
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
23 |
\begin{center}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
24 |
\begin{tabular}{ll}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
25 |
Email: & christian.urban at kcl.ac.uk\\
|
518
|
26 |
Office: & N7.07 (North Wing, Bush House)\\
|
75
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
27 |
Slides: & KEATS (also homework is there)\\
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
28 |
\end{tabular}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
29 |
\end{center}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
30 |
|
331
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
31 |
\end{frame}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
32 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
33 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
34 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
35 |
\begin{frame}[c]
|
75
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
36 |
|
331
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
37 |
\begin{center}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
38 |
\includegraphics[scale=0.6]{../pics/bridge-limits.png}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
39 |
\end{center}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
40 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
41 |
\end{frame}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
42 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
147
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
43 |
|
331
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
44 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
45 |
\begin{frame}[c]
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
46 |
\frametitle{Old-Fashioned Eng.~vs.~CS}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
47 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
48 |
\begin{center}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
49 |
\begin{tabular}{@{}cc@{}}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
50 |
\begin{tabular}{@{}p{5.2cm}}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
51 |
\includegraphics[scale=0.058]{../pics/towerbridge.jpg}\\
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
52 |
{\bf bridges}: \\
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
53 |
\raggedright\small
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
54 |
engineers can ``look'' at a bridge and have a pretty good
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
55 |
intuition about whether it will hold up or not\\
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
56 |
(redundancy; predictive theory)
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
57 |
\end{tabular} &
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
58 |
\begin{tabular}{p{5cm}}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
59 |
\includegraphics[scale=0.265]{../pics/code.jpg}\\
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
60 |
\raggedright
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
61 |
{\bf code}: \\
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
62 |
\raggedright\small
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
63 |
programmers have very little intuition about their code;
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
64 |
often it is too expensive to have redundancy;
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
65 |
not ``continuous''
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
66 |
\end{tabular}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
67 |
\end{tabular}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
68 |
\end{center}
|
147
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
69 |
|
331
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
70 |
\end{frame}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
71 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
72 |
|
147
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
73 |
|
331
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
74 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
433
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
75 |
\begin{frame}[c]
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
76 |
\frametitle{Trusting Computing Base}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
77 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
78 |
When considering whether a system meets some security
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
79 |
objectives, it is important to consider which parts of that
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
80 |
system are trusted in order to meet that objective (TCB).
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
81 |
\bigskip\pause
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
82 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
83 |
The smaller the TCB, the less effort it takes to get
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
84 |
some confidence that it is trustworthy, by doing a code
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
85 |
review or by performing some (penetration) testing.
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
86 |
\bigskip
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
87 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
88 |
\footnotesize
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
89 |
CPU, compiler, libraries, OS, NP $\not=$ P,
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
90 |
random number generator, \ldots
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
91 |
\end{frame}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
92 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
93 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
94 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
95 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
331
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
96 |
\begin{frame}[c]
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
97 |
\frametitle{Dijkstra on Testing}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
98 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
99 |
\begin{bubble}[10cm]
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
100 |
``Program testing can be a very effective way to show the
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
101 |
presence of bugs, but it is hopelessly inadequate for showing
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
102 |
their absence.''
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
103 |
\end{bubble}\bigskip
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
104 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
105 |
unfortunately attackers exploit bugs (Satan's computer vs
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
106 |
Murphy's)
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
107 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
108 |
\end{frame}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
109 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
147
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
110 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
111 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
112 |
\begin{frame}[c]
|
331
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
113 |
\frametitle{\Large Proving Programs to be Correct}
|
147
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
114 |
|
331
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
115 |
\begin{bubble}[10cm]
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
116 |
\small
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
117 |
{\bf Theorem:} There are infinitely many prime
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
118 |
numbers.\medskip\\
|
147
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
119 |
|
331
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
120 |
{\bf Proof} \ldots\\
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
121 |
\end{bubble}\bigskip
|
147
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
122 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
123 |
|
331
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
124 |
similarly\bigskip
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
125 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
126 |
\begin{bubble}[10cm]
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
127 |
\small
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
128 |
{\bf Theorem:} The program is doing what
|
433
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
129 |
it is supposed to be doing.\medskip
|
147
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
130 |
|
331
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
131 |
{\bf Long, long proof} \ldots\\
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
132 |
\end{bubble}\bigskip\medskip
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
133 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
134 |
\small This can be a gigantic proof. The only hope is to have
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
135 |
help from the computer. `Program' is here to be understood to be
|
433
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
136 |
quite general (protocols, OS, \ldots).
|
331
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
137 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
138 |
\end{frame}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
139 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
147
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
140 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
141 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
331
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
142 |
\begin{frame}[c]
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
143 |
\frametitle{\Large{}Mars Pathfinder Mission 1997}
|
147
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
144 |
|
331
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
145 |
\begin{center}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
146 |
\includegraphics[scale=0.15]{../pics/marspath1.png}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
147 |
\includegraphics[scale=0.16]{../pics/marspath3.png}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
148 |
\includegraphics[scale=0.3]{../pics/marsrover.png}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
149 |
\end{center}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
150 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
151 |
\begin{itemize}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
152 |
\item despite NASA's famous testing procedures, the lander crashed frequently on Mars
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
153 |
\item a scheduling algorithm was not used in the OS
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
154 |
\end{itemize}
|
147
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
155 |
|
331
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
156 |
\end{frame}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
157 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
75
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
158 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
159 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
331
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
160 |
\begin{frame}[c]
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
161 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
162 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
163 |
\begin{textblock}{11}(1,3)
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
164 |
\begin{tabular}{@{\hspace{-10mm}}l}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
165 |
\begin{tikzpicture}[scale=1.1]
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
166 |
\node at (-2.5,-1.5) {\textcolor{white}{a}};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
167 |
\node at (8,4) {\textcolor{white}{a}};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
168 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
169 |
|
146
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
170 |
|
331
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
171 |
\only<1>{
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
172 |
\draw[fill, blue!50] (1,0) rectangle (3,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
173 |
}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
174 |
\only<2>{
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
175 |
\draw[fill, blue!50] (1,0) rectangle (2,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
176 |
\draw[fill, blue!50] (3,0) rectangle (5,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
177 |
\draw[fill, blue!100] (2,3) rectangle (3,3.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
178 |
}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
179 |
\only<3>{
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
180 |
\draw[fill, blue!50] (1,0) rectangle (2,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
181 |
\draw[fill, blue!50] (3,0) rectangle (4.5,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
182 |
\draw[fill, blue!50] (5.5,0) rectangle (6,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
183 |
\draw[fill, blue!100] (2,3) rectangle (3,3.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
184 |
\draw[fill, blue!100] (4.5,3) rectangle (5.5,3.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
185 |
}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
186 |
\only<4>{
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
187 |
\node at (2.5,0.9) {\small locked a resource};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
188 |
\draw[fill, blue!50] (1,0) rectangle (2,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
189 |
\draw[blue!50, very thick] (2,0) rectangle (4,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
190 |
\draw[blue!100, very thick] (2,3) rectangle (3, 3.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
191 |
\draw[red, <-, line width = 2mm] (2,-0.1) -- (2, -1);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
192 |
}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
193 |
\only<5>{
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
194 |
\node at (2.5,0.9) {\small locked a resource};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
195 |
\draw[fill, blue!50] (1,0) rectangle (4,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
196 |
\draw[blue!100, fill] (4,3) rectangle (5, 3.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
197 |
}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
198 |
\only<6>{
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
199 |
\node at (2.5,0.9) {\small locked a resource};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
200 |
\draw[fill, blue!50] (1,0) rectangle (2,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
201 |
\draw[blue!50, very thick] (2,0) rectangle (4,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
202 |
\draw[blue!100, very thick] (2,3) rectangle (3, 3.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
203 |
\draw[red, <-, line width = 2mm] (2,-0.1) -- (2, -1);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
204 |
}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
205 |
\only<7>{
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
206 |
\node at (2.5,0.9) {\small locked a resource};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
207 |
\draw[fill, blue!50] (1,0) rectangle (2.5,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
208 |
\draw[blue!50, very thick] (2.5,0) rectangle (4,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
209 |
\draw[blue!100, very thick] (2.5,3) rectangle (3.5, 3.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
210 |
\draw[red, <-, line width = 2mm] (2.5,-0.1) -- (2.5, -1);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
211 |
}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
212 |
\only<8>{
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
213 |
\node at (2.5,0.9) {\small locked a resource};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
214 |
\draw[fill, blue!50] (1,0) rectangle (2.5,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
215 |
\draw[blue!50, very thick] (2.5,0) rectangle (4,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
216 |
\draw[blue!100, very thick] (2.5,3) rectangle (3.5, 3.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
217 |
\draw[blue!100, very thick] (2.5,3) rectangle (3.5, 3.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
218 |
\draw[red, fill] (2.5,1.5) rectangle (3.5,2.1);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
219 |
\draw[red, <-, line width = 2mm] (2.5,-0.1) -- (2.5, -1);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
220 |
}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
221 |
\only<9>{
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
222 |
\node at (2.5,0.9) {\small locked a resource};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
223 |
\draw[fill, blue!50] (1,0) rectangle (2.5,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
224 |
\draw[blue!50, very thick] (3.5,0) rectangle (5,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
225 |
\draw[blue!100, very thick] (3.5,3) rectangle (4.5, 3.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
226 |
\draw[red, fill] (2.5,1.5) rectangle (3.5,2.1);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
227 |
\draw[red, <-, line width = 2mm] (3.5,-0.1) -- (3.5, -1);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
228 |
}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
229 |
\only<10>{
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
230 |
\node at (2.5,0.9) {\small locked a resource};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
231 |
\draw[fill, blue!50] (1,0) rectangle (2.5,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
232 |
\draw[blue!50, very thick] (3.5,0) rectangle (5,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
233 |
\draw[blue!100, very thick] (3.5,3) rectangle (4.5, 3.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
234 |
\draw[red, fill] (2.5,1.5) rectangle (3.5,2.1);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
235 |
\draw[red, fill] (3.55,1.5) rectangle (4.5,2.1);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
236 |
\draw[red, <-, line width = 2mm] (3.5,-0.1) -- (3.5, -1);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
237 |
}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
238 |
\only<11>{
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
239 |
\node at (2.5,0.9) {\small locked a resource};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
240 |
\draw[fill, blue!50] (1,0) rectangle (2.5,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
241 |
\draw[blue!50, very thick] (4.5,0) rectangle (6,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
242 |
\draw[blue!100, very thick] (4.5,3) rectangle (5.5, 3.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
243 |
\draw[red, fill] (2.5,1.5) rectangle (3.5,2.1);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
244 |
\draw[red, fill] (3.55,1.5) rectangle (4.5,2.1);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
245 |
\draw[red, <-, line width = 2mm] (4.5,-0.1) -- (4.5, -1);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
246 |
}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
247 |
\only<12>{
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
248 |
\node at (2.5,0.9) {\small locked a resource};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
249 |
\draw[fill, blue!50] (1,0) rectangle (2.5,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
250 |
\draw[blue!50, very thick] (5.5,0) rectangle (7,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
251 |
\draw[blue!100, very thick] (5.5,3) rectangle (6.5, 3.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
252 |
\draw[red, fill] (2.5,1.5) rectangle (3.5,2.1);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
253 |
\draw[red, fill] (3.55,1.5) rectangle (4.5,2.1);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
254 |
\draw[red, fill] (4.55,1.5) rectangle (5.5,2.1);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
255 |
\draw[red, <-, line width = 2mm] (5.5,-0.1) -- (5.5, -1);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
256 |
\node [anchor=base] at (6.3, 1.8) {\Large\ldots};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
257 |
}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
258 |
\only<13>{
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
259 |
\node at (2.5,0.9) {\small locked a resource};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
260 |
\draw[fill, blue!50] (1,0) rectangle (2,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
261 |
\draw[blue!50, very thick] (2,0) rectangle (4,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
262 |
\draw[blue!100, very thick] (2,3) rectangle (3, 3.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
263 |
\draw[red, <-, line width = 2mm] (2,-0.1) -- (2, -1);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
264 |
}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
265 |
\only<14>{
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
266 |
\node at (2.5,3.9) {\small locked a resource};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
267 |
\draw[fill, blue!50] (1,0) rectangle (2,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
268 |
\draw[blue!50, fill] (2,3) rectangle (4,3.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
269 |
\draw[blue!100, very thick] (4,3) rectangle (5, 3.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
270 |
\draw[blue!50, ->, line width = 2mm] (2,1) -- (2, 2.5);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
271 |
\draw[red, <-, line width = 2mm] (2,-0.1) -- (2, -1);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
272 |
}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
273 |
\only<15>{
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
274 |
\node at (2.5,3.9) {\small locked a resource};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
275 |
\draw[fill, blue!50] (1,0) rectangle (2,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
276 |
\draw[blue!50, fill] (2,3) rectangle (4,3.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
277 |
\draw[blue!100, very thick] (4,3) rectangle (5, 3.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
278 |
\draw[red, <-, line width = 2mm] (2.5,-0.1) -- (2.5, -1);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
279 |
\draw[red, very thick] (2.5,1.5) rectangle (3.5,2.1);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
280 |
}
|
83
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
281 |
|
331
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
282 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
283 |
\draw[very thick,->](0,0) -- (8,0);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
284 |
\node [anchor=base] at (8, -0.3) {\scriptsize time};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
285 |
\node [anchor=base] at (0, -0.3) {\scriptsize 0};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
286 |
\node [anchor=base] at (-1.2, 0.2) {\small low priority};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
287 |
\only<2->{\node [anchor=base] at (-1.2, 3.2) {\small high priority};}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
288 |
\only<8->{\node [anchor=base] at (-1.5, 1.7) {\small medium pr.};}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
289 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
290 |
\end{tikzpicture}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
291 |
\end{tabular}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
292 |
\end{textblock}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
293 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
294 |
\begin{textblock}{0}(2.5,13)%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
295 |
\small
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
296 |
\onslide<3->{
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
297 |
\begin{bubble}[8cm]%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
298 |
Scheduling: You want to avoid that a high
|
434
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
299 |
priority process is starved indefinitely.
|
331
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
300 |
\end{bubble}}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
301 |
\end{textblock}
|
146
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
302 |
|
331
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
303 |
\end{frame}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
304 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
305 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
306 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
307 |
\begin{frame}[c]
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
308 |
\frametitle{\Large Priority Inheritance Scheduling}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
309 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
310 |
\begin{itemize}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
311 |
\item Let a low priority process $L$ temporarily inherit
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
312 |
the high priority of $H$ until $L$ leaves the critical
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
313 |
section unlocking the resource.\bigskip
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
314 |
\item Once the resource is unlocked $L$ returns to its original
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
315 |
priority level.
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
316 |
\end{itemize}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
317 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
318 |
\end{frame}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
319 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
320 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
321 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
322 |
\begin{frame}[c]
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
323 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
324 |
\begin{textblock}{11}(1,3)
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
325 |
\begin{tabular}{@{\hspace{-10mm}}l}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
326 |
\begin{tikzpicture}[scale=1.1]
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
327 |
\node at (-2.5,-1.5) {\textcolor{white}{a}};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
328 |
\node at (8,4) {\textcolor{white}{a}};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
329 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
330 |
\only<1>{
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
331 |
\draw[fill, blue!50] (1,0) rectangle (6,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
332 |
\node at (1.5,0.9) {\small $A_L$};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
333 |
\node at (2.0,0.9) {\small $B_L$};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
334 |
\node at (3.5,0.9) {\small $A_R$};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
335 |
\node at (5.7,0.9) {\small $B_R$};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
336 |
\draw[very thick,blue!100] (1.5,0) -- (1.5,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
337 |
\draw[very thick,blue!100] (2.0,0) -- (2.0,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
338 |
\draw[very thick,blue!100] (3.5,0) -- (3.5,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
339 |
\draw[very thick,blue!100] (5.7,0) -- (5.7,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
340 |
}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
341 |
\only<2>{
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
342 |
\draw[fill, blue!50] (1,0) rectangle (3,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
343 |
\draw[very thick, blue!50] (3,0) rectangle (6,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
344 |
\node at (1.5,0.9) {\small $A_L$};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
345 |
\node at (2.0,0.9) {\small $B_L$};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
346 |
\node at (3.5,0.9) {\small $A_R$};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
347 |
\node at (5.7,0.9) {\small $B_R$};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
348 |
\draw[very thick,blue!100] (1.5,0) -- (1.5,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
349 |
\draw[very thick,blue!100] (2.0,0) -- (2.0,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
350 |
\draw[very thick,blue!100] (3.5,0) -- (3.5,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
351 |
\draw[very thick,blue!100] (5.7,0) -- (5.7,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
352 |
}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
353 |
\only<3>{
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
354 |
\draw[fill, blue!50] (1,0) rectangle (3,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
355 |
\draw[very thick, blue!50] (3,0) rectangle (6,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
356 |
\node at (1.5,0.9) {\small $A_L$};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
357 |
\node at (2.0,0.9) {\small $B_L$};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
358 |
\node at (3.5,0.9) {\small $A_R$};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
359 |
\node at (5.7,0.9) {\small $B_R$};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
360 |
\draw[very thick,blue!100] (1.5,0) -- (1.5,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
361 |
\draw[very thick,blue!100] (2.0,0) -- (2.0,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
362 |
\draw[very thick,blue!100] (3.5,0) -- (3.5,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
363 |
\draw[very thick,blue!100] (5.7,0) -- (5.7,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
364 |
\draw[very thick,blue!100] (3,3) rectangle (4,3.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
365 |
\node at (3.5,3.3) {\small $A$};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
366 |
}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
367 |
\only<4>{
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
368 |
\draw[fill, blue!50] (1,0) rectangle (3,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
369 |
\draw[very thick, blue!50] (3,0) rectangle (6,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
370 |
\node at (1.5,0.9) {\small $A_L$};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
371 |
\node at (2.0,0.9) {\small $B_L$};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
372 |
\node at (3.5,0.9) {\small $A_R$};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
373 |
\node at (5.7,0.9) {\small $B_R$};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
374 |
\draw[very thick,blue!100] (1.5,0) -- (1.5,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
375 |
\draw[very thick,blue!100] (2.0,0) -- (2.0,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
376 |
\draw[very thick,blue!100] (3.5,0) -- (3.5,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
377 |
\draw[very thick,blue!100] (5.7,0) -- (5.7,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
378 |
\draw[very thick,blue!100] (3,3) rectangle (4,3.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
379 |
\node at (3.5,3.3) {\small $A$};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
380 |
\draw[very thick,blue!100] (4,3) rectangle (5,3.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
381 |
\node at (4.5,3.3) {\small $B$};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
382 |
}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
383 |
\only<5>{
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
384 |
\draw[fill, blue!50] (1,0) rectangle (3,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
385 |
\draw[very thick, blue!50] (3,3) rectangle (6,3.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
386 |
\node at (1.5,0.9) {\small $A_L$};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
387 |
\node at (2.0,0.9) {\small $B_L$};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
388 |
\node at (3.5,3.9) {\small $A_R$};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
389 |
\node at (5.7,3.9) {\small $B_R$};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
390 |
\draw[very thick,blue!100] (1.5,0) -- (1.5,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
391 |
\draw[very thick,blue!100] (2.0,0) -- (2.0,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
392 |
\draw[very thick,blue!100] (3.5,3) -- (3.5,3.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
393 |
\draw[very thick,blue!100] (5.7,3) -- (5.7,3.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
394 |
\draw[very thick,blue!100] (6,3) rectangle (7,3.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
395 |
\node at (6.5,3.3) {\small $A$};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
396 |
\draw[very thick,blue!100] (7,3) rectangle (8,3.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
397 |
\node at (7.5,3.3) {\small $B$};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
398 |
\draw[blue!50, ->, line width = 2mm] (3,1) -- (3, 2.5);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
399 |
}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
400 |
\only<6>{
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
401 |
\draw[fill, blue!50] (1,0) rectangle (3,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
402 |
\draw[fill, blue!50] (3,3) rectangle (3.5,3.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
403 |
\draw[very thick, blue!50] (3.5,3) rectangle (6,3.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
404 |
\node at (1.5,0.9) {\small $A_L$};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
405 |
\node at (2.0,0.9) {\small $B_L$};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
406 |
\node at (3.5,3.9) {\small $A_R$};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
407 |
\node at (5.7,3.9) {\small $B_R$};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
408 |
\draw[very thick,blue!100] (1.5,0) -- (1.5,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
409 |
\draw[very thick,blue!100] (2.0,0) -- (2.0,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
410 |
\draw[very thick,blue!100] (3.5,3) -- (3.5,3.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
411 |
\draw[very thick,blue!100] (5.7,3) -- (5.7,3.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
412 |
\draw[very thick,blue!100] (6,3) rectangle (7,3.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
413 |
\node at (6.5,3.3) {\small $A$};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
414 |
\draw[very thick,blue!100] (7,3) rectangle (8,3.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
415 |
\node at (7.5,3.3) {\small $B$};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
416 |
}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
417 |
\only<7>{
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
418 |
\draw[fill, blue!50] (1,0) rectangle (3,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
419 |
\draw[fill, blue!50] (3,3) rectangle (3.5,3.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
420 |
\draw[very thick, blue!50] (3.5,0) rectangle (6,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
421 |
\node at (1.5,0.9) {\small $A_L$};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
422 |
\node at (2.0,0.9) {\small $B_L$};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
423 |
\node at (3.5,3.9) {\small $A_R$};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
424 |
\node at (5.7,0.9) {\small $B_R$};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
425 |
\draw[very thick,blue!100] (1.5,0) -- (1.5,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
426 |
\draw[very thick,blue!100] (2.0,0) -- (2.0,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
427 |
\draw[very thick,blue!100] (3.5,3) -- (3.5,3.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
428 |
\draw[very thick,blue!100] (5.7,0) -- (5.7,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
429 |
\draw[very thick,blue!100] (6,3) rectangle (7,3.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
430 |
\node at (6.5,3.3) {\small $A$};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
431 |
\draw[very thick,blue!100] (7,3) rectangle (8,3.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
432 |
\node at (7.5,3.3) {\small $B$};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
433 |
\draw[blue!50, <-, line width = 2mm] (3.5,1) -- (3.5, 2.5);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
434 |
\draw[blue!50, <-, line width = 2mm] (4,3.3) -- (5.5,3.3);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
435 |
}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
436 |
\only<8>{
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
437 |
\draw[fill, blue!50] (1,0) rectangle (3,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
438 |
\draw[fill, blue!50] (3,3) rectangle (3.5,3.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
439 |
\draw[very thick, blue!50] (4.5,0) rectangle (7,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
440 |
\node at (1.5,0.9) {\small $A_L$};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
441 |
\node at (2.0,0.9) {\small $B_L$};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
442 |
\node at (3.5,3.9) {\small $A_R$};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
443 |
\node at (6.7,0.9) {\small $B_R$};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
444 |
\draw[very thick,blue!100] (1.5,0) -- (1.5,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
445 |
\draw[very thick,blue!100] (2.0,0) -- (2.0,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
446 |
\draw[very thick,blue!100] (3.5,3) -- (3.5,3.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
447 |
\draw[very thick,blue!100] (6.7,0) -- (6.7,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
448 |
\draw[fill,blue!100] (3.5,3) rectangle (4.5,3.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
449 |
\node at (4,3.3) {\small $A$};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
450 |
\draw[very thick,blue!100] (7,3) rectangle (8,3.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
451 |
\node at (7.5,3.3) {\small $B$};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
452 |
}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
453 |
\only<9>{
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
454 |
\draw[fill, blue!50] (1,0) rectangle (3,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
455 |
\draw[fill, blue!50] (3,3) rectangle (3.5,3.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
456 |
\draw[fill, blue!50] (4.5,0) rectangle (5,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
457 |
\draw[very thick, blue!50] (5,0) rectangle (7,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
458 |
\node at (1.5,0.9) {\small $A_L$};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
459 |
\node at (2.0,0.9) {\small $B_L$};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
460 |
\node at (3.5,3.9) {\small $A_R$};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
461 |
\node at (6.7,0.9) {\small $B_R$};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
462 |
\draw[very thick,blue!100] (1.5,0) -- (1.5,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
463 |
\draw[very thick,blue!100] (2.0,0) -- (2.0,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
464 |
\draw[very thick,blue!100] (3.5,3) -- (3.5,3.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
465 |
\draw[very thick,blue!100] (6.7,0) -- (6.7,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
466 |
\draw[fill,blue!100] (3.5,3) rectangle (4.5,3.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
467 |
\node at (4,3.3) {\small $A$};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
468 |
\draw[very thick,blue!100] (7,3) rectangle (8,3.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
469 |
\node at (7.5,3.3) {\small $B$};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
470 |
}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
471 |
\only<10>{
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
472 |
\draw[fill, blue!50] (1,0) rectangle (3,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
473 |
\draw[fill, blue!50] (3,3) rectangle (3.5,3.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
474 |
\draw[fill, blue!50] (4.5,0) rectangle (5,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
475 |
\draw[very thick, blue!50] (5,0) rectangle (7,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
476 |
\node at (1.5,0.9) {\small $A_L$};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
477 |
\node at (2.0,0.9) {\small $B_L$};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
478 |
\node at (3.5,3.9) {\small $A_R$};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
479 |
\node at (6.7,0.9) {\small $B_R$};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
480 |
\draw[very thick,blue!100] (1.5,0) -- (1.5,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
481 |
\draw[very thick,blue!100] (2.0,0) -- (2.0,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
482 |
\draw[very thick,blue!100] (3.5,3) -- (3.5,3.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
483 |
\draw[very thick,blue!100] (6.7,0) -- (6.7,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
484 |
\draw[fill,blue!100] (3.5,3) rectangle (4.5,3.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
485 |
\node at (4,3.3) {\small $A$};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
486 |
\draw[very thick,blue!100] (7,3) rectangle (8,3.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
487 |
\node at (7.5,3.3) {\small $B$};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
488 |
\draw[red, fill] (5,1.5) rectangle (6,2.1);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
489 |
\draw[red, fill] (6.05,1.5) rectangle (7,2.1);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
490 |
}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
491 |
\only<11>{
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
492 |
\draw[fill, blue!50] (1,0) rectangle (3,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
493 |
\draw[fill, blue!50] (3,3) rectangle (3.5,3.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
494 |
\draw[fill, blue!50] (4.5,0) rectangle (5,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
495 |
\draw[very thick, blue!50] (5,0) rectangle (7,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
496 |
\node at (1.5,0.9) {\small $A_L$};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
497 |
\node at (2.0,0.9) {\small $B_L$};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
498 |
\node at (3.5,3.9) {\small $A_R$};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
499 |
\node at (6.7,0.9) {\small $B_R$};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
500 |
\draw[very thick,blue!100] (1.5,0) -- (1.5,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
501 |
\draw[very thick,blue!100] (2.0,0) -- (2.0,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
502 |
\draw[very thick,blue!100] (3.5,3) -- (3.5,3.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
503 |
\draw[very thick,blue!100] (6.7,0) -- (6.7,0.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
504 |
\draw[fill,blue!100] (3.5,3) rectangle (4.5,3.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
505 |
\node at (4,3.3) {\small $A$};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
506 |
\draw[very thick,blue!100] (7,3) rectangle (8,3.6);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
507 |
\node at (7.5,3.3) {\small $B$};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
508 |
\draw[red, fill] (5,1.5) rectangle (6,2.1);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
509 |
\draw[red, fill] (6.05,1.5) rectangle (7,2.1);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
510 |
\draw[blue!50, ->, line width = 2mm] (7.1,0.4) -- (8, 0.4);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
511 |
\draw[blue!50, ->, line width = 2mm] (7.1,4) -- (8,4);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
512 |
}
|
76
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
513 |
|
331
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
514 |
\draw[very thick,->](0,0) -- (8,0);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
515 |
\node [anchor=base] at (8, -0.3) {\scriptsize time};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
516 |
\node [anchor=base] at (0, -0.3) {\scriptsize 0};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
517 |
\node [anchor=base] at (-1.2, 0.2) {\small low priority};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
518 |
\only<2->{\node [anchor=base] at (-1.2, 3.2) {\small high priority};}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
519 |
\only<10->{\node [anchor=base] at (-1.5, 1.7) {\small medium pr.};}
|
146
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
520 |
|
331
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
521 |
\end{tikzpicture}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
522 |
\end{tabular}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
523 |
\end{textblock}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
524 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
525 |
\begin{textblock}{0}(2.5,13)%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
526 |
\small
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
527 |
\onslide<11>{
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
528 |
\begin{bubble}[8cm]%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
529 |
Scheduling: You want to avoid that a high
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
530 |
priority process is staved indefinitely.
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
531 |
\end{bubble}}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
532 |
\end{textblock}
|
79
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
533 |
|
146
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
534 |
|
331
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
535 |
\end{frame}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
536 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
537 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
538 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
539 |
\begin{frame}[c]
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
540 |
\frametitle{\Large Priority Inheritance Scheduling}
|
146
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
541 |
|
331
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
542 |
\begin{itemize}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
543 |
\item Let a low priority process $L$ temporarily inherit
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
544 |
the high priority of $H$ until $L$ leaves the critical
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
545 |
section unlocking the resource.\bigskip
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
546 |
\item Once the resource is unlocked $L$ returns to its original
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
547 |
priority level. \alert{\bf BOGUS}\pause\bigskip
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
548 |
\item \ldots $L$ needs to switch to the highest
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
549 |
\alert{remaining} priority of the threads that it blocks.
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
550 |
\end{itemize}\bigskip
|
76
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
551 |
|
331
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
552 |
\small this error is already known since around 1999
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
553 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
554 |
\end{frame}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
555 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
76
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
556 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
557 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
331
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
558 |
\begin{frame}[c]
|
83
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
559 |
|
331
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
560 |
\begin{center}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
561 |
\includegraphics[scale=0.25]{../pics/p3.jpg}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
562 |
\end{center}
|
83
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
563 |
|
331
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
564 |
\begin{itemize}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
565 |
\item by Rajkumar, 1991
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
566 |
\item \it ``it resumes the priority it had at the point of entry into the critical
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
567 |
section''
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
568 |
\end{itemize}
|
148
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
569 |
|
331
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
570 |
\end{frame}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
571 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
572 |
|
83
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
573 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
574 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
331
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
575 |
\begin{frame}[c]
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
576 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
577 |
\begin{center}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
578 |
\includegraphics[scale=0.25]{../pics/p2.jpg}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
579 |
\end{center}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
580 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
581 |
\begin{itemize}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
582 |
\item by Jane Liu, 2000
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
583 |
\item {\it ``The job $J_l$ executes at its inherited
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
584 |
priority until it releases $R$; at that time, the
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
585 |
priority of $J_l$ returns to its priority
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
586 |
at the time when it acquires the resource $R$.''}\medskip
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
587 |
\item \small gives pseudo code and totally bogus data structures
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
588 |
\item \small interesting part ``{\it left as an exercise}''
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
589 |
\end{itemize}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
590 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
591 |
\end{frame}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
592 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
593 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
594 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
595 |
\begin{frame}[c]
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
596 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
597 |
\begin{center}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
598 |
\includegraphics[scale=0.15]{../pics/p1.pdf}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
599 |
\end{center}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
600 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
601 |
\begin{itemize}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
602 |
\item by Laplante and Ovaska, 2011 (\$113.76)
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
603 |
\item \it ``when $[$the task$]$ exits the critical section that
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
604 |
caused the block, it reverts to the priority it had
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
605 |
when it entered that section''
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
606 |
\end{itemize}
|
147
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
607 |
|
331
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
608 |
\end{frame}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
609 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
610 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
611 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
612 |
\begin{frame}[c]
|
433
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
613 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
614 |
\begin{center}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
615 |
\includegraphics[scale=0.25]{../pics/p4.jpg}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
616 |
\end{center}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
617 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
618 |
\begin{itemize}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
619 |
\item by Silberschatz, Galvin, and Gagne, 2013 (OS-bible)
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
620 |
\item \it ``Upon releasing the lock, the
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
621 |
$[$low-priority$]$ thread will revert to
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
622 |
its original priority.''
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
623 |
\end{itemize}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
624 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
625 |
\end{frame}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
626 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
627 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
628 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
629 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
630 |
\begin{frame}[c]
|
331
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
631 |
\frametitle{Priority Scheduling}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
632 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
633 |
\begin{itemize}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
634 |
\item a scheduling algorithm that is widely used in real-time operating systems
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
635 |
\item has been ``proved'' correct by hand in a paper in 1983
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
636 |
\item but this algorithm turned out to be incorrect, despite its ``proof''\bigskip\pause
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
637 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
638 |
\item we corrected the algorithm and then {\bf really} proved that it is correct
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
639 |
\item we implemented this algorithm in a small OS called PINTOS (used for teaching at Stanford)
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
640 |
\item our implementation was much more efficient than their reference implementation
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
641 |
\end{itemize}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
642 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
643 |
\end{frame}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
644 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
645 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
646 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
647 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
648 |
\begin{frame}[c]
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
649 |
\frametitle{Design of AC-Policies}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
650 |
|
434
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
651 |
Imagine you set up an access policy (root, lpd, users, staff, etc)
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
652 |
\bigskip\pause
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
653 |
|
331
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
654 |
\Large
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
655 |
\begin{quote}
|
434
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
656 |
``what you specify is what you get but not necessarily what you want\ldots''
|
331
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
657 |
\end{quote}\bigskip\bigskip\bigskip
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
658 |
|
434
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
659 |
\normalsize main work by Chunhan Wu (a PhD-student in Nanjing)
|
331
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
660 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
661 |
\end{frame}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
662 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
147
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
663 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
664 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
331
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
665 |
\begin{frame}[c]
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
666 |
\frametitle{Testing Policies}
|
147
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
667 |
|
331
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
668 |
\begin{center}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
669 |
\begin{tikzpicture}[scale=1]
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
670 |
%\draw[black!10,step=2mm] (-5,-3) grid (5,4);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
671 |
%\draw[black!10,thick,step=10mm] (-5,-3) grid (5,4);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
672 |
\draw[white,thick,step=10mm] (-5,-3) grid (5,4);
|
147
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
673 |
|
331
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
674 |
\draw [black!20, line width=1mm] (0,0) circle (1cm);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
675 |
\draw [line width=1mm] (0,0) circle (3cm);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
676 |
\node [black!20] at (0,0) {\begin{tabular}{c}core\\[-1mm] system\end{tabular}};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
677 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
678 |
\draw [red, line width=2mm, <-] (-2.1,2.1) -- (-3.5,3.2);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
679 |
\node at (-3.5,3.6) {your system};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
680 |
\node at (-4.8,0) {\Large policy $+$};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
681 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
682 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
683 |
\only<2>{
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
684 |
\draw [black, fill=red, line width=0.5mm] (2,1) circle (3mm);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
685 |
\draw [red, line width=2mm, <-] (2.3,1.2) -- (3.5,2);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
686 |
\node at (3.8,2.6) {\begin{tabular}{l}a seed\\[-1mm] \footnotesize virus, Trojan\end{tabular}};}
|
147
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
687 |
|
331
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
688 |
\only<3>{
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
689 |
\draw [black, fill=red, line width=0.5mm] (2,1) circle (7mm);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
690 |
\node[white] at (2,1) {\small tainted};}
|
147
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
691 |
|
331
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
692 |
\only<4>{
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
693 |
\begin{scope}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
694 |
\draw [clip] (0,0) circle (2.955cm);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
695 |
\draw [black, fill=red, line width=0.5mm] (2,1) circle (9mm);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
696 |
\node[white] at (2,1) {\small tainted};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
697 |
\end{scope}}
|
83
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
698 |
|
331
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
699 |
\only<5->{
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
700 |
\begin{scope}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
701 |
\draw [clip] (0,0) circle (2.955cm);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
702 |
\draw [black, fill=red, line width=0.5mm] (2,1) circle (13mm);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
703 |
\node[white] at (2,1) {\small tainted};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
704 |
\end{scope}}
|
83
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
705 |
|
331
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
706 |
\only<6->{
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
707 |
\draw[fill=white, line width=1mm] (1.265,2.665) arc (-35:183:5mm);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
708 |
\draw[fill=white, line width=1mm] (1.25,3.25) arc (-35:183:3mm);
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
709 |
\node[black, rotate=10] at (1.9,3.6) {\LARGE\ldots};
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
710 |
}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
711 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
712 |
\end{tikzpicture}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
713 |
\end{center}
|
434
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
714 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
715 |
\only<7->{
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
716 |
\begin{textblock}{4}(1,12)
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
717 |
\small
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
718 |
reduced the problem to a finite problem; gave a proof
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
719 |
\end{textblock}}
|
331
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
720 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
721 |
\end{frame}
|
83
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
722 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
723 |
|
331
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
724 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
147
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
725 |
|
332
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
726 |
\begin{frame}[c]
|
433
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
727 |
\frametitle{Big Proofs in CS (1)}
|
332
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
728 |
|
433
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
729 |
Formal proofs in CS sound like science fiction? Completely
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
730 |
irrelevant! Lecturer gone mad?\pause
|
332
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
731 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
732 |
\begin{itemize}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
733 |
\item in 2008, verification of a small C-compiler
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
734 |
\begin{itemize}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
735 |
\item ``if my input program has a certain behaviour, then the compiled machine code has the same behaviour''
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
736 |
\item is as good as \texttt{gcc -O1}, but much less buggy
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
737 |
\end{itemize}
|
433
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
738 |
\end{itemize}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
739 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
740 |
\begin{center}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
741 |
\includegraphics[scale=0.12]{../pics/compcert.png}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
742 |
\end{center}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
743 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
744 |
\end{frame}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
745 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
746 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
747 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
748 |
\begin{frame}[c]
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
749 |
\frametitle{Fuzzy Testing C-Compilers}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
750 |
|
332
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
751 |
\begin{itemize}
|
434
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
752 |
\item tested GCC, LLVM and others by randomly generating
|
433
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
753 |
C-programs
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
754 |
\item found more than 300 bugs in GCC and also
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
755 |
many in LLVM (some of them highest-level critical)\bigskip
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
756 |
\item about CompCert:
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
757 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
758 |
\begin{bubble}[10cm]\small ``The striking thing about our CompCert
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
759 |
results is that the middle-end bugs we found in all other
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
760 |
compilers are absent. As of early 2011, the under-development
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
761 |
version of CompCert is the only compiler we have tested for
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
762 |
which Csmith cannot find wrong-code errors. This is not for
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
763 |
lack of trying: we have devoted about six CPU-years to the
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
764 |
task.''
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
765 |
\end{bubble}
|
332
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
766 |
\end{itemize}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
767 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
768 |
\end{frame}
|
433
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
769 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
770 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
771 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
772 |
\begin{frame}[c]
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
773 |
\frametitle{Big Proofs in CS (2)}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
774 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
775 |
\begin{itemize}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
776 |
\item in 2010, verification of a micro-kernel operating system (approximately 8700 loc)
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
777 |
\begin{itemize}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
778 |
\item used in helicopters and mobile phones
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
779 |
\item 200k loc of proof
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
780 |
\item 25 - 30 person years
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
781 |
\item found 160 bugs in the C code (144 by the proof)
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
782 |
\end{itemize}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
783 |
\end{itemize}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
784 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
785 |
\begin{bubble}[10cm]\small
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
786 |
``Real-world operating-system kernel with an end-to-end proof
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
787 |
of implementation correctness and security enforcement''
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
788 |
\end{bubble}\bigskip\pause
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
789 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
790 |
unhackable kernel (New Scientists, September 2015)
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
791 |
\end{frame}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
792 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
793 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
794 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
795 |
\begin{frame}[c]
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
796 |
\frametitle{Big Proofs in CS (3)}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
797 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
798 |
\begin{itemize}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
799 |
\item verified TLS implementation\medskip
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
800 |
\item verified compilers (CompCert, CakeML)\medskip
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
801 |
\item verified distributed systems (Verdi)\medskip
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
802 |
\item verified OSes or OS components\\
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
803 |
(seL4, CertiKOS, Ironclad Apps, \ldots)\medskip
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
804 |
\item verified cryptography
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
805 |
\end{itemize}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
806 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
807 |
\end{frame}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
808 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
809 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
810 |
\begin{frame}[c]
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
811 |
\frametitle{How Did This Happen?}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
812 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
813 |
Lots of ways!
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
814 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
815 |
\begin{itemize}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
816 |
\item better programming languages
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
817 |
\begin{itemize}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
818 |
\item basic safety guarantees built in
\item powerful mechanisms for abstraction and modularity
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
819 |
\end{itemize}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
820 |
\item better software development methodology
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
821 |
\item stable platforms and frameworks
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
822 |
\item better use of specifications\medskip\\
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
823 |
\small If you want to build software that works or is secure,
|
434
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
824 |
it is helpful to know what you mean by ``works'' and by ``is secure''!
|
433
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
825 |
\end{itemize}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
826 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
827 |
\end{frame}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
828 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
829 |
|
332
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
830 |
|
147
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
831 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
149
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
832 |
\begin{frame}[c]
|
332
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
833 |
\frametitle{Goal}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
834 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
835 |
Remember the Bridges example?
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
836 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
837 |
\begin{itemize}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
838 |
\item Can we look at our programs and somehow ensure
|
434
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
839 |
they are secure/bug free/correct?\pause\bigskip
|
332
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
840 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
841 |
\item Very hard: Anything interesting about programs is equivalent
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
842 |
to halting problem, which is undecidable.\pause\bigskip
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
843 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
844 |
\item \alert{Solution:} We avoid this ``minor'' obstacle by
|
433
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
845 |
being as close as possible of deciding the halting
|
332
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
846 |
problem, without actually deciding the halting problem.
|
434
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
847 |
\small$\quad\Rightarrow$ yes, no, don't know (static analysis)
|
332
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
848 |
\end{itemize}
|
87
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
849 |
|
331
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
850 |
\end{frame}
|
87
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
851 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
332
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
852 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
853 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
854 |
\begin{frame}[c]
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
855 |
\frametitle{What is Static Analysis?}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
856 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
857 |
\begin{center}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
858 |
\includegraphics[scale=0.4]{../pics/state.png}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
859 |
\end{center}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
860 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
861 |
\begin{itemize}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
862 |
\item depending on some initial input, a program
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
863 |
(behaviour) will ``develop'' over time.
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
864 |
\end{itemize}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
865 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
866 |
\end{frame}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
867 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
868 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
869 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
870 |
\begin{frame}[c]
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
871 |
\frametitle{What is Static Analysis?}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
872 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
873 |
\begin{center}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
874 |
\includegraphics[scale=0.4]{../pics/state2.png}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
875 |
\end{center}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
876 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
877 |
\end{frame}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
878 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
879 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
880 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
881 |
\begin{frame}[c]
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
882 |
\frametitle{What is Static Analysis?}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
883 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
884 |
\begin{center}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
885 |
\includegraphics[scale=0.4]{../pics/state3.jpg}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
886 |
\end{center}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
887 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
888 |
\end{frame}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
889 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
890 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
891 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
892 |
\begin{frame}[c]
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
893 |
\frametitle{What is Static Analysis?}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
894 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
895 |
\begin{center}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
896 |
\includegraphics[scale=0.4]{../pics/state4.jpg}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
897 |
\end{center}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
898 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
899 |
\begin{itemize}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
900 |
\item to be avoided
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
901 |
\end{itemize}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
902 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
903 |
\end{frame}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
904 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
905 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
906 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
907 |
\begin{frame}[c]
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
908 |
\frametitle{What is Static Analysis?}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
909 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
910 |
\begin{center}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
911 |
\includegraphics[scale=0.4]{../pics/state5.png}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
912 |
\end{center}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
913 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
914 |
\begin{itemize}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
915 |
\item this needs more work
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
916 |
\end{itemize}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
917 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
918 |
\end{frame}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
919 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
920 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
921 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
922 |
\begin{frame}[c]
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
923 |
\frametitle{What is Static Analysis?}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
924 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
925 |
\begin{center}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
926 |
\includegraphics[scale=0.4]{../pics/state6.png}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
927 |
\end{center}
|
433
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
928 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
929 |
for example no key is leaked
|
332
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
930 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
931 |
\end{frame}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
932 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
933 |
|
433
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
934 |
|
332
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
935 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
936 |
\begin{frame}[fragile]
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
937 |
\frametitle{\large Concrete Example: Sign-Analysis}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
938 |
\mbox{}\\[-20mm]\mbox{}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
939 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
940 |
\bl{\begin{plstx}[rhs style=,one per line]
: \meta{Exp} ::= \meta{Exp} + \meta{Exp}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
941 |
| \meta{Exp} * \meta{Exp}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
942 |
| \meta{Exp} = \meta{Exp}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
943 |
| \meta{num}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
944 |
| \meta{var}\\
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
945 |
: \meta{Stmt} ::= \meta{label} :
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
946 |
| \meta{var} := \meta{Exp}
|
434
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
947 |
| \pcode{jmp?} \meta{Exp} \meta{label}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
948 |
| \pcode{goto} \meta{label}\\
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
949 |
: \meta{Prog} ::= \meta{Stmt} \ldots{} \meta{Stmt}\\
|
332
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
950 |
\end{plstx}}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
951 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
952 |
\begin{textblock}{0}(7.8,2.5)
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
953 |
\small
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
954 |
\begin{bubble}[5.6cm]
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
955 |
\begin{lstlisting}[numbers=none,
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
956 |
basicstyle=\ttfamily,
|
333
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
957 |
language={},xleftmargin=3mm]
|
332
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
958 |
a := 1
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
959 |
n := 5
|
336
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
960 |
top: jmp? n = 0 done
|
332
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
961 |
a := a * n
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
962 |
n := n + -1
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
963 |
goto top
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
964 |
done:
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
965 |
\end{lstlisting}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
966 |
\end{bubble}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
967 |
\end{textblock}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
968 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
969 |
\end{frame}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
970 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
971 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
972 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
973 |
\begin{frame}[fragile]
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
974 |
\frametitle{\large Concrete Example: Sign-Analysis}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
975 |
\mbox{}\\[-20mm]\mbox{}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
976 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
977 |
\bl{\begin{plstx}[rhs style=,one per line]
: \meta{Exp} ::= \meta{Exp} + \meta{Exp}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
978 |
| \meta{Exp} * \meta{Exp}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
979 |
| \meta{Exp} = \meta{Exp}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
980 |
| \meta{num}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
981 |
| \meta{var}\\
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
982 |
: \meta{Stmt} ::= \meta{label} :
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
983 |
| \meta{var} := \meta{Exp}
|
434
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
984 |
| \pcode{jmp?} \meta{Exp} \meta{label}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
985 |
| \pcode{goto} \meta{label}\\
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
986 |
: \meta{Prog} ::= \meta{Stmt} \ldots{} \meta{Stmt}\\
|
332
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
987 |
\end{plstx}}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
988 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
989 |
\begin{textblock}{0}(7.8,3.5)
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
990 |
\small
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
991 |
\begin{bubble}[5.6cm]
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
992 |
\begin{lstlisting}[numbers=none,
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
993 |
basicstyle=\ttfamily,
|
333
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
994 |
language={},xleftmargin=3mm]
|
332
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
995 |
n := 6
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
996 |
m1 := 0
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
997 |
m2 := 1
|
333
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
998 |
top: jmp? n = 0 done
|
332
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
999 |
tmp := m2
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1000 |
m2 := m1 + m2
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1001 |
m1 := tmp
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1002 |
n := n + -1
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1003 |
goto top
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1004 |
done:
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1005 |
\end{lstlisting}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1006 |
\end{bubble}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1007 |
\end{textblock}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1008 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1009 |
\end{frame}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1010 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1011 |
|
333
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1012 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1013 |
\begin{frame}[fragile]
|
433
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1014 |
\frametitle{\large Concrete Example: Sign-Analysis}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1015 |
\mbox{}\\[-20mm]\mbox{}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1016 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1017 |
\bl{\begin{plstx}[rhs style=,one per line]
: \meta{Exp} ::= \meta{Exp} + \meta{Exp}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1018 |
| \meta{Exp} * \meta{Exp}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1019 |
| \meta{Exp} = \meta{Exp}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1020 |
| \meta{num}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1021 |
| \meta{var}\\
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1022 |
: \meta{Stmt} ::= \meta{label} :
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1023 |
| \meta{var} := \meta{Exp}
|
434
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1024 |
| \pcode{jmp?} \meta{Exp} \meta{label}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1025 |
| \pcode{goto} \meta{label}\\
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1026 |
: \meta{Prog} ::= \meta{Stmt} \ldots{} \meta{Stmt}\\
|
433
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1027 |
\end{plstx}}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1028 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1029 |
\end{frame}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1030 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1031 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1032 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1033 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1034 |
\begin{frame}[fragile]
|
434
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1035 |
\frametitle{Eval: An Interpreter}
|
433
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1036 |
\mbox{}\\[-14mm]\mbox{}
|
333
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1037 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1038 |
\small
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1039 |
\begin{center}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1040 |
\bl{\begin{tabular}{lcl}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1041 |
$[n]_{env}$ & $\dn$ & $n$\\
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1042 |
$[x]_{env}$ & $\dn$ & $env(x)$\\
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1043 |
$[e_1 + e_2]_{env}$ & $\dn$ & $[e_1]_{env} + [e_2]_{env}$\\
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1044 |
$[e_1 * e_2]_{env}$ & $\dn$ & $[e_1]_{env} * [e_2]_{env}$\\
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1045 |
$[e_1 = e_2]_{env}$ & $\dn$ &
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1046 |
$\begin{cases}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1047 |
1 & \text{if}\quad[e_1]_{env} = [e_2]_{env}\\
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1048 |
0 & \text{otherwise}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1049 |
\end{cases}$\\
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1050 |
\end{tabular}}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1051 |
\end{center}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1052 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1053 |
\footnotesize
|
336
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1054 |
\begin{lstlisting}[numbers=none,xleftmargin=-5mm]
|
333
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1055 |
def eval_exp(e: Exp, env: Env) : Int = e match {
|
336
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1056 |
case Num(n) => n
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1057 |
case Var(x) => env(x)
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1058 |
case Plus(e1, e2) => eval_exp(e1, env) + eval_exp(e2, env)
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1059 |
case Times(e1, e2) => eval_exp(e1, env) * eval_exp(e2, env)
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1060 |
case Equ(e1, e2) =>
|
333
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1061 |
if (eval_exp(e1, env) == eval_exp(e2, env)) 1 else 0
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1062 |
}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1063 |
\end{lstlisting}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1064 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1065 |
\end{frame}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1066 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1067 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1068 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1069 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1070 |
\begin{frame}[fragile]
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1071 |
\small
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1072 |
A program
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1073 |
\begin{bubble}[6cm]\footnotesize
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1074 |
\begin{lstlisting}[numbers=none,
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1075 |
language={},
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1076 |
basicstyle=\ttfamily,
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1077 |
xleftmargin=1mm]
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1078 |
a := 1
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1079 |
n := 5
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1080 |
top: jmp? n = 0 done
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1081 |
a := a * n
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1082 |
n := n + -1
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1083 |
goto top
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1084 |
done:
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1085 |
\end{lstlisting}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1086 |
\end{bubble}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1087 |
|
434
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1088 |
The \emph{snippets} of the program:
|
333
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1089 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1090 |
\footnotesize
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1091 |
\begin{columns}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1092 |
\begin{column}[t]{5cm}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1093 |
\begin{bubble}[4.5cm]
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1094 |
\begin{lstlisting}[numbers=none,
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1095 |
basicstyle=\ttfamily,
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1096 |
language={},xleftmargin=1mm]
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1097 |
"" a := 1
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1098 |
n := 5
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1099 |
top: jmp? n = 0 done
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1100 |
a := a * n
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1101 |
n := n + -1
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1102 |
goto top
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1103 |
done:
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1104 |
\end{lstlisting}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1105 |
\end{bubble}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1106 |
\end{column}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1107 |
\begin{column}[t]{5cm}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1108 |
\begin{bubble}[4.5cm]
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1109 |
\begin{lstlisting}[numbers=none,
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1110 |
basicstyle=\ttfamily,
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1111 |
language={},xleftmargin=1mm]
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1112 |
top: jmp? n = 0 done
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1113 |
a := a * n
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1114 |
n := n + -1
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1115 |
goto top
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1116 |
done:
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1117 |
\end{lstlisting}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1118 |
\end{bubble}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1119 |
\end{column}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1120 |
\begin{column}[t]{2cm}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1121 |
\begin{bubble}[1.1cm]
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1122 |
\begin{lstlisting}[numbers=none,
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1123 |
basicstyle=\ttfamily,
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1124 |
language={},xleftmargin=1mm]
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1125 |
done:
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1126 |
\end{lstlisting}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1127 |
\end{bubble}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1128 |
\end{column}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1129 |
\end{columns}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1130 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1131 |
\end{frame}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1132 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1133 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1134 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1135 |
\begin{frame}[fragile]
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1136 |
\frametitle{Eval for Stmts}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1137 |
\mbox{}\\[-12mm]\mbox{}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1138 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1139 |
Let \bl{$sn$} be the snippets of a program
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1140 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1141 |
\small
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1142 |
\begin{center}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1143 |
\bl{\begin{tabular}{lcl}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1144 |
$[\texttt{nil}]_{env}$ & $\dn$ & $env$\medskip\\
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1145 |
$[\texttt{Label}(l:)::rest]_{env}$ & $\dn$ & $[rest]_{env}$\medskip\\
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1146 |
$[x \,\texttt{:=}\, e::rest]_{env}$ & $\dn$ &
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1147 |
$[rest]_{(env[x:= [e]_{env}])}$\medskip\\
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1148 |
$[\texttt{jmp?}\;e\;l::rest]_{env}$ & $\dn$ &
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1149 |
$\begin{cases}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1150 |
[sn(l)]_{env} & \text{if}\quad[e]_{env} = 1\\
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1151 |
[rest]_{env} & \text{otherwise}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1152 |
\end{cases}$\medskip\\
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1153 |
$[\texttt{goto}\;l::rest]_{env}$ & $\dn$ & $[sn(l)]_{env}$\\
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1154 |
\end{tabular}}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1155 |
\end{center}\bigskip
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1156 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1157 |
Start with \bl{$[sn(\mbox{\code{""}})]_{\varnothing}$}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1158 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1159 |
\end{frame}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1160 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1161 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1162 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1163 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1164 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1165 |
\begin{frame}[fragile]
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1166 |
\frametitle{Eval in Code}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1167 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1168 |
\footnotesize
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1169 |
\begin{lstlisting}[language=Scala,numbers=none,xleftmargin=-5mm]
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1170 |
def eval(sn: Snips) : Env = {
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1171 |
def eval_stmts(sts: Stmts, env: Env) : Env = sts match {
|
336
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1172 |
case Nil => env
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1173 |
case Label(l)::rest => eval_stmts(rest, env)
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1174 |
case Assign(x, e)::rest =>
|
333
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1175 |
eval_stmts(rest, env + (x -> eval_exp(e, env)))
|
336
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1176 |
case Jmp(b, l)::rest =>
|
333
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1177 |
if (eval_exp(b, env) == 1) eval_stmts(sn(l), env)
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1178 |
else eval_stmts(rest, env)
|
336
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1179 |
case Goto(l)::rest => eval_stmts(sn(l), env)
|
333
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1180 |
}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1181 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1182 |
eval_stmts(sn(""), Map())
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1183 |
}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1184 |
\end{lstlisting}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1185 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1186 |
\end{frame}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1187 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1188 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1189 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1190 |
\begin{frame}[fragile]
|
434
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1191 |
\frametitle{The Idea of Static Analysis}
|
333
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1192 |
\small
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1193 |
\mbox{}\bigskip\\
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1194 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1195 |
\begin{columns}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1196 |
\begin{column}{5cm}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1197 |
\begin{bubble}[4.5cm]\footnotesize
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1198 |
\begin{lstlisting}[numbers=none,
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1199 |
language={},
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1200 |
basicstyle=\ttfamily,
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1201 |
xleftmargin=1mm]
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1202 |
a := 1
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1203 |
n := 5
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1204 |
top: jmp? n = 0 done
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1205 |
a := a * n
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1206 |
n := n + -1
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1207 |
goto top
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1208 |
done:
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1209 |
\end{lstlisting}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1210 |
\end{bubble}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1211 |
\end{column}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1212 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1213 |
\begin{column}{1cm}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1214 |
\raisebox{-20mm}{\LARGE\bf$\Rightarrow$}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1215 |
\end{column}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1216 |
\begin{column}{6cm}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1217 |
\begin{bubble}[4.7cm]\footnotesize
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1218 |
\begin{lstlisting}[numbers=none,
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1219 |
language={},
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1220 |
basicstyle=\ttfamily,
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1221 |
xleftmargin=1mm,
|
336
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1222 |
escapeinside={(*}{*)}]
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1223 |
a := (*\hl{'+'}*)
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1224 |
n := (*\hl{'+'}*)
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1225 |
top: jmp? n = (*\hl{'0'}*) done
|
333
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1226 |
a := a * n
|
336
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1227 |
n := n + (*\hl{'-'}*)
|
333
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1228 |
goto top
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1229 |
done:
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1230 |
\end{lstlisting}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1231 |
\end{bubble}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1232 |
\end{column}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1233 |
\end{columns}\bigskip\bigskip
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1234 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1235 |
Replace all constants and variables by either
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1236 |
\pcode{+}, \pcode{-} or \pcode{0}. What we want to find out
|
337
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1237 |
is what the sign of \texttt{a} and \texttt{n} is (they should
|
333
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1238 |
always positive).
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1239 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1240 |
\end{frame}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1241 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1242 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1243 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1244 |
\begin{frame}[c]
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1245 |
\frametitle{Sign Analysis?}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1246 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1247 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1248 |
\begin{columns}
|
334
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1249 |
\begin{column}{3cm}
|
333
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1250 |
\begin{tabular}{cc|l}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1251 |
$e_1$ & $e_2$ & $e_1 + e_2$\\\hline{}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1252 |
- & - & -\\
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1253 |
- & 0 & -\\
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1254 |
- & + & -, 0, +\\
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1255 |
0 & $x$ & $x$\\
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1256 |
+ & - & -, 0, +\\
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1257 |
+ & 0 & +\\
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1258 |
+ & + & +\\
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1259 |
\end{tabular}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1260 |
\end{column}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1261 |
|
334
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1262 |
\begin{column}{3cm}
|
333
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1263 |
\begin{tabular}{cc|l}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1264 |
$e_1$ & $e_2$ & $e_1 * e_2$\\\hline{}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1265 |
- & - & +\\
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1266 |
- & 0 & 0\\
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1267 |
- & + & -\\
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1268 |
0 & $x$ & 0\\
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1269 |
+ & - & -\\
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1270 |
+ & 0 & 0\\
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1271 |
+ & + & +\\
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1272 |
\end{tabular}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1273 |
\end{column}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1274 |
\end{columns}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1275 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1276 |
\end{frame}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1277 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
332
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1278 |
|
334
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1279 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1280 |
\begin{frame}[fragile]
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1281 |
\mbox{}\\[-13mm]\mbox{}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1282 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1283 |
\small
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1284 |
\begin{center}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1285 |
\bl{\begin{tabular}{lcl}
|
434
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1286 |
$[n]_{aenv}$ & $\dn$ &
|
334
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1287 |
$\begin{cases}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1288 |
\{+\} & \text{if}\; n > 0\\
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1289 |
\{-\} & \text{if}\; n < 0\\
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1290 |
\{0\} & \text{if}\; n = 0
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1291 |
\end{cases}$\\
|
434
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1292 |
$[x]_{aenv}$ & $\dn$ & $aenv(x)$\\
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1293 |
$[e_1 + e_2]_{aenv}$ & $\dn$ & $[e_1]_{aenv} \oplus [e_2]_{aenv}$\\
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1294 |
$[e_1 * e_2]_{aenv}$ & $\dn$ & $[e_1]_{aenv} \otimes [e_2]_{aenv}$\\
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1295 |
$[e_1 = e_2]_{aenv}$ & $\dn$ & $\{0, +\}$\\
|
334
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1296 |
\end{tabular}}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1297 |
\end{center}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1298 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1299 |
\scriptsize
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1300 |
\begin{lstlisting}[language=Scala,numbers=none,xleftmargin=-5mm]
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1301 |
def aeval_exp(e: Exp, aenv: AEnv) : Set[Abst] = e match {
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1302 |
case Num(0) => Set(Zero)
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1303 |
case Num(n) if (n < 0) => Set(Neg)
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1304 |
case Num(n) if (n > 0) => Set(Pos)
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1305 |
case Var(x) => aenv(x)
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1306 |
case Plus(e1, e2) =>
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1307 |
aplus(aeval_exp(e1, aenv), aeval_exp(e2, aenv))
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1308 |
case Times(e1, e2) =>
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1309 |
atimes(aeval_exp(e1, aenv), aeval_exp(e2, aenv))
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1310 |
case Equ(e1, e2) => Set(Zero, Pos)
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1311 |
}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1312 |
\end{lstlisting}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1313 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1314 |
\end{frame}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1315 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1316 |
|
434
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1317 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1318 |
\begin{frame}[fragile]
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1319 |
\frametitle{AEval for Stmts}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1320 |
\mbox{}\\[-12mm]\mbox{}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1321 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1322 |
Let \bl{$sn$} be the snippets of a program
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1323 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1324 |
\small
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1325 |
\begin{center}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1326 |
\bl{\begin{tabular}{lcl}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1327 |
$[\texttt{nil}]_{aenv}$ & $\to$ & $(\texttt{nil},aenv)$\medskip\\
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1328 |
$[\texttt{Label}(l:)::rest]_{aenv}$ & $\to$ & $(rest, aenv)$\medskip\\
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1329 |
$[x \,\texttt{:=}\, e::rest]_{aenv}$ & $\to$ &
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1330 |
$(rest, aenv[x:= [e]_{aenv}])$\medskip\\
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1331 |
$[\texttt{jmp?}\;e\;l::rest]_{aenv}$ & $\to$ &
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1332 |
$(sn(l),aenv)$ \textcolor{black}{and} $(rest, aenv)$\medskip\\
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1333 |
$[\texttt{goto}\;l::rest]_{aenv}$ & $\to$ & $(sn(l), aenv)$\\
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1334 |
\end{tabular}}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1335 |
\end{center}\bigskip
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1336 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1337 |
Start with \bl{$[sn(\mbox{\code{""}})]_{\varnothing}$}, try to
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1338 |
reach all \emph{states} you can find (until a fix point is reached).
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1339 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1340 |
Check whether there are only $aenv$ in the final states that have
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1341 |
your property.
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1342 |
\end{frame}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1343 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
334
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1344 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1345 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1346 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1347 |
\begin{frame}[c]
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1348 |
\frametitle{Sign Analysis}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1349 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1350 |
\begin{itemize}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1351 |
\item We want to find out whether \texttt{a} and \texttt{n}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1352 |
are always positive?\medskip
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1353 |
\item After a few optimisations, we can indeed find this out.
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1354 |
\begin{itemize}
|
434
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1355 |
\item \texttt{equations} return \texttt{+} or \texttt{0}
|
334
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1356 |
\item branch into only one dircection if you know
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1357 |
\item if $x$ is \texttt{+}, then $x + \texttt{-1}$
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1358 |
cannot be negative
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1359 |
\end{itemize}\bigskip
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1360 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1361 |
\item What is this good for? Well, you do not need
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1362 |
underflow checks (in order to prevent buffer-overflow
|
434
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1363 |
attacks). In general this technique is used to make sure
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1364 |
keys stay secret.
|
334
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1365 |
\end{itemize}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1366 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1367 |
\end{frame}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1368 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1369 |
|
434
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1370 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1371 |
\begin{frame}[c]
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1372 |
\frametitle{Take Home Points}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1373 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1374 |
\begin{itemize}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1375 |
\item While testing is important, it does not show the
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1376 |
absence of bugs/vulnerabilities.\medskip
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1377 |
\item More and more we need (formal) proofs that show
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1378 |
a program is bug free.
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1379 |
\end{itemize}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1380 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1381 |
\end{frame}
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1382 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1383 |
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1384 |
|
332
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1385 |
|
76
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1386 |
\end{document}
|
75
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
1387 |
|
332
Christian Urban <christian dot urban at kcl dot ac dot uk>
diff
changeset
|
1388 |
|
75
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
1389 |
%%% Local Variables:
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
1390 |
%%% mode: latex
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
1391 |
%%% TeX-master: t
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
1392 |
%%% End:
|
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
1393 |
|