# HG changeset patch # User Chengsong # Date 1654527437 -3600 # Node ID ce91c29d2885011e0f03ba64f9b6ecb46a00a1b3 # Parent d4359c94bead50814f9624c870e70dfee9e42c2a fixed plotting error 6.1 diff -r d4359c94bead -r ce91c29d2885 ChengsongTanPhdThesis/Chapters/Cubic.tex --- a/ChengsongTanPhdThesis/Chapters/Cubic.tex Mon Jun 06 03:06:32 2022 +0100 +++ b/ChengsongTanPhdThesis/Chapters/Cubic.tex Mon Jun 06 15:57:17 2022 +0100 @@ -183,6 +183,7 @@ that have "language duplicates", but only eliminate the "exact duplicates". For this we need to break up terms $(a+b)\cdot c$ into two terms $a\cdot c$ and $b\cdot c$ before we add them to the accumulator: +\begin{figure} \begin{verbatim} def distinctWith(rs: List[ARexp], pruneFunction: (ARexp, Set[Rexp]) => ARexp, @@ -202,8 +203,11 @@ } } \end{verbatim} +\caption{A Stronger Version of $\textit{distinctBy}$} +\end{figure} \noindent This process is done by the function $\textit{turnIntoTerms}$: +\begin{figure} \begin{verbatim} def turnIntoTerms(r: Rexp): List[Rexp] = r match { case SEQ(r1, r2) => if(isOne(r1)) @@ -215,8 +219,12 @@ case _ => r :: Nil } \end{verbatim} +\caption{function that breaks up regular expression into "atomic" terms} +\end{figure} + \noindent The pruning function can be defined recursively: +\begin{figure} \begin{verbatim} def prune7(r: ARexp, acc: Set[Rexp]) : ARexp = r match{ case AALTS(bs, rs) => rs.map(r => prune7(r, acc)).filter(_ != ZERO) match @@ -233,52 +241,49 @@ case r => if(acc(erase(r))) AZERO else r } \end{verbatim} +\caption{pruning function} +\end{figure} + + +\pgfplotsset{ + myplotstyle/.style={ + legend style={draw=none, font=\small}, + legend cell align=left, + legend pos=north east, + ylabel style={align=center, font=\bfseries\boldmath}, + xlabel style={align=center, font=\bfseries\boldmath}, + x tick label style={font=\bfseries\boldmath}, + y tick label style={font=\bfseries\boldmath}, + scaled ticks=true, + every axis plot/.append style={thick}, + }, +} \begin{figure} \centering \begin{tabular}{@{}c@{\hspace{0mm}}c@{\hspace{0mm}}c@{}} \begin{tikzpicture} \begin{axis}[ - xlabel={$n$}, - x label style={at={(1.05,-0.05)}}, + %xlabel={$n$}, + myplotstyle, + xlabel={input length}, ylabel={size}, - enlargelimits=false, - xtick={0,5,...,30}, - xmax=30, - ymax=800, - ytick={0,200,...,800}, - scaled ticks=false, - axis lines=left, - width=5cm, - height=4cm, - legend entries={$bsimpStrong$ size growth}, - legend pos=north west, - legend cell align=left] + ] \addplot[red,mark=*, mark options={fill=white}] table {strongSimpCurve.data}; \end{axis} \end{tikzpicture} & \begin{tikzpicture} \begin{axis}[ - xlabel={$n$}, - x label style={at={(1.05,-0.05)}}, + %xlabel={$n$}, + myplotstyle, + xlabel={input length}, ylabel={size}, - enlargelimits=false, - xtick={0,5,...,30}, - xmax=30, - ymax=42000, - ytick={0,10000,...,40000}, - scaled ticks=true, - axis lines=left, - width=5cm, - height=4cm, - legend entries={$bsimp$ size growth}, - legend pos=north west, - legend cell align=left] + ] \addplot[blue,mark=*, mark options={fill=white}] table {bsimpExponential.data}; \end{axis} \end{tikzpicture}\\ -\multicolumn{2}{c}{Graphs: Runtime for matching $((a^* + (aa)^* + \ldots + (aaaaa)^* )^*)^*$ with strings +\multicolumn{2}{l}{Graphs: Runtime for matching $((a^* + (aa)^* + \ldots + (aaaaa)^* )^*)^*$ with strings of the form $\underbrace{aa..a}_{n}$.} \end{tabular} \caption{aaaaaStarStar} \label{fig:aaaaaStarStar} diff -r d4359c94bead -r ce91c29d2885 ChengsongTanPhdThesis/bsimpExponential.data --- a/ChengsongTanPhdThesis/bsimpExponential.data Mon Jun 06 03:06:32 2022 +0100 +++ b/ChengsongTanPhdThesis/bsimpExponential.data Mon Jun 06 15:57:17 2022 +0100 @@ -28,34 +28,4 @@ 27 33061 28 35461 29 37947 -30 405110 39 -1 133 -2 353 -3 655 -4 1037 -5 1503 -6 2055 -7 2695 -8 3415 -9 4219 -10 5105 -11 6079 -12 7133 -13 8277 -14 9503 -15 10807 -16 12197 -17 13677 -18 15239 -19 16885 -20 18607 -21 20419 -22 22319 -23 24303 -24 26363 -25 28509 -26 30743 -27 33061 -28 35461 -29 37947 30 40511 \ No newline at end of file diff -r d4359c94bead -r ce91c29d2885 ChengsongTanPhdThesis/main.tex --- a/ChengsongTanPhdThesis/main.tex Mon Jun 06 03:06:32 2022 +0100 +++ b/ChengsongTanPhdThesis/main.tex Mon Jun 06 15:57:17 2022 +0100 @@ -230,7 +230,7 @@ cubic to regular expression size using a technique introduced by Antimirov. The result is an algorithm with provable guarantees on -correctness and running time. We believe this is the first +correctness and finiteness. We believe this is the first work with these two guarantees together. \end{abstract}