slides02.tex
author Christian Urban <urbanc@in.tum.de>
Wed, 03 Oct 2012 01:41:08 +0100
changeset 16 32d56fef14a7
parent 15 f5a6270adebc
child 17 4d81b2dc8271
permissions -rw-r--r--
tuned
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     1
\documentclass[dvipsnames,14pt,t]{beamer}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     2
\usepackage{beamerthemeplainculight}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     3
\usepackage[T1]{fontenc}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     4
\usepackage[latin1]{inputenc}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     5
\usepackage{mathpartir}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     6
\usepackage[absolute,overlay]{textpos}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     7
\usepackage{ifthen}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     8
\usepackage{tikz}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     9
\usepackage{pgf}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    10
\usepackage{calc} 
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    11
\usepackage{ulem}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    12
\usepackage{courier}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    13
\usepackage{listings}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    14
\renewcommand{\uline}[1]{#1}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    15
\usetikzlibrary{arrows}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    16
\usetikzlibrary{automata}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    17
\usetikzlibrary{shapes}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    18
\usetikzlibrary{shadows}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    19
\usetikzlibrary{positioning}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    20
\usetikzlibrary{calc}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    21
\usepackage{graphicx} 
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    22
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    23
\definecolor{javared}{rgb}{0.6,0,0} % for strings
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    24
\definecolor{javagreen}{rgb}{0.25,0.5,0.35} % comments
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    25
\definecolor{javapurple}{rgb}{0.5,0,0.35} % keywords
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    26
\definecolor{javadocblue}{rgb}{0.25,0.35,0.75} % javadoc
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    27
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    28
\lstset{language=Java,
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    29
	basicstyle=\ttfamily,
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    30
	keywordstyle=\color{javapurple}\bfseries,
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    31
	stringstyle=\color{javagreen},
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    32
	commentstyle=\color{javagreen},
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    33
	morecomment=[s][\color{javadocblue}]{/**}{*/},
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    34
	numbers=left,
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    35
	numberstyle=\tiny\color{black},
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    36
	stepnumber=1,
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    37
	numbersep=10pt,
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    38
	tabsize=2,
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    39
	showspaces=false,
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    40
	showstringspaces=false}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    41
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    42
\lstdefinelanguage{scala}{
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    43
  morekeywords={abstract,case,catch,class,def,%
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    44
    do,else,extends,false,final,finally,%
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    45
    for,if,implicit,import,match,mixin,%
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    46
    new,null,object,override,package,%
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    47
    private,protected,requires,return,sealed,%
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    48
    super,this,throw,trait,true,try,%
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    49
    type,val,var,while,with,yield},
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    50
  otherkeywords={=>,<-,<\%,<:,>:,\#,@},
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    51
  sensitive=true,
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    52
  morecomment=[l]{//},
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    53
  morecomment=[n]{/*}{*/},
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    54
  morestring=[b]",
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    55
  morestring=[b]',
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    56
  morestring=[b]"""
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    57
}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    58
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    59
\lstset{language=Scala,
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    60
	basicstyle=\ttfamily,
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    61
	keywordstyle=\color{javapurple}\bfseries,
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    62
	stringstyle=\color{javagreen},
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    63
	commentstyle=\color{javagreen},
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    64
	morecomment=[s][\color{javadocblue}]{/**}{*/},
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    65
	numbers=left,
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    66
	numberstyle=\tiny\color{black},
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    67
	stepnumber=1,
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    68
	numbersep=10pt,
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    69
	tabsize=2,
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    70
	showspaces=false,
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    71
	showstringspaces=false}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    72
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    73
% beamer stuff 
11
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
    74
\renewcommand{\slidecaption}{AFL 02, King's College London, 3.~October 2012}
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
    75
\newcommand{\bl}[1]{\textcolor{blue}{#1}}       
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
    76
\newcommand{\dn}{\stackrel{\mbox{\scriptsize def}}{=}}% for definitions
7
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    77
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    78
\begin{document}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    79
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    80
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    81
\mode<presentation>{
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    82
\begin{frame}<1>[t]
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    83
\frametitle{%
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    84
  \begin{tabular}{@ {}c@ {}}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    85
  \\[-3mm]
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    86
  \LARGE Automata and \\[-2mm] 
16
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
    87
  \LARGE Formal Languages (2)\\[3mm] 
7
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    88
  \end{tabular}}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    89
16
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
    90
  %\begin{center}
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
    91
  %\includegraphics[scale=0.3]{pics/ante1.jpg}\hspace{5mm}
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
    92
  %\includegraphics[scale=0.31]{pics/ante2.jpg}\\
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
    93
  %\footnotesize\textcolor{gray}{Antikythera automaton, 100 BC (Archimedes?)}
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
    94
  %\end{center}
7
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    95
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    96
\normalsize
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    97
  \begin{center}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    98
  \begin{tabular}{ll}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    99
  Email:  & christian.urban at kcl.ac.uk\\
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   100
  Of$\!$fice: & S1.27 (1st floor Strand Building)\\
16
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   101
  Slides: & KEATS 
7
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   102
  \end{tabular}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   103
  \end{center}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   104
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   105
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   106
\end{frame}}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   107
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   108
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   109
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   110
\mode<presentation>{
16
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   111
\begin{frame}[c]
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   112
\frametitle{\begin{tabular}{c}Languages\end{tabular}}
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   113
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   114
A \alert{language} is a set of strings.\bigskip
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   115
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   116
A \alert{regular expression} specifies a set of strings or language.
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   117
  
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   118
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   119
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   120
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   121
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   122
\mode<presentation>{
15
Christian Urban <urbanc@in.tum.de>
parents: 11
diff changeset
   123
\begin{frame}[t]
7
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   124
\frametitle{\begin{tabular}{c}Regular Expressions\end{tabular}}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   125
15
Christian Urban <urbanc@in.tum.de>
parents: 11
diff changeset
   126
Their inductive definition:
Christian Urban <urbanc@in.tum.de>
parents: 11
diff changeset
   127
Christian Urban <urbanc@in.tum.de>
parents: 11
diff changeset
   128
Christian Urban <urbanc@in.tum.de>
parents: 11
diff changeset
   129
\begin{textblock}{6}(2,5)
7
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   130
  \begin{tabular}{@ {}rrl@ {\hspace{13mm}}l}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   131
  \bl{r} & \bl{$::=$}  & \bl{$\varnothing$}  & null\\
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   132
         & \bl{$\mid$} & \bl{$\epsilon$}        & empty string / "" / []\\
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   133
         & \bl{$\mid$} & \bl{c}                         & character\\
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   134
         & \bl{$\mid$} & \bl{r$_1$ $\cdot$ r$_2$} & sequence\\
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   135
         & \bl{$\mid$} & \bl{r$_1$ + r$_2$}  & alternative / choice\\
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   136
         & \bl{$\mid$} & \bl{r$^*$}                   & star (zero or more)\\
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   137
  \end{tabular}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   138
  \end{textblock}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   139
  
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   140
\end{frame}}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   141
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   142
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   143
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   144
\mode<presentation>{
16
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   145
\begin{frame}[t]
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   146
\frametitle{\begin{tabular}{c}Regular Expressions\end{tabular}}
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   147
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   148
Their implementation in Scala:
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   149
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   150
{\lstset{language=Scala}\fontsize{8}{10}\selectfont
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   151
\texttt{\lstinputlisting{app51.scala}}}
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   152
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   153
  
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   154
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   155
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   156
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   157
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   158
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   159
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   160
\mode<presentation>{
7
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   161
\begin{frame}[c]
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   162
\frametitle{\begin{tabular}{c}The Meaning of a\\[-2mm] Regular Expression\end{tabular}}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   163
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   164
\begin{textblock}{15}(1,4)
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   165
 \begin{tabular}{@ {}rcl}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   166
 \bl{$L$($\varnothing$)}  & \bl{$\dn$} & \bl{$\varnothing$}\\
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   167
 \bl{$L$($\epsilon$)}        & \bl{$\dn$} & \bl{$\{$""$\}$}\\
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   168
 \bl{$L$(c)}                         & \bl{$\dn$} & \bl{$\{$"c"$\}$}\\
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   169
 \bl{$L$(r$_1$ + r$_2$)} & \bl{$\dn$} & \bl{$L$(r$_1$) $\cup$ $L$(r$_2$)}\\
11
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   170
 \bl{$L$(r$_1$ $\cdot$ r$_2$)}  & \bl{$\dn$} & \bl{$L$(r$_1$) @ $L$(r$_2$)}\\
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   171
 \bl{$L$(r$^*$)}                   & \bl{$\dn$} & \bl{$\bigcup_{n \ge 0}$ $L$(r)$^n$}\\
7
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   172
  \end{tabular}\bigskip
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   173
  
11
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   174
\hspace{5mm}\textcolor{gray}{$L$(r)$^0$ $\;\dn\;$ $\{$""$\}$}\\
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   175
\textcolor{gray}{$L$(r)$^{n+1}$ $\;\dn\;$ $L$(r) @ $L$(r)$^n$}  
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   176
\end{textblock}
7
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   177
16
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   178
\only<2->{
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   179
\begin{textblock}{5}(11,5)
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   180
\textcolor{gray}{\small
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   181
A @ B\\
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   182
\ldots you take out every string from A and
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   183
concatenate it with every string in B 
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   184
}
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   185
\end{textblock}}
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   186
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   187
\only<3->{
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   188
\begin{textblock}{6}(9,12)\small
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   189
\bl{$L$} is a function from regular expressions to sets of strings\\
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   190
\bl{$L$ : Rexp $\Rightarrow$ Set[String]}
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   191
\end{textblock}}
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   192
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   193
7
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   194
\end{frame}}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   195
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   196
16
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   197
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   198
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   199
\begin{frame}[c]
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   200
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   201
\large
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   202
\begin{center}
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   203
What is \bl{$L$(a$^*$)}?
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   204
\end{center}  
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   205
  
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   206
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   207
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   208
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   209
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   210
11
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   211
\newcommand{\YES}{\textcolor{gray}{yes}}
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   212
\newcommand{\NO}{\textcolor{gray}{no}}
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   213
\newcommand{\FORALLR}{\textcolor{gray}{$\forall$ r.}}
7
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   214
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   215
\mode<presentation>{
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   216
\begin{frame}[c]
11
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   217
\frametitle{\begin{tabular}{c}Reg Exp Equivalences\end{tabular}}
7
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   218
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   219
\begin{center}
16
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   220
\begin{tabular}{l@ {\hspace{7mm}}rcl@ {\hspace{7mm}}l}
11
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   221
&\bl{(a + b)  + c} & \bl{$\equiv^?$} & \bl{a + (b + c)} & \onslide<2->{\YES}\\
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   222
&\bl{a + a} & \bl{$\equiv^?$} & \bl{a} & \onslide<3->{\YES}\\
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   223
&\bl{(a $\cdot$ b)  $\cdot$ c} & \bl{$\equiv^?$} & \bl{a $\cdot$ (b $\cdot$ c)} & \onslide<4->{\YES}\\
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   224
&\bl{a $\cdot$ a} & \bl{$\equiv^?$} & \bl{a} & \onslide<5->{\NO}\\
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   225
&\bl{$\epsilon^*$} & \bl{$\equiv^?$} & \bl{$\epsilon$} & \onslide<6->{\YES}\\
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   226
&\bl{$\varnothing^*$} & \bl{$\equiv^?$} & \bl{$\varnothing$} & \onslide<7->{\NO}\\
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   227
\FORALLR &\bl{r $\cdot$ $\epsilon$} & \bl{$\equiv^?$} & \bl{r} & \onslide<8->{\YES}\\
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   228
\FORALLR &\bl{r + $\epsilon$} & \bl{$\equiv^?$} & \bl{r} & \onslide<9->{\NO}\\
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   229
\FORALLR &\bl{r + $\varnothing$} & \bl{$\equiv^?$} & \bl{r} & \onslide<10->{\YES}\\
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   230
\FORALLR &\bl{r $\cdot$ $\varnothing$} & \bl{$\equiv^?$} & \bl{r} & \onslide<11->{\NO}\\
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   231
&\bl{c $\cdot$ (a + b)} & \bl{$\equiv^?$} & \bl{(c $\cdot$ a) + (c $\cdot$ b)} & \onslide<12->{\YES}\\
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   232
&\bl{a$^*$} & \bl{$\equiv^?$} & \bl{$\epsilon$ + (a $\cdot$ a$^*$)} & \onslide<13->{\YES}
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   233
\end{tabular}
7
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   234
\end{center}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   235
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   236
\end{frame}}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   237
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   238
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   239
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   240
\mode<presentation>{
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   241
\begin{frame}[c]
11
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   242
\frametitle{\begin{tabular}{c}The Meaning of Matching\end{tabular}}
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   243
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   244
\large
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   245
a regular expression \bl{r} matches a string \bl{s} is defined as
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   246
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   247
\begin{center}
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   248
\bl{s $\in$ $L$(r)}\\ 
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   249
\end{center}\bigskip\bigskip\pause
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   250
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   251
\small
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   252
if \bl{r$_1$ $\equiv$ r$_2$}, then \bl{$s$ $\in$ $L$(r$_1$)} iff \bl{$s$ $\in$ $L$(r$_2$)}
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   253
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   254
\end{frame}}
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   255
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   256
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   257
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   258
\mode<presentation>{
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   259
\begin{frame}[t]
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   260
\frametitle{\begin{tabular}{c}A Matching Algorithm\end{tabular}}
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   261
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   262
\begin{itemize}
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   263
\item given a regular expression \bl{r} and a string \bl{s}, say yes or no for whether
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   264
\begin{center}
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   265
\bl{s $\in$ $L$(r)}
16
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   266
\end{center}
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   267
or not.\bigskip\bigskip\pause
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   268
\end{itemize}\pause
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   269
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   270
\small
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   271
\begin{itemize}
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   272
\item Identifiers (strings of letters or digits, starting with a letter)
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   273
\item Integers (a non-empty sequence of digits)
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   274
\item Keywords (else, if, while, \ldots)
Christian Urban <urbanc@in.tum.de>
parents: 15
diff changeset
   275
\item White space (a non-empty sequence of blanks, newlines and tabs)
11
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   276
\end{itemize}
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   277
\end{frame}}
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   278
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   279
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   280
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   281
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   282
\mode<presentation>{
5353d405e4e6 added slides 2
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   283
\begin{frame}[c]
15
Christian Urban <urbanc@in.tum.de>
parents: 11
diff changeset
   284
\frametitle{\begin{tabular}{c}A Matching Algorithm\end{tabular}}
7
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   285
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   286
\small
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   287
whether a regular expression matches the empty string:\medskip
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   288
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   289
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   290
{\lstset{language=Scala}\fontsize{8}{10}\selectfont
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   291
\texttt{\lstinputlisting{app5.scala}}}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   292
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   293
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   294
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   295
\end{frame}}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   296
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   297
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   298
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   299
\mode<presentation>{
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   300
\begin{frame}[c]
15
Christian Urban <urbanc@in.tum.de>
parents: 11
diff changeset
   301
\frametitle{\begin{tabular}{c}The Derivative of a Rexp\end{tabular}}
7
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   302
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   303
\large
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   304
If \bl{r} matches the string \bl{c::s}, what is a regular expression that matches \bl{s}?\bigskip\bigskip\bigskip\bigskip
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   305
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   306
\small
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   307
\bl{der c r} gives the answer
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   308
\end{frame}}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   309
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   310
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   311
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   312
\mode<presentation>{
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   313
\begin{frame}[c]
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   314
\frametitle{\begin{tabular}{c}The Derivative\end{tabular}}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   315
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   316
\begin{center}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   317
\begin{tabular}{@ {}l@ {\hspace{2mm}}c@ {\hspace{2mm}}l@ {\hspace{-10mm}}l@ {}}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   318
  \bl{der c ($\varnothing$)}            & \bl{$\dn$} & \bl{$\varnothing$} & \\
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   319
  \bl{der c ($\epsilon$)}           & \bl{$\dn$} & \bl{$\varnothing$} & \\
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   320
  \bl{der c (d)}           & \bl{$\dn$} & \bl{if c $=$ d then [] else $\varnothing$} & \\
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   321
  \bl{der c (r$_1$ + r$_2$)} & \bl{$\dn$} & \bl{(der c r$_1$) + (der c r$_2$)} & \\
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   322
  \bl{der c (r$_1$ $\cdot$ r$_2$)} & \bl{$\dn$} & \bl{((der c r$_1$) $\cdot$ r$_2$) + } & \\
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   323
       &          & \bl{\hspace{3mm}(if nullable r$_1$ then der c r$_2$ else $\varnothing$)}\\
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   324
  \bl{der c (r$^*$)}          & \bl{$\dn$} & \bl{(der c r) $\cdot$ (r$^*$)} &\smallskip\\\pause
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   325
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   326
  \bl{ders [] r}     & \bl{$\dn$} & \bl{r} & \\
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   327
  \bl{ders (c::s) r} & \bl{$\dn$} & \bl{ders s (der c r)} & \\
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   328
  \end{tabular}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   329
\end{center}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   330
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   331
\end{frame}}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   332
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   333
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   334
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   335
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   336
\mode<presentation>{
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   337
\begin{frame}[c]
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   338
\frametitle{\begin{tabular}{c}The Derivative\end{tabular}}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   339
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   340
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   341
{\lstset{language=Scala}\fontsize{8}{10}\selectfont
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   342
\texttt{\lstinputlisting{app6.scala}}}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   343
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   344
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   345
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   346
\end{frame}}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   347
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   348
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   349
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   350
\mode<presentation>{
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   351
\begin{frame}[c]
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   352
\frametitle{\begin{tabular}{c}The Rexp Matcher\end{tabular}}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   353
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   354
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   355
{\lstset{language=Scala}\fontsize{8}{10}\selectfont
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   356
\texttt{\lstinputlisting{app7.scala}}}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   357
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   358
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   359
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   360
\end{frame}}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   361
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   362
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   363
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   364
\end{document}
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   365
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   366
%%% Local Variables:  
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   367
%%% mode: latex
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   368
%%% TeX-master: t
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   369
%%% End: 
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   370