# HG changeset patch # User Christian Urban # Date 1475450685 -3600 # Node ID e08431a78f668e6eab79967d7301519ddb72643a # Parent 8664ff87cd77583354fa208e12c67d22d470d368 updated diff -r 8664ff87cd77 -r e08431a78f66 handouts/ho02.pdf Binary file handouts/ho02.pdf has changed diff -r 8664ff87cd77 -r e08431a78f66 progs/app6.scala --- 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}@*/ } diff -r 8664ff87cd77 -r e08431a78f66 progs/app60.scala --- /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))) +} diff -r 8664ff87cd77 -r e08431a78f66 slides/slides02.pdf Binary file slides/slides02.pdf has changed diff -r 8664ff87cd77 -r e08431a78f66 slides/slides02.tex --- 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} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%