209 node[right]{\small Ruby}; |
209 node[right]{\small Ruby}; |
210 \end{scope} |
210 \end{scope} |
211 \end{tikzpicture} |
211 \end{tikzpicture} |
212 \end{column} |
212 \end{column} |
213 \begin{column}{.5\textwidth} |
213 \begin{column}{.5\textwidth} |
214 Us (after this course)\\\mbox{}\bigskip\\ |
214 Us (after next lecture)\\\mbox{}\bigskip\\ |
215 \begin{tikzpicture}[y=.08cm, x=.0003cm] |
215 \begin{tikzpicture}[y=.08cm, x=.0003cm] |
216 %axis |
216 %axis |
217 \draw (0,0) -- coordinate (x axis mid) (12000,0); |
217 \draw (0,0) -- coordinate (x axis mid) (12000,0); |
218 \draw (0,0) -- coordinate (y axis mid) (0,30); |
218 \draw (0,0) -- coordinate (y axis mid) (0,30); |
219 %ticks |
219 %ticks |
557 |
557 |
558 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
558 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
559 \begin{frame}[t] |
559 \begin{frame}[t] |
560 \frametitle{\begin{tabular}{c}Regular Expressions\end{tabular}} |
560 \frametitle{\begin{tabular}{c}Regular Expressions\end{tabular}} |
561 |
561 |
562 Their inductive definition:\medskip |
562 Their inductive definition: |
563 |
563 |
564 \begin{textblock}{6}(2,5) |
564 |
565 \begin{tabular}{rrl@ {\hspace{13mm}}l} |
565 \begin{textblock}{6}(2,7.5) |
566 \bl{$r$} & \bl{$::=$} & \bl{$\varnothing$} & null\\ |
566 \begin{tabular}{@ {}rrl@ {\hspace{13mm}}l} |
567 & \bl{$\mid$} & \bl{$\epsilon$} & empty string / \pcode{""} / \pcode{[]}\\ |
567 \bl{$r$} & \bl{$::=$} & \bl{$\varnothing$} & null\\ |
568 & \bl{$\mid$} & \bl{$c$} & character\\ |
568 & \bl{$\mid$} & \bl{$\epsilon$} & empty string / \pcode{""} / $[]$\\ |
569 & \bl{$\mid$} & \bl{$r_1 \cdot r_2$} & sequence\\ |
569 & \bl{$\mid$} & \bl{$c$} & character\\ |
570 & \bl{$\mid$} & \bl{$r_1 + r_2$} & alternative / choice\\ |
570 & \bl{$\mid$} & \bl{$r_1 + r_2$} & alternative / choice\\ |
571 & \bl{$\mid$} & \bl{$r^*$} & star (zero or more)\\ |
571 & \bl{$\mid$} & \bl{$r_1 \cdot r_2$} & sequence\\ |
|
572 & \bl{$\mid$} & \bl{$r^*$} & star (zero or more)\\ |
572 \end{tabular} |
573 \end{tabular} |
573 \end{textblock} |
574 \end{textblock} |
574 |
575 |
|
576 |
|
577 \only<2->{\footnotesize |
|
578 \begin{textblock}{9}(2,0.5) |
|
579 \begin{bubble}[9.8cm] |
|
580 \lstinputlisting{../progs/app01.scala} |
|
581 \end{bubble} |
|
582 \end{textblock}} |
|
583 |
575 \end{frame} |
584 \end{frame} |
576 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
585 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
577 |
586 |
578 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
587 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
579 \begin{frame}[t] |
588 \begin{frame}[t] |
594 \frametitle{Strings} |
603 \frametitle{Strings} |
595 |
604 |
596 \ldots are lists of characters. For example \code{"hello"} |
605 \ldots are lists of characters. For example \code{"hello"} |
597 |
606 |
598 \begin{center} |
607 \begin{center} |
599 \bl{$[h, e, l, l, o]$} |
608 \bl{$[h, e, l, l, o]$} or just \bl{$hello$} |
600 \end{center} |
609 \end{center} |
601 |
610 |
602 the empty string: $[]$ or \pcode{""}\bigskip\\ |
611 the empty string: \bl{$[]$} or \bl{\pcode{""}}\bigskip\\ |
603 |
612 |
604 the concatenation of two strings: |
613 the concatenation of two strings: |
605 |
614 |
606 \begin{center} |
615 \begin{center} |
607 \bl{$s_1 \,@\, s_2$} |
616 \bl{$s_1 \,@\, s_2$} |
608 \end{center} |
617 \end{center} |
609 |
618 |
610 \textit{foo $@$ bar = foobar}, \textit{baz $@\, []$ = baz} |
619 \bl{\textit{foo $@$ bar = foobar}, \textit{baz $@\, []$ = baz}} |
611 |
620 |
612 \end{frame} |
621 \end{frame} |
613 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
622 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
623 |
|
624 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
625 \begin{frame}[c] |
|
626 \frametitle{Languages, Strings} |
|
627 |
|
628 \begin{itemize} |
|
629 \item \alert{\bf Strings} are lists of characters, for example |
|
630 \begin{center} |
|
631 \bl{$[]$},\;\bl{$abc$} \hspace{2cm}(Pattern match: \bl{$c\!::\!s$}) |
|
632 \end{center}\bigskip |
|
633 |
|
634 |
|
635 \item A \alert{\bf language} is a set of strings, for example\medskip |
|
636 \begin{center} |
|
637 \bl{$\{[], hello, \textit{foobar}, a, abc\}$} |
|
638 \end{center}\bigskip |
|
639 |
|
640 \item \alert{\bf Concatenation} of strings and sets |
|
641 |
|
642 \begin{center} |
|
643 \begin{tabular}{rcl} |
|
644 \bl{$\textit{foo}\;@\;bar$} & \bl{$=$} & \bl{$\textit{foobar}$}\medskip\\ |
|
645 \bl{$A\;@\;B$} & \bl{$\dn$} & \bl{$\{ s_1\,@\,s_2 \;\mid\; s_1 \in A \wedge s_2 \in B\}$} |
|
646 \end{tabular} |
|
647 \end{center} |
|
648 |
|
649 %\item The \alert{\bf meaning} of a regular expression is a set of |
|
650 % strings, or language. |
|
651 \end{itemize} |
|
652 |
|
653 \end{frame} |
|
654 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
655 |
614 |
656 |
615 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
657 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
616 \mode<presentation>{ |
658 \mode<presentation>{ |
617 \begin{frame}[c] |
659 \begin{frame}[c] |
618 \frametitle{\begin{tabular}{c}The Meaning of a\\[-2mm] |
660 \frametitle{\begin{tabular}{c}The Meaning of a\\[-2mm] |
661 \frametitle{Written Exam} |
707 \frametitle{Written Exam} |
662 |
708 |
663 \begin{itemize} |
709 \begin{itemize} |
664 \item Accounts for 75\%.\bigskip |
710 \item Accounts for 75\%.\bigskip |
665 |
711 |
666 \item You will understand the question ``Is this relevant for |
712 \item You will understand the question ``\textit{Is this relevant for |
667 the exam?'' is very demotivating for the lecturer!\bigskip\\ |
713 the exam?}'' is very demotivating for the lecturer!\bigskip\\ |
668 |
714 |
669 \item Deal: Whatever is in the homework (and is not marked |
715 \item Deal: Whatever is in the homework (and is not marked |
670 ``optional'') is relevant for the exam. |
716 ``\textit{optional}'') is relevant for the exam.\bigskip |
|
717 |
|
718 \item Each lecture has also a handout. There are also handouts about |
|
719 notation and Scala. |
671 \end{itemize} |
720 \end{itemize} |
672 |
721 |
673 \end{frame} |
722 \end{frame} |
674 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
723 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
675 |
724 |