2299
|
1 |
(*<*)
|
|
2 |
theory Slides1
|
|
3 |
imports "LaTeXsugar" "Nominal"
|
|
4 |
begin
|
|
5 |
|
|
6 |
notation (latex output)
|
|
7 |
set ("_") and
|
|
8 |
Cons ("_::/_" [66,65] 65)
|
|
9 |
|
|
10 |
(*>*)
|
|
11 |
|
|
12 |
|
|
13 |
text_raw {*
|
2309
|
14 |
\renewcommand{\slidecaption}{Cambridge, 8.~June 2010}
|
2299
|
15 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
16 |
\mode<presentation>{
|
|
17 |
\begin{frame}<1>[t]
|
|
18 |
\frametitle{%
|
|
19 |
\begin{tabular}{@ {\hspace{-3mm}}c@ {}}
|
|
20 |
\\
|
2313
|
21 |
\huge Nominal Isabelle 2\\[-2mm]
|
|
22 |
\large Or, How to Reason Conveniently\\[-5mm]
|
|
23 |
\large with General Bindings\\[5mm]
|
2299
|
24 |
\end{tabular}}
|
|
25 |
\begin{center}
|
2309
|
26 |
Christian Urban
|
|
27 |
\end{center}
|
|
28 |
\begin{center}
|
|
29 |
joint work with {\bf Cezary Kaliszyk}\\[0mm]
|
2299
|
30 |
\end{center}
|
|
31 |
\end{frame}}
|
|
32 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
33 |
|
|
34 |
*}
|
|
35 |
|
|
36 |
text_raw {*
|
|
37 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
38 |
\mode<presentation>{
|
2300
|
39 |
\begin{frame}<1-2>
|
2309
|
40 |
\frametitle{\begin{tabular}{c}Binding in Old Nominal\end{tabular}}
|
2304
|
41 |
\mbox{}\\[-6mm]
|
2302
|
42 |
|
|
43 |
\begin{itemize}
|
2311
|
44 |
\item the old Nominal Isabelle provided a reasoning infrastructure for single binders\medskip
|
2304
|
45 |
|
2302
|
46 |
\begin{center}
|
|
47 |
Lam [a].(Var a)
|
|
48 |
\end{center}\bigskip
|
|
49 |
|
2304
|
50 |
\item<2-> but representing
|
|
51 |
|
2302
|
52 |
\begin{center}
|
|
53 |
$\forall\{a_1,\ldots,a_n\}.\; T$
|
2304
|
54 |
\end{center}\medskip
|
|
55 |
|
2309
|
56 |
with single binders and reasoning about it is a \alert{\bf major} pain;
|
|
57 |
take my word for it!
|
2302
|
58 |
\end{itemize}
|
2304
|
59 |
|
|
60 |
\only<1>{
|
|
61 |
\begin{textblock}{6}(1.5,11)
|
|
62 |
\small
|
|
63 |
for example\\
|
|
64 |
\begin{tabular}{l@ {\hspace{2mm}}l}
|
2348
|
65 |
& a $\fresh$ Lam [a]. t\\
|
|
66 |
& Lam [a]. (Var a) \alert{$=$} Lam [b]. (Var b)\\
|
|
67 |
& Barendregt-style reasoning about bound variables\\
|
2304
|
68 |
\end{tabular}
|
|
69 |
\end{textblock}}
|
2299
|
70 |
|
|
71 |
\end{frame}}
|
|
72 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
73 |
*}
|
|
74 |
|
2304
|
75 |
text_raw {*
|
|
76 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
77 |
\mode<presentation>{
|
|
78 |
\begin{frame}<1-4>
|
|
79 |
\frametitle{\begin{tabular}{c}Binding Sets of Names\end{tabular}}
|
|
80 |
\mbox{}\\[-3mm]
|
2299
|
81 |
|
2304
|
82 |
\begin{itemize}
|
|
83 |
\item binding sets of names has some interesting properties:\medskip
|
|
84 |
|
|
85 |
\begin{center}
|
|
86 |
\begin{tabular}{l}
|
|
87 |
$\forall\{x, y\}.\, x \rightarrow y \;\;\approx_\alpha\;\; \forall\{y, x\}.\, y \rightarrow x$
|
|
88 |
\bigskip\smallskip\\
|
|
89 |
|
|
90 |
\onslide<2->{%
|
|
91 |
$\forall\{x, y\}.\, x \rightarrow y \;\;\not\approx_\alpha\;\; \forall\{z\}.\, z \rightarrow z$
|
|
92 |
}\bigskip\smallskip\\
|
|
93 |
|
|
94 |
\onslide<3->{%
|
|
95 |
$\forall\{x\}.\, x \rightarrow y \;\;\approx_\alpha\;\; \forall\{x, \alert{z}\}.\, x \rightarrow y$
|
|
96 |
}\medskip\\
|
|
97 |
\onslide<3->{\hspace{4cm}\small provided $z$ is fresh for the type}
|
|
98 |
\end{tabular}
|
|
99 |
\end{center}
|
|
100 |
\end{itemize}
|
|
101 |
|
|
102 |
\begin{textblock}{8}(2,14.5)
|
|
103 |
\footnotesize $^*$ $x$, $y$, $z$ are assumed to be distinct
|
|
104 |
\end{textblock}
|
|
105 |
|
|
106 |
\only<4>{
|
|
107 |
\begin{textblock}{6}(2.5,4)
|
|
108 |
\begin{tikzpicture}
|
|
109 |
\draw (0,0) node[inner sep=3mm,fill=cream, ultra thick, draw=red, rounded corners=2mm]
|
|
110 |
{\normalsize\color{darkgray}
|
|
111 |
\begin{minipage}{8cm}\raggedright
|
|
112 |
For type-schemes the order of bound names does not matter, and
|
|
113 |
alpha-equivalence is preserved under \alert{vacuous} binders.
|
|
114 |
\end{minipage}};
|
|
115 |
\end{tikzpicture}
|
|
116 |
\end{textblock}}
|
|
117 |
\end{frame}}
|
|
118 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
119 |
*}
|
|
120 |
|
|
121 |
text_raw {*
|
|
122 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
123 |
\mode<presentation>{
|
|
124 |
\begin{frame}<1-3>
|
|
125 |
\frametitle{\begin{tabular}{c}Other Binding Modes\end{tabular}}
|
|
126 |
\mbox{}\\[-3mm]
|
|
127 |
|
|
128 |
\begin{itemize}
|
|
129 |
\item alpha-equivalence being preserved under vacuous binders is \underline{not} always
|
|
130 |
wanted:\bigskip\bigskip\normalsize
|
|
131 |
|
|
132 |
\begin{tabular}{@ {\hspace{-8mm}}l}
|
|
133 |
$\text{let}\;x = 3\;\text{and}\;y = 2\;\text{in}\;x - y\;\text{end}$\medskip\\
|
|
134 |
\onslide<2->{$\;\;\;\only<2>{\approx_\alpha}\only<3>{\alert{\not\approx_\alpha}}
|
|
135 |
\text{let}\;y = 2\;\text{and}\;x = 3\only<3->{\alert{\;\text{and}
|
|
136 |
\;z = \text{loop}}}\;\text{in}\;x - y\;\text{end}$}
|
|
137 |
\end{tabular}
|
|
138 |
|
|
139 |
|
|
140 |
\end{itemize}
|
|
141 |
|
|
142 |
\end{frame}}
|
|
143 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
144 |
*}
|
|
145 |
|
|
146 |
text_raw {*
|
|
147 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
148 |
\mode<presentation>{
|
|
149 |
\begin{frame}<1>
|
|
150 |
\frametitle{\begin{tabular}{c}\LARGE{}Even Another Binding Mode\end{tabular}}
|
|
151 |
\mbox{}\\[-3mm]
|
|
152 |
|
|
153 |
\begin{itemize}
|
|
154 |
\item sometimes one wants to abstract more than one name, but the order \underline{does} matter\bigskip
|
|
155 |
|
|
156 |
\begin{center}
|
|
157 |
\begin{tabular}{@ {\hspace{-8mm}}l}
|
|
158 |
$\text{let}\;(x, y) = (3, 2)\;\text{in}\;x - y\;\text{end}$\medskip\\
|
|
159 |
$\;\;\;\not\approx_\alpha
|
|
160 |
\text{let}\;(y, x) = (3, 2)\;\text{in}\;x - y\;\text{end}$
|
|
161 |
\end{tabular}
|
|
162 |
\end{center}
|
|
163 |
|
|
164 |
|
|
165 |
\end{itemize}
|
|
166 |
|
|
167 |
\end{frame}}
|
|
168 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
169 |
*}
|
|
170 |
|
|
171 |
text_raw {*
|
|
172 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
173 |
\mode<presentation>{
|
|
174 |
\begin{frame}<1-2>
|
|
175 |
\frametitle{\begin{tabular}{c}\LARGE{}Three Binding Modes\end{tabular}}
|
|
176 |
\mbox{}\\[-3mm]
|
|
177 |
|
|
178 |
\begin{itemize}
|
|
179 |
\item the order does not matter and alpha-equivelence is preserved under
|
2309
|
180 |
vacuous binders \textcolor{gray}{(restriction)}\medskip
|
2304
|
181 |
|
|
182 |
\item the order does not matter, but the cardinality of the binders
|
2309
|
183 |
must be the same \textcolor{gray}{(abstraction)}\medskip
|
2304
|
184 |
|
2313
|
185 |
\item the order does matter \textcolor{gray}{(iterated single binders)}
|
2304
|
186 |
\end{itemize}
|
|
187 |
|
|
188 |
\onslide<2->{
|
|
189 |
\begin{center}
|
|
190 |
\isacommand{bind\_res}\hspace{6mm}
|
|
191 |
\isacommand{bind\_set}\hspace{6mm}
|
|
192 |
\isacommand{bind}
|
|
193 |
\end{center}}
|
|
194 |
|
|
195 |
\end{frame}}
|
|
196 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
197 |
*}
|
|
198 |
|
|
199 |
text_raw {*
|
|
200 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
201 |
\mode<presentation>{
|
|
202 |
\begin{frame}<1-3>
|
|
203 |
\frametitle{\begin{tabular}{c}Specification of Binding\end{tabular}}
|
|
204 |
\mbox{}\\[-6mm]
|
|
205 |
|
|
206 |
\mbox{}\hspace{10mm}
|
|
207 |
\begin{tabular}{ll}
|
|
208 |
\multicolumn{2}{l}{\isacommand{nominal\_datatype} trm $=$}\\
|
|
209 |
\hspace{5mm}\phantom{$|$} Var name\\
|
|
210 |
\hspace{5mm}$|$ App trm trm\\
|
|
211 |
\hspace{5mm}$|$ Lam \only<2->{x::}name \only<2->{t::}trm
|
|
212 |
& \onslide<2->{\isacommand{bind} x \isacommand{in} t}\\
|
|
213 |
\hspace{5mm}$|$ Let \only<2->{as::}assn \only<2->{t::}trm
|
|
214 |
& \onslide<2->{\isacommand{bind} bn(as) \isacommand{in} t}\\
|
|
215 |
\multicolumn{2}{l}{\isacommand{and} assn $=$}\\
|
|
216 |
\multicolumn{2}{l}{\hspace{5mm}\phantom{$|$} ANil}\\
|
|
217 |
\multicolumn{2}{l}{\hspace{5mm}$|$ ACons name trm assn}\\
|
|
218 |
\multicolumn{2}{l}{\onslide<3->{\isacommand{binder} bn \isacommand{where}}}\\
|
2309
|
219 |
\multicolumn{2}{l}{\onslide<3->{\hspace{5mm}\phantom{$|$} bn(ANil) $=$ []}}\\
|
|
220 |
\multicolumn{2}{l}{\onslide<3->{\hspace{5mm}$|$ bn(ACons a t as) $=$ [a] @ bn(as)}}\\
|
2304
|
221 |
\end{tabular}
|
|
222 |
|
|
223 |
|
|
224 |
|
|
225 |
\end{frame}}
|
|
226 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
227 |
*}
|
|
228 |
|
|
229 |
text_raw {*
|
|
230 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
231 |
\mode<presentation>{
|
2309
|
232 |
\begin{frame}<1-5>
|
|
233 |
\frametitle{\begin{tabular}{c}Inspiration from Ott\end{tabular}}
|
2304
|
234 |
\mbox{}\\[-3mm]
|
|
235 |
|
|
236 |
\begin{itemize}
|
2309
|
237 |
\item this way of specifying binding is inspired by
|
2311
|
238 |
{\bf Ott}\onslide<2->{, \alert{\bf but} we made some adjustments:}\medskip
|
2309
|
239 |
|
2304
|
240 |
|
2309
|
241 |
\only<2>{
|
2304
|
242 |
\begin{itemize}
|
2309
|
243 |
\item Ott allows specifications like\smallskip
|
2304
|
244 |
\begin{center}
|
|
245 |
$t ::= t\;t\; |\;\lambda x.t$
|
2309
|
246 |
\end{center}
|
|
247 |
\end{itemize}}
|
2304
|
248 |
|
2309
|
249 |
\only<3-4>{
|
|
250 |
\begin{itemize}
|
|
251 |
\item whether something is bound can depend in Ott on other bound things\smallskip
|
2304
|
252 |
\begin{center}
|
2309
|
253 |
\begin{tikzpicture}
|
|
254 |
\node (A) at (-0.5,1) {Foo $(\lambda y. \lambda x. t)$};
|
|
255 |
\node (B) at ( 1.1,1) {$s$};
|
|
256 |
\onslide<4>{\node (C) at (0.5,0) {$\{y, x\}$};}
|
|
257 |
\onslide<4>{\draw[->,red,line width=1mm] (A) -- (C);}
|
|
258 |
\onslide<4>{\draw[->,red,line width=1mm] (C) -- (B);}
|
|
259 |
\end{tikzpicture}
|
|
260 |
\end{center}
|
|
261 |
\onslide<4>{this might make sense for ``raw'' terms, but not at all
|
2304
|
262 |
for $\alpha$-equated terms}
|
2309
|
263 |
\end{itemize}}
|
|
264 |
|
|
265 |
\only<5>{
|
|
266 |
\begin{itemize}
|
2311
|
267 |
\item we allow multiple ``binders'' and ``bodies''\smallskip
|
2309
|
268 |
\begin{center}
|
2313
|
269 |
\begin{tabular}{l}
|
|
270 |
\isacommand{bind} a b c \ldots \isacommand{in} x y z \ldots\\
|
|
271 |
\isacommand{bind\_set} a b c \ldots \isacommand{in} x y z \ldots\\
|
|
272 |
\isacommand{bind\_res} a b c \ldots \isacommand{in} x y z \ldots
|
|
273 |
\end{tabular}
|
2309
|
274 |
\end{center}\bigskip\medskip
|
2313
|
275 |
the reason is that with our definition of $\alpha$-equivalence\medskip
|
2309
|
276 |
\begin{center}
|
2313
|
277 |
\begin{tabular}{l}
|
|
278 |
\isacommand{bind\_res} as \isacommand{in} x y $\not\Leftrightarrow$\\
|
|
279 |
\hspace{8mm}\isacommand{bind\_res} as \isacommand{in} x, \isacommand{bind\_res} as \isacommand{in} y
|
2309
|
280 |
\end{tabular}
|
2313
|
281 |
\end{center}\medskip
|
2309
|
282 |
|
|
283 |
same with \isacommand{bind\_set}
|
|
284 |
\end{itemize}}
|
2304
|
285 |
\end{itemize}
|
|
286 |
|
|
287 |
|
|
288 |
\end{frame}}
|
|
289 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
290 |
*}
|
2309
|
291 |
|
2304
|
292 |
text_raw {*
|
|
293 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
294 |
\mode<presentation>{
|
|
295 |
\begin{frame}<1>
|
|
296 |
\frametitle{\begin{tabular}{c}Alpha-Equivalence\end{tabular}}
|
|
297 |
\mbox{}\\[-3mm]
|
|
298 |
|
|
299 |
\begin{itemize}
|
2311
|
300 |
\item in the old Nominal Isabelle, we represented single binders as partial functions:\bigskip
|
2304
|
301 |
|
|
302 |
\begin{center}
|
|
303 |
\begin{tabular}{l}
|
2309
|
304 |
Lam [$a$].\,$t$ $\;{^\text{``}}\!\dn{}\!^{\text{''}}$\\[2mm]
|
2304
|
305 |
\;\;\;\;$\lambda b.$\;$\text{if}\;a = b\;\text{then}\;t\;\text{else}$\\
|
2309
|
306 |
\phantom{\;\;\;\;$\lambda b.$\;\;\;\;\;\;}$\text{if}\;b \fresh t\;
|
2304
|
307 |
\text{then}\;(a\;b)\act t\;\text{else}\;\text{error}$
|
|
308 |
\end{tabular}
|
|
309 |
\end{center}
|
|
310 |
\end{itemize}
|
|
311 |
|
|
312 |
\begin{textblock}{10}(2,14)
|
|
313 |
\footnotesize $^*$ alpha-equality coincides with equality on functions
|
|
314 |
\end{textblock}
|
|
315 |
\end{frame}}
|
|
316 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
317 |
*}
|
|
318 |
|
|
319 |
text_raw {*
|
|
320 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
321 |
\mode<presentation>{
|
2309
|
322 |
\begin{frame}<1->
|
|
323 |
\frametitle{\begin{tabular}{c}New Design\end{tabular}}
|
|
324 |
\mbox{}\\[4mm]
|
|
325 |
|
|
326 |
\begin{center}
|
|
327 |
\begin{tikzpicture}
|
2313
|
328 |
{\draw (0,0) node[inner sep=3mm, ultra thick, draw=fg, rounded corners=2mm]
|
2309
|
329 |
(A) {\begin{minipage}{1.1cm}bind.\\spec.\end{minipage}};}
|
|
330 |
|
2313
|
331 |
{\draw (3,0) node[inner sep=3mm, ultra thick, draw=fg, rounded corners=2mm]
|
2309
|
332 |
(B) {\begin{minipage}{1.1cm}raw\\terms\end{minipage}};}
|
|
333 |
|
2313
|
334 |
\alt<2>
|
2309
|
335 |
{\draw (6,0) node[inner sep=3mm, ultra thick, draw=red, rounded corners=2mm]
|
|
336 |
(C) {\textcolor{red}{\begin{minipage}{1.1cm}$\alpha$-\\equiv.\end{minipage}}};}
|
2313
|
337 |
{\draw (6,0) node[inner sep=3mm, ultra thick, draw=fg, rounded corners=2mm]
|
2309
|
338 |
(C) {\begin{minipage}{1.1cm}$\alpha$-\\equiv.\end{minipage}};}
|
|
339 |
|
2313
|
340 |
{\draw (0,-3) node[inner sep=3mm, ultra thick, draw=fg, rounded corners=2mm]
|
2309
|
341 |
(D) {\begin{minipage}{1.1cm}quot.\\type\end{minipage}};}
|
|
342 |
|
2313
|
343 |
{\draw (3,-3) node[inner sep=3mm, ultra thick, draw=fg, rounded corners=2mm]
|
2309
|
344 |
(E) {\begin{minipage}{1.1cm}lift\\thms\end{minipage}};}
|
|
345 |
|
2313
|
346 |
{\draw (6,-3) node[inner sep=3mm, ultra thick, draw=fg, rounded corners=2mm]
|
2309
|
347 |
(F) {\begin{minipage}{1.1cm}add.\\thms\end{minipage}};}
|
|
348 |
|
2313
|
349 |
\draw[->,fg!50,line width=1mm] (A) -- (B);
|
|
350 |
\draw[->,fg!50,line width=1mm] (B) -- (C);
|
|
351 |
\draw[->,fg!50,line width=1mm, line join=round, rounded corners=2mm]
|
2309
|
352 |
(C) -- (8,0) -- (8,-1.5) -- (-2,-1.5) -- (-2,-3) -- (D);
|
2313
|
353 |
\draw[->,fg!50,line width=1mm] (D) -- (E);
|
|
354 |
\draw[->,fg!50,line width=1mm] (E) -- (F);
|
2309
|
355 |
\end{tikzpicture}
|
|
356 |
\end{center}
|
|
357 |
|
|
358 |
\end{frame}}
|
|
359 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
360 |
*}
|
|
361 |
|
|
362 |
|
|
363 |
|
|
364 |
text_raw {*
|
|
365 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
366 |
\mode<presentation>{
|
2313
|
367 |
\begin{frame}<1-8>
|
2304
|
368 |
\frametitle{\begin{tabular}{c}Alpha-Equivalence\end{tabular}}
|
|
369 |
\mbox{}\\[-3mm]
|
|
370 |
|
|
371 |
\begin{itemize}
|
|
372 |
\item lets first look at pairs\bigskip\medskip
|
|
373 |
|
|
374 |
\begin{tabular}{@ {\hspace{1cm}}l}
|
2313
|
375 |
$(as, x) \onslide<2->{\approx\!}\makebox[0mm][l]{\only<2-6>{${}_{\text{set}}$}%
|
|
376 |
\only<7>{${}_{\text{\alert{list}}}$}%
|
|
377 |
\only<8>{${}_{\text{\alert{res}}}$}}%
|
2304
|
378 |
\onslide<3->{^{R,\text{fv}}}\,\onslide<2->{(bs,y)}$
|
|
379 |
\end{tabular}\bigskip
|
|
380 |
\end{itemize}
|
|
381 |
|
|
382 |
\only<1>{
|
|
383 |
\begin{textblock}{8}(3,8.5)
|
|
384 |
\begin{tabular}{l@ {\hspace{2mm}}p{8cm}}
|
2348
|
385 |
& $as$ is a set of names\ldots the binders\\
|
|
386 |
& $x$ is the body (might be a tuple)\\
|
|
387 |
& $\approx_{\text{set}}$ is where the cardinality
|
2304
|
388 |
of the binders has to be the same\\
|
|
389 |
\end{tabular}
|
|
390 |
\end{textblock}}
|
|
391 |
|
|
392 |
\only<4->{
|
|
393 |
\begin{textblock}{12}(5,8)
|
|
394 |
\begin{tabular}{ll@ {\hspace{1mm}}l}
|
|
395 |
$\dn$ & \onslide<5->{$\exists \pi.\,$} & $\text{fv}(x) - as = \text{fv}(y) - bs$\\[1mm]
|
|
396 |
& \onslide<5->{$\;\;\;\wedge$} & \onslide<5->{$\text{fv}(x) - as \fresh^* \pi$}\\[1mm]
|
2313
|
397 |
& \onslide<5->{$\;\;\;\wedge$} & \onslide<5->{$(\pi \act x)\;R\;y$}\\[1mm]
|
|
398 |
& \onslide<6-7>{$\;\;\;\wedge$} & \onslide<6-7>{$\pi \act as = bs$}\\
|
2304
|
399 |
\end{tabular}
|
|
400 |
\end{textblock}}
|
|
401 |
|
2313
|
402 |
\only<7>{
|
|
403 |
\begin{textblock}{7}(3,13.8)
|
2311
|
404 |
\footnotesize $^*$ $as$ and $bs$ are \alert{lists} of names
|
2304
|
405 |
\end{textblock}}
|
|
406 |
\end{frame}}
|
|
407 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
408 |
*}
|
|
409 |
|
|
410 |
text_raw {*
|
|
411 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
412 |
\mode<presentation>{
|
2311
|
413 |
\begin{frame}<1-3>
|
2304
|
414 |
\frametitle{\begin{tabular}{c}Examples\end{tabular}}
|
|
415 |
\mbox{}\\[-3mm]
|
|
416 |
|
|
417 |
\begin{itemize}
|
|
418 |
\item lets look at ``type-schemes'':\medskip\medskip
|
|
419 |
|
|
420 |
\begin{center}
|
|
421 |
$(as, x) \approx\!\makebox[0mm][l]{${}_{\text{set}}$}\only<1>{{}^{R,\text{fv}}}\only<2->{{}^{\alert{=},\alert{\text{fv}}}} (bs, y)$
|
|
422 |
\end{center}\medskip
|
|
423 |
|
|
424 |
\onslide<2->{
|
|
425 |
\begin{center}
|
|
426 |
\begin{tabular}{l}
|
|
427 |
$\text{fv}(x) = \{x\}$\\[1mm]
|
|
428 |
$\text{fv}(T_1 \rightarrow T_2) = \text{fv}(T_1) \cup \text{fv}(T_2)$\\
|
|
429 |
\end{tabular}
|
|
430 |
\end{center}}
|
|
431 |
\end{itemize}
|
|
432 |
|
|
433 |
|
2311
|
434 |
\only<3->{
|
2304
|
435 |
\begin{textblock}{4}(0.3,12)
|
|
436 |
\begin{tikzpicture}
|
|
437 |
\draw (0,0) node[inner sep=1mm,fill=cream, ultra thick, draw=red, rounded corners=2mm]
|
|
438 |
{\tiny\color{darkgray}
|
|
439 |
\begin{minipage}{3.4cm}\raggedright
|
|
440 |
\begin{tabular}{r@ {\hspace{1mm}}l}
|
|
441 |
\multicolumn{2}{@ {}l}{res:}\\
|
|
442 |
$\exists\pi.$ & $\text{fv}(x) - as = \text{fv}(y) - bs$\\
|
|
443 |
$\wedge$ & $\text{fv}(x) - as \fresh^* \pi$\\
|
|
444 |
$\wedge$ & $\pi \cdot x = y$\\
|
|
445 |
\\
|
|
446 |
\end{tabular}
|
|
447 |
\end{minipage}};
|
|
448 |
\end{tikzpicture}
|
|
449 |
\end{textblock}}
|
2311
|
450 |
\only<3->{
|
2304
|
451 |
\begin{textblock}{4}(5.2,12)
|
|
452 |
\begin{tikzpicture}
|
|
453 |
\draw (0,0) node[inner sep=1mm,fill=cream, ultra thick, draw=red, rounded corners=2mm]
|
|
454 |
{\tiny\color{darkgray}
|
|
455 |
\begin{minipage}{3.4cm}\raggedright
|
|
456 |
\begin{tabular}{r@ {\hspace{1mm}}l}
|
|
457 |
\multicolumn{2}{@ {}l}{set:}\\
|
|
458 |
$\exists\pi.$ & $\text{fv}(x) - as = \text{fv}(y) - bs$\\
|
|
459 |
$\wedge$ & $\text{fv}(x) - as \fresh^* \pi$\\
|
|
460 |
$\wedge$ & $\pi \cdot x = y$\\
|
|
461 |
$\wedge$ & $\pi \cdot as = bs$\\
|
|
462 |
\end{tabular}
|
|
463 |
\end{minipage}};
|
|
464 |
\end{tikzpicture}
|
|
465 |
\end{textblock}}
|
2311
|
466 |
\only<3->{
|
2304
|
467 |
\begin{textblock}{4}(10.2,12)
|
|
468 |
\begin{tikzpicture}
|
|
469 |
\draw (0,0) node[inner sep=1mm,fill=cream, ultra thick, draw=red, rounded corners=2mm]
|
|
470 |
{\tiny\color{darkgray}
|
|
471 |
\begin{minipage}{3.4cm}\raggedright
|
|
472 |
\begin{tabular}{r@ {\hspace{1mm}}l}
|
|
473 |
\multicolumn{2}{@ {}l}{list:}\\
|
|
474 |
$\exists\pi.$ & $\text{fv}(x) - as = \text{fv}(y) - bs$\\
|
|
475 |
$\wedge$ & $\text{fv}(x) - as \fresh^* \pi$\\
|
|
476 |
$\wedge$ & $\pi \cdot x = y$\\
|
|
477 |
$\wedge$ & $\pi \cdot as = bs$\\
|
|
478 |
\end{tabular}
|
|
479 |
\end{minipage}};
|
|
480 |
\end{tikzpicture}
|
|
481 |
\end{textblock}}
|
|
482 |
|
|
483 |
\end{frame}}
|
|
484 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
485 |
*}
|
|
486 |
|
|
487 |
text_raw {*
|
|
488 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
489 |
\mode<presentation>{
|
|
490 |
\begin{frame}<1-2>
|
|
491 |
\frametitle{\begin{tabular}{c}Examples\end{tabular}}
|
|
492 |
\mbox{}\\[-3mm]
|
|
493 |
|
|
494 |
\begin{center}
|
|
495 |
\only<1>{$(\{x, y\}, x \rightarrow y) \approx_? (\{x, y\}, y \rightarrow x)$}
|
|
496 |
\only<2>{$([x, y], x \rightarrow y) \approx_? ([x, y], y \rightarrow x)$}
|
|
497 |
\end{center}
|
|
498 |
|
|
499 |
\begin{itemize}
|
|
500 |
\item $\approx_{\text{res}}$, $\approx_{\text{set}}$%
|
|
501 |
\only<2>{, \alert{$\not\approx_{\text{list}}$}}
|
|
502 |
\end{itemize}
|
|
503 |
|
|
504 |
|
|
505 |
\only<1->{
|
|
506 |
\begin{textblock}{4}(0.3,12)
|
|
507 |
\begin{tikzpicture}
|
|
508 |
\draw (0,0) node[inner sep=1mm,fill=cream, ultra thick, draw=red, rounded corners=2mm]
|
|
509 |
{\tiny\color{darkgray}
|
|
510 |
\begin{minipage}{3.4cm}\raggedright
|
|
511 |
\begin{tabular}{r@ {\hspace{1mm}}l}
|
|
512 |
\multicolumn{2}{@ {}l}{res:}\\
|
|
513 |
$\exists\pi.$ & $\text{fv}(x) - as = \text{fv}(y) - bs$\\
|
|
514 |
$\wedge$ & $\text{fv}(x) - as \fresh^* \pi$\\
|
|
515 |
$\wedge$ & $\pi \cdot x = y$\\
|
|
516 |
\\
|
|
517 |
\end{tabular}
|
|
518 |
\end{minipage}};
|
|
519 |
\end{tikzpicture}
|
|
520 |
\end{textblock}}
|
|
521 |
\only<1->{
|
|
522 |
\begin{textblock}{4}(5.2,12)
|
|
523 |
\begin{tikzpicture}
|
|
524 |
\draw (0,0) node[inner sep=1mm,fill=cream, ultra thick, draw=red, rounded corners=2mm]
|
|
525 |
{\tiny\color{darkgray}
|
|
526 |
\begin{minipage}{3.4cm}\raggedright
|
|
527 |
\begin{tabular}{r@ {\hspace{1mm}}l}
|
|
528 |
\multicolumn{2}{@ {}l}{set:}\\
|
|
529 |
$\exists\pi.$ & $\text{fv}(x) - as = \text{fv}(y) - bs$\\
|
|
530 |
$\wedge$ & $\text{fv}(x) - as \fresh^* \pi$\\
|
|
531 |
$\wedge$ & $\pi \cdot x = y$\\
|
|
532 |
$\wedge$ & $\pi \cdot as = bs$\\
|
|
533 |
\end{tabular}
|
|
534 |
\end{minipage}};
|
|
535 |
\end{tikzpicture}
|
|
536 |
\end{textblock}}
|
|
537 |
\only<1->{
|
|
538 |
\begin{textblock}{4}(10.2,12)
|
|
539 |
\begin{tikzpicture}
|
|
540 |
\draw (0,0) node[inner sep=1mm,fill=cream, ultra thick, draw=red, rounded corners=2mm]
|
|
541 |
{\tiny\color{darkgray}
|
|
542 |
\begin{minipage}{3.4cm}\raggedright
|
|
543 |
\begin{tabular}{r@ {\hspace{1mm}}l}
|
|
544 |
\multicolumn{2}{@ {}l}{list:}\\
|
|
545 |
$\exists\pi.$ & $\text{fv}(x) - as = \text{fv}(y) - bs$\\
|
|
546 |
$\wedge$ & $\text{fv}(x) - as \fresh^* \pi$\\
|
|
547 |
$\wedge$ & $\pi \cdot x = y$\\
|
|
548 |
$\wedge$ & $\pi \cdot as = bs$\\
|
|
549 |
\end{tabular}
|
|
550 |
\end{minipage}};
|
|
551 |
\end{tikzpicture}
|
|
552 |
\end{textblock}}
|
|
553 |
|
|
554 |
\end{frame}}
|
|
555 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
556 |
*}
|
|
557 |
|
|
558 |
text_raw {*
|
|
559 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
560 |
\mode<presentation>{
|
2311
|
561 |
\begin{frame}<1-2>
|
2304
|
562 |
\frametitle{\begin{tabular}{c}Examples\end{tabular}}
|
|
563 |
\mbox{}\\[-3mm]
|
|
564 |
|
|
565 |
\begin{center}
|
|
566 |
\only<1>{$(\{x\}, x) \approx_? (\{x, y\}, x)$}
|
|
567 |
\end{center}
|
|
568 |
|
|
569 |
\begin{itemize}
|
|
570 |
\item $\approx_{\text{res}}$, $\not\approx_{\text{set}}$,
|
|
571 |
$\not\approx_{\text{list}}$
|
|
572 |
\end{itemize}
|
|
573 |
|
|
574 |
|
|
575 |
\only<1->{
|
|
576 |
\begin{textblock}{4}(0.3,12)
|
|
577 |
\begin{tikzpicture}
|
|
578 |
\draw (0,0) node[inner sep=1mm,fill=cream, ultra thick, draw=red, rounded corners=2mm]
|
|
579 |
{\tiny\color{darkgray}
|
|
580 |
\begin{minipage}{3.4cm}\raggedright
|
|
581 |
\begin{tabular}{r@ {\hspace{1mm}}l}
|
|
582 |
\multicolumn{2}{@ {}l}{res:}\\
|
|
583 |
$\exists\pi.$ & $\text{fv}(x) - as = \text{fv}(y) - bs$\\
|
|
584 |
$\wedge$ & $\text{fv}(x) - as \fresh^* \pi$\\
|
|
585 |
$\wedge$ & $\pi \cdot x = y$\\
|
|
586 |
\\
|
|
587 |
\end{tabular}
|
|
588 |
\end{minipage}};
|
|
589 |
\end{tikzpicture}
|
|
590 |
\end{textblock}}
|
|
591 |
\only<1->{
|
|
592 |
\begin{textblock}{4}(5.2,12)
|
|
593 |
\begin{tikzpicture}
|
|
594 |
\draw (0,0) node[inner sep=1mm,fill=cream, ultra thick, draw=red, rounded corners=2mm]
|
|
595 |
{\tiny\color{darkgray}
|
|
596 |
\begin{minipage}{3.4cm}\raggedright
|
|
597 |
\begin{tabular}{r@ {\hspace{1mm}}l}
|
|
598 |
\multicolumn{2}{@ {}l}{set:}\\
|
|
599 |
$\exists\pi.$ & $\text{fv}(x) - as = \text{fv}(y) - bs$\\
|
|
600 |
$\wedge$ & $\text{fv}(x) - as \fresh^* \pi$\\
|
|
601 |
$\wedge$ & $\pi \cdot x = y$\\
|
|
602 |
$\wedge$ & $\pi \cdot as = bs$\\
|
|
603 |
\end{tabular}
|
|
604 |
\end{minipage}};
|
|
605 |
\end{tikzpicture}
|
|
606 |
\end{textblock}}
|
|
607 |
\only<1->{
|
|
608 |
\begin{textblock}{4}(10.2,12)
|
|
609 |
\begin{tikzpicture}
|
|
610 |
\draw (0,0) node[inner sep=1mm,fill=cream, ultra thick, draw=red, rounded corners=2mm]
|
|
611 |
{\tiny\color{darkgray}
|
|
612 |
\begin{minipage}{3.4cm}\raggedright
|
|
613 |
\begin{tabular}{r@ {\hspace{1mm}}l}
|
|
614 |
\multicolumn{2}{@ {}l}{list:}\\
|
|
615 |
$\exists\pi.$ & $\text{fv}(x) - as = \text{fv}(y) - bs$\\
|
|
616 |
$\wedge$ & $\text{fv}(x) - as \fresh^* \pi$\\
|
|
617 |
$\wedge$ & $\pi \cdot x = y$\\
|
|
618 |
$\wedge$ & $\pi \cdot as = bs$\\
|
|
619 |
\end{tabular}
|
|
620 |
\end{minipage}};
|
|
621 |
\end{tikzpicture}
|
|
622 |
\end{textblock}}
|
|
623 |
|
2311
|
624 |
\only<2>{
|
|
625 |
\begin{textblock}{6}(2.5,4)
|
|
626 |
\begin{tikzpicture}
|
|
627 |
\draw (0,0) node[inner sep=5mm,fill=cream, ultra thick, draw=red, rounded corners=2mm]
|
|
628 |
{\normalsize
|
|
629 |
\begin{minipage}{8cm}\raggedright
|
|
630 |
\begin{itemize}
|
|
631 |
\item \color{darkgray}$\alpha$-equivalences coincide when a single name is
|
|
632 |
abstracted
|
|
633 |
\item \color{darkgray}in that case they are equivalent to ``old-fashioned'' definitions of $\alpha$
|
|
634 |
\end{itemize}
|
|
635 |
\end{minipage}};
|
|
636 |
\end{tikzpicture}
|
|
637 |
\end{textblock}}
|
|
638 |
|
2304
|
639 |
\end{frame}}
|
|
640 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
641 |
*}
|
|
642 |
|
|
643 |
text_raw {*
|
|
644 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
645 |
\mode<presentation>{
|
|
646 |
\begin{frame}<1-3>
|
|
647 |
\frametitle{\begin{tabular}{c}General Abstractions\end{tabular}}
|
|
648 |
\mbox{}\\[-7mm]
|
|
649 |
|
|
650 |
\begin{itemize}
|
2311
|
651 |
\item we take $(as, x) \approx\!\makebox[0mm][l]{${}_{{}*{}}$}^{=,\text{supp}} (bs, y)$\medskip
|
|
652 |
\item they are equivalence relations\medskip
|
2304
|
653 |
\item we can therefore use the quotient package to introduce the
|
2311
|
654 |
types $\beta\;\text{abs}_*$\bigskip
|
2304
|
655 |
\begin{center}
|
|
656 |
\only<1>{$[as].\,x$}
|
|
657 |
\only<2>{$\text{supp}([as].x) = \text{supp}(x) - as$}
|
|
658 |
\only<3>{%
|
|
659 |
\begin{tabular}{r@ {\hspace{1mm}}l}
|
|
660 |
\multicolumn{2}{@ {\hspace{-7mm}}l}{$[as]. x \alert{=} [bs].y\;\;\;\text{if\!f}$}\\[2mm]
|
|
661 |
$\exists \pi.$ & $\text{supp}(x) - as = \text{supp}(y) - bs$\\
|
|
662 |
$\wedge$ & $\text{supp}(x) - as \fresh^* \pi$\\
|
|
663 |
$\wedge$ & $\pi \act x = y $\\
|
2311
|
664 |
$(\wedge$ & $\pi \act as = bs)\;^*$\\
|
2304
|
665 |
\end{tabular}}
|
|
666 |
\end{center}
|
|
667 |
\end{itemize}
|
|
668 |
|
2311
|
669 |
\only<1->{
|
|
670 |
\begin{textblock}{8}(12,3.8)
|
|
671 |
\footnotesize $^*$ set, res, list
|
|
672 |
\end{textblock}}
|
2304
|
673 |
|
|
674 |
\end{frame}}
|
|
675 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
676 |
*}
|
|
677 |
|
|
678 |
text_raw {*
|
|
679 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
680 |
\mode<presentation>{
|
|
681 |
\begin{frame}<1>
|
2311
|
682 |
\frametitle{\begin{tabular}{c}A Problem\end{tabular}}
|
2304
|
683 |
\mbox{}\\[-3mm]
|
|
684 |
|
|
685 |
\begin{center}
|
|
686 |
$\text{let}\;x_1=t_1 \ldots x_n=t_n\;\text{in}\;s$
|
|
687 |
\end{center}
|
|
688 |
|
|
689 |
\begin{itemize}
|
|
690 |
\item we cannot represent this as\medskip
|
|
691 |
\begin{center}
|
|
692 |
$\text{let}\;[x_1,\ldots,x_n]\alert{.}s\;\;[t_1,\ldots,t_n]$
|
|
693 |
\end{center}\bigskip
|
|
694 |
|
|
695 |
because\medskip
|
|
696 |
\begin{center}
|
|
697 |
$\text{let}\;[x].s\;\;[t_1,t_2]$
|
|
698 |
\end{center}
|
|
699 |
\end{itemize}
|
|
700 |
|
|
701 |
|
|
702 |
\end{frame}}
|
|
703 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
704 |
*}
|
|
705 |
|
|
706 |
text_raw {*
|
|
707 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
708 |
\mode<presentation>{
|
|
709 |
\begin{frame}<1->
|
|
710 |
\frametitle{\begin{tabular}{c}Our Specifications\end{tabular}}
|
|
711 |
\mbox{}\\[-6mm]
|
|
712 |
|
|
713 |
\mbox{}\hspace{10mm}
|
|
714 |
\begin{tabular}{ll}
|
|
715 |
\multicolumn{2}{l}{\isacommand{nominal\_datatype} trm $=$}\\
|
|
716 |
\hspace{5mm}\phantom{$|$} Var name\\
|
|
717 |
\hspace{5mm}$|$ App trm trm\\
|
|
718 |
\hspace{5mm}$|$ Lam x::name t::trm
|
|
719 |
& \isacommand{bind} x \isacommand{in} t\\
|
|
720 |
\hspace{5mm}$|$ Let as::assn t::trm
|
|
721 |
& \isacommand{bind} bn(as) \isacommand{in} t\\
|
|
722 |
\multicolumn{2}{l}{\isacommand{and} assn $=$}\\
|
|
723 |
\multicolumn{2}{l}{\hspace{5mm}\phantom{$|$} ANil}\\
|
|
724 |
\multicolumn{2}{l}{\hspace{5mm}$|$ ACons name trm assn}\\
|
|
725 |
\multicolumn{2}{l}{\isacommand{binder} bn \isacommand{where}}\\
|
|
726 |
\multicolumn{2}{l}{\hspace{5mm}\phantom{$|$} bn(ANil) $=$ $[]$}\\
|
|
727 |
\multicolumn{2}{l}{\hspace{5mm}$|$ bn(ACons a t as) $=$ $[$a$]$ @ bn(as)}\\
|
|
728 |
\end{tabular}
|
|
729 |
|
|
730 |
\end{frame}}
|
|
731 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
732 |
*}
|
|
733 |
|
|
734 |
text_raw {*
|
|
735 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
736 |
\mode<presentation>{
|
|
737 |
\begin{frame}<1-2>
|
|
738 |
\frametitle{\begin{tabular}{c}``Raw'' Definitions\end{tabular}}
|
|
739 |
\mbox{}\\[-6mm]
|
|
740 |
|
|
741 |
\mbox{}\hspace{10mm}
|
|
742 |
\begin{tabular}{ll}
|
|
743 |
\multicolumn{2}{l}{\isacommand{datatype} trm $=$}\\
|
|
744 |
\hspace{5mm}\phantom{$|$} Var name\\
|
|
745 |
\hspace{5mm}$|$ App trm trm\\
|
|
746 |
\hspace{5mm}$|$ Lam name trm\\
|
|
747 |
\hspace{5mm}$|$ Let assn trm\\
|
|
748 |
\multicolumn{2}{l}{\isacommand{and} assn $=$}\\
|
|
749 |
\multicolumn{2}{l}{\hspace{5mm}\phantom{$|$} ANil}\\
|
|
750 |
\multicolumn{2}{l}{\hspace{5mm}$|$ ACons name trm assn}\\[5mm]
|
|
751 |
\multicolumn{2}{l}{\isacommand{function} bn \isacommand{where}}\\
|
|
752 |
\multicolumn{2}{l}{\hspace{5mm}\phantom{$|$} bn(ANil) $=$ $[]$}\\
|
|
753 |
\multicolumn{2}{l}{\hspace{5mm}$|$ bn(ACons a t as) $=$ $[$a$]$ @ bn(as)}\\
|
|
754 |
\end{tabular}
|
|
755 |
|
|
756 |
\only<2>{
|
|
757 |
\begin{textblock}{5}(10,5)
|
|
758 |
$+$ \begin{tabular}{l}automatically\\
|
|
759 |
generate fv's\end{tabular}
|
|
760 |
\end{textblock}}
|
|
761 |
\end{frame}}
|
|
762 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
763 |
*}
|
|
764 |
|
|
765 |
text_raw {*
|
|
766 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
767 |
\mode<presentation>{
|
|
768 |
\begin{frame}<1>
|
|
769 |
\frametitle{\begin{tabular}{c}\LARGE``Raw'' Alpha-Equivalence\end{tabular}}
|
|
770 |
\mbox{}\\[6mm]
|
|
771 |
|
|
772 |
\begin{center}
|
|
773 |
Lam x::name t::trm \hspace{10mm}\isacommand{bind} x \isacommand{in} t\\
|
|
774 |
\end{center}
|
|
775 |
|
|
776 |
|
|
777 |
\[
|
|
778 |
\infer[\text{Lam-}\!\approx_\alpha]
|
|
779 |
{\text{Lam}\;x\;t \approx_\alpha \text{Lam}\;x'\;t'}
|
|
780 |
{([x], t) \approx\!\makebox[0mm][l]{${}_{\text{list}}$}
|
|
781 |
^{\approx_\alpha,\text{fv}} ([x'], t')}
|
|
782 |
\]
|
|
783 |
|
|
784 |
|
|
785 |
\end{frame}}
|
|
786 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
787 |
*}
|
|
788 |
|
|
789 |
text_raw {*
|
|
790 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
791 |
\mode<presentation>{
|
|
792 |
\begin{frame}<1>
|
|
793 |
\frametitle{\begin{tabular}{c}\LARGE``Raw'' Alpha-Equivalence\end{tabular}}
|
|
794 |
\mbox{}\\[6mm]
|
|
795 |
|
|
796 |
\begin{center}
|
|
797 |
Lam x::name y::name t::trm s::trm \hspace{5mm}\isacommand{bind} x y \isacommand{in} t s\\
|
|
798 |
\end{center}
|
|
799 |
|
|
800 |
|
|
801 |
\[
|
|
802 |
\infer[\text{Lam-}\!\approx_\alpha]
|
|
803 |
{\text{Lam}\;x\;y\;t\;s \approx_\alpha \text{Lam}\;x'\;y'\;t'\;s'}
|
|
804 |
{([x, y], (t, s)) \approx\!\makebox[0mm][l]{${}_{\text{list}}$}
|
|
805 |
^{R, fv} ([x', y'], (t', s'))}
|
|
806 |
\]
|
|
807 |
|
|
808 |
\footnotesize
|
2309
|
809 |
where $R =\;\approx_\alpha\times\approx_\alpha$ and $fv = \text{fv}\cup\text{fv}$
|
2304
|
810 |
|
|
811 |
\end{frame}}
|
|
812 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
813 |
*}
|
|
814 |
|
|
815 |
text_raw {*
|
|
816 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
817 |
\mode<presentation>{
|
|
818 |
\begin{frame}<1-2>
|
|
819 |
\frametitle{\begin{tabular}{c}\LARGE``Raw'' Alpha-Equivalence\end{tabular}}
|
|
820 |
\mbox{}\\[6mm]
|
|
821 |
|
|
822 |
\begin{center}
|
|
823 |
Let as::assn t::trm \hspace{10mm}\isacommand{bind} bn(as) \isacommand{in} t\\
|
|
824 |
\end{center}
|
|
825 |
|
|
826 |
|
|
827 |
\[
|
|
828 |
\infer[\text{Let-}\!\approx_\alpha]
|
|
829 |
{\text{Let}\;as\;t \approx_\alpha \text{Let}\;as'\;t'}
|
|
830 |
{(\text{bn}(as), t) \approx\!\makebox[0mm][l]{${}_{\text{list}}$}
|
|
831 |
^{\approx_\alpha,\text{fv}} (\text{bn}(as'), t') &
|
2311
|
832 |
\onslide<2->{as \approx_\alpha^{\text{bn}} as'}}
|
|
833 |
\]\bigskip
|
2304
|
834 |
|
|
835 |
|
2311
|
836 |
\onslide<1->{\small{}bn-function $\Rightarrow$ \alert{deep binders}}
|
2304
|
837 |
\end{frame}}
|
|
838 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
839 |
*}
|
|
840 |
|
2311
|
841 |
|
2304
|
842 |
text_raw {*
|
|
843 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
844 |
\mode<presentation>{
|
|
845 |
\begin{frame}<1->
|
|
846 |
\frametitle{\begin{tabular}{c}\LARGE{}$\alpha$ for Binding Functions\end{tabular}}
|
|
847 |
\mbox{}\\[-6mm]
|
|
848 |
|
|
849 |
\mbox{}\hspace{10mm}
|
|
850 |
\begin{tabular}{l}
|
|
851 |
\ldots\\
|
|
852 |
\isacommand{binder} bn \isacommand{where}\\
|
|
853 |
\phantom{$|$} bn(ANil) $=$ $[]$\\
|
|
854 |
$|$ bn(ACons a t as) $=$ $[$a$]$ @ bn(as)\\
|
|
855 |
\end{tabular}\bigskip
|
|
856 |
|
|
857 |
\begin{center}
|
|
858 |
\mbox{\infer{\text{ANil} \approx_\alpha^{\text{bn}} \text{ANil}}{}}\bigskip
|
|
859 |
|
|
860 |
\mbox{\infer{\text{ACons}\;a\;t\;as \approx_\alpha^{\text{bn}} \text{ACons}\;a'\;t'\;as'}
|
|
861 |
{t \approx_\alpha t' & as \approx_\alpha^{bn} as'}}
|
|
862 |
\end{center}
|
|
863 |
|
|
864 |
|
|
865 |
\end{frame}}
|
|
866 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
867 |
*}
|
|
868 |
|
2311
|
869 |
|
|
870 |
text_raw {*
|
|
871 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
872 |
\mode<presentation>{
|
|
873 |
\begin{frame}<1>
|
|
874 |
\frametitle{\begin{tabular}{c}\LARGE``Raw'' Alpha-Equivalence\end{tabular}}
|
|
875 |
\mbox{}\\[6mm]
|
|
876 |
|
|
877 |
\begin{center}
|
|
878 |
LetRec as::assn t::trm \hspace{10mm}\isacommand{bind} bn(as) \isacommand{in} t \alert{as}\\
|
|
879 |
\end{center}
|
|
880 |
|
|
881 |
|
|
882 |
\[\mbox{}\hspace{-4mm}
|
|
883 |
\infer[\text{LetRec-}\!\approx_\alpha]
|
|
884 |
{\text{LetRec}\;as\;t \approx_\alpha \text{LetRec}\;as'\;t'}
|
|
885 |
{(\text{bn}(as), (t, as)) \approx\!\makebox[0mm][l]{${}_{\text{list}}$}
|
|
886 |
^{R,fv} (\text{bn}(as'), (t', as'))}
|
|
887 |
\]\bigskip
|
|
888 |
|
|
889 |
\onslide<1->{\alert{deep recursive binders}}
|
|
890 |
\end{frame}}
|
|
891 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
892 |
*}
|
|
893 |
|
|
894 |
text_raw {*
|
|
895 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
896 |
\mode<presentation>{
|
|
897 |
\begin{frame}<1->
|
|
898 |
\frametitle{\begin{tabular}{c}Restrictions\end{tabular}}
|
|
899 |
\mbox{}\\[-6mm]
|
|
900 |
|
|
901 |
Our restrictions on binding specifications:
|
|
902 |
|
|
903 |
\begin{itemize}
|
|
904 |
\item a body can only occur once in a list of binding clauses\medskip
|
|
905 |
\item you can only have one binding function for a deep binder\medskip
|
|
906 |
\item binding functions can return: the empty set, singletons, unions (similarly for lists)
|
|
907 |
\end{itemize}
|
|
908 |
|
|
909 |
|
|
910 |
\end{frame}}
|
|
911 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
912 |
*}
|
|
913 |
|
2304
|
914 |
text_raw {*
|
|
915 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
916 |
\mode<presentation>{
|
|
917 |
\begin{frame}<1->
|
|
918 |
\frametitle{\begin{tabular}{c}Automatic Proofs\end{tabular}}
|
|
919 |
\mbox{}\\[-6mm]
|
|
920 |
|
|
921 |
\begin{itemize}
|
|
922 |
\item we can show that $\alpha$'s are equivalence relations\medskip
|
2311
|
923 |
\item as a result we can use our quotient package to introduce the type(s)
|
2304
|
924 |
of $\alpha$-equated terms
|
|
925 |
|
|
926 |
\[
|
|
927 |
\infer
|
|
928 |
{\text{Lam}\;x\;t \alert{=} \text{Lam}\;x'\;t'}
|
|
929 |
{\only<1>{([x], t) \approx\!\makebox[0mm][l]{${}_{\text{list}}$}
|
|
930 |
^{=,\text{supp}} ([x'], t')}%
|
|
931 |
\only<2>{[x].t = [x'].t'}}
|
|
932 |
\]
|
|
933 |
|
|
934 |
|
|
935 |
\item the properties for support are implied by the properties of $[\_].\_$
|
2311
|
936 |
\item we can derive strong induction principles (almost automatic---matter of time)
|
2304
|
937 |
\end{itemize}
|
|
938 |
|
|
939 |
|
|
940 |
\end{frame}}
|
|
941 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
942 |
*}
|
|
943 |
|
|
944 |
text_raw {*
|
|
945 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
946 |
\mode<presentation>{
|
2309
|
947 |
\begin{frame}<1>[t]
|
|
948 |
\frametitle{\begin{tabular}{c}Runtime is Acceptable\end{tabular}}
|
|
949 |
\mbox{}\\[-7mm]\mbox{}
|
|
950 |
|
|
951 |
\footnotesize
|
|
952 |
\begin{center}
|
|
953 |
\begin{tikzpicture}
|
2313
|
954 |
\draw (0,0) node[inner sep=2mm, ultra thick, draw=fg, rounded corners=2mm]
|
2309
|
955 |
(A) {\begin{minipage}{0.8cm}bind.\\spec.\end{minipage}};
|
|
956 |
|
2313
|
957 |
\draw (2,0) node[inner sep=2mm, ultra thick, draw=fg, rounded corners=2mm]
|
2309
|
958 |
(B) {\begin{minipage}{0.8cm}raw\\terms\end{minipage}};
|
|
959 |
|
2313
|
960 |
\draw (4,0) node[inner sep=2mm, ultra thick, draw=fg, rounded corners=2mm]
|
2309
|
961 |
(C) {\begin{minipage}{0.8cm}$\alpha$-\\equiv.\end{minipage}};
|
|
962 |
|
2313
|
963 |
\draw (0,-2) node[inner sep=2mm, ultra thick, draw=fg, rounded corners=2mm]
|
2309
|
964 |
(D) {\begin{minipage}{0.8cm}quot.\\type\end{minipage}};
|
|
965 |
|
2313
|
966 |
\draw (2,-2) node[inner sep=2mm, ultra thick, draw=fg, rounded corners=2mm]
|
2309
|
967 |
(E) {\begin{minipage}{0.8cm}lift\\thms\end{minipage}};
|
|
968 |
|
2313
|
969 |
\draw (4,-2) node[inner sep=2mm, ultra thick, draw=fg, rounded corners=2mm]
|
2309
|
970 |
(F) {\begin{minipage}{0.8cm}add.\\thms\end{minipage}};
|
|
971 |
|
2313
|
972 |
\draw[->,fg!50,line width=1mm] (A) -- (B);
|
|
973 |
\draw[->,fg!50,line width=1mm] (B) -- (C);
|
|
974 |
\draw[->,fg!50,line width=1mm, line join=round, rounded corners=2mm]
|
2309
|
975 |
(C) -- (5,0) -- (5,-1) -- (-1,-1) -- (-1,-2) -- (D);
|
2313
|
976 |
\draw[->,fg!50,line width=1mm] (D) -- (E);
|
|
977 |
\draw[->,fg!50,line width=1mm] (E) -- (F);
|
2309
|
978 |
\end{tikzpicture}
|
|
979 |
\end{center}
|
|
980 |
|
|
981 |
\begin{itemize}
|
2311
|
982 |
\item Core Haskell: 11 types, 49 term-constructors, 7 binding functions
|
|
983 |
\begin{center}
|
|
984 |
$\sim$ 1 min
|
|
985 |
\end{center}
|
2309
|
986 |
\end{itemize}
|
|
987 |
|
|
988 |
\end{frame}}
|
|
989 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
990 |
*}
|
|
991 |
|
|
992 |
|
|
993 |
text_raw {*
|
|
994 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
995 |
\mode<presentation>{
|
|
996 |
\begin{frame}<1->
|
|
997 |
\frametitle{\begin{tabular}{c}Interesting Phenomenon\end{tabular}}
|
|
998 |
\mbox{}\\[-6mm]
|
|
999 |
|
|
1000 |
\small
|
2313
|
1001 |
\mbox{}\hspace{20mm}
|
2309
|
1002 |
\begin{tabular}{ll}
|
|
1003 |
\multicolumn{2}{l}{\isacommand{nominal\_datatype} trm $=$}\\
|
|
1004 |
\hspace{5mm}\phantom{$|$} Var name\\
|
|
1005 |
\hspace{5mm}$|$ App trm trm\\
|
|
1006 |
\hspace{5mm}$|$ Lam x::name t::trm
|
|
1007 |
& \isacommand{bind} x \isacommand{in} t\\
|
|
1008 |
\hspace{5mm}$|$ Let as::assn t::trm
|
|
1009 |
& \isacommand{bind} bn(as) \isacommand{in} t\\
|
|
1010 |
\multicolumn{2}{l}{\isacommand{and} assn $=$}\\
|
|
1011 |
\multicolumn{2}{l}{\hspace{5mm}\phantom{$|$} ANil}\\
|
|
1012 |
\multicolumn{2}{l}{\hspace{5mm}$|$ ACons name trm assn}\\
|
|
1013 |
\multicolumn{2}{l}{\isacommand{binder} bn \isacommand{where}}\\
|
|
1014 |
\multicolumn{2}{l}{\hspace{5mm}\phantom{$|$} bn(ANil) $=$ $[]$}\\
|
|
1015 |
\multicolumn{2}{l}{\hspace{5mm}$|$ bn(ACons a t as) $=$ $[$a$]$ @ bn(as)}\\
|
|
1016 |
\end{tabular}\bigskip\medskip
|
|
1017 |
|
|
1018 |
we cannot quotient assn: ACons a \ldots $\not\approx_\alpha$ ACons b \ldots
|
|
1019 |
|
2313
|
1020 |
\only<1->{
|
|
1021 |
\begin{textblock}{8}(0.2,7.3)
|
|
1022 |
\alert{\begin{tabular}{p{2.6cm}}
|
|
1023 |
\raggedright\footnotesize{}Should a ``naked'' assn be quotient?
|
|
1024 |
\end{tabular}\hspace{-3mm}
|
|
1025 |
$\begin{cases}
|
|
1026 |
\mbox{} \\ \mbox{}
|
|
1027 |
\end{cases}$}
|
|
1028 |
\end{textblock}}
|
2309
|
1029 |
\end{frame}}
|
|
1030 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
1031 |
*}
|
|
1032 |
|
|
1033 |
text_raw {*
|
|
1034 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
1035 |
\mode<presentation>{
|
2304
|
1036 |
\begin{frame}<1->
|
|
1037 |
\frametitle{\begin{tabular}{c}Conclusion\end{tabular}}
|
|
1038 |
\mbox{}\\[-6mm]
|
|
1039 |
|
|
1040 |
\begin{itemize}
|
|
1041 |
\item the user does not see anything of the raw level\medskip
|
|
1042 |
\only<1>{\begin{center}
|
2309
|
1043 |
Lam a (Var a) \alert{$=$} Lam b (Var b)
|
2304
|
1044 |
\end{center}\bigskip}
|
|
1045 |
|
|
1046 |
\item<2-> we have not yet done function definitions (will come soon and
|
|
1047 |
we hope to make improvements over the old way there too)\medskip
|
2309
|
1048 |
\item<3-> it took quite some time to get here, but it seems worthwhile
|
|
1049 |
(Barendregt's variable convention is unsound in general,
|
|
1050 |
found bugs in two paper proofs, quotient package, POPL 2011 tutorial)\medskip
|
2304
|
1051 |
\end{itemize}
|
|
1052 |
|
|
1053 |
|
|
1054 |
\end{frame}}
|
|
1055 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
1056 |
*}
|
2299
|
1057 |
|
2311
|
1058 |
text_raw {*
|
|
1059 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
1060 |
\mode<presentation>{
|
|
1061 |
\begin{frame}<1->[c]
|
|
1062 |
\frametitle{\begin{tabular}{c}Questions?\end{tabular}}
|
|
1063 |
\mbox{}\\[-6mm]
|
|
1064 |
|
|
1065 |
\begin{center}
|
|
1066 |
\alert{\huge{Thanks!}}
|
|
1067 |
\end{center}
|
|
1068 |
|
|
1069 |
\end{frame}}
|
|
1070 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
1071 |
*}
|
|
1072 |
|
2313
|
1073 |
text_raw {*
|
|
1074 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
1075 |
\mode<presentation>{
|
|
1076 |
\begin{frame}<1-2>[c]
|
|
1077 |
\frametitle{\begin{tabular}{c}Examples\end{tabular}}
|
|
1078 |
\mbox{}\\[-6mm]
|
|
1079 |
|
|
1080 |
\begin{center}
|
|
1081 |
$(\{a,b\}, a \rightarrow b) \approx_\alpha (\{a, b\}, a \rightarrow b)$
|
|
1082 |
$(\{a,b\}, a \rightarrow b) \approx_\alpha (\{a, b\}, b \rightarrow a)$
|
|
1083 |
\end{center}
|
|
1084 |
|
|
1085 |
\begin{center}
|
|
1086 |
$(\{a,b\}, (a \rightarrow b, a \rightarrow b))$\\
|
|
1087 |
\hspace{17mm}$\not\approx_\alpha (\{a, b\}, (a \rightarrow b, b \rightarrow a))$
|
|
1088 |
\end{center}
|
|
1089 |
|
|
1090 |
\onslide<2->
|
|
1091 |
{1.) \hspace{3mm}\isacommand{bind\_set} as \isacommand{in} $\tau_1$,
|
|
1092 |
\isacommand{bind\_set} as \isacommand{in} $\tau_2$\medskip
|
|
1093 |
|
|
1094 |
2.) \hspace{3mm}\isacommand{bind\_set} as \isacommand{in} $\tau_1$ $\tau_2$
|
|
1095 |
}
|
|
1096 |
|
|
1097 |
\end{frame}}
|
|
1098 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
1099 |
*}
|
|
1100 |
|
2299
|
1101 |
(*<*)
|
|
1102 |
end
|
|
1103 |
(*>*) |