2351
|
1 |
(*<*)
|
|
2 |
theory Slides3
|
|
3 |
imports "LaTeXsugar" "Nominal"
|
|
4 |
begin
|
|
5 |
|
|
6 |
notation (latex output)
|
|
7 |
set ("_") and
|
|
8 |
Cons ("_::/_" [66,65] 65)
|
|
9 |
|
|
10 |
(*>*)
|
|
11 |
|
2355
|
12 |
text_raw {*
|
|
13 |
\renewcommand{\slidecaption}{UNIF, Edinburgh, 14.~July 2010}
|
2356
|
14 |
|
|
15 |
\newcommand{\abst}[2]{#1.#2}% atom-abstraction
|
|
16 |
\newcommand{\pair}[2]{\langle #1,#2\rangle} % pairing
|
|
17 |
\newcommand{\susp}{{\boldsymbol{\cdot}}}% for suspensions
|
|
18 |
\newcommand{\unit}{\langle\rangle}% unit
|
|
19 |
\newcommand{\app}[2]{#1\,#2}% application
|
|
20 |
\newcommand{\eqprob}{\mathrel{{\approx}?}}
|
|
21 |
|
|
22 |
\pgfdeclareradialshading{smallbluesphere}{\pgfpoint{0.5mm}{0.5mm}}%
|
|
23 |
{rgb(0mm)=(0,0,0.9);
|
|
24 |
rgb(0.9mm)=(0,0,0.7);
|
|
25 |
rgb(1.3mm)=(0,0,0.5);
|
|
26 |
rgb(1.4mm)=(1,1,1)}
|
|
27 |
|
2355
|
28 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
29 |
\mode<presentation>{
|
|
30 |
\begin{frame}<1>[c]
|
|
31 |
\frametitle{Quiz}
|
|
32 |
|
|
33 |
Assuming that \smath{a} and \smath{b} are distinct variables,\\
|
|
34 |
is it possible to find $\lambda$-terms \smath{M_1} to \smath{M_7}
|
|
35 |
that make the following pairs \alert{$\alpha$-equivalent}?
|
|
36 |
|
|
37 |
\begin{tabular}{@ {\hspace{14mm}}p{12cm}}
|
|
38 |
\begin{itemize}
|
|
39 |
\item \smath{\lambda a.\lambda b. (M_1\,b)\;} and
|
|
40 |
\smath{\lambda b.\lambda a. (a\,M_1)\;}
|
|
41 |
|
|
42 |
\item \smath{\lambda a.\lambda b. (M_2\,b)\;} and
|
|
43 |
\smath{\lambda b.\lambda a. (a\,M_3)\;}
|
|
44 |
|
|
45 |
\item \smath{\lambda a.\lambda b. (b\,M_4)\;} and
|
|
46 |
\smath{\lambda b.\lambda a. (a\,M_5)\;}
|
|
47 |
|
|
48 |
\item \smath{\lambda a.\lambda b. (b\,M_6)\;} and
|
|
49 |
\smath{\lambda a.\lambda a. (a\,M_7)\;}
|
|
50 |
\end{itemize}
|
|
51 |
\end{tabular}
|
|
52 |
|
|
53 |
If there is one solution for a pair, can you describe all its solutions?
|
|
54 |
|
|
55 |
\end{frame}}
|
|
56 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
57 |
*}
|
2351
|
58 |
|
|
59 |
text_raw {*
|
|
60 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
61 |
\mode<presentation>{
|
|
62 |
\begin{frame}<1>[t]
|
|
63 |
\frametitle{%
|
|
64 |
\begin{tabular}{@ {\hspace{-3mm}}c@ {}}
|
|
65 |
\\
|
2355
|
66 |
\huge Nominal Unification\\[-2mm]
|
|
67 |
\Large Hitting a Sweet Spot\\[5mm]
|
2351
|
68 |
\end{tabular}}
|
|
69 |
\begin{center}
|
|
70 |
Christian Urban
|
|
71 |
\end{center}
|
|
72 |
\begin{center}
|
2355
|
73 |
\small initial work with Andy Pitts and Jamie Gabbay\\[0mm]
|
2351
|
74 |
\end{center}
|
|
75 |
\end{frame}}
|
|
76 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
77 |
|
|
78 |
*}
|
|
79 |
text_raw {*
|
|
80 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
81 |
\mode<presentation>{
|
2356
|
82 |
\begin{frame}<1-4>[c]
|
|
83 |
\frametitle{One Motivation}
|
|
84 |
|
|
85 |
\onslide<2->{Typing implemented in Prolog \textcolor{darkgray}{(from a textbook)}}\bigskip\\
|
2351
|
86 |
|
2356
|
87 |
\onslide<3->{
|
|
88 |
\begin{tabular}{l}
|
|
89 |
type (Gamma, var(X), T) :- member (X,T) Gamma.\smallskip\medskip\\
|
|
90 |
|
|
91 |
type (Gamma, app(M, N), T') :-\\
|
|
92 |
\hspace{3cm}type (Gamma, M, arrow(T, T')),\\
|
|
93 |
\hspace{3cm}type (Gamma, N, T).\smallskip\medskip\\
|
2351
|
94 |
|
2356
|
95 |
type (Gamma, lam(X, M), arrow(T, T')) :-\\
|
|
96 |
\hspace{3cm}type ((X, T)::Gamma, M, T').\smallskip\medskip\\
|
|
97 |
|
|
98 |
member X X::Tail.\\
|
|
99 |
member X Y::Tail :- member X Tail.\\
|
|
100 |
\end{tabular}}
|
|
101 |
|
|
102 |
\only<4>{
|
|
103 |
\begin{textblock}{6}(2.5,2)
|
|
104 |
\begin{tikzpicture}
|
|
105 |
\draw (0,0) node[inner sep=3mm,fill=cream, ultra thick, draw=red, rounded corners=2mm]
|
|
106 |
{\color{darkgray}
|
|
107 |
\begin{minipage}{8cm}\raggedright
|
|
108 |
The problem is that \smath{\lambda x.\lambda x. (x\;x)}
|
|
109 |
gets the types
|
2351
|
110 |
\begin{center}
|
2356
|
111 |
\begin{tabular}{l}
|
|
112 |
\smath{T\rightarrow (T\rightarrow S) \rightarrow S} and\\
|
|
113 |
\smath{(T\rightarrow S)\rightarrow T \rightarrow S}\\
|
2351
|
114 |
\end{tabular}
|
2356
|
115 |
\end{center}
|
|
116 |
\end{minipage}};
|
|
117 |
\end{tikzpicture}
|
2351
|
118 |
\end{textblock}}
|
|
119 |
|
|
120 |
\end{frame}}
|
|
121 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
122 |
*}
|
|
123 |
|
|
124 |
text_raw {*
|
|
125 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
126 |
\mode<presentation>{
|
2356
|
127 |
\begin{frame}<1>[c]
|
|
128 |
\frametitle{Higher-Order Unification}
|
2351
|
129 |
|
|
130 |
\begin{itemize}
|
2356
|
131 |
\item Lambda Prolog with full Higher-Order Unification\\
|
|
132 |
\textcolor{darkgray}{(no mgus, undecidable, modulo $\alpha\beta$)}\bigskip
|
|
133 |
\item Higher-Order Pattern Unification\\
|
|
134 |
\textcolor{darkgray}{(has mgus, decidable, some restrictions, modulo $\alpha\beta_0$)}
|
2351
|
135 |
\end{itemize}
|
2356
|
136 |
|
2351
|
137 |
\end{frame}}
|
|
138 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
139 |
*}
|
|
140 |
|
|
141 |
text_raw {*
|
|
142 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
143 |
\mode<presentation>{
|
2356
|
144 |
\begin{frame}<1-10>[t]
|
|
145 |
\frametitle{Underlying Ideas}
|
2351
|
146 |
|
|
147 |
\begin{itemize}
|
2356
|
148 |
\item<1-> Unification (\alert{only}) up to $\alpha$
|
|
149 |
|
|
150 |
\item<2-> Swappings / Permutations
|
|
151 |
|
|
152 |
\only<2-5>{
|
|
153 |
\begin{center}
|
|
154 |
\begin{tabular}{r@ {\hspace{1mm}}l@ {\hspace{12mm}}r@ {\hspace{1mm}}l}
|
|
155 |
\only<2>{\smath{\textcolor{white}{[b\!:=\!a]}}}%
|
|
156 |
\only<3>{\smath{[b\!:=\!a]}}%
|
|
157 |
\only<4-5>{\smath{\alert{\swap{a}{b}\,\act}}} &
|
|
158 |
\onslide<2-5>{\smath{\lambda a.b}} &
|
2351
|
159 |
|
2356
|
160 |
\only<2>{\smath{\textcolor{white}{[b\!:=\!a]}}}%
|
|
161 |
\only<3>{\smath{[b\!:=\!a]}}%
|
|
162 |
\only<4-5>{\smath{\alert{\swap{a}{b}\,\act}}} &
|
|
163 |
\onslide<2-5>{\smath{\lambda c.b}}\\
|
|
164 |
|
|
165 |
\onslide<3-5>{\smath{=}} & \only<3>{\smath{\lambda a.a}}\only<4-5>{\smath{\lambda b.a}} &
|
|
166 |
\onslide<3-5>{\smath{=}} & \only<3>{\smath{\lambda c.a}}\only<4-5>{\smath{\lambda c.a}}\\
|
|
167 |
\end{tabular}
|
|
168 |
\end{center}\bigskip
|
|
169 |
|
|
170 |
\onslide<4-5>{
|
|
171 |
\begin{center}
|
|
172 |
\begin{tikzpicture}
|
|
173 |
\draw (0,0) node[inner sep=0mm,fill=cream, ultra thick, draw=cream]
|
|
174 |
{\begin{minipage}{8cm}
|
|
175 |
\begin{tabular}{r@ {\hspace{3mm}}l}
|
|
176 |
\smath{\swap{a}{b}\act t} $\;\dn$ & \alert{swap} {\bf all} occurences of\\
|
|
177 |
& \smath{b} and \smath{a} in \smath{t}
|
2351
|
178 |
\end{tabular}
|
2356
|
179 |
\end{minipage}};
|
|
180 |
\end{tikzpicture}
|
|
181 |
\end{center}}\bigskip
|
|
182 |
|
|
183 |
\onslide<5>{
|
|
184 |
Unlike for \smath{[b\!:=\!a]\act(-)}, for \smath{\swap{a}{b}\act (-)} we do
|
|
185 |
have if \smath{t =_\alpha t'} then \smath{\pi \act t =_\alpha \pi \act t'.}}}
|
|
186 |
|
|
187 |
\item<6-> Variables (or holes)\bigskip
|
|
188 |
|
|
189 |
\begin{center}
|
|
190 |
\onslide<7->{\mbox{}\hspace{-25mm}\smath{\lambda x\hspace{-0.5mm}s .}}
|
|
191 |
\onslide<8-9>{\raisebox{-1.7mm}{\huge\smath{(}}}\raisebox{-4mm}{\begin{tikzpicture}
|
|
192 |
\fill[blue] (0, 0) circle (5mm);
|
|
193 |
\end{tikzpicture}}
|
|
194 |
\onslide<8-9>{\smath{y\hspace{-0.5mm}s}{\raisebox{-1.7mm}{\huge\smath{)}}}}\bigskip
|
|
195 |
\end{center}
|
|
196 |
|
|
197 |
\only<8-9>{\smath{y\hspace{-0.5mm}s} are the parameters the hole can depend on\onslide<9->{, but
|
|
198 |
then you need $\beta_0$-reduction\medskip
|
|
199 |
\begin{center}
|
|
200 |
\smath{(\lambda x. t) y \longrightarrow_{\beta_0} t[x:=y]}
|
|
201 |
\end{center}}}
|
|
202 |
|
|
203 |
\only<10>{we will record the information about which parameters a hole
|
|
204 |
\alert{\bf cannot} depend on}
|
2351
|
205 |
|
|
206 |
\end{itemize}
|
2356
|
207 |
|
|
208 |
\end{frame}}
|
|
209 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
210 |
*}
|
|
211 |
|
|
212 |
text_raw {*
|
|
213 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
214 |
\mode<presentation>{
|
|
215 |
\begin{frame}<1-4>[c]
|
|
216 |
\frametitle{Terms}
|
|
217 |
|
|
218 |
\begin{tabular}{lll @ {\hspace{10mm}}lll}
|
|
219 |
|
|
220 |
\onslide<1->{\pgfuseshading{smallbluesphere}} &
|
|
221 |
\onslide<1->{\colorbox{cream}{\smath{\unit}}} &
|
|
222 |
\onslide<1->{Units} &
|
|
223 |
|
|
224 |
\onslide<2->{\pgfuseshading{smallbluesphere}} &
|
|
225 |
\onslide<2->{\colorbox{cream}{\smath{a}}} &
|
|
226 |
\onslide<2->{Atoms} \\[5mm]
|
|
227 |
|
|
228 |
\onslide<1->{\pgfuseshading{smallbluesphere}} &
|
|
229 |
\onslide<1->{\colorbox{cream}{\smath{\pair{t}{t'}}}} &
|
|
230 |
\onslide<1->{Pairs} &
|
|
231 |
|
|
232 |
\onslide<3->{\pgfuseshading{smallbluesphere}} &
|
|
233 |
\onslide<3->{\colorbox{cream}{\smath{\abst{a}{t}}}} &
|
|
234 |
\onslide<3->{Abstractions}\\[5mm]
|
|
235 |
|
|
236 |
\onslide<1->{\pgfuseshading{smallbluesphere}} &
|
|
237 |
\onslide<1->{\colorbox{cream}{\smath{\app{F}{t}}}} &
|
|
238 |
\onslide<1->{Funct.} &
|
|
239 |
|
|
240 |
\onslide<4->{\pgfuseshading{smallbluesphere}} &
|
|
241 |
\onslide<4->{\colorbox{cream}{\smath{\pi\susp X}}} &
|
|
242 |
\onslide<4->{Suspensions}
|
|
243 |
\end{tabular}
|
|
244 |
|
|
245 |
\only<2>{
|
|
246 |
\begin{textblock}{13}(1.5,12)
|
|
247 |
\small Atoms are constants \textcolor{darkgray}{(infinitely many of them)}
|
|
248 |
\end{textblock}}
|
|
249 |
|
|
250 |
\only<3>{
|
|
251 |
\begin{textblock}{13}(1.5,12)
|
|
252 |
\small \smath{\ulcorner \lambda\abst{a}{a}\urcorner \mapsto \text{fn\ }\abst{a}{a}}\\
|
|
253 |
\small constructions like \smath{\text{fn\ }\abst{X}{X}} are not allowed
|
|
254 |
\end{textblock}}
|
|
255 |
|
|
256 |
\only<4>{
|
|
257 |
\begin{textblock}{13}(1.5,12)
|
|
258 |
\small \smath{X} is a variable standing for a term\\
|
|
259 |
\small \smath{\pi} is an explicit permutation \smath{\swap{a_1}{b_1}\ldots\swap{a_n}{b_n}},
|
|
260 |
waiting to be applied to the term that is substituted for \smath{X}
|
|
261 |
\end{textblock}}
|
2351
|
262 |
|
|
263 |
\end{frame}}
|
|
264 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
265 |
*}
|
|
266 |
|
|
267 |
text_raw {*
|
|
268 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
269 |
\mode<presentation>{
|
2356
|
270 |
\begin{frame}<1-3>[c]
|
|
271 |
\frametitle{Permutations}
|
|
272 |
|
|
273 |
a permutation applied to a term
|
|
274 |
|
|
275 |
\begin{center}
|
|
276 |
\begin{tabular}{lrcl}
|
|
277 |
\pgfuseshading{smallbluesphere} &
|
|
278 |
\smath{[]\act c} & \smath{\dn} & \smath{c} \\
|
2351
|
279 |
|
2356
|
280 |
\pgfuseshading{smallbluesphere} &
|
|
281 |
\smath{\swap{a}{b}\!::\!\pi\act c} & \smath{\dn} &
|
|
282 |
\smath{\begin{cases}
|
|
283 |
a & \text{if}\;\pi\act c = b\\
|
|
284 |
b & \text{if}\;\pi\act c = a\\
|
|
285 |
\pi\act c & \text{otherwise}
|
|
286 |
\end{cases}}\\
|
|
287 |
|
|
288 |
\onslide<2->{\pgfuseshading{smallbluesphere}} &
|
|
289 |
\onslide<2->{\smath{\pi\act\abst{a}{t}}} & \onslide<2->{\smath{\dn}} &
|
|
290 |
\onslide<2->{\smath{\abst{\pi\act a}{\pi\act t}}}\\
|
|
291 |
|
|
292 |
\onslide<3->{\pgfuseshading{smallbluesphere}} &
|
|
293 |
\onslide<3->{\smath{\pi\act\pi'\act X}} & \onslide<3->{\smath{\dn}} &
|
|
294 |
\onslide<3->{\smath{(\pi @ \pi')\act X}}\\
|
2351
|
295 |
\end{tabular}
|
|
296 |
\end{center}
|
|
297 |
|
|
298 |
\end{frame}}
|
|
299 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
300 |
*}
|
|
301 |
|
|
302 |
text_raw {*
|
|
303 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
304 |
\mode<presentation>{
|
2356
|
305 |
\begin{frame}<1-3>[c]
|
|
306 |
\frametitle{Freshness Constraints}
|
|
307 |
|
|
308 |
Recall \smath{\lambda a. \raisebox{-0.7mm}{\tikz \fill[blue] (0, 0) circle (2.5mm);}}
|
|
309 |
\bigskip\pause
|
|
310 |
|
|
311 |
We therefore will identify
|
|
312 |
|
|
313 |
\begin{center}
|
|
314 |
\smath{\mathtt{fn\ } a. X \;\approx\; \mathtt{fn\ } b. \alert<3->{\swap{a}{b}}\act X}
|
|
315 |
\end{center}
|
|
316 |
|
|
317 |
provided that `\smath{b} is fresh for \smath{X} --- (\smath{b\fresh X})',
|
|
318 |
i.e., does not occur freely in any ground term that might be substituted for
|
|
319 |
\smath{X}.\bigskip\pause
|
|
320 |
|
|
321 |
If we know more about \smath{X}, e.g., if we knew that \smath{a\fresh X} and
|
|
322 |
\smath{b\fresh X}, then we can replace\\ \smath{\swap{a}{b}\act X} by
|
|
323 |
\smath{X}.
|
2351
|
324 |
|
2356
|
325 |
\end{frame}}
|
|
326 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
327 |
*}
|
|
328 |
|
|
329 |
text_raw {*
|
|
330 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
331 |
\mode<presentation>{
|
|
332 |
\begin{frame}<1-4>[c]
|
|
333 |
\frametitle{Equivalence Judgements}
|
2351
|
334 |
|
2356
|
335 |
\alt<1>{Our equality is {\bf not} just}{but judgements}
|
|
336 |
|
|
337 |
\begin{center}
|
|
338 |
\begin{tabular}{rl}
|
|
339 |
\colorbox{cream}{\smath{\onslide<2->{\nabla \vdash} t \approx t'}} & \alert{$\alpha$-equivalence}\\[1mm]
|
|
340 |
\onslide<4->{\colorbox{cream}{\smath{\onslide<2->{\nabla \vdash} a \fresh t}}} &
|
|
341 |
\onslide<4->{\alert{freshness}}
|
|
342 |
\end{tabular}
|
|
343 |
\end{center}
|
2351
|
344 |
|
|
345 |
\onslide<2->{
|
2356
|
346 |
where
|
2351
|
347 |
\begin{center}
|
2356
|
348 |
\smath{\nabla = \{a_1\fresh X_1,\ldots, a_n\fresh X_n\}}
|
|
349 |
\end{center}
|
|
350 |
is a finite set of \alert{freshness assumptions}.}
|
|
351 |
|
|
352 |
\onslide<3->{
|
|
353 |
\begin{center}
|
|
354 |
\smath{\{a\fresh X,b\fresh X\} \vdash \text{fn\ } a. X \approx \text{fn\ } b. X}
|
2351
|
355 |
\end{center}}
|
|
356 |
|
|
357 |
\end{frame}}
|
|
358 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
359 |
*}
|
|
360 |
|
|
361 |
text_raw {*
|
|
362 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
363 |
\mode<presentation>{
|
2356
|
364 |
\begin{frame}<1>[c]
|
|
365 |
\frametitle{Rules for Equivalence}
|
|
366 |
|
|
367 |
\begin{center}
|
|
368 |
\begin{tabular}{c}
|
|
369 |
Excerpt\\
|
|
370 |
(i.e.~only the interesting rules)
|
|
371 |
\end{tabular}
|
|
372 |
\end{center}
|
|
373 |
|
|
374 |
\end{frame}}
|
|
375 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
376 |
*}
|
2351
|
377 |
|
2356
|
378 |
text_raw {*
|
|
379 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
380 |
\mode<presentation>{
|
|
381 |
\begin{frame}<1>[c]
|
|
382 |
\frametitle{Rules for Equivalence}
|
|
383 |
|
|
384 |
\begin{center}
|
|
385 |
\begin{tabular}{c}
|
|
386 |
\colorbox{cream}{\smath{\infer{\nabla \vdash a \approx a}{}}}\\[8mm]
|
|
387 |
|
|
388 |
\colorbox{cream}{%
|
|
389 |
\smath{\infer{\nabla \vdash \abst{a}{t} \approx \abst{a}{t'}}
|
|
390 |
{\nabla \vdash t \approx t'}}}\\[8mm]
|
|
391 |
|
|
392 |
\colorbox{cream}{%
|
|
393 |
\smath{\infer{\nabla \vdash \abst{a}{t} \approx \abst{b}{t'}}
|
|
394 |
{a\not=b\;\; & \nabla \vdash t \approx \swap{a}{b}\act t'\;\;& \nabla \vdash a\fresh t'}}}
|
2351
|
395 |
\end{tabular}
|
2356
|
396 |
\end{center}
|
2351
|
397 |
|
|
398 |
\end{frame}}
|
|
399 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
400 |
*}
|
|
401 |
|
|
402 |
text_raw {*
|
|
403 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
404 |
\mode<presentation>{
|
2356
|
405 |
\begin{frame}<1-3>[c]
|
|
406 |
\frametitle{Rules for Equivalence}
|
2351
|
407 |
|
|
408 |
\begin{center}
|
2356
|
409 |
\colorbox{cream}{%
|
|
410 |
\smath{%
|
|
411 |
\infer{\nabla \vdash \pi\act X \approx \pi'\act X}
|
|
412 |
{\begin{array}{c}
|
|
413 |
(a\fresh X)\in\nabla\\
|
|
414 |
\text{for all}\; a \;\text{with}\;\pi\act a \not= \pi'\act a
|
|
415 |
\end{array}
|
|
416 |
}}}
|
2351
|
417 |
\end{center}
|
|
418 |
|
2356
|
419 |
\onslide<2->{
|
|
420 |
for example\\[4mm]
|
|
421 |
|
|
422 |
\alt<2>{%
|
|
423 |
\begin{center}
|
|
424 |
\smath{\{a\fresh\!X, b\fresh\!X\} \vdash X \approx \swap{a}{b}\act X}
|
|
425 |
\end{center}}
|
|
426 |
{%
|
2351
|
427 |
\begin{center}
|
2356
|
428 |
\smath{\{a\fresh\!X, c\fresh\!X\} \vdash \swap{a}{c}\swap{a}{b}\act X \approx \swap{b}{c}\act X}
|
|
429 |
\end{center}}
|
2351
|
430 |
|
2356
|
431 |
\onslide<3->{
|
|
432 |
\begin{tabular}{@ {}lllll@ {}}
|
|
433 |
because &
|
|
434 |
\smath{\swap{a}{c}\swap{a}{b}}: &
|
|
435 |
\smath{a\mapsto b} &
|
|
436 |
\smath{\swap{b}{c}}: &
|
|
437 |
\smath{a\mapsto a}\\
|
|
438 |
& & \smath{b\mapsto c} & & \smath{b\mapsto c}\\
|
|
439 |
& & \smath{c\mapsto a} & & \smath{c\mapsto b}\\
|
|
440 |
\end{tabular}
|
|
441 |
disagree at \smath{a} and \smath{c}.}
|
|
442 |
}
|
|
443 |
|
|
444 |
\end{frame}}
|
|
445 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
446 |
*}
|
|
447 |
|
|
448 |
text_raw {*
|
|
449 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
450 |
\mode<presentation>{
|
|
451 |
\begin{frame}<1>[c]
|
|
452 |
\frametitle{Rules for Freshness}
|
|
453 |
|
2351
|
454 |
\begin{center}
|
2356
|
455 |
\begin{tabular}{c}
|
|
456 |
Excerpt\\
|
|
457 |
(i.e.~only the interesting rules)
|
2351
|
458 |
\end{tabular}
|
2356
|
459 |
\end{center}
|
2351
|
460 |
|
|
461 |
\end{frame}}
|
|
462 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
463 |
*}
|
|
464 |
|
|
465 |
text_raw {*
|
|
466 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
467 |
\mode<presentation>{
|
2356
|
468 |
\begin{frame}<1>[c]
|
|
469 |
\frametitle{Rules for Freshness}
|
2351
|
470 |
|
2356
|
471 |
\begin{center}
|
|
472 |
\begin{tabular}{c}
|
|
473 |
\colorbox{cream}{%
|
|
474 |
\smath{\infer{\nabla \vdash a\fresh b}{a\not= b}}}\\[5mm]
|
2351
|
475 |
|
2356
|
476 |
\colorbox{cream}{%
|
|
477 |
\smath{\infer{\nabla \vdash a\fresh\abst{a}{t}}{}}}\hspace{7mm}
|
|
478 |
\colorbox{cream}{%
|
|
479 |
\smath{\infer{\nabla \vdash a\fresh\abst{b}{t}}
|
|
480 |
{a\not= b\;\; & \nabla \vdash a\fresh t}}}\\[5mm]
|
|
481 |
|
|
482 |
\colorbox{cream}{%
|
|
483 |
\smath{\infer{\nabla \vdash a\fresh \pi\act X}
|
|
484 |
{(\pi^{-1}\act a\fresh X)\in\nabla}}}
|
2351
|
485 |
\end{tabular}
|
|
486 |
\end{center}
|
|
487 |
|
|
488 |
\end{frame}}
|
|
489 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
490 |
*}
|
|
491 |
|
|
492 |
text_raw {*
|
|
493 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
494 |
\mode<presentation>{
|
2356
|
495 |
\begin{frame}<1-4>[t]
|
|
496 |
\frametitle{$\approx$ is an Equivalence}
|
|
497 |
\mbox{}\\[5mm]
|
2351
|
498 |
|
|
499 |
\begin{center}
|
2356
|
500 |
\colorbox{cream}{\alert{Theorem:}
|
|
501 |
$\approx$ is an equivalence relation.}
|
|
502 |
\end{center}\bigskip
|
2351
|
503 |
|
2356
|
504 |
\only<1>{%
|
|
505 |
\begin{tabular}{ll}
|
|
506 |
(Reflexivity) & $\smath{\nabla\vdash t\approx t}$\\[2mm]
|
|
507 |
(Symmetry) & if $\smath{\nabla\vdash t_1\approx t_2}\;$
|
|
508 |
then $\;\smath{\nabla\vdash t_2\approx t_1}$\\[2mm]
|
|
509 |
(Transitivity) & if $\smath{\nabla\vdash t_1\approx t_2}\;$ and
|
|
510 |
$\;\smath{\nabla\vdash t_2\approx t_3}$\\
|
|
511 |
& then $\smath{\nabla\vdash t_1\approx t_3}$\\
|
|
512 |
\end{tabular}}
|
2351
|
513 |
|
2356
|
514 |
\only<2->{%
|
|
515 |
\begin{itemize}
|
|
516 |
\item<2-> \smath{\nabla \vdash t\approx t'} then \smath{\nabla \vdash \pi\act t\approx \pi\act t'}
|
2351
|
517 |
|
2356
|
518 |
\item<2-> \smath{\nabla \vdash a\fresh t} then
|
|
519 |
\smath{\nabla \vdash \pi\act a\fresh \pi\act t}
|
2351
|
520 |
|
2356
|
521 |
\item<3-> \smath{\nabla \vdash t\approx \pi\act t'} then
|
|
522 |
\smath{\nabla \vdash (\pi^{-1})\act t\approx t'}
|
|
523 |
|
|
524 |
\item<3-> \smath{\nabla \vdash a\fresh \pi\act t} then
|
|
525 |
\smath{\nabla \vdash (\pi^{-1})\act a\fresh t}
|
2351
|
526 |
|
2356
|
527 |
\item<4-> \smath{\nabla \vdash a\fresh t} and \smath{\nabla \vdash t\approx t'} then
|
|
528 |
\smath{\nabla \vdash a\fresh t'}
|
|
529 |
\end{itemize}
|
|
530 |
}
|
|
531 |
|
2351
|
532 |
\end{frame}}
|
|
533 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
534 |
*}
|
|
535 |
|
|
536 |
text_raw {*
|
|
537 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
538 |
\mode<presentation>{
|
2356
|
539 |
\begin{frame}<1-4>
|
|
540 |
\frametitle{Comparison $=_\alpha$}
|
2351
|
541 |
|
2356
|
542 |
Traditionally \smath{=_\alpha} is defined as
|
2351
|
543 |
|
|
544 |
\begin{center}
|
2356
|
545 |
\colorbox{cream}{%
|
|
546 |
\begin{minipage}{9cm}
|
|
547 |
\raggedright least congruence which identifies \smath{\abst{a}{t}}
|
|
548 |
with \smath{\abst{b}{[a:=b]t}} provided \smath{b} is not free
|
|
549 |
in \smath{t}
|
|
550 |
\end{minipage}}
|
|
551 |
\end{center}
|
2351
|
552 |
|
2356
|
553 |
where \smath{[a:=b]t} replaces all free occurrences of\\
|
|
554 |
\smath{a} by \smath{b} in \smath{t}.
|
|
555 |
\bigskip
|
2351
|
556 |
|
2356
|
557 |
\only<2>{%
|
|
558 |
\begin{textblock}{13}(1.2,10)
|
|
559 |
For \alert{ground} terms:
|
2351
|
560 |
|
2356
|
561 |
\begin{center}
|
|
562 |
\colorbox{cream}{%
|
|
563 |
\begin{minipage}{9.0cm}
|
|
564 |
\begin{tabular}{@ {}rl}
|
|
565 |
\underline{Theorem:}
|
|
566 |
& \smath{t=_\alpha t'\;\;} if\hspace{-0.5mm}f~\smath{\;\;\emptyset \vdash t\approx t'}\\[2mm]
|
|
567 |
& \smath{a\not\in FA(t)\;\;} if\hspace{-0.5mm}f~\smath{\;\;\emptyset\vdash a\fresh t}
|
2351
|
568 |
\end{tabular}
|
2356
|
569 |
\end{minipage}}
|
|
570 |
\end{center}
|
2351
|
571 |
\end{textblock}}
|
2356
|
572 |
|
|
573 |
\only<3>{%
|
|
574 |
\begin{textblock}{13}(1.2,10)
|
|
575 |
In general \smath{=_\alpha} and \smath{\approx} are distinct!
|
|
576 |
\begin{center}
|
|
577 |
\colorbox{cream}{%
|
|
578 |
\begin{minipage}{6.0cm}
|
|
579 |
\smath{\abst{a}{X}=_\alpha \abst{b}{X}\;} but not\\[2mm]
|
|
580 |
\smath{\emptyset \vdash \abst{a}{X} \approx \abst{b}{X}\;} (\smath{a\not=b})
|
|
581 |
\end{minipage}}
|
|
582 |
\end{center}
|
|
583 |
\end{textblock}}
|
|
584 |
|
|
585 |
\only<4>{
|
|
586 |
\begin{textblock}{6}(1,2)
|
2351
|
587 |
\begin{tikzpicture}
|
2356
|
588 |
\draw (0,0) node[inner sep=3mm,fill=cream, ultra thick, draw=red, rounded corners=2mm]
|
|
589 |
{\color{darkgray}
|
|
590 |
\begin{minipage}{10cm}\raggedright
|
|
591 |
That is a crucial point: if we had\\[-2mm]
|
|
592 |
\[\smath{\emptyset \vdash \abst{a}{X}\approx \abst{b}{X}}\mbox{,}\]
|
|
593 |
then applying $\smath{[X:=a]}$, $\smath{[X:=b]}$, $\ldots$\\
|
|
594 |
give two terms that are {\bf not} $\alpha$-equivalent.\\[3mm]
|
|
595 |
The freshness constraints $\smath{a\fresh X}$ and $\smath{b\fresh X}$
|
|
596 |
rule out the problematic substitutions. Therefore
|
|
597 |
|
|
598 |
\[\smath{\{a\fresh X,b\fresh X\} \vdash \abst{a}{X}\approx \abst{b}{X}}\]
|
|
599 |
|
|
600 |
does hold.
|
2351
|
601 |
\end{minipage}};
|
|
602 |
\end{tikzpicture}
|
|
603 |
\end{textblock}}
|
|
604 |
|
|
605 |
\end{frame}}
|
|
606 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
607 |
*}
|
|
608 |
|
|
609 |
text_raw {*
|
|
610 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
611 |
\mode<presentation>{
|
2356
|
612 |
\begin{frame}<1-9>
|
|
613 |
\frametitle{Substitution}
|
|
614 |
|
|
615 |
\begin{tabular}{l@ {\hspace{8mm}}r@ {\hspace{1.5mm}}c@ {\hspace{1.5mm}}l@ {}}
|
|
616 |
\pgfuseshading{smallbluesphere} &
|
|
617 |
\smath{\sigma(\abst{a}{t})} & \smath{\dn} & \smath{\abst{a}{\sigma(t)}}\\[2mm]
|
2351
|
618 |
|
2356
|
619 |
\pgfuseshading{smallbluesphere} &
|
|
620 |
\smath{\sigma(\pi\act X)} & \smath{\dn} &
|
|
621 |
\smath{\begin{cases}%
|
|
622 |
\pi\;\act\;\sigma(X) & \!\!\text{if\ } \sigma(X)\not=X\\
|
|
623 |
\pi\act X & \!\!\text{otherwise}%
|
|
624 |
\end{cases}}\\[6mm]
|
|
625 |
\end{tabular}\bigskip\bigskip
|
2351
|
626 |
|
2356
|
627 |
\pause
|
|
628 |
\only<2-5>{
|
|
629 |
\only<2->{for example}
|
|
630 |
\def\arraystretch{1.3}
|
|
631 |
\begin{tabular}{@ {\hspace{14mm}}l@ {\hspace{3mm}}l}
|
|
632 |
\onslide<2->{\textcolor{white}{$\Rightarrow$}} &
|
|
633 |
\onslide<2->{\alt<3>{\smath{\underline{\abst{a}{\swap{a}{b}\act X}\;\,[X:=\pair{b}{Y}]}}}
|
|
634 |
{\smath{\abst{a}{\swap{a}{b}\act X}\;\,[X:=\pair{b}{Y}]}}}\\
|
|
635 |
\onslide<3->{\smath{\Rightarrow}} &
|
|
636 |
\onslide<3->{\alt<3,4>{\smath{\abst{a}{\underline{\swap{a}{b}\act X[X:=\pair{b}{Y}]}}}}
|
|
637 |
{\smath{\abst{a}{\swap{a}{b}\act X}[X:=\pair{b}{Y}]}}}\\
|
|
638 |
\onslide<4->{\smath{\Rightarrow}} &
|
|
639 |
\onslide<4->{\alt<4>{\smath{\abst{a}{\swap{a}{b}\act \underline{\pair{b}{Y}}}}}
|
|
640 |
{\smath{\abst{a}{\underline{\swap{a}{b}}\act \pair{b}{Y}}}}}\\
|
|
641 |
\onslide<5->{\smath{\Rightarrow}} &
|
|
642 |
\onslide<5->{\smath{\abst{a}{\pair{a}{\swap{a}{b}\act Y}}}}
|
|
643 |
\end{tabular}}
|
2351
|
644 |
|
2356
|
645 |
\only<6->
|
|
646 |
{\begin{tabular}{l@ {\hspace{8mm}}l@ {}}
|
|
647 |
\pgfuseshading{smallbluesphere} &
|
|
648 |
if \smath{\nabla\vdash t\approx t'} and\hspace{-2mm}\mbox{}
|
|
649 |
\raisebox{-2.7mm}{
|
|
650 |
\alt<7>{\begin{tikzpicture}
|
|
651 |
\draw (0,0) node[inner sep=1mm,fill=cream, very thick, draw=red, rounded corners=3mm]
|
|
652 |
{\smath{\;\nabla'\vdash\sigma(\nabla)\;}};
|
|
653 |
\end{tikzpicture}}
|
|
654 |
{\begin{tikzpicture}
|
|
655 |
\draw (0,0) node[inner sep=1mm,fill=white, very thick, draw=white, rounded corners=3mm]
|
|
656 |
{\smath{\;\nabla'\vdash\sigma(\nabla)\;}};
|
|
657 |
\end{tikzpicture}}}\\
|
|
658 |
& then \smath{\nabla'\vdash\sigma(t)\approx\sigma(t')}
|
|
659 |
\end{tabular}}
|
2351
|
660 |
|
2356
|
661 |
\only<9>
|
|
662 |
{\begin{tabular}{l@ {\hspace{8mm}}l@ {}}
|
|
663 |
\\[-4mm]
|
|
664 |
\pgfuseshading{smallbluesphere} &
|
|
665 |
\smath{\sigma(\pi\act t)=\pi\act\sigma(t)}
|
|
666 |
\end{tabular}}
|
2351
|
667 |
|
|
668 |
|
2356
|
669 |
\only<7>{
|
|
670 |
\begin{textblock}{6}(10,10.5)
|
2351
|
671 |
\begin{tikzpicture}
|
2356
|
672 |
\draw (0,0) node[inner sep=1mm,fill=cream, very thick, draw=red, rounded corners=2mm]
|
|
673 |
{\color{darkgray}
|
|
674 |
\begin{minipage}{3.8cm}\raggedright
|
|
675 |
this means\\[1mm]
|
|
676 |
\smath{\nabla'\vdash a\fresh\sigma(X)}\\[1mm]
|
|
677 |
holds for all\\[1mm]
|
|
678 |
\smath{(a\fresh X)\in\nabla}
|
2351
|
679 |
\end{minipage}};
|
|
680 |
\end{tikzpicture}
|
|
681 |
\end{textblock}}
|
|
682 |
|
|
683 |
\end{frame}}
|
|
684 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
685 |
*}
|
|
686 |
|
|
687 |
text_raw {*
|
|
688 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
689 |
\mode<presentation>{
|
2356
|
690 |
\begin{frame}<1->
|
|
691 |
\frametitle{Equational Problems}
|
2351
|
692 |
|
2356
|
693 |
An equational problem
|
|
694 |
\[
|
|
695 |
\colorbox{cream}{\smath{t \eqprob t'}}
|
|
696 |
\]
|
|
697 |
is \alert{solved} by
|
2351
|
698 |
|
|
699 |
\begin{center}
|
2356
|
700 |
\begin{tabular}{ll}
|
|
701 |
\pgfuseshading{smallbluesphere} & a substitution \smath{\sigma} (terms for variables)\\[3mm]
|
|
702 |
\pgfuseshading{smallbluesphere} & {\bf and} a set of freshness assumptions \smath{\nabla}
|
|
703 |
\end{tabular}
|
2351
|
704 |
\end{center}
|
|
705 |
|
2356
|
706 |
so that \smath{\nabla\vdash \sigma(t)\approx \sigma(t')}.
|
2351
|
707 |
|
|
708 |
|
|
709 |
\end{frame}}
|
|
710 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
711 |
*}
|
|
712 |
|
|
713 |
text_raw {*
|
|
714 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
715 |
\mode<presentation>{
|
|
716 |
\begin{frame}<1->
|
2356
|
717 |
\frametitle{Conclusion}
|
2351
|
718 |
|
|
719 |
\begin{itemize}
|
|
720 |
\item the user does not see anything of the raw level\medskip
|
|
721 |
\only<1>{\begin{center}
|
|
722 |
Lam a (Var a) \alert{$=$} Lam b (Var b)
|
|
723 |
\end{center}\bigskip}
|
|
724 |
|
|
725 |
\item<2-> we have not yet done function definitions (will come soon and
|
|
726 |
we hope to make improvements over the old way there too)\medskip
|
|
727 |
\item<3-> it took quite some time to get here, but it seems worthwhile
|
|
728 |
(Barendregt's variable convention is unsound in general,
|
|
729 |
found bugs in two paper proofs, quotient package, POPL 2011 tutorial)\medskip
|
|
730 |
\end{itemize}
|
|
731 |
|
|
732 |
|
|
733 |
\end{frame}}
|
|
734 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
735 |
*}
|
|
736 |
|
|
737 |
(*<*)
|
|
738 |
end
|
|
739 |
(*>*) |