245 |
272 |
246 \end{frame}} |
273 \end{frame}} |
247 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
274 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
248 *} |
275 *} |
249 |
276 |
250 text_raw {* |
|
251 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
252 \mode<presentation>{ |
|
253 \begin{frame}<1-5> |
|
254 \frametitle{\begin{tabular}{c}Inspiration from Ott\end{tabular}} |
|
255 \mbox{}\\[-3mm] |
|
256 |
|
257 \begin{itemize} |
|
258 \item this way of specifying binding is inspired by |
|
259 {\bf Ott}\onslide<2->{, \alert{\bf but} we made some adjustments:}\medskip |
|
260 |
|
261 |
|
262 \only<2>{ |
|
263 \begin{itemize} |
|
264 \item Ott allows specifications like\smallskip |
|
265 \begin{center} |
|
266 $t ::= t\;t\; |\;\lambda x.t$ |
|
267 \end{center} |
|
268 \end{itemize}} |
|
269 |
|
270 \only<3-4>{ |
|
271 \begin{itemize} |
|
272 \item whether something is bound can depend in Ott on other bound things\smallskip |
|
273 \begin{center} |
|
274 \begin{tikzpicture} |
|
275 \node (A) at (-0.5,1) {Foo $(\lambda y. \lambda x. t)$}; |
|
276 \node (B) at ( 1.1,1) {$s$}; |
|
277 \onslide<4>{\node (C) at (0.5,0) {$\{y, x\}$};} |
|
278 \onslide<4>{\draw[->,red,line width=1mm] (A) -- (C);} |
|
279 \onslide<4>{\draw[->,red,line width=1mm] (C) -- (B);} |
|
280 \end{tikzpicture} |
|
281 \end{center} |
|
282 \onslide<4>{this might make sense for ``raw'' terms, but not at all |
|
283 for $\alpha$-equated terms} |
|
284 \end{itemize}} |
|
285 |
|
286 \only<5>{ |
|
287 \begin{itemize} |
|
288 \item we allow multiple ``binders'' and ``bodies''\smallskip |
|
289 \begin{center} |
|
290 \begin{tabular}{l} |
|
291 \isacommand{bind} a b c \ldots \isacommand{in} x y z \ldots\\ |
|
292 \isacommand{bind (set)} a b c \ldots \isacommand{in} x y z \ldots\\ |
|
293 \isacommand{bind (set+)} a b c \ldots \isacommand{in} x y z \ldots |
|
294 \end{tabular} |
|
295 \end{center}\bigskip\medskip |
|
296 the reason is that with our definition of $\alpha$-equivalence\medskip |
|
297 \begin{center} |
|
298 \begin{tabular}{l} |
|
299 \isacommand{bind (set+)} as \isacommand{in} x y $\not\Leftrightarrow$\\ |
|
300 \hspace{8mm}\isacommand{bind (set+)} as \isacommand{in} x, \isacommand{bind (set+)} as \isacommand{in} y |
|
301 \end{tabular} |
|
302 \end{center}\medskip |
|
303 |
|
304 same with \isacommand{bind (set)} |
|
305 \end{itemize}} |
|
306 \end{itemize} |
|
307 |
|
308 |
|
309 \end{frame}} |
|
310 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
311 *} |
|
312 |
|
313 text_raw {* |
|
314 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
315 \mode<presentation>{ |
|
316 \begin{frame}<1> |
|
317 \frametitle{\begin{tabular}{c}Alpha-Equivalence\end{tabular}} |
|
318 \mbox{}\\[-3mm] |
|
319 |
|
320 \begin{itemize} |
|
321 \item in the old Nominal Isabelle, we represented single binders as partial functions:\bigskip |
|
322 |
|
323 \begin{center} |
|
324 \begin{tabular}{l} |
|
325 Lam [$a$].\,$t$ $\;{^\text{``}}\!\dn{}\!^{\text{''}}$\\[2mm] |
|
326 \;\;\;\;$\lambda b.$\;$\text{if}\;a = b\;\text{then}\;t\;\text{else}$\\ |
|
327 \phantom{\;\;\;\;$\lambda b.$\;\;\;\;\;\;}$\text{if}\;b \fresh t\; |
|
328 \text{then}\;(a\;b)\act t\;\text{else}\;\text{error}$ |
|
329 \end{tabular} |
|
330 \end{center} |
|
331 \end{itemize} |
|
332 |
|
333 \begin{textblock}{10}(2,14) |
|
334 \footnotesize $^*$ alpha-equality coincides with equality on functions |
|
335 \end{textblock} |
|
336 \end{frame}} |
|
337 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
338 *} |
|
339 |
|
340 text_raw {* |
|
341 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
342 \mode<presentation>{ |
|
343 \begin{frame}<1-> |
|
344 \frametitle{\begin{tabular}{c}New Design\end{tabular}} |
|
345 \mbox{}\\[4mm] |
|
346 |
|
347 \begin{center} |
|
348 \begin{tikzpicture} |
|
349 {\draw (0,0) node[inner sep=3mm, ultra thick, draw=fg, rounded corners=2mm] |
|
350 (A) {\begin{minipage}{1.1cm}bind.\\spec.\end{minipage}};} |
|
351 |
|
352 {\draw (3,0) node[inner sep=3mm, ultra thick, draw=fg, rounded corners=2mm] |
|
353 (B) {\begin{minipage}{1.1cm}raw\\terms\end{minipage}};} |
|
354 |
|
355 \alt<2> |
|
356 {\draw (6,0) node[inner sep=3mm, ultra thick, draw=red, rounded corners=2mm] |
|
357 (C) {\textcolor{red}{\begin{minipage}{1.1cm}$\alpha$-\\equiv.\end{minipage}}};} |
|
358 {\draw (6,0) node[inner sep=3mm, ultra thick, draw=fg, rounded corners=2mm] |
|
359 (C) {\begin{minipage}{1.1cm}$\alpha$-\\equiv.\end{minipage}};} |
|
360 |
|
361 {\draw (0,-3) node[inner sep=3mm, ultra thick, draw=fg, rounded corners=2mm] |
|
362 (D) {\begin{minipage}{1.1cm}quot.\\type\end{minipage}};} |
|
363 |
|
364 {\draw (3,-3) node[inner sep=3mm, ultra thick, draw=fg, rounded corners=2mm] |
|
365 (E) {\begin{minipage}{1.1cm}lift\\thms\end{minipage}};} |
|
366 |
|
367 {\draw (6,-3) node[inner sep=3mm, ultra thick, draw=fg, rounded corners=2mm] |
|
368 (F) {\begin{minipage}{1.1cm}add.\\thms\end{minipage}};} |
|
369 |
|
370 \draw[->,fg!50,line width=1mm] (A) -- (B); |
|
371 \draw[->,fg!50,line width=1mm] (B) -- (C); |
|
372 \draw[->,fg!50,line width=1mm, line join=round, rounded corners=2mm] |
|
373 (C) -- (8,0) -- (8,-1.5) -- (-2,-1.5) -- (-2,-3) -- (D); |
|
374 \draw[->,fg!50,line width=1mm] (D) -- (E); |
|
375 \draw[->,fg!50,line width=1mm] (E) -- (F); |
|
376 \end{tikzpicture} |
|
377 \end{center} |
|
378 |
|
379 \end{frame}} |
|
380 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
381 *} |
|
382 |
|
383 |
|
384 |
277 |
385 text_raw {* |
278 text_raw {* |
386 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
279 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
387 \mode<presentation>{ |
280 \mode<presentation>{ |
388 \begin{frame}<1-8> |
281 \begin{frame}<1-8> |
390 \mbox{}\\[-3mm] |
283 \mbox{}\\[-3mm] |
391 |
284 |
392 \begin{itemize} |
285 \begin{itemize} |
393 \item lets first look at pairs\bigskip\medskip |
286 \item lets first look at pairs\bigskip\medskip |
394 |
287 |
395 \begin{tabular}{@ {\hspace{1cm}}l} |
288 \textcolor{blue}{\begin{tabular}{@ {\hspace{1cm}}l} |
396 $(as, x) \onslide<2->{\approx\!}\makebox[0mm][l]{\only<2-6>{${}_{\text{set}}$}% |
289 $(as, x) \onslide<2->{\approx\!}\makebox[5mm][l]{\only<2-6>{${}_{\text{set}}$}% |
397 \only<7>{${}_{\text{\alert{list}}}$}% |
290 \only<7>{${}_{\text{\alert{list}}}$}% |
398 \only<8>{${}_{\text{\alert{set+}}}$}}% |
291 \only<8>{${}_{\text{\alert{set+}}}$}}% |
399 \onslide<3->{^{R,\text{fv}}}\,\onslide<2->{(bs,y)}$ |
292 \,\onslide<2->{(bs,y)}$ |
400 \end{tabular}\bigskip |
293 \end{tabular}}\bigskip |
401 \end{itemize} |
294 \end{itemize} |
402 |
295 |
403 \only<1>{ |
296 \only<1>{ |
404 \begin{textblock}{8}(3,8.5) |
297 \begin{textblock}{8}(3,8.5) |
405 \begin{tabular}{l@ {\hspace{2mm}}p{8cm}} |
298 \begin{tabular}{l@ {\hspace{2mm}}p{8cm}} |
406 & $as$ is a set of names\ldots the binders\\ |
299 & \textcolor{blue}{$as$} is a set of names\ldots the binders\\ |
407 & $x$ is the body (might be a tuple)\\ |
300 & \textcolor{blue}{$x$} is the body (might be a tuple)\\ |
408 & $\approx_{\text{set}}$ is where the cardinality |
301 & \textcolor{blue}{$\approx_{\text{set}}$} is where the cardinality |
409 of the binders has to be the same\\ |
302 of the binders has to be the same\\ |
410 \end{tabular} |
303 \end{tabular} |
411 \end{textblock}} |
304 \end{textblock}} |
412 |
305 |
413 \only<4->{ |
306 \only<4->{ |
414 \begin{textblock}{12}(5,8) |
307 \begin{textblock}{12}(5,8) |
|
308 \textcolor{blue}{ |
415 \begin{tabular}{ll@ {\hspace{1mm}}l} |
309 \begin{tabular}{ll@ {\hspace{1mm}}l} |
416 $\dn$ & \onslide<5->{$\exists \pi.\,$} & $\text{fv}(x) - as = \text{fv}(y) - bs$\\[1mm] |
310 $\dn$ & \onslide<5->{$\exists \pi.\,$} & $\text{fv}(x) - as = \text{fv}(y) - bs$\\[1mm] |
417 & \onslide<5->{$\;\;\;\wedge$} & \onslide<5->{$\text{fv}(x) - as \fresh^* \pi$}\\[1mm] |
311 & \onslide<5->{$\;\;\;\wedge$} & \onslide<5->{$\text{fv}(x) - as \fresh^* \pi$}\\[1mm] |
418 & \onslide<5->{$\;\;\;\wedge$} & \onslide<5->{$(\pi \act x)\;R\;y$}\\[1mm] |
312 & \onslide<5->{$\;\;\;\wedge$} & \onslide<5->{$(\pi \act x) = y$}\\[1mm] |
419 & \onslide<6-7>{$\;\;\;\wedge$} & \onslide<6-7>{$\pi \act as = bs$}\\ |
313 & \only<6-7>{$\;\;\;\wedge$}\only<8>{\textcolor{gray}{\xout{$\;\;\;\wedge$}}} & |
420 \end{tabular} |
314 \only<6-7>{$\pi \act as = bs$}\only<8>{\textcolor{gray}{\xout{$\pi \act as = bs$}}}\\ |
|
315 \end{tabular}} |
421 \end{textblock}} |
316 \end{textblock}} |
422 |
317 |
423 \only<7>{ |
318 \only<7>{ |
424 \begin{textblock}{7}(3,13.8) |
319 \begin{textblock}{7}(3,13.8) |
425 \footnotesize $^*$ $as$ and $bs$ are \alert{lists} of names |
320 \footnotesize $^*$ $as$ and $bs$ are \alert{lists} of names |
753 *} |
587 *} |
754 |
588 |
755 text_raw {* |
589 text_raw {* |
756 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
590 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
757 \mode<presentation>{ |
591 \mode<presentation>{ |
758 \begin{frame}<1-2> |
592 \begin{frame}<1>[c] |
759 \frametitle{\begin{tabular}{c}``Raw'' Definitions\end{tabular}} |
593 \frametitle{\begin{tabular}{c}Binding Functions\end{tabular}} |
|
594 |
|
595 \begin{center} |
|
596 \begin{tikzpicture} |
|
597 \node (A) at (-0.5,1) {Foo $(\lambda y. \lambda x. t)$}; |
|
598 \node (B) at ( 1.5,1) {$s$}; |
|
599 \onslide<1>{\node (C) at (0.5,-0.5) {$\{y, x\}$};} |
|
600 \onslide<1>{\draw[->,red,line width=1mm] (A) -- (C);} |
|
601 \onslide<1>{\draw[->,red,line width=1mm] (C) -- (B);} |
|
602 \end{tikzpicture} |
|
603 \end{center} |
|
604 |
|
605 |
|
606 \end{frame}} |
|
607 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
608 *} |
|
609 |
|
610 text_raw {* |
|
611 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
612 \mode<presentation>{ |
|
613 \begin{frame}<1->[t] |
|
614 \frametitle{\begin{tabular}{c}Binder Clauses\end{tabular}} |
|
615 |
|
616 \begin{itemize} |
|
617 \item We need for a bound variable to have a `clear scope', and bound |
|
618 variables should not be free and bound at the same time.\bigskip |
|
619 \end{itemize} |
|
620 |
|
621 \begin{center} |
|
622 \only<1>{ |
|
623 \begin{tabular}{@ {\hspace{-5mm}}l} |
|
624 \alert{\bf shallow binders}\\ |
|
625 \hspace{4mm}Lam x::name t::trm\hspace{4mm} \isacommand{bind} x \isacommand{in} t\\ |
|
626 \hspace{4mm}All xs::name set T::ty\hspace{4mm} \isacommand{bind} xs \isacommand{in} T\\ |
|
627 \hspace{4mm}Foo x::name t$_1$::trm t$_2$::trm\hspace{4mm} |
|
628 \isacommand{bind} x \isacommand{in} t$_1$, \isacommand{bind} x \isacommand{in} t$_2$\\ |
|
629 \hspace{4mm}Bar x::name t$_1$::trm t$_2$::trm\hspace{4mm} |
|
630 \isacommand{bind} x \isacommand{in} t$_1$ t$_2$\\ |
|
631 \end{tabular}} |
|
632 \only<2>{ |
|
633 \begin{tabular}{@ {\hspace{-5mm}}l} |
|
634 \alert{\bf deep binders} \\ |
|
635 \hspace{4mm}Let as::assns t::trm\hspace{4mm} \isacommand{bind} bn(as) \isacommand{in} t\\ |
|
636 \hspace{4mm}Foo as::assns t$_1$::trm t$_2$::trm\\ |
|
637 \hspace{20mm}\isacommand{bind} bn(as) \isacommand{in} t$_1$, \isacommand{bind} bn(as) \isacommand{in} t$_2$\\[4mm] |
|
638 \makebox[0mm][l]{\alert{$\times$}}\hspace{4mm}Bar as::assns t$_1$::trm t$_2$::trm\\ |
|
639 \hspace{20mm}\isacommand{bind} bn$_1$(as) \isacommand{in} t$_1$, \isacommand{bind} bn$_2$(as) \isacommand{in} t$_2$\\ |
|
640 \end{tabular}} |
|
641 \only<3>{ |
|
642 \begin{tabular}{@ {\hspace{-5mm}}l} |
|
643 {\bf deep \alert{recursive} binders} \\ |
|
644 \hspace{4mm}Let\_rec as::assns t::trm\hspace{4mm} \isacommand{bind} bn(as) \isacommand{in} t as\\[4mm] |
|
645 |
|
646 \makebox[0mm][l]{\alert{$\times$}}\hspace{4mm}Foo\_rec as::assns t$_1$::trm t$_2$::trm\hspace{4mm}\\ |
|
647 \hspace{20mm}\isacommand{bind} bn(as) \isacommand{in} t$_1$ as, \isacommand{bind} bn(as) \isacommand{in} t$_2$\\ |
|
648 |
|
649 \end{tabular}} |
|
650 \end{center} |
|
651 |
|
652 \end{frame}} |
|
653 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
654 *} |
|
655 |
|
656 text_raw {* |
|
657 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
658 \mode<presentation>{ |
|
659 \begin{frame}<2-5> |
|
660 \frametitle{\begin{tabular}{c}Our Work\end{tabular}} |
760 \mbox{}\\[-6mm] |
661 \mbox{}\\[-6mm] |
761 |
662 |
762 \mbox{}\hspace{10mm} |
663 \begin{center} |
763 \begin{tabular}{ll} |
664 \begin{tikzpicture}[scale=1.5] |
764 \multicolumn{2}{l}{\isacommand{datatype} trm $=$}\\ |
665 %%%\draw[step=2mm] (-4,-1) grid (4,1); |
765 \hspace{5mm}\phantom{$|$} Var name\\ |
666 |
766 \hspace{5mm}$|$ App trm trm\\ |
667 \onslide<1>{\draw[very thick] (0.7,0.4) circle (4.25mm);} |
767 \hspace{5mm}$|$ Lam name trm\\ |
668 \onslide<1>{\draw[rounded corners=1mm, very thick] ( 0.0,-0.8) rectangle ( 1.8, 0.9);} |
768 \hspace{5mm}$|$ Let assns trm\\ |
669 \onslide<1->{\draw[rounded corners=1mm, very thick] (-1.95,0.85) rectangle (-2.85,-0.05);} |
769 \multicolumn{2}{l}{\isacommand{and} assns $=$}\\ |
670 |
770 \multicolumn{2}{l}{\hspace{5mm}\phantom{$|$} ANil}\\ |
671 \onslide<1>{\draw (-2.0, 0.845) -- (0.7,0.845);} |
771 \multicolumn{2}{l}{\hspace{5mm}$|$ ACons name trm assns}\\[5mm] |
672 \onslide<1>{\draw (-2.0,-0.045) -- (0.7,-0.045);} |
772 \multicolumn{2}{l}{\isacommand{function} bn \isacommand{where}}\\ |
673 |
773 \multicolumn{2}{l}{\hspace{5mm}\phantom{$|$} bn(ANil) $=$ $[]$}\\ |
674 \onslide<1>{\alert{\draw ( 0.7, 0.4) node {\footnotesize\begin{tabular}{@ {}c@ {}}$\alpha$-\\[-1mm]classes\end{tabular}};}} |
774 \multicolumn{2}{l}{\hspace{5mm}$|$ bn(ACons a t as) $=$ $[$a$]$ @ bn(as)}\\ |
675 \onslide<1->{\alert{\draw (-2.4, 0.4) node {\footnotesize\begin{tabular}{@ {}c@ {}}$\alpha$-eq.\\[-1mm]terms\end{tabular}};}} |
775 \end{tabular} |
676 \onslide<1>{\draw (1.8, 0.48) node[right=-0.1mm] |
776 |
677 {\footnotesize\begin{tabular}{@ {}l@ {}}existing\\[-1mm] type\\ \onslide<1>{\alert{(sets of raw terms)}}\end{tabular}};} |
777 \only<2>{ |
678 \onslide<1>{\draw (0.9, -0.35) node {\footnotesize\begin{tabular}{@ {}l@ {}}non-empty\\[-1mm]subset\end{tabular}};} |
778 \begin{textblock}{5}(10,5) |
679 \onslide<1->{\draw (-3.25, 0.55) node {\footnotesize\begin{tabular}{@ {}l@ {}}new\\[-1mm]type\end{tabular}};} |
779 $+$ \begin{tabular}{l}automatically\\ |
680 |
780 generate fv's\end{tabular} |
681 \onslide<1>{\draw[<->, very thick] (-1.8, 0.3) -- (-0.1,0.3);} |
781 \end{textblock}} |
682 \onslide<1>{\draw (-0.95, 0.3) node[above=0mm] {\footnotesize{}isomorphism};} |
782 \end{frame}} |
683 |
783 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
684 \onslide<1>{\draw[->, line width=2mm, red] (-1.0,-0.4) -- (0.35,0.16);} |
784 *} |
685 \end{tikzpicture} |
785 |
686 \end{center} |
786 text_raw {* |
687 |
787 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
688 \begin{textblock}{9.5}(6,3.5) |
788 \mode<presentation>{ |
689 \begin{itemize} |
789 \begin{frame}<1> |
690 \item<1-> defined fv and $\alpha$ |
790 \frametitle{\begin{tabular}{c}\LARGE``Raw'' Alpha-Equivalence\end{tabular}} |
691 \item<3-> derived a reasoning infrastructure ($\fresh$, distinctness, injectivity, cases,\ldots) |
791 \mbox{}\\[6mm] |
692 \item<4-> a (weak) induction principle |
792 |
693 \item<5-> derive a {\bf stronger} induction principle (Barendregt variable convention built in)\\ |
793 \begin{center} |
694 \begin{center} |
794 Lam x::name t::trm \hspace{10mm}\isacommand{bind} x \isacommand{in} t\\ |
695 \textcolor{blue}{Foo ($\lambda x. \lambda y. t$) ($\lambda u. \lambda v. s$)} |
795 \end{center} |
696 \end{center} |
796 |
697 \end{itemize} |
797 |
698 \end{textblock} |
798 \[ |
699 |
799 \infer[\text{Lam-}\!\approx_\alpha] |
700 |
800 {\text{Lam}\;x\;t \approx_\alpha \text{Lam}\;x'\;t'} |
701 \end{frame}} |
801 {([x], t) \approx\!\makebox[0mm][l]{${}_{\text{list}}$} |
702 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
802 ^{\approx_\alpha,\text{fv}} ([x'], t')} |
703 *} |
803 \] |
704 |
804 |
|
805 |
|
806 \end{frame}} |
|
807 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
808 *} |
|
809 |
|
810 text_raw {* |
|
811 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
812 \mode<presentation>{ |
|
813 \begin{frame}<1> |
|
814 \frametitle{\begin{tabular}{c}\LARGE``Raw'' Alpha-Equivalence\end{tabular}} |
|
815 \mbox{}\\[6mm] |
|
816 |
|
817 \begin{center} |
|
818 Lam x::name y::name t::trm s::trm \hspace{5mm}\isacommand{bind} x y \isacommand{in} t s\\ |
|
819 \end{center} |
|
820 |
|
821 |
|
822 \[ |
|
823 \infer[\text{Lam-}\!\approx_\alpha] |
|
824 {\text{Lam}\;x\;y\;t\;s \approx_\alpha \text{Lam}\;x'\;y'\;t'\;s'} |
|
825 {([x, y], (t, s)) \approx\!\makebox[0mm][l]{${}_{\text{list}}$} |
|
826 ^{R, fv} ([x', y'], (t', s'))} |
|
827 \] |
|
828 |
|
829 \footnotesize |
|
830 where $R =\;\approx_\alpha\times\approx_\alpha$ and $fv = \text{fv}\cup\text{fv}$ |
|
831 |
|
832 \end{frame}} |
|
833 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
834 *} |
|
835 |
|
836 text_raw {* |
|
837 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
838 \mode<presentation>{ |
|
839 \begin{frame}<1-2> |
|
840 \frametitle{\begin{tabular}{c}\LARGE``Raw'' Alpha-Equivalence\end{tabular}} |
|
841 \mbox{}\\[6mm] |
|
842 |
|
843 \begin{center} |
|
844 Let as::assns t::trm \hspace{10mm}\isacommand{bind} bn(as) \isacommand{in} t\\ |
|
845 \end{center} |
|
846 |
|
847 |
|
848 \[ |
|
849 \infer[\text{Let-}\!\approx_\alpha] |
|
850 {\text{Let}\;as\;t \approx_\alpha \text{Let}\;as'\;t'} |
|
851 {(\text{bn}(as), t) \approx\!\makebox[0mm][l]{${}_{\text{list}}$} |
|
852 ^{\approx_\alpha,\text{fv}} (\text{bn}(as'), t') & |
|
853 \onslide<2->{as \approx_\alpha^{\text{bn}} as'}} |
|
854 \]\bigskip |
|
855 |
|
856 |
|
857 \onslide<1->{\small{}bn-function $\Rightarrow$ \alert{deep binders}} |
|
858 \end{frame}} |
|
859 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
860 *} |
|
861 |
|
862 |
|
863 text_raw {* |
|
864 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
865 \mode<presentation>{ |
|
866 \begin{frame}<1-> |
|
867 \frametitle{\begin{tabular}{c}\LARGE{}$\alpha$ for Binding Functions\end{tabular}} |
|
868 \mbox{}\\[-6mm] |
|
869 |
|
870 \mbox{}\hspace{10mm} |
|
871 \begin{tabular}{l} |
|
872 \ldots\\ |
|
873 \isacommand{binder} bn \isacommand{where}\\ |
|
874 \phantom{$|$} bn(ANil) $=$ $[]$\\ |
|
875 $|$ bn(ACons a t as) $=$ $[$a$]$ @ bn(as)\\ |
|
876 \end{tabular}\bigskip |
|
877 |
|
878 \begin{center} |
|
879 \mbox{\infer{\text{ANil} \approx_\alpha^{\text{bn}} \text{ANil}}{}}\bigskip |
|
880 |
|
881 \mbox{\infer{\text{ACons}\;a\;t\;as \approx_\alpha^{\text{bn}} \text{ACons}\;a'\;t'\;as'} |
|
882 {t \approx_\alpha t' & as \approx_\alpha^{bn} as'}} |
|
883 \end{center} |
|
884 |
|
885 |
|
886 \end{frame}} |
|
887 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
888 *} |
|
889 |
|
890 |
|
891 text_raw {* |
|
892 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
893 \mode<presentation>{ |
|
894 \begin{frame}<1> |
|
895 \frametitle{\begin{tabular}{c}\LARGE``Raw'' Alpha-Equivalence\end{tabular}} |
|
896 \mbox{}\\[6mm] |
|
897 |
|
898 \begin{center} |
|
899 LetRec as::assns t::trm \hspace{10mm}\isacommand{bind} bn(as) \isacommand{in} t \alert{as}\\ |
|
900 \end{center} |
|
901 |
|
902 |
|
903 \[\mbox{}\hspace{-4mm} |
|
904 \infer[\text{LetRec-}\!\approx_\alpha] |
|
905 {\text{LetRec}\;as\;t \approx_\alpha \text{LetRec}\;as'\;t'} |
|
906 {(\text{bn}(as), (t, as)) \approx\!\makebox[0mm][l]{${}_{\text{list}}$} |
|
907 ^{R,\text{fv}} (\text{bn}(as'), (t', as'))} |
|
908 \]\bigskip |
|
909 |
|
910 \onslide<1->{\alert{deep recursive binders}} |
|
911 \end{frame}} |
|
912 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
913 *} |
|
914 |
|
915 text_raw {* |
|
916 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
917 \mode<presentation>{ |
|
918 \begin{frame}<1-> |
|
919 \frametitle{\begin{tabular}{c}Restrictions\end{tabular}} |
|
920 \mbox{}\\[-6mm] |
|
921 |
|
922 Our restrictions on binding specifications: |
|
923 |
|
924 \begin{itemize} |
|
925 \item a body can only occur once in a list of binding clauses\medskip |
|
926 \item you can only have one binding function for a deep binder\medskip |
|
927 \item binding functions can return: the empty set, singletons, unions (similarly for lists) |
|
928 \end{itemize} |
|
929 |
|
930 |
|
931 \end{frame}} |
|
932 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
933 *} |
|
934 |
|
935 text_raw {* |
|
936 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
937 \mode<presentation>{ |
|
938 \begin{frame}<1-> |
|
939 \frametitle{\begin{tabular}{c}Automatic Proofs\end{tabular}} |
|
940 \mbox{}\\[-6mm] |
|
941 |
|
942 \begin{itemize} |
|
943 \item we can show that $\alpha$'s are equivalence relations\medskip |
|
944 \item as a result we can use our quotient package to introduce the type(s) |
|
945 of $\alpha$-equated terms |
|
946 |
|
947 \[ |
|
948 \infer |
|
949 {\text{Lam}\;x\;t \alert{=} \text{Lam}\;x'\;t'} |
|
950 {\only<1>{([x], t) \approx\!\makebox[0mm][l]{${}_{\text{list}}$} |
|
951 ^{=,\text{supp}} ([x'], t')}% |
|
952 \only<2>{[x].t = [x'].t'}} |
|
953 \] |
|
954 |
|
955 |
|
956 \item the properties for support are implied by the properties of $[\_].\_$ |
|
957 \item we can derive strong induction principles |
|
958 \end{itemize} |
|
959 |
|
960 |
|
961 \end{frame}} |
|
962 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
963 *} |
|
964 |
|
965 text_raw {* |
|
966 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
967 \mode<presentation>{ |
|
968 \begin{frame}<1>[t] |
|
969 \frametitle{\begin{tabular}{c}Runtime is Acceptable\end{tabular}} |
|
970 \mbox{}\\[-7mm]\mbox{} |
|
971 |
|
972 \footnotesize |
|
973 \begin{center} |
|
974 \begin{tikzpicture} |
|
975 \draw (0,0) node[inner sep=2mm, ultra thick, draw=fg, rounded corners=2mm] |
|
976 (A) {\begin{minipage}{0.8cm}bind.\\spec.\end{minipage}}; |
|
977 |
|
978 \draw (2,0) node[inner sep=2mm, ultra thick, draw=fg, rounded corners=2mm] |
|
979 (B) {\begin{minipage}{0.8cm}raw\\terms\end{minipage}}; |
|
980 |
|
981 \draw (4,0) node[inner sep=2mm, ultra thick, draw=fg, rounded corners=2mm] |
|
982 (C) {\begin{minipage}{0.8cm}$\alpha$-\\equiv.\end{minipage}}; |
|
983 |
|
984 \draw (0,-2) node[inner sep=2mm, ultra thick, draw=fg, rounded corners=2mm] |
|
985 (D) {\begin{minipage}{0.8cm}quot.\\type\end{minipage}}; |
|
986 |
|
987 \draw (2,-2) node[inner sep=2mm, ultra thick, draw=fg, rounded corners=2mm] |
|
988 (E) {\begin{minipage}{0.8cm}lift\\thms\end{minipage}}; |
|
989 |
|
990 \draw (4,-2) node[inner sep=2mm, ultra thick, draw=fg, rounded corners=2mm] |
|
991 (F) {\begin{minipage}{0.8cm}add.\\thms\end{minipage}}; |
|
992 |
|
993 \draw[->,fg!50,line width=1mm] (A) -- (B); |
|
994 \draw[->,fg!50,line width=1mm] (B) -- (C); |
|
995 \draw[->,fg!50,line width=1mm, line join=round, rounded corners=2mm] |
|
996 (C) -- (5,0) -- (5,-1) -- (-1,-1) -- (-1,-2) -- (D); |
|
997 \draw[->,fg!50,line width=1mm] (D) -- (E); |
|
998 \draw[->,fg!50,line width=1mm] (E) -- (F); |
|
999 \end{tikzpicture} |
|
1000 \end{center} |
|
1001 |
|
1002 \begin{itemize} |
|
1003 \item Core Haskell: 11 types, 49 term-constructors, 7 binding functions |
|
1004 \begin{center} |
|
1005 $\sim$ 2 mins |
|
1006 \end{center} |
|
1007 \end{itemize} |
|
1008 |
|
1009 \end{frame}} |
|
1010 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
1011 *} |
|
1012 |
|
1013 |
|
1014 text_raw {* |
|
1015 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
1016 \mode<presentation>{ |
|
1017 \begin{frame}<1-> |
|
1018 \frametitle{\begin{tabular}{c}Interesting Phenomenon\end{tabular}} |
|
1019 \mbox{}\\[-6mm] |
|
1020 |
|
1021 \small |
|
1022 \mbox{}\hspace{20mm} |
|
1023 \begin{tabular}{ll} |
|
1024 \multicolumn{2}{l}{\isacommand{nominal\_datatype} trm $=$}\\ |
|
1025 \hspace{5mm}\phantom{$|$} Var name\\ |
|
1026 \hspace{5mm}$|$ App trm trm\\ |
|
1027 \hspace{5mm}$|$ Lam x::name t::trm |
|
1028 & \isacommand{bind} x \isacommand{in} t\\ |
|
1029 \hspace{5mm}$|$ Let as::assns t::trm |
|
1030 & \isacommand{bind} bn(as) \isacommand{in} t\\ |
|
1031 \multicolumn{2}{l}{\isacommand{and} assns $=$}\\ |
|
1032 \multicolumn{2}{l}{\hspace{5mm}\phantom{$|$} ANil}\\ |
|
1033 \multicolumn{2}{l}{\hspace{5mm}$|$ ACons name trm assns}\\ |
|
1034 \multicolumn{2}{l}{\isacommand{binder} bn \isacommand{where}}\\ |
|
1035 \multicolumn{2}{l}{\hspace{5mm}\phantom{$|$} bn(ANil) $=$ $[]$}\\ |
|
1036 \multicolumn{2}{l}{\hspace{5mm}$|$ bn(ACons a t as) $=$ $[$a$]$ @ bn(as)}\\ |
|
1037 \end{tabular}\bigskip\medskip |
|
1038 |
|
1039 we cannot quotient assns: ACons a \ldots $\not\approx_\alpha$ ACons b \ldots |
|
1040 |
|
1041 \only<1->{ |
|
1042 \begin{textblock}{8}(0.2,7.3) |
|
1043 \alert{\begin{tabular}{p{2.6cm}} |
|
1044 \raggedright\footnotesize{}Should a ``naked'' assns be quotient? |
|
1045 \end{tabular}\hspace{-3mm} |
|
1046 $\begin{cases} |
|
1047 \mbox{} \\ \mbox{} |
|
1048 \end{cases}$} |
|
1049 \end{textblock}} |
|
1050 \end{frame}} |
|
1051 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
1052 *} |
|
1053 |
705 |
1054 text_raw {* |
706 text_raw {* |
1055 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
707 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
1056 \mode<presentation>{ |
708 \mode<presentation>{ |
1057 \begin{frame}<1-> |
709 \begin{frame}<1-> |