slides/slides05.tex
author Christian Urban <christian dot urban at kcl dot ac dot uk>
Thu, 28 Aug 2014 01:06:09 +0100
changeset 233 acddd4808117
parent 215 828303e8e4af
child 270 4dbeaf43031d
permissions -rw-r--r--
updated
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
44
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     1
\documentclass[dvipsnames,14pt,t]{beamer}
147
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
     2
\usepackage{beamerthemeplaincu}
44
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     3
\usepackage[absolute,overlay]{textpos}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     4
\usepackage{ifthen}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     5
\usepackage{tikz}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     6
\usepackage{pgf}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     7
\usepackage{calc} 
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     8
\usepackage{ulem}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     9
\usepackage{courier}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    10
\usepackage{listings}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    11
\renewcommand{\uline}[1]{#1}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    12
\usetikzlibrary{arrows}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    13
\usetikzlibrary{automata}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    14
\usetikzlibrary{shapes}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    15
\usetikzlibrary{shadows}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    16
\usetikzlibrary{positioning}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    17
\usetikzlibrary{calc}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    18
\usepackage{graphicx} 
148
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
    19
\usepackage{pgfplots}
153
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 151
diff changeset
    20
\usepackage{fontspec}
215
828303e8e4af updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 169
diff changeset
    21
\usepackage{../langs}
828303e8e4af updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 169
diff changeset
    22
\usepackage{../data}
44
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    23
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    24
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    25
% beamer stuff 
147
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    26
\renewcommand{\slidecaption}{AFL 05, King's College London, 23.~October 2013}
44
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    27
\newcommand{\bl}[1]{\textcolor{blue}{#1}}       
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    28
\newcommand{\dn}{\stackrel{\mbox{\scriptsize def}}{=}}% for definitions
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    29
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    30
\begin{document}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    31
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    32
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    33
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    34
\begin{frame}<1>[t]
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    35
\frametitle{%
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    36
  \begin{tabular}{@ {}c@ {}}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    37
  \\[-3mm]
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    38
  \LARGE Automata and \\[-2mm] 
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    39
  \LARGE Formal Languages (5)\\[3mm] 
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    40
  \end{tabular}}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    41
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    42
  \normalsize
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    43
  \begin{center}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    44
  \begin{tabular}{ll}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    45
  Email:  & christian.urban at kcl.ac.uk\\
147
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    46
  Office: & S1.27 (1st floor Strand Building)\\
44
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    47
  Slides: & KEATS (also home work is there)\\
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    48
  \end{tabular}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    49
  \end{center}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    50
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    51
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    52
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    53
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    54
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    55
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    56
\mode<presentation>{
147
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    57
\begin{frame}[c]
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    58
\frametitle{DFA Minimisation}
44
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    59
147
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    60
\begin{enumerate}
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    61
\item Take all pairs \bl{$(q, p)$} with \bl{$q \not= p$}
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    62
\item Mark all pairs that accepting and non-accepting states
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    63
\item For  all unmarked pairs \bl{$(q, p)$} and all characters \bl{$c$} tests wether
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    64
\begin{center}
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    65
\bl{$(\delta(q, c), \delta(p,c))$}
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    66
\end{center} 
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    67
are marked. If yes, then also mark \bl{$(q, p)$}.
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    68
\item Repeat last step until no chance.
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    69
\item All unmarked pairs can be merged.
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    70
\end{enumerate}
44
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    71
147
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    72
\end{frame}}
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    73
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    74
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    75
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    76
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    77
\mode<presentation>{
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    78
\begin{frame}<1-2>[c]
44
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    79
147
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    80
\begin{center}
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    81
\begin{tikzpicture}[>=stealth',very thick,auto,
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    82
                             every state/.style={minimum size=0pt,inner sep=2pt,draw=blue!50,very thick,fill=blue!20},]
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    83
\node[state,initial]  (q_0)  {$q_0$};
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    84
\node[state] (q_1) [right=of q_0] {$q_1$};
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    85
\node[state] (q_2) [below right=of q_0] {$q_2$};
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    86
\node[state] (q_3) [right=of q_2] {$q_3$};
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    87
\node[state, accepting] (q_4) [right=of q_1] {$q_4$};
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    88
\path[->] (q_0) edge node [above]  {\alert{$a$}} (q_1);
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    89
\path[->] (q_1) edge node [above]  {\alert{$a$}} (q_4);
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    90
\path[->] (q_4) edge [loop right] node  {\alert{$a, b$}} ();
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    91
\path[->] (q_3) edge node [right]  {\alert{$a$}} (q_4);
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    92
\path[->] (q_2) edge node [above]  {\alert{$a$}} (q_3);
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    93
\path[->] (q_1) edge node [right]  {\alert{$b$}} (q_2);
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    94
\path[->] (q_0) edge node [above]  {\alert{$b$}} (q_2);
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    95
\path[->] (q_2) edge [loop left] node  {\alert{$b$}} ();
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    96
\path[->] (q_3) edge [bend left=95, looseness=1.3] node [below]  {\alert{$b$}} (q_0);
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    97
\end{tikzpicture}
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    98
\end{center}
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    99
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   100
\mbox{}\\[-20mm]\mbox{}
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   101
44
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   102
\begin{center}
147
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   103
\begin{tikzpicture}[scale=0.8,line width=0.8mm]
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   104
\draw (0,0) -- (4,0);
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   105
\draw (0,1) -- (4,1);
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   106
\draw (0,2) -- (3,2);
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   107
\draw (0,3) -- (2,3);
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   108
\draw (0,4) -- (1,4);
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   109
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   110
\draw (0,0) -- (0, 4);
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   111
\draw (1,0) -- (1, 4);
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   112
\draw (2,0) -- (2, 3);
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   113
\draw (3,0) -- (3, 2);
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   114
\draw (4,0) -- (4, 1);
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   115
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   116
\draw (0.5,-0.5) node {$q_0$}; 
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   117
\draw (1.5,-0.5) node {$q_1$}; 
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   118
\draw (2.5,-0.5) node {$q_2$}; 
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   119
\draw (3.5,-0.5) node {$q_3$};
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   120
 
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   121
\draw (-0.5, 3.5) node {$q_1$}; 
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   122
\draw (-0.5, 2.5) node {$q_2$}; 
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   123
\draw (-0.5, 1.5) node {$q_3$}; 
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   124
\draw (-0.5, 0.5) node {$q_4$}; 
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   125
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   126
\draw (0.5,0.5) node {\large$\star$}; 
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   127
\draw (1.5,0.5) node {\large$\star$}; 
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   128
\draw (2.5,0.5) node {\large$\star$}; 
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   129
\draw (3.5,0.5) node {\large$\star$};
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   130
\end{tikzpicture}\\
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   131
\end{center}
44
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   132
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   133
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   134
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   135
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   136
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   137
\mode<presentation>{
147
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   138
\begin{frame}<1-2>[c]
44
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   139
147
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   140
\begin{center}
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   141
\begin{tabular}{@{\hspace{-8mm}}cc@{}}
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   142
\begin{tikzpicture}[>=stealth',very thick,auto,
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   143
                             every state/.style={minimum size=0pt,inner sep=2pt,draw=blue!50,very thick,fill=blue!20},]
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   144
\node[state,initial]  (q_0)  {$q_0$};
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   145
\node[state] (q_1) [right=of q_0] {$q_1$};
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   146
\node[state] (q_2) [below right=of q_0] {$q_2$};
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   147
\node[state] (q_3) [right=of q_2] {$q_3$};
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   148
\node[state, accepting] (q_4) [right=of q_1] {$q_4$};
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   149
\path[->] (q_0) edge node [above]  {\alert{$a$}} (q_1);
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   150
\path[->] (q_1) edge node [above]  {\alert{$a$}} (q_4);
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   151
\path[->] (q_4) edge [loop right] node  {\alert{$a, b$}} ();
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   152
\path[->] (q_3) edge node [right]  {\alert{$a$}} (q_4);
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   153
\path[->] (q_2) edge node [above]  {\alert{$a$}} (q_3);
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   154
\path[->] (q_1) edge node [right]  {\alert{$b$}} (q_2);
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   155
\path[->] (q_0) edge node [above]  {\alert{$b$}} (q_2);
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   156
\path[->] (q_2) edge [loop left] node  {\alert{$b$}} ();
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   157
\path[->] (q_3) edge [bend left=95, looseness=1.3] node [below]  {\alert{$b$}} (q_0);
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   158
\end{tikzpicture}
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   159
&
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   160
\raisebox{9mm}{\begin{tikzpicture}[scale=0.6,line width=0.8mm]
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   161
\draw (0,0) -- (4,0);
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   162
\draw (0,1) -- (4,1);
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   163
\draw (0,2) -- (3,2);
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   164
\draw (0,3) -- (2,3);
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   165
\draw (0,4) -- (1,4);
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   166
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   167
\draw (0,0) -- (0, 4);
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   168
\draw (1,0) -- (1, 4);
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   169
\draw (2,0) -- (2, 3);
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   170
\draw (3,0) -- (3, 2);
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   171
\draw (4,0) -- (4, 1);
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   172
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   173
\draw (0.5,-0.5) node {$q_0$}; 
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   174
\draw (1.5,-0.5) node {$q_1$}; 
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   175
\draw (2.5,-0.5) node {$q_2$}; 
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   176
\draw (3.5,-0.5) node {$q_3$};
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   177
 
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   178
\draw (-0.5, 3.5) node {$q_1$}; 
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   179
\draw (-0.5, 2.5) node {$q_2$}; 
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   180
\draw (-0.5, 1.5) node {$q_3$}; 
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   181
\draw (-0.5, 0.5) node {$q_4$}; 
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   182
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   183
\draw (0.5,0.5) node {\large$\star$}; 
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   184
\draw (1.5,0.5) node {\large$\star$}; 
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   185
\draw (2.5,0.5) node {\large$\star$}; 
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   186
\draw (3.5,0.5) node {\large$\star$};
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   187
\draw (0.5,1.5) node {\large$\star$}; 
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   188
\draw (2.5,1.5) node {\large$\star$}; 
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   189
\draw (0.5,3.5) node {\large$\star$}; 
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   190
\draw (1.5,2.5) node {\large$\star$}; 
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   191
\end{tikzpicture}}
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   192
\end{tabular}
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   193
\end{center}
44
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   194
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   195
147
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   196
\mbox{}\\[-20mm]\mbox{}
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   197
44
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   198
\begin{center}
147
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   199
\begin{tikzpicture}[>=stealth',very thick,auto,
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   200
                             every state/.style={minimum size=0pt,inner sep=2pt,draw=blue!50,very thick,fill=blue!20},]
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   201
\node[state,initial]  (q_02)  {$q_{0, 2}$};
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   202
\node[state] (q_13) [right=of q_02] {$q_{1, 3}$};
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   203
\node[state, accepting] (q_4) [right=of q_13] {$q_{4\phantom{,0}}$};
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   204
\path[->] (q_02) edge [bend left] node [above]  {\alert{$a$}} (q_13);
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   205
\path[->] (q_13) edge [bend left] node [below]  {\alert{$b$}} (q_02);
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   206
\path[->] (q_02) edge [loop below] node  {\alert{$b$}} ();
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   207
\path[->] (q_13) edge node [above]  {\alert{$a$}} (q_4);
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   208
\path[->] (q_4) edge [loop above] node  {\alert{$a, b$}} ();
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   209
\end{tikzpicture}\\
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   210
minimal automaton
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   211
\end{center}
44
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   212
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   213
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   214
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   215
147
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   216
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   217
44
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   218
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   219
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   220
\begin{frame}[c]
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   221
147
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   222
\begin{center}
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   223
\begin{tikzpicture}[>=stealth',very thick,auto,
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   224
                             every state/.style={minimum size=0pt,inner sep=2pt,draw=blue!50,very thick,fill=blue!20},]
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   225
\only<1>{\node[state,initial]  (q_0)  {$q_0$};}
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   226
\only<2->{\node[state,accepting]  (q_0)  {$q_0$};}
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   227
\node[state] (q_1) [right=of q_0] {$q_1$};
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   228
\node[state] (q_2) [below right=of q_0] {$q_2$};
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   229
\node[state] (q_3) [right=of q_2] {$q_3$};
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   230
\only<1>{\node[state, accepting] (q_4) [right=of q_1] {$q_4$};}
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   231
\only<2->{\node[state, initial right] (q_4) [right=of q_1] {$q_4$};}
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   232
\only<1-2>{
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   233
\path[->] (q_0) edge node [above]  {\alert{$a$}} (q_1);
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   234
\path[->] (q_1) edge node [above]  {\alert{$a$}} (q_4);
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   235
\path[->] (q_4) edge [loop above] node  {\alert{$a, b$}} ();
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   236
\path[->] (q_3) edge node [right]  {\alert{$a$}} (q_4);
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   237
\path[->] (q_2) edge node [above]  {\alert{$a$}} (q_3);
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   238
\path[->] (q_1) edge node [right]  {\alert{$b$}} (q_2);
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   239
\path[->] (q_0) edge node [above]  {\alert{$b$}} (q_2);
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   240
\path[->] (q_2) edge [loop left] node  {\alert{$b$}} ();
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   241
\path[->] (q_3) edge [bend left=95, looseness=1.3] node [below]  {\alert{$b$}} (q_0);}
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   242
\only<3->{
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   243
\path[<-] (q_0) edge node [above]  {\alert{$a$}} (q_1);
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   244
\path[<-] (q_1) edge node [above]  {\alert{$a$}} (q_4);
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   245
\path[<-] (q_4) edge [loop above] node  {\alert{$a, b$}} ();
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   246
\path[<-] (q_3) edge node [right]  {\alert{$a$}} (q_4);
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   247
\path[<-] (q_2) edge node [above]  {\alert{$a$}} (q_3);
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   248
\path[<-] (q_1) edge node [right]  {\alert{$b$}} (q_2);
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   249
\path[<-] (q_0) edge node [above]  {\alert{$b$}} (q_2);
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   250
\path[<-] (q_2) edge [loop left] node  {\alert{$b$}} ();
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   251
\path[<-] (q_3) edge [bend left=95, looseness=1.3] node [below]  {\alert{$b$}} (q_0);}
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   252
\end{tikzpicture}
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   253
\end{center}
44
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   254
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   255
\begin{itemize}
147
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   256
\item<2-> exchange initial / accepting states
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   257
\item<3-> reverse all edges
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   258
\item<4-> subset construction $\Rightarrow$ DFA
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   259
\item<5-> repeat once more \onslide<6->{$\Rightarrow$ minimal DFA}
44
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   260
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   261
\end{itemize}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   262
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   263
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   264
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   265
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   266
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   267
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   268
\begin{frame}[c]
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   269
153
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 151
diff changeset
   270
\mbox{\lstinputlisting[language=while]{../progs/fib.while}}
44
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   271
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   272
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   273
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   274
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   275
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   276
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   277
\begin{frame}[c]
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   278
153
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 151
diff changeset
   279
\mbox{\lstinputlisting[language=while]{../progs/collatz.while}}
44
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   280
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   281
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   282
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   283
46
Christian Urban <urbanc@in.tum.de>
parents: 44
diff changeset
   284
148
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   285
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   286
\mode<presentation>{
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   287
\begin{frame}[c]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   288
157
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 153
diff changeset
   289
\mbox{\lstinputlisting[language=while]{../progs/collatz.while}}
148
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   290
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   291
\begin{textblock}{6}(10,2)
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   292
\begin{tikzpicture}[scale=0.46]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   293
\begin{axis}[axis x line=bottom, axis y line=left, ylabel=secs,
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   294
    xlabel=n,
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   295
    enlargelimits=0.05,
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   296
    ybar interval=0.7, legend style=small]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   297
\addplot file {interpreted2.data};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   298
\addplot file {compiled2.data};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   299
%\legend{interpreted, compiled}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   300
\end{axis}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   301
\end{tikzpicture}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   302
\end{textblock}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   303
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   304
\end{frame}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   305
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
150
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   306
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   307
\mode<presentation>{
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   308
\begin{frame}[c]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   309
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   310
\begin{tikzpicture}[scale=1]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   311
  
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   312
  \draw[line width=1mm] (-.3, 0) rectangle (1.5,2);
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   313
  \draw (4.2,1) node {Code Gen};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   314
  \draw (0.6,1.7) node {\footnotesize Parser};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   315
  \draw (-2.7,1.7) node {\footnotesize Lexer};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   316
  
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   317
  \draw[line width=1mm] (-1.8, 0) rectangle (-3.6,2);
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   318
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   319
  \draw[white] (1.7,1) node (X) {};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   320
  \draw[white] (3.2,1) node (Y) {};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   321
  \draw[red, ->, line width = 2mm] (X) -- (Y);
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   322
 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   323
  \draw[red, <-, line width = 2mm] (-0.6,1) -- (-1.6,1);
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   324
  \draw[red, <-, line width = 2mm] (-3.8,1) -- (-4.8,1);
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   325
\end{tikzpicture}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   326
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   327
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   328
\end{frame}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   329
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
148
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   330
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   331
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   332
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   333
\mode<presentation>{
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   334
\begin{frame}[t]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   335
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   336
\consolas
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   337
\begin{center}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   338
"if true then then 42 else +"
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   339
\end{center}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   340
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   341
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   342
\begin{tabular}{@{}l}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   343
KEYWORD: \\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   344
\hspace{5mm}{if}, {then}, {else},\\ 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   345
WHITESPACE:\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   346
\hspace{5mm}{" "}, {$\backslash$n},\\ 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   347
IDENT:\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   348
\hspace{5mm}LETTER $\cdot$ (LETTER + DIGIT + {\_})$^*$\\ 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   349
NUM:\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   350
\hspace{5mm}(NONZERODIGIT $\cdot$ DIGIT$^*$) + {0}\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   351
OP:\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   352
\hspace{5mm}{+}\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   353
COMMENT:\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   354
\hspace{5mm}{$\slash$*} $\cdot$ (ALL$^*$ $\cdot$ {*$\slash$} $\cdot$ ALL$^*$) $\cdot$ {*$\slash$}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   355
\end{tabular}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   356
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   357
\end{frame}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   358
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   359
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   360
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   361
\mode<presentation>{
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   362
\begin{frame}[t]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   363
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   364
\consolas
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   365
\begin{center}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   366
"if true then then 42 else +"
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   367
\end{center}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   368
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   369
\only<1>{
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   370
\small\begin{tabular}{l}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   371
KEYWORD(if),\\ 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   372
WHITESPACE,\\ 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   373
IDENT(true),\\ 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   374
WHITESPACE,\\ 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   375
KEYWORD(then),\\ 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   376
WHITESPACE,\\ 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   377
KEYWORD(then),\\ 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   378
WHITESPACE,\\ 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   379
NUM(42),\\ 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   380
WHITESPACE,\\ 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   381
KEYWORD(else),\\ 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   382
WHITESPACE,\\ 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   383
OP(+)
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   384
\end{tabular}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   385
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   386
\only<2>{
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   387
\small\begin{tabular}{l}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   388
KEYWORD(if),\\ 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   389
IDENT(true),\\ 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   390
KEYWORD(then),\\ 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   391
KEYWORD(then),\\ 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   392
NUM(42),\\ 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   393
KEYWORD(else),\\ 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   394
OP(+)
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   395
\end{tabular}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   396
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   397
\end{frame}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   398
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   399
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   400
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   401
\mode<presentation>{
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   402
\begin{frame}[c]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   403
150
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   404
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   405
There is one small problem with the tokenizer. How should we 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   406
tokenize:
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   407
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   408
\begin{center}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   409
{\consolas "x - 3"}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   410
\end{center}
149
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
   411
150
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   412
\consolas
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   413
\begin{tabular}{@{}l}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   414
OP:\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   415
\hspace{5mm}\texttt{"+"}, \texttt{"-"}\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   416
NUM:\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   417
\hspace{5mm}(NONZERODIGIT $\cdot$ DIGIT$^*$) + {''0''}\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   418
NUMBER:\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   419
\hspace{5mm}NUM +  (\texttt{"-"} $\cdot$ NUM)\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   420
\end{tabular}
149
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
   421
148
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   422
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   423
\end{frame}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   424
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   425
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   426
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   427
\mode<presentation>{
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   428
\begin{frame}[c]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   429
\frametitle{\begin{tabular}{c}Two Rules\end{tabular}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   430
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   431
\begin{itemize}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   432
\item Longest match rule (``maximal munch rule''): The 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   433
longest initial substring matched by any regular expression is taken
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   434
as next token.\bigskip
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   435
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   436
\item Rule priority:
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   437
For a particular longest initial substring, the first regular
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   438
expression that can match determines the token.
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   439
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   440
\end{itemize}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   441
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   442
%\url{http://www.technologyreview.com/tr10/?year=2011}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   443
  
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   444
%finite deterministic automata/ nondeterministic automaton
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   445
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   446
%\item problem with infix operations, for example i-12
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   447
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   448
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   449
\end{frame}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   450
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
149
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
   451
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
   452
\mode<presentation>{
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
   453
\begin{frame}[t]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
   454
\frametitle{\begin{tabular}{c}Nullable\end{tabular}}
46
Christian Urban <urbanc@in.tum.de>
parents: 44
diff changeset
   455
149
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
   456
\small
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
   457
\ldots{}whether a regular expression can match the empty string:
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
   458
\begin{center}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
   459
\begin{tabular}{@ {}l@ {\hspace{2mm}}c@ {\hspace{2mm}}l@ {}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
   460
\bl{$nullable(\varnothing)$}      & \bl{$\dn$} & \bl{$f\!\/alse$}\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
   461
\bl{$nullable(\epsilon)$}           & \bl{$\dn$} &  \bl{$true$}\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
   462
\bl{$nullable (c)$}                    & \bl{$\dn$} &  \bl{$f\!alse$}\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
   463
\bl{$nullable (r_1 + r_2)$}       & \bl{$\dn$} &  \bl{$nullable(r_1) \vee nullable(r_2)$} \\ 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
   464
\bl{$nullable (r_1 \cdot r_2)$} & \bl{$\dn$} &  \bl{$nullable(r_1) \wedge nullable(r_2)$} \\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
   465
\bl{$nullable (r^*)$}                 & \bl{$\dn$} & \bl{$true$} \\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
   466
\end{tabular}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
   467
\end{center}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
   468
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
   469
\end{frame}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
   470
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
   471
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
   472
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
   473
\mode<presentation>{
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
   474
\begin{frame}[c]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
   475
\frametitle{\begin{tabular}{c}Zeroable\end{tabular}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
   476
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
   477
\small
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
   478
\ldots{}whether a regular expression can match nothing:
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
   479
\begin{center}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
   480
\begin{tabular}{@ {}l@ {\hspace{2mm}}c@ {\hspace{2mm}}l@ {}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
   481
\bl{$zeroable(\varnothing)$}      & \bl{$\dn$} & \bl{$true$}\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
   482
\bl{$zeroable(\epsilon)$}           & \bl{$\dn$} &  \bl{$f\!alse$}\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
   483
\bl{$zeroable (c)$}                    & \bl{$\dn$} &  \bl{$f\!alse$}\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
   484
\bl{$zeroable (r_1 + r_2)$}       & \bl{$\dn$} &  \bl{$zeroable(r_1) \wedge zeroable(r_2)$} \\ 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
   485
\bl{$zeroable (r_1 \cdot r_2)$} & \bl{$\dn$} &  \bl{$zeroable(r_1) \vee zeroable(r_2)$} \\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
   486
\bl{$zeroable (r^*)$}                 & \bl{$\dn$} & \bl{$f\!alse$} \\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
   487
\end{tabular}
150
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   488
\end{center}\bigskip\pause
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   489
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   490
\begin{center}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   491
\bl{$zeroable(r) \Leftrightarrow L(r) = \varnothing$}
149
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
   492
\end{center}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
   493
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
   494
\end{frame}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
   495
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
46
Christian Urban <urbanc@in.tum.de>
parents: 44
diff changeset
   496
150
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   497
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   498
\mode<presentation>{
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   499
\begin{frame}[c]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   500
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   501
\begin{itemize}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   502
\item The star-case in our proof about the matcher needs the following lemma
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   503
\begin{center}
151
df229ec49b22 added ho
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 150
diff changeset
   504
\bl{$Der\,c\,A^* = (Der\,c\,A)\,@\, A^*$}
150
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   505
\end{center}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   506
\end{itemize}\bigskip\bigskip
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   507
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   508
\begin{itemize}
151
df229ec49b22 added ho
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 150
diff changeset
   509
\item \bl{$A^* = \{""\} \cup A\,@\,A^*$}
150
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   510
\item If \bl{\texttt{""} $\in A$}, then\\ \bl{$Der\,c\,(A @ B) = (Der\,c\,A) @ B \cup (Der\,c\,B)$}\medskip
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   511
\item If \bl{\texttt{""} $\not\in A$}, then\\ \bl{$Der\,c\,(A @ B) = (Der\,c\,A) @ B$}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   512
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   513
\end{itemize}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   514
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   515
\end{frame}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   516
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   517
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   518
44
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   519
\end{document}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   520
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   521
%%% Local Variables:  
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   522
%%% mode: latex
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   523
%%% TeX-master: t
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   524
%%% End: 
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   525