slides/slides02.tex
changeset 121 43c116860e47
parent 120 3e71efb25ce9
child 122 4123344e6915
--- a/slides/slides02.tex	Wed Oct 02 00:10:52 2013 +0100
+++ b/slides/slides02.tex	Wed Oct 02 01:02:50 2013 +0100
@@ -199,6 +199,36 @@
 951 31.96038
 \end{filecontents}
 
+\begin{filecontents}{re3.data}
+1 0.001605
+501 0.131066
+1001 0.057885
+1501 0.136875
+2001 0.176238
+2501 0.254363
+3001 0.37262
+3501 0.500946
+4001 0.638384
+4501 0.816605
+5001 1.00491
+5501 1.232505
+6001 1.525672
+6501 1.757502
+7001 2.092784
+7501 2.429224
+8001 2.803037
+8501 3.463045
+9001 3.609
+9501 4.081504
+10001 4.54569
+10501 6.17789
+11001 6.77242
+11501 7.95864
+\end{filecontents}
+
+
+
+
 \begin{document}
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -857,8 +887,6 @@
 \end{frame}}
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
 
-
-
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \mode<presentation>{
 \begin{frame}[t]
@@ -913,15 +941,87 @@
 \end{frame}}
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
 
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\mode<presentation>{
+\begin{frame}[c]
+\frametitle{\begin{tabular}{c}Examples\end{tabular}}
+
+Recall the example of \bl{$r \dn ((a \cdot b) + b)^*$} with
+
+\begin{center}
+\begin{tabular}{l}
+\bl{$der\,a\,r = ((\epsilon \cdot b) + \varnothing) \cdot r$}\\
+\bl{$der\,b\,r = ((\varnothing \cdot b) + \epsilon)\cdot r$}
+\end{tabular}
+\end{center}
+
+What are these regular expressions equal to?
+
+\end{frame}}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\mode<presentation>{
+\begin{frame}[t]
+\frametitle{\begin{tabular}{c}\bl{$(a?\{n\}) \cdot a\{n\}$}\end{tabular}}
+
+\mbox{}\\[-9mm]
+
+\begin{tabular}{@ {\hspace{-5mm}}l}
+\begin{tikzpicture}[y=.2cm, x=.0008cm]
+ 	%axis
+	\draw (0,0) -- coordinate (x axis mid) (12000,0);
+    	\draw (0,0) -- coordinate (y axis mid) (0,30);
+    	%ticks
+    	\foreach \x in {0,2000,...,12000}
+     		\draw (\x,1pt) -- (\x,-3pt)
+			node[anchor=north] {\x};
+    	\foreach \y in {0,5,...,30}
+     		\draw (1pt,\y) -- (-3pt,\y) 
+     			node[anchor=east] {\y}; 
+	%labels      
+	\node[below=0.6cm] at (x axis mid) {\bl{a}s};
+	\node[rotate=90, left=1.2cm] at (y axis mid) {secs};
+
+	%plots
+	\draw[color=red] plot[mark=triangle*, mark options={fill=white} ] 
+		file {re1.data};
+         \draw[color=green] plot[mark=square*, mark options={fill=white} ] 
+		file {re2b.data};
+	\draw[color=black] plot[mark=square*, mark options={fill=white} ] 
+		file {re3.data};	 
+    
+	%legend
+	\begin{scope}[shift={(2000,20)}] 
+	\draw[color=red] (0,0) -- 
+		plot[mark=triangle*, mark options={fill=white}] (0.25,0) -- (50,0) 
+		node[right]{\small Scala V1};
+	\draw[yshift=13, color=green] (0,0) -- 
+		plot[mark=square*, mark options={fill=white}] (0.25,0) -- (50,0)
+		node[right]{\small Scala V2};	
+	\draw[yshift=26, color=black] (0,0) -- 
+		plot[mark=square*, mark options={fill=white}] (0.25,0) -- (50,0)
+		node[right]{\small Scala V3};	
+	\end{scope}
+\end{tikzpicture}
+\end{tabular}
+
+\end{frame}}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
+
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \mode<presentation>{
 \begin{frame}[c]
 \frametitle{\begin{tabular}{c}Regular Languages\end{tabular}}
 
-A language (set of strings) is \alert{regular} iff there exists
-a regular expression that recognises all its strings.
+A language (a set of strings) is \alert{regular} iff there exists
+a regular expression that recognises all its strings.\bigskip\bigskip\pause
 
+
+Do you think there are languages that are {\bf not} regular?
 \end{frame}}
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
 
@@ -947,20 +1047,6 @@
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
 
 
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\mode<presentation>{
-\begin{frame}[c]
-\frametitle{\begin{tabular}{c}The Rexp Matcher\end{tabular}}
-
-
-{\lstset{language=Scala}\fontsize{8}{10}\selectfont
-\texttt{\lstinputlisting{../progs/app7.scala}}}
-
-
-
-\end{frame}}
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
-
 
 
 \end{document}