456
|
1 |
\documentclass{article}
|
|
2 |
|
|
3 |
\usepackage{tikz}
|
|
4 |
\usetikzlibrary{automata,positioning}
|
|
5 |
\begin{document}
|
|
6 |
\section{regular expression derivatives as NFA's}
|
|
7 |
\begin{tikzpicture}[shorten >=1pt,node distance=2cm,on grid,auto]
|
|
8 |
\node[state,initial] (q_0) {$q_0$};
|
|
9 |
\node[state] (q_1) [above right=of q_0] {$q_1$};
|
|
10 |
\node[state] (q_2) [below right=of q_0] {$q_2$};
|
|
11 |
\node[state,accepting](q_3) [below right=of q_1] {$q_3$};
|
|
12 |
\path[->]
|
|
13 |
(q_0) edge node {0} (q_1)
|
|
14 |
edge node [swap] {1} (q_2)
|
|
15 |
(q_1) edge node {1} (q_3)
|
|
16 |
edge [loop above] node {0} ()
|
|
17 |
(q_2) edge node [swap] {0} (q_3)
|
|
18 |
edge [loop below] node {1} ();
|
|
19 |
\end{tikzpicture}
|
|
20 |
\end{document} |