{"id":24186076,"url":"https://github.com/carlosagalicia/regex_to_dfa","last_synced_at":"2025-07-24T20:08:23.032Z","repository":{"id":269632678,"uuid":"908049096","full_name":"carlosagalicia/regex_to_DFA","owner":"carlosagalicia","description":"Program to convert regular expressions into their corresponding NFA (Non-deterministic Finite Automaton) and subsequently into a DFA (Deterministic Finite Automaton).","archived":false,"fork":false,"pushed_at":"2024-12-28T00:58:03.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-13T12:44:51.588Z","etag":null,"topics":["data-structures","nfa-to-dfa-conversion","python","regex"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/carlosagalicia.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-25T01:34:26.000Z","updated_at":"2024-12-28T03:12:32.000Z","dependencies_parsed_at":"2024-12-25T02:30:00.549Z","dependency_job_id":"9f4adc03-7151-4bc6-931c-bde2e885b01e","html_url":"https://github.com/carlosagalicia/regex_to_DFA","commit_stats":null,"previous_names":["carlosagalicia/regex_to_dfa"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carlosagalicia%2Fregex_to_DFA","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carlosagalicia%2Fregex_to_DFA/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carlosagalicia%2Fregex_to_DFA/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carlosagalicia%2Fregex_to_DFA/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/carlosagalicia","download_url":"https://codeload.github.com/carlosagalicia/regex_to_DFA/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241596244,"owners_count":19988041,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["data-structures","nfa-to-dfa-conversion","python","regex"],"created_at":"2025-01-13T12:33:47.833Z","updated_at":"2025-03-03T01:41:15.203Z","avatar_url":"https://github.com/carlosagalicia.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Regex to NFA and DFA Conversion\n## Overview\nThis project implements a program to convert regular expressions into their corresponding NFA (Non-deterministic Finite Automaton) and subsequently into a DFA (Deterministic Finite Automaton). The program includes functionality for:\n- Parsing regular expressions with operators like concatenation (.), union (|), Kleene star (*), and Kleene plus (+).\n- Constructing an NFA using the Thompson construction algorithm.\n- Converting the NFA into a DFA using the subset construction algorithm.\n- Visualizing the NFA and DFA states and transitions.\n\n## Key Learning\nThis project emphasizes several computer science concepts:\n- **Regular Expressions:** Parsing and transforming expressions for processing.\n- **Finite Automata Theory:** Understanding NFA and DFA construction and differences.\n- **Algorithms:** Thompson and subset construction algorithms for finite automata.\n- **Data Structures:** Efficient use of lists, sets, and dictionaries for state management.\n\n## Tools and Languages\n- **Programming Language:** Python\n- **Libraries:** No external libraries are required; the implementation is purely algorithmic.\n\n## Installation and Usage\n\n### Requirements\n- Python 3.7 or higher\n\n## Instructions\n1. Clone the repository\n  ```bash\n  git clone https://github.com/carlosagalicia/regex_to_DFA.git\n  ```\n\n2. Run the script\n  ```bash\n  python actividad_integradora_1.py\n  ```\n3. Input the alphabet and the regular expression when prompted. The program will display the NFA and DFA transitions.\n\n## Example Input and Output\nInput:\n```bash\n  Alphabet: ab\n  Regex: ab|a*\n```\nOutput:\n```bash\n  ---RESULTS---\n  INPUT:\n  ab|a*\n  NFA:\n  0 =\u003e [(1, 'a')]\n  1 =\u003e [(2, '#')]\n  2 =\u003e [(3, 'b')]\n  3 =\u003e [(9, '#')]\n  4 =\u003e [(5, 'a')]\n  5 =\u003e [(4, '#'), (7, '#')]\n  6 =\u003e [(4, '#'), (7, '#')]\n  7 =\u003e [(9, '#')]\n  8 =\u003e [(0, '#'), (6, '#')]\n  Accepting state: 9\n  DFA:\n  A =\u003e [('B', 'a')]\n  B =\u003e [('C', 'a'), ('D', 'b')]\n  C =\u003e [('C', 'a')]\n  D =\u003e []\n  Accepting states: ['A', 'B', 'C', 'D']\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarlosagalicia%2Fregex_to_dfa","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcarlosagalicia%2Fregex_to_dfa","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarlosagalicia%2Fregex_to_dfa/lists"}