Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
fja
eval
Commits
a60be41b
Commit
a60be41b
authored
Apr 02, 2021
by
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
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
lib/dfa.py
View file @
a60be41b
...
...
@@ -330,6 +330,11 @@ class DFA:
if
tgt
is
not
None
and
tgt
not
in
state_map
.
keys
():
queue
.
append
(
tgt
)
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
()),
deepcopy
(
self
.
characters
),
{(
state_map
[
st
],
ch
):
state_map
[
tgt
]
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment