updated
authorChristian Urban <christian dot urban at kcl dot ac dot uk>
Mon, 03 Oct 2016 00:24:45 +0100
changeset 435 e08431a78f66
parent 434 8664ff87cd77
child 436 9213b8298ca9
updated
handouts/ho02.pdf
progs/app6.scala
progs/app60.scala
slides/slides02.pdf
slides/slides02.tex
Binary file handouts/ho02.pdf has changed
--- a/progs/app6.scala	Sun Oct 02 15:07:21 2016 +0100
+++ b/progs/app6.scala	Mon Oct 03 00:24:45 2016 +0100
@@ -22,6 +22,6 @@
 
 def ders(s: List[Char], r: Rexp) : Rexp = s match {
   case Nil => r
-  case c::s => ders(s, simp(der(c, r))) (*@\label{simpline}@*) 
+  case c::s => ders(s, simp(der(c, r)))             /*@\label{simpline}@*/ 
 }
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/progs/app60.scala	Mon Oct 03 00:24:45 2016 +0100
@@ -0,0 +1,4 @@
+def ders(s: List[Char], r: Rexp) : Rexp = s match {
+  case Nil => r
+  case c::s => ders(s, simp(der(c, r)))          
+}
Binary file slides/slides02.pdf has changed
--- a/slides/slides02.tex	Sun Oct 02 15:07:21 2016 +0100
+++ b/slides/slides02.tex	Mon Oct 03 00:24:45 2016 +0100
@@ -476,6 +476,8 @@
 \item \bl{$(a + a \cdot a)^*$}
 \item \bl{$(a + a?)^*$}
 \end{itemize}
+
+\item sometimes also called \alert{catastrophic backtracking}
 \end{itemize}
 
 \end{frame}
@@ -707,10 +709,10 @@
     ytick={0,5,...,30},
     scaled ticks=false,
     axis lines=left,
-    width=9.5cm,
-    height=7cm, 
+    width=8cm,
+    height=6.5cm, 
     legend entries={Python,Ruby,Scala V1,Scala V2},  
-    legend pos=north west,
+    legend pos=outer north east,
     legend cell align=left  
 ]
 \addplot[blue,mark=*, mark options={fill=white}] table {re-python.data};
@@ -744,6 +746,36 @@
 \end{frame}
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
 
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\begin{frame}[c]
+\frametitle{Simplifiaction}
+
+\begin{center}
+\bl{\begin{tabular}{rcl}
+$r + \ZERO$       & $\Rightarrow$ & $r$\\
+$\ZERO + r$       & $\Rightarrow$ & $r$\\
+$r \cdot \ONE$    & $\Rightarrow$ & $r$\\
+$\ONE \cdot r$    & $\Rightarrow$ & $r$\\
+$r \cdot \ZERO$   & $\Rightarrow$ & $\ZERO$\\
+$\ZERO \cdot r$   & $\Rightarrow$ & $\ZERO$\\
+$r + r$           & $\Rightarrow$ & $r$
+\end{tabular}}
+\end{center}
+
+\footnotesize
+\lstinputlisting{../progs/app60.scala}
+\end{frame}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\begin{frame}[c]
+
+\footnotesize
+\lstinputlisting{../progs/app6.scala}
+
+\end{frame}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
+
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \begin{frame}[t]
@@ -808,6 +840,34 @@
 \end{frame}
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
 
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\begin{frame}[c]
+\frametitle{\bl{$(a^*)^* \cdot b$}}
+
+\begin{center}
+\begin{tikzpicture}
+  \begin{axis}[
+    xlabel={$n$},
+    x label style={at={(1.09,0.0)}},
+    ylabel={time in secs},
+    enlargelimits=false,
+    ytick={0,5,...,20},
+    ymax=25,
+    axis lines=left,
+    width=9cm,
+    height=5cm, 
+    legend entries={Scala V3},
+    legend pos=north west,
+    legend cell align=left]
+\addplot[green,mark=square*,mark options={fill=white}] table {re2a.data};
+\addplot[black,mark=square*,mark options={fill=white}] table {re3a.data};
+\end{axis}
+\end{tikzpicture}
+\end{center}
+
+\end{frame}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
+
 
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%