-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Check for bug in .union for transitions that go backwards #11
Comments
The theoretical logic for union is
I think this algorithm provides closure for all possible DFAs. It would be nice to avoid NFA construction for such a basic operation. |
Maybe something like |
Update with solution: Since this is union, we don't care if one or both machines could potentially accept, so these states can be merged. Thus "backwards" transitions can move back onto the middle path and we don't care about the implication. Any accept states from either machine will be final states for the union. |
The precise union of DFAs is defined simply as the union of final states + the product of transitions. |
which is still xy bounded in space and time complexity, but this bugs out with current union op. |
I heard a rumor that |
The simplest union algorithm that I can think of is that a union state is either
This algorithm would still yield an O(xy) upper bound, so it is a good fallback to cover the problematic cases with back edges. |
This may be bugged, the current solution seems shaky. Try union on some more complex state machines in tests.
The text was updated successfully, but these errors were encountered: