261 & \bl{$\mid$} & \bl{$r_1 + r_2$} & alternative / choice\\ |
261 & \bl{$\mid$} & \bl{$r_1 + r_2$} & alternative / choice\\ |
262 & \bl{$\mid$} & \bl{$r^*$} & star (zero or more)\\ |
262 & \bl{$\mid$} & \bl{$r^*$} & star (zero or more)\\ |
263 \end{tabular} |
263 \end{tabular} |
264 \end{textblock} |
264 \end{textblock} |
265 |
265 |
|
266 \only<2->{\footnotesize |
|
267 \begin{textblock}{9}(2,0.5) |
|
268 \begin{bubble}[9.8cm] |
|
269 \lstinputlisting{../progs/app01.scala} |
|
270 \end{bubble} |
|
271 \end{textblock}} |
|
272 |
266 \end{frame} |
273 \end{frame} |
267 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
274 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
268 |
275 |
269 |
276 |
270 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
277 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
473 \bl{$der\,c\,r$} gives the answer, Brzozowski 1964 |
480 \bl{$der\,c\,r$} gives the answer, Brzozowski 1964 |
474 \end{frame} |
481 \end{frame} |
475 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
482 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
476 |
483 |
477 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
484 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
478 \mode<presentation>{ |
|
479 \begin{frame}[c] |
485 \begin{frame}[c] |
480 \frametitle{The Derivative of a Rexp} |
486 \frametitle{The Derivative of a Rexp} |
481 |
487 |
482 \begin{center} |
488 \begin{center} |
483 \begin{tabular}{@ {}l@ {\hspace{2mm}}c@ {\hspace{2mm}}l@ {\hspace{-10mm}}l@ {}} |
489 \begin{tabular}{@ {}l@ {\hspace{2mm}}c@ {\hspace{2mm}}l@ {\hspace{-10mm}}l@ {}} |
493 \bl{$\textit{ders}\, []\, r$} & \bl{$\dn$} & \bl{$r$} & \\ |
499 \bl{$\textit{ders}\, []\, r$} & \bl{$\dn$} & \bl{$r$} & \\ |
494 \bl{$\textit{ders}\, (c\!::\!s)\, r$} & \bl{$\dn$} & \bl{$\textit{ders}\,s\,(der\,c\,r)$} & \\ |
500 \bl{$\textit{ders}\, (c\!::\!s)\, r$} & \bl{$\dn$} & \bl{$\textit{ders}\,s\,(der\,c\,r)$} & \\ |
495 \end{tabular} |
501 \end{tabular} |
496 \end{center} |
502 \end{center} |
497 |
503 |
498 \end{frame}} |
504 \end{frame} |
499 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
505 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
500 |
506 |
501 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
507 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
502 \begin{frame}[c] |
508 \begin{frame}[c] |
503 \frametitle{Examples} |
509 \frametitle{Examples} |
718 \addplot[black,mark=square*,mark options={fill=white}] table {re3.data}; |
721 \addplot[black,mark=square*,mark options={fill=white}] table {re3.data}; |
719 \end{axis} |
722 \end{axis} |
720 \end{tikzpicture} |
723 \end{tikzpicture} |
721 \end{center} |
724 \end{center} |
722 |
725 |
723 \end{frame}} |
726 \end{frame} |
724 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
727 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
725 |
728 |
726 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
729 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
727 \mode<presentation>{ |
730 \begin{frame}[t] |
728 \begin{frame}[t] |
731 \frametitle{Proofs about Rexps} |
729 \frametitle{\begin{tabular}{c}Proofs about Rexps\end{tabular}} |
|
730 |
732 |
731 Remember their inductive definition:\\[5cm] |
733 Remember their inductive definition:\\[5cm] |
732 |
734 |
733 \begin{textblock}{6}(5,5) |
735 \begin{textblock}{6}(5,5) |
734 \begin{tabular}{@ {}rrl} |
736 \begin{tabular}{@ {}rrl} |
735 \bl{$r$} & \bl{$::=$} & \bl{$\varnothing$}\\ |
737 \bl{$r$} & \bl{$::=$} & \bl{$\varnothing$}\\ |
736 & \bl{$\mid$} & \bl{$\epsilon$} \\ |
738 & \bl{$\mid$} & \bl{$\epsilon$} \\ |
737 & \bl{$\mid$} & \bl{$c$} \\ |
739 & \bl{$\mid$} & \bl{$c$} \\ |
738 & \bl{$\mid$} & \bl{$r_1 \cdot r_2$}\\ |
740 & \bl{$\mid$} & \bl{$r_1 \cdot r_2$}\\ |
739 & \bl{$\mid$} & \bl{$r_1 + r_2$} \\ |
741 & \bl{$\mid$} & \bl{$r_1 + r_2$} \\ |
740 & \bl{$\mid$} & \bl{$r^*$} \\ |
742 & \bl{$\mid$} & \bl{$r^*$} \\ |
741 \end{tabular} |
743 \end{tabular} |
742 \end{textblock} |
744 \end{textblock} |
743 |
745 |
744 If we want to prove something, say a property \bl{$P(r)$}, for all regular expressions \bl{$r$} then \ldots |
746 If we want to prove something, say a property \bl{$P(r)$}, for all regular expressions \bl{$r$} then \ldots |
745 |
747 |
746 \end{frame}} |
748 \end{frame} |
747 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
749 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
748 |
750 |
749 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
751 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
750 \mode<presentation>{ |
752 \begin{frame}[c] |
751 \begin{frame}[c] |
753 \frametitle{Proofs about Rexp (2)} |
752 \frametitle{\begin{tabular}{c}Proofs about Rexp (2)\end{tabular}} |
|
753 |
754 |
754 \begin{itemize} |
755 \begin{itemize} |
755 \item \bl{$P$} holds for \bl{$\varnothing$}, \bl{$\epsilon$} and \bl{c}\bigskip |
756 \item \bl{$P$} holds for \bl{$\varnothing$}, \bl{$\epsilon$} and \bl{c}\bigskip |
756 \item \bl{$P$} holds for \bl{$r_1 + r_2$} under the assumption that \bl{$P$} already |
757 \item \bl{$P$} holds for \bl{$r_1 + r_2$} under the assumption that \bl{$P$} already |
757 holds for \bl{$r_1$} and \bl{$r_2$}.\bigskip |
758 holds for \bl{$r_1$} and \bl{$r_2$}.\bigskip |
759 holds for \bl{$r_1$} and \bl{$r_2$}.\bigskip |
760 holds for \bl{$r_1$} and \bl{$r_2$}.\bigskip |
760 \item \bl{$P$} holds for \bl{$r^*$} under the assumption that \bl{$P$} already |
761 \item \bl{$P$} holds for \bl{$r^*$} under the assumption that \bl{$P$} already |
761 holds for \bl{$r$}. |
762 holds for \bl{$r$}. |
762 \end{itemize} |
763 \end{itemize} |
763 |
764 |
764 \end{frame}} |
765 \end{frame} |
765 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
766 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
766 |
767 |
767 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
768 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
768 \mode<presentation>{ |
769 \begin{frame}[c] |
769 \begin{frame}[c] |
770 \frametitle{Proofs about Rexp (3)} |
770 \frametitle{\begin{tabular}{c}Proofs about Rexp (3)\end{tabular}} |
|
771 |
771 |
772 Assume \bl{$P(r)$} is the property: |
772 Assume \bl{$P(r)$} is the property: |
773 |
773 |
774 \begin{center} |
774 \begin{center} |
775 \bl{$nullable(r)$} if and only if \bl{$[] \in L(r)$} |
775 \bl{$nullable(r)$} if and only if \bl{$[] \in L(r)$} |
776 \end{center} |
776 \end{center} |
777 |
777 |
778 \end{frame}} |
778 \end{frame} |
779 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
779 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
780 |
780 |
781 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
781 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
782 \mode<presentation>{ |
782 \begin{frame}[c] |
783 \begin{frame}[c] |
783 \frametitle{Proofs about Rexp (4)} |
784 \frametitle{\begin{tabular}{c}Proofs about Rexp (4)\end{tabular}} |
|
785 |
|
786 |
784 |
787 \begin{center} |
785 \begin{center} |
788 \bl{\begin{tabular}{r@{\hspace{1mm}}c@{\hspace{1mm}}l} |
786 \bl{\begin{tabular}{r@{\hspace{1mm}}c@{\hspace{1mm}}l} |
789 $rev(\varnothing)$ & $\dn$ & $\varnothing$\\ |
787 $rev(\varnothing)$ & $\dn$ & $\varnothing$\\ |
790 $rev(\epsilon)$ & $\dn$ & $\epsilon$\\ |
788 $rev(\epsilon)$ & $\dn$ & $\epsilon$\\ |
802 \bl{$L(rev(r)) = \{s^{-1} \;|\; s \in L(r)\}$} |
800 \bl{$L(rev(r)) = \{s^{-1} \;|\; s \in L(r)\}$} |
803 \end{center} |
801 \end{center} |
804 |
802 |
805 by induction on \bl{$r$}. |
803 by induction on \bl{$r$}. |
806 |
804 |
807 \end{frame}} |
805 \end{frame} |
808 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
806 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
809 |
807 |
810 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
808 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
811 \mode<presentation>{ |
809 \begin{frame}[c] |
812 \begin{frame}[c] |
810 \frametitle{Proofs about Rexp (5)} |
813 \frametitle{\begin{tabular}{c}Proofs about Rexp (5)\end{tabular}} |
|
814 |
811 |
815 Let \bl{$Der\,c\,A$} be the set defined as |
812 Let \bl{$Der\,c\,A$} be the set defined as |
816 |
813 |
817 \begin{center} |
814 \begin{center} |
818 \bl{$Der\,c\,A \dn \{ s \;|\; c\!::\!s \in A\}$ } |
815 \bl{$Der\,c\,A \dn \{ s \;|\; c\!::\!s \in A\}$ } |
824 \bl{$L(der\,c\,r) = Der\,c\,(L(r))$} |
821 \bl{$L(der\,c\,r) = Der\,c\,(L(r))$} |
825 \end{center} |
822 \end{center} |
826 |
823 |
827 by induction on \bl{$r$}. |
824 by induction on \bl{$r$}. |
828 |
825 |
829 \end{frame}} |
826 \end{frame} |
830 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
827 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
831 |
828 |
832 |
829 |
833 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
830 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
834 \mode<presentation>{ |
831 \mode<presentation>{ |