From: Ulya Trofimovich Date: Wed, 17 Oct 2018 21:29:31 +0000 (+0100) Subject: Paper: tweaks in picture layout. X-Git-Tag: 1.2~321 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=27aadc4075b97b8d26b9d2fd3ca655016762b8e8;p=re2c Paper: tweaks in picture layout. --- diff --git a/re2c/doc/tdfa_v2/img/pe.tex b/re2c/doc/tdfa_v2/img/pe.tex index 218997bc..c721a10c 100644 --- a/re2c/doc/tdfa_v2/img/pe.tex +++ b/re2c/doc/tdfa_v2/img/pe.tex @@ -42,10 +42,10 @@ \small{ \begin{scope}[xshift=0in, yshift=0in] - \tikzstyle{every node}=[styleA, sibling distance = 0.4in] + \tikzstyle{every node}=[styleA, sibling distance = 0.5in] - \begin{scope}[xshift=0in, yshift=0in] - \node[xshift=0in, yshift=-1.25in, draw=none] {$s = T^1 (T^2 (\varnothing^0, T^0 (a^0, a^0)))$}; + \begin{scope}[xshift=-0.5in, yshift=0in] + \node[xshift=0in, yshift=-1.2in, draw=none] {$s = T^1 (T^2 (\varnothing^0, T^0 (a^0, a^0)))$}; \graph [tree layout, grow=down, fresh nodes] { s1/"${T}^{1}$" -- { s11/"${T}^{2}$" -- { @@ -79,7 +79,7 @@ -- ($(s1.east)$); \end{scope} - \begin{scope}[xshift=1.6in, yshift=0in] + \begin{scope}[xshift=1in, yshift=0in] \node[xshift=0in, yshift=-0.9in, draw=none] {$t = T^1 (T^2 (a^0, \varnothing^0), T^2 (a^0, \varnothing^0))$}; \graph [tree layout, grow=down, fresh nodes] { s1/"${T}^{1}$" -- { @@ -120,10 +120,9 @@ -- ($(s1.east)$); \end{scope} - \begin{scope}[xshift=4.5in, yshift=-0.65in] - \node (a) {{ + \begin{scope}[xshift=2.7in, yshift=-0.2in] + \node (a) { $\begin{aligned} - &\begin{aligned} \alpha = \Phi_0(s) &= \overbracket {\Xl_1 \Xl_2 } a @@ -137,10 +136,15 @@ \overbracket { \Xr_1 \Xl_2 } a \overbracket { \Xr_1 \Xr_0 } - \end{aligned} - \\ - &traces (\alpha, \beta) = - \left[\begin{aligned} + \end{aligned}$ + }; + \end{scope} + + \begin{scope}[xshift=5in, yshift=-0.4in] + \node (a) { + $\begin{aligned} + tr&aces (\alpha, \beta) : \\[-0.4em] + &\left[\begin{aligned} \rho_0 &= \rho'_0 = -1 \\[-0.4em] \rho_1 &= min (lasth(\Xl_1 \Xl_2), minh (\epsilon)) = min (2, \infty) = 2 \\[-0.4em] \rho'_1 &= min (lasth(\Xl_1 \Xl_2), minh (\Xr_1 \Xl_2)) = min (2, 1) = 1 \\[-0.4em] @@ -148,35 +152,38 @@ \rho'_2 &= min (\rho'_1, minh (\Xr_1 \Xr_0)) = min (1, 0) = 0 \end{aligned}\right. \end{aligned}$ - }}; + }; + \end{scope} + + \begin{scope}[xshift=4in, yshift=-1.05in] + \node (a) { + $\begin{aligned} + &\rho_1 > \rho'_1 \;\wedge\; \rho_2 = \rho'_2 + \;\Rightarrow\; \alpha \sqsubset \beta + \;\Rightarrow\; \alpha < \beta + \\[-0.3em] + \|s\|^{Sub}_1 = 2 &> 1 = \|t\|^{Sub}_1 \wedge \|s\|^{Sub}_p = \|t\|^{Sub}_p \;\forall p < 1 + \;\Rightarrow\; s <_1 t + \end{aligned}$ + }; \end{scope} \end{scope} } \normalsize{ \node (x1) [ xshift=2.7in - , yshift=-1.45in + , yshift=-1.4in , draw=none ] {(a) -- Rule 1: longest precedence, RE $(a|aa)^{0,\infty}$ and string $aa$. - Order on IPTs: $s <_1 t$ because $\|s\|^{Sub}_1 = 2 > 1 = \|t\|^{Sub}_1$ - }; -\node (x2) - [ below of = x1 - , yshift=0.225in - , draw=none - ] { - and $\|s\|^{Sub}_p = \|t\|^{Sub}_p \;\forall p < 1$. - Order on PEs: $\alpha < \beta$ because - $\rho_1 > \rho'_1 \;\wedge\; \rho_2 = \rho'_2 \;\Rightarrow\; \alpha \sqsubset \beta$. }; } \small{ \begin{scope}[xshift=0in, yshift=-1.9in] - \tikzstyle{every node}=[styleA] + \tikzstyle{every node}=[styleA, sibling distance = 0.5in] - \begin{scope}[xshift=0in, yshift=0in] + \begin{scope}[xshift=-0.5in, yshift=0in] \node[xshift=0in, yshift=-0.6in, draw=none] {$s = T^1 (a^2, \varnothing^3)$}; \graph [tree layout, grow=down, fresh nodes] { r1/"${T}^{1}$" -- { @@ -199,7 +206,7 @@ -- ($(r1.east)$); \end{scope} - \begin{scope}[xshift=1.6in, yshift=0in] + \begin{scope}[xshift=1in, yshift=0in] \node[xshift=0in, yshift=-0.6in, draw=none] {$t = T^1 (\varnothing^2, a^3)$}; \graph [tree layout, grow=down, fresh nodes] { t1/"${T}^{1}$" -- { @@ -222,10 +229,9 @@ -- ($(t1.east)$); \end{scope} - \begin{scope}[xshift=4.5in, yshift=-0.4in] - \node (a) {{ + \begin{scope}[xshift=2.7in, yshift=-0.0in] + \node (a) { $\begin{aligned} - &\begin{aligned} \alpha = \Phi_0(s) &= \overbracket {\Xl_1 \Xl_2 } a @@ -235,52 +241,55 @@ \overbracket {\Xl_1 \Xm_1 \Xl_2 } a \overbracket { \Xr_1 \Xr_0 } - \end{aligned} - \\ - &traces (\alpha, \beta) = - \left[\begin{aligned} + \end{aligned}$ + }; + \end{scope} + + \begin{scope}[xshift=5in, yshift=-0.1in] + \node (a) { + $\begin{aligned} + tr&aces (\alpha, \beta) : \\[-0.4em] + &\left[\begin{aligned} \rho_0 &= min (lasth (\Xl_1), minh (\Xl_2)) = min (1, 2) = 1 \\[-0.4em] \rho'_0 &= min (lasth (\Xl_1), minh (\Xm_1 \Xl_2)) = min (1, 1) = 1 \\[-0.4em] \rho_1 &= min (\rho_0, minh (\Xr_1 \Xm_1 \Xr_0)) = min (1, 0) = 0 \\[-0.4em] \rho'_1 &= min (\rho'_0, minh (\Xr_1 \Xr_0)) = min (1, 0) = 0 \end{aligned}\right. \end{aligned}$ - }}; + }; \end{scope} + \begin{scope}[xshift=4in, yshift=-0.7in] + \node (a) { + $\begin{aligned} + \rho_i = \rho'_i &\;\forall i + \;\wedge\; first(\alpha \backslash \beta) = \Xl < \Xm = first(\beta \backslash \alpha) + \;\Rightarrow\; \alpha \sim \beta \;\wedge\; \alpha \subset \beta + \;\Rightarrow\; \alpha < \beta + \\[-0.3em] + &\|s\|^{Sub}_1 = 1 > -1 = \|t\|^{Sub}_1 \wedge \|s\|^{Sub}_p = \|t\|^{Sub}_p \;\forall p < 1 + \;\Rightarrow\; s <_1 t + \end{aligned}$ + }; + \end{scope} \end{scope} } \normalsize{ \node (y1) [ xshift=2.7in - , yshift=-3.0in + , yshift=-2.95in , draw=none ] {(b) -- Rule 2: leftmost precedence, RE $(a)|(a)$ and string $a$. - Order on IPTs: $s <_1 t$ because - $\|s\|^{Sub}_1 = 1 > -1 = \|t\|^{Sub}_1$ - }; -\node (y2) - [ below of = y1 - , yshift=0.225in - , draw=none - ] { - and $\|s\|^{Sub}_p = \|t\|^{Sub}_p \;\forall p < 1$. - Order on PEs: $\alpha < \beta$ because - $\rho_i = \rho'_i \;\forall i \;\Rightarrow\; \alpha \sim \beta$ - and - $first(\alpha \backslash \beta) = \Xl < \Xm = first(\beta \backslash \alpha) - \;\Rightarrow\; - \alpha \subset \beta$. }; } \small{ -\begin{scope}[xshift=0in, yshift=-3.4in] - \tikzstyle{every node}=[styleA, sibling distance = 0.4in] +\begin{scope}[xshift=0in, yshift=-3.3in] + \tikzstyle{every node}=[styleA, sibling distance = 0.5in] + \begin{scope}[xshift=-0.5in, yshift=0in] \node[yshift=-0.9in, draw=none] {$s = T^1(T^2(a^0, \varnothing^0))$}; - \begin{scope}[xshift=0in, yshift=0in] \graph [tree layout, grow=down, fresh nodes] { s1/"${T}^{1}$" -- { s11/"${T}^{2}$" -- { @@ -306,7 +315,7 @@ -- ($(s1.east)$); \end{scope} - \begin{scope}[xshift=1.6in, yshift=0in] + \begin{scope}[xshift=1in, yshift=0in] \node[xshift=0in, yshift=-0.9in, draw=none] {$t = T^1 (T^2 (a^0, \varnothing^0), T^2(\varnothing^0, \epsilon^0))$}; \graph [tree layout, grow=down, fresh nodes] { s1/"${T}^{1}$" -- { @@ -347,10 +356,9 @@ -- ($(s1.east)$); \end{scope} - \begin{scope}[xshift=4.5in, yshift=-0.45in] - \node (a) {{ + \begin{scope}[xshift=2.7in, yshift=-0.2in] + \node (a) { $\begin{aligned} - &\begin{aligned} \alpha = \Phi_0(s) &= \overbracket {\Xl_1 \Xl_2 } a @@ -360,52 +368,56 @@ \overbracket { \Xl_1 \Xl_2 } a \overbracket { \Xr_1 \Xl_2 \Xr_1 \Xr_0 } - \end{aligned} - \\ - &traces (\alpha, \beta) = - \left[\begin{aligned} + \end{aligned}$ + }; + \end{scope} + + \begin{scope}[xshift=5in, yshift=-0.2in] + \node (a) { + $\begin{aligned} + tr&aces (\alpha, \beta) : + \\[-0.4em] + &\left[\begin{aligned} \rho_0 &= \rho'_0 = -1 \\[-0.4em] \rho_1 &= min (lasth (\Xr_1), minh (\Xr_0)) = min (1, 0) = 0 \\[-0.4em] \rho'_1 &= min (lasth (\Xr_1), minh (\Xl_2 \Xr_1 \Xr_0)) = min (1, 0) = 0 \end{aligned}\right. \end{aligned}$ - }}; + }; \end{scope} + \begin{scope}[xshift=4in, yshift=-0.75in] + \node (a) { + $\begin{aligned} + \rho_i = \rho'_i \;\forall i + &\;\wedge\; first(\alpha \backslash \beta) = \Xr < \Xl = first(\beta \backslash \alpha) + \;\Rightarrow\; \alpha \sim \beta \;\wedge\; \alpha \subset \beta + \;\Rightarrow\; \alpha < \beta + \\[-0.3em] + &\|s\|^{Sub}_2 = \infty > 0 = \|t\|^{Sub}_2 \wedge \|s\|^{Sub}_p = \|t\|^{Sub}_p \;\forall p < 2 + \;\Rightarrow\; s <_2 t + \end{aligned}$ + }; + \end{scope} \end{scope} } \normalsize{ \node (z1) [ xshift=2.7in - , yshift=-4.5in + , yshift=-4.45in , draw=none ] {(c) -- Rule 3: no optional empty repetitions, RE $(a|\epsilon)^{0,\infty}$ and string $a$. - Order on IPTs: $s <_2 t$ because - $\|s\|^{Sub}_2 = \infty > 0 = \|t\|^{Sub}_2$ }; -\node (z2) - [ below of = z1 - , yshift=0.225in - , draw=none - ] { - and $\|s\|^{Sub}_p = \|t\|^{Sub}_p \;\forall p < 2$. - Order on PEs: $\alpha < \beta$ because - $\rho_i = \rho'_i \;\forall i \;\Rightarrow\; \alpha \sim \beta$ - and - $first(\alpha \backslash \beta) = \Xr < \Xl = first(\beta \backslash \alpha) - \;\Rightarrow\; - \alpha \subset \beta$. - }; } \small{ -\begin{scope}[xshift=0in, yshift=-4.9in] - \tikzstyle{every node}=[styleA, sibling distance = 0.4in] +\begin{scope}[xshift=0in, yshift=-4.85in] + \tikzstyle{every node}=[styleA, sibling distance = 0.5in] + \begin{scope}[xshift=-0.5in, yshift=0in] \node[yshift=-0.6in, draw=none] {$s = T^1(\varnothing^2)$}; - \begin{scope}[xshift=0in, yshift=0in] \graph [tree layout, grow=down, fresh nodes] { s1/"${T}^{1}$" -- { s11/"${\varnothing}^{2}$" @@ -421,7 +433,7 @@ -- ($(s1.east)$); \end{scope} - \begin{scope}[xshift=1.6in, yshift=0in] + \begin{scope}[xshift=1in, yshift=0in] \node[xshift=0in, yshift=-0.9in, draw=none] {$t = T^1(T^2(\epsilon^0))$}; \graph [tree layout, grow=down, fresh nodes] { s1/"${T}^{1}$" -- { @@ -447,51 +459,54 @@ -- ($(s1.east)$); \end{scope} - \begin{scope}[xshift=4.5in, yshift=-0.45in] - \node (a) {{ + \begin{scope}[xshift=2.7in, yshift=-0.2in] + \node (a) { $\begin{aligned} - &\begin{aligned} \alpha = \Phi_0(s) &= \overbracket {\Xl_1 \Xm_1 \Xr_0 } \\[-0.4em] \beta = \Phi_0(t) &= \overbracket {\Xl_1 \Xl_2 \Xr_1 \Xr_0 } - \end{aligned} - \\ - &traces (\alpha, \beta) = - \left[\begin{aligned} + \end{aligned}$ + }; + \end{scope} + + \begin{scope}[xshift=5in, yshift=-0.2in] + \node (a) { + $\begin{aligned} + tr&aces (\alpha, \beta) : + \\[-0.4em] + &\left[\begin{aligned} \rho_0 &= min (lasth (\Xl_1), minh (\Xm_1 \Xr_0)) = min (1, 0) = 0 \\[-0.4em] \rho'_0 &= min (lasth (\Xl_1), minh (\Xl_2 \Xr_1 \Xr_0)) = min (1, 0) = 0 \end{aligned}\right. \end{aligned}$ - }}; + }; \end{scope} + \begin{scope}[xshift=4in, yshift=-0.7in] + \node (a) { + $\begin{aligned} + \rho_i = \rho'_i \;\forall i + &\;\wedge\; first(\alpha \backslash \beta) = \Xm > \Xl = first(\beta \backslash \alpha) + \;\Rightarrow\; \alpha \sim \beta \;\wedge\; \beta \subset \alpha + \;\Rightarrow\; \beta < \alpha + \\[-0.3em] + &\|s\|^{Sub}_2 = 0 > -1 = \|s\|^{Sub}_2 \wedge \|s\|^{Sub}_p = \|t\|^{Sub}_p \;\forall p < 2 + \;\Rightarrow\; t <_2 s + \end{aligned}$ + }; + \end{scope} \end{scope} } \normalsize{ \node (z1) [ xshift=2.7in - , yshift=-6.0in + , yshift=-6in , draw=none ] {(d) -- Rule 4: empty match is better than no match, RE $(a|\epsilon)^{0,\infty}$ and string $\epsilon$. - Order on IPTs: $t <_2 s$ because - $\|s\|^{Sub}_2 = 0 > -1 = \|s\|^{Sub}_2$ }; -\node (z2) - [ below of = z1 - , yshift=0.225in - , draw=none - ] { - and $\|s\|^{Sub}_p = \|t\|^{Sub}_p \;\forall p < 2$. - Order on PEs: $\beta < \alpha$ because - $\rho_i = \rho'_i \;\forall i \;\Rightarrow\; \alpha \sim \beta$ - and - $first(\alpha \backslash \beta) = \Xm > \Xl = first(\beta \backslash \alpha) - \;\Rightarrow\; - \beta \subset \alpha$. - }; } @@ -590,7 +605,7 @@ ] -\begin{scope}[xshift=0in, yshift=-2.0in] +\begin{scope}[xshift=0in, yshift=-2.2in] \tikzstyle{every node}=[draw = none, shape = circle, inner sep = 0] \node[xshift=-0.4in, draw=none] {$t_3:$}; \graph [tree layout, grow=down, fresh nodes, sibling distance = 0.45in, level distance = 0.3in] { @@ -636,7 +651,7 @@ \end{scope} -\begin{scope}[xshift=1.6in, yshift=-2in] +\begin{scope}[xshift=1.6in, yshift=-2.2in] \tikzstyle{every node}=[draw = none, shape = circle, inner sep = 0] \node[xshift=-0.4in, draw=none] {$t_5:$}; \graph [tree layout, grow=down, fresh nodes, sibling distance = 0.45in, level distance = 0.3in] { @@ -688,7 +703,7 @@ \end{scope} -\begin{scope}[xshift=5.6in, yshift=-1.85in] +\begin{scope}[xshift=5.6in, yshift=-2in] \node [shape=rectangle, draw = none] (a) { $\begin{aligned} &\begin{aligned} @@ -709,13 +724,14 @@ \end{scope} -\begin{scope}[xshift=2.0in, yshift=-1.8in] +\begin{scope}[xshift=2.0in, yshift=-1.9in] \node [shape=rectangle, draw = none] (a) { \setlength\tabcolsep{1.5pt} \renewcommand{\arraystretch}{0.5} $\begin{aligned} &\begin{tabular}{cccccccc|c} $t_2$ & $t_3$ & $t_4$ & $t_5$ & $t_6$ & $t_7$ & $t_8$ & $t_9$ \\ + &&&&&&& \\[-0.4em] \hline &&&&&&& \\[-0.2em] % @@ -930,12 +946,12 @@ \normalsize{ \node (w1) [ xshift=3.3in - , yshift=-3.2in + , yshift=-3.4in , draw=none , shape=rectangle ] {(e) -- - All possible IPTs for RE $(((a)^{1,3})^{1,3})^{1,3}$ and string $aaa$, the corresponding PEs, - and the table of $traces(\Phi_0(t_i), \Phi_0(t_j))$ + Pairwise comparison of all PEs for RE $(((a)^{1,3})^{1,3})^{1,3}$ and string $aaa$. + The table contains $traces(\Phi_0(t_i), \Phi_0(t_j))$ }; \node (w2) [ below of = w1 @@ -943,8 +959,8 @@ , draw=none , shape=rectangle ] { - for each pair of PEs at row $t_i$, column $t_j$. - IPTs $t_3$ and $t_5$ are shown in more detail (their table entry is in bold). + for PEs at row $t_i$, column $t_j$. + IPTs $t_3$ and $t_5$ are shown in more detail (table entry in bold). }; }