author | Christian Urban <christian dot urban at kcl dot ac dot uk> |
Tue, 22 Oct 2013 23:17:53 +0100 | |
changeset 147 | 4725bba8ef26 |
parent 93 | 4794759139ea |
child 148 | 36eb7bfb0e63 |
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} |
|
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 |
||
147
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
28 |
\makeatletter |
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
29 |
\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
|
30 |
\@empty\z@\@empty |
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
31 |
\makeatother |
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
32 |
|
44 | 33 |
\lstset{language=Java, |
147
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
34 |
basicstyle=\consolas, |
44 | 35 |
keywordstyle=\color{javapurple}\bfseries, |
36 |
stringstyle=\color{javagreen}, |
|
37 |
commentstyle=\color{javagreen}, |
|
38 |
morecomment=[s][\color{javadocblue}]{/**}{*/}, |
|
39 |
numbers=left, |
|
40 |
numberstyle=\tiny\color{black}, |
|
41 |
stepnumber=1, |
|
42 |
numbersep=10pt, |
|
43 |
tabsize=2, |
|
44 |
showspaces=false, |
|
45 |
showstringspaces=false} |
|
46 |
||
47 |
\lstdefinelanguage{scala}{ |
|
48 |
morekeywords={abstract,case,catch,class,def,% |
|
49 |
do,else,extends,false,final,finally,% |
|
50 |
for,if,implicit,import,match,mixin,% |
|
51 |
new,null,object,override,package,% |
|
52 |
private,protected,requires,return,sealed,% |
|
53 |
super,this,throw,trait,true,try,% |
|
147
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
54 |
type,val,var,while,with,yield, then}, |
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
55 |
otherkeywords={=>,<-,<\%,<:,>:,\#,@,->}, |
44 | 56 |
sensitive=true, |
57 |
morecomment=[l]{//}, |
|
58 |
morecomment=[n]{/*}{*/}, |
|
59 |
morestring=[b]", |
|
60 |
morestring=[b]', |
|
61 |
morestring=[b]""" |
|
62 |
} |
|
63 |
||
64 |
\lstset{language=Scala, |
|
147
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
65 |
basicstyle=\consolas, |
44 | 66 |
keywordstyle=\color{javapurple}\bfseries, |
67 |
stringstyle=\color{javagreen}, |
|
68 |
commentstyle=\color{javagreen}, |
|
69 |
morecomment=[s][\color{javadocblue}]{/**}{*/}, |
|
70 |
numbers=left, |
|
71 |
numberstyle=\tiny\color{black}, |
|
72 |
stepnumber=1, |
|
73 |
numbersep=10pt, |
|
74 |
tabsize=2, |
|
75 |
showspaces=false, |
|
76 |
showstringspaces=false} |
|
147
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
77 |
|
44 | 78 |
|
79 |
% beamer stuff |
|
147
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
80 |
\renewcommand{\slidecaption}{AFL 05, King's College London, 23.~October 2013} |
44 | 81 |
\newcommand{\bl}[1]{\textcolor{blue}{#1}} |
82 |
\newcommand{\dn}{\stackrel{\mbox{\scriptsize def}}{=}}% for definitions |
|
83 |
||
84 |
\begin{document} |
|
85 |
||
86 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
87 |
\mode<presentation>{ |
|
88 |
\begin{frame}<1>[t] |
|
89 |
\frametitle{% |
|
90 |
\begin{tabular}{@ {}c@ {}} |
|
91 |
\\[-3mm] |
|
92 |
\LARGE Automata and \\[-2mm] |
|
93 |
\LARGE Formal Languages (5)\\[3mm] |
|
94 |
\end{tabular}} |
|
95 |
||
96 |
\normalsize |
|
97 |
\begin{center} |
|
98 |
\begin{tabular}{ll} |
|
99 |
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
|
100 |
Office: & S1.27 (1st floor Strand Building)\\ |
44 | 101 |
Slides: & KEATS (also home work is there)\\ |
102 |
\end{tabular} |
|
103 |
\end{center} |
|
104 |
||
105 |
||
106 |
\end{frame}} |
|
107 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
108 |
||
109 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
110 |
\mode<presentation>{ |
|
147
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
111 |
\begin{frame}[c] |
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
112 |
\frametitle{DFA Minimisation} |
44 | 113 |
|
147
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
114 |
\begin{enumerate} |
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
115 |
\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
|
116 |
\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
|
117 |
\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
|
118 |
\begin{center} |
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
119 |
\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
|
120 |
\end{center} |
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
121 |
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
|
122 |
\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
|
123 |
\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
|
124 |
\end{enumerate} |
44 | 125 |
|
147
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
126 |
\end{frame}} |
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
127 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
128 |
|
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
129 |
|
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
130 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
131 |
\mode<presentation>{ |
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
132 |
\begin{frame}<1-2>[c] |
44 | 133 |
|
147
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
134 |
\begin{center} |
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
135 |
\begin{tikzpicture}[>=stealth',very thick,auto, |
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
136 |
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
|
137 |
\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
|
138 |
\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
|
139 |
\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
|
140 |
\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
|
141 |
\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
|
142 |
\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
|
143 |
\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
|
144 |
\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
|
145 |
\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
|
146 |
\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
|
147 |
\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
|
148 |
\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
|
149 |
\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
|
150 |
\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
|
151 |
\end{tikzpicture} |
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
152 |
\end{center} |
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
153 |
|
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
154 |
\mbox{}\\[-20mm]\mbox{} |
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
155 |
|
44 | 156 |
\begin{center} |
147
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
157 |
\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
|
158 |
\draw (0,0) -- (4,0); |
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
159 |
\draw (0,1) -- (4,1); |
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
160 |
\draw (0,2) -- (3,2); |
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
161 |
\draw (0,3) -- (2,3); |
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
162 |
\draw (0,4) -- (1,4); |
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
163 |
|
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
164 |
\draw (0,0) -- (0, 4); |
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
165 |
\draw (1,0) -- (1, 4); |
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
166 |
\draw (2,0) -- (2, 3); |
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
167 |
\draw (3,0) -- (3, 2); |
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
168 |
\draw (4,0) -- (4, 1); |
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
169 |
|
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
170 |
\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
|
171 |
\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
|
172 |
\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
|
173 |
\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
|
174 |
|
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
175 |
\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
|
176 |
\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
|
177 |
\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
|
178 |
\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
|
179 |
|
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
180 |
\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
|
181 |
\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
|
182 |
\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
|
183 |
\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
|
184 |
\end{tikzpicture}\\ |
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
185 |
\end{center} |
44 | 186 |
|
187 |
\end{frame}} |
|
188 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
189 |
||
190 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
191 |
\mode<presentation>{ |
|
147
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
192 |
\begin{frame}<1-2>[c] |
44 | 193 |
|
147
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
194 |
\begin{center} |
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
195 |
\begin{tabular}{@{\hspace{-8mm}}cc@{}} |
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
196 |
\begin{tikzpicture}[>=stealth',very thick,auto, |
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
197 |
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
|
198 |
\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
|
199 |
\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
|
200 |
\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
|
201 |
\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
|
202 |
\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
|
203 |
\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
|
204 |
\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
|
205 |
\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
|
206 |
\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
|
207 |
\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
|
208 |
\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
|
209 |
\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
|
210 |
\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
|
211 |
\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
|
212 |
\end{tikzpicture} |
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
213 |
& |
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
214 |
\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
|
215 |
\draw (0,0) -- (4,0); |
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
216 |
\draw (0,1) -- (4,1); |
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
217 |
\draw (0,2) -- (3,2); |
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
218 |
\draw (0,3) -- (2,3); |
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
219 |
\draw (0,4) -- (1,4); |
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
220 |
|
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
221 |
\draw (0,0) -- (0, 4); |
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
222 |
\draw (1,0) -- (1, 4); |
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
223 |
\draw (2,0) -- (2, 3); |
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
224 |
\draw (3,0) -- (3, 2); |
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
225 |
\draw (4,0) -- (4, 1); |
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
226 |
|
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
227 |
\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
|
228 |
\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
|
229 |
\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
|
230 |
\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
|
231 |
|
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
232 |
\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
|
233 |
\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
|
234 |
\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
|
235 |
\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
|
236 |
|
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
237 |
\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
|
238 |
\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
|
239 |
\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
|
240 |
\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
|
241 |
\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
|
242 |
\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
|
243 |
\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
|
244 |
\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
|
245 |
\end{tikzpicture}} |
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
246 |
\end{tabular} |
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
247 |
\end{center} |
44 | 248 |
|
249 |
||
147
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
250 |
\mbox{}\\[-20mm]\mbox{} |
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
251 |
|
44 | 252 |
\begin{center} |
147
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
253 |
\begin{tikzpicture}[>=stealth',very thick,auto, |
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
254 |
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
|
255 |
\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
|
256 |
\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
|
257 |
\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
|
258 |
\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
|
259 |
\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
|
260 |
\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
|
261 |
\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
|
262 |
\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
|
263 |
\end{tikzpicture}\\ |
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
264 |
minimal automaton |
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
265 |
\end{center} |
44 | 266 |
|
267 |
\end{frame}} |
|
268 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
269 |
||
147
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
270 |
|
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
271 |
|
44 | 272 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
273 |
\mode<presentation>{ |
|
274 |
\begin{frame}[c] |
|
275 |
||
147
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
276 |
\begin{center} |
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
277 |
\begin{tikzpicture}[>=stealth',very thick,auto, |
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
278 |
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
|
279 |
\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
|
280 |
\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
|
281 |
\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
|
282 |
\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
|
283 |
\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
|
284 |
\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
|
285 |
\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
|
286 |
\only<1-2>{ |
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
287 |
\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
|
288 |
\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
|
289 |
\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
|
290 |
\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
|
291 |
\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
|
292 |
\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
|
293 |
\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
|
294 |
\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
|
295 |
\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
|
296 |
\only<3->{ |
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
297 |
\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
|
298 |
\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
|
299 |
\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
|
300 |
\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
|
301 |
\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
|
302 |
\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
|
303 |
\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
|
304 |
\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
|
305 |
\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
|
306 |
\end{tikzpicture} |
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
307 |
\end{center} |
44 | 308 |
|
309 |
\begin{itemize} |
|
147
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
310 |
\item<2-> exchange initial / accepting states |
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
311 |
\item<3-> reverse all edges |
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
312 |
\item<4-> subset construction $\Rightarrow$ DFA |
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
313 |
\item<5-> repeat once more \onslide<6->{$\Rightarrow$ minimal DFA} |
44 | 314 |
|
315 |
\end{itemize} |
|
316 |
||
317 |
\end{frame}} |
|
318 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
319 |
||
320 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
321 |
\mode<presentation>{ |
|
322 |
\begin{frame}[c] |
|
323 |
||
147
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
324 |
\texttt{\consolas\lstinputlisting{../progs/fib.while}} |
44 | 325 |
|
326 |
\end{frame}} |
|
327 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
328 |
||
329 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
330 |
\mode<presentation>{ |
|
331 |
\begin{frame}[c] |
|
332 |
||
147
4725bba8ef26
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
333 |
\texttt{\consolas\lstinputlisting{../progs/collatz.while}} |
44 | 334 |
|
335 |
\end{frame}} |
|
336 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
337 |
||
46 | 338 |
|
339 |
||
340 |
||
47 | 341 |
\newcommand{\qq}{\mbox{\texttt{"}}} |
342 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
343 |
\mode<presentation>{ |
|
344 |
\begin{frame}[c] |
|
345 |
\frametitle{\begin{tabular}{c}Grammars\end{tabular}} |
|
346 |
||
347 |
\begin{center} |
|
348 |
\bl{\begin{tabular}{lcl} |
|
349 |
$E$ & $\rightarrow$ & $F + (F \cdot \qq*\qq \cdot F) + (F \cdot \qq\backslash\qq \cdot F)$\\ |
|
350 |
$F$ & $\rightarrow$ & $T + (T \cdot \qq\texttt{+}\qq \cdot T) + (T \cdot \qq\texttt{-}\qq \cdot T)$\\ |
|
351 |
$T$ & $\rightarrow$ & $num + (\qq\texttt{(}\qq \cdot E \cdot \qq\texttt{)}\qq)$\\ |
|
352 |
\end{tabular}} |
|
353 |
\end{center} |
|
354 |
||
355 |
\bl{$E$}, \bl{$F$} and \bl{$T$} are non-terminals\\ |
|
356 |
\bl{$E$} is start symbol\\ |
|
357 |
\bl{$num$}, \bl{(}, \bl{)}, \bl{+} \ldots are terminals\bigskip\\ |
|
358 |
||
359 |
||
360 |
\bl{\texttt{(2*3)+(3+4)}} |
|
361 |
||
362 |
\end{frame}} |
|
363 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
364 |
||
365 |
||
366 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
367 |
\mode<presentation>{ |
|
368 |
\begin{frame}[c] |
|
369 |
||
370 |
\begin{center} |
|
371 |
\bl{\begin{tabular}{lcl} |
|
372 |
$E$ & $\rightarrow$ & $F + (F \cdot \qq*\qq \cdot F) + (F \cdot \qq\backslash\qq \cdot F)$\\ |
|
373 |
$F$ & $\rightarrow$ & $T + (T \cdot \qq\texttt{+}\qq \cdot T) + (T \cdot \qq\texttt{-}\qq \cdot T)$\\ |
|
374 |
$T$ & $\rightarrow$ & $num + (\qq\texttt{(}\qq \cdot E \cdot \qq\texttt{)}\qq)$\\ |
|
375 |
\end{tabular}} |
|
376 |
\end{center} |
|
377 |
||
378 |
\begin{center} |
|
379 |
\begin{tikzpicture}[level distance=8mm, blue] |
|
380 |
\node {E} |
|
381 |
child {node {F} |
|
382 |
child {node {T} |
|
383 |
child {node {\qq(\qq\,E\,\qq)\qq} |
|
384 |
child {node{F \qq*\qq{} F} |
|
385 |
child {node {T} child {node {2}}} |
|
386 |
child {node {T} child {node {3}}} |
|
387 |
} |
|
388 |
} |
|
389 |
} |
|
390 |
child {node {\qq+\qq}} |
|
391 |
child {node {T} |
|
392 |
child {node {\qq(\qq\,E\,\qq)\qq} |
|
393 |
child {node {F} |
|
394 |
child {node {T \qq+\qq{} T} |
|
395 |
child {node {3}} |
|
396 |
child {node {4}} |
|
397 |
} |
|
398 |
}} |
|
399 |
}}; |
|
400 |
\end{tikzpicture} |
|
401 |
\end{center} |
|
402 |
||
403 |
\begin{textblock}{5}(1, 5) |
|
404 |
\bl{\texttt{(2*3)+(3+4)}} |
|
405 |
\end{textblock} |
|
406 |
||
407 |
\end{frame}} |
|
408 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
44 | 409 |
|
410 |
\end{document} |
|
411 |
||
412 |
%%% Local Variables: |
|
413 |
%%% mode: latex |
|
414 |
%%% TeX-master: t |
|
415 |
%%% End: |
|
416 |