slides/slides04.tex
author Christian Urban <christian dot urban at kcl dot ac dot uk>
Sat, 12 Oct 2013 23:39:20 +0100
changeset 142 1aa28135a2da
parent 139 6e7c3db9023d
child 144 0cb61bed557d
permissions -rw-r--r--
added
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
33
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     1
\documentclass[dvipsnames,14pt,t]{beamer}
142
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 139
diff changeset
     2
\usepackage{beamerthemeplaincu}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 139
diff changeset
     3
%%%\usepackage[T1]{fontenc}
33
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     4
\usepackage[latin1]{inputenc}
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     5
\usepackage{mathpartir}
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     6
\usepackage[absolute,overlay]{textpos}
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     7
\usepackage{ifthen}
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     8
\usepackage{tikz}
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     9
\usepackage{pgf}
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    10
\usepackage{calc} 
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    11
\usepackage{ulem}
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    12
\usepackage{courier}
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    13
\usepackage{listings}
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    14
\renewcommand{\uline}[1]{#1}
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    15
\usetikzlibrary{arrows}
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    16
\usetikzlibrary{automata}
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    17
\usetikzlibrary{shapes}
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    18
\usetikzlibrary{shadows}
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    19
\usetikzlibrary{positioning}
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    20
\usetikzlibrary{calc}
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    21
\usepackage{graphicx} 
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    22
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    23
\definecolor{javared}{rgb}{0.6,0,0} % for strings
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    24
\definecolor{javagreen}{rgb}{0.25,0.5,0.35} % comments
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    25
\definecolor{javapurple}{rgb}{0.5,0,0.35} % keywords
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    26
\definecolor{javadocblue}{rgb}{0.25,0.35,0.75} % javadoc
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    27
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    28
\lstset{language=Java,
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    29
	basicstyle=\ttfamily,
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    30
	keywordstyle=\color{javapurple}\bfseries,
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    31
	stringstyle=\color{javagreen},
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    32
	commentstyle=\color{javagreen},
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    33
	morecomment=[s][\color{javadocblue}]{/**}{*/},
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    34
	numbers=left,
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    35
	numberstyle=\tiny\color{black},
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    36
	stepnumber=1,
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    37
	numbersep=10pt,
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    38
	tabsize=2,
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    39
	showspaces=false,
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    40
	showstringspaces=false}
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    41
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    42
\lstdefinelanguage{scala}{
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    43
  morekeywords={abstract,case,catch,class,def,%
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    44
    do,else,extends,false,final,finally,%
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    45
    for,if,implicit,import,match,mixin,%
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    46
    new,null,object,override,package,%
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    47
    private,protected,requires,return,sealed,%
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    48
    super,this,throw,trait,true,try,%
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    49
    type,val,var,while,with,yield},
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    50
  otherkeywords={=>,<-,<\%,<:,>:,\#,@},
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    51
  sensitive=true,
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    52
  morecomment=[l]{//},
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    53
  morecomment=[n]{/*}{*/},
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    54
  morestring=[b]",
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    55
  morestring=[b]',
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    56
  morestring=[b]"""
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    57
}
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    58
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    59
\lstset{language=Scala,
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    60
	basicstyle=\ttfamily,
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    61
	keywordstyle=\color{javapurple}\bfseries,
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    62
	stringstyle=\color{javagreen},
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    63
	commentstyle=\color{javagreen},
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    64
	morecomment=[s][\color{javadocblue}]{/**}{*/},
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    65
	numbers=left,
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    66
	numberstyle=\tiny\color{black},
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    67
	stepnumber=1,
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    68
	numbersep=10pt,
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    69
	tabsize=2,
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    70
	showspaces=false,
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    71
	showstringspaces=false}
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    72
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    73
% beamer stuff 
142
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 139
diff changeset
    74
\renewcommand{\slidecaption}{AFL 04, King's College London, 16.~October 2013}
33
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    75
\newcommand{\bl}[1]{\textcolor{blue}{#1}}       
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    76
\newcommand{\dn}{\stackrel{\mbox{\scriptsize def}}{=}}% for definitions
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    77
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    78
\begin{document}
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    79
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    80
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    81
\mode<presentation>{
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    82
\begin{frame}<1>[t]
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    83
\frametitle{%
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    84
  \begin{tabular}{@ {}c@ {}}
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    85
  \\[-3mm]
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    86
  \LARGE Automata and \\[-2mm] 
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    87
  \LARGE Formal Languages (4)\\[3mm] 
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    88
  \end{tabular}}
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    89
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    90
  \normalsize
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    91
  \begin{center}
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    92
  \begin{tabular}{ll}
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    93
  Email:  & christian.urban at kcl.ac.uk\\
142
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 139
diff changeset
    94
  Office: & S1.27 (1st floor Strand Building)\\
33
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    95
  Slides: & KEATS (also home work is there)\\
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    96
  \end{tabular}
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    97
  \end{center}
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    98
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    99
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   100
\end{frame}}
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   101
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   102
139
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   103
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   104
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   105
\mode<presentation>{
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   106
\begin{frame}<1-2>[c]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   107
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   108
\begin{center}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   109
\begin{tikzpicture}[>=stealth',very thick,auto,
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   110
                             every state/.style={minimum size=0pt,inner sep=2pt,draw=blue!50,very thick,fill=blue!20},]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   111
\node[state,initial]  (q_0)  {$q_0$};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   112
\node[state] (q_1) [right=of q_0] {$q_1$};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   113
\node[state] (q_2) [below right=of q_0] {$q_2$};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   114
\node[state] (q_3) [right=of q_2] {$q_3$};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   115
\node[state, accepting] (q_4) [right=of q_1] {$q_4$};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   116
\path[->] (q_0) edge node [above]  {\alert{$a$}} (q_1);
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   117
\path[->] (q_1) edge node [above]  {\alert{$a$}} (q_4);
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   118
\path[->] (q_4) edge [loop right] node  {\alert{$a, b$}} ();
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   119
\path[->] (q_3) edge node [right]  {\alert{$a$}} (q_4);
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   120
\path[->] (q_2) edge node [above]  {\alert{$a$}} (q_3);
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   121
\path[->] (q_1) edge node [right]  {\alert{$b$}} (q_2);
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   122
\path[->] (q_0) edge node [above]  {\alert{$b$}} (q_2);
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   123
\path[->] (q_2) edge [loop left] node  {\alert{$b$}} ();
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   124
\path[->] (q_3) edge [bend left=95, looseness=1.3] node [below]  {\alert{$b$}} (q_0);
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   125
\end{tikzpicture}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   126
\end{center}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   127
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   128
\mbox{}\\[-20mm]\mbox{}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   129
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   130
\begin{center}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   131
\begin{tikzpicture}[>=stealth',very thick,auto,
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   132
                             every state/.style={minimum size=0pt,inner sep=2pt,draw=blue!50,very thick,fill=blue!20},]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   133
\node[state,initial]  (q_02)  {$q_{0, 2}$};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   134
\node[state] (q_13) [right=of q_02] {$q_{1, 3}$};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   135
\node[state, accepting] (q_4) [right=of q_13] {$q_{4\phantom{,0}}$};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   136
\path[->] (q_02) edge [bend left] node [above]  {\alert{$a$}} (q_13);
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   137
\path[->] (q_13) edge [bend left] node [below]  {\alert{$b$}} (q_02);
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   138
\path[->] (q_02) edge [loop below] node  {\alert{$b$}} ();
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   139
\path[->] (q_13) edge node [above]  {\alert{$a$}} (q_4);
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   140
\path[->] (q_4) edge [loop above] node  {\alert{$a, b$}} ();
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   141
\end{tikzpicture}\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   142
minimal automaton
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   143
\end{center}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   144
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   145
\end{frame}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   146
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   147
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   148
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   149
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   150
\mode<presentation>{
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   151
\begin{frame}[c]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   152
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   153
\begin{enumerate}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   154
\item Take all pairs \bl{(q, p)} with \bl{q $\not=$ p}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   155
\item Mark all pairs that are accepting and non-accepting states
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   156
\item For  all unmarked pairs \bl{(q, p)} and all characters \bl{c} tests wether
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   157
\begin{center}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   158
\bl{($\delta$(q,c), $\delta$(p,c))}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   159
\end{center} 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   160
are marked. If yes, then also mark \bl{(q, p)} 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   161
\item Repeat last step until no chance.
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   162
\item All unmarked pairs can be merged.
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   163
\end{enumerate}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   164
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   165
\end{frame}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   166
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   167
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   168
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   169
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
   170
33
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   171
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   172
\mode<presentation>{
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   173
\begin{frame}[c]
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   174
\frametitle{\begin{tabular}{c}Last Week\end{tabular}}
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   175
35
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   176
Last week I showed you\bigskip
33
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   177
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   178
\begin{itemize}
35
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   179
\item a tokenizer taking a list of regular expressions\bigskip
33
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   180
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   181
\item tokenization identifies lexeme in an input stream of characters (or string)
35
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   182
and cathegorizes  them into tokens
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   183
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   184
\end{itemize}
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   185
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   186
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   187
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
33
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   188
35
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   189
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   190
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   191
\begin{frame}[c]
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   192
\frametitle{\begin{tabular}{c}Two Rules\end{tabular}}
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   193
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   194
\begin{itemize}
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   195
\item Longest match rule (maximal munch rule): The 
34
Christian Urban <urbanc@in.tum.de>
parents: 33
diff changeset
   196
longest initial substring matched by any regular expression is taken
35
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   197
as next token.\bigskip
34
Christian Urban <urbanc@in.tum.de>
parents: 33
diff changeset
   198
Christian Urban <urbanc@in.tum.de>
parents: 33
diff changeset
   199
\item Rule priority:
Christian Urban <urbanc@in.tum.de>
parents: 33
diff changeset
   200
For a particular longest initial substring, the first regular
Christian Urban <urbanc@in.tum.de>
parents: 33
diff changeset
   201
expression that can match determines the token.
Christian Urban <urbanc@in.tum.de>
parents: 33
diff changeset
   202
33
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   203
\end{itemize}
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   204
35
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   205
%\url{http://www.technologyreview.com/tr10/?year=2011}
33
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   206
  
35
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   207
%finite deterministic automata/ nondeterministic automaton
34
Christian Urban <urbanc@in.tum.de>
parents: 33
diff changeset
   208
35
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   209
%\item problem with infix operations, for example i-12
34
Christian Urban <urbanc@in.tum.de>
parents: 33
diff changeset
   210
Christian Urban <urbanc@in.tum.de>
parents: 33
diff changeset
   211
33
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   212
\end{frame}}
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   213
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
36
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   214
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   215
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   216
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   217
\begin{frame}[t]
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   218
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   219
\begin{center}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   220
\texttt{"if true then then 42 else +"}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   221
\end{center}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   222
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   223
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   224
\begin{tabular}{@{}l}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   225
KEYWORD: \\
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   226
\hspace{5mm}\texttt{"if"}, \texttt{"then"}, \texttt{"else"},\\ 
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   227
WHITESPACE:\\
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   228
\hspace{5mm}\texttt{" "}, \texttt{"$\backslash$n"},\\ 
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   229
IDENT:\\
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   230
\hspace{5mm}LETTER $\cdot$ (LETTER + DIGIT + \texttt{"\_"})$^*$\\ 
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   231
NUM:\\
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   232
\hspace{5mm}(NONZERODIGIT $\cdot$ DIGIT$^*$) + \texttt{"0"}\\
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   233
OP:\\
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   234
\hspace{5mm}\texttt{"+"}\\
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   235
COMMENT:\\
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   236
\hspace{5mm}\texttt{"$\slash$*"} $\cdot$ (ALL$^*$ $\cdot$ \texttt{"*$\slash$"} $\cdot$ ALL$^*$) $\cdot$ \texttt{"*$\slash$"}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   237
\end{tabular}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   238
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   239
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   240
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
33
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   241
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   242
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   243
\mode<presentation>{
35
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   244
\begin{frame}[t]
33
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   245
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   246
\begin{center}
35
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   247
\texttt{"if true then then 42 else +"}
33
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   248
\end{center}
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   249
35
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   250
\only<1>{
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   251
\small\begin{tabular}{l}
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   252
KEYWORD(if),\\ 
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   253
WHITESPACE,\\ 
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   254
IDENT(true),\\ 
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   255
WHITESPACE,\\ 
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   256
KEYWORD(then),\\ 
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   257
WHITESPACE,\\ 
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   258
KEYWORD(then),\\ 
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   259
WHITESPACE,\\ 
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   260
NUM(42),\\ 
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   261
WHITESPACE,\\ 
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   262
KEYWORD(else),\\ 
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   263
WHITESPACE,\\ 
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   264
OP(+)
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   265
\end{tabular}}
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   266
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   267
\only<2>{
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   268
\small\begin{tabular}{l}
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   269
KEYWORD(if),\\ 
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   270
IDENT(true),\\ 
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   271
KEYWORD(then),\\ 
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   272
KEYWORD(then),\\ 
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   273
NUM(42),\\ 
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   274
KEYWORD(else),\\ 
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   275
OP(+)
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   276
\end{tabular}}
33
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   277
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   278
\end{frame}}
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   279
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   280
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   281
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   282
\mode<presentation>{
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   283
\begin{frame}[c]
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   284
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   285
35
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   286
There is one small problem with the tokenizer. How should we 
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   287
tokenize:
33
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   288
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   289
\begin{center}
35
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   290
\texttt{"x - 3"}
33
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   291
\end{center}
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   292
36
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   293
\begin{tabular}{@{}l}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   294
OP:\\
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   295
\hspace{5mm}\texttt{"+"}, \texttt{"-"}\\
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   296
NUM:\\
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   297
\hspace{5mm}(NONZERODIGIT $\cdot$ DIGIT$^*$) + \texttt{"0"}\\
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   298
NUMBER:\\
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   299
\hspace{5mm}NUM +  (\texttt{"-"} $\cdot$ NUM)\\
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   300
\end{tabular}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   301
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   302
33
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   303
\end{frame}}
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   304
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   305
38
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   306
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   307
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   308
\begin{frame}[c]
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   309
\frametitle{\begin{tabular}{c}Negation\end{tabular}}
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   310
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   311
Assume you have an alphabet consisting of the letters \bl{a}, \bl{b} and \bl{c} only.
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   312
Find a regular expression that matches all strings \emph{except} \bl{ab}, \bl{ac} and \bl{cba}.
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   313
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   314
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   315
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   316
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   317
33
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   318
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   319
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   320
\mode<presentation>{
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   321
\begin{frame}[c]
36
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   322
\frametitle{\begin{tabular}{c}Deterministic Finite Automata\end{tabular}}
35
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   323
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   324
A deterministic finite automaton consists of:
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   325
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   326
\begin{itemize}
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   327
\item a finite set of states
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   328
\item one of these states is the start state
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   329
\item some states are accepting states, and
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   330
\item there is transition function\medskip 
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   331
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   332
\small
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   333
which takes a state and a character as arguments and produces a new state\smallskip\\
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   334
this function might not always be defined everywhere
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   335
\end{itemize}
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   336
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   337
\begin{center}
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   338
\bl{$A(Q, q_0, F, \delta)$}
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   339
\end{center}
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   340
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   341
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   342
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   343
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   344
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   345
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   346
\begin{frame}[c]
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   347
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   348
\begin{center}
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   349
\includegraphics[scale=0.7]{pics/ch3.jpg}
36
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   350
\end{center}\pause
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   351
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   352
\begin{itemize}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   353
\item start can be an accepting state
39
Christian Urban <urbanc@in.tum.de>
parents: 38
diff changeset
   354
\item it is possible that there is no accepting state
Christian Urban <urbanc@in.tum.de>
parents: 38
diff changeset
   355
\item all states might be accepting (but does not necessarily mean all strings are accepted)
36
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   356
\end{itemize}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   357
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   358
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   359
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   360
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   361
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   362
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   363
\begin{frame}[c]
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   364
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   365
\begin{center}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   366
\includegraphics[scale=0.7]{pics/ch3.jpg}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   367
\end{center}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   368
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   369
for this automaton \bl{$\delta$} is the function\\
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   370
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   371
\begin{center}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   372
\begin{tabular}{lll}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   373
\bl{(q$_0$, a) $\rightarrow$ q$_1$} & \bl{(q$_1$, a) $\rightarrow$ q$_4$} & \bl{(q$_4$, a) $\rightarrow$ q$_4$}\\
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   374
\bl{(q$_0$, b) $\rightarrow$ q$_2$} & \bl{(q$_1$, b) $\rightarrow$ q$_2$} & \bl{(q$_4$, b) $\rightarrow$ q$_4$}\\
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   375
\end{tabular}\ldots
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   376
\end{center}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   377
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   378
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   379
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   380
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   381
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   382
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   383
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   384
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   385
\begin{frame}[t]
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   386
\frametitle{\begin{tabular}{c}Accepting a String\end{tabular}}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   387
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   388
Given
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   389
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   390
\begin{center}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   391
\bl{$A(Q, q_0, F, \delta)$}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   392
\end{center}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   393
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   394
you can define
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   395
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   396
\begin{center}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   397
\begin{tabular}{l}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   398
\bl{$\hat{\delta}(q, \texttt{""}) = q$}\\
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   399
\bl{$\hat{\delta}(q, c::s) = \hat{\delta}(\delta(q, c), s)$}\\
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   400
\end{tabular}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   401
\end{center}\pause
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   402
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   403
Whether a string \bl{$s$} is accepted by \bl{$A$}?
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   404
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   405
\begin{center}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   406
\hspace{5mm}\bl{$\hat{\delta}(q_0, s) \in F$}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   407
\end{center}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   408
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   409
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   410
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   411
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   412
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   413
\begin{frame}[c]
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   414
\frametitle{\begin{tabular}{c}Non-Deterministic\\[-1mm] Finite Automata\end{tabular}}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   415
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   416
A non-deterministic finite automaton consists again of:
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   417
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   418
\begin{itemize}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   419
\item a finite set of states
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   420
\item one of these states is the start state
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   421
\item some states are accepting states, and
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   422
\item there is transition \alert{relation}\medskip 
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   423
\end{itemize}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   424
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   425
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   426
\begin{center}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   427
\begin{tabular}{c}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   428
\bl{(q$_1$, a) $\rightarrow$ q$_2$}\\
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   429
\bl{(q$_1$, a) $\rightarrow$ q$_3$}\\
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   430
\end{tabular}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   431
\hspace{10mm}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   432
\begin{tabular}{c}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   433
\bl{(q$_1$, $\epsilon$) $\rightarrow$ q$_2$}\\
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   434
\end{tabular}
35
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   435
\end{center}
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   436
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   437
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   438
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
33
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   439
35
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   440
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   441
\mode<presentation>{
36
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   442
\begin{frame}[c]
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   443
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   444
\begin{center}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   445
\includegraphics[scale=0.7]{pics/ch5.jpg}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   446
\end{center}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   447
37
Christian Urban <urbanc@in.tum.de>
parents: 36
diff changeset
   448
36
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   449
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   450
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   451
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   452
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   453
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   454
\begin{frame}[c]
35
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   455
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   456
\begin{center}
36
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   457
\begin{tabular}[b]{ll}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   458
\bl{$\varnothing$} & \includegraphics[scale=0.7]{pics/NULL.jpg}\\\\
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   459
\bl{$\epsilon$} & \includegraphics[scale=0.7]{pics/epsilon.jpg}\\\\
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   460
\bl{c} & \includegraphics[scale=0.7]{pics/char.jpg}\\
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   461
\end{tabular}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   462
\end{center}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   463
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   464
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   465
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   466
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   467
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   468
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   469
\begin{frame}[c]
35
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   470
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   471
\begin{center}
36
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   472
\begin{tabular}[t]{ll}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   473
\bl{r$_1$ $\cdot$ r$_2$} & \includegraphics[scale=0.6]{pics/seq.jpg}\\\\
35
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   474
\end{tabular}
36
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   475
\end{center}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   476
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   477
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   478
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   479
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   480
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   481
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   482
\begin{frame}[c]
33
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   483
35
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   484
\begin{center}
36
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   485
\begin{tabular}[t]{ll}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   486
\bl{r$_1$ + r$_2$} & \includegraphics[scale=0.7]{pics/alt.jpg}\\\\
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   487
\end{tabular}
35
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   488
\end{center}
36
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   489
35
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   490
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   491
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   492
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   493
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   494
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   495
\begin{frame}[c]
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   496
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   497
\begin{center}
36
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   498
\begin{tabular}[b]{ll}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   499
\bl{r$^*$} & \includegraphics[scale=0.7]{pics/star.jpg}\\
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   500
\end{tabular}
38
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   501
\end{center}\pause\bigskip
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   502
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   503
Why can't we just have an epsilon transition from the accepting states to the starting state?
36
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   504
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   505
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   506
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   507
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   508
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   509
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   510
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   511
\begin{frame}[c]
38
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   512
\frametitle{\begin{tabular}{c}Subset Construction\end{tabular}}
36
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   513
38
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   514
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   515
\begin{textblock}{5}(1,2.5)
36
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   516
\includegraphics[scale=0.5]{pics/ch5.jpg}
37
Christian Urban <urbanc@in.tum.de>
parents: 36
diff changeset
   517
\end{textblock}
Christian Urban <urbanc@in.tum.de>
parents: 36
diff changeset
   518
38
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   519
\begin{textblock}{11}(6.5,4.5)
37
Christian Urban <urbanc@in.tum.de>
parents: 36
diff changeset
   520
\begin{tabular}{r|cl}
Christian Urban <urbanc@in.tum.de>
parents: 36
diff changeset
   521
& a & b\\
Christian Urban <urbanc@in.tum.de>
parents: 36
diff changeset
   522
\hline
Christian Urban <urbanc@in.tum.de>
parents: 36
diff changeset
   523
$\varnothing$ \onslide<2>{\textcolor{white}{*}} & $\varnothing$ & $\varnothing$\\
Christian Urban <urbanc@in.tum.de>
parents: 36
diff changeset
   524
$\{0\}$ \onslide<2>{\textcolor{white}{*}} & $\{0,1,2\}$ & $\{2\}$\\
Christian Urban <urbanc@in.tum.de>
parents: 36
diff changeset
   525
$\{1\}$ \onslide<2>{\textcolor{white}{*}} &$\{1\}$ & $\varnothing$\\
Christian Urban <urbanc@in.tum.de>
parents: 36
diff changeset
   526
$\{2\}$ \onslide<2>{*} & $\varnothing$ &$\{2\}$\\
Christian Urban <urbanc@in.tum.de>
parents: 36
diff changeset
   527
$\{0,1\}$ \onslide<2>{\textcolor{white}{*}} &$\{0,1,2\}$ &$\{2\}$\\
Christian Urban <urbanc@in.tum.de>
parents: 36
diff changeset
   528
$\{0,2\}$ \onslide<2>{*}&$\{0,1,2\}$ &$\{2\}$\\
Christian Urban <urbanc@in.tum.de>
parents: 36
diff changeset
   529
$\{1,2\}$ \onslide<2>{*}& $\{1\}$ & $\{2\}$\\
Christian Urban <urbanc@in.tum.de>
parents: 36
diff changeset
   530
\onslide<2>{s:} $\{0,1,2\}$ \onslide<2>{*}&$\{0,1,2\}$ &$\{2\}$\\
Christian Urban <urbanc@in.tum.de>
parents: 36
diff changeset
   531
\end{tabular}
Christian Urban <urbanc@in.tum.de>
parents: 36
diff changeset
   532
\end{textblock}
Christian Urban <urbanc@in.tum.de>
parents: 36
diff changeset
   533
36
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   534
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   535
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   536
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   537
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   538
38
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   539
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   540
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   541
\begin{frame}[c]
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   542
\frametitle{\begin{tabular}{c}Regular Languages\end{tabular}}
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   543
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   544
A language is \alert{regular} iff there exists
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   545
a regular expression that recognises all its strings.\bigskip\medskip
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   546
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   547
or equivalently\bigskip\medskip
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   548
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   549
A language is \alert{regular} iff there exists
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   550
a deterministic finite automaton that recognises all its strings.\bigskip\pause
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   551
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   552
Why is every finite set of strings a regular language?
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   553
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   554
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   555
36
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   556
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   557
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   558
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   559
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   560
\begin{frame}[c]
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   561
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   562
\begin{center}
38
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   563
\includegraphics[scale=0.5]{pics/ch3.jpg}
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   564
\end{center}
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   565
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   566
\begin{center}
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   567
\includegraphics[scale=0.5]{pics/ch4.jpg}\\
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   568
minimal automaton
35
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   569
\end{center}
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   570
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   571
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   572
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   573
39
Christian Urban <urbanc@in.tum.de>
parents: 38
diff changeset
   574
Christian Urban <urbanc@in.tum.de>
parents: 38
diff changeset
   575
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents: 38
diff changeset
   576
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents: 38
diff changeset
   577
\begin{frame}[c]
Christian Urban <urbanc@in.tum.de>
parents: 38
diff changeset
   578
Christian Urban <urbanc@in.tum.de>
parents: 38
diff changeset
   579
\begin{enumerate}
Christian Urban <urbanc@in.tum.de>
parents: 38
diff changeset
   580
\item Take all pairs \bl{(q, p)} with \bl{q $\not=$ p}
Christian Urban <urbanc@in.tum.de>
parents: 38
diff changeset
   581
\item Mark all pairs that accepting and non-accepting states
Christian Urban <urbanc@in.tum.de>
parents: 38
diff changeset
   582
\item For  all unmarked pairs \bl{(q, p)} and all characters \bl{c} tests wether
Christian Urban <urbanc@in.tum.de>
parents: 38
diff changeset
   583
\begin{center}
Christian Urban <urbanc@in.tum.de>
parents: 38
diff changeset
   584
\bl{($\delta$(q,c), $\delta$(p,c))}
Christian Urban <urbanc@in.tum.de>
parents: 38
diff changeset
   585
\end{center} 
41
Christian Urban <urbanc@in.tum.de>
parents: 40
diff changeset
   586
are marked. If yes, then also mark \bl{(q, p)} 
39
Christian Urban <urbanc@in.tum.de>
parents: 38
diff changeset
   587
\item Repeat last step until no chance.
Christian Urban <urbanc@in.tum.de>
parents: 38
diff changeset
   588
\item All unmarked pairs can be merged.
Christian Urban <urbanc@in.tum.de>
parents: 38
diff changeset
   589
\end{enumerate}
Christian Urban <urbanc@in.tum.de>
parents: 38
diff changeset
   590
Christian Urban <urbanc@in.tum.de>
parents: 38
diff changeset
   591
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents: 38
diff changeset
   592
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents: 38
diff changeset
   593
Christian Urban <urbanc@in.tum.de>
parents: 38
diff changeset
   594
Christian Urban <urbanc@in.tum.de>
parents: 38
diff changeset
   595
38
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   596
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   597
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   598
\begin{frame}[c]
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   599
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   600
Given the function 
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   601
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   602
\begin{center}
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   603
\bl{\begin{tabular}{r@{\hspace{1mm}}c@{\hspace{1mm}}l}
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   604
$rev(\varnothing)$   & $\dn$ & $\varnothing$\\
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   605
$rev(\epsilon)$         & $\dn$ & $\epsilon$\\
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   606
$rev(c)$                      & $\dn$ & $c$\\
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   607
$rev(r_1 + r_2)$        & $\dn$ & $rev(r_1) + rev(r_2)$\\
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   608
$rev(r_1 \cdot r_2)$  & $\dn$ & $rev(r_2) \cdot rev(r_1)$\\
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   609
$rev(r^*)$                   & $\dn$ & $rev(r)^*$\\
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   610
\end{tabular}}
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   611
\end{center}
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   612
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   613
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   614
and the set
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   615
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   616
\begin{center}
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   617
\bl{$Rev\,A \dn \{s^{-1} \;|\; s \in A\}$}
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   618
\end{center}
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   619
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   620
prove whether
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   621
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   622
\begin{center}
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   623
\bl{$L(rev(r)) = Rev (L(r))$}
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   624
\end{center}
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   625
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   626
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   627
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
35
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   628
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   629
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   630
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   631
\begin{frame}[c]
33
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   632
38
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   633
\begin{itemize}
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   634
\item The star-case in our proof about the matcher needs the following lemma
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   635
\begin{center}
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   636
\bl{Der\,c\,A$^*$ $=$ (Der c A)\,@\, A$^*$}
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   637
\end{center}
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   638
\end{itemize}\bigskip\bigskip
33
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   639
38
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   640
\begin{itemize}
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   641
\item If \bl{\texttt{""} $\in$ A}, then\\ \bl{Der\,c\,(A @ B) $=$ (Der\,c\,A) @ B $\cup$ (Der\,c\,B)}\medskip
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   642
\item If \bl{\texttt{""} $\not\in$ A}, then\\ \bl{Der\,c\,(A @ B) $=$ (Der\,c\,A) @ B}
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   643
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   644
\end{itemize}
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   645
33
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   646
\end{frame}}
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   647
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   648
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   649
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   650
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   651
\mode<presentation>{
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   652
\begin{frame}[c]
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   653
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   654
\begin{itemize}
35
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   655
\item Assuming you have the alphabet \bl{\{a, b, c\}}\bigskip
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   656
\item Give a regular expression that can recognise all strings that have at least one \bl{b}.
33
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   657
\end{itemize}
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   658
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   659
\end{frame}}
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   660
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   661
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   662
40
Christian Urban <urbanc@in.tum.de>
parents: 39
diff changeset
   663
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents: 39
diff changeset
   664
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents: 39
diff changeset
   665
\begin{frame}[c]
Christian Urban <urbanc@in.tum.de>
parents: 39
diff changeset
   666
Christian Urban <urbanc@in.tum.de>
parents: 39
diff changeset
   667
``I hate coding. I do not want to look at code.''
Christian Urban <urbanc@in.tum.de>
parents: 39
diff changeset
   668
Christian Urban <urbanc@in.tum.de>
parents: 39
diff changeset
   669
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents: 39
diff changeset
   670
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents: 39
diff changeset
   671
33
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   672
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   673
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   674
\end{document}
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   675
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   676
%%% Local Variables:  
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   677
%%% mode: latex
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   678
%%% TeX-master: t
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   679
%%% End: 
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   680