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