PhdThesisRealOne/automata_view.tex
author Chengsong
Sun, 20 Mar 2022 23:32:08 +0000
changeset 456 26a5e640cdd7
permissions -rw-r--r--
realPhdThesis
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
456
26a5e640cdd7 realPhdThesis
Chengsong
parents:
diff changeset
     1
\documentclass{article}
26a5e640cdd7 realPhdThesis
Chengsong
parents:
diff changeset
     2
26a5e640cdd7 realPhdThesis
Chengsong
parents:
diff changeset
     3
\usepackage{tikz}
26a5e640cdd7 realPhdThesis
Chengsong
parents:
diff changeset
     4
\usetikzlibrary{automata,positioning}
26a5e640cdd7 realPhdThesis
Chengsong
parents:
diff changeset
     5
\begin{document}
26a5e640cdd7 realPhdThesis
Chengsong
parents:
diff changeset
     6
\section{regular expression derivatives as NFA's}
26a5e640cdd7 realPhdThesis
Chengsong
parents:
diff changeset
     7
\begin{tikzpicture}[shorten >=1pt,node distance=2cm,on grid,auto] 
26a5e640cdd7 realPhdThesis
Chengsong
parents:
diff changeset
     8
   \node[state,initial] (q_0)   {$q_0$}; 
26a5e640cdd7 realPhdThesis
Chengsong
parents:
diff changeset
     9
   \node[state] (q_1) [above right=of q_0] {$q_1$}; 
26a5e640cdd7 realPhdThesis
Chengsong
parents:
diff changeset
    10
   \node[state] (q_2) [below right=of q_0] {$q_2$}; 
26a5e640cdd7 realPhdThesis
Chengsong
parents:
diff changeset
    11
   \node[state,accepting](q_3) [below right=of q_1] {$q_3$};
26a5e640cdd7 realPhdThesis
Chengsong
parents:
diff changeset
    12
    \path[->] 
26a5e640cdd7 realPhdThesis
Chengsong
parents:
diff changeset
    13
    (q_0) edge  node {0} (q_1)
26a5e640cdd7 realPhdThesis
Chengsong
parents:
diff changeset
    14
          edge  node [swap] {1} (q_2)
26a5e640cdd7 realPhdThesis
Chengsong
parents:
diff changeset
    15
    (q_1) edge  node  {1} (q_3)
26a5e640cdd7 realPhdThesis
Chengsong
parents:
diff changeset
    16
          edge [loop above] node {0} ()
26a5e640cdd7 realPhdThesis
Chengsong
parents:
diff changeset
    17
    (q_2) edge  node [swap] {0} (q_3) 
26a5e640cdd7 realPhdThesis
Chengsong
parents:
diff changeset
    18
          edge [loop below] node {1} ();
26a5e640cdd7 realPhdThesis
Chengsong
parents:
diff changeset
    19
\end{tikzpicture}
26a5e640cdd7 realPhdThesis
Chengsong
parents:
diff changeset
    20
\end{document}