act minim 2
This commit is contained in:
parent
a8c44579ec
commit
d171b1b165
Binary file not shown.
|
@ -75,169 +75,7 @@ Para enfrentar el problema de diseñar una gramática a partir de ciertas condic
|
|||
|
||||
\end{enumerate}
|
||||
|
||||
Veamos otro ejemplo ahora a partir de una tabla.
|
||||
|
||||
\textbf{Ejemplo:} Minimaliza el siguiente autómata
|
||||
\begin{center}
|
||||
\begin{tabular}{||c||c c||}
|
||||
\hline
|
||||
Estado & a & b \\ [0.5ex]
|
||||
\hline\hline
|
||||
$\rightarrow S$ & $Q_1$ & $Q_5$ \\
|
||||
\hline
|
||||
$Q_1$ & $S$ & $Q_5$ \\
|
||||
\hline
|
||||
$Q_2$ & $Q_6$ & $S$ \\
|
||||
\hline
|
||||
$Q_3$ & $Q_7$ & $Q_1$ \\
|
||||
\hline
|
||||
$Q_4$ & $S$ & $Q_6$ \\
|
||||
\hline
|
||||
$Q_5^*$ & $Q_7$ & $Q_2$ \\
|
||||
\hline
|
||||
$Q_6^*$ & $S$ & $Q_3$ \\
|
||||
\hline
|
||||
$Q_7^*$ & $S$ & $Q_2$ \\ [1ex]
|
||||
\hline
|
||||
\end{tabular}
|
||||
\end{center}
|
||||
|
||||
Espero sea claro que $S$ es el estado inicial y $Q_5$, $Q_6$ y $Q_7$, los estados marcados con asterisco, son estados finales. De analizar la tabla podemos encontrar los estados inaccesibles, aquellos estados que no aparezcan del lado derecho de la tabla. Revisando podemos ver que el estado $Q_4$ no aparece en ninguna transición desde otro estado. Podemos eliminarlo.
|
||||
|
||||
\begin{center}
|
||||
\begin{tabular}{||c||c c||}
|
||||
\hline
|
||||
Estado & a & b \\ [0.5ex]
|
||||
\hline\hline
|
||||
$S$ & $Q_1$ & $Q_5$ \\
|
||||
\hline
|
||||
$Q_1$ & $S$ & $Q_5$ \\
|
||||
\hline
|
||||
$Q_2$ & $Q_6$ & $S$ \\
|
||||
\hline
|
||||
$Q_3$ & $Q_7$ & $Q_1$ \\
|
||||
\hline
|
||||
$Q_5^*$ & $Q_7$ & $Q_2$ \\
|
||||
\hline
|
||||
$Q_6^*$ & $S$ & $Q_3$ \\
|
||||
\hline
|
||||
$Q_7^*$ & $S$ & $Q_2$ \\ [1ex]
|
||||
\hline
|
||||
\end{tabular}
|
||||
\end{center}
|
||||
|
||||
Ya sin estados inaccesibles armamos la tabla \ref{tab:1}, empezando vacía y marcamos, como lo dice el algoritmo, las parejas \{\emph{estado final, no estado final}\} o viceversa.
|
||||
|
||||
\begin{table}[h!]
|
||||
\begin{center}
|
||||
\begin{tabular}{c c c c c c c}
|
||||
\hline
|
||||
$S$ & & & & & & \\
|
||||
\hline
|
||||
& $Q_1$ & & & & & \\
|
||||
\hline
|
||||
& & $Q_2$ & & & & \\
|
||||
\hline
|
||||
& & & $Q_3$ & & & \\
|
||||
\hline
|
||||
& & & & $Q_5$ & & \\
|
||||
\hline
|
||||
& & & & & $Q_6$ & \\
|
||||
\hline
|
||||
& & & & & & $Q_7$ \\[1ex]
|
||||
\hline
|
||||
\end{tabular}
|
||||
\caption{Tabla para la minimalización de estados del autómata.}
|
||||
\label{tab:1}
|
||||
\end{center}
|
||||
\end{table}
|
||||
|
||||
Una vez marcadas las parejas \{\emph{estado final, no estado final}\}, revisamos las posibles transiciones de cada estado de la pareja para cada símbolo del alfabeto.
|
||||
|
||||
\begin{table}[h!]
|
||||
\begin{center}
|
||||
\begin{tabular}{c c c c c c c}
|
||||
\hline
|
||||
$S$ & & & & & & \\
|
||||
\hline
|
||||
& $Q_1$ & & & & & \\
|
||||
\hline
|
||||
& & $Q_2$ & & & & \\
|
||||
\hline
|
||||
& & & $Q_3$ & & & \\
|
||||
\hline
|
||||
\checkmark& \checkmark & \checkmark & \checkmark & $Q_5$ & & \\
|
||||
\hline
|
||||
\checkmark & \checkmark & \checkmark & \checkmark & & $Q_6$ & \\
|
||||
\hline
|
||||
\checkmark & \checkmark & \checkmark & \checkmark & & & $Q_7$ \\[1ex]
|
||||
\hline
|
||||
\end{tabular}
|
||||
\caption{Tabla para la minimalización de estados del autómata.}
|
||||
\label{tab:2}
|
||||
\end{center}
|
||||
\end{table}
|
||||
|
||||
Se pueden ver las siguientes posibilidades:
|
||||
|
||||
\begin{align*}
|
||||
\{S,Q_1\} &\overset{a}{\rightarrow} \{Q_1,S\} \text{, que no está marcado} \\
|
||||
\{S,Q_1\} &\overset{b}{\rightarrow} \{Q_5,Q_5\} \text{, que no puede estar marcado}\\
|
||||
\{S,Q_2\} &\overset{a}{\rightarrow} \{Q_1,Q_6\} \text{, que sí está marcado \checkmark}\\
|
||||
\{S,Q_3\} &\overset{a}{\rightarrow} \{Q_1,Q_7\} \text{, que sí está marcado \checkmark}\\
|
||||
\{Q_1,Q_2\} &\overset{a}{\rightarrow} \{S,Q_6\} \text{, que sí está marcado \checkmark}\\
|
||||
\{Q_1,Q_3\} &\overset{a}{\rightarrow} \{S,Q_7\} \text{, que sí está marcado \checkmark}\\
|
||||
\{Q_2,Q_3\} &\overset{a}{\rightarrow} \{Q_6,Q_7\} \text{, que no está marcado}\\
|
||||
\{Q_2,Q_3\} &\overset{b}{\rightarrow} \{S,Q_1\} \text{, que no está marcado}\\
|
||||
\{Q_5,Q_6\} &\overset{a}{\rightarrow} \{Q_7,S\} \text{, que sí está marcado \checkmark}\\
|
||||
\{Q_5,Q_7\} &\overset{a}{\rightarrow} \{Q_7,S\} \text{, que sí está marcado \checkmark}\\
|
||||
\{Q_6,Q_7\} &\overset{a}{\rightarrow} \{S,S\} \text{, que no puede estar marcado}\\
|
||||
\{Q_6,Q_7\} &\overset{b}{\rightarrow} \{Q_3,Q_2\} \text{, que no está marcado}
|
||||
\end{align*}
|
||||
|
||||
Una vez con viendo las transiciones podemos seguir repitiendo el paso, pero vemos que las parejas sin marcar siguen si poderse marcar. Para ese caso la tabla queda como se ve en \ref{tab:3}
|
||||
|
||||
\begin{table}[h!]
|
||||
\begin{center}
|
||||
\begin{tabular}{c c c c c c c}
|
||||
\hline
|
||||
$S$ & & & & & & \\
|
||||
\hline
|
||||
& $Q_1$ & & & & & \\
|
||||
\hline
|
||||
\checkmark & \checkmark & $Q_2$ & & & & \\
|
||||
\hline
|
||||
\checkmark & \checkmark & & $Q_3$ & & & \\
|
||||
\hline
|
||||
\checkmark& \checkmark & \checkmark & \checkmark & $Q_5$ & & \\
|
||||
\hline
|
||||
\checkmark & \checkmark & \checkmark & \checkmark & \checkmark & $Q_6$ & \\
|
||||
\hline
|
||||
\checkmark & \checkmark & \checkmark & \checkmark & \checkmark & & $Q_7$ \\[1ex]
|
||||
\hline
|
||||
\end{tabular}
|
||||
\caption{Tabla para la minimalización de estados del autómata.}
|
||||
\label{tab:3}
|
||||
\end{center}
|
||||
\end{table}
|
||||
|
||||
Lo que quiere decir, que aunque demos más vueltas ya no podemos marcar más y por lo tanto las equivalencias son $S\equiv Q_1$, $Q_2\equiv Q_3$ y $Q_6\equiv Q_7$, estos estados pueden colapsarse. Les muestro la tabla y ya les toca a ustedes hacer el autómata:
|
||||
|
||||
\begin{center}
|
||||
\begin{tabular}{||c||c c||}
|
||||
\hline
|
||||
Estado & a & b \\ [0.5ex]
|
||||
\hline\hline
|
||||
$\{S,Q_1\}$ & $\{S,Q_1\}$ & $Q_5$ \\
|
||||
\hline
|
||||
$\{Q_2,Q_3\}$ & $\{Q_6,Q_7\}$ & $\{S,Q_1\}$ \\
|
||||
\hline
|
||||
$Q_5^*$ & $\{Q_6,Q_7\}$ & $\{Q_2,Q_3\}$ \\
|
||||
\hline
|
||||
$\{Q_6,Q_7\}^*$ & $S$ & $\{Q_2,Q_3\}$ \\
|
||||
\hline
|
||||
\end{tabular}
|
||||
\end{center}
|
||||
|
||||
\section{Formas normales}
|
||||
|
||||
|
|
BIN
minimizacion.pdf
BIN
minimizacion.pdf
Binary file not shown.
164
minimizacion.tex
164
minimizacion.tex
|
@ -204,6 +204,170 @@ Lo que quiere decir que $q_1$ y $q_2$ son colapsables, así como $q_3$ y $q_4$.
|
|||
\label{fig:fin}
|
||||
\end{figure}
|
||||
|
||||
Veamos otro ejemplo ahora a partir de una tabla.
|
||||
|
||||
\textbf{Ejemplo:} Minimaliza el siguiente autómata
|
||||
\begin{center}
|
||||
\begin{tabular}{||c||c c||}
|
||||
\hline
|
||||
Estado & a & b \\ [0.5ex]
|
||||
\hline\hline
|
||||
$\rightarrow S$ & $Q_1$ & $Q_5$ \\
|
||||
\hline
|
||||
$Q_1$ & $S$ & $Q_5$ \\
|
||||
\hline
|
||||
$Q_2$ & $Q_6$ & $S$ \\
|
||||
\hline
|
||||
$Q_3$ & $Q_7$ & $Q_1$ \\
|
||||
\hline
|
||||
$Q_4$ & $S$ & $Q_6$ \\
|
||||
\hline
|
||||
$Q_5^*$ & $Q_7$ & $Q_2$ \\
|
||||
\hline
|
||||
$Q_6^*$ & $S$ & $Q_3$ \\
|
||||
\hline
|
||||
$Q_7^*$ & $S$ & $Q_2$ \\ [1ex]
|
||||
\hline
|
||||
\end{tabular}
|
||||
\end{center}
|
||||
|
||||
Espero sea claro que $S$ es el estado inicial y $Q_5$, $Q_6$ y $Q_7$, los estados marcados con asterisco, son estados finales. De analizar la tabla podemos encontrar los estados inaccesibles, aquellos estados que no aparezcan del lado derecho de la tabla. Revisando podemos ver que el estado $Q_4$ no aparece en ninguna transición desde otro estado. Podemos eliminarlo.
|
||||
|
||||
\begin{center}
|
||||
\begin{tabular}{||c||c c||}
|
||||
\hline
|
||||
Estado & a & b \\ [0.5ex]
|
||||
\hline\hline
|
||||
$S$ & $Q_1$ & $Q_5$ \\
|
||||
\hline
|
||||
$Q_1$ & $S$ & $Q_5$ \\
|
||||
\hline
|
||||
$Q_2$ & $Q_6$ & $S$ \\
|
||||
\hline
|
||||
$Q_3$ & $Q_7$ & $Q_1$ \\
|
||||
\hline
|
||||
$Q_5^*$ & $Q_7$ & $Q_2$ \\
|
||||
\hline
|
||||
$Q_6^*$ & $S$ & $Q_3$ \\
|
||||
\hline
|
||||
$Q_7^*$ & $S$ & $Q_2$ \\ [1ex]
|
||||
\hline
|
||||
\end{tabular}
|
||||
\end{center}
|
||||
|
||||
Ya sin estados inaccesibles armamos la tabla \ref{tab:1}, empezando vacía y marcamos, como lo dice el algoritmo, las parejas \{\emph{estado final, no estado final}\} o viceversa.
|
||||
|
||||
\begin{table}[h!]
|
||||
\begin{center}
|
||||
\begin{tabular}{c c c c c c c}
|
||||
\hline
|
||||
$S$ & & & & & & \\
|
||||
\hline
|
||||
& $Q_1$ & & & & & \\
|
||||
\hline
|
||||
& & $Q_2$ & & & & \\
|
||||
\hline
|
||||
& & & $Q_3$ & & & \\
|
||||
\hline
|
||||
& & & & $Q_5$ & & \\
|
||||
\hline
|
||||
& & & & & $Q_6$ & \\
|
||||
\hline
|
||||
& & & & & & $Q_7$ \\[1ex]
|
||||
\hline
|
||||
\end{tabular}
|
||||
\caption{Tabla para la minimalización de estados del autómata.}
|
||||
\label{tab:1}
|
||||
\end{center}
|
||||
\end{table}
|
||||
|
||||
Una vez marcadas las parejas \{\emph{estado final, no estado final}\}, revisamos las posibles transiciones de cada estado de la pareja para cada símbolo del alfabeto.
|
||||
|
||||
\begin{table}[h!]
|
||||
\begin{center}
|
||||
\begin{tabular}{c c c c c c c}
|
||||
\hline
|
||||
$S$ & & & & & & \\
|
||||
\hline
|
||||
& $Q_1$ & & & & & \\
|
||||
\hline
|
||||
& & $Q_2$ & & & & \\
|
||||
\hline
|
||||
& & & $Q_3$ & & & \\
|
||||
\hline
|
||||
\checkmark& \checkmark & \checkmark & \checkmark & $Q_5$ & & \\
|
||||
\hline
|
||||
\checkmark & \checkmark & \checkmark & \checkmark & & $Q_6$ & \\
|
||||
\hline
|
||||
\checkmark & \checkmark & \checkmark & \checkmark & & & $Q_7$ \\[1ex]
|
||||
\hline
|
||||
\end{tabular}
|
||||
\caption{Tabla para la minimalización de estados del autómata.}
|
||||
\label{tab:2}
|
||||
\end{center}
|
||||
\end{table}
|
||||
|
||||
Se pueden ver las siguientes posibilidades:
|
||||
|
||||
\begin{align*}
|
||||
\{S,Q_1\} &\overset{a}{\rightarrow} \{Q_1,S\} \text{, que no está marcado} \\
|
||||
\{S,Q_1\} &\overset{b}{\rightarrow} \{Q_5,Q_5\} \text{, que no puede estar marcado}\\
|
||||
\{S,Q_2\} &\overset{a}{\rightarrow} \{Q_1,Q_6\} \text{, que sí está marcado \checkmark}\\
|
||||
\{S,Q_3\} &\overset{a}{\rightarrow} \{Q_1,Q_7\} \text{, que sí está marcado \checkmark}\\
|
||||
\{Q_1,Q_2\} &\overset{a}{\rightarrow} \{S,Q_6\} \text{, que sí está marcado \checkmark}\\
|
||||
\{Q_1,Q_3\} &\overset{a}{\rightarrow} \{S,Q_7\} \text{, que sí está marcado \checkmark}\\
|
||||
\{Q_2,Q_3\} &\overset{a}{\rightarrow} \{Q_6,Q_7\} \text{, que no está marcado}\\
|
||||
\{Q_2,Q_3\} &\overset{b}{\rightarrow} \{S,Q_1\} \text{, que no está marcado}\\
|
||||
\{Q_5,Q_6\} &\overset{a}{\rightarrow} \{Q_7,S\} \text{, que sí está marcado \checkmark}\\
|
||||
\{Q_5,Q_7\} &\overset{a}{\rightarrow} \{Q_7,S\} \text{, que sí está marcado \checkmark}\\
|
||||
\{Q_6,Q_7\} &\overset{a}{\rightarrow} \{S,S\} \text{, que no puede estar marcado}\\
|
||||
\{Q_6,Q_7\} &\overset{b}{\rightarrow} \{Q_3,Q_2\} \text{, que no está marcado}
|
||||
\end{align*}
|
||||
|
||||
Una vez con viendo las transiciones podemos seguir repitiendo el paso, pero vemos que las parejas sin marcar siguen si poderse marcar. Para ese caso la tabla queda como se ve en \ref{tab:3}
|
||||
|
||||
\begin{table}[h!]
|
||||
\begin{center}
|
||||
\begin{tabular}{c c c c c c c}
|
||||
\hline
|
||||
$S$ & & & & & & \\
|
||||
\hline
|
||||
& $Q_1$ & & & & & \\
|
||||
\hline
|
||||
\checkmark & \checkmark & $Q_2$ & & & & \\
|
||||
\hline
|
||||
\checkmark & \checkmark & & $Q_3$ & & & \\
|
||||
\hline
|
||||
\checkmark& \checkmark & \checkmark & \checkmark & $Q_5$ & & \\
|
||||
\hline
|
||||
\checkmark & \checkmark & \checkmark & \checkmark & \checkmark & $Q_6$ & \\
|
||||
\hline
|
||||
\checkmark & \checkmark & \checkmark & \checkmark & \checkmark & & $Q_7$ \\[1ex]
|
||||
\hline
|
||||
\end{tabular}
|
||||
\caption{Tabla para la minimalización de estados del autómata.}
|
||||
\label{tab:3}
|
||||
\end{center}
|
||||
\end{table}
|
||||
|
||||
Lo que quiere decir, que aunque demos más vueltas ya no podemos marcar más y por lo tanto las equivalencias son $S\equiv Q_1$, $Q_2\equiv Q_3$ y $Q_6\equiv Q_7$, estos estados pueden colapsarse. Les muestro la tabla y ya les toca a ustedes hacer el autómata:
|
||||
|
||||
\begin{center}
|
||||
\begin{tabular}{||c||c c||}
|
||||
\hline
|
||||
Estado & a & b \\ [0.5ex]
|
||||
\hline\hline
|
||||
$\{S,Q_1\}$ & $\{S,Q_1\}$ & $Q_5$ \\
|
||||
\hline
|
||||
$\{Q_2,Q_3\}$ & $\{Q_6,Q_7\}$ & $\{S,Q_1\}$ \\
|
||||
\hline
|
||||
$Q_5^*$ & $\{Q_6,Q_7\}$ & $\{Q_2,Q_3\}$ \\
|
||||
\hline
|
||||
$\{Q_6,Q_7\}^*$ & $S$ & $\{Q_2,Q_3\}$ \\
|
||||
\hline
|
||||
\end{tabular}
|
||||
\end{center}
|
||||
|
||||
\begin{thebibliography}{10}
|
||||
\bibitem{Kozen} Kozen, Dexter C. ``Automata and Computability'' Springer (1997)
|
||||
\bibitem{Sipser} Sipser, Michael ``Introduction to the Theory of Computation'' 2a ed., Thomson Course Tecnology (2006)
|
||||
|
|
Loading…
Reference in New Issue