{"id":19162408,"url":"https://github.com/rezamardanidev/finite-acceptor","last_synced_at":"2025-04-14T19:22:11.951Z","repository":{"id":215139006,"uuid":"738216685","full_name":"rezamardaniDev/finite-acceptor","owner":"rezamardaniDev","description":"Python implementation of a Deterministic Finite Automaton (DFA) with interactive testing. Verify input string acceptance and explore language processing concepts","archived":false,"fork":false,"pushed_at":"2024-01-02T18:02:38.000Z","size":6,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-28T07:41:40.285Z","etag":null,"topics":["computational-theory","deterministic-finite-automaton","dfa","finite-automaton","state-machine"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rezamardaniDev.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}},"created_at":"2024-01-02T17:49:23.000Z","updated_at":"2025-01-13T09:01:26.000Z","dependencies_parsed_at":"2024-01-02T18:54:43.999Z","dependency_job_id":"a78683ba-2335-40cf-845d-74f5d65303fa","html_url":"https://github.com/rezamardaniDev/finite-acceptor","commit_stats":null,"previous_names":["rezamardanidev/finite-acceptor"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rezamardaniDev%2Ffinite-acceptor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rezamardaniDev%2Ffinite-acceptor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rezamardaniDev%2Ffinite-acceptor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rezamardaniDev%2Ffinite-acceptor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rezamardaniDev","download_url":"https://codeload.github.com/rezamardaniDev/finite-acceptor/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248943415,"owners_count":21186958,"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":["computational-theory","deterministic-finite-automaton","dfa","finite-automaton","state-machine"],"created_at":"2024-11-09T09:10:58.515Z","updated_at":"2025-04-14T19:22:11.929Z","avatar_url":"https://github.com/rezamardaniDev.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Finite Automaton\n\nThis Python script implements a Finite Automaton class capable of handling Deterministic Finite Automata (DFA). The `FiniteAutomaton` class is defined with methods to check if the automaton is a DFA and to determine if a given input string is accepted.\n\n## Usage\n\n### FiniteAutomaton Class\n\nThe `FiniteAutomaton` class is initialized with the following parameters:\n- `states`: Set of states in the automaton.\n- `alphabet`: Set of symbols in the input alphabet.\n- `transitions`: Dictionary representing the transitions between states based on input symbols.\n- `start_state`: The initial state of the automaton.\n- `final_states`: Set of final/accepting states.\n\n#### Methods\n\n1. `is_dfa()`: Checks if the automaton is a Deterministic Finite Automaton (DFA).\n\n2. `accept_input(input_string)`: Accepts an input string and determines if it is accepted by the automaton. Returns a tuple of acceptance status and the sequence of visited states.\n\n### Reading Transition File\n\nThe script includes a function `read_transition_file(file_path)` to read transition information from a file and convert it into a dictionary used by the `FiniteAutomaton` class.\n\n## Example\n\nTo use the script, create an instance of the `FiniteAutomaton` class with the necessary parameters, and interactively test input strings.\n\n```bash\npython main.py\nThe script prompts the user to enter a string and outputs whether the string is accepted or not, along with the sequence of visited states.\n\nFile Structure\nmain.py: The main Python script containing the FiniteAutomaton class and the main() function for interactive testing.\ntransitions.txt: Example file containing transition information.\nFeel free to modify the automaton parameters and transition file to suit your specific use case.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frezamardanidev%2Ffinite-acceptor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frezamardanidev%2Ffinite-acceptor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frezamardanidev%2Ffinite-acceptor/lists"}