Skip to content

Commit

Permalink
lasalle/2024/automata: lecture 8
Browse files Browse the repository at this point in the history
  • Loading branch information
rafasgj committed Apr 25, 2024
1 parent 84272e1 commit 40b8588
Show file tree
Hide file tree
Showing 10 changed files with 731 additions and 5 deletions.
24 changes: 24 additions & 0 deletions _tikz/gnfa.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
\documentclass[tikz,convert={outfile=\jobname.svg}]{standalone}
\usetikzlibrary{automata, arrows.meta, positioning}
\begin{document}
\begin{tikzpicture}[
thick,
node distance={25mm},
auto
]

\node[state, initial, initial text = {}] (q1) {$q_1$};
\node[state, accepting] (q3) [below=4cm, right of=q1] {$q_3$};
\node[state, accepting] (q2) [above=4cm, right of=q3] {$q_2$};

\path[->]
(q1) edge [loop above] node {$a$} (q1)
(q1) edge [bend left] node {$a^{*}b^{*}$} (q2)
(q1) edge [bend right] node [swap, left=0.8cm, above] {$a\cup b$} (q3)
(q2) edge [loop right] node {$ab$} (q2)
(q2) edge [bend left] node [swap] {$b$} (q1)
(q2) edge [bend left] node [right=0.6cm, above] {$aab$} (q3)
;

\end{tikzpicture}
\end{document}
32 changes: 32 additions & 0 deletions _tikz/gnfa_convenient.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
\documentclass[tikz,convert={outfile=\jobname.svg}]{standalone}
\usepackage{amssymb}
\usetikzlibrary{automata, arrows.meta, positioning}
\begin{document}
\begin{tikzpicture}[
thick,
node distance={25mm},
auto
]

\node[state, initial, initial text = {}] (q1) {$q_1$};
\node[state] (qn) [right of=q1] {$q_n$};
\node[state] (q3) [below=4cm, right of=qn] {$q_3$};
\node[state] (q2) [above=4cm, right of=q3] {$q_2$};
\node[state, accepting] (q4) [below=2cm, right of=q2] {$q_4$};

\path[->]
(q1) edge node {$\varepsilon$} (qn)
(qn) edge [loop above] node {$a$} (qn)
(qn) edge [bend left] node {$a^{*}b^{*}$} (q2)
(qn) edge [bend right] node [swap, left=0.8cm, above] {$a\cup b$} (q3)
(q2) edge [loop above] node {$ab$} (q2)
(q2) edge [bend left] node [swap] {$b$} (qn)
(q2) edge [bend left] node [right=0.6cm, above] {$aab$} (q3)
(q3) edge [] node [] {$\varnothing$} (q2)
(q3) edge [] node [swap] {$\varnothing$} (qn)
(q2) edge [bend left] node [swap] {$\varepsilon$} (q4)
(q3) edge [bend right] node [swap] {$\varepsilon$} (q4)
;

\end{tikzpicture}
\end{document}
22 changes: 22 additions & 0 deletions _tikz/gnfa_kstate.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
\documentclass[tikz,convert={outfile=\jobname.svg}]{standalone}
\usetikzlibrary{automata, arrows.meta, positioning}
\begin{document}
\begin{tikzpicture}[
thick,
node distance={25mm},
auto
]

\node[state] (qi) {$q_i$};
\node[state] (x) [above right of =qi] {$x$};
\node[state] (qj) [below right of=x] {$q_j$};

\path[->]
(qi) edge [] node {$r_1$} (x)
(qi) edge [] node {$r_4$} (qj)
(x) edge [loop right] node {$r_2$} (x)
(x) edge [] node {$r_3$} (qj)
;

\end{tikzpicture}
\end{document}
18 changes: 18 additions & 0 deletions _tikz/gnfa_kstate_reduced.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
\documentclass[tikz,convert={outfile=\jobname.svg}]{standalone}
\usetikzlibrary{automata, arrows.meta, positioning}
\begin{document}
\begin{tikzpicture}[
thick,
node distance={25mm},
auto
]

\node[state] (qi) {$q_i$};
\node[state] (qj) [right=4cm] {$q_j$};

\path[->]
(qi) edge [] node {$r_1(r_2)^*r_3 \cup r_4$} (qj)
;

\end{tikzpicture}
\end{document}
114 changes: 114 additions & 0 deletions images/gnfa.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
174 changes: 174 additions & 0 deletions images/gnfa_convenient.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
94 changes: 94 additions & 0 deletions images/gnfa_kstate.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 40b8588

Please sign in to comment.