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