Commit a60be41b authored by Vladimír Štill's avatar Vladimír Štill
Browse files

dfa: Report a more reasonable error if an automaton cannot be canonised

parent d008f682
Pipeline #76433 passed with stage
in 50 seconds
......@@ -330,6 +330,11 @@ class DFA:
if tgt is not None and tgt not in state_map.keys():
for st, _ in self.transition.keys():
if st not in state_map:
raise Exception("Automaton cannot be canonised, it has "
"unreachable states")
return DFA(set(state_map.values()),
{(state_map[st], ch): state_map[tgt]
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment