slides/slides05.tex
author Christian Urban <christian dot urban at kcl dot ac dot uk>
Sat, 12 Oct 2013 23:39:20 +0100
changeset 142 1aa28135a2da
parent 93 4794759139ea
child 147 4725bba8ef26
permissions -rw-r--r--
added
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
44
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     1
\documentclass[dvipsnames,14pt,t]{beamer}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     2
\usepackage{beamerthemeplainculight}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     3
\usepackage[T1]{fontenc}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     4
\usepackage[latin1]{inputenc}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     5
\usepackage{mathpartir}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     6
\usepackage[absolute,overlay]{textpos}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     7
\usepackage{ifthen}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     8
\usepackage{tikz}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     9
\usepackage{pgf}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    10
\usepackage{calc} 
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    11
\usepackage{ulem}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    12
\usepackage{courier}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    13
\usepackage{listings}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    14
\renewcommand{\uline}[1]{#1}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    15
\usetikzlibrary{arrows}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    16
\usetikzlibrary{automata}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    17
\usetikzlibrary{shapes}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    18
\usetikzlibrary{shadows}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    19
\usetikzlibrary{positioning}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    20
\usetikzlibrary{calc}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    21
\usepackage{graphicx} 
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    22
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    23
\definecolor{javared}{rgb}{0.6,0,0} % for strings
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    24
\definecolor{javagreen}{rgb}{0.25,0.5,0.35} % comments
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    25
\definecolor{javapurple}{rgb}{0.5,0,0.35} % keywords
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    26
\definecolor{javadocblue}{rgb}{0.25,0.35,0.75} % javadoc
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    27
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    28
\lstset{language=Java,
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    29
	basicstyle=\ttfamily,
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    30
	keywordstyle=\color{javapurple}\bfseries,
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    31
	stringstyle=\color{javagreen},
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    32
	commentstyle=\color{javagreen},
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    33
	morecomment=[s][\color{javadocblue}]{/**}{*/},
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    34
	numbers=left,
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    35
	numberstyle=\tiny\color{black},
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    36
	stepnumber=1,
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    37
	numbersep=10pt,
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    38
	tabsize=2,
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    39
	showspaces=false,
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    40
	showstringspaces=false}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    41
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    42
\lstdefinelanguage{scala}{
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    43
  morekeywords={abstract,case,catch,class,def,%
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    44
    do,else,extends,false,final,finally,%
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    45
    for,if,implicit,import,match,mixin,%
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    46
    new,null,object,override,package,%
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    47
    private,protected,requires,return,sealed,%
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    48
    super,this,throw,trait,true,try,%
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    49
    type,val,var,while,with,yield},
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    50
  otherkeywords={=>,<-,<\%,<:,>:,\#,@},
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    51
  sensitive=true,
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    52
  morecomment=[l]{//},
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    53
  morecomment=[n]{/*}{*/},
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    54
  morestring=[b]",
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    55
  morestring=[b]',
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    56
  morestring=[b]"""
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    57
}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    58
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    59
\lstset{language=Scala,
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    60
	basicstyle=\ttfamily,
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    61
	keywordstyle=\color{javapurple}\bfseries,
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    62
	stringstyle=\color{javagreen},
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    63
	commentstyle=\color{javagreen},
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    64
	morecomment=[s][\color{javadocblue}]{/**}{*/},
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    65
	numbers=left,
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    66
	numberstyle=\tiny\color{black},
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    67
	stepnumber=1,
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    68
	numbersep=10pt,
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    69
	tabsize=2,
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    70
	showspaces=false,
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    71
	showstringspaces=false}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    72
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    73
% beamer stuff 
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    74
\renewcommand{\slidecaption}{AFL 05, King's College London, 24.~October 2012}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    75
\newcommand{\bl}[1]{\textcolor{blue}{#1}}       
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    76
\newcommand{\dn}{\stackrel{\mbox{\scriptsize def}}{=}}% for definitions
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    77
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    78
\begin{document}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    79
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    80
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    81
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    82
\begin{frame}<1>[t]
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    83
\frametitle{%
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    84
  \begin{tabular}{@ {}c@ {}}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    85
  \\[-3mm]
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    86
  \LARGE Automata and \\[-2mm] 
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    87
  \LARGE Formal Languages (5)\\[3mm] 
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    88
  \end{tabular}}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    89
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    90
  \normalsize
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    91
  \begin{center}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    92
  \begin{tabular}{ll}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    93
  Email:  & christian.urban at kcl.ac.uk\\
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    94
  Of$\!$fice: & S1.27 (1st floor Strand Building)\\
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    95
  Slides: & KEATS (also home work is there)\\
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    96
  \end{tabular}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    97
  \end{center}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    98
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    99
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   100
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   101
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   102
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   103
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   104
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   105
\begin{frame}[t]
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   106
\frametitle{\begin{tabular}{c}Deterministic Finite Automata\end{tabular}}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   107
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   108
A DFA \bl{$A(Q, q_0, F, \delta)$} consists of:
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   109
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   110
\begin{itemize}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   111
\item a finite set of states \bl{$Q$}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   112
\item one of these states is the start state \bl{$q_0$}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   113
\item some states are accepting states \bl{$F$}
47
Christian Urban <urbanc@in.tum.de>
parents: 46
diff changeset
   114
\item a transition function \bl{$\delta$}
44
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   115
\end{itemize}\pause
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   116
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   117
\onslide<2->{
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   118
\begin{center}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   119
\begin{tabular}{l}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   120
\bl{$\hat{\delta}(q, \texttt{""}) = q$}\\
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   121
\bl{$\hat{\delta}(q, c\!::\!s) = \hat{\delta}(\delta(q, c), s)$}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   122
\end{tabular}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   123
\end{center}}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   124
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   125
\only<3,4>{
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   126
\begin{center}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   127
\begin{tikzpicture}[scale=2, line width=0.5mm]
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   128
  \node[state, initial]        (q02) at ( 0,1) {$q_{0}$};
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   129
  \node[state]                    (q13) at ( 1,1) {$q_{1}$};
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   130
  \node[state, accepting] (q4) at ( 2,1) {$q_2$};
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   131
  \path[->] (q02) edge[bend left] node[above] {$a$} (q13)
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   132
                  (q13) edge[bend left] node[below] {$b$} (q02)
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   133
                  (q13) edge node[above] {$a$} (q4)
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   134
                  (q02) edge [loop below] node {$b$} ()
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   135
                  (q4) edge [loop right] node {$a, b$} ()
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   136
            ;
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   137
\end{tikzpicture}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   138
\end{center}}%
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   139
%
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   140
\only<5>{
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   141
\begin{center}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   142
\bl{$L(A) \dn \{ s \;|\; \hat{\delta}(q_0, s) \in F\}$}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   143
\end{center}}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   144
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   145
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   146
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   147
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   148
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   149
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   150
\begin{frame}[t]
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   151
\frametitle{\begin{tabular}{c}Non-Deterministic\\[-1mm] Finite Automata\end{tabular}}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   152
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   153
An NFA \bl{$A(Q, q_0, F, \delta)$} consists again of:
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   154
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   155
\begin{itemize}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   156
\item a finite set of states
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   157
\item one of these states is the start state
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   158
\item some states are accepting states
47
Christian Urban <urbanc@in.tum.de>
parents: 46
diff changeset
   159
\item a transition \alert{relation}\medskip 
44
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   160
\end{itemize}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   161
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   162
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   163
\begin{center}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   164
\begin{tabular}{c}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   165
\bl{(q$_1$, a) $\rightarrow$ q$_2$}\\
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   166
\bl{(q$_1$, a) $\rightarrow$ q$_3$}\\
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   167
\end{tabular}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   168
\hspace{10mm}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   169
\begin{tabular}{c}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   170
\bl{(q$_1$, $\epsilon$) $\rightarrow$ q$_2$}\\
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   171
\end{tabular}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   172
\end{center}\pause\medskip
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   173
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   174
A string \bl{s} is accepted by an NFA, if there is a ``lucky'' sequence to an accepting state.
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   175
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   176
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   177
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   178
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   179
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   180
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   181
\begin{frame}[c]
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   182
\frametitle{\begin{tabular}{c}Last Week\end{tabular}}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   183
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   184
Last week I showed you\bigskip
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   185
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   186
\begin{itemize}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   187
\item an algorithm for automata minimisation
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   188
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   189
\item an algorithm for transforming a regular expression into an NFA
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   190
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   191
\item an algorithm for transforming an NFA into a DFA (subset construction)
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   192
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   193
\end{itemize}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   194
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   195
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   196
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   197
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   198
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   199
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   200
\begin{frame}[c]
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   201
\frametitle{\begin{tabular}{c}This Week\end{tabular}}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   202
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   203
Go over the algorithms again, but with two new things and \ldots\medskip
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   204
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   205
\begin{itemize}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   206
\item with the example: what is the regular expression that accepts every string, except those ending 
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   207
in \bl{aa}?\medskip
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   208
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   209
\item Go over the proof for \bl{$L(rev(r)) = Rev(L(r))$}.\medskip
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   210
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   211
\item Anything else so far.
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   212
\end{itemize}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   213
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   214
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   215
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   216
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   217
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   218
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   219
\begin{frame}[c]
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   220
\frametitle{\begin{tabular}{c}Proofs By Induction\end{tabular}}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   221
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   222
\begin{itemize}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   223
\item \bl{$P$} holds for \bl{$\varnothing$}, \bl{$\epsilon$} and \bl{c}\bigskip
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   224
\item \bl{$P$} holds for \bl{r$_1$ + r$_2$} under the assumption that \bl{$P$} already
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   225
holds for \bl{r$_1$} and \bl{r$_2$}.\bigskip
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   226
\item \bl{$P$} holds for \bl{r$_1$ $\cdot$ r$_2$} under the assumption that \bl{$P$} already
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   227
holds for \bl{r$_1$} and \bl{r$_2$}.
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   228
\item \bl{$P$} holds for \bl{r$^*$} under the assumption that \bl{$P$} already
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   229
holds for \bl{r}.
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   230
\end{itemize}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   231
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   232
\begin{center}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   233
\bl{$P(r):\;\;L(rev(r)) = Rev(L(r))$}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   234
\end{center}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   235
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   236
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   237
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   238
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   239
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   240
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   241
\begin{frame}[t]
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   242
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   243
What is the regular expression that accepts every string, except those ending 
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   244
in \bl{aa}?\pause\bigskip
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   245
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   246
\begin{center}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   247
\begin{tabular}{l}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   248
\bl{(a + b)$^*$ba}\\
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   249
\bl{(a + b)$^*$ab}\\
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   250
\bl{(a + b)$^*$bb}\\\pause
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   251
\bl{a}\\
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   252
\bl{\texttt{""}}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   253
\end{tabular}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   254
\end{center}\pause
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   255
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   256
What are the strings to be avoided?\pause\medskip
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   257
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   258
\begin{center}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   259
\bl{(a + b)$^*$aa}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   260
\end{center}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   261
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   262
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   263
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   264
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   265
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   266
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   267
\begin{frame}[t]
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   268
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   269
An NFA for \bl{(a + b)$^*$aa}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   270
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   271
\begin{center}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   272
\begin{tikzpicture}[scale=2, line width=0.5mm]
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   273
  \node[state, initial]        (q0) at ( 0,1) {$q_0$};
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   274
  \node[state]                    (q1) at ( 1,1) {$q_1$};
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   275
  \node[state, accepting] (q2) at ( 2,1) {$q_2$};
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   276
  \path[->] (q0) edge node[above] {$a$} (q1)
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   277
                  (q1) edge node[above] {$a$} (q2)
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   278
                  (q0) edge [loop below] node {$a$} ()
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   279
                  (q0) edge [loop above] node {$b$} ()
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   280
            ;
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   281
\end{tikzpicture}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   282
\end{center}\pause
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   283
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   284
Minimisation for DFAs\\
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   285
Subset Construction for NFAs
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   286
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   287
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   288
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   289
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   290
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   291
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   292
\begin{frame}[c]
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   293
\frametitle{\begin{tabular}{c}DFA Minimisation\end{tabular}}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   294
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   295
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   296
\begin{enumerate}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   297
\item Take all pairs \bl{(q, p)} with \bl{q $\not=$ p}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   298
\item Mark all pairs that accepting and non-accepting states
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   299
\item For  all unmarked pairs \bl{(q, p)} and all characters \bl{c} tests wether
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   300
\begin{center}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   301
\bl{($\delta$(q,c), $\delta$(p,c))}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   302
\end{center} 
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   303
are marked. If yes, then also mark \bl{(q, p)}.
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   304
\item Repeat last step until nothing changed.
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   305
\item All unmarked pairs can be merged.
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   306
\end{enumerate}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   307
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   308
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   309
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   310
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   311
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   312
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   313
\begin{frame}[c]
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   314
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   315
Minimal DFA \only<1>{\bl{(a + b)$^*$aa}}\only<2->{\alert{not} \bl{(a + b)$^*$aa}}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   316
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   317
\begin{center}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   318
\begin{tikzpicture}[scale=2, line width=0.5mm]
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   319
  \only<1>{\node[state, initial]        (q0) at ( 0,1) {$q_0$};}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   320
  \only<2->{\node[state, initial,accepting]        (q0) at ( 0,1) {$q_0$};}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   321
  \only<1>{\node[state]                    (q1) at ( 1,1) {$q_1$};}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   322
  \only<2->{\node[state,accepting]                    (q1) at ( 1,1) {$q_1$};}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   323
  \only<1>{\node[state, accepting] (q2) at ( 2,1) {$q_2$};}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   324
  \only<2->{\node[state] (q2) at ( 2,1) {$q_2$};}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   325
  \path[->] (q0) edge[bend left] node[above] {$a$} (q1)
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   326
                  (q1) edge[bend left] node[above] {$b$} (q0)
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   327
                  (q2) edge[bend left=50] node[below] {$b$} (q0)
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   328
                  (q1) edge node[above] {$a$} (q2)
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   329
                  (q2) edge [loop right] node {$a$} ()
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   330
                  (q0) edge [loop below] node {$b$} ()
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   331
            ;
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   332
\end{tikzpicture}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   333
\end{center}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   334
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   335
\onslide<3>{How to get from a DFA to a regular expression?}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   336
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   337
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   338
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   339
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   340
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   341
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   342
\begin{frame}[c]
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   343
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   344
\begin{center}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   345
\begin{tikzpicture}[scale=2, line width=0.5mm]
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   346
  \only<1->{\node[state, initial]        (q0) at ( 0,1) {$q_0$};}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   347
  \only<1->{\node[state]                    (q1) at ( 1,1) {$q_1$};}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   348
  \only<1->{\node[state] (q2) at ( 2,1) {$q_2$};}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   349
  \path[->] (q0) edge[bend left] node[above] {$a$} (q1)
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   350
                  (q1) edge[bend left] node[above] {$b$} (q0)
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   351
                  (q2) edge[bend left=50] node[below] {$b$} (q0)
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   352
                  (q1) edge node[above] {$a$} (q2)
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   353
                  (q2) edge [loop right] node {$a$} ()
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   354
                  (q0) edge [loop below] node {$b$} ()
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   355
            ;
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   356
\end{tikzpicture}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   357
\end{center}\pause\bigskip
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   358
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   359
\onslide<2->{
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   360
\begin{center}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   361
\begin{tabular}{r@ {\hspace{2mm}}c@ {\hspace{2mm}}l}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   362
\bl{$q_0$} & \bl{$=$} & \bl{$2\, q_0 + 3 \,q_1 +  4\, q_2$}\\
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   363
\bl{$q_1$} & \bl{$=$} & \bl{$2 \,q_0 + 3\, q_1 + 1\, q_2$}\\
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   364
\bl{$q_2$} & \bl{$=$} & \bl{$1\, q_0 + 5\, q_1 + 2\, q_2$}\\
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   365
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   366
\end{tabular}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   367
\end{center}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   368
}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   369
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   370
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   371
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   372
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   373
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   374
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   375
\begin{frame}[c]
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   376
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   377
\begin{center}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   378
\begin{tikzpicture}[scale=2, line width=0.5mm]
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   379
  \only<1->{\node[state, initial]        (q0) at ( 0,1) {$q_0$};}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   380
  \only<1->{\node[state]                    (q1) at ( 1,1) {$q_1$};}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   381
  \only<1->{\node[state] (q2) at ( 2,1) {$q_2$};}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   382
  \path[->] (q0) edge[bend left] node[above] {$a$} (q1)
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   383
                  (q1) edge[bend left] node[above] {$b$} (q0)
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   384
                  (q2) edge[bend left=50] node[below] {$b$} (q0)
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   385
                  (q1) edge node[above] {$a$} (q2)
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   386
                  (q2) edge [loop right] node {$a$} ()
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   387
                  (q0) edge [loop below] node {$b$} ()
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   388
            ;
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   389
\end{tikzpicture}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   390
\end{center}\bigskip
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   391
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   392
\onslide<2->{
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   393
\begin{center}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   394
\begin{tabular}{r@ {\hspace{2mm}}c@ {\hspace{2mm}}l}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   395
\bl{$q_0$} & \bl{$=$} & \bl{$\epsilon + q_0\,b + q_1\,b +  q_2\,b$}\\
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   396
\bl{$q_1$} & \bl{$=$} & \bl{$q_0\,a$}\\
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   397
\bl{$q_2$} & \bl{$=$} & \bl{$q_1\,a + q_2\,a$}\\
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   398
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   399
\end{tabular}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   400
\end{center}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   401
}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   402
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   403
\onslide<3->{
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   404
Arden's Lemma:
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   405
\begin{center}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   406
If \bl{$q = q\,r + s$}\; then\; \bl{$q = s\, r^*$}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   407
\end{center}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   408
}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   409
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   410
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   411
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   412
46
Christian Urban <urbanc@in.tum.de>
parents: 44
diff changeset
   413
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents: 44
diff changeset
   414
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents: 44
diff changeset
   415
\begin{frame}[c]
Christian Urban <urbanc@in.tum.de>
parents: 44
diff changeset
   416
\frametitle{\begin{tabular}{c}Algorithms on Automata\end{tabular}}
Christian Urban <urbanc@in.tum.de>
parents: 44
diff changeset
   417
Christian Urban <urbanc@in.tum.de>
parents: 44
diff changeset
   418
Christian Urban <urbanc@in.tum.de>
parents: 44
diff changeset
   419
\begin{itemize}
Christian Urban <urbanc@in.tum.de>
parents: 44
diff changeset
   420
\item Reg $\rightarrow$ NFA: Thompson-McNaughton-Yamada method\medskip
Christian Urban <urbanc@in.tum.de>
parents: 44
diff changeset
   421
\item NFA $\rightarrow$ DFA: Subset Construction\medskip
Christian Urban <urbanc@in.tum.de>
parents: 44
diff changeset
   422
\item DFA $\rightarrow$ Reg: Brzozowski's Algebraic Method\medskip
Christian Urban <urbanc@in.tum.de>
parents: 44
diff changeset
   423
\item DFA minimisation: Hopcrofts Algorithm\medskip
Christian Urban <urbanc@in.tum.de>
parents: 44
diff changeset
   424
\item complement DFA
Christian Urban <urbanc@in.tum.de>
parents: 44
diff changeset
   425
\end{itemize}
Christian Urban <urbanc@in.tum.de>
parents: 44
diff changeset
   426
Christian Urban <urbanc@in.tum.de>
parents: 44
diff changeset
   427
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents: 44
diff changeset
   428
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
47
Christian Urban <urbanc@in.tum.de>
parents: 46
diff changeset
   429
\newcommand{\qq}{\mbox{\texttt{"}}}
Christian Urban <urbanc@in.tum.de>
parents: 46
diff changeset
   430
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents: 46
diff changeset
   431
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents: 46
diff changeset
   432
\begin{frame}[c]
Christian Urban <urbanc@in.tum.de>
parents: 46
diff changeset
   433
\frametitle{\begin{tabular}{c}Grammars\end{tabular}}
Christian Urban <urbanc@in.tum.de>
parents: 46
diff changeset
   434
Christian Urban <urbanc@in.tum.de>
parents: 46
diff changeset
   435
\begin{center}
Christian Urban <urbanc@in.tum.de>
parents: 46
diff changeset
   436
\bl{\begin{tabular}{lcl}
Christian Urban <urbanc@in.tum.de>
parents: 46
diff changeset
   437
$E$ & $\rightarrow$ &  $F + (F \cdot \qq*\qq \cdot F) + (F \cdot \qq\backslash\qq \cdot F)$\\
Christian Urban <urbanc@in.tum.de>
parents: 46
diff changeset
   438
$F$ & $\rightarrow$ & $T + (T \cdot \qq\texttt{+}\qq \cdot T) + (T \cdot \qq\texttt{-}\qq \cdot T)$\\
Christian Urban <urbanc@in.tum.de>
parents: 46
diff changeset
   439
$T$ & $\rightarrow$ & $num + (\qq\texttt{(}\qq \cdot E \cdot \qq\texttt{)}\qq)$\\
Christian Urban <urbanc@in.tum.de>
parents: 46
diff changeset
   440
\end{tabular}}
Christian Urban <urbanc@in.tum.de>
parents: 46
diff changeset
   441
\end{center}
Christian Urban <urbanc@in.tum.de>
parents: 46
diff changeset
   442
Christian Urban <urbanc@in.tum.de>
parents: 46
diff changeset
   443
\bl{$E$}, \bl{$F$} and \bl{$T$} are non-terminals\\
Christian Urban <urbanc@in.tum.de>
parents: 46
diff changeset
   444
\bl{$E$} is start symbol\\
Christian Urban <urbanc@in.tum.de>
parents: 46
diff changeset
   445
\bl{$num$}, \bl{(}, \bl{)}, \bl{+} \ldots are terminals\bigskip\\
Christian Urban <urbanc@in.tum.de>
parents: 46
diff changeset
   446
Christian Urban <urbanc@in.tum.de>
parents: 46
diff changeset
   447
Christian Urban <urbanc@in.tum.de>
parents: 46
diff changeset
   448
\bl{\texttt{(2*3)+(3+4)}}
Christian Urban <urbanc@in.tum.de>
parents: 46
diff changeset
   449
Christian Urban <urbanc@in.tum.de>
parents: 46
diff changeset
   450
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents: 46
diff changeset
   451
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents: 46
diff changeset
   452
Christian Urban <urbanc@in.tum.de>
parents: 46
diff changeset
   453
Christian Urban <urbanc@in.tum.de>
parents: 46
diff changeset
   454
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents: 46
diff changeset
   455
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents: 46
diff changeset
   456
\begin{frame}[c]
Christian Urban <urbanc@in.tum.de>
parents: 46
diff changeset
   457
Christian Urban <urbanc@in.tum.de>
parents: 46
diff changeset
   458
\begin{center}
Christian Urban <urbanc@in.tum.de>
parents: 46
diff changeset
   459
\bl{\begin{tabular}{lcl}
Christian Urban <urbanc@in.tum.de>
parents: 46
diff changeset
   460
$E$ & $\rightarrow$ &  $F + (F \cdot \qq*\qq \cdot F) + (F \cdot \qq\backslash\qq \cdot F)$\\
Christian Urban <urbanc@in.tum.de>
parents: 46
diff changeset
   461
$F$ & $\rightarrow$ & $T + (T \cdot \qq\texttt{+}\qq \cdot T) + (T \cdot \qq\texttt{-}\qq \cdot T)$\\
Christian Urban <urbanc@in.tum.de>
parents: 46
diff changeset
   462
$T$ & $\rightarrow$ & $num + (\qq\texttt{(}\qq \cdot E \cdot \qq\texttt{)}\qq)$\\
Christian Urban <urbanc@in.tum.de>
parents: 46
diff changeset
   463
\end{tabular}}
Christian Urban <urbanc@in.tum.de>
parents: 46
diff changeset
   464
\end{center}
Christian Urban <urbanc@in.tum.de>
parents: 46
diff changeset
   465
Christian Urban <urbanc@in.tum.de>
parents: 46
diff changeset
   466
\begin{center}
Christian Urban <urbanc@in.tum.de>
parents: 46
diff changeset
   467
\begin{tikzpicture}[level distance=8mm, blue]
Christian Urban <urbanc@in.tum.de>
parents: 46
diff changeset
   468
  \node {E}
Christian Urban <urbanc@in.tum.de>
parents: 46
diff changeset
   469
    child {node {F} 
Christian Urban <urbanc@in.tum.de>
parents: 46
diff changeset
   470
     child {node {T} 
Christian Urban <urbanc@in.tum.de>
parents: 46
diff changeset
   471
                 child {node {\qq(\qq\,E\,\qq)\qq}
Christian Urban <urbanc@in.tum.de>
parents: 46
diff changeset
   472
                            child {node{F \qq*\qq{} F}
Christian Urban <urbanc@in.tum.de>
parents: 46
diff changeset
   473
                                  child {node {T} child {node {2}}}
Christian Urban <urbanc@in.tum.de>
parents: 46
diff changeset
   474
                                  child {node {T} child {node {3}}} 
Christian Urban <urbanc@in.tum.de>
parents: 46
diff changeset
   475
                               }
Christian Urban <urbanc@in.tum.de>
parents: 46
diff changeset
   476
                          }
Christian Urban <urbanc@in.tum.de>
parents: 46
diff changeset
   477
              }
Christian Urban <urbanc@in.tum.de>
parents: 46
diff changeset
   478
     child {node {\qq+\qq}}
Christian Urban <urbanc@in.tum.de>
parents: 46
diff changeset
   479
     child {node {T}
Christian Urban <urbanc@in.tum.de>
parents: 46
diff changeset
   480
       child {node {\qq(\qq\,E\,\qq)\qq} 
Christian Urban <urbanc@in.tum.de>
parents: 46
diff changeset
   481
       child {node {F}
Christian Urban <urbanc@in.tum.de>
parents: 46
diff changeset
   482
       child {node {T \qq+\qq{} T}
Christian Urban <urbanc@in.tum.de>
parents: 46
diff changeset
   483
                    child {node {3}}
Christian Urban <urbanc@in.tum.de>
parents: 46
diff changeset
   484
                    child {node {4}} 
Christian Urban <urbanc@in.tum.de>
parents: 46
diff changeset
   485
                 }
Christian Urban <urbanc@in.tum.de>
parents: 46
diff changeset
   486
                 }}
Christian Urban <urbanc@in.tum.de>
parents: 46
diff changeset
   487
    }};
Christian Urban <urbanc@in.tum.de>
parents: 46
diff changeset
   488
\end{tikzpicture}
Christian Urban <urbanc@in.tum.de>
parents: 46
diff changeset
   489
\end{center}
Christian Urban <urbanc@in.tum.de>
parents: 46
diff changeset
   490
Christian Urban <urbanc@in.tum.de>
parents: 46
diff changeset
   491
\begin{textblock}{5}(1, 5)
Christian Urban <urbanc@in.tum.de>
parents: 46
diff changeset
   492
\bl{\texttt{(2*3)+(3+4)}}
Christian Urban <urbanc@in.tum.de>
parents: 46
diff changeset
   493
\end{textblock}
Christian Urban <urbanc@in.tum.de>
parents: 46
diff changeset
   494
Christian Urban <urbanc@in.tum.de>
parents: 46
diff changeset
   495
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents: 46
diff changeset
   496
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
44
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   497
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   498
\end{document}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   499
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   500
%%% Local Variables:  
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   501
%%% mode: latex
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   502
%%% TeX-master: t
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   503
%%% End: 
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   504