slides/slides05.tex
author Christian Urban <christian dot urban at kcl dot ac dot uk>
Tue, 19 Nov 2013 23:44:49 +0000
changeset 197 6622bd256029
parent 169 57df3d7b4a25
child 215 828303e8e4af
permissions -rw-r--r--
added
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
44
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     1
\documentclass[dvipsnames,14pt,t]{beamer}
147
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
     2
\usepackage{beamerthemeplaincu}
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
     3
%\usepackage[T1]{fontenc}
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
     4
%\usepackage[latin1]{inputenc}
44
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     5
\usepackage{mathpartir}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     6
\usepackage[absolute,overlay]{textpos}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     7
\usepackage{ifthen}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     8
\usepackage{tikz}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     9
\usepackage{pgf}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    10
\usepackage{calc} 
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    11
\usepackage{ulem}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    12
\usepackage{courier}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    13
\usepackage{listings}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    14
\renewcommand{\uline}[1]{#1}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    15
\usetikzlibrary{arrows}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    16
\usetikzlibrary{automata}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    17
\usetikzlibrary{shapes}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    18
\usetikzlibrary{shadows}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    19
\usetikzlibrary{positioning}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    20
\usetikzlibrary{calc}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    21
\usepackage{graphicx} 
148
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
    22
\usepackage{pgfplots}
153
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 151
diff changeset
    23
\usepackage{fontspec}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 151
diff changeset
    24
\setmonofont{Consolas}
44
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    25
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    26
\definecolor{javared}{rgb}{0.6,0,0} % for strings
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    27
\definecolor{javagreen}{rgb}{0.25,0.5,0.35} % comments
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    28
\definecolor{javapurple}{rgb}{0.5,0,0.35} % keywords
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    29
\definecolor{javadocblue}{rgb}{0.25,0.35,0.75} % javadoc
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    30
147
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    31
\makeatletter
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    32
\lst@CCPutMacro\lst@ProcessOther {"2D}{\lst@ttfamily{-{}}{-{}}}
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    33
\@empty\z@\@empty
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    34
\makeatother
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    35
44
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    36
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    37
\lstdefinelanguage{scala}{
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    38
  morekeywords={abstract,case,catch,class,def,%
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    39
    do,else,extends,false,final,finally,%
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    40
    for,if,implicit,import,match,mixin,%
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    41
    new,null,object,override,package,%
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    42
    private,protected,requires,return,sealed,%
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    43
    super,this,throw,trait,true,try,%
153
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 151
diff changeset
    44
    type,val,var,while,with,yield},
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 151
diff changeset
    45
  otherkeywords={=>,<-,<\%,<:,>:,\#,@},
44
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    46
  sensitive=true,
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    47
  morecomment=[l]{//},
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    48
  morecomment=[n]{/*}{*/},
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    49
  morestring=[b]",
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    50
  morestring=[b]',
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    51
  morestring=[b]"""
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    52
}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    53
153
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 151
diff changeset
    54
\lstdefinelanguage{while}{
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 151
diff changeset
    55
  morekeywords={while, if, then. else, read, write},
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 151
diff changeset
    56
  otherkeywords={=>,<-,<\%,<:,>:,\#,@},
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 151
diff changeset
    57
  sensitive=true,
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 151
diff changeset
    58
  morecomment=[l]{//},
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 151
diff changeset
    59
  morecomment=[n]{/*}{*/},
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 151
diff changeset
    60
  morestring=[b]",
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 151
diff changeset
    61
  morestring=[b]',
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 151
diff changeset
    62
  morestring=[b]"""
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 151
diff changeset
    63
}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 151
diff changeset
    64
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 151
diff changeset
    65
44
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    66
\lstset{language=Scala,
153
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 151
diff changeset
    67
	basicstyle=\ttfamily,
44
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    68
	keywordstyle=\color{javapurple}\bfseries,
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    69
	stringstyle=\color{javagreen},
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    70
	commentstyle=\color{javagreen},
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    71
	morecomment=[s][\color{javadocblue}]{/**}{*/},
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    72
	numbers=left,
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    73
	numberstyle=\tiny\color{black},
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    74
	stepnumber=1,
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    75
	numbersep=10pt,
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    76
	tabsize=2,
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    77
	showspaces=false,
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    78
	showstringspaces=false}
147
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    79
	
148
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
    80
\begin{filecontents}{interpreted2.data}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
    81
%1 0.00503
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
    82
200 1.005863
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
    83
400 7.8296765
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
    84
600 27.2321885
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
    85
800 65.249271
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
    86
1000 135.4493445
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
    87
1200 232.134097
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
    88
1400 382.527227
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
    89
\end{filecontents}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
    90
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
    91
\begin{filecontents}{compiled2.data}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
    92
200 0.222058
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
    93
400 0.215204
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
    94
600 0.202031
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
    95
800 0.21986
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
    96
1000 0.205934
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
    97
1200 0.1981615
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
    98
1400 0.207116
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
    99
\end{filecontents}
44
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   100
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   101
% beamer stuff 
147
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   102
\renewcommand{\slidecaption}{AFL 05, King's College London, 23.~October 2013}
44
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   103
\newcommand{\bl}[1]{\textcolor{blue}{#1}}       
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   104
\newcommand{\dn}{\stackrel{\mbox{\scriptsize def}}{=}}% for definitions
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   105
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   106
\begin{document}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   107
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   108
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   109
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   110
\begin{frame}<1>[t]
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   111
\frametitle{%
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   112
  \begin{tabular}{@ {}c@ {}}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   113
  \\[-3mm]
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   114
  \LARGE Automata and \\[-2mm] 
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   115
  \LARGE Formal Languages (5)\\[3mm] 
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   116
  \end{tabular}}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   117
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   118
  \normalsize
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   119
  \begin{center}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   120
  \begin{tabular}{ll}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   121
  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
   122
  Office: & S1.27 (1st floor Strand Building)\\
44
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   123
  Slides: & KEATS (also home work is there)\\
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   124
  \end{tabular}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   125
  \end{center}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   126
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   127
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   128
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   129
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   130
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   131
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   132
\mode<presentation>{
147
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   133
\begin{frame}[c]
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   134
\frametitle{DFA Minimisation}
44
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   135
147
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   136
\begin{enumerate}
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   137
\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
   138
\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
   139
\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
   140
\begin{center}
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   141
\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
   142
\end{center} 
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   143
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
   144
\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
   145
\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
   146
\end{enumerate}
44
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   147
147
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   148
\end{frame}}
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   149
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   150
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   151
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   152
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   153
\mode<presentation>{
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   154
\begin{frame}<1-2>[c]
44
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   155
147
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   156
\begin{center}
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   157
\begin{tikzpicture}[>=stealth',very thick,auto,
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   158
                             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
   159
\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
   160
\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
   161
\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
   162
\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
   163
\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
   164
\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
   165
\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
   166
\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
   167
\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
   168
\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
   169
\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
   170
\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
   171
\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
   172
\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
   173
\end{tikzpicture}
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   174
\end{center}
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   175
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   176
\mbox{}\\[-20mm]\mbox{}
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   177
44
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   178
\begin{center}
147
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   179
\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
   180
\draw (0,0) -- (4,0);
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   181
\draw (0,1) -- (4,1);
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   182
\draw (0,2) -- (3,2);
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   183
\draw (0,3) -- (2,3);
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   184
\draw (0,4) -- (1,4);
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   185
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   186
\draw (0,0) -- (0, 4);
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   187
\draw (1,0) -- (1, 4);
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   188
\draw (2,0) -- (2, 3);
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   189
\draw (3,0) -- (3, 2);
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   190
\draw (4,0) -- (4, 1);
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   191
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   192
\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
   193
\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
   194
\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
   195
\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
   196
 
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   197
\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
   198
\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
   199
\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
   200
\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
   201
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   202
\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
   203
\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
   204
\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
   205
\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
   206
\end{tikzpicture}\\
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   207
\end{center}
44
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   208
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   209
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   210
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   211
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   212
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   213
\mode<presentation>{
147
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   214
\begin{frame}<1-2>[c]
44
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
\begin{center}
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   217
\begin{tabular}{@{\hspace{-8mm}}cc@{}}
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   218
\begin{tikzpicture}[>=stealth',very thick,auto,
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   219
                             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
   220
\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
   221
\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
   222
\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
   223
\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
   224
\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
   225
\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
   226
\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
   227
\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
   228
\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
   229
\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
   230
\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
   231
\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
   232
\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
   233
\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
   234
\end{tikzpicture}
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   235
&
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   236
\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
   237
\draw (0,0) -- (4,0);
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   238
\draw (0,1) -- (4,1);
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   239
\draw (0,2) -- (3,2);
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   240
\draw (0,3) -- (2,3);
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   241
\draw (0,4) -- (1,4);
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   242
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   243
\draw (0,0) -- (0, 4);
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   244
\draw (1,0) -- (1, 4);
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   245
\draw (2,0) -- (2, 3);
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   246
\draw (3,0) -- (3, 2);
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   247
\draw (4,0) -- (4, 1);
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   248
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   249
\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
   250
\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
   251
\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
   252
\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
   253
 
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   254
\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
   255
\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
   256
\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
   257
\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
   258
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   259
\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
   260
\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
   261
\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
   262
\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
   263
\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
   264
\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
   265
\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
   266
\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
   267
\end{tikzpicture}}
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   268
\end{tabular}
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   269
\end{center}
44
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   270
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   271
147
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   272
\mbox{}\\[-20mm]\mbox{}
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   273
44
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   274
\begin{center}
147
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   275
\begin{tikzpicture}[>=stealth',very thick,auto,
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   276
                             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
   277
\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
   278
\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
   279
\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
   280
\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
   281
\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
   282
\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
   283
\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
   284
\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
   285
\end{tikzpicture}\\
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   286
minimal automaton
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   287
\end{center}
44
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   288
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   289
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   290
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   291
147
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   292
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   293
44
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   294
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   295
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   296
\begin{frame}[c]
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   297
147
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   298
\begin{center}
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   299
\begin{tikzpicture}[>=stealth',very thick,auto,
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   300
                             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
   301
\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
   302
\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
   303
\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
   304
\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
   305
\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
   306
\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
   307
\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
   308
\only<1-2>{
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   309
\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
   310
\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
   311
\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
   312
\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
   313
\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
   314
\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
   315
\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
   316
\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
   317
\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
   318
\only<3->{
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   319
\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
   320
\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
   321
\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
   322
\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
   323
\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
   324
\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
   325
\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
   326
\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
   327
\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
   328
\end{tikzpicture}
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   329
\end{center}
44
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   330
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   331
\begin{itemize}
147
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   332
\item<2-> exchange initial / accepting states
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   333
\item<3-> reverse all edges
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   334
\item<4-> subset construction $\Rightarrow$ DFA
4725bba8ef26 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   335
\item<5-> repeat once more \onslide<6->{$\Rightarrow$ minimal DFA}
44
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   336
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   337
\end{itemize}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   338
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   339
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   340
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   341
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   342
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   343
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   344
\begin{frame}[c]
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   345
153
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 151
diff changeset
   346
\mbox{\lstinputlisting[language=while]{../progs/fib.while}}
44
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   347
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   348
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   349
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   350
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   351
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   352
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   353
\begin{frame}[c]
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   354
153
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 151
diff changeset
   355
\mbox{\lstinputlisting[language=while]{../progs/collatz.while}}
44
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   356
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   357
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   358
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   359
46
Christian Urban <urbanc@in.tum.de>
parents: 44
diff changeset
   360
148
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   361
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   362
\mode<presentation>{
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   363
\begin{frame}[c]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   364
157
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 153
diff changeset
   365
\mbox{\lstinputlisting[language=while]{../progs/collatz.while}}
148
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   366
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   367
\begin{textblock}{6}(10,2)
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   368
\begin{tikzpicture}[scale=0.46]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   369
\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
   370
    xlabel=n,
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   371
    enlargelimits=0.05,
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   372
    ybar interval=0.7, legend style=small]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   373
\addplot file {interpreted2.data};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   374
\addplot file {compiled2.data};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   375
%\legend{interpreted, compiled}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   376
\end{axis}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   377
\end{tikzpicture}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   378
\end{textblock}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   379
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   380
\end{frame}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   381
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
150
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   382
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   383
\mode<presentation>{
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   384
\begin{frame}[c]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   385
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   386
\begin{tikzpicture}[scale=1]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   387
  
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   388
  \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
   389
  \draw (4.2,1) node {Code Gen};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   390
  \draw (0.6,1.7) node {\footnotesize Parser};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   391
  \draw (-2.7,1.7) node {\footnotesize Lexer};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   392
  
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   393
  \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
   394
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   395
  \draw[white] (1.7,1) node (X) {};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   396
  \draw[white] (3.2,1) node (Y) {};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   397
  \draw[red, ->, line width = 2mm] (X) -- (Y);
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   398
 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   399
  \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
   400
  \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
   401
\end{tikzpicture}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   402
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   403
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   404
\end{frame}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   405
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
148
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   406
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   407
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   408
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   409
\mode<presentation>{
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   410
\begin{frame}[t]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   411
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   412
\consolas
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   413
\begin{center}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   414
"if true then then 42 else +"
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   415
\end{center}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   416
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   417
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   418
\begin{tabular}{@{}l}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   419
KEYWORD: \\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   420
\hspace{5mm}{if}, {then}, {else},\\ 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   421
WHITESPACE:\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   422
\hspace{5mm}{" "}, {$\backslash$n},\\ 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   423
IDENT:\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   424
\hspace{5mm}LETTER $\cdot$ (LETTER + DIGIT + {\_})$^*$\\ 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   425
NUM:\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   426
\hspace{5mm}(NONZERODIGIT $\cdot$ DIGIT$^*$) + {0}\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   427
OP:\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   428
\hspace{5mm}{+}\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   429
COMMENT:\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   430
\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
   431
\end{tabular}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   432
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   433
\end{frame}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   434
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
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
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   437
\mode<presentation>{
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   438
\begin{frame}[t]
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
\consolas
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   441
\begin{center}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   442
"if true then then 42 else +"
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   443
\end{center}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   444
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   445
\only<1>{
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   446
\small\begin{tabular}{l}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   447
KEYWORD(if),\\ 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   448
WHITESPACE,\\ 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   449
IDENT(true),\\ 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   450
WHITESPACE,\\ 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   451
KEYWORD(then),\\ 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   452
WHITESPACE,\\ 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   453
KEYWORD(then),\\ 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   454
WHITESPACE,\\ 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   455
NUM(42),\\ 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   456
WHITESPACE,\\ 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   457
KEYWORD(else),\\ 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   458
WHITESPACE,\\ 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   459
OP(+)
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   460
\end{tabular}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   461
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   462
\only<2>{
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   463
\small\begin{tabular}{l}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   464
KEYWORD(if),\\ 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   465
IDENT(true),\\ 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   466
KEYWORD(then),\\ 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   467
KEYWORD(then),\\ 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   468
NUM(42),\\ 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   469
KEYWORD(else),\\ 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   470
OP(+)
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   471
\end{tabular}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   472
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   473
\end{frame}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   474
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   475
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   476
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   477
\mode<presentation>{
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   478
\begin{frame}[c]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   479
150
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   480
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   481
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
   482
tokenize:
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   483
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   484
\begin{center}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   485
{\consolas "x - 3"}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   486
\end{center}
149
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
   487
150
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   488
\consolas
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   489
\begin{tabular}{@{}l}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   490
OP:\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   491
\hspace{5mm}\texttt{"+"}, \texttt{"-"}\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   492
NUM:\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   493
\hspace{5mm}(NONZERODIGIT $\cdot$ DIGIT$^*$) + {''0''}\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   494
NUMBER:\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   495
\hspace{5mm}NUM +  (\texttt{"-"} $\cdot$ NUM)\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   496
\end{tabular}
149
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
   497
148
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   498
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   499
\end{frame}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   500
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   501
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   502
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   503
\mode<presentation>{
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   504
\begin{frame}[c]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   505
\frametitle{\begin{tabular}{c}Two Rules\end{tabular}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   506
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   507
\begin{itemize}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   508
\item Longest match rule (``maximal munch rule''): The 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   509
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
   510
as next token.\bigskip
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   511
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   512
\item Rule priority:
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   513
For a particular longest initial substring, the first regular
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   514
expression that can match determines the token.
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   515
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   516
\end{itemize}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   517
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   518
%\url{http://www.technologyreview.com/tr10/?year=2011}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   519
  
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   520
%finite deterministic automata/ nondeterministic automaton
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   521
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   522
%\item problem with infix operations, for example i-12
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   523
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   524
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   525
\end{frame}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 147
diff changeset
   526
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
149
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
   527
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
   528
\mode<presentation>{
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
   529
\begin{frame}[t]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
   530
\frametitle{\begin{tabular}{c}Nullable\end{tabular}}
46
Christian Urban <urbanc@in.tum.de>
parents: 44
diff changeset
   531
149
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
   532
\small
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
   533
\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
   534
\begin{center}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
   535
\begin{tabular}{@ {}l@ {\hspace{2mm}}c@ {\hspace{2mm}}l@ {}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
   536
\bl{$nullable(\varnothing)$}      & \bl{$\dn$} & \bl{$f\!\/alse$}\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
   537
\bl{$nullable(\epsilon)$}           & \bl{$\dn$} &  \bl{$true$}\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
   538
\bl{$nullable (c)$}                    & \bl{$\dn$} &  \bl{$f\!alse$}\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
   539
\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
   540
\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
   541
\bl{$nullable (r^*)$}                 & \bl{$\dn$} & \bl{$true$} \\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
   542
\end{tabular}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
   543
\end{center}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
   544
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
   545
\end{frame}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
   546
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
   547
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
   548
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
   549
\mode<presentation>{
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
   550
\begin{frame}[c]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
   551
\frametitle{\begin{tabular}{c}Zeroable\end{tabular}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
   552
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
   553
\small
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
   554
\ldots{}whether a regular expression can match nothing:
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
   555
\begin{center}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
   556
\begin{tabular}{@ {}l@ {\hspace{2mm}}c@ {\hspace{2mm}}l@ {}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
   557
\bl{$zeroable(\varnothing)$}      & \bl{$\dn$} & \bl{$true$}\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
   558
\bl{$zeroable(\epsilon)$}           & \bl{$\dn$} &  \bl{$f\!alse$}\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
   559
\bl{$zeroable (c)$}                    & \bl{$\dn$} &  \bl{$f\!alse$}\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
   560
\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
   561
\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
   562
\bl{$zeroable (r^*)$}                 & \bl{$\dn$} & \bl{$f\!alse$} \\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
   563
\end{tabular}
150
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   564
\end{center}\bigskip\pause
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   565
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   566
\begin{center}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   567
\bl{$zeroable(r) \Leftrightarrow L(r) = \varnothing$}
149
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
   568
\end{center}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
   569
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
   570
\end{frame}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 148
diff changeset
   571
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
46
Christian Urban <urbanc@in.tum.de>
parents: 44
diff changeset
   572
150
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   573
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   574
\mode<presentation>{
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   575
\begin{frame}[c]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   576
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   577
\begin{itemize}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   578
\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
   579
\begin{center}
151
df229ec49b22 added ho
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 150
diff changeset
   580
\bl{$Der\,c\,A^* = (Der\,c\,A)\,@\, A^*$}
150
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   581
\end{center}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   582
\end{itemize}\bigskip\bigskip
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   583
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   584
\begin{itemize}
151
df229ec49b22 added ho
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 150
diff changeset
   585
\item \bl{$A^* = \{""\} \cup A\,@\,A^*$}
150
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   586
\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
   587
\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
   588
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   589
\end{itemize}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   590
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   591
\end{frame}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   592
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   593
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 149
diff changeset
   594
44
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   595
\end{document}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   596
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   597
%%% Local Variables:  
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   598
%%% mode: latex
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   599
%%% TeX-master: t
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   600
%%% End: 
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   601