Este documento describe un programa en C para convertir un autómata finito no determinista (AFN) a un autómata finito determinista (AFD). El programa toma como entrada la descripción del AFN incluyendo su alfabeto, estados, estado inicial, estados finales y matriz de transiciones, y produce como salida la descripción del AFD equivalente. El documento explica las funciones utilizadas como cierre epsilon, mover, copiar estados y marcar estados, y provee un ejemplo de ejecución del programa.
0 calificaciones0% encontró este documento útil (0 votos)
68 vistas12 páginas
Este documento describe un programa en C para convertir un autómata finito no determinista (AFN) a un autómata finito determinista (AFD). El programa toma como entrada la descripción del AFN incluyendo su alfabeto, estados, estado inicial, estados finales y matriz de transiciones, y produce como salida la descripción del AFD equivalente. El documento explica las funciones utilizadas como cierre epsilon, mover, copiar estados y marcar estados, y provee un ejemplo de ejecución del programa.
Este documento describe un programa en C para convertir un autómata finito no determinista (AFN) a un autómata finito determinista (AFD). El programa toma como entrada la descripción del AFN incluyendo su alfabeto, estados, estado inicial, estados finales y matriz de transiciones, y produce como salida la descripción del AFD equivalente. El documento explica las funciones utilizadas como cierre epsilon, mover, copiar estados y marcar estados, y provee un ejemplo de ejecución del programa.
Este documento describe un programa en C para convertir un autómata finito no determinista (AFN) a un autómata finito determinista (AFD). El programa toma como entrada la descripción del AFN incluyendo su alfabeto, estados, estado inicial, estados finales y matriz de transiciones, y produce como salida la descripción del AFD equivalente. El documento explica las funciones utilizadas como cierre epsilon, mover, copiar estados y marcar estados, y provee un ejemplo de ejecución del programa.
Descargue como DOCX, PDF, TXT o lea en línea desde Scribd
Descargar como docx, pdf o txt
Está en la página 1de 12
UNIVERSIDAD NACIONAL DE TRUJILLO
ESCUELA ACADEMICO PROFESIONAL DE INFORMATICA
Curso: Teora de la computacin - Laboratorio
Profesor: Yensi Vega
Alumno: Alex Navez Marios
Trabajo: Programa para convertir un AFN a AFD He codificado este programa en c usando el IDE code block
Para probar este programa he utilizado este autmata como ejemplo:
Haciendo su diagrama en JFLAP:
Y la siguiente tabla de transiciones:
Como entradas para mi programa tengo: Cantidad de elementos del alfabeto Ingresar los elementos Cantidad de estados del autmata Ingresar los estados del autmata El estado inicial Los estados finales La matriz de transiciones Y la palabra que se desea analizar Y como salida tengo: Palabra pertenece al leguaje No pertenece al lenguaje
En la siguiente captura de pantalla demuestro el ingreso de los datos y la salida. Ingrese la palabra 011 y pertenece al lenguaje. Ingrese la palabra 10 y no pertenece al lenguaje.
PROGRAMA PARA CONVERTIR UN AUTOMATA FINITO NO DETERMINISTA (AFN) A UN AUTOMATA FINITO DETERMINISTA (AFD)
Este programa fue hecho ayudndome con la teora de internet y codificado en C usando el IDE Code Blocks
int main() // afnafd.cpp { int m,i,j,k; int t[AFN_MAX]; int estadosD[AFN_MAX][AFN_MAX],nest=0; int nD[AFN_MAX]; int a[AFN_MAX],na; char* alfabeto="ab";