slides/slides03.tex
author Christian Urban <christian.urban@kcl.ac.uk>
Sat, 09 Nov 2024 06:23:35 +0000
changeset 972 ebb4a40d9bae
parent 967 ce5de01b9632
permissions -rw-r--r--
updated
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
651
652065f55d54 updated
Christian Urban <urbanc@in.tum.de>
parents: 650
diff changeset
     1
% !TEX program = xelatex
743
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
     2
\documentclass[dvipsnames,14pt,t,xelatex,aspectratio=169,xcolor={table}]{beamer}
265
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
     3
\usepackage{../slides}
871
94b84d880c2b updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 847
diff changeset
     4
\usepackage{../graphicss}
215
828303e8e4af updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 143
diff changeset
     5
\usepackage{../langs}
828303e8e4af updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 143
diff changeset
     6
\usepackage{../data}
25
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     7
781
bae72c598afd updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 779
diff changeset
     8
\usepackage{tcolorbox}
bae72c598afd updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 779
diff changeset
     9
\newtcolorbox{mybox}{colback=red!5!white,colframe=red!75!black}
bae72c598afd updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 779
diff changeset
    10
\newtcolorbox{mybox2}[1]{colback=red!5!white,colframe=red!75!black,fonttitle=\bfseries,title=#1}
bae72c598afd updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 779
diff changeset
    11
\newtcolorbox{mybox3}[1]{colback=Cyan!5!white,colframe=Cyan!75!black,fonttitle=\bfseries,title=#1}
bae72c598afd updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 779
diff changeset
    12
bae72c598afd updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 779
diff changeset
    13
265
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
    14
\hfuzz=220pt 
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
    15
781
bae72c598afd updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 779
diff changeset
    16
\pgfplotsset{compat=1.17}
265
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
    17
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
    18
\newcommand{\bl}[1]{\textcolor{blue}{#1}}  
25
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    19
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    20
% beamer stuff 
445
e7d0157f0471 updated slides
Christian Urban <urbanc@in.tum.de>
parents: 348
diff changeset
    21
\renewcommand{\slidecaption}{CFL 03, King's College London}
25
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    22
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    23
\begin{document}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    24
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    25
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
265
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
    26
\begin{frame}[t]
25
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    27
\frametitle{%
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    28
  \begin{tabular}{@ {}c@ {}}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    29
  \\[-3mm]
889
00c1c3408c93 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 871
diff changeset
    30
  \LARGE Compilers and \\[-1mm] 
00c1c3408c93 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 871
diff changeset
    31
  \LARGE Formal Languages\\[-5mm] 
25
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    32
  \end{tabular}}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    33
651
652065f55d54 updated
Christian Urban <urbanc@in.tum.de>
parents: 650
diff changeset
    34
  \normalsize
25
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    35
  \begin{center}
651
652065f55d54 updated
Christian Urban <urbanc@in.tum.de>
parents: 650
diff changeset
    36
  \begin{tabular}{ll}
967
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
    37
    Email:  & christian.urban at kcl.ac.uk\\
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
    38
    Office Hour: & Friday 12 -- 14\\  
889
00c1c3408c93 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 871
diff changeset
    39
  Location: & N7.07 (North Wing, Bush House)\\
00c1c3408c93 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 871
diff changeset
    40
  Slides \& Progs: & KEATS\\
00c1c3408c93 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 871
diff changeset
    41
  Pollev: & \texttt{\alert{https://pollev.com/cfltutoratki576}}\\  
25
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    42
  \end{tabular}
889
00c1c3408c93 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 871
diff changeset
    43
  \end{center}
743
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
    44
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
    45
  \begin{center}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
    46
    \begin{tikzpicture}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
    47
      \node[drop shadow,fill=white,inner sep=0pt] 
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
    48
      {\footnotesize\rowcolors{1}{capri!10}{white}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
    49
        \begin{tabular}{|p{4.8cm}|p{4.8cm}|}\hline
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
    50
          1 Introduction, Languages          & 6 While-Language \\
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
    51
          2 Regular Expressions, Derivatives & 7 Compilation, JVM \\
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
    52
          \cellcolor{blue!50}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
    53
          3 Automata, Regular Languages      & 8 Compiling Functional Languages \\
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
    54
          4 Lexing, Tokenising               & 9 Optimisations \\
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
    55
          5 Grammars, Parsing                & 10 LLVM \\ \hline
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
    56
        \end{tabular}%
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
    57
      };
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
    58
    \end{tikzpicture}
25
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    59
  \end{center}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    60
265
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
    61
\end{frame}
445
e7d0157f0471 updated slides
Christian Urban <urbanc@in.tum.de>
parents: 348
diff changeset
    62
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
e7d0157f0471 updated slides
Christian Urban <urbanc@in.tum.de>
parents: 348
diff changeset
    63
967
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
    64
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
    65
{
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
    66
\setbeamercolor{background canvas}{bg=cream}
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
    67
\begin{frame}[c]
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
    68
\frametitle{For Installation Problems}
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
    69
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
    70
\begin{itemize}
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
    71
\item Harry Dilnot (harry.dilnot@kcl.ac.uk) \\
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
    72
  \;\;Windows expert
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
    73
\item Oliver Iliffe (oliver.iliffe@kcl.ac.uk) 
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
    74
\end{itemize}
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
    75
  
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
    76
\end{frame}
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
    77
}
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
    78
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
    79
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
    80
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
    81
\begin{frame}[c]
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
    82
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
    83
\begin{mybox3}{From Pollev last week}\it    
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
    84
Is the equivalence of two regexes belong in the P or NP class of problems?
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
    85
\end{mybox3}  
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
    86
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
    87
\end{frame}
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
    88
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
    89
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
    90
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
    91
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
    92
\begin{frame}[c]
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
    93
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
    94
\begin{mybox3}{From Pollev last week}\it    
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
    95
  If state machines are not efficient, then how/why do many lexer
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
    96
  packages like the logos crate in rust compile down a lexer
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
    97
  definition down to a jump table driven state machine?
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
    98
  \textcolor{gray}{Could we
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
    99
  achieve quicker lexing with things like SIMD instructions?}
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
   100
\end{mybox3}  
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
   101
\end{frame}
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
   102
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
   103
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
   104
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
   105
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
   106
\begin{frame}[c]
972
ebb4a40d9bae updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 967
diff changeset
   107
%%\frametitle{\boldmath$(abcdef)^{\{n\}}$ in Rust and Scala}
967
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
   108
  
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
   109
\begin{textblock}{14}(1,3)
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
   110
\begin{tikzpicture}
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
   111
\begin{axis}[
972
ebb4a40d9bae updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 967
diff changeset
   112
    xlabel={\bl{n} copies of \bl{\texttt{"}abcdef\texttt{"}}}, 
967
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
   113
    x label style={at={(0.45,-0.16)}},
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
   114
    ylabel={time in secs},
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
   115
    enlargelimits=false, 
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
   116
    ytick={0,10,...,60},
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
   117
    ymax=65,
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
   118
    xmax=50000,
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
   119
    xtick={0,10000,...,40000},
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
   120
    scaled ticks=false,
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
   121
    axis lines=left,
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
   122
    width=10cm,
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
   123
    height=6cm,
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
   124
    legend entries={Rust, Scala V3},
972
ebb4a40d9bae updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 967
diff changeset
   125
    legend style={font=\small,at={(1.0,0.48)},anchor=north},
967
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
   126
    legend cell align=left]
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
   127
    \addplot[blue,mark=*, mark options={fill=white}] table {re-rust2.data};
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
   128
    \only<2>{\addplot[red,mark=*, mark options={fill=white}] table {re-scala2.data};}
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
   129
\end{axis}
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
   130
\end{tikzpicture}
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
   131
\end{textblock}
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
   132
972
ebb4a40d9bae updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 967
diff changeset
   133
\begin{textblock}{9}(1.8,1.8)
ebb4a40d9bae updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 967
diff changeset
   134
{Regular expression: \bl{\texttt{(abcdef)$^{\{\textrm{n}\}}$}}}
ebb4a40d9bae updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 967
diff changeset
   135
\end{textblock}
ebb4a40d9bae updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 967
diff changeset
   136
ebb4a40d9bae updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 967
diff changeset
   137
\begin{textblock}{6}(10.5,11.4)
ebb4a40d9bae updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 967
diff changeset
   138
{\bl{$n$}}
ebb4a40d9bae updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 967
diff changeset
   139
\end{textblock}
ebb4a40d9bae updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 967
diff changeset
   140
967
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
   141
\end{frame}
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
   142
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
   143
972
ebb4a40d9bae updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 967
diff changeset
   144
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ebb4a40d9bae updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 967
diff changeset
   145
\begin{frame}[c]
ebb4a40d9bae updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 967
diff changeset
   146
%%\frametitle{\boldmath$(abcdef)^{\{n\}}$ in Rust and Scala}
ebb4a40d9bae updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 967
diff changeset
   147
  
ebb4a40d9bae updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 967
diff changeset
   148
\begin{textblock}{14}(1,3)
ebb4a40d9bae updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 967
diff changeset
   149
\begin{tikzpicture}
ebb4a40d9bae updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 967
diff changeset
   150
\begin{axis}[
ebb4a40d9bae updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 967
diff changeset
   151
    xlabel={strings of the form \bl{$\underbrace{\texttt{a}...\texttt{a}}_n$}}, 
ebb4a40d9bae updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 967
diff changeset
   152
    x label style={at={(0.45,-0.16)}},
ebb4a40d9bae updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 967
diff changeset
   153
    ylabel={time in secs},
ebb4a40d9bae updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 967
diff changeset
   154
    enlargelimits=false,
ebb4a40d9bae updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 967
diff changeset
   155
    xtick={0,5,10,...,30},
ebb4a40d9bae updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 967
diff changeset
   156
    xmax=35,
ebb4a40d9bae updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 967
diff changeset
   157
    ymax=35,
ebb4a40d9bae updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 967
diff changeset
   158
    ytick={0,10,...,30},
ebb4a40d9bae updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 967
diff changeset
   159
    scaled ticks=false,
ebb4a40d9bae updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 967
diff changeset
   160
    axis lines=left,
ebb4a40d9bae updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 967
diff changeset
   161
    width=10cm,
ebb4a40d9bae updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 967
diff changeset
   162
    height=6cm,
ebb4a40d9bae updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 967
diff changeset
   163
    legend entries={Python,JavaScript,Swift,Dart},
ebb4a40d9bae updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 967
diff changeset
   164
    legend style={font=\small,at={(1.15,0.78)},anchor=north},
ebb4a40d9bae updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 967
diff changeset
   165
    legend cell align=left]
ebb4a40d9bae updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 967
diff changeset
   166
    \addplot[blue,mark=*, mark options={fill=white}] table {re-python2.data};
ebb4a40d9bae updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 967
diff changeset
   167
    \addplot[red,mark=*, mark options={fill=white}] table {re-js.data};
ebb4a40d9bae updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 967
diff changeset
   168
    \addplot[magenta,mark=*, mark options={fill=white}] table {re-swift.data};
ebb4a40d9bae updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 967
diff changeset
   169
    \addplot[brown,mark=*, mark options={fill=white}] table {re-dart.data};
ebb4a40d9bae updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 967
diff changeset
   170
ebb4a40d9bae updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 967
diff changeset
   171
\end{axis}
ebb4a40d9bae updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 967
diff changeset
   172
\end{tikzpicture}
ebb4a40d9bae updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 967
diff changeset
   173
\end{textblock}
ebb4a40d9bae updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 967
diff changeset
   174
ebb4a40d9bae updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 967
diff changeset
   175
\begin{textblock}{6}(1.8,1.8)
ebb4a40d9bae updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 967
diff changeset
   176
{Regular expression: \bl{\texttt{(a*)*$\,$b}}}
ebb4a40d9bae updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 967
diff changeset
   177
\end{textblock}
ebb4a40d9bae updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 967
diff changeset
   178
ebb4a40d9bae updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 967
diff changeset
   179
\begin{textblock}{6}(10.5,11.4)
ebb4a40d9bae updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 967
diff changeset
   180
{\bl{$n$}}
ebb4a40d9bae updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 967
diff changeset
   181
\end{textblock}
ebb4a40d9bae updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 967
diff changeset
   182
ebb4a40d9bae updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 967
diff changeset
   183
\end{frame}
ebb4a40d9bae updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 967
diff changeset
   184
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ebb4a40d9bae updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 967
diff changeset
   185
ebb4a40d9bae updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 967
diff changeset
   186
% @@@@@@@@@@@@@@@@@
ebb4a40d9bae updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 967
diff changeset
   187
\end{document}
ebb4a40d9bae updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 967
diff changeset
   188
% @@@@@@@@@@@@@@@@@@
ebb4a40d9bae updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 967
diff changeset
   189
967
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
   190
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
   191
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
   192
\begin{frame}[c]
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
   193
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
   194
\begin{mybox3}{From Pollev last week}\it    
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
   195
  For a regular expression $r = r_1 \cdot r_2$, to prove that
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
   196
  $der\;c\;r = (der\;c\;r) \cdot r^{\{n-1\}}$, is there a
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
   197
  way to prove it in the general case instead
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
   198
  of how you do the calculations for each $n$ in the videos?
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
   199
\end{mybox3}  
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
   200
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
   201
\end{frame}
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
   202
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
   203
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
   204
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
   205
941
66adcae6c762 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 940
diff changeset
   206
{
66adcae6c762 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 940
diff changeset
   207
\setbeamercolor{background canvas}{bg=cream}
66adcae6c762 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 940
diff changeset
   208
\begin{frame}<1-10>[c]
66adcae6c762 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 940
diff changeset
   209
\end{frame}
66adcae6c762 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 940
diff changeset
   210
}
66adcae6c762 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 940
diff changeset
   211
66adcae6c762 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 940
diff changeset
   212
66adcae6c762 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 940
diff changeset
   213
66adcae6c762 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 940
diff changeset
   214
445
e7d0157f0471 updated slides
Christian Urban <urbanc@in.tum.de>
parents: 348
diff changeset
   215
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
776
939c10745a3a updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   216
%\begin{frame}[c]
939c10745a3a updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   217
%\frametitle{Scala Book, Exams}
939c10745a3a updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   218
%
939c10745a3a updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   219
%\begin{itemize}
939c10745a3a updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   220
%\item \small https://nms.kcl.ac.uk/christian.urban/ProgInScala2ed.pdf\normalsize
939c10745a3a updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   221
%\item homework (written exam 80\%)
939c10745a3a updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   222
%\item coursework (20\%)\bigskip
939c10745a3a updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   223
%\item short survey at KEATS; to be answered until Sunday    
939c10745a3a updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   224
%\end{itemize}
445
e7d0157f0471 updated slides
Christian Urban <urbanc@in.tum.de>
parents: 348
diff changeset
   225
776
939c10745a3a updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   226
%\end{frame}
445
e7d0157f0471 updated slides
Christian Urban <urbanc@in.tum.de>
parents: 348
diff changeset
   227
%%%%%%%%%%%
25
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   228
133
09efdf5cf07c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   229
09efdf5cf07c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   230
09efdf5cf07c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   231
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
25
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   232
\begin{frame}[t]
651
652065f55d54 updated
Christian Urban <urbanc@in.tum.de>
parents: 650
diff changeset
   233
\frametitle{(Basic) Regular Expressions}
25
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   234
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   235
\begin{center}
134
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 133
diff changeset
   236
   \begin{tabular}{@ {}rrl@ {\hspace{13mm}}l}
515
3566c8175e63 updated
cu
parents: 500
diff changeset
   237
  \bl{$r$} & \bl{$::=$}  & \bl{$\ZERO$}  & nothing\\
445
e7d0157f0471 updated slides
Christian Urban <urbanc@in.tum.de>
parents: 348
diff changeset
   238
         & \bl{$\mid$} & \bl{$\ONE$}        & empty string / "" / $[]$\\
134
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 133
diff changeset
   239
         & \bl{$\mid$} & \bl{$c$}                         & character\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 133
diff changeset
   240
         & \bl{$\mid$} & \bl{$r_1 \cdot r_2$} & sequence\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 133
diff changeset
   241
         & \bl{$\mid$} & \bl{$r_1 + r_2$}  & alternative / choice\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 133
diff changeset
   242
         & \bl{$\mid$} & \bl{$r^*$}                   & star (zero or more)\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 133
diff changeset
   243
  \end{tabular}
25
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   244
  \end{center}
134
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 133
diff changeset
   245
  
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 133
diff changeset
   246
How about ranges \bl{$[a\mbox{-}z]$}, \bl{$r^+$} and \bl{$\sim{}r$}? Do they increase the
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 133
diff changeset
   247
set of languages we can recognise?
25
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   248
  
265
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
   249
\end{frame}
25
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   250
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   251
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   252
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
776
939c10745a3a updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
   253
\begin{frame}[t]
265
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
   254
\frametitle{Negation}
135
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   255
265
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
   256
Assume you have an alphabet consisting of the letters \bl{$a$}, \bl{$b$} and \bl{$c$} only.
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
   257
Find a (basic!) regular expression that matches all strings \emph{\alert{except}} 
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
   258
\bl{$ab$} and \bl{$ac$}!
135
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   259
265
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
   260
\end{frame}
135
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   261
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   262
25
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   263
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
573
711bbc480998 updated
Christian Urban <urbanc@in.tum.de>
parents: 572
diff changeset
   264
\begin{frame}[t]
265
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
   265
\frametitle{Automata}
25
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   266
346
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
   267
A \alert{\bf deterministic finite automaton}, DFA, consists of:
25
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   268
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   269
\begin{itemize}
515
3566c8175e63 updated
cu
parents: 500
diff changeset
   270
\item an alphabet \bl{$\varSigma$}  
574
bd4f144326c7 updated
Christian Urban <urbanc@in.tum.de>
parents: 573
diff changeset
   271
\item a set of states \bl{$\mbox{Qs}$}
515
3566c8175e63 updated
cu
parents: 500
diff changeset
   272
\item one of these states is the start state \bl{$\mbox{Q}_0$}
346
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
   273
\item some states are accepting states \bl{$F$}, and
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
   274
\item there is transition function \bl{$\delta$}\bigskip 
25
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   275
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   276
\small
265
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
   277
which takes a state as argument and a character and produces a 
515
3566c8175e63 updated
cu
parents: 500
diff changeset
   278
new state; this function might not be everywhere defined $\Rightarrow$ partial function
133
09efdf5cf07c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   279
\end{itemize}
09efdf5cf07c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   280
135
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   281
\begin{center}
574
bd4f144326c7 updated
Christian Urban <urbanc@in.tum.de>
parents: 573
diff changeset
   282
\bl{$A(\varSigma, \mbox{Qs}, \mbox{Q}_0, F, \delta)$}
135
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   283
\end{center}
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   284
265
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
   285
\end{frame}
135
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   286
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   287
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   288
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   289
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   290
\begin{frame}[c]
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   291
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   292
\begin{center}
137
69cec773736b added pictures
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 136
diff changeset
   293
\begin{tikzpicture}[>=stealth',very thick,auto,
573
711bbc480998 updated
Christian Urban <urbanc@in.tum.de>
parents: 572
diff changeset
   294
  every state/.style={minimum size=0pt,inner sep=2pt,
711bbc480998 updated
Christian Urban <urbanc@in.tum.de>
parents: 572
diff changeset
   295
    draw=blue!50,very thick,fill=blue!20},]
515
3566c8175e63 updated
cu
parents: 500
diff changeset
   296
\node[state,initial]  (Q_0)  {$\mbox{Q}_0$};
3566c8175e63 updated
cu
parents: 500
diff changeset
   297
\node[state] (Q_1) [right=of Q_0] {$\mbox{Q}_1$};
3566c8175e63 updated
cu
parents: 500
diff changeset
   298
\node[state] (Q_2) [below right=of Q_0] {$\mbox{Q}_2$};
3566c8175e63 updated
cu
parents: 500
diff changeset
   299
\node[state] (Q_3) [right=of Q_2] {$\mbox{Q}_3$};
3566c8175e63 updated
cu
parents: 500
diff changeset
   300
\node[state, accepting] (Q_4) [right=of Q_1] {$\mbox{Q}_4$};
3566c8175e63 updated
cu
parents: 500
diff changeset
   301
\path[->] (Q_0) edge node [above]  {\alert{$a$}} (Q_1);
3566c8175e63 updated
cu
parents: 500
diff changeset
   302
\path[->] (Q_1) edge node [above]  {\alert{$a$}} (Q_4);
3566c8175e63 updated
cu
parents: 500
diff changeset
   303
\path[->] (Q_4) edge [loop right] node  {\alert{$a, b$}} ();
3566c8175e63 updated
cu
parents: 500
diff changeset
   304
\path[->] (Q_3) edge node [right]  {\alert{$a$}} (Q_4);
3566c8175e63 updated
cu
parents: 500
diff changeset
   305
\path[->] (Q_2) edge node [above]  {\alert{$a$}} (Q_3);
3566c8175e63 updated
cu
parents: 500
diff changeset
   306
\path[->] (Q_1) edge node [right]  {\alert{$b$}} (Q_2);
3566c8175e63 updated
cu
parents: 500
diff changeset
   307
\path[->] (Q_0) edge node [above]  {\alert{$b$}} (Q_2);
3566c8175e63 updated
cu
parents: 500
diff changeset
   308
\path[->] (Q_2) edge [loop left] node  {\alert{$b$}} ();
3566c8175e63 updated
cu
parents: 500
diff changeset
   309
\path[->] (Q_3) edge [bend left=95, looseness=1.3] node [below]  {\alert{$b$}} (Q_0);
137
69cec773736b added pictures
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 136
diff changeset
   310
\end{tikzpicture}
346
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
   311
\end{center}
135
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   312
573
711bbc480998 updated
Christian Urban <urbanc@in.tum.de>
parents: 572
diff changeset
   313
\mbox{}\\[-14mm]
711bbc480998 updated
Christian Urban <urbanc@in.tum.de>
parents: 572
diff changeset
   314
\only<1>{
135
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   315
\begin{itemize}
139
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 138
diff changeset
   316
\item the start state can be an accepting state
135
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   317
\item it is possible that there is no accepting state
139
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 138
diff changeset
   318
\item all states might be accepting (but this does not necessarily mean all strings are accepted)
573
711bbc480998 updated
Christian Urban <urbanc@in.tum.de>
parents: 572
diff changeset
   319
\end{itemize}}
711bbc480998 updated
Christian Urban <urbanc@in.tum.de>
parents: 572
diff changeset
   320
\only<2>{
135
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   321
for this automaton \bl{$\delta$} is the function\\
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   322
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   323
\begin{center}
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   324
\begin{tabular}{lll}
515
3566c8175e63 updated
cu
parents: 500
diff changeset
   325
  \bl{$(\mbox{Q}_0, a) \rightarrow \mbox{Q}_1$} & \bl{$(\mbox{Q}_1, a) \rightarrow \mbox{Q}_4$}
3566c8175e63 updated
cu
parents: 500
diff changeset
   326
  & \bl{$(\mbox{Q}_4, a) \rightarrow \mbox{Q}_4$}\\
3566c8175e63 updated
cu
parents: 500
diff changeset
   327
  \bl{$(\mbox{Q}_0, b) \rightarrow \mbox{Q}_2$} & \bl{$(\mbox{Q}_1, b) \rightarrow \mbox{Q}_2$} &
3566c8175e63 updated
cu
parents: 500
diff changeset
   328
  \bl{$(\mbox{Q}_4, b) \rightarrow \mbox{Q}_4$}\\
135
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   329
\end{tabular}\ldots
573
711bbc480998 updated
Christian Urban <urbanc@in.tum.de>
parents: 572
diff changeset
   330
\end{center}  
711bbc480998 updated
Christian Urban <urbanc@in.tum.de>
parents: 572
diff changeset
   331
}  
135
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   332
265
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
   333
\end{frame}
135
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   334
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   335
573
711bbc480998 updated
Christian Urban <urbanc@in.tum.de>
parents: 572
diff changeset
   336
135
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   337
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   338
\begin{frame}[t]
265
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
   339
\frametitle{Accepting a String}
135
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   340
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   341
Given
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   342
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   343
\begin{center}
574
bd4f144326c7 updated
Christian Urban <urbanc@in.tum.de>
parents: 573
diff changeset
   344
\bl{$A(\varSigma, \mbox{Qs}, \mbox{Q}_0, F, \delta)$}
135
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   345
\end{center}
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   346
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   347
you can define
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   348
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   349
\begin{center}
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   350
\begin{tabular}{l}
778
3e5f5d19f514 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 776
diff changeset
   351
\bl{$\widehat{\delta}(Q, []) \dn Q$}\\
3e5f5d19f514 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 776
diff changeset
   352
\bl{$\widehat{\delta}(Q, c::s) \dn \widehat{\delta}(\delta(Q, c), s)$}\\
135
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   353
\end{tabular}
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   354
\end{center}\pause
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   355
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   356
Whether a string \bl{$s$} is accepted by \bl{$A$}?
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   357
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   358
\begin{center}
517
edab48a5b37e updated
cu
parents: 515
diff changeset
   359
\hspace{5mm}\bl{$\widehat{\delta}(\mbox{Q}_0, s) \in F$}
135
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   360
\end{center}
265
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
   361
\end{frame}
135
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   362
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   363
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   364
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   365
\begin{frame}[c]
346
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
   366
\frametitle{Regular Languages}
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
   367
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
   368
A \alert{\bf language} is a set of strings.\bigskip
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
   369
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
   370
A \alert{\bf regular expression} specifies a language.\bigskip
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
   371
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
   372
A language is \alert{\bf regular} iff there exists
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
   373
a regular expression that recognises all its strings.\bigskip\bigskip\pause
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
   374
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
   375
not all languages are regular, e.g.~\bl{$a^nb^n$} is not
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
   376
\end{frame}
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
   377
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
   378
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
   379
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
   380
\begin{frame}[c]
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
   381
\frametitle{Regular Languages (2)}
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
   382
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
   383
A language is \alert{\bf regular} iff there exists a regular
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
   384
expression that recognises all its strings.\bigskip\medskip
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
   385
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
   386
or {\bf equivalently}\bigskip\medskip
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
   387
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
   388
A language is \alert{\bf regular} iff there exists a
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
   389
deterministic finite automaton that recognises all its
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
   390
strings.
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
   391
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
   392
\end{frame}
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
   393
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
   394
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
   395
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
   396
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
   397
\begin{frame}[c]
348
31e89128ccd2 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 346
diff changeset
   398
\frametitle{\begin{tabular}{c}
31e89128ccd2 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 346
diff changeset
   399
              Non-Deterministic\\[-1mm] 
31e89128ccd2 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 346
diff changeset
   400
              Finite Automata\end{tabular}}
135
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   401
779
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   402
\bl{$N(\varSigma, \mbox{Qs}, \mbox{Qs}_0, F, \rho)$}\\
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   403
A non-deterministic finite automaton (NFA) consists of:
135
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   404
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   405
\begin{itemize}
779
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   406
\item a finite set of states, \bl{$Qs$}
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   407
\item \underline{some} these states are the start states, \bl{$Qs_0$}
135
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   408
\item some states are accepting states, and
779
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   409
\item there is transition \alert{relation}, \bl{$\rho$}\medskip 
135
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   410
\end{itemize}
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   411
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   412
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   413
\begin{center}
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   414
\begin{tabular}{c}
515
3566c8175e63 updated
cu
parents: 500
diff changeset
   415
\bl{$(\mbox{Q}_1, a) \rightarrow \mbox{Q}_2$}\\
3566c8175e63 updated
cu
parents: 500
diff changeset
   416
\bl{$(\mbox{Q}_1, a) \rightarrow \mbox{Q}_3$}\\
135
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   417
\end{tabular}
515
3566c8175e63 updated
cu
parents: 500
diff changeset
   418
\bl{\ldots}
3566c8175e63 updated
cu
parents: 500
diff changeset
   419
\hspace{10mm}\pause
3566c8175e63 updated
cu
parents: 500
diff changeset
   420
\bl{$(\mbox{Q}_1, a) \rightarrow \{\mbox{Q}_2, \mbox{Q}_3\}$}
135
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   421
\end{center}
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   422
265
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
   423
\end{frame}
135
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   424
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   425
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   426
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   427
\begin{frame}[c]
515
3566c8175e63 updated
cu
parents: 500
diff changeset
   428
\frametitle{An NFA Example}
3566c8175e63 updated
cu
parents: 500
diff changeset
   429
3566c8175e63 updated
cu
parents: 500
diff changeset
   430
% A NFA for (ab* + b)*a
3566c8175e63 updated
cu
parents: 500
diff changeset
   431
\begin{center}
3566c8175e63 updated
cu
parents: 500
diff changeset
   432
\begin{tikzpicture}[>=stealth',very thick, auto,
3566c8175e63 updated
cu
parents: 500
diff changeset
   433
    every state/.style={minimum size=0pt,inner sep=3pt,
3566c8175e63 updated
cu
parents: 500
diff changeset
   434
      draw=blue!50,very thick,fill=blue!20},scale=2]
3566c8175e63 updated
cu
parents: 500
diff changeset
   435
\node[state,initial]  (Q_0)  {$\mbox{Q}_0$};
3566c8175e63 updated
cu
parents: 500
diff changeset
   436
\node[state] (Q_1) [right=of Q_0] {$\mbox{Q}_1$};
3566c8175e63 updated
cu
parents: 500
diff changeset
   437
\node[state, accepting] (Q_2) [right=of Q_1] {$\mbox{Q}_2$};
3566c8175e63 updated
cu
parents: 500
diff changeset
   438
\path[->] (Q_0) edge [loop above] node  {\alert{$b$}} ();
3566c8175e63 updated
cu
parents: 500
diff changeset
   439
\path[<-] (Q_0) edge node [below]  {\alert{$b$}} (Q_1);
3566c8175e63 updated
cu
parents: 500
diff changeset
   440
\path[->] (Q_0) edge [bend left] node [above]  {\alert{$a$}} (Q_1);
3566c8175e63 updated
cu
parents: 500
diff changeset
   441
\path[->] (Q_0) edge [bend right] node [below]  {\alert{$a$}} (Q_2);
3566c8175e63 updated
cu
parents: 500
diff changeset
   442
\path[->] (Q_1) edge [loop above] node  {\alert{$a,b$}} ();
3566c8175e63 updated
cu
parents: 500
diff changeset
   443
\path[->] (Q_1) edge node  [above] {\alert{$a$}} (Q_2);
3566c8175e63 updated
cu
parents: 500
diff changeset
   444
\end{tikzpicture}
3566c8175e63 updated
cu
parents: 500
diff changeset
   445
\end{center}
3566c8175e63 updated
cu
parents: 500
diff changeset
   446
3566c8175e63 updated
cu
parents: 500
diff changeset
   447
\end{frame}
3566c8175e63 updated
cu
parents: 500
diff changeset
   448
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
3566c8175e63 updated
cu
parents: 500
diff changeset
   449
3566c8175e63 updated
cu
parents: 500
diff changeset
   450
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3566c8175e63 updated
cu
parents: 500
diff changeset
   451
\begin{frame}[c]
574
bd4f144326c7 updated
Christian Urban <urbanc@in.tum.de>
parents: 573
diff changeset
   452
\frametitle{Another Example}
bd4f144326c7 updated
Christian Urban <urbanc@in.tum.de>
parents: 573
diff changeset
   453
bd4f144326c7 updated
Christian Urban <urbanc@in.tum.de>
parents: 573
diff changeset
   454
For the regular expression \bl{$(.^*)a\,(.^{\{n\}})bc$}\bigskip\bigskip
bd4f144326c7 updated
Christian Urban <urbanc@in.tum.de>
parents: 573
diff changeset
   455
bd4f144326c7 updated
Christian Urban <urbanc@in.tum.de>
parents: 573
diff changeset
   456
% \begin{center}
650
3031e3379ea3 updated
Christian Urban <urbanc@in.tum.de>
parents: 574
diff changeset
   457
\mbox{}\hspace{-11.5mm}
574
bd4f144326c7 updated
Christian Urban <urbanc@in.tum.de>
parents: 573
diff changeset
   458
	\begin{tikzpicture}[>=stealth',very thick, auto,
bd4f144326c7 updated
Christian Urban <urbanc@in.tum.de>
parents: 573
diff changeset
   459
	every state/.style={minimum size=5pt,inner sep=1pt,
bd4f144326c7 updated
Christian Urban <urbanc@in.tum.de>
parents: 573
diff changeset
   460
		draw=blue!50,very thick,fill=blue!20},scale=1, node distance=5mm,
bd4f144326c7 updated
Christian Urban <urbanc@in.tum.de>
parents: 573
diff changeset
   461
	decoration={brace,mirror,amplitude=7}]
bd4f144326c7 updated
Christian Urban <urbanc@in.tum.de>
parents: 573
diff changeset
   462
	\node[state,initial]  (Q_0)  {$\;0\;$};
bd4f144326c7 updated
Christian Urban <urbanc@in.tum.de>
parents: 573
diff changeset
   463
	\node[state] (Q_1) [right=of Q_0] {$\;1\;$};
bd4f144326c7 updated
Christian Urban <urbanc@in.tum.de>
parents: 573
diff changeset
   464
	\node[state] (Q_2) [right=of Q_1] {$\;2\;$};
bd4f144326c7 updated
Christian Urban <urbanc@in.tum.de>
parents: 573
diff changeset
   465
	\node (Q_3) [right=of Q_2] {$\hspace{-1mm}\ldots\hspace{-3mm}$};
bd4f144326c7 updated
Christian Urban <urbanc@in.tum.de>
parents: 573
diff changeset
   466
	\node[state] (Q_4) [right=of Q_3] {$\;\phantom{1}\;$};
bd4f144326c7 updated
Christian Urban <urbanc@in.tum.de>
parents: 573
diff changeset
   467
	\node (Q_5) [right=of Q_4] {$\hspace{-1mm}\ldots\hspace{-3mm}$};
bd4f144326c7 updated
Christian Urban <urbanc@in.tum.de>
parents: 573
diff changeset
   468
	\node[state] (Q_6) [right=of Q_5] {\tiny$n+1$};
bd4f144326c7 updated
Christian Urban <urbanc@in.tum.de>
parents: 573
diff changeset
   469
	\node[state] (Q_7) [right=of Q_6] {\tiny$n+2$};
bd4f144326c7 updated
Christian Urban <urbanc@in.tum.de>
parents: 573
diff changeset
   470
	\node[state,accepting] (Q_8) [right=of Q_7] {\tiny$n+3$};
bd4f144326c7 updated
Christian Urban <urbanc@in.tum.de>
parents: 573
diff changeset
   471
	
bd4f144326c7 updated
Christian Urban <urbanc@in.tum.de>
parents: 573
diff changeset
   472
	\path[->] (Q_0) edge [loop above] node {$*$} ();
bd4f144326c7 updated
Christian Urban <urbanc@in.tum.de>
parents: 573
diff changeset
   473
	\path[->] (Q_0) edge node [above] {$a$} (Q_1);
bd4f144326c7 updated
Christian Urban <urbanc@in.tum.de>
parents: 573
diff changeset
   474
	\path[->] (Q_1) edge node [above] {$*$} (Q_2);
bd4f144326c7 updated
Christian Urban <urbanc@in.tum.de>
parents: 573
diff changeset
   475
	\path[->] (Q_2) edge node [above] {$*$} (Q_3);
bd4f144326c7 updated
Christian Urban <urbanc@in.tum.de>
parents: 573
diff changeset
   476
	\path[->] (Q_4) edge node [above] {$*$} (Q_5);
bd4f144326c7 updated
Christian Urban <urbanc@in.tum.de>
parents: 573
diff changeset
   477
	\path[->] (Q_5) edge node [above] {$*$} (Q_6);
bd4f144326c7 updated
Christian Urban <urbanc@in.tum.de>
parents: 573
diff changeset
   478
	\path[->] (Q_6) edge node [above] {$b$} (Q_7);
bd4f144326c7 updated
Christian Urban <urbanc@in.tum.de>
parents: 573
diff changeset
   479
	\path[->] (Q_7) edge node [above] {$c$} (Q_8);
bd4f144326c7 updated
Christian Urban <urbanc@in.tum.de>
parents: 573
diff changeset
   480
	
bd4f144326c7 updated
Christian Urban <urbanc@in.tum.de>
parents: 573
diff changeset
   481
	\draw [decorate] ([yshift=-5mm]Q_1.east) --node[below=3mm]{$n$} ([yshift=-5mm]Q_6.west);
bd4f144326c7 updated
Christian Urban <urbanc@in.tum.de>
parents: 573
diff changeset
   482
	\end{tikzpicture}\bigskip
bd4f144326c7 updated
Christian Urban <urbanc@in.tum.de>
parents: 573
diff changeset
   483
bd4f144326c7 updated
Christian Urban <urbanc@in.tum.de>
parents: 573
diff changeset
   484
bd4f144326c7 updated
Christian Urban <urbanc@in.tum.de>
parents: 573
diff changeset
   485
{\small Note the star-transitions: accept any character.}
bd4f144326c7 updated
Christian Urban <urbanc@in.tum.de>
parents: 573
diff changeset
   486
        
bd4f144326c7 updated
Christian Urban <urbanc@in.tum.de>
parents: 573
diff changeset
   487
\end{frame}
bd4f144326c7 updated
Christian Urban <urbanc@in.tum.de>
parents: 573
diff changeset
   488
bd4f144326c7 updated
Christian Urban <urbanc@in.tum.de>
parents: 573
diff changeset
   489
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
bd4f144326c7 updated
Christian Urban <urbanc@in.tum.de>
parents: 573
diff changeset
   490
\begin{frame}[c]
515
3566c8175e63 updated
cu
parents: 500
diff changeset
   491
\frametitle{Two Epsilon NFA Examples}
135
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   492
346
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
   493
\small
135
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   494
\begin{center}
143
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 139
diff changeset
   495
\begin{tabular}[t]{c@{\hspace{9mm}}c}
136
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 135
diff changeset
   496
\begin{tikzpicture}[scale=0.7,>=stealth',very thick,
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 135
diff changeset
   497
                             every state/.style={minimum size=0pt,draw=blue!50,very thick,fill=blue!20},]
215
828303e8e4af updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 143
diff changeset
   498
\node[state,initial]  (q_0)  {$q_0$};
828303e8e4af updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 143
diff changeset
   499
\node[state] (q_1) [above=of q_0] {$q_1$};
828303e8e4af updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 143
diff changeset
   500
\node[state, accepting] (q_2) [below=of q_0] {$q_2$};
828303e8e4af updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 143
diff changeset
   501
\path[->] (q_0) edge node [left]  {\alert{$\epsilon$}} (q_1);
828303e8e4af updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 143
diff changeset
   502
\path[->] (q_0) edge node [left]  {\alert{$\epsilon$}} (q_2);
828303e8e4af updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 143
diff changeset
   503
\path[->] (q_0) edge [loop right] node  {\alert{$a$}} ();
828303e8e4af updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 143
diff changeset
   504
\path[->] (q_1) edge [loop above] node  {\alert{$a$}} ();
828303e8e4af updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 143
diff changeset
   505
\path[->] (q_2) edge [loop below] node  {\alert{$b$}} ();
143
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 139
diff changeset
   506
\end{tikzpicture} &
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 139
diff changeset
   507
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 139
diff changeset
   508
\raisebox{20mm}{
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 139
diff changeset
   509
\begin{tikzpicture}[scale=0.7,>=stealth',very thick,
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 139
diff changeset
   510
                             every state/.style={minimum size=0pt,draw=blue!50,very thick,fill=blue!20},]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 139
diff changeset
   511
\node[state,initial]  (r_1)  {$r_1$};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 139
diff changeset
   512
\node[state] (r_2) [above=of r_1] {$r_2$};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 139
diff changeset
   513
\node[state, accepting] (r_3) [right=of r_1] {$r_3$};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 139
diff changeset
   514
\path[->] (r_1) edge node [below]  {\alert{$b$}} (r_3);
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 139
diff changeset
   515
\path[->] (r_2) edge [bend left] node [above]  {\alert{$a$}} (r_3);
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 139
diff changeset
   516
\path[->] (r_1) edge [bend left] node  [left] {\alert{$\epsilon$}} (r_2);
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 139
diff changeset
   517
\path[->] (r_2) edge [bend left] node  [right] {\alert{$a$}} (r_1);
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 139
diff changeset
   518
\end{tikzpicture}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 139
diff changeset
   519
\end{tabular}
135
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   520
\end{center}
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   521
265
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
   522
\end{frame}
135
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   523
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   524
515
3566c8175e63 updated
cu
parents: 500
diff changeset
   525
135
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   526
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   527
\begin{frame}[c]
779
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   528
\frametitle{Thompson: Rexp to $\epsilon$NFA}
135
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   529
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   530
\begin{center}
137
69cec773736b added pictures
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 136
diff changeset
   531
\begin{tabular}[t]{l@{\hspace{10mm}}l}
445
e7d0157f0471 updated slides
Christian Urban <urbanc@in.tum.de>
parents: 348
diff changeset
   532
\raisebox{1mm}{\bl{$\ZERO$}} & 
137
69cec773736b added pictures
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 136
diff changeset
   533
\begin{tikzpicture}[scale=0.7,>=stealth',very thick, every state/.style={minimum size=3pt,draw=blue!50,very thick,fill=blue!20},]
515
3566c8175e63 updated
cu
parents: 500
diff changeset
   534
\node[state, initial]  (Q_0)  {$\mbox{}$};
137
69cec773736b added pictures
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 136
diff changeset
   535
\end{tikzpicture}\\\\
445
e7d0157f0471 updated slides
Christian Urban <urbanc@in.tum.de>
parents: 348
diff changeset
   536
\raisebox{1mm}{\bl{$\ONE$}} & 
137
69cec773736b added pictures
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 136
diff changeset
   537
\begin{tikzpicture}[scale=0.7,>=stealth',very thick, every state/.style={minimum size=3pt,draw=blue!50,very thick,fill=blue!20},]
515
3566c8175e63 updated
cu
parents: 500
diff changeset
   538
\node[state, initial, accepting]  (Q_0)  {$\mbox{}$};
137
69cec773736b added pictures
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 136
diff changeset
   539
\end{tikzpicture}\\\\
651
652065f55d54 updated
Christian Urban <urbanc@in.tum.de>
parents: 650
diff changeset
   540
\raisebox{5mm}{\bl{$c$}} & 
137
69cec773736b added pictures
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 136
diff changeset
   541
\begin{tikzpicture}[scale=0.7,>=stealth',very thick, every state/.style={minimum size=3pt,draw=blue!50,very thick,fill=blue!20},]
515
3566c8175e63 updated
cu
parents: 500
diff changeset
   542
\node[state, initial]  (Q_0)  {$\mbox{}$};
3566c8175e63 updated
cu
parents: 500
diff changeset
   543
\node[state, accepting]  (Q_1)  [right=of Q_0] {$\mbox{}$};
3566c8175e63 updated
cu
parents: 500
diff changeset
   544
\path[->] (Q_0) edge node [below]  {\alert{$c$}} (Q_1);
137
69cec773736b added pictures
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 136
diff changeset
   545
\end{tikzpicture}\\\\
135
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   546
\end{tabular}
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   547
\end{center}
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   548
265
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
   549
\end{frame}
135
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   550
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   551
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   552
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
137
69cec773736b added pictures
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 136
diff changeset
   553
\begin{frame}[t]
69cec773736b added pictures
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 136
diff changeset
   554
\frametitle{Case $r_1\cdot r_2$}
69cec773736b added pictures
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 136
diff changeset
   555
69cec773736b added pictures
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 136
diff changeset
   556
\mbox{}\bigskip
515
3566c8175e63 updated
cu
parents: 500
diff changeset
   557
\onslide<1->{By recursion we are given two automata:\bigskip}
137
69cec773736b added pictures
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 136
diff changeset
   558
515
3566c8175e63 updated
cu
parents: 500
diff changeset
   559
{\centering%
3566c8175e63 updated
cu
parents: 500
diff changeset
   560
\only<1>{%
3566c8175e63 updated
cu
parents: 500
diff changeset
   561
\begin{tikzpicture}[node distance=3mm,
3566c8175e63 updated
cu
parents: 500
diff changeset
   562
    >=stealth',very thick,
3566c8175e63 updated
cu
parents: 500
diff changeset
   563
    every state/.style={minimum size=3pt,draw=blue!50,very thick,fill=blue!20}]
3566c8175e63 updated
cu
parents: 500
diff changeset
   564
\node[state, initial]  (Q_0)  {$\mbox{}$};
3566c8175e63 updated
cu
parents: 500
diff changeset
   565
\node[state, initial]  (Q_01) [below=1mm of Q_0] {$\mbox{}$};  
3566c8175e63 updated
cu
parents: 500
diff changeset
   566
\node[state, initial]  (Q_02) [above=1mm of Q_0] {$\mbox{}$};  
3566c8175e63 updated
cu
parents: 500
diff changeset
   567
\node (R_1)  [right=of Q_0] {$\ldots$};
3566c8175e63 updated
cu
parents: 500
diff changeset
   568
\node[state, accepting]  (T_1)  [right=of R_1] {$\mbox{}$};
3566c8175e63 updated
cu
parents: 500
diff changeset
   569
\node[state, accepting]  (T_2)  [above=of T_1] {$\mbox{}$};
3566c8175e63 updated
cu
parents: 500
diff changeset
   570
\node[state, accepting]  (T_3)  [below=of T_1] {$\mbox{}$};
3566c8175e63 updated
cu
parents: 500
diff changeset
   571
3566c8175e63 updated
cu
parents: 500
diff changeset
   572
\node (A_0)  [right=2.5cm of T_1] {$\mbox{}$};
3566c8175e63 updated
cu
parents: 500
diff changeset
   573
\node[state, initial]  (A_01)  [above=1mm of A_0] {$\mbox{}$};
3566c8175e63 updated
cu
parents: 500
diff changeset
   574
\node[state, initial]  (A_02)  [below=1mm of A_0] {$\mbox{}$};
3566c8175e63 updated
cu
parents: 500
diff changeset
   575
3566c8175e63 updated
cu
parents: 500
diff changeset
   576
\node (b_1)  [right=of A_0] {$\ldots$};
137
69cec773736b added pictures
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 136
diff changeset
   577
\node[state, accepting]  (c_1)  [right=of b_1] {$\mbox{}$};
69cec773736b added pictures
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 136
diff changeset
   578
\node[state, accepting]  (c_2)  [above=of c_1] {$\mbox{}$};
69cec773736b added pictures
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 136
diff changeset
   579
\node[state, accepting]  (c_3)  [below=of c_1] {$\mbox{}$};
69cec773736b added pictures
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 136
diff changeset
   580
\begin{pgfonlayer}{background}
515
3566c8175e63 updated
cu
parents: 500
diff changeset
   581
  \node (1) [rounded corners, inner sep=1mm, thick,
3566c8175e63 updated
cu
parents: 500
diff changeset
   582
    draw=black!60, fill=black!20, fit= (Q_0) (R_1) (T_1) (T_2) (T_3)] {};
3566c8175e63 updated
cu
parents: 500
diff changeset
   583
  \node (2) [rounded corners, inner sep=1mm, thick,
3566c8175e63 updated
cu
parents: 500
diff changeset
   584
    draw=black!60, fill=black!20, fit= (A_0) (b_1) (c_1) (c_2) (c_3)] {};
3566c8175e63 updated
cu
parents: 500
diff changeset
   585
\node [yshift=2mm] at (1.north) {$r_1$};
3566c8175e63 updated
cu
parents: 500
diff changeset
   586
\node [yshift=2mm] at (2.north) {$r_2$};
143
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 139
diff changeset
   587
\end{pgfonlayer}
515
3566c8175e63 updated
cu
parents: 500
diff changeset
   588
\end{tikzpicture}}
3566c8175e63 updated
cu
parents: 500
diff changeset
   589
\only<2>{%
3566c8175e63 updated
cu
parents: 500
diff changeset
   590
\begin{tikzpicture}[node distance=3mm,
3566c8175e63 updated
cu
parents: 500
diff changeset
   591
    >=stealth',very thick,
3566c8175e63 updated
cu
parents: 500
diff changeset
   592
    every state/.style={minimum size=3pt,draw=blue!50,very thick,fill=blue!20},]
3566c8175e63 updated
cu
parents: 500
diff changeset
   593
\node[state, initial]  (Q_0)  {$\mbox{}$};
3566c8175e63 updated
cu
parents: 500
diff changeset
   594
\node[state, initial]  (Q_01) [below=1mm of Q_0] {$\mbox{}$};  
3566c8175e63 updated
cu
parents: 500
diff changeset
   595
\node[state, initial]  (Q_02) [above=1mm of Q_0] {$\mbox{}$};  
3566c8175e63 updated
cu
parents: 500
diff changeset
   596
\node (r_1)  [right=of Q_0] {$\ldots$};
3566c8175e63 updated
cu
parents: 500
diff changeset
   597
\node[state]  (t_1)  [right=of r_1] {$\mbox{}$};
3566c8175e63 updated
cu
parents: 500
diff changeset
   598
\node[state]  (t_2)  [above=of t_1] {$\mbox{}$};
3566c8175e63 updated
cu
parents: 500
diff changeset
   599
\node[state]  (t_3)  [below=of t_1] {$\mbox{}$};
3566c8175e63 updated
cu
parents: 500
diff changeset
   600
3566c8175e63 updated
cu
parents: 500
diff changeset
   601
\node  (A_0)  [right=2.5cm of t_1] {$\mbox{}$};
3566c8175e63 updated
cu
parents: 500
diff changeset
   602
\node[state]  (A_01)  [above=1mm of A_0] {$\mbox{}$};
3566c8175e63 updated
cu
parents: 500
diff changeset
   603
\node[state]  (A_02)  [below=1mm of A_0] {$\mbox{}$};
3566c8175e63 updated
cu
parents: 500
diff changeset
   604
3566c8175e63 updated
cu
parents: 500
diff changeset
   605
\node (b_1)  [right=of A_0] {$\ldots$};
3566c8175e63 updated
cu
parents: 500
diff changeset
   606
\node[state, accepting]  (c_1)  [right=of b_1] {$\mbox{}$};
3566c8175e63 updated
cu
parents: 500
diff changeset
   607
\node[state, accepting]  (c_2)  [above=of c_1] {$\mbox{}$};
3566c8175e63 updated
cu
parents: 500
diff changeset
   608
\node[state, accepting]  (c_3)  [below=of c_1] {$\mbox{}$};
3566c8175e63 updated
cu
parents: 500
diff changeset
   609
\path[->] (t_1) edge (A_01);
3566c8175e63 updated
cu
parents: 500
diff changeset
   610
\path[->] (t_2) edge node [above]  {$\epsilon$s} (A_01);
3566c8175e63 updated
cu
parents: 500
diff changeset
   611
\path[->] (t_3) edge (A_01);
3566c8175e63 updated
cu
parents: 500
diff changeset
   612
\path[->] (t_1) edge (A_02);
3566c8175e63 updated
cu
parents: 500
diff changeset
   613
\path[->] (t_2) edge (A_02);
3566c8175e63 updated
cu
parents: 500
diff changeset
   614
\path[->] (t_3) edge node [below]  {$\epsilon$s} (A_02);
3566c8175e63 updated
cu
parents: 500
diff changeset
   615
 
3566c8175e63 updated
cu
parents: 500
diff changeset
   616
\begin{pgfonlayer}{background}
3566c8175e63 updated
cu
parents: 500
diff changeset
   617
  \node (3) [rounded corners, inner sep=1mm, thick,
3566c8175e63 updated
cu
parents: 500
diff changeset
   618
    draw=black!60, fill=black!20, fit= (Q_0) (c_1) (c_2) (c_3)] {};
3566c8175e63 updated
cu
parents: 500
diff changeset
   619
\node [yshift=2mm] at (3.north) {$r_1\cdot r_2$};
3566c8175e63 updated
cu
parents: 500
diff changeset
   620
\end{pgfonlayer}
3566c8175e63 updated
cu
parents: 500
diff changeset
   621
\end{tikzpicture}}
3566c8175e63 updated
cu
parents: 500
diff changeset
   622
%
3566c8175e63 updated
cu
parents: 500
diff changeset
   623
}\bigskip\bigskip
137
69cec773736b added pictures
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 136
diff changeset
   624
69cec773736b added pictures
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 136
diff changeset
   625
\small
69cec773736b added pictures
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 136
diff changeset
   626
We need to (1) change the accepting nodes of the first automaton into non-accepting nodes, and (2) connect them
69cec773736b added pictures
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 136
diff changeset
   627
via $\epsilon$-transitions to the starting state of the second automaton. 
135
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   628
265
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
   629
\end{frame}
137
69cec773736b added pictures
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 136
diff changeset
   630
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
69cec773736b added pictures
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 136
diff changeset
   631
69cec773736b added pictures
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 136
diff changeset
   632
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
69cec773736b added pictures
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 136
diff changeset
   633
\begin{frame}[t]
69cec773736b added pictures
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 136
diff changeset
   634
\frametitle{Case $r_1+ r_2$}
515
3566c8175e63 updated
cu
parents: 500
diff changeset
   635
\mbox{}\\[-8mm]
137
69cec773736b added pictures
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 136
diff changeset
   636
515
3566c8175e63 updated
cu
parents: 500
diff changeset
   637
\onslide<1->{By recursion we are given two automata:\smallskip}
137
69cec773736b added pictures
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 136
diff changeset
   638
515
3566c8175e63 updated
cu
parents: 500
diff changeset
   639
\hspace{2cm}
3566c8175e63 updated
cu
parents: 500
diff changeset
   640
\only<1>{%
3566c8175e63 updated
cu
parents: 500
diff changeset
   641
  \begin{tikzpicture}[node distance=3mm,
3566c8175e63 updated
cu
parents: 500
diff changeset
   642
    >=stealth',very thick,
3566c8175e63 updated
cu
parents: 500
diff changeset
   643
    every state/.style={minimum size=3pt,draw=blue!50,very thick,fill=blue!20},
3566c8175e63 updated
cu
parents: 500
diff changeset
   644
    baseline=(current bounding box.center)]
3566c8175e63 updated
cu
parents: 500
diff changeset
   645
\node at (0,0)  (1)  {$\mbox{}$};
3566c8175e63 updated
cu
parents: 500
diff changeset
   646
\node  (2)  [above=14mm of 1] {};
3566c8175e63 updated
cu
parents: 500
diff changeset
   647
\node[state, initial]  (4)  [above=1mm of 2] {$\mbox{}$};
3566c8175e63 updated
cu
parents: 500
diff changeset
   648
\node[state, initial]  (5)  [below=1mm of 2] {$\mbox{}$};
3566c8175e63 updated
cu
parents: 500
diff changeset
   649
\node[state, initial]  (3)  [below=10mm of 1] {$\mbox{}$};
135
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   650
515
3566c8175e63 updated
cu
parents: 500
diff changeset
   651
\node (a)  [right=of 2] {$\ldots\,$};
3566c8175e63 updated
cu
parents: 500
diff changeset
   652
\node  (a1)  [right=of a] {$$};
137
69cec773736b added pictures
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 136
diff changeset
   653
\node[state, accepting]  (a2)  [above=of a1] {$\mbox{}$};
69cec773736b added pictures
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 136
diff changeset
   654
\node[state, accepting]  (a3)  [below=of a1] {$\mbox{}$};
69cec773736b added pictures
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 136
diff changeset
   655
69cec773736b added pictures
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 136
diff changeset
   656
\node (b)  [right=of 3] {$\ldots$};
69cec773736b added pictures
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 136
diff changeset
   657
\node[state, accepting]  (b1)  [right=of b] {$\mbox{}$};
69cec773736b added pictures
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 136
diff changeset
   658
\node[state, accepting]  (b2)  [above=of b1] {$\mbox{}$};
69cec773736b added pictures
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 136
diff changeset
   659
\node[state, accepting]  (b3)  [below=of b1] {$\mbox{}$};
69cec773736b added pictures
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 136
diff changeset
   660
\begin{pgfonlayer}{background}
515
3566c8175e63 updated
cu
parents: 500
diff changeset
   661
\node (1) [rounded corners, inner sep=1mm, thick, draw=black!60, fill=black!20, fit= (2) (a1) (a2) (a3)] {};
3566c8175e63 updated
cu
parents: 500
diff changeset
   662
\node (2) [rounded corners, inner sep=1mm, thick, draw=black!60, fill=black!20, fit= (3) (b1) (b2) (b3)] {};
3566c8175e63 updated
cu
parents: 500
diff changeset
   663
\node [yshift=3mm] at (1.north) {$r_1$};
3566c8175e63 updated
cu
parents: 500
diff changeset
   664
\node [yshift=3mm] at (2.north) {$r_2$};
137
69cec773736b added pictures
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 136
diff changeset
   665
\end{pgfonlayer}
515
3566c8175e63 updated
cu
parents: 500
diff changeset
   666
\end{tikzpicture}}
3566c8175e63 updated
cu
parents: 500
diff changeset
   667
\only<2>{%
3566c8175e63 updated
cu
parents: 500
diff changeset
   668
\begin{tikzpicture}[node distance=3mm,
3566c8175e63 updated
cu
parents: 500
diff changeset
   669
    >=stealth',very thick,
3566c8175e63 updated
cu
parents: 500
diff changeset
   670
    every state/.style={minimum size=3pt,draw=blue!50,very thick,fill=blue!20},
3566c8175e63 updated
cu
parents: 500
diff changeset
   671
    baseline=(current bounding box.center)]
3566c8175e63 updated
cu
parents: 500
diff changeset
   672
\node at (0,0) (1)  {$\mbox{}$};
3566c8175e63 updated
cu
parents: 500
diff changeset
   673
\node (2)  [above=14mm of 1] {$$};
3566c8175e63 updated
cu
parents: 500
diff changeset
   674
\node[state, initial]  (4)  [above=1mm of 2] {$\mbox{}$};
3566c8175e63 updated
cu
parents: 500
diff changeset
   675
\node[state, initial]  (5)  [below=1mm of 2] {$\mbox{}$};
3566c8175e63 updated
cu
parents: 500
diff changeset
   676
\node[state, initial]  (3)  [below=10mm of 1] {$\mbox{}$};
3566c8175e63 updated
cu
parents: 500
diff changeset
   677
3566c8175e63 updated
cu
parents: 500
diff changeset
   678
\node (a)  [right=of 2] {$\ldots\,$};
3566c8175e63 updated
cu
parents: 500
diff changeset
   679
\node (a1)  [right=of a] {$$};
3566c8175e63 updated
cu
parents: 500
diff changeset
   680
\node[state, accepting]  (a2)  [above=of a1] {$\mbox{}$};
3566c8175e63 updated
cu
parents: 500
diff changeset
   681
\node[state, accepting]  (a3)  [below=of a1] {$\mbox{}$};
3566c8175e63 updated
cu
parents: 500
diff changeset
   682
3566c8175e63 updated
cu
parents: 500
diff changeset
   683
\node (b)  [right=of 3] {$\ldots$};
3566c8175e63 updated
cu
parents: 500
diff changeset
   684
\node[state, accepting]  (b1)  [right=of b] {$\mbox{}$};
3566c8175e63 updated
cu
parents: 500
diff changeset
   685
\node[state, accepting]  (b2)  [above=of b1] {$\mbox{}$};
3566c8175e63 updated
cu
parents: 500
diff changeset
   686
\node[state, accepting]  (b3)  [below=of b1] {$\mbox{}$};
3566c8175e63 updated
cu
parents: 500
diff changeset
   687
3566c8175e63 updated
cu
parents: 500
diff changeset
   688
%\path[->] (1) edge node [above]  {$\epsilon$} (2);
3566c8175e63 updated
cu
parents: 500
diff changeset
   689
%\path[->] (1) edge node [below]  {$\epsilon$} (3);
3566c8175e63 updated
cu
parents: 500
diff changeset
   690
3566c8175e63 updated
cu
parents: 500
diff changeset
   691
\begin{pgfonlayer}{background}
3566c8175e63 updated
cu
parents: 500
diff changeset
   692
\node (3) [rounded corners, inner sep=1mm, thick, draw=black!60, fill=black!20, fit= (1) (a2) (a3) (b2) (b3)] {};
3566c8175e63 updated
cu
parents: 500
diff changeset
   693
\node [yshift=3mm] at (3.north) {$r_1+ r_2$};
3566c8175e63 updated
cu
parents: 500
diff changeset
   694
\end{pgfonlayer}
3566c8175e63 updated
cu
parents: 500
diff changeset
   695
\end{tikzpicture}}
3566c8175e63 updated
cu
parents: 500
diff changeset
   696
%
137
69cec773736b added pictures
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 136
diff changeset
   697
69cec773736b added pictures
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 136
diff changeset
   698
\small
515
3566c8175e63 updated
cu
parents: 500
diff changeset
   699
\mbox{}\\\medskip
517
edab48a5b37e updated
cu
parents: 515
diff changeset
   700
We can just put both automata together.
265
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
   701
\end{frame}
135
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   702
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   703
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   704
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   705
\begin{frame}[c]
138
b98a0a49c432 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 137
diff changeset
   706
\frametitle{Case $r^*$}
b98a0a49c432 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 137
diff changeset
   707
515
3566c8175e63 updated
cu
parents: 500
diff changeset
   708
\onslide<1->{By recursion we are given an automaton for $r$:\smallskip}
135
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   709
515
3566c8175e63 updated
cu
parents: 500
diff changeset
   710
\hspace{2cm}
3566c8175e63 updated
cu
parents: 500
diff changeset
   711
\only<1>{\begin{tikzpicture}[node distance=3mm,
3566c8175e63 updated
cu
parents: 500
diff changeset
   712
    >=stealth',very thick,
3566c8175e63 updated
cu
parents: 500
diff changeset
   713
    every state/.style={minimum size=3pt,draw=blue!50,very thick,fill=blue!20},
3566c8175e63 updated
cu
parents: 500
diff changeset
   714
    baseline=(current bounding box.north)]
3566c8175e63 updated
cu
parents: 500
diff changeset
   715
\node (2)  {$\mbox{}$};
3566c8175e63 updated
cu
parents: 500
diff changeset
   716
\node[state, initial]  (4)  [above=1mm of 2] {$\mbox{}$};
3566c8175e63 updated
cu
parents: 500
diff changeset
   717
\node[state, initial]  (5)  [below=1mm of 2] {$\mbox{}$};  
138
b98a0a49c432 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 137
diff changeset
   718
\node (a)  [right=of 2] {$\ldots$};
b98a0a49c432 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 137
diff changeset
   719
\node[state, accepting]  (a1)  [right=of a] {$\mbox{}$};
b98a0a49c432 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 137
diff changeset
   720
\node[state, accepting]  (a2)  [above=of a1] {$\mbox{}$};
515
3566c8175e63 updated
cu
parents: 500
diff changeset
   721
\node[state, accepting]  (a3)  [below=of a1] {$\mbox{}$};
3566c8175e63 updated
cu
parents: 500
diff changeset
   722
\begin{pgfonlayer}{background}
3566c8175e63 updated
cu
parents: 500
diff changeset
   723
\node (1) [rounded corners, inner sep=1mm, thick, draw=black!60, fill=black!20, fit= (2) (a1) (a2) (a3)] {};
3566c8175e63 updated
cu
parents: 500
diff changeset
   724
\node [yshift=3mm] at (1.north) {$r$};
3566c8175e63 updated
cu
parents: 500
diff changeset
   725
\end{pgfonlayer}
3566c8175e63 updated
cu
parents: 500
diff changeset
   726
\end{tikzpicture}}
3566c8175e63 updated
cu
parents: 500
diff changeset
   727
\only<2->{\begin{tikzpicture}[node distance=3mm,
3566c8175e63 updated
cu
parents: 500
diff changeset
   728
    >=stealth',very thick,
3566c8175e63 updated
cu
parents: 500
diff changeset
   729
    every state/.style={minimum size=3pt,draw=blue!50,very thick,fill=blue!20},
3566c8175e63 updated
cu
parents: 500
diff changeset
   730
    baseline=(current bounding box.north)]
3566c8175e63 updated
cu
parents: 500
diff changeset
   731
\node at (0,0) [state, initial,accepting]  (1)  {$\mbox{}$};
3566c8175e63 updated
cu
parents: 500
diff changeset
   732
\node (2)  [right=16mm of 1] {$\mbox{}$};
3566c8175e63 updated
cu
parents: 500
diff changeset
   733
\node[state]  (4)  [above=1mm of 2] {$\mbox{}$};
3566c8175e63 updated
cu
parents: 500
diff changeset
   734
\node[state]  (5)  [below=1mm of 2] {$\mbox{}$};  
3566c8175e63 updated
cu
parents: 500
diff changeset
   735
\node (a)  [right=of 2] {$\ldots$};
138
b98a0a49c432 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 137
diff changeset
   736
\node[state]  (a1)  [right=of a] {$\mbox{}$};
b98a0a49c432 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 137
diff changeset
   737
\node[state]  (a2)  [above=of a1] {$\mbox{}$};
515
3566c8175e63 updated
cu
parents: 500
diff changeset
   738
\node[state]  (a3)  [below=of a1] {$\mbox{}$};
3566c8175e63 updated
cu
parents: 500
diff changeset
   739
\path[->] (1) edge node [below]  {$\epsilon$} (4);
3566c8175e63 updated
cu
parents: 500
diff changeset
   740
\path[->] (1) edge node [below]  {$\epsilon$} (5);
3566c8175e63 updated
cu
parents: 500
diff changeset
   741
\path[->] (a1) edge [bend left=45] node [below]  {$\epsilon$} (1);
3566c8175e63 updated
cu
parents: 500
diff changeset
   742
\path[->] (a2) edge [bend right] node [below]  {$\epsilon$} (1);
3566c8175e63 updated
cu
parents: 500
diff changeset
   743
\path[->] (a3) edge [bend left=45] node [below]  {$\epsilon$} (1);
138
b98a0a49c432 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 137
diff changeset
   744
\begin{pgfonlayer}{background}
515
3566c8175e63 updated
cu
parents: 500
diff changeset
   745
\node (2) [rounded corners, inner sep=1mm, thick, draw=black!60, fill=black!20, fit= (1) (a2) (a3)] {};
3566c8175e63 updated
cu
parents: 500
diff changeset
   746
\node [yshift=3mm] at (2.north) {$r^*$};
138
b98a0a49c432 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 137
diff changeset
   747
\end{pgfonlayer}
515
3566c8175e63 updated
cu
parents: 500
diff changeset
   748
\end{tikzpicture}}
3566c8175e63 updated
cu
parents: 500
diff changeset
   749
\bigskip
138
b98a0a49c432 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 137
diff changeset
   750
139
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 138
diff changeset
   751
\onslide<3->{
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 138
diff changeset
   752
Why can't we just have an epsilon transition from the accepting states to the starting state?}
135
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   753
346
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
   754
\end{frame}
135
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   755
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   756
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   757
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
   758
\begin{frame}[c]
779
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   759
\frametitle{\mbox{NFA Breadth-First: \boldmath{}$a^{?\{n\}}\!\cdot\! a^{\{n\}}$}}
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   760
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   761
\begin{tikzpicture}
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   762
  \begin{axis}[xlabel={\pcode{a}s},
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   763
    ylabel={time in secs},
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   764
    enlargelimits=false,
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   765
    xtick={0,5,...,30},
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   766
    xmax=30,
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   767
    ymax=35,
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   768
    ytick={0,5,...,30},
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   769
    scaled ticks=false,
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   770
    axis lines=left,
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   771
    width=9cm,
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   772
    height=6cm, 
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   773
    legend entries={Python,Ruby,my NFA},
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   774
    legend pos=outer north east,
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   775
    legend cell align=left]
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   776
\addplot[blue,mark=*, mark options={fill=white}] table {re-python.data};
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   777
\addplot[brown,mark=pentagon*, mark options={fill=white}] table {re-ruby.data};  
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   778
\addplot[red,mark=triangle*, mark options={fill=red}] table {nfabreadth.data};	
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   779
\end{axis}
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   780
\end{tikzpicture}
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   781
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   782
\end{frame}
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   783
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   784
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   785
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   786
\begin{frame}[c]
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   787
  \frametitle{NFA Breadth-First:\boldmath{}$(a^*)^* \cdot b$}
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   788
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   789
\bigskip    
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   790
\begin{center}
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   791
\begin{tikzpicture}
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   792
  \begin{axis}[
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   793
    xlabel={\pcode{a}s},
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   794
    %%x label style={at={(1.05,0.0)}},
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   795
    ylabel={time in secs},
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   796
    enlargelimits=false,
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   797
    xtick={0,10,...,100},
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   798
    xmax=103,
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   799
    ymax=35,
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   800
    ytick={0,5,...,30},
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   801
    scaled ticks=false,
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   802
    axis lines=left,
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   803
    width=9cm,
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   804
    height=6cm, 
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   805
    legend entries={Java 8,Python,JavaScript,Swift,Dart,my NFA},  
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   806
    legend pos=outer north east,
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   807
    legend cell align=left]
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   808
\addplot[blue,mark=*, mark options={fill=white}] table {re-python2.data};
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   809
\addplot[cyan,mark=*, mark options={fill=white}] table {re-java.data};
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   810
\addplot[red,mark=*, mark options={fill=white}] table {re-js.data};
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   811
\addplot[magenta,mark=*, mark options={fill=white}] table {re-swift.data};
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   812
\addplot[brown,mark=*, mark options={fill=white}] table {re-dart.data};
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   813
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   814
\addplot[red,mark=triangle*, mark options={fill=red}] table {nfabreadth2.data};	
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   815
\end{axis}
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   816
\end{tikzpicture}
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   817
\end{center}
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   818
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   819
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   820
\end{frame}
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   821
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   822
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   823
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   824
\begin{frame}[c]
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   825
\frametitle{NFA Depth-First: \boldmath$a^{?\{n\}} \cdot a^{\{n\}}$}
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   826
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   827
\begin{tikzpicture}
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   828
  \begin{axis}[xlabel={\pcode{a}s},
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   829
    ylabel={time in secs},
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   830
    enlargelimits=false,
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   831
    xtick={0,5,...,30},
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   832
    xmax=30,
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   833
    ymax=35,
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   834
    ytick={0,5,...,30},
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   835
    scaled ticks=false,
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   836
    axis lines=left,
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   837
    width=9cm,
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   838
    height=6cm, 
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   839
    legend entries={Python,Ruby,my NFA},
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   840
    legend pos=outer north east,
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   841
    legend cell align=left]
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   842
\addplot[blue,mark=*, mark options={fill=white}] table {re-python.data};
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   843
\addplot[brown,mark=pentagon*, mark options={fill=white}] table {re-ruby.data};  
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   844
\addplot[red,mark=triangle*, mark options={fill=red}] table {nfadepth.data};	
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   845
\end{axis}
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   846
\end{tikzpicture}
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   847
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   848
\end{frame}
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   849
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   850
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   851
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   852
\begin{frame}[c]
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   853
  \frametitle{NFA Depth-First: \boldmath$(a^*)^* \cdot b$}
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   854
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   855
\bigskip    
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   856
\begin{center}
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   857
\begin{tikzpicture}
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   858
  \begin{axis}[
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   859
    xlabel={\pcode{a}s},
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   860
    %%x label style={at={(1.05,0.0)}},
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   861
    ylabel={time in secs},
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   862
    enlargelimits=false,
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   863
    xtick={0,15,...,30},
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   864
    xmax=33,
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   865
    ymax=35,
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   866
    ytick={0,5,...,30},
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   867
    scaled ticks=false,
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   868
    axis lines=left,
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   869
    width=9cm,
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   870
    height=6cm, 
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   871
    legend entries={Java 8,Python,JavaScript,Swift,Dart,my NFA},  
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   872
    legend pos=outer north east,
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   873
    legend cell align=left]
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   874
\addplot[blue,mark=*, mark options={fill=white}] table {re-python2.data};
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   875
\addplot[cyan,mark=*, mark options={fill=white}] table {re-java.data};
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   876
\addplot[red,mark=*, mark options={fill=white}] table {re-js.data};
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   877
\addplot[magenta,mark=*, mark options={fill=white}] table {re-swift.data};
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   878
\addplot[brown,mark=*, mark options={fill=white}] table {re-dart.data};
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   879
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   880
\addplot[red,mark=triangle*, mark options={fill=red}] table {nfadepth2.data};	
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   881
\end{axis}
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   882
\end{tikzpicture}
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   883
\end{center}
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   884
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   885
The punchline is that many existing libraries do depth-first search
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   886
in NFAs (with backtracking).
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   887
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   888
\end{frame}
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   889
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   890
782
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   891
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   892
\begin{frame}[c]
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   893
\frametitle{Subset Construction}
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   894
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   895
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   896
\begin{textblock}{5}(1,3.5)
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   897
\begin{center}
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   898
\begin{tikzpicture}[node distance=6mm,scale=0.7,>=stealth',very thick,
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   899
                             every state/.style={minimum size=0pt,draw=blue!50,very thick,fill=blue!20},]
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   900
\node[state,initial]  (Q_0)  {$\mbox{Q}_0$};
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   901
\node[state] (Q_1) [below=of Q_0] {$\mbox{Q}_1$};
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   902
\node[state, accepting] (Q_2) [below=of Q_1] {$\mbox{Q}_2$};
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   903
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   904
\path[->] (Q_0) edge node [left]  {\alert{$1$}} (Q_1);
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   905
\path[->] (Q_1) edge node [left]  {\alert{$0,1$}} (Q_2);
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   906
\path[->] (Q_0) edge [loop right] node  {\alert{$0,1$}} ();
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   907
%\path[->] (Q_1) edge [loop above] node  {\alert{$a$}} ();
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   908
%\path[->] (Q_2) edge [loop below] node  {\alert{$b$}} ();
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   909
\end{tikzpicture}
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   910
\end{center}
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   911
\end{textblock}
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   912
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   913
\begin{textblock}{11}(6.5,4)
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   914
\begin{tabular}{r|cl}
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   915
nodes \textcolor{white}{*} & $0$ & $1$\\
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   916
\hline
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   917
$\{\}$  \textcolor{white}{*} & \onslide<2->{$\{\}$} & \onslide<2->{$\{\}$}\\
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   918
\onslide<5->{s:} $\{0\}$ \textcolor{white}{*} & \onslide<3->{$\{0\}$} & \onslide<3->{$\{0,1\}$}\\
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   919
$\{1\}$ \textcolor{white}{*} & \onslide<3->{$\{2\}$} & \onslide<3->{$\{2\}$}\\
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   920
$\{2\}$ \onslide<5->{*} & \onslide<3->{$\{\}$} & \onslide<3->{$\{\}$}\\
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   921
$\{0,1\}$ \textcolor{white}{*} &\onslide<4->{$\{0,2\}$} & \onslide<4->{$\{0,1,2\}$}\\
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   922
$\{0,2\}$ \onslide<5->{*} &\onslide<4->{$\{0\}$} & \onslide<4->{$\{0,1\}$}\\
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   923
$\{1,2\}$ \onslide<5->{*} & \onslide<4->{$\{2\}$} & \onslide<4->{$\{2\}$}\\
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   924
$\{0,1,2\}$ \onslide<5->{*}& \onslide<4->{$\{0,2\}$} & \onslide<4->{$\{0,1,2\}$}\\
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   925
\end{tabular}
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   926
\end{textblock}
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   927
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   928
\end{frame}
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   929
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
779
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
   930
  
782
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   931
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   932
\begin{frame}[c]
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   933
\frametitle{The Result}
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   934
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   935
\footnotesize
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   936
\begin{center}
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   937
\begin{tikzpicture}[scale=0.5,>=stealth',very thick,
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   938
                    every state/.style={minimum size=0pt,
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   939
                    draw=blue!50,very thick,fill=blue!20},
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   940
                    baseline=0mm]
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   941
\node[state,initial]  (q0)  {$\{0\}$};
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   942
\node[state] (q01) [right=of q0] {$\{0,1\}$};
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   943
\node[state,accepting] (q12) [above=of q01] {$\{1,2\}$};
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   944
\node[state,accepting] (q02) [below=of q01] {$\{0,2\}$};
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   945
\node[state] (q1) [right=2cm of q12] {$\{1\}$};
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   946
\node[state,accepting] (q2) [right=2.5cm of q01] {$\{2\}$};
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   947
\node[state,accepting] (q012) [right=1.5cm of q02] {$\{0,1,2\}$};
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   948
\node[state] (Qn) [right=of q2] {$\{\}$};
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   949
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   950
\path[->] (q0) edge [loop above] node  {\alert{$0$}} ();
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   951
\path[->] (q0) edge node [above]  {\alert{$1$}} (q01);
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   952
\path[->] (q02) edge [bend left] node [left]  {\alert{$1$}} (q01);
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   953
\path[->] (q02) edge node [below]  {\alert{$0$}} (q0);
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   954
\path[->] (q01) edge node [above]  {\alert{$1$}} (q012);
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   955
\path[->] (q01) edge [bend left] node [right]  {\alert{$0$}} (q02);
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   956
\path[->] (q12) edge node [below]  {\alert{$0,1$}} (q2);
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   957
\path[->] (q1) edge node [right]  {\alert{$0,1$}} (q2);
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   958
\path[->] (q2) edge node [above]  {\alert{$0,1$}} (Qn);
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   959
\path[->] (q012) edge [loop right] node  {\alert{$1$}} ();
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   960
\path[->] (q012) edge node [below]  {\alert{$0$}} (q02);
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   961
\path[->] (Qn) edge [loop above] node  {$\alert{0},\alert{1}$} ();
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   962
\end{tikzpicture}
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   963
\end{center}
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   964
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   965
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   966
\end{frame}
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   967
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   968
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   969
\begin{frame}[c]
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   970
\frametitle{Removing Dead States}
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   971
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   972
\footnotesize
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   973
\begin{center}
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   974
\begin{tabular}{ll}
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   975
\large DFA: & \large (original) NFA:\\
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   976
\raisebox{0mm}{%
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   977
\begin{tikzpicture}[scale=0.7,>=stealth',very thick,
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   978
                    every state/.style={minimum size=0pt,
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   979
                    draw=blue!50,very thick,fill=blue!20}]
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   980
\node[state,initial]  (q0)  {$\{0\}$};
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   981
\node[state] (q01) [right=of q0] {$\{0,1\}$};
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   982
\node[state,accepting] (q02) [below=of q01] {$\{0,2\}$};
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   983
\node[state,accepting] (q012) [right=1.5cm of q02] {$\{0,1,2\}$};
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   984
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   985
\path[->] (q0) edge [loop above] node  {\alert{$0$}} ();
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   986
\path[->] (q0) edge node [above]  {\alert{$1$}} (q01);
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   987
\path[->] (q02) edge [bend left] node [left]  {\alert{$1$}} (q01);
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   988
\path[->] (q02) edge node [below]  {\alert{$0$}} (q0);
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   989
\path[->] (q01) edge node [above]  {\alert{$1$}} (q012);
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   990
\path[->] (q01) edge [bend left] node [right]  {\alert{$0$}} (q02);
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   991
\path[->] (q012) edge [loop right] node  {\alert{$1$}} ();
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   992
\path[->] (q012) edge node [below]  {\alert{$0$}} (q02);
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   993
\end{tikzpicture}}
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   994
&
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   995
\begin{tikzpicture}[scale=0.7,>=stealth',very thick,
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   996
                    every state/.style={minimum size=0pt,
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   997
                      draw=blue!50,very thick,fill=blue!20},]
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   998
\node[state,initial]  (Q_0)  {$\mbox{Q}_0$};
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
   999
\node[state] (Q_1) [below=of Q_0] {$\mbox{Q}_1$};
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
  1000
\node[state, accepting] (Q_2) [below=of Q_1] {$\mbox{Q}_2$};
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
  1001
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
  1002
\path[->] (Q_0) edge node [left]  {\alert{$1$}} (Q_1);
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
  1003
\path[->] (Q_1) edge node [left]  {\alert{$0,1$}} (Q_2);
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
  1004
\path[->] (Q_0) edge [loop right] node  {\alert{$0,1$}} ();                    
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
  1005
\end{tikzpicture}
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
  1006
\end{tabular}
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
  1007
\end{center}
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
  1008
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
  1009
\end{frame}
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
  1010
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
779
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
  1011
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
  1012
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
  1013
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5385c8342f02 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 778
diff changeset
  1014
\begin{frame}[c]
782
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
  1015
\frametitle{Subset Construction ($\epsilon$NFA)}
135
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
  1016
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
  1017
662
8da26d4c2ca8 updated
Christian Urban <urbanc@in.tum.de>
parents: 651
diff changeset
  1018
\begin{textblock}{5}(1,1.5)
136
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 135
diff changeset
  1019
\begin{center}
515
3566c8175e63 updated
cu
parents: 500
diff changeset
  1020
\begin{tikzpicture}[node distance=6mm,scale=0.7,>=stealth',very thick,
136
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 135
diff changeset
  1021
                             every state/.style={minimum size=0pt,draw=blue!50,very thick,fill=blue!20},]
515
3566c8175e63 updated
cu
parents: 500
diff changeset
  1022
\node[state,initial]  (Q_0)  {$\mbox{Q}_0$};
3566c8175e63 updated
cu
parents: 500
diff changeset
  1023
\node[state] (Q_1) [above=of Q_0] {$\mbox{Q}_1$};
3566c8175e63 updated
cu
parents: 500
diff changeset
  1024
\node[state, accepting] (Q_2) [below=of Q_0] {$\mbox{Q}_2$};
3566c8175e63 updated
cu
parents: 500
diff changeset
  1025
\path[->] (Q_0) edge node [left]  {\alert{$\epsilon$}} (Q_1);
3566c8175e63 updated
cu
parents: 500
diff changeset
  1026
\path[->] (Q_0) edge node [left]  {\alert{$\epsilon$}} (Q_2);
3566c8175e63 updated
cu
parents: 500
diff changeset
  1027
\path[->] (Q_0) edge [loop right] node  {\alert{$a$}} ();
3566c8175e63 updated
cu
parents: 500
diff changeset
  1028
\path[->] (Q_1) edge [loop above] node  {\alert{$a$}} ();
3566c8175e63 updated
cu
parents: 500
diff changeset
  1029
\path[->] (Q_2) edge [loop below] node  {\alert{$b$}} ();
136
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 135
diff changeset
  1030
\end{tikzpicture}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 135
diff changeset
  1031
\end{center}
135
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
  1032
\end{textblock}
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
  1033
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
  1034
\begin{textblock}{11}(6.5,4.5)
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
  1035
\begin{tabular}{r|cl}
139
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 138
diff changeset
  1036
nodes \textcolor{white}{*} & $a$ & $b$\\
135
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
  1037
\hline
346
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1038
$\{\}$ \textcolor{white}{*} & \onslide<2->{$\{\}$} & \onslide<2->{$\{\}$}\\
139
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 138
diff changeset
  1039
$\{0\}$ \textcolor{white}{*} & \onslide<3->{$\{0,1,2\}$} & \onslide<3->{$\{2\}$}\\
346
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1040
$\{1\}$ \textcolor{white}{*} & \onslide<3->{$\{1\}$} & \onslide<3->{$\{\}$}\\
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1041
$\{2\}$ \onslide<5->{*} & \onslide<3->{$\{\}$} & \onslide<3->{$\{2\}$}\\
139
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 138
diff changeset
  1042
$\{0,1\}$ \textcolor{white}{*} &\onslide<4->{$\{0,1,2\}$} & \onslide<4->{$\{2\}$}\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 138
diff changeset
  1043
$\{0,2\}$ \onslide<5->{*} &\onslide<4->{$\{0,1,2\}$} & \onslide<4->{$\{2\}$}\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 138
diff changeset
  1044
$\{1,2\}$ \onslide<5->{*} & \onslide<4->{$\{1\}$} & \onslide<4->{$\{2\}$}\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 138
diff changeset
  1045
\onslide<5->{s:} $\{0,1,2\}$ \onslide<5->{*}& \onslide<4->{$\{0,1,2\}$} & \onslide<4->{$\{2\}$}\\
135
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
  1046
\end{tabular}
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
  1047
\end{textblock}
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
  1048
346
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1049
\end{frame}
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1050
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
135
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
  1051
346
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1052
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1053
\begin{frame}[c]
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1054
\frametitle{The Result}
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1055
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1056
\footnotesize
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1057
\begin{center}
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1058
\begin{tikzpicture}[scale=0.5,>=stealth',very thick,
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1059
                    every state/.style={minimum size=0pt,
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1060
                    draw=blue!50,very thick,fill=blue!20},
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1061
                    baseline=0mm]
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1062
\node[state,initial,accepting]  (q012)  {$\{0,1,2\}$};
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1063
\node[state,accepting] (q02) [right=of q012] {$\{0,2\}$};
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1064
\node[state] (q01) [above=of q02] {$\{0,1\}$};
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1065
\node[state,accepting] (q12) [below=of q02] {$\{1,2\}$};
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1066
\node[state] (q0) [right=2cm of q01] {$\{0\}$};
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1067
\node[state] (q1) [right=2.5cm of q02] {$\{1\}$};
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1068
\node[state,accepting] (q2) [right=1.5cm of q12] {$\{2\}$};
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1069
\node[state] (qn) [right=of q1] {$\{\}$};
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1070
348
31e89128ccd2 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 346
diff changeset
  1071
\path[->] (q012) edge [loop below] node  {\alert{$a$}} ();
31e89128ccd2 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 346
diff changeset
  1072
\path[->] (q012) edge node [above]  {\alert{$b$}} (q2);
31e89128ccd2 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 346
diff changeset
  1073
\path[->] (q12) edge [bend left] node [below,pos=0.4]  {\alert{$a$}} (q1);
31e89128ccd2 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 346
diff changeset
  1074
\path[->] (q12) edge node [below]  {\alert{$b$}} (q2);
31e89128ccd2 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 346
diff changeset
  1075
\path[->] (q02) edge node [above]  {\alert{$a$}} (q012);
31e89128ccd2 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 346
diff changeset
  1076
\path[->] (q02) edge [bend left] node [above, pos=0.8]  {\alert{$b$}} (q2);
31e89128ccd2 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 346
diff changeset
  1077
\path[->] (q01) edge node [below]  {\alert{$a$}} (q012);
31e89128ccd2 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 346
diff changeset
  1078
\path[->] (q01) edge [bend left] node [above]  {\alert{$b$}} (q2);
31e89128ccd2 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 346
diff changeset
  1079
\path[->] (q0) edge node [below]  {\alert{$a$}} (q012);
31e89128ccd2 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 346
diff changeset
  1080
\path[->] (q0) edge node [right, pos=0.2]  {\alert{$b$}} (q2);
31e89128ccd2 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 346
diff changeset
  1081
\path[->] (q1) edge [loop above] node  {\alert{$a$}} ();
31e89128ccd2 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 346
diff changeset
  1082
\path[->] (q1) edge node [above]  {\alert{$b$}} (qn);
31e89128ccd2 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 346
diff changeset
  1083
\path[->] (q2) edge [loop right] node  {\alert{$b$}} ();
31e89128ccd2 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 346
diff changeset
  1084
\path[->] (q2) edge node [below]  {\alert{$a$}} (qn);
31e89128ccd2 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 346
diff changeset
  1085
\path[->] (qn) edge [loop above] node  {$\alert{a},\alert{b}$} ();
346
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1086
\end{tikzpicture}
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1087
\end{center}
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1088
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1089
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1090
\end{frame}
135
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
  1091
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
  1092
265
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1093
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1094
\begin{frame}[c]
346
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1095
\frametitle{Removing Dead States}
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1096
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1097
\footnotesize
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1098
\begin{center}
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1099
\begin{tabular}{ll}
445
e7d0157f0471 updated slides
Christian Urban <urbanc@in.tum.de>
parents: 348
diff changeset
  1100
DFA: & (original) NFA:\\
346
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1101
\raisebox{10mm}{%
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1102
\begin{tikzpicture}[scale=0.7,>=stealth',very thick,
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1103
                    every state/.style={minimum size=0pt,
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1104
                    draw=blue!50,very thick,fill=blue!20}]
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1105
\node[state,initial,accepting]  (q012)  {$\{0,1,2\}$};
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1106
\node[state,accepting] (q2) [right=of q012] {$\{2\}$};
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1107
\node[state] (qn) [right=of q2] {$\{\}$};
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1108
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1109
\path[->] (q012) edge [loop below] node  {\alert{$a$}} ();
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1110
\path[->] (q012) edge node [above]  {\alert{$b$}} (q2);
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1111
\path[->] (q2) edge [loop below] node  {\alert{$b$}} ();
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1112
\path[->] (q2) edge node [below]  {\alert{$a$}} (qn);
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1113
\path[->] (qn) edge [loop above] node 
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1114
   {$\alert{a},\alert{b}$} ();
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1115
\end{tikzpicture}}
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1116
&
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1117
\begin{tikzpicture}[scale=0.7,>=stealth',very thick,
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1118
                    every state/.style={minimum size=0pt,
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1119
                    draw=blue!50,very thick,fill=blue!20},]
515
3566c8175e63 updated
cu
parents: 500
diff changeset
  1120
\node[state,initial]  (Q_0)  {$\mbox{Q}_0$};
3566c8175e63 updated
cu
parents: 500
diff changeset
  1121
\node[state] (Q_1) [above=of Q_0] {$\mbox{Q}_1$};
3566c8175e63 updated
cu
parents: 500
diff changeset
  1122
\node[state, accepting] (Q_2) [below=of Q_0] {$\mbox{Q}_2$};
3566c8175e63 updated
cu
parents: 500
diff changeset
  1123
\path[->] (Q_0) edge node [left]  {\alert{$\epsilon$}} (Q_1);
3566c8175e63 updated
cu
parents: 500
diff changeset
  1124
\path[->] (Q_0) edge node [left]  {\alert{$\epsilon$}} (Q_2);
3566c8175e63 updated
cu
parents: 500
diff changeset
  1125
\path[->] (Q_0) edge [loop right] node  {\alert{$a$}} ();
3566c8175e63 updated
cu
parents: 500
diff changeset
  1126
\path[->] (Q_1) edge [loop above] node  {\alert{$a$}} ();
3566c8175e63 updated
cu
parents: 500
diff changeset
  1127
\path[->] (Q_2) edge [loop below] node  {\alert{$b$}} ();
346
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1128
\end{tikzpicture}
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1129
\end{tabular}
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1130
\end{center}
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1131
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1132
\end{frame}
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1133
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1134
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1135
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1136
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1137
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1138
\begin{frame}[c]
265
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1139
\frametitle{Regexps and Automata}
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1140
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1141
\begin{center}
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1142
\begin{tikzpicture}
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1143
\node (rexp)  {\bl{\bf Regexps}};
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1144
\node (nfa) [right=of rexp] {\bl{\bf NFAs}};
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1145
\node (dfa) [right=of nfa] {\bl{\bf DFAs}};
346
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1146
\onslide<2->{\node (mdfa) [right=of dfa] {\bl{\bf \begin{tabular}{c}minimal\\ DFAs\end{tabular}}};}
265
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1147
\path[->, red, line width=2mm] (rexp) edge node [above=4mm, black] {\begin{tabular}{c@{\hspace{9mm}}}Thompson's\\[-1mm] construction\end{tabular}} (nfa);
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1148
\path[->, red, line width=2mm] (nfa) edge node [above=4mm, black] {\begin{tabular}{c}subset\\[-1mm] construction\end{tabular}}(dfa);
346
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1149
\onslide<2->{\path[->, red, line width=2mm] (dfa) edge node [below=9mm, black] {minimisation} (mdfa);}
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1150
\end{tikzpicture}\\
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1151
\end{center}
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1152
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1153
\end{frame}
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1154
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1155
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1156
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1157
\begin{frame}[c]
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1158
\frametitle{DFA Minimisation}
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1159
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1160
\begin{enumerate}
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1161
\item Take all pairs \bl{$(q, p)$} with \bl{$q \not= p$}
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1162
\item Mark all pairs that accepting and non-accepting states
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1163
\item For  all unmarked pairs \bl{$(q, p)$} and all characters \bl{$c$} test whether
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1164
\begin{center}
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1165
\bl{$(\delta(q, c), \delta(p,c))$}
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1166
\end{center} 
348
31e89128ccd2 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 346
diff changeset
  1167
are marked. If yes in at least one case, then also mark \bl{$(q, p)$}.
346
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1168
\item Repeat last step until no change.
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1169
\item All unmarked pairs can be merged.
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1170
\end{enumerate}
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1171
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1172
\end{frame}
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1173
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1174
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1175
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1176
\begin{frame}[c]
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1177
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1178
\begin{center}
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1179
\begin{tikzpicture}[>=stealth',very thick,auto,
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1180
                             every state/.style={minimum size=0pt,inner sep=2pt,draw=blue!50,very thick,fill=blue!20},]
515
3566c8175e63 updated
cu
parents: 500
diff changeset
  1181
\node[state,initial]  (Q_0)  {$\mbox{Q}_0$};
3566c8175e63 updated
cu
parents: 500
diff changeset
  1182
\node[state] (Q_1) [right=of Q_0] {$\mbox{Q}_1$};
3566c8175e63 updated
cu
parents: 500
diff changeset
  1183
\node[state] (Q_2) [below right=of Q_0] {$\mbox{Q}_2$};
3566c8175e63 updated
cu
parents: 500
diff changeset
  1184
\node[state] (Q_3) [right=of Q_2] {$\mbox{Q}_3$};
3566c8175e63 updated
cu
parents: 500
diff changeset
  1185
\node[state, accepting] (Q_4) [right=of Q_1] {$\mbox{Q}_4$};
3566c8175e63 updated
cu
parents: 500
diff changeset
  1186
\path[->] (Q_0) edge node [above]  {\alert{$a$}} (Q_1);
3566c8175e63 updated
cu
parents: 500
diff changeset
  1187
\path[->] (Q_1) edge node [above]  {\alert{$a$}} (Q_4);
3566c8175e63 updated
cu
parents: 500
diff changeset
  1188
\path[->] (Q_4) edge [loop right] node  {\alert{$a, b$}} ();
3566c8175e63 updated
cu
parents: 500
diff changeset
  1189
\path[->] (Q_3) edge node [right]  {\alert{$a$}} (Q_4);
3566c8175e63 updated
cu
parents: 500
diff changeset
  1190
\path[->] (Q_2) edge node [above]  {\alert{$a$}} (Q_3);
3566c8175e63 updated
cu
parents: 500
diff changeset
  1191
\path[->] (Q_1) edge node [right]  {\alert{$b$}} (Q_2);
3566c8175e63 updated
cu
parents: 500
diff changeset
  1192
\path[->] (Q_0) edge node [above]  {\alert{$b$}} (Q_2);
3566c8175e63 updated
cu
parents: 500
diff changeset
  1193
\path[->] (Q_2) edge [loop left] node  {\alert{$b$}} ();
3566c8175e63 updated
cu
parents: 500
diff changeset
  1194
\path[->] (Q_3) edge [bend left=95, looseness=1.3] node [below]  {\alert{$b$}} (Q_0);
346
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1195
\end{tikzpicture}
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1196
\end{center}
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1197
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1198
\mbox{}\\[-20mm]\mbox{}
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1199
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1200
\begin{center}
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1201
\begin{tikzpicture}[scale=0.8,line width=0.8mm]
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1202
\draw (0,0) -- (4,0);
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1203
\draw (0,1) -- (4,1);
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1204
\draw (0,2) -- (3,2);
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1205
\draw (0,3) -- (2,3);
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1206
\draw (0,4) -- (1,4);
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1207
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1208
\draw (0,0) -- (0, 4);
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1209
\draw (1,0) -- (1, 4);
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1210
\draw (2,0) -- (2, 3);
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1211
\draw (3,0) -- (3, 2);
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1212
\draw (4,0) -- (4, 1);
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1213
515
3566c8175e63 updated
cu
parents: 500
diff changeset
  1214
\draw (0.5,-0.5) node {$\mbox{Q}_0$}; 
3566c8175e63 updated
cu
parents: 500
diff changeset
  1215
\draw (1.5,-0.5) node {$\mbox{Q}_1$}; 
3566c8175e63 updated
cu
parents: 500
diff changeset
  1216
\draw (2.5,-0.5) node {$\mbox{Q}_2$}; 
3566c8175e63 updated
cu
parents: 500
diff changeset
  1217
\draw (3.5,-0.5) node {$\mbox{Q}_3$};
346
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1218
 
515
3566c8175e63 updated
cu
parents: 500
diff changeset
  1219
\draw (-0.5, 3.5) node {$\mbox{Q}_1$}; 
3566c8175e63 updated
cu
parents: 500
diff changeset
  1220
\draw (-0.5, 2.5) node {$\mbox{Q}_2$}; 
3566c8175e63 updated
cu
parents: 500
diff changeset
  1221
\draw (-0.5, 1.5) node {$\mbox{Q}_3$}; 
3566c8175e63 updated
cu
parents: 500
diff changeset
  1222
\draw (-0.5, 0.5) node {$\mbox{Q}_4$}; 
346
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1223
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1224
\draw (0.5,0.5) node {\large$\star$}; 
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1225
\draw (1.5,0.5) node {\large$\star$}; 
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1226
\draw (2.5,0.5) node {\large$\star$}; 
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1227
\draw (3.5,0.5) node {\large$\star$};
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1228
\end{tikzpicture}
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1229
\end{center}
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1230
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1231
\end{frame}
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1232
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1233
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1234
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1235
\begin{frame}[c]
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1236
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1237
\begin{center}
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1238
\begin{tabular}{@{\hspace{-8mm}}cc@{}}
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1239
\begin{tikzpicture}[>=stealth',very thick,auto,
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1240
                             every state/.style={minimum size=0pt,inner sep=2pt,draw=blue!50,very thick,fill=blue!20},]
515
3566c8175e63 updated
cu
parents: 500
diff changeset
  1241
\node[state,initial]  (Q_0)  {$\mbox{Q}_0$};
3566c8175e63 updated
cu
parents: 500
diff changeset
  1242
\node[state] (Q_1) [right=of Q_0] {$\mbox{Q}_1$};
3566c8175e63 updated
cu
parents: 500
diff changeset
  1243
\node[state] (Q_2) [below right=of Q_0] {$\mbox{Q}_2$};
3566c8175e63 updated
cu
parents: 500
diff changeset
  1244
\node[state] (Q_3) [right=of Q_2] {$\mbox{Q}_3$};
3566c8175e63 updated
cu
parents: 500
diff changeset
  1245
\node[state, accepting] (Q_4) [right=of Q_1] {$\mbox{Q}_4$};
3566c8175e63 updated
cu
parents: 500
diff changeset
  1246
\path[->] (Q_0) edge node [above]  {\alert{$a$}} (Q_1);
3566c8175e63 updated
cu
parents: 500
diff changeset
  1247
\path[->] (Q_1) edge node [above]  {\alert{$a$}} (Q_4);
3566c8175e63 updated
cu
parents: 500
diff changeset
  1248
\path[->] (Q_4) edge [loop right] node  {\alert{$a, b$}} ();
3566c8175e63 updated
cu
parents: 500
diff changeset
  1249
\path[->] (Q_3) edge node [right]  {\alert{$a$}} (Q_4);
3566c8175e63 updated
cu
parents: 500
diff changeset
  1250
\path[->] (Q_2) edge node [above]  {\alert{$a$}} (Q_3);
3566c8175e63 updated
cu
parents: 500
diff changeset
  1251
\path[->] (Q_1) edge node [right]  {\alert{$b$}} (Q_2);
3566c8175e63 updated
cu
parents: 500
diff changeset
  1252
\path[->] (Q_0) edge node [above]  {\alert{$b$}} (Q_2);
3566c8175e63 updated
cu
parents: 500
diff changeset
  1253
\path[->] (Q_2) edge [loop left] node  {\alert{$b$}} ();
3566c8175e63 updated
cu
parents: 500
diff changeset
  1254
\path[->] (Q_3) edge [bend left=95, looseness=1.3] node [below]  {\alert{$b$}} (Q_0);
346
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1255
\end{tikzpicture}
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1256
&
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1257
\raisebox{9mm}{\begin{tikzpicture}[scale=0.6,line width=0.8mm]
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1258
\draw (0,0) -- (4,0);
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1259
\draw (0,1) -- (4,1);
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1260
\draw (0,2) -- (3,2);
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1261
\draw (0,3) -- (2,3);
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1262
\draw (0,4) -- (1,4);
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1263
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1264
\draw (0,0) -- (0, 4);
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1265
\draw (1,0) -- (1, 4);
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1266
\draw (2,0) -- (2, 3);
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1267
\draw (3,0) -- (3, 2);
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1268
\draw (4,0) -- (4, 1);
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1269
515
3566c8175e63 updated
cu
parents: 500
diff changeset
  1270
\draw (0.5,-0.5) node {$\mbox{Q}_0$}; 
3566c8175e63 updated
cu
parents: 500
diff changeset
  1271
\draw (1.5,-0.5) node {$\mbox{Q}_1$}; 
3566c8175e63 updated
cu
parents: 500
diff changeset
  1272
\draw (2.5,-0.5) node {$\mbox{Q}_2$}; 
3566c8175e63 updated
cu
parents: 500
diff changeset
  1273
\draw (3.5,-0.5) node {$\mbox{Q}_3$};
346
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1274
 
515
3566c8175e63 updated
cu
parents: 500
diff changeset
  1275
\draw (-0.5, 3.5) node {$\mbox{Q}_1$}; 
3566c8175e63 updated
cu
parents: 500
diff changeset
  1276
\draw (-0.5, 2.5) node {$\mbox{Q}_2$}; 
3566c8175e63 updated
cu
parents: 500
diff changeset
  1277
\draw (-0.5, 1.5) node {$\mbox{Q}_3$}; 
3566c8175e63 updated
cu
parents: 500
diff changeset
  1278
\draw (-0.5, 0.5) node {$\mbox{Q}_4$}; 
346
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1279
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1280
\draw (0.5,0.5) node {\large$\star$}; 
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1281
\draw (1.5,0.5) node {\large$\star$}; 
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1282
\draw (2.5,0.5) node {\large$\star$}; 
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1283
\draw (3.5,0.5) node {\large$\star$};
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1284
\draw (0.5,1.5) node {\large$\star$}; 
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1285
\draw (2.5,1.5) node {\large$\star$}; 
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1286
\draw (0.5,3.5) node {\large$\star$}; 
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1287
\draw (1.5,2.5) node {\large$\star$}; 
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1288
\end{tikzpicture}}
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1289
\end{tabular}
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1290
\end{center}
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1291
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1292
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1293
\mbox{}\\[-20mm]\mbox{}
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1294
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1295
\begin{center}
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1296
\begin{tikzpicture}[>=stealth',very thick,auto,
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1297
                             every state/.style={minimum size=0pt,inner sep=2pt,draw=blue!50,very thick,fill=blue!20},]
515
3566c8175e63 updated
cu
parents: 500
diff changeset
  1298
\node[state,initial]  (Q_02)  {$\mbox{Q}_{0, 2}$};
3566c8175e63 updated
cu
parents: 500
diff changeset
  1299
\node[state] (Q_13) [right=of Q_02] {$\mbox{Q}_{1, 3}$};
3566c8175e63 updated
cu
parents: 500
diff changeset
  1300
\node[state, accepting] (Q_4) [right=of Q_13] {$\mbox{Q}_{4\phantom{,0}}$};
3566c8175e63 updated
cu
parents: 500
diff changeset
  1301
\path[->] (Q_02) edge [bend left] node [above]  {\alert{$a$}} (Q_13);
3566c8175e63 updated
cu
parents: 500
diff changeset
  1302
\path[->] (Q_13) edge [bend left] node [below]  {\alert{$b$}} (Q_02);
3566c8175e63 updated
cu
parents: 500
diff changeset
  1303
\path[->] (Q_02) edge [loop below] node  {\alert{$b$}} ();
3566c8175e63 updated
cu
parents: 500
diff changeset
  1304
\path[->] (Q_13) edge node [above]  {\alert{$a$}} (Q_4);
3566c8175e63 updated
cu
parents: 500
diff changeset
  1305
\path[->] (Q_4) edge [loop above] node  {\alert{$a, b$}} ();
346
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1306
\end{tikzpicture}\\
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1307
minimal automaton
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1308
\end{center}
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1309
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1310
\end{frame}
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1311
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1312
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1313
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1314
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1315
\begin{frame}[c]
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1316
\frametitle{Alternatives}
573
711bbc480998 updated
Christian Urban <urbanc@in.tum.de>
parents: 572
diff changeset
  1317
\mbox{}\\[-14mm]\mbox{}
346
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1318
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1319
\begin{center}
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1320
\begin{tikzpicture}[>=stealth',very thick,auto,
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1321
                    every state/.style={minimum size=0pt,
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1322
                    inner sep=2pt,draw=blue!50,very thick,fill=blue!20}]
515
3566c8175e63 updated
cu
parents: 500
diff changeset
  1323
\only<1>{\node[state,initial]  (Q_0)  {$\mbox{Q}_0$};}
3566c8175e63 updated
cu
parents: 500
diff changeset
  1324
\only<2->{\node[state,accepting]  (Q_0)  {$\mbox{Q}_0$};}
3566c8175e63 updated
cu
parents: 500
diff changeset
  1325
\node[state] (Q_1) [right=of Q_0] {$\mbox{Q}_1$};
3566c8175e63 updated
cu
parents: 500
diff changeset
  1326
\node[state] (Q_2) [below right=of Q_0] {$\mbox{Q}_2$};
3566c8175e63 updated
cu
parents: 500
diff changeset
  1327
\node[state] (Q_3) [right=of Q_2] {$\mbox{Q}_3$};
3566c8175e63 updated
cu
parents: 500
diff changeset
  1328
\only<1>{\node[state, accepting] (Q_4) [right=of Q_1] {$\mbox{Q}_4$};}
3566c8175e63 updated
cu
parents: 500
diff changeset
  1329
\only<2->{\node[state, initial right] (Q_4) [right=of Q_1] {$\mbox{Q}_4$};}
346
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1330
\only<1-2>{
515
3566c8175e63 updated
cu
parents: 500
diff changeset
  1331
\path[->] (Q_0) edge node [above]  {\alert{$a$}} (Q_1);
3566c8175e63 updated
cu
parents: 500
diff changeset
  1332
\path[->] (Q_1) edge node [above]  {\alert{$a$}} (Q_4);
3566c8175e63 updated
cu
parents: 500
diff changeset
  1333
\path[->] (Q_4) edge [loop above] node  {\alert{$a, b$}} ();
3566c8175e63 updated
cu
parents: 500
diff changeset
  1334
\path[->] (Q_3) edge node [right]  {\alert{$a$}} (Q_4);
3566c8175e63 updated
cu
parents: 500
diff changeset
  1335
\path[->] (Q_2) edge node [above]  {\alert{$a$}} (Q_3);
3566c8175e63 updated
cu
parents: 500
diff changeset
  1336
\path[->] (Q_1) edge node [right]  {\alert{$b$}} (Q_2);
3566c8175e63 updated
cu
parents: 500
diff changeset
  1337
\path[->] (Q_0) edge node [above]  {\alert{$b$}} (Q_2);
3566c8175e63 updated
cu
parents: 500
diff changeset
  1338
\path[->] (Q_2) edge [loop left] node  {\alert{$b$}} ();
3566c8175e63 updated
cu
parents: 500
diff changeset
  1339
\path[->] (Q_3) edge [bend left=95, looseness=1.3] node [below]  {\alert{$b$}} (Q_0);}
346
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1340
\only<3->{
515
3566c8175e63 updated
cu
parents: 500
diff changeset
  1341
\path[<-] (Q_0) edge node [above]  {\alert{$a$}} (Q_1);
3566c8175e63 updated
cu
parents: 500
diff changeset
  1342
\path[<-] (Q_1) edge node [above]  {\alert{$a$}} (Q_4);
3566c8175e63 updated
cu
parents: 500
diff changeset
  1343
\path[<-] (Q_4) edge [loop above] node  {\alert{$a, b$}} ();
3566c8175e63 updated
cu
parents: 500
diff changeset
  1344
\path[<-] (Q_3) edge node [right]  {\alert{$a$}} (Q_4);
3566c8175e63 updated
cu
parents: 500
diff changeset
  1345
\path[<-] (Q_2) edge node [above]  {\alert{$a$}} (Q_3);
3566c8175e63 updated
cu
parents: 500
diff changeset
  1346
\path[<-] (Q_1) edge node [right]  {\alert{$b$}} (Q_2);
3566c8175e63 updated
cu
parents: 500
diff changeset
  1347
\path[<-] (Q_0) edge node [above]  {\alert{$b$}} (Q_2);
3566c8175e63 updated
cu
parents: 500
diff changeset
  1348
\path[<-] (Q_2) edge [loop left] node  {\alert{$b$}} ();
3566c8175e63 updated
cu
parents: 500
diff changeset
  1349
\path[<-] (Q_3) edge [bend left=95, looseness=1.3] node [below]  {\alert{$b$}} (Q_0);}
346
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1350
\end{tikzpicture}
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1351
\end{center}
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1352
\mbox{}\\[-18mm]
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1353
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1354
\small
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1355
\begin{itemize}
573
711bbc480998 updated
Christian Urban <urbanc@in.tum.de>
parents: 572
diff changeset
  1356
\item<1-> exchange initial / accepting states\\[-2mm]
711bbc480998 updated
Christian Urban <urbanc@in.tum.de>
parents: 572
diff changeset
  1357
\item<2-> reverse all edges\\[-2mm]
711bbc480998 updated
Christian Urban <urbanc@in.tum.de>
parents: 572
diff changeset
  1358
\item<3-> subset construction $\Rightarrow$ DFA\\[-2mm]
711bbc480998 updated
Christian Urban <urbanc@in.tum.de>
parents: 572
diff changeset
  1359
\item<4-> remove dead states\\[-2mm]
711bbc480998 updated
Christian Urban <urbanc@in.tum.de>
parents: 572
diff changeset
  1360
\item<5-> repeat once more 
346
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1361
          \onslide<6->{$\Rightarrow$ minimal DFA}
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1362
\end{itemize}
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1363
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1364
\end{frame}
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1365
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1366
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1367
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1368
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1369
\begin{frame}[c]
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1370
\frametitle{Regexps and Automata}
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1371
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1372
\begin{center}
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1373
\begin{tikzpicture}
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1374
\node (rexp)  {\bl{\bf Regexps}};
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1375
\node (nfa) [right=of rexp] {\bl{\bf NFAs}};
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1376
\node (dfa) [right=of nfa] {\bl{\bf DFAs}};
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1377
\onslide<1->{\node (mdfa) [right=of dfa] {\bl{\bf \begin{tabular}{c}minimal\\ DFAs\end{tabular}}};}
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1378
\path[->, red, line width=2mm] (rexp) edge node [above=4mm, black] {\begin{tabular}{c@{\hspace{9mm}}}Thompson's\\[-1mm] construction\end{tabular}} (nfa);
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1379
\path[->, red, line width=2mm] (nfa) edge node [above=4mm, black] {\begin{tabular}{c}subset\\[-1mm] construction\end{tabular}}(dfa);
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1380
\onslide<1->{\path[->, red, line width=2mm] (dfa) edge node [below=9mm, black] {minimisation} (mdfa);}
265
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1381
\onslide<2->{\path[->, red, line width=2mm] (dfa) edge [bend left=45] (rexp);}
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1382
\end{tikzpicture}\\
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1383
\end{center}
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1384
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1385
\end{frame}
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1386
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1387
135
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
  1388
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
  1389
265
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1390
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1391
\begin{frame}<2>[c]
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1392
\frametitle{DFA to Rexp}
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1393
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1394
\begin{center}
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1395
\begin{tikzpicture}[scale=2,>=stealth',very thick,
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1396
                             every state/.style={minimum size=0pt,draw=blue!50,very thick,fill=blue!20},]
515
3566c8175e63 updated
cu
parents: 500
diff changeset
  1397
  \only<1>{\node[state, initial]        (q0) at ( 0,1) {$\mbox{Q}_0$};}
3566c8175e63 updated
cu
parents: 500
diff changeset
  1398
  \only<2->{\node[state, initial,accepting]        (q0) at ( 0,1) {$\mbox{Q}_0$};}
3566c8175e63 updated
cu
parents: 500
diff changeset
  1399
  \only<1>{\node[state]                    (q1) at ( 1,1) {$\mbox{Q}_1$};}
3566c8175e63 updated
cu
parents: 500
diff changeset
  1400
  \only<2->{\node[state,accepting]                    (q1) at ( 1,1) {$\mbox{Q}_1$};}
3566c8175e63 updated
cu
parents: 500
diff changeset
  1401
  \only<1>{\node[state, accepting] (q2) at ( 2,1) {$\mbox{Q}_2$};}
3566c8175e63 updated
cu
parents: 500
diff changeset
  1402
  \only<2->{\node[state] (q2) at ( 2,1) {$\mbox{Q}_2$};}
265
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1403
  \path[->] (q0) edge[bend left] node[above] {\alert{$a$}} (q1)
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1404
                  (q1) edge[bend left] node[above] {\alert{$b$}} (q0)
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1405
                  (q2) edge[bend left=50] node[below] {\alert{$b$}} (q0)
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1406
                  (q1) edge node[above] {\alert{$a$}} (q2)
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1407
                  (q2) edge [loop right] node {\alert{$a$}} ()
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1408
                  (q0) edge [loop below] node {\alert{$b$}} ()
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1409
            ;
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1410
\end{tikzpicture}
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1411
\end{center}
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1412
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1413
\onslide<3>{How to get from a DFA to a regular expression?}
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1414
346
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1415
\end{frame}
265
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1416
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
135
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
  1417
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
  1418
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
265
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1419
\begin{frame}[c]
135
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
  1420
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
  1421
\begin{center}
265
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1422
\begin{tikzpicture}[scale=2,>=stealth',very thick,
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1423
                             every state/.style={minimum size=0pt,draw=blue!50,very thick,fill=blue!20},]
783
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1424
  \only<1->{\node[state, initial,accepting]        (q0) at ( 0,1) {$\mbox{Q}_0$};}
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1425
  \only<1->{\node[state,accepting]                    (q1) at ( 1,1) {$\mbox{Q}_1$};}
515
3566c8175e63 updated
cu
parents: 500
diff changeset
  1426
  \only<1->{\node[state] (q2) at ( 2,1) {$\mbox{Q}_2$};}
265
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1427
  \path[->] (q0) edge[bend left] node[above] {\alert{$a$}} (q1)
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1428
                  (q1) edge[bend left] node[above] {\alert{$b$}} (q0)
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1429
                  (q2) edge[bend left=50] node[below] {\alert{$b$}} (q0)
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1430
                  (q1) edge node[above] {\alert{$a$}} (q2)
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1431
                  (q2) edge [loop right] node {\alert{$a$}} ()
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1432
                  (q0) edge [loop below] node {\alert{$b$}} ()
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1433
            ;
139
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 138
diff changeset
  1434
\end{tikzpicture}
265
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1435
\end{center}\pause\bigskip
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1436
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1437
\onslide<2->{
445
e7d0157f0471 updated slides
Christian Urban <urbanc@in.tum.de>
parents: 348
diff changeset
  1438
You know how to solve since school days, no?
265
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1439
\begin{center}
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1440
\begin{tabular}{r@ {\hspace{2mm}}c@ {\hspace{2mm}}l}
515
3566c8175e63 updated
cu
parents: 500
diff changeset
  1441
\bl{$\mbox{Q}_0$} & \bl{$=$} & \bl{$2\, \mbox{Q}_0 + 3 \,\mbox{Q}_1 +  4\, \mbox{Q}_2$}\\
3566c8175e63 updated
cu
parents: 500
diff changeset
  1442
\bl{$\mbox{Q}_1$} & \bl{$=$} & \bl{$2 \,\mbox{Q}_0 + 3\, \mbox{Q}_1 + 1\, \mbox{Q}_2$}\\
3566c8175e63 updated
cu
parents: 500
diff changeset
  1443
\bl{$\mbox{Q}_2$} & \bl{$=$} & \bl{$1\, \mbox{Q}_0 + 5\, \mbox{Q}_1 + 2\, \mbox{Q}_2$}\\
265
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1444
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1445
\end{tabular}
135
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
  1446
\end{center}
265
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1447
}
135
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
  1448
346
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1449
\end{frame}
135
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
  1450
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
  1451
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
  1452
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
  1453
\begin{frame}[c]
72b686e1c974 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 134
diff changeset
  1454
265
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1455
\begin{center}
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1456
\begin{tikzpicture}[scale=2,>=stealth',very thick,
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1457
                             every state/.style={minimum size=0pt,draw=blue!50,very thick,fill=blue!20},]
515
3566c8175e63 updated
cu
parents: 500
diff changeset
  1458
  \only<1->{\node[state, initial]        (q0) at ( 0,1) {$\mbox{Q}_0$};}
3566c8175e63 updated
cu
parents: 500
diff changeset
  1459
  \only<1->{\node[state]                    (q1) at ( 1,1) {$\mbox{Q}_1$};}
3566c8175e63 updated
cu
parents: 500
diff changeset
  1460
  \only<1->{\node[state] (q2) at ( 2,1) {$\mbox{Q}_2$};}
265
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1461
  \path[->] (q0) edge[bend left] node[above] {\alert{$a$}} (q1)
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1462
                  (q1) edge[bend left] node[above] {\alert{$b$}} (q0)
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1463
                  (q2) edge[bend left=50] node[below] {\alert{$b$}} (q0)
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1464
                  (q1) edge node[above] {\alert{$a$}} (q2)
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1465
                  (q2) edge [loop right] node {\alert{$a$}} ()
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1466
                  (q0) edge [loop below] node {\alert{$b$}} ()
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1467
            ;
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1468
\end{tikzpicture}
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1469
\end{center}\bigskip
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1470
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1471
\onslide<2->{
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1472
\begin{center}
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1473
\begin{tabular}{r@ {\hspace{2mm}}c@ {\hspace{2mm}}l}
650
3031e3379ea3 updated
Christian Urban <urbanc@in.tum.de>
parents: 574
diff changeset
  1474
\bl{$\mbox{Q}_0$} & \bl{$=$} & \bl{$\mbox{Q}_0\,b + \mbox{Q}_1\,b +  \mbox{Q}_2\,b + \ONE$}\\
515
3566c8175e63 updated
cu
parents: 500
diff changeset
  1475
\bl{$\mbox{Q}_1$} & \bl{$=$} & \bl{$\mbox{Q}_0\,a$}\\
3566c8175e63 updated
cu
parents: 500
diff changeset
  1476
\bl{$\mbox{Q}_2$} & \bl{$=$} & \bl{$\mbox{Q}_1\,a + \mbox{Q}_2\,a$}\\
265
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1477
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1478
\end{tabular}
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1479
\end{center}
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1480
}
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1481
783
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1482
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1483
\only<3-9>{\small
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1484
\begin{textblock}{6}(1,0.8)
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1485
\begin{bubble}[6.7cm]
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1486
\begin{tabular}{r@ {\hspace{1mm}}c@ {\hspace{1mm}}l}
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1487
\multicolumn{3}{@{}l}{substitute \bl{$\mbox{Q}_1$} into \bl{$\mbox{Q}_0$} \& \bl{$\mbox{Q}_2$}:}\\    
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1488
\bl{$\mbox{Q}_0$} & \bl{$=$} & \bl{$\mbox{Q}_0\,b + \mbox{Q}_0\,a\,b +  \mbox{Q}_2\,b + \ONE$}\\
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1489
\bl{$\mbox{Q}_2$} & \bl{$=$} & \bl{$\mbox{Q}_0\,a\,a + \mbox{Q}_2\,a$}
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1490
\end{tabular}
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1491
\end{bubble}
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1492
\end{textblock}}
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1493
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1494
\only<4-9>{\small
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1495
\begin{textblock}{6}(2,4.15)
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1496
\begin{bubble}[6.7cm]
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1497
\begin{tabular}{r@ {\hspace{1mm}}c@ {\hspace{1mm}}l}
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1498
\multicolumn{3}{@{}l}{simplifying \bl{$\mbox{Q}_0$}:}\\    
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1499
\bl{$\mbox{Q}_0$} & \bl{$=$} & \bl{$\mbox{Q}_0\,(b + a\,b) + \mbox{Q}_2\,b + \ONE$}\\
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1500
\bl{$\mbox{Q}_2$} & \bl{$=$} & \bl{$\mbox{Q}_0\,a\,a + \mbox{Q}_2\,a$}
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1501
\end{tabular}
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1502
\end{bubble}
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1503
\end{textblock}}
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1504
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1505
\only<6-9>{\small
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1506
\begin{textblock}{6}(3,7.55)
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1507
\begin{bubble}[6.7cm]
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1508
\begin{tabular}{r@ {\hspace{1mm}}c@ {\hspace{1mm}}l}
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1509
  \multicolumn{3}{@{}l}{Arden for \bl{$\mbox{Q}_2$}:}\\    
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1510
\bl{$\mbox{Q}_0$} & \bl{$=$} & \bl{$\mbox{Q}_0\,(b + a\,b) + \mbox{Q}_2\,b + \ONE$}\\
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1511
\bl{$\mbox{Q}_2$} & \bl{$=$} & \bl{$\mbox{Q}_0\,a\,a\,(a^*)$}
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1512
\end{tabular}
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1513
\end{bubble}
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1514
\end{textblock}}
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1515
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1516
\only<7-9>{\small
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1517
\begin{textblock}{6}(4,10.9)
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1518
\begin{bubble}[7.5cm]
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1519
\begin{tabular}{r@ {\hspace{1mm}}c@ {\hspace{1mm}}l}
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1520
  \multicolumn{3}{@{}l}{Substitute \bl{$\mbox{Q}_2$} and simplify:}\\    
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1521
\bl{$\mbox{Q}_0$} & \bl{$=$} & \bl{$\mbox{Q}_0\,(b + a\,b + a\,a\,(a^*)\,b) + \ONE$}\\
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1522
\end{tabular}
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1523
\end{bubble}
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1524
\end{textblock}}
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1525
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1526
\only<8-9>{\small
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1527
\begin{textblock}{6}(5,13.4)
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1528
\begin{bubble}[7.5cm]
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1529
\begin{tabular}{r@ {\hspace{1mm}}c@ {\hspace{1mm}}l}
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1530
  \multicolumn{3}{@{}l}{Arden again for \bl{$\mbox{Q}_0$}:}\\    
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1531
\bl{$\mbox{Q}_0$} & \bl{$=$} & \bl{$(b + a\,b + a\,a\,(a^*)\,b)^*$}\\
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1532
\end{tabular}
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1533
\end{bubble}
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1534
\end{textblock}}
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1535
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1536
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1537
\only<9-10>{\small
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1538
\begin{textblock}{6}(6,11.5)
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1539
\begin{bubble}[6.7cm]
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1540
\begin{tabular}{r@ {\hspace{1mm}}c@ {\hspace{1mm}}l}
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1541
\multicolumn{3}{@{}l}{Finally:}\\    
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1542
\bl{$\mbox{Q}_0$} & \bl{$=$} & \bl{$(b + a\,b + a\,a\,(a^*)\,b)^*$}\\
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1543
\bl{$\mbox{Q}_1$} & \bl{$=$} & \bl{$(b + a\,b + a\,a\,(a^*)\,b)^*\,a$}\\
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1544
\bl{$\mbox{Q}_2$} & \bl{$=$} & \bl{$(b + a\,b + a\,a\,(a^*)\,b)^*\,a\,a\,(a^*)$}\\
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1545
\end{tabular}
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1546
\end{bubble}
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1547
\end{textblock}}
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1548
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1549
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1550
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1551
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1552
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1553
\only<5-6>{
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1554
\begin{textblock}{6}(0.7,11.9)
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1555
\begin{bubble}[6.7cm]
265
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1556
Arden's Lemma:
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1557
\begin{center}
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1558
If \bl{$q = q\,r + s$}\; then\; \bl{$q = s\, r^*$}
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1559
\end{center}
783
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1560
\end{bubble}
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1561
\end{textblock}}
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1562
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1563
\only<8>{
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1564
\begin{textblock}{6}(1.1,7.8)
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1565
\begin{bubble}[6.7cm]
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1566
Arden's Lemma:
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1567
\begin{center}
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1568
If \bl{$q = q\,r + s$}\; then\; \bl{$q = s\, r^*$}
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1569
\end{center}
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1570
\end{bubble}
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1571
\end{textblock}}
265
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1572
346
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1573
\end{frame}
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1574
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1575
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1576
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1577
\begin{frame}[c]
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1578
\frametitle{Regexps and Automata}
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1579
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1580
\begin{center}
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1581
\begin{tikzpicture}
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1582
\node (rexp)  {\bl{\bf Regexps}};
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1583
\node (nfa) [right=of rexp] {\bl{\bf NFAs}};
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1584
\node (dfa) [right=of nfa] {\bl{\bf DFAs}};
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1585
\onslide<1->{\node (mdfa) [right=of dfa] {\bl{\bf \begin{tabular}{c}minimal\\ DFAs\end{tabular}}};}
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1586
\path[->, red, line width=2mm] (rexp) edge node [above=4mm, black] {\begin{tabular}{c@{\hspace{9mm}}}Thompson's\\[-1mm] construction\end{tabular}} (nfa);
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1587
\path[->, red, line width=2mm] (nfa) edge node [above=4mm, black] {\begin{tabular}{c}subset\\[-1mm] construction\end{tabular}}(dfa);
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1588
\onslide<1->{\path[->, red, line width=2mm] (dfa) edge node [below=9mm, black] {minimisation} (mdfa);}
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1589
\onslide<1->{\path[->, red, line width=2mm] (dfa) edge [bend left=45] (rexp);}
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1590
\end{tikzpicture}\\
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1591
\end{center}
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1592
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1593
\end{frame}
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1594
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1595
941
66adcae6c762 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 940
diff changeset
  1596
{
66adcae6c762 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 940
diff changeset
  1597
\setbeamercolor{background canvas}{bg=cream}
66adcae6c762 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 940
diff changeset
  1598
\begin{frame}<1-10>[c]
66adcae6c762 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 940
diff changeset
  1599
\end{frame}
66adcae6c762 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 940
diff changeset
  1600
}
66adcae6c762 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 940
diff changeset
  1601
66adcae6c762 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 940
diff changeset
  1602
346
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1603
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1604
\begin{frame}[c]
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1605
\frametitle{Regular Languages (3)}
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1606
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1607
A language is \alert{\bf regular} iff there exists a regular
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1608
expression that recognises all its strings.\bigskip\medskip
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1609
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1610
or {\bf equivalently}\bigskip\medskip
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1611
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1612
A language is \alert{\bf regular} iff there exists a
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1613
deterministic finite automaton that recognises all its
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1614
strings.\bigskip\medskip\pause
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1615
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1616
Why is every finite set of strings a regular language?
a98794b11ac4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
  1617
\end{frame}
265
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1618
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1619
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1620
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 215
diff changeset
  1621
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
783
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1622
%\begin{frame}[c]
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1623
%
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1624
%Given the function 
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1625
%
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1626
%\begin{center}
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1627
%\bl{\begin{tabular}{r@{\hspace{1mm}}c@{\hspace{1mm}}l}
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1628
%$rev(\ZERO)$   & $\dn$ & $\ZERO$\\
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1629
%$rev(\ONE)$         & $\dn$ & $\ONE$\\
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1630
%$rev(c)$                      & $\dn$ & $c$\\
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1631
%$rev(r_1 + r_2)$        & $\dn$ & $rev(r_1) + rev(r_2)$\\
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1632
%$rev(r_1 \cdot r_2)$  & $\dn$ & $rev(r_2) \cdot rev(r_1)$\\
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1633
%$rev(r^*)$                   & $\dn$ & $rev(r)^*$\\
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1634
%\end{tabular}}
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1635
%\end{center}
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1636
%
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1637
%
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1638
%and the set
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1639
%
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1640
%\begin{center}
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1641
%\bl{$Rev\,A \dn \{s^{-1} \;|\; s \in A\}$}
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1642
%\end{center}
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1643
%
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1644
%prove whether
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1645
%
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1646
%\begin{center}
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1647
%\bl{$L(rev(r)) = Rev (L(r))$}
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1648
%\end{center}
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1649
%
06cbaaad3ba8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 782
diff changeset
  1650
%\end{frame}
133
09efdf5cf07c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
  1651
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
25
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1652
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1653
743
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1654
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1655
\begin{frame}[c]
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1656
\frametitle{Regexps and Automata}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1657
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1658
\begin{center}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1659
\begin{tikzpicture}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1660
\node (rexp)  {\bl{\bf Regexps}};
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1661
\node (nfa) [right=of rexp] {\bl{\bf NFAs}};
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1662
\node (dfa) [right=of nfa] {\bl{\bf DFAs}};
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1663
\node (mdfa) [right=of dfa] {\bl{\bf \begin{tabular}{c}minimal\\ DFAs\end{tabular}}};
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1664
\path[->,red, line width=2mm] (rexp) edge node [above=4mm, black] 
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1665
     {\begin{tabular}{c@{\hspace{9mm}}}Thompson's\\[-1mm] construction\end{tabular}} (nfa);
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1666
\path[->,red, line width=2mm] (nfa) edge node [above=4mm, black] 
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1667
     {\begin{tabular}{c}subset\\[-1mm] construction\end{tabular}}(dfa);
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1668
\path[->, red, line width=2mm] (dfa) edge node [below=5mm, black] {minimisation} (mdfa);
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1669
%%\path[->, red, line width=2mm] (dfa) edge [bend left=45] (rexp);
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1670
\path[->, red, line width=2mm] (dfa) edge [bend left=45] node [below, black] {\begin{tabular}{l}Brzozowski's\\ method\end{tabular}} (rexp);
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1671
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1672
\end{tikzpicture}\\
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1673
\end{center}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1674
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1675
\end{frame}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1676
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1677
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1678
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1679
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1680
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1681
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1682
% \begin{frame}[c]
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1683
% \frametitle{DFA to Rexp}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1684
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1685
% \begin{center}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1686
% \begin{tikzpicture}[scale=2,>=stealth',very thick,
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1687
%                     every state/.style={minimum size=0pt,
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1688
%                     draw=blue!50,very thick,fill=blue!20},]
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1689
%   \node[state, initial]        (q0) at ( 0,1) {$q_0$};
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1690
%   \node[state]                    (q1) at ( 1,1) {$q_1$};
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1691
%   \node[state, accepting] (q2) at ( 2,1) {$q_2$};
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1692
%   \path[->] (q0) edge[bend left] node[above] {\alert{$a$}} (q1)
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1693
%             (q1) edge[bend left] node[above] {\alert{$b$}} (q0)
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1694
%             (q2) edge[bend left=50] node[below] {\alert{$b$}} (q0)
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1695
%             (q1) edge node[above] {\alert{$a$}} (q2)
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1696
%             (q2) edge [loop right] node {\alert{$a$}} ()
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1697
%             (q0) edge [loop below] node {\alert{$b$}} ();
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1698
% \end{tikzpicture}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1699
% \end{center}\bigskip
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1700
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1701
% \begin{center}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1702
% \begin{tabular}{r@ {\hspace{2mm}}c@ {\hspace{2mm}}l@{\hspace{7mm}}l}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1703
% \bl{$q_0$} & \bl{$=$} & \bl{$\ONE + q_0\,b + q_1\,b +  q_2\,b$} & (start state)\\
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1704
% \bl{$q_1$} & \bl{$=$} & \bl{$q_0\,a$}\\
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1705
% \bl{$q_2$} & \bl{$=$} & \bl{$q_1\,a + q_2\,a$}\\
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1706
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1707
% \end{tabular}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1708
% \end{center}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1709
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1710
% Arden's Lemma:
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1711
% \begin{center}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1712
% If \bl{$q = q\,r + s$}\; then\; \bl{$q = s\, r^*$}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1713
% \end{center}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1714
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1715
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1716
% \end{frame}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1717
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1718
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1719
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1720
% \begin{frame}[c]
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1721
% \frametitle{DFA Minimisation}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1722
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1723
% \begin{enumerate}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1724
% \item Take all pairs \bl{$(q, p)$} with \bl{$q \not= p$}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1725
% \item Mark all pairs that accepting and non-accepting states
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1726
% \item For  all unmarked pairs \bl{$(q, p)$} and all characters \bl{$c$} test whether
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1727
% \begin{center}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1728
% \bl{$(\delta(q, c), \delta(p,c))$}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1729
% \end{center} 
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1730
% are marked. If yes, then also mark \bl{$(q, p)$}.
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1731
% \item Repeat last step until no change.
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1732
% \item All unmarked pairs can be merged.
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1733
% \end{enumerate}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1734
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1735
% \end{frame}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1736
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1737
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1738
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1739
% \begin{frame}[c]
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1740
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1741
% \begin{center}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1742
% \begin{tabular}{@{\hspace{-8mm}}cc@{}}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1743
% \begin{tikzpicture}[>=stealth',very thick,auto,
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1744
%                              every state/.style={minimum size=0pt,inner sep=2pt,draw=blue!50,very thick,fill=blue!20},]
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1745
% \node[state,initial]  (q_0)  {$q_0$};
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1746
% \node[state] (q_1) [right=of q_0] {$q_1$};
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1747
% \node[state] (q_2) [below right=of q_0] {$q_2$};
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1748
% \node[state] (q_3) [right=of q_2] {$q_3$};
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1749
% \node[state, accepting] (q_4) [right=of q_1] {$q_4$};
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1750
% \path[->] (q_0) edge node [above]  {\alert{$a$}} (q_1);
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1751
% \path[->] (q_1) edge node [above]  {\alert{$a$}} (q_4);
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1752
% \path[->] (q_4) edge [loop right] node  {\alert{$a, b$}} ();
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1753
% \path[->] (q_3) edge node [right]  {\alert{$a$}} (q_4);
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1754
% \path[->] (q_2) edge node [above]  {\alert{$a$}} (q_3);
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1755
% \path[->] (q_1) edge node [right]  {\alert{$b$}} (q_2);
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1756
% \path[->] (q_0) edge node [above]  {\alert{$b$}} (q_2);
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1757
% \path[->] (q_2) edge [loop left] node  {\alert{$b$}} ();
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1758
% \path[->] (q_3) edge [bend left=95, looseness=1.3] node [below]  {\alert{$b$}} (q_0);
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1759
% \end{tikzpicture}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1760
% &
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1761
% \raisebox{9mm}{\begin{tikzpicture}[scale=0.6,line width=0.8mm]
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1762
% \draw (0,0) -- (4,0);
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1763
% \draw (0,1) -- (4,1);
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1764
% \draw (0,2) -- (3,2);
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1765
% \draw (0,3) -- (2,3);
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1766
% \draw (0,4) -- (1,4);
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1767
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1768
% \draw (0,0) -- (0, 4);
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1769
% \draw (1,0) -- (1, 4);
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1770
% \draw (2,0) -- (2, 3);
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1771
% \draw (3,0) -- (3, 2);
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1772
% \draw (4,0) -- (4, 1);
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1773
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1774
% \draw (0.5,-0.5) node {$q_0$}; 
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1775
% \draw (1.5,-0.5) node {$q_1$}; 
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1776
% \draw (2.5,-0.5) node {$q_2$}; 
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1777
% \draw (3.5,-0.5) node {$q_3$};
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1778
 
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1779
% \draw (-0.5, 3.5) node {$q_1$}; 
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1780
% \draw (-0.5, 2.5) node {$q_2$}; 
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1781
% \draw (-0.5, 1.5) node {$q_3$}; 
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1782
% \draw (-0.5, 0.5) node {$q_4$}; 
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1783
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1784
% \draw (0.5,0.5) node {\large$\star$}; 
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1785
% \draw (1.5,0.5) node {\large$\star$}; 
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1786
% \draw (2.5,0.5) node {\large$\star$}; 
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1787
% \draw (3.5,0.5) node {\large$\star$};
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1788
% \draw (0.5,1.5) node {\large$\star$}; 
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1789
% \draw (2.5,1.5) node {\large$\star$}; 
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1790
% \draw (0.5,3.5) node {\large$\star$}; 
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1791
% \draw (1.5,2.5) node {\large$\star$}; 
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1792
% \end{tikzpicture}}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1793
% \end{tabular}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1794
% \end{center}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1795
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1796
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1797
% \mbox{}\\[-20mm]\mbox{}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1798
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1799
% \begin{center}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1800
% \begin{tikzpicture}[>=stealth',very thick,auto,
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1801
%                              every state/.style={minimum size=0pt,inner sep=2pt,draw=blue!50,very thick,fill=blue!20},]
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1802
% \node[state,initial]  (q_02)  {$q_{0, 2}$};
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1803
% \node[state] (q_13) [right=of q_02] {$q_{1, 3}$};
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1804
% \node[state, accepting] (q_4) [right=of q_13] {$q_{4\phantom{,0}}$};
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1805
% \path[->] (q_02) edge [bend left] node [above]  {\alert{$a$}} (q_13);
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1806
% \path[->] (q_13) edge [bend left] node [below]  {\alert{$b$}} (q_02);
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1807
% \path[->] (q_02) edge [loop below] node  {\alert{$b$}} ();
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1808
% \path[->] (q_13) edge node [above]  {\alert{$a$}} (q_4);
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1809
% \path[->] (q_4) edge [loop above] node  {\alert{$a, b$}} ();
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1810
% \end{tikzpicture}\\
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1811
% minimal automaton
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1812
% \end{center}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1813
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1814
% \end{frame}
967
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  1815
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  1816
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  1817
743
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1818
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1819
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1820
\begin{frame}[c]
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1821
\frametitle{Regular Languages}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1822
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1823
Two equivalent definitions:\bigskip
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1824
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1825
\begin{quote}\rm A language is \alert{regular} iff there exists a
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1826
regular expression that recognises all its strings.
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1827
\end{quote}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1828
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1829
\begin{quote}\rm A language is \alert{regular} iff there exists an
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1830
automaton that recognises all its strings.
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1831
\end{quote}\bigskip\bigskip
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1832
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1833
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1834
\small
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1835
for example \bl{$a^nb^n$} is not regular
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1836
\end{frame}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1837
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1838
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1839
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1840
\begin{frame}[c]
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1841
\frametitle{Negation}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1842
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1843
Regular languages are closed under negation:\bigskip
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1844
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1845
\begin{center}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1846
\begin{tikzpicture}[scale=2,>=stealth',very thick,
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1847
                    every state/.style={minimum size=0pt,
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1848
                    draw=blue!50,very thick,fill=blue!20}]
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1849
  \only<1>{\node[state,initial] (q0) at ( 0,1) {$q_0$};}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1850
  \only<2>{\node[state,initial,accepting] (q0) at ( 0,1) {$q_0$};}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1851
  \only<1>{\node[state] (q1) at ( 1,1) {$q_1$};}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1852
  \only<2>{\node[state,accepting] (q1) at ( 1,1) {$q_1$};}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1853
  \only<1>{\node[state, accepting] (q2) at ( 2,1) {$q_2$};}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1854
  \only<2>{\node[state] (q2) at ( 2,1) {$q_2$};}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1855
  \path[->] (q0) edge[bend left] node[above] {\alert{$a$}} (q1)
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1856
            (q1) edge[bend left] node[above] {\alert{$b$}} (q0)
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1857
            (q2) edge[bend left=50] node[below] {\alert{$b$}} (q0)
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1858
            (q1) edge node[above] {\alert{$a$}} (q2)
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1859
            (q2) edge [loop right] node {\alert{$a$}} ()
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1860
            (q0) edge [loop below] node {\alert{$b$}} ();
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1861
\end{tikzpicture}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1862
\end{center}\bigskip\bigskip
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1863
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1864
But requires that the automaton is \alert{completed}!
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1865
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1866
\end{frame}
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1867
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 662
diff changeset
  1868
891
00ffcd796ffb updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 889
diff changeset
  1869
{
00ffcd796ffb updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 889
diff changeset
  1870
\setbeamercolor{background canvas}{bg=cream}
00ffcd796ffb updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 889
diff changeset
  1871
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00ffcd796ffb updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 889
diff changeset
  1872
\begin{frame}[c]
00ffcd796ffb updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 889
diff changeset
  1873
  \frametitle{\boldmath{}$(a^*)^* \cdot b$}
00ffcd796ffb updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 889
diff changeset
  1874
00ffcd796ffb updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 889
diff changeset
  1875
\begin{center}
00ffcd796ffb updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 889
diff changeset
  1876
\begin{tikzpicture}
00ffcd796ffb updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 889
diff changeset
  1877
  \begin{axis}[
00ffcd796ffb updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 889
diff changeset
  1878
    xlabel={\pcode{a}s},
00ffcd796ffb updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 889
diff changeset
  1879
    %%x label style={at={(1.05,0.0)}},
00ffcd796ffb updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 889
diff changeset
  1880
    ylabel={time in secs},
00ffcd796ffb updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 889
diff changeset
  1881
    enlargelimits=false,
00ffcd796ffb updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 889
diff changeset
  1882
    xtick={0,15,...,30},
00ffcd796ffb updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 889
diff changeset
  1883
    xmax=33,
00ffcd796ffb updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 889
diff changeset
  1884
    ymax=35,
00ffcd796ffb updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 889
diff changeset
  1885
    ytick={0,5,...,30},
00ffcd796ffb updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 889
diff changeset
  1886
    scaled ticks=false,
00ffcd796ffb updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 889
diff changeset
  1887
    axis lines=left,
00ffcd796ffb updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 889
diff changeset
  1888
    width=9cm,
00ffcd796ffb updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 889
diff changeset
  1889
    height=6cm, 
00ffcd796ffb updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 889
diff changeset
  1890
    legend entries={Java 8,Python,JavaScript,Swift,Dart},  
00ffcd796ffb updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 889
diff changeset
  1891
    legend pos=outer north east,
00ffcd796ffb updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 889
diff changeset
  1892
    legend cell align=left]
00ffcd796ffb updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 889
diff changeset
  1893
\addplot[blue,mark=*, mark options={fill=white}] table {re-python2.data};
00ffcd796ffb updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 889
diff changeset
  1894
\addplot[cyan,mark=*, mark options={fill=white}] table {re-java.data};
00ffcd796ffb updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 889
diff changeset
  1895
\addplot[red,mark=*, mark options={fill=white}] table {re-js.data};
00ffcd796ffb updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 889
diff changeset
  1896
\addplot[magenta,mark=*, mark options={fill=white}] table {re-swift.data};
00ffcd796ffb updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 889
diff changeset
  1897
\addplot[brown,mark=*, mark options={fill=white}] table {re-dart.data};
00ffcd796ffb updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 889
diff changeset
  1898
00ffcd796ffb updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 889
diff changeset
  1899
%\addplot[red,mark=triangle*, mark options={fill=red}] table {nfadepth2.data};	
00ffcd796ffb updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 889
diff changeset
  1900
\end{axis}
00ffcd796ffb updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 889
diff changeset
  1901
\end{tikzpicture}
00ffcd796ffb updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 889
diff changeset
  1902
\end{center}
00ffcd796ffb updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 889
diff changeset
  1903
00ffcd796ffb updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 889
diff changeset
  1904
\end{frame}}
00ffcd796ffb updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 889
diff changeset
  1905
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00ffcd796ffb updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 889
diff changeset
  1906
967
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  1907
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  1908
891
00ffcd796ffb updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 889
diff changeset
  1909
\begin{frame}<1-3>[c]
00ffcd796ffb updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 889
diff changeset
  1910
\end{frame}  
00ffcd796ffb updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 889
diff changeset
  1911
889
00c1c3408c93 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 871
diff changeset
  1912
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00c1c3408c93 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 871
diff changeset
  1913
{
00c1c3408c93 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 871
diff changeset
  1914
\setbeamercolor{background canvas}{bg=cream}
00c1c3408c93 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 871
diff changeset
  1915
\begin{frame}[c]
00c1c3408c93 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 871
diff changeset
  1916
00c1c3408c93 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 871
diff changeset
  1917
\begin{center}
00c1c3408c93 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 871
diff changeset
  1918
\begin{tikzpicture}[scale=1.5,>=stealth',very thick,
00c1c3408c93 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 871
diff changeset
  1919
                    every state/.style={minimum size=0pt,
00c1c3408c93 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 871
diff changeset
  1920
                    draw=blue!50,very thick,fill=blue!20}]
00c1c3408c93 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 871
diff changeset
  1921
  \node[state,initial]   (q0) at (0,2) {$q_0$};
00c1c3408c93 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 871
diff changeset
  1922
  \node[state,accepting] (q1) at (2,2) {$q_1$};
00c1c3408c93 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 871
diff changeset
  1923
  \node[state]           (q2) at (0,0) {$q_2$};
00c1c3408c93 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 871
diff changeset
  1924
  \node[state]           (q3) at (2,0) {$q_3$};
00c1c3408c93 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 871
diff changeset
  1925
00c1c3408c93 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 871
diff changeset
  1926
  \path[->] (q0) edge[bend left] node[above] {\alert{$a$}} (q1)
00c1c3408c93 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 871
diff changeset
  1927
            (q1) edge[bend left] node[above] {\alert{$a$}} (q0)
00c1c3408c93 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 871
diff changeset
  1928
            (q2) edge[bend left] node[above] {\alert{$a$}} (q3)
00c1c3408c93 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 871
diff changeset
  1929
            (q3) edge[bend left] node[above] {\alert{$a$}} (q2)
00c1c3408c93 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 871
diff changeset
  1930
            (q0) edge[bend left] node[right] {\alert{$b$}} (q2)
00c1c3408c93 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 871
diff changeset
  1931
            (q2) edge[bend left] node[left]  {\alert{$b$}} (q0)
00c1c3408c93 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 871
diff changeset
  1932
            (q1) edge[bend left] node[right] {\alert{$b$}} (q3)
00c1c3408c93 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 871
diff changeset
  1933
            (q3) edge[bend left] node[left]  {\alert{$b$}} (q1);
00c1c3408c93 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 871
diff changeset
  1934
\end{tikzpicture}
00c1c3408c93 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 871
diff changeset
  1935
\end{center}
00c1c3408c93 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 871
diff changeset
  1936
00c1c3408c93 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 871
diff changeset
  1937
\hfill{}Which language?
00c1c3408c93 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 871
diff changeset
  1938
00c1c3408c93 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 871
diff changeset
  1939
\end{frame}
00c1c3408c93 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 871
diff changeset
  1940
}
00c1c3408c93 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 871
diff changeset
  1941
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00c1c3408c93 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 871
diff changeset
  1942
00c1c3408c93 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 871
diff changeset
  1943
967
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  1944
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  1945
\begin{frame}[c]
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  1946
\frametitle{\mbox{CW1: Regexes and \boldmath$L$-function}}
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  1947
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  1948
Given 
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  1949
\begin{center}
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  1950
\begin{tabular}{@ {}l@ {\hspace{20mm}}l@ {\hspace{2mm}}l@ {\hspace{2mm}}l}
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  1951
\bl{$r^+$}        & \bl{$L(r^+)$}         & \bl{$\dn$}  & \bl{$\bigcup_{1\le i}.\;L(r)^i$}\\
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  1952
\bl{$r^?$}        & \bl{$L(r^?)$}         & \bl{$\dn$}  & \bl{$L(r) \cup \{[]\}$}\\  
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  1953
\bl{$r_1 \,\&\, r_2$} &  \bl{$L(r_1 \& r_2)$} &  \bl{$\dn$} & \bl{$L(r_1) \cap L(r_2)$} \\
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  1954
\bl{$r^{\{n\}}$}   & \bl{$L(r^{\{n\}})$}   & \bl{$\dn$}  & \bl{$L(r)^n$}\\
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  1955
\bl{$r^{\{..m\}}$}   & \bl{$L(r^{\{..m\}})$}   & \bl{$\dn$}  & \bl{$\bigcup_{0\le i \le m}.\;L(r)^i$}\\
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  1956
\bl{$r^{\{n..\}}$}   & \bl{$L(r^{\{n..\}})$}   & \bl{$\dn$}  & \bl{$\bigcup_{n\le i}.\;L(r)^i$}\\
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  1957
\bl{$r^{\{n..m\}}$}   & \bl{$L(r^{\{n..m\}})$}   & \bl{$\dn$}  & \bl{$\bigcup_{n\le i \le m}.\;L(r)^i$}\\      
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  1958
\bl{$\sim{}r$}   & \bl{$L(\sim{}r)$}   & \bl{$\dn$}  & \bl{$\Sigma^* - L(r)$}\\      
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  1959
\end{tabular}
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  1960
\end{center}
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  1961
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  1962
\end{frame}
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  1963
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  1964
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  1965
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  1966
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  1967
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  1968
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  1969
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  1970
\begin{frame}[c]
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  1971
\frametitle{Nullable}
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  1972
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  1973
\begin{center}
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  1974
\begin{tabular}{@ {}l@ {\hspace{2mm}}c@ {\hspace{2mm}}l@ {}}
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  1975
\bl{$nullable(r^+)$}    & \bl{$\dn$} & \bl{$nullable(r)$}\\
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  1976
\bl{$nullable(r^?)$}       & \bl{$\dn$} & \bl{\textit{true}}\\
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  1977
\bl{$nullable(r_1 \,\&\, r_2)$}  & \bl{$\dn$} & \bl{$nullable(r_1) \wedge nullable(r_2)$}\\
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  1978
\bl{$nullable(r^{\{n\}})$}     & \bl{$\dn$} & \bl{\textit{if} $n = 0$ \textit{then} \textit{true} \textit{else} $nullable(r)$} \\ 
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  1979
\bl{$nullable(r^{\{..m\}})$} & \bl{$\dn$} & \bl{\textit{true}} \\
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  1980
\bl{$nullable (r^{\{n..\}})$}           & \bl{$\dn$} & \bl{\textit{if} $n = 0$ \textit{then} \textit{true} \textit{else} $nullable(r)$}\\
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  1981
\bl{$nullable (r^{\{n..m\}})$}           & \bl{$\dn$} & \bl{\textit{if} $n = 0$ \textit{then} \textit{true} \textit{else} $nullable(r)$}\\  
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  1982
\bl{$nullable (\sim{}r)$}           & \bl{$\dn$} & \bl{$!\,nullable(r)$}\\
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  1983
\end{tabular}
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  1984
\end{center}
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  1985
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  1986
\end{frame}
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  1987
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  1988
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  1989
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  1990
\begin{frame}[c]
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  1991
\frametitle{Derivative}
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  1992
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  1993
\begin{center}
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  1994
\begin{tabular}{@ {}l@ {\hspace{2mm}}c@ {\hspace{2mm}}l@ {}}
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  1995
\bl{$der\,c\,(r^+)$}    & \bl{$\dn$} & \bl{$(der\,c\,r)\cdot r^*$}\\
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  1996
\bl{$der\,c\,(r^?)$}       & \bl{$\dn$} & \bl{$der\,c\,r$}\\
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  1997
\bl{$der\,c\,(r_1 \,\&\, r_2)$}  & \bl{$\dn$} & \bl{$(der\,c\,r_1) \;\&\; (der\,c\,r_2)$}\\
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  1998
\bl{$der\,c\,(r^{\{n\}})$}     & \bl{$\dn$} & \bl{\textit{if} $n = 0$ \textit{then} $\ZERO$ \textit{else} $(der\,c\,r)\cdot r^{\{n - 1\}}$} \\ 
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  1999
\bl{$der\,c\,(r^{\{..m\}})$} & \bl{$\dn$} &  \bl{\textit{if} $m = 0$ \textit{then} $\ZERO$ \textit{else} $(der\,c\,r)\cdot r^{\{..m - 1\}}$}\\
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  2000
\bl{$der\,c\,(r^{\{n..\}})$}           & \bl{$\dn$} & \bl{\textit{if} $n = 0$ \textit{then} $(der\,c\,r)\cdot r^*$ \textit{else} $(der\,c\,r)\cdot r^{\{n - 1..\}}$}\\
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  2001
  \bl{$der\,c\,(r^{\{n..m\}})$}           & \bl{$\dn$} & \bl{\textit{if} $n = 0 \wedge m = 0$ \textit{then} $\ZERO$ \textit{else}}\\
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  2002
                        &            & \bl{\textit{if} $ n = 0$ \textit{then} $(der\,c\,r)\cdot r^{\{..m-1\}}$
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  2003
                                       \textit{else} $(der\,c\,r)\cdot r^{\{n-1..m-1\}}$}\\  
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  2004
\bl{$der\,c\,(\sim{}r)$}           & \bl{$\dn$} & \bl{$\sim\,(der\,c\,r)$}\\
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  2005
\end{tabular}
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  2006
\end{center}
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  2007
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  2008
\end{frame}
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  2009
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  2010
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  2011
781
bae72c598afd updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 779
diff changeset
  2012
847
da2320360f12 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 784
diff changeset
  2013
\begin{frame}<1-15>[c]
da2320360f12 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 784
diff changeset
  2014
781
bae72c598afd updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 779
diff changeset
  2015
\end{frame}
bae72c598afd updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 779
diff changeset
  2016
967
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  2017
% \begin{frame}[t]
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  2018
% \begin{mybox3}{}
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  2019
%   I always thought dfa's needed a transition for each state for each
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  2020
%   character, and if not it would be an nfa not a dfa. Is there an
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  2021
%   example that disproves this?
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  2022
% \end{mybox3}
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  2023
% \end{frame}
781
bae72c598afd updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 779
diff changeset
  2024
967
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  2025
% \begin{frame}<1-12>[c]
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  2026
% \end{frame}
781
bae72c598afd updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 779
diff changeset
  2027
967
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  2028
% \begin{frame}[t]
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  2029
% \begin{mybox3}{}
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  2030
%   Do the regular expression matchers in Python and Java 8 have more
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  2031
%   features than the one implemented in this module? Or is there
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  2032
%   another reason for their inefficiency?
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  2033
% \end{mybox3}
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  2034
% \end{frame}
782
a26a20acd1c2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 781
diff changeset
  2035
891
00ffcd796ffb updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 889
diff changeset
  2036
967
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  2037
% \begin{frame}[c]
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  2038
%   \begin{itemize}
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  2039
%   \item CW / censored some msgs 
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  2040
%   \item power law / proof
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  2041
%   \item CW feedback
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  2042
%   \item too polished CW submissions
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  2043
%   \item no open book  
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  2044
%   \end{itemize}  
ce5de01b9632 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 941
diff changeset
  2045
% \end{frame}
891
00ffcd796ffb updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 889
diff changeset
  2046
00ffcd796ffb updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 889
diff changeset
  2047
25
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2048
\end{document}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2049
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2050
%%% Local Variables:  
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2051
%%% mode: latex
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2052
%%% TeX-master: t
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2053
%%% End: 
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2054