slides04.tex
author Christian Urban <urbanc@in.tum.de>
Mon, 29 Oct 2012 12:31:31 +0000
changeset 49 d2c6852ca8da
parent 41 3a0489b83990
permissions -rw-r--r--
added programs and slides
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}
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     2
\usepackage{beamerthemeplainculight}
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     3
\usepackage[T1]{fontenc}
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 
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    74
\renewcommand{\slidecaption}{AFL 04, King's College London, 17.~October 2012}
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\\
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    94
  Of$\!$fice: & S1.27 (1st floor Strand Building)\\
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
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   103
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   104
\mode<presentation>{
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   105
\begin{frame}[c]
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   106
\frametitle{\begin{tabular}{c}Last Week\end{tabular}}
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   107
35
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   108
Last week I showed you\bigskip
33
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   109
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   110
\begin{itemize}
35
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   111
\item a tokenizer taking a list of regular expressions\bigskip
33
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   112
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   113
\item tokenization identifies lexeme in an input stream of characters (or string)
35
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   114
and cathegorizes  them into tokens
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   115
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   116
\end{itemize}
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   117
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   118
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   119
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
33
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   120
35
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   121
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   122
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   123
\begin{frame}[c]
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   124
\frametitle{\begin{tabular}{c}Two Rules\end{tabular}}
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   125
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   126
\begin{itemize}
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   127
\item Longest match rule (maximal munch rule): The 
34
Christian Urban <urbanc@in.tum.de>
parents: 33
diff changeset
   128
longest initial substring matched by any regular expression is taken
35
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   129
as next token.\bigskip
34
Christian Urban <urbanc@in.tum.de>
parents: 33
diff changeset
   130
Christian Urban <urbanc@in.tum.de>
parents: 33
diff changeset
   131
\item Rule priority:
Christian Urban <urbanc@in.tum.de>
parents: 33
diff changeset
   132
For a particular longest initial substring, the first regular
Christian Urban <urbanc@in.tum.de>
parents: 33
diff changeset
   133
expression that can match determines the token.
Christian Urban <urbanc@in.tum.de>
parents: 33
diff changeset
   134
33
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   135
\end{itemize}
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   136
35
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   137
%\url{http://www.technologyreview.com/tr10/?year=2011}
33
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   138
  
35
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   139
%finite deterministic automata/ nondeterministic automaton
34
Christian Urban <urbanc@in.tum.de>
parents: 33
diff changeset
   140
35
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   141
%\item problem with infix operations, for example i-12
34
Christian Urban <urbanc@in.tum.de>
parents: 33
diff changeset
   142
Christian Urban <urbanc@in.tum.de>
parents: 33
diff changeset
   143
33
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   144
\end{frame}}
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   145
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
36
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   146
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   147
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   148
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   149
\begin{frame}[t]
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   150
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   151
\begin{center}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   152
\texttt{"if true then then 42 else +"}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   153
\end{center}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   154
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   155
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   156
\begin{tabular}{@{}l}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   157
KEYWORD: \\
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   158
\hspace{5mm}\texttt{"if"}, \texttt{"then"}, \texttt{"else"},\\ 
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   159
WHITESPACE:\\
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   160
\hspace{5mm}\texttt{" "}, \texttt{"$\backslash$n"},\\ 
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   161
IDENT:\\
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   162
\hspace{5mm}LETTER $\cdot$ (LETTER + DIGIT + \texttt{"\_"})$^*$\\ 
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   163
NUM:\\
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   164
\hspace{5mm}(NONZERODIGIT $\cdot$ DIGIT$^*$) + \texttt{"0"}\\
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   165
OP:\\
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   166
\hspace{5mm}\texttt{"+"}\\
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   167
COMMENT:\\
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   168
\hspace{5mm}\texttt{"$\slash$*"} $\cdot$ (ALL$^*$ $\cdot$ \texttt{"*$\slash$"} $\cdot$ ALL$^*$) $\cdot$ \texttt{"*$\slash$"}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   169
\end{tabular}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   170
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   171
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   172
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
33
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   173
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   174
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   175
\mode<presentation>{
35
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   176
\begin{frame}[t]
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{center}
35
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   179
\texttt{"if true then then 42 else +"}
33
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   180
\end{center}
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   181
35
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   182
\only<1>{
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   183
\small\begin{tabular}{l}
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   184
KEYWORD(if),\\ 
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   185
WHITESPACE,\\ 
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   186
IDENT(true),\\ 
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   187
WHITESPACE,\\ 
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   188
KEYWORD(then),\\ 
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   189
WHITESPACE,\\ 
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   190
KEYWORD(then),\\ 
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   191
WHITESPACE,\\ 
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   192
NUM(42),\\ 
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   193
WHITESPACE,\\ 
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   194
KEYWORD(else),\\ 
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   195
WHITESPACE,\\ 
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   196
OP(+)
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   197
\end{tabular}}
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   198
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   199
\only<2>{
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   200
\small\begin{tabular}{l}
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   201
KEYWORD(if),\\ 
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   202
IDENT(true),\\ 
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   203
KEYWORD(then),\\ 
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   204
KEYWORD(then),\\ 
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   205
NUM(42),\\ 
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   206
KEYWORD(else),\\ 
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   207
OP(+)
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   208
\end{tabular}}
33
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   209
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   210
\end{frame}}
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   211
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   212
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   213
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   214
\mode<presentation>{
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   215
\begin{frame}[c]
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   216
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   217
35
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   218
There is one small problem with the tokenizer. How should we 
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   219
tokenize:
33
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   220
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   221
\begin{center}
35
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   222
\texttt{"x - 3"}
33
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   223
\end{center}
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   224
36
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   225
\begin{tabular}{@{}l}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   226
OP:\\
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   227
\hspace{5mm}\texttt{"+"}, \texttt{"-"}\\
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   228
NUM:\\
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   229
\hspace{5mm}(NONZERODIGIT $\cdot$ DIGIT$^*$) + \texttt{"0"}\\
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   230
NUMBER:\\
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   231
\hspace{5mm}NUM +  (\texttt{"-"} $\cdot$ NUM)\\
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   232
\end{tabular}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   233
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   234
33
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   235
\end{frame}}
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   236
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   237
38
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   238
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   239
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   240
\begin{frame}[c]
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   241
\frametitle{\begin{tabular}{c}Negation\end{tabular}}
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   242
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   243
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
   244
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
   245
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   246
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   247
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   248
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   249
33
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   250
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   251
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   252
\mode<presentation>{
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   253
\begin{frame}[c]
36
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   254
\frametitle{\begin{tabular}{c}Deterministic Finite Automata\end{tabular}}
35
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   255
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   256
A deterministic finite automaton consists of:
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   257
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   258
\begin{itemize}
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   259
\item a finite set of states
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   260
\item one of these states is the start state
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   261
\item some states are accepting states, and
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   262
\item there is transition function\medskip 
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   263
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   264
\small
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   265
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
   266
this function might not always be defined everywhere
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   267
\end{itemize}
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   268
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   269
\begin{center}
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   270
\bl{$A(Q, q_0, F, \delta)$}
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   271
\end{center}
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   272
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   273
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   274
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   275
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   276
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   277
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   278
\begin{frame}[c]
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   279
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   280
\begin{center}
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   281
\includegraphics[scale=0.7]{pics/ch3.jpg}
36
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   282
\end{center}\pause
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   283
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   284
\begin{itemize}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   285
\item start can be an accepting state
39
Christian Urban <urbanc@in.tum.de>
parents: 38
diff changeset
   286
\item it is possible that there is no accepting state
Christian Urban <urbanc@in.tum.de>
parents: 38
diff changeset
   287
\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
   288
\end{itemize}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   289
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   290
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   291
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   292
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   293
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   294
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   295
\begin{frame}[c]
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   296
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   297
\begin{center}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   298
\includegraphics[scale=0.7]{pics/ch3.jpg}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   299
\end{center}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   300
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   301
for this automaton \bl{$\delta$} is the function\\
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   302
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   303
\begin{center}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   304
\begin{tabular}{lll}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   305
\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
   306
\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
   307
\end{tabular}\ldots
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   308
\end{center}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   309
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   310
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   311
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   312
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   313
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   314
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   315
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   316
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   317
\begin{frame}[t]
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   318
\frametitle{\begin{tabular}{c}Accepting a String\end{tabular}}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   319
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   320
Given
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   321
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   322
\begin{center}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   323
\bl{$A(Q, q_0, F, \delta)$}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   324
\end{center}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   325
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   326
you can define
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   327
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   328
\begin{center}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   329
\begin{tabular}{l}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   330
\bl{$\hat{\delta}(q, \texttt{""}) = q$}\\
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   331
\bl{$\hat{\delta}(q, c::s) = \hat{\delta}(\delta(q, c), s)$}\\
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   332
\end{tabular}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   333
\end{center}\pause
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   334
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   335
Whether a string \bl{$s$} is accepted by \bl{$A$}?
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   336
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   337
\begin{center}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   338
\hspace{5mm}\bl{$\hat{\delta}(q_0, s) \in F$}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   339
\end{center}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   340
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   341
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   342
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   343
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   344
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   345
\begin{frame}[c]
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   346
\frametitle{\begin{tabular}{c}Non-Deterministic\\[-1mm] Finite Automata\end{tabular}}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   347
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   348
A non-deterministic finite automaton consists again of:
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   349
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   350
\begin{itemize}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   351
\item a finite set of states
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   352
\item one of these states is the start state
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   353
\item some states are accepting states, and
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   354
\item there is transition \alert{relation}\medskip 
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   355
\end{itemize}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   356
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   357
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   358
\begin{center}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   359
\begin{tabular}{c}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   360
\bl{(q$_1$, a) $\rightarrow$ q$_2$}\\
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   361
\bl{(q$_1$, a) $\rightarrow$ q$_3$}\\
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   362
\end{tabular}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   363
\hspace{10mm}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   364
\begin{tabular}{c}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   365
\bl{(q$_1$, $\epsilon$) $\rightarrow$ q$_2$}\\
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   366
\end{tabular}
35
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   367
\end{center}
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   368
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   369
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   370
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
33
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   371
35
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   372
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   373
\mode<presentation>{
36
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   374
\begin{frame}[c]
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   375
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   376
\begin{center}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   377
\includegraphics[scale=0.7]{pics/ch5.jpg}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   378
\end{center}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   379
37
Christian Urban <urbanc@in.tum.de>
parents: 36
diff changeset
   380
36
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   381
\end{frame}}
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
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   385
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   386
\begin{frame}[c]
35
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   387
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   388
\begin{center}
36
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   389
\begin{tabular}[b]{ll}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   390
\bl{$\varnothing$} & \includegraphics[scale=0.7]{pics/NULL.jpg}\\\\
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   391
\bl{$\epsilon$} & \includegraphics[scale=0.7]{pics/epsilon.jpg}\\\\
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   392
\bl{c} & \includegraphics[scale=0.7]{pics/char.jpg}\\
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   393
\end{tabular}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   394
\end{center}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   395
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   396
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   397
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   398
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   399
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   400
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   401
\begin{frame}[c]
35
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   402
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   403
\begin{center}
36
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   404
\begin{tabular}[t]{ll}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   405
\bl{r$_1$ $\cdot$ r$_2$} & \includegraphics[scale=0.6]{pics/seq.jpg}\\\\
35
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   406
\end{tabular}
36
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   407
\end{center}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   408
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   409
\end{frame}}
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
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   413
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   414
\begin{frame}[c]
33
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   415
35
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   416
\begin{center}
36
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   417
\begin{tabular}[t]{ll}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   418
\bl{r$_1$ + r$_2$} & \includegraphics[scale=0.7]{pics/alt.jpg}\\\\
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   419
\end{tabular}
35
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   420
\end{center}
36
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   421
35
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   422
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   423
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   424
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   425
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   426
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   427
\begin{frame}[c]
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   428
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   429
\begin{center}
36
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   430
\begin{tabular}[b]{ll}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   431
\bl{r$^*$} & \includegraphics[scale=0.7]{pics/star.jpg}\\
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   432
\end{tabular}
38
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   433
\end{center}\pause\bigskip
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   434
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   435
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
   436
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   437
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   438
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   439
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   440
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   441
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   442
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   443
\begin{frame}[c]
38
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   444
\frametitle{\begin{tabular}{c}Subset Construction\end{tabular}}
36
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   445
38
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   446
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   447
\begin{textblock}{5}(1,2.5)
36
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   448
\includegraphics[scale=0.5]{pics/ch5.jpg}
37
Christian Urban <urbanc@in.tum.de>
parents: 36
diff changeset
   449
\end{textblock}
Christian Urban <urbanc@in.tum.de>
parents: 36
diff changeset
   450
38
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   451
\begin{textblock}{11}(6.5,4.5)
37
Christian Urban <urbanc@in.tum.de>
parents: 36
diff changeset
   452
\begin{tabular}{r|cl}
Christian Urban <urbanc@in.tum.de>
parents: 36
diff changeset
   453
& a & b\\
Christian Urban <urbanc@in.tum.de>
parents: 36
diff changeset
   454
\hline
Christian Urban <urbanc@in.tum.de>
parents: 36
diff changeset
   455
$\varnothing$ \onslide<2>{\textcolor{white}{*}} & $\varnothing$ & $\varnothing$\\
Christian Urban <urbanc@in.tum.de>
parents: 36
diff changeset
   456
$\{0\}$ \onslide<2>{\textcolor{white}{*}} & $\{0,1,2\}$ & $\{2\}$\\
Christian Urban <urbanc@in.tum.de>
parents: 36
diff changeset
   457
$\{1\}$ \onslide<2>{\textcolor{white}{*}} &$\{1\}$ & $\varnothing$\\
Christian Urban <urbanc@in.tum.de>
parents: 36
diff changeset
   458
$\{2\}$ \onslide<2>{*} & $\varnothing$ &$\{2\}$\\
Christian Urban <urbanc@in.tum.de>
parents: 36
diff changeset
   459
$\{0,1\}$ \onslide<2>{\textcolor{white}{*}} &$\{0,1,2\}$ &$\{2\}$\\
Christian Urban <urbanc@in.tum.de>
parents: 36
diff changeset
   460
$\{0,2\}$ \onslide<2>{*}&$\{0,1,2\}$ &$\{2\}$\\
Christian Urban <urbanc@in.tum.de>
parents: 36
diff changeset
   461
$\{1,2\}$ \onslide<2>{*}& $\{1\}$ & $\{2\}$\\
Christian Urban <urbanc@in.tum.de>
parents: 36
diff changeset
   462
\onslide<2>{s:} $\{0,1,2\}$ \onslide<2>{*}&$\{0,1,2\}$ &$\{2\}$\\
Christian Urban <urbanc@in.tum.de>
parents: 36
diff changeset
   463
\end{tabular}
Christian Urban <urbanc@in.tum.de>
parents: 36
diff changeset
   464
\end{textblock}
Christian Urban <urbanc@in.tum.de>
parents: 36
diff changeset
   465
36
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   466
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   467
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   468
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   469
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   470
38
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   471
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   472
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   473
\begin{frame}[c]
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   474
\frametitle{\begin{tabular}{c}Regular Languages\end{tabular}}
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   475
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   476
A language is \alert{regular} iff there exists
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   477
a regular expression that recognises all its strings.\bigskip\medskip
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   478
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   479
or equivalently\bigskip\medskip
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   480
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   481
A language is \alert{regular} iff there exists
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   482
a deterministic finite automaton that recognises all its strings.\bigskip\pause
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   483
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   484
Why is every finite set of strings a regular language?
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   485
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   486
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   487
36
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   488
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   489
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   490
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   491
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   492
\begin{frame}[c]
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   493
Christian Urban <urbanc@in.tum.de>
parents: 35
diff changeset
   494
\begin{center}
38
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   495
\includegraphics[scale=0.5]{pics/ch3.jpg}
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   496
\end{center}
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   497
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   498
\begin{center}
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   499
\includegraphics[scale=0.5]{pics/ch4.jpg}\\
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   500
minimal automaton
35
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   501
\end{center}
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   502
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   503
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   504
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   505
39
Christian Urban <urbanc@in.tum.de>
parents: 38
diff changeset
   506
Christian Urban <urbanc@in.tum.de>
parents: 38
diff changeset
   507
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents: 38
diff changeset
   508
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents: 38
diff changeset
   509
\begin{frame}[c]
Christian Urban <urbanc@in.tum.de>
parents: 38
diff changeset
   510
Christian Urban <urbanc@in.tum.de>
parents: 38
diff changeset
   511
\begin{enumerate}
Christian Urban <urbanc@in.tum.de>
parents: 38
diff changeset
   512
\item Take all pairs \bl{(q, p)} with \bl{q $\not=$ p}
Christian Urban <urbanc@in.tum.de>
parents: 38
diff changeset
   513
\item Mark all pairs that accepting and non-accepting states
Christian Urban <urbanc@in.tum.de>
parents: 38
diff changeset
   514
\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
   515
\begin{center}
Christian Urban <urbanc@in.tum.de>
parents: 38
diff changeset
   516
\bl{($\delta$(q,c), $\delta$(p,c))}
Christian Urban <urbanc@in.tum.de>
parents: 38
diff changeset
   517
\end{center} 
41
Christian Urban <urbanc@in.tum.de>
parents: 40
diff changeset
   518
are marked. If yes, then also mark \bl{(q, p)} 
39
Christian Urban <urbanc@in.tum.de>
parents: 38
diff changeset
   519
\item Repeat last step until no chance.
Christian Urban <urbanc@in.tum.de>
parents: 38
diff changeset
   520
\item All unmarked pairs can be merged.
Christian Urban <urbanc@in.tum.de>
parents: 38
diff changeset
   521
\end{enumerate}
Christian Urban <urbanc@in.tum.de>
parents: 38
diff changeset
   522
Christian Urban <urbanc@in.tum.de>
parents: 38
diff changeset
   523
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents: 38
diff changeset
   524
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents: 38
diff changeset
   525
Christian Urban <urbanc@in.tum.de>
parents: 38
diff changeset
   526
Christian Urban <urbanc@in.tum.de>
parents: 38
diff changeset
   527
38
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   528
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   529
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   530
\begin{frame}[c]
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   531
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   532
Given the function 
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   533
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   534
\begin{center}
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   535
\bl{\begin{tabular}{r@{\hspace{1mm}}c@{\hspace{1mm}}l}
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   536
$rev(\varnothing)$   & $\dn$ & $\varnothing$\\
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   537
$rev(\epsilon)$         & $\dn$ & $\epsilon$\\
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   538
$rev(c)$                      & $\dn$ & $c$\\
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   539
$rev(r_1 + r_2)$        & $\dn$ & $rev(r_1) + rev(r_2)$\\
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   540
$rev(r_1 \cdot r_2)$  & $\dn$ & $rev(r_2) \cdot rev(r_1)$\\
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   541
$rev(r^*)$                   & $\dn$ & $rev(r)^*$\\
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   542
\end{tabular}}
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   543
\end{center}
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   544
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   545
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   546
and the set
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   547
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   548
\begin{center}
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   549
\bl{$Rev\,A \dn \{s^{-1} \;|\; s \in A\}$}
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   550
\end{center}
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   551
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   552
prove whether
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   553
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   554
\begin{center}
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   555
\bl{$L(rev(r)) = Rev (L(r))$}
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   556
\end{center}
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   557
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   558
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   559
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
35
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   560
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   561
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   562
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   563
\begin{frame}[c]
33
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   564
38
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   565
\begin{itemize}
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   566
\item The star-case in our proof about the matcher needs the following lemma
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   567
\begin{center}
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   568
\bl{Der\,c\,A$^*$ $=$ (Der c A)\,@\, A$^*$}
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   569
\end{center}
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   570
\end{itemize}\bigskip\bigskip
33
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   571
38
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   572
\begin{itemize}
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   573
\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
   574
\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
   575
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   576
\end{itemize}
Christian Urban <urbanc@in.tum.de>
parents: 37
diff changeset
   577
33
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   578
\end{frame}}
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   579
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   580
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   581
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   582
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   583
\mode<presentation>{
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   584
\begin{frame}[c]
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   585
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   586
\begin{itemize}
35
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   587
\item Assuming you have the alphabet \bl{\{a, b, c\}}\bigskip
Christian Urban <urbanc@in.tum.de>
parents: 34
diff changeset
   588
\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
   589
\end{itemize}
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   590
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   591
\end{frame}}
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   592
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   593
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   594
40
Christian Urban <urbanc@in.tum.de>
parents: 39
diff changeset
   595
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents: 39
diff changeset
   596
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents: 39
diff changeset
   597
\begin{frame}[c]
Christian Urban <urbanc@in.tum.de>
parents: 39
diff changeset
   598
Christian Urban <urbanc@in.tum.de>
parents: 39
diff changeset
   599
``I hate coding. I do not want to look at code.''
Christian Urban <urbanc@in.tum.de>
parents: 39
diff changeset
   600
Christian Urban <urbanc@in.tum.de>
parents: 39
diff changeset
   601
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents: 39
diff changeset
   602
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents: 39
diff changeset
   603
33
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   604
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   605
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   606
\end{document}
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   607
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   608
%%% Local Variables:  
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   609
%%% mode: latex
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   610
%%% TeX-master: t
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   611
%%% End: 
92b3e287d87e slides 4
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   612