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

Improve insert_word and insert_identity #394

Merged
merged 3 commits into from
Mar 5, 2024
Merged

Conversation

koniksedy
Copy link
Collaborator

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

  • Modifications to methods nfa::Nfa::insert_word(), nft::Nft::insert_word(), and nft::Nft::insert_word_by_parts(), which now have an optional target state (default Limits::max_state).
    • If the target state is not specified, a new state will be created.
    • These methods return the target state.
  • An overloaded method nft::Nft::insert_identity() that can create identity transitions for each symbol in a given vector.

@koniksedy koniksedy requested a review from Adda0 March 3, 2024 18:32
Copy link

codecov bot commented Mar 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

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
@@                  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              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Adda0
Copy link
Collaborator

Adda0 commented Mar 5, 2024

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.

@Adda0 Adda0 force-pushed the nft-insert_word branch from b98af29 to f0ac876 Compare March 5, 2024 10:44
@Adda0 Adda0 merged commit 66870fb into states_with_levels Mar 5, 2024
18 checks passed
@Adda0 Adda0 deleted the nft-insert_word branch March 5, 2024 10:56
Adda0 added a commit that referenced this pull request Mar 6, 2024
Improve insert_word and insert_identity
Adda0 added a commit that referenced this pull request Mar 28, 2024
Improve insert_word and insert_identity
Adda0 added a commit that referenced this pull request Apr 15, 2024
Improve insert_word and insert_identity
Adda0 added a commit that referenced this pull request Nov 18, 2024
Improve insert_word and insert_identity
Adda0 added a commit that referenced this pull request Nov 21, 2024
Improve insert_word and insert_identity
Adda0 added a commit that referenced this pull request Nov 21, 2024
Improve insert_word and insert_identity
Adda0 added a commit that referenced this pull request Nov 22, 2024
Improve insert_word and insert_identity
Adda0 added a commit that referenced this pull request Dec 2, 2024
Improve insert_word and insert_identity
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

Successfully merging this pull request may close these issues.

2 participants