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

Incorrect Starting States in DFA #252

Open
cmsalser opened this issue Feb 16, 2023 · 0 comments
Open

Incorrect Starting States in DFA #252

cmsalser opened this issue Feb 16, 2023 · 0 comments

Comments

@cmsalser
Copy link

Description

While working with conversions between NFA's and DFA's, I noticed an issue where the starting state had changed from the corresponding NFA.

Cases

  • a?
    { "_nfa": { "in": { "_transitions": {}, "accepting": false, "number": 1, "_epsilonClosure": {} }, "out": { "_transitions": {}, "accepting": true, "number": 2, "_epsilonClosure": {} }, "_transitionTable": { "1": { "a": [ 2 ], "ε*": [ 1, 2 ] }, "2": { "ε*": [ 2 ] } }, "_acceptingStates": {}, "_alphabet": {}, "_acceptingStateNumbers": {} }, "_acceptingStateNumbers": {}, "_originalTransitionTable": { "2": {}, "1,2": { "a": "2" } }, "_originalAcceptingStateNumbers": {}, "_transitionTable": { "1": {}, "2": { "a": 1 } } }
  • (a|b)d
    { "_nfa": { "in": { "_transitions": {}, "accepting": false, "number": 1, "_epsilonClosure": {} }, "out": { "_transitions": {}, "accepting": true, "number": 6, "_epsilonClosure": {} }, "_transitionTable": { "1": { "ε*": [ 1, 2, 7 ] }, "2": { "a": [ 3 ], "ε*": [ 2 ] }, "3": { "ε*": [ 3, 4, 5 ] }, "4": { "ε*": [ 4, 5 ] }, "5": { "c": [ 6 ], "ε*": [ 5 ] }, "6": { "ε*": [ 6 ] }, "7": { "b": [ 8 ], "ε*": [ 7 ] }, "8": { "ε*": [ 8, 4, 5 ] } }, "_acceptingStates": {}, "_alphabet": {}, "_acceptingStateNumbers": {} }, "_acceptingStateNumbers": {}, "_originalTransitionTable": { "6": {}, "1,2,7": { "a": "3,4,5", "b": "8,4,5" }, "8,4,5": { "c": "6" }, "3,4,5": { "c": "6" } }, "_originalAcceptingStateNumbers": {}, "_transitionTable": { "1": {}, "2": { "a": 4, "b": 3 }, "3": { "c": 1 }, "4": { "c": 1 } } }
    For the above NFAs, the starting state is 1, however when converting to DFA, the new start changes to 2.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant