VeriFIT / mata

A fast and simple automata library
MIT License
20 stars 13 forks source link

Improve insert_word and insert_identity #394

Closed koniksedy closed 7 months ago

koniksedy commented 7 months ago

This PR, based on notes from PR-Nfa compose, includes:

codecov[bot] commented 7 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 73.43%. Comparing base (485b91e) to head (f0ac876). Report is 1 commits behind head on states_with_levels.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## states_with_levels #394 +/- ## ====================================================== + Coverage 73.32% 73.43% +0.10% ====================================================== Files 43 43 Lines 5170 5180 +10 Branches 1173 1173 ====================================================== + Hits 3791 3804 +13 + Misses 942 939 -3 Partials 437 437 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

Adda0 commented 7 months ago

We cannot use Limits::max_state. We need to probably have two overloaded functions. One with the normal parameters without target state which will inside the function default to nfa.num_of_states(), and another with explicit target state parameter (the original function). I consider this approach a cleaner solution than the current one since Limits::max_state is still technically a valid state.