Parcial Final
Parcial Final
\begin{document}
\maketitle
Para cada uno de los siguientes lenguajes, construya un autómata de pila
que lo lea:
\begin{enumerate}
\item $\{a^{i}b^{j}c^{k} | i, j, k \in \mathbb{N}, i < j\}$
\begin{figure}[htbp]
\centering
\begin{tikzpicture}[shorten >=1pt, node distance=2.5cm, on grid, auto, >=latex]
\tikzstyle{state}=[circle, draw, minimum size=10mm]
\tikzstyle{accept}=[state, double]
\tikzstyle{trans}=[-latex, thick]
% Nodes
\node[state, initial, initial text=Inicio] (q0) {$q_0$};
\node[state] (q1) [right=of q0] {$q_1$};
\node[state] (q2) [right=of q1] {$q_2$};
\node[state] (q3) [right=of q2] {$q_3$};
\node[state, accepting] (q4) [right=of q3] {$q_4$};
% Transitions
\path[trans]
(q0) edge node {$\lambda,\lambda \rightarrow \$$} (q1)
(q1) edge[loop above] node {$a,\lambda \rightarrow a$} (q1)
(q1) edge node { $\lambda, \lambda \rightarrow \lambda$} (q2)
(q2) edge[loop above] node{b,a$\rightarrow \lambda$}(q2)
(q2) edge node {$b, \$ \rightarrow \lambda$} (q3)
(q3) edge[loop above] node{$b,\lambda \rightarrow \lambda$}(q3)
(q3) edge node {$c, \lambda \rightarrow c$} (q4)
(q4) edge[loop above] node{$c,\lambda \rightarrow \lambda$}(q4);
\end{tikzpicture}
\end{figure}
\begin{figure}[htbp]
\centering
\begin{tikzpicture}[shorten >=1pt, node distance=2.5cm, on grid, auto, >=latex]
\tikzstyle{state}=[circle, draw, minimum size=10mm]
\tikzstyle{accept}=[state, double]
\tikzstyle{trans}=[-latex, thick]
% Nodes
\node[state, initial, initial text=Inicio] (q0) {$q_0$};
\node[state] (q1) [right=of q0] {$q_1$};
\node[state] (q2) [right=of q1] {$q_2$};
\node[state] (q3) [right=of q2] {$q_3$};
\node[state, accepting] (q4) [right=of q3] {$q_4$};
% Transitions
\path[trans]
(q0) edge node {$\lambda,\lambda \rightarrow \$$} (q1)
(q1) edge[loop above] node {$a,\lambda \rightarrow a$} (q1)
(q1) edge node { $\lambda, \lambda \rightarrow \lambda$} (q2)
(q2) edge[loop above] node{$b,\lambda \rightarrow \lambda$}(q2)
(q2) edge node {$\lambda, \lambda \rightarrow \lambda$} (q3)
(q3) edge[loop above] node[align=center]{
$c,a \rightarrow \lambda$\\
$c,b \rightarrow \lambda$
} (q3)
(q3) edge node {$\lambda, \$ \rightarrow \lambda$} (q4);
\end{tikzpicture}
\end{figure}
\end{enumerate}
\begin{figure}[htbp]
\centering
\begin{tikzpicture}[shorten >=1pt, node distance=2.5cm, on grid, auto, >=latex]
\tikzstyle{state}=[circle, draw, minimum size=10mm]
\tikzstyle{accept}=[state, double]
\tikzstyle{trans}=[-latex, thick]
% Nodes
\node[state, initial, initial text=Inicio] (q0) {$q_0$};
\node[state] (q1) [right=of q0] {$q_1$};
\node[state] (q2) [right=of q1] {$q_2$};
\node[state] (q3) [right=of q2] {$q_3$};
\node[state, accepting] (q4) [right=of q3] {$q_4$};
% Transitions
\path[trans]
(q0) edge node {$\lambda,\lambda \rightarrow \$$} (q1)
(q1) edge[loop above] node {$a,\lambda \rightarrow a$} (q1)
(q1) edge node { $\lambda, \lambda \rightarrow \lambda$} (q2)
(q2) edge[loop above] node{b,a$\rightarrow \lambda$}(q2)
(q2) edge node {$b, \$ \rightarrow \lambda$} (q3)
(q3) edge[loop above] node{$b,\lambda \rightarrow c$}(q3)
(q3) edge node {$\lambda , \lambda \rightarrow \lambda$} (q4)
(q4) edge[loop above] node[align=center]{
$\lambda,c \rightarrow \lambda$\\
$\lambda, \$ \rightarrow \lambda$
}(q4);
\end{tikzpicture}
\end{figure}
\end{document}