Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancing Regular Language Parsing: NFA to DFA, State Minimization, and Optimization Algorithms #21

Closed
vaishakhRaveendran opened this issue Jun 26, 2024 · 3 comments · Fixed by #22
Assignees
Labels
compiler Related to the Vyaakaran compiler enhancement New feature or request FOSS Hack Good issues for FOSS Hack participants

Comments

@vaishakhRaveendran
Copy link
Contributor

Description:

We propose the following enhancements to improve the efficiency of regular language processing:

  • NFA to DFA Conversion: Implement the subset construction algorithm to convert Non-deterministic Finite Automata (NFA) to Deterministic Finite Automata (DFA).

  • DFA State Minimization: Add an algorithm to minimize DFA states by merging equivalent states, producing a more efficient automaton.

  • Optimization Algorithms:

    • Forward Reachability: Determine the set of states reachable from the initial state and remove unreachable states.
    • Co-reachability: Identify states that can reach a final state and eliminate non-contributing states.

@blenderskool blenderskool added enhancement New feature or request compiler Related to the Vyaakaran compiler FOSS Hack Good issues for FOSS Hack participants labels Jun 26, 2024
@blenderskool
Copy link
Owner

@vaishakhRaveendran How would the forward reachability changes be different from the current implementation?

@vaishakhRaveendran
Copy link
Contributor Author

We're planning to use a breadth-first search (BFS) starting from the initial state 'S' to explore all the reachable nodes in the finite automaton. Yes, it is kind of similar to the current implementation. It's an experiment we're trying out. We've noticed it can be a lot faster with parallelization for larger graphs. We're aiming to build this if we can.

@blenderskool
Copy link
Owner

blenderskool commented Jun 27, 2024

@vaishakhRaveendran Sure, do take a shot at it. I would recommend exploring the BFS approach if you have time. Other enhancements are actual extensions to the project, while this may just be a performance improvement. Also, do measure the computation times before / after the forward reachability changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler Related to the Vyaakaran compiler enhancement New feature or request FOSS Hack Good issues for FOSS Hack participants
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants