#16580: FiniteStateMachine: cleanup code
-------------------------------------+-------------------------------------
Reporter: cheuberg | Owner:
Type: defect | Status: positive_review
Priority: minor | Milestone: sage-6.3
Component: finite state | Resolution:
machines | Merged in:
Keywords: | Reviewers: Daniel Krenn
finite_state_machine | Work issues:
Authors: Clemens Heuberger | Commit:
Report Upstream: N/A | fd618dcb88bf9771419caf8d86ce617b644e6e54
Branch: u/cheuberg/fsm | Stopgaps:
/code-cleanup-post-16067 |
Dependencies: |
-------------------------------------+-------------------------------------
Comment (by vbraun):
Fails on OSX:
{{{
sage -t --long src/sage/combinat/finite_state_machine.py
**********************************************************************
File "src/sage/combinat/finite_state_machine.py", line 3318, in
sage.combinat.finite_state_machine.FiniteStateMachine.?
Failed example:
latex(T)
Expected:
\begin{tikzpicture}[auto, initial text=, >=latex]
\node[state, initial, initial where=above] (v0) at (0.000000,
0.000000) {$\mathcal{I}$};
\node[state, accepting, accepting where=left] (v1) at (-6.000000,
3.000000) {$\mathbf{0}$};
\node[state, accepting, accepting where=45] (v2) at (6.000000,
3.000000) {$\mathbf{3}$};
\path[->] (v2.45.00) edge node[rotate=45.00, anchor=south] {$\$ \mid
{\scriptstyle w_{0} w_{0}}$} ++(45.00:10ex);
\node[state] (v3) at (-2.000000, 3.000000) {$\mathbf{1}$};
\node[state] (v4) at (2.000000, 3.000000) {$\mathbf{2}$};
\path[->] (v0.31.57) edge node[rotate=26.57, anchor=south]
{${\scriptstyle w_{0}}\mid {\scriptstyle w_{0} w_{3}}$} (v2.201.57);
\path[->] (v1) edge[loop left] node[rotate=90, anchor=south]
{${\scriptstyle w_{0}}\mid {\scriptstyle w_{0}}$} ();
\path[->] (v2) edge[loop below] node {${\scriptstyle w_{0}}\mid
{\scriptstyle w_{0}}$} ();
\path[->] (v0.128.69) edge node[rotate=303.69, anchor=north]
{${\scriptstyle w_{0}}\mid {\scriptstyle w_{0} w_{1}}$} (v3.298.69);
\path[->] (v4.-118.69) edge node[rotate=56.31, anchor=north]
{${\scriptstyle w_{0}}\mid {\scriptstyle w_{0} w_{-2}}$} (v0.51.31);
\path[->] (v0.158.43) edge node[rotate=333.43, anchor=north]
{${\scriptstyle w_{0}}\mid {\scriptstyle w_{0} w_{0}}$} (v1.328.43);
\path[->] (v2.-148.43) edge node[rotate=26.57, anchor=north]
{${\scriptstyle w_{0}}\mid {\scriptstyle w_{0} w_{-3}}$} (v0.21.57);
\path[->] (v3.-51.31) edge node[rotate=-56.31, anchor=south]
{${\scriptstyle w_{0}}\mid {\scriptstyle w_{0} w_{-1}}$} (v0.118.69);
\path[->] (v0) edge[loop below] node {${\scriptstyle w_{0}}\mid
{\scriptstyle w_{0}}$} ();
\path[->] (v4) edge[loop right] node[rotate=90, anchor=north]
{${\scriptstyle w_{0}}\mid {\scriptstyle w_{0}}$} ();
\path[->] (v1.-21.57) edge node[rotate=-26.57, anchor=south]
{${\scriptstyle w_{0}}\mid {\scriptstyle w_{0} w_{0}}$} (v0.148.43);
\path[->] (v3) edge[loop above] node {${\scriptstyle w_{0}}\mid
{\scriptstyle w_{0}}$} ();
\path[->] (v0.61.31) edge node[rotate=56.31, anchor=south]
{${\scriptstyle w_{0}}\mid {\scriptstyle w_{0} w_{2}}$} (v4.231.31);
\end{tikzpicture}
Got:
\begin{tikzpicture}[auto, initial text=, >=latex]
\node[state, initial, initial where=above] (v0) at (0.000000,
0.000000) {$\mathcal{I}$};
\node[state, accepting, accepting where=left] (v1) at (-6.000000,
3.000000) {$\mathbf{0}$};
\node[state, accepting, accepting where=45] (v2) at (6.000000,
3.000000) {$\mathbf{3}$};
\path[->] (v2.45.00) edge node[rotate=45.00, anchor=south] {$\$ \mid
{\scriptstyle w_{0} w_{0}}$} ++(45.00:10ex);
\node[state] (v3) at (-2.000000, 3.000000) {$\mathbf{1}$};
\node[state] (v4) at (2.000000, 3.000000) {$\mathbf{2}$};
\path[->] (v0.31.57) edge node[rotate=26.57, anchor=south]
{${\scriptstyle w_{0}}\mid {\scriptstyle w_{0} w_{3}}$} (v2.201.57);
\path[->] (v1) edge[loop left] node[rotate=90, anchor=south]
{${\scriptstyle w_{0}}\mid {\scriptstyle w_{0}}$} ();
\path[->] (v0.61.31) edge node[rotate=56.31, anchor=south]
{${\scriptstyle w_{0}}\mid {\scriptstyle w_{0} w_{2}}$} (v4.231.31);
\path[->] (v0.128.69) edge node[rotate=303.69, anchor=north]
{${\scriptstyle w_{0}}\mid {\scriptstyle w_{0} w_{1}}$} (v3.298.69);
\path[->] (v4.-118.69) edge node[rotate=56.31, anchor=north]
{${\scriptstyle w_{0}}\mid {\scriptstyle w_{0} w_{-2}}$} (v0.51.31);
\path[->] (v0.158.43) edge node[rotate=333.43, anchor=north]
{${\scriptstyle w_{0}}\mid {\scriptstyle w_{0} w_{0}}$} (v1.328.43);
\path[->] (v2.-148.43) edge node[rotate=26.57, anchor=north]
{${\scriptstyle w_{0}}\mid {\scriptstyle w_{0} w_{-3}}$} (v0.21.57);
\path[->] (v3.-51.31) edge node[rotate=-56.31, anchor=south]
{${\scriptstyle w_{0}}\mid {\scriptstyle w_{0} w_{-1}}$} (v0.118.69);
\path[->] (v0) edge[loop below] node {${\scriptstyle w_{0}}\mid
{\scriptstyle w_{0}}$} ();
\path[->] (v4) edge[loop right] node[rotate=90, anchor=north]
{${\scriptstyle w_{0}}\mid {\scriptstyle w_{0}}$} ();
\path[->] (v1.-21.57) edge node[rotate=-26.57, anchor=south]
{${\scriptstyle w_{0}}\mid {\scriptstyle w_{0} w_{0}}$} (v0.148.43);
\path[->] (v3) edge[loop above] node {${\scriptstyle w_{0}}\mid
{\scriptstyle w_{0}}$} ();
\path[->] (v2) edge[loop below] node {${\scriptstyle w_{0}}\mid
{\scriptstyle w_{0}}$} ();
\end{tikzpicture}
**********************************************************************
File "src/sage/combinat/finite_state_machine.py", line 3352, in
sage.combinat.finite_state_machine.FiniteStateMachine.?
Failed example:
latex(T)
Expected:
\begin{tikzpicture}[auto, initial text=, >=latex, accepting text=,
accepting/.style=accepting by arrow, accepting distance=10ex]
\node[state, initial, initial where=above] (v0) at (0.000000,
0.000000) {$\mathcal{I}$};
\node[state] (v1) at (-6.000000, 3.000000) {$\mathbf{0}$};
\path[->] (v1.180.00) edge node[rotate=360.00, anchor=south] {$\$ \mid
\varepsilon$} ++(180.00:10ex);
\node[state] (v2) at (6.000000, 3.000000) {$\mathbf{3}$};
\path[->] (v2.45.00) edge node[rotate=45.00, anchor=south] {$\$ \mid
w_{0} w_{0}$} ++(45.00:10ex);
\node[state] (v3) at (-2.000000, 3.000000) {$\mathbf{1}$};
\node[state] (v4) at (2.000000, 3.000000) {$\mathbf{2}$};
\path[->] (v0.31.57) edge node[rotate=26.57, anchor=south] {$w_{0}\mid
w_{0} w_{3}$} (v2.201.57);
\path[->] (v1) edge[loop left] node[rotate=90, anchor=south]
{$w_{0}\mid w_{0}$} ();
\path[->] (v2) edge[loop below] node {$w_{0}\mid w_{0}$} ();
\path[->] (v0.128.69) edge node[rotate=303.69, anchor=north]
{$w_{0}\mid w_{0} w_{1}$} (v3.298.69);
\path[->] (v4.-118.69) edge node[rotate=56.31, anchor=north]
{$w_{0}\mid w_{0} w_{-2}$} (v0.51.31);
\path[->] (v0.158.43) edge node[rotate=333.43, anchor=north]
{$w_{0}\mid w_{0} w_{0}$} (v1.328.43);
\path[->] (v2.-148.43) edge node[rotate=26.57, anchor=north]
{$w_{0}\mid w_{0} w_{-3}$} (v0.21.57);
\path[->] (v3.-51.31) edge node[rotate=-56.31, anchor=south]
{$w_{0}\mid w_{0} w_{-1}$} (v0.118.69);
\path[->] (v0) edge[loop below] node {$w_{0}\mid w_{0}$} ();
\path[->] (v4) edge[loop right] node[rotate=90, anchor=north]
{$w_{0}\mid w_{0}$} ();
\path[->] (v1.-21.57) edge node[rotate=-26.57, anchor=south]
{$w_{0}\mid w_{0} w_{0}$} (v0.148.43);
\path[->] (v3) edge[loop above] node {$w_{0}\mid w_{0}$} ();
\path[->] (v0.61.31) edge node[rotate=56.31, anchor=south] {$w_{0}\mid
w_{0} w_{2}$} (v4.231.31);
\end{tikzpicture}
Got:
\begin{tikzpicture}[auto, initial text=, >=latex, accepting text=,
accepting/.style=accepting by arrow, accepting distance=10ex]
\node[state, initial, initial where=above] (v0) at (0.000000,
0.000000) {$\mathcal{I}$};
\node[state] (v1) at (-6.000000, 3.000000) {$\mathbf{0}$};
\path[->] (v1.180.00) edge node[rotate=360.00, anchor=south] {$\$ \mid
\varepsilon$} ++(180.00:10ex);
\node[state] (v2) at (6.000000, 3.000000) {$\mathbf{3}$};
\path[->] (v2.45.00) edge node[rotate=45.00, anchor=south] {$\$ \mid
w_{0} w_{0}$} ++(45.00:10ex);
\node[state] (v3) at (-2.000000, 3.000000) {$\mathbf{1}$};
\node[state] (v4) at (2.000000, 3.000000) {$\mathbf{2}$};
\path[->] (v0.31.57) edge node[rotate=26.57, anchor=south] {$w_{0}\mid
w_{0} w_{3}$} (v2.201.57);
\path[->] (v1) edge[loop left] node[rotate=90, anchor=south]
{$w_{0}\mid w_{0}$} ();
\path[->] (v0.61.31) edge node[rotate=56.31, anchor=south] {$w_{0}\mid
w_{0} w_{2}$} (v4.231.31);
\path[->] (v0.128.69) edge node[rotate=303.69, anchor=north]
{$w_{0}\mid w_{0} w_{1}$} (v3.298.69);
\path[->] (v4.-118.69) edge node[rotate=56.31, anchor=north]
{$w_{0}\mid w_{0} w_{-2}$} (v0.51.31);
\path[->] (v0.158.43) edge node[rotate=333.43, anchor=north]
{$w_{0}\mid w_{0} w_{0}$} (v1.328.43);
\path[->] (v2.-148.43) edge node[rotate=26.57, anchor=north]
{$w_{0}\mid w_{0} w_{-3}$} (v0.21.57);
\path[->] (v3.-51.31) edge node[rotate=-56.31, anchor=south]
{$w_{0}\mid w_{0} w_{-1}$} (v0.118.69);
\path[->] (v0) edge[loop below] node {$w_{0}\mid w_{0}$} ();
\path[->] (v4) edge[loop right] node[rotate=90, anchor=north]
{$w_{0}\mid w_{0}$} ();
\path[->] (v1.-21.57) edge node[rotate=-26.57, anchor=south]
{$w_{0}\mid w_{0} w_{0}$} (v0.148.43);
\path[->] (v3) edge[loop above] node {$w_{0}\mid w_{0}$} ();
\path[->] (v2) edge[loop below] node {$w_{0}\mid w_{0}$} ();
\end{tikzpicture}
**********************************************************************
1 item had failures:
2 of 132 in sage.combinat.finite_state_machine.FiniteStateMachine.?
[1234 tests, 2 failures, 3.75 s]
}}}
--
Ticket URL: <http://trac.sagemath.org/ticket/16580#comment:3>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.