Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download
Project: Automates
Views: 87
a = Automaton({'A': [('A', 0), ('B', 1), ('B', -1)], 'B': [('A', 0)]}) a.state('A').is_initial = True a.state('A').is_final = True
a
Automaton with 2 states
view(a)
show(a)
latex.eval(latex(a))
''
def view_graph(g): latex.eval(latex(g))
view_graph(a)
latex(a)
\begin{tikzpicture}[auto, initial text=, >=latex] \node[state, accepting, initial] (v0) at (3.000000, 0.000000) {$\text{\texttt{A}}$}; \node[state] (v1) at (-3.000000, 0.000000) {$\text{\texttt{B}}$}; \path[->] (v0) edge[loop above] node {$0$} (); \path[->] (v0.185.00) edge node[rotate=360.00, anchor=north] {$1, -1$} (v1.355.00); \path[->] (v1.5.00) edge node[rotate=0.00, anchor=south] {$0$} (v0.175.00); \end{tikzpicture}