-
Notifications
You must be signed in to change notification settings - Fork 13
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
Hopcroft's minimization: Valmari and Lehtinen's variant for a partial transition function #475
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## devel #475 +/- ##
==========================================
+ Coverage 73.67% 74.46% +0.78%
==========================================
Files 30 30
Lines 4251 4413 +162
Branches 968 1003 +35
==========================================
+ Hits 3132 3286 +154
- Misses 771 772 +1
- Partials 348 355 +7 ☔ View full report in Codecov by Sentry. |
That looks really good! Just to be safe, can you also compare the size of minimized automata by Brzozowski and Hopcroft? If they are actually always same. Also, maybe we should make it the default minimization algorithm (for the dispatcher function, if we have it + maybe have two versions of the dispatcher function, one take nfa, one dfa). |
I agree. Maybe we should have Or even better, |
I've already tested it. Apart from Brzozowski creating (for some reason) an automaton with one initial state for an empty automaton, the automata are indeed the same in language and size. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR looks great. When we finish the discussion regarding the interface, I will approve and merge the PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, I would still make it a default minimization algorithm, but that can be further PR.
This PR introduces the implementation of Valmaria and Lehtinin's variant of Hopcroft's minimization of deterministic finite automata with partial transition function.
The performance of this reduction method was tested against Brzozowski's minimization and simulation on determinized automata obtained from:
Timeouts
The timeout was set to 10 seconds.
All Benchmarks
It can be seen that Hopcoroft's algorithm is, on average, 100x faster than Brzozowski or the simulation.
Cactus Plot
Scatter Plot Matrix
Abstract Regular Model Checking
Cactus Plot
Scatter Plot Matrix
WS1S logic
These automate have a binary alphabet.
Cactus Plot
Scatter Plot Matrix
RegexLib
Cactus Plot
Scatter Plot Matrix
Email Validation
Cactus Plot
Scatter Plot Matrix
Norn and SyGuS-qgen and Others
Cactus Plot
Scatter Plot Matrix
Tabakov-Vardi
Automata were generated with 10, 50, 100, and 200 states, for alphabets containing 2, 4, 8, and 16 symbols, and with a transitions-to-states ratio per symbol ranging from 0.1 to 1.
Cactus Plot
Scatter Plot Matrix