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

Implement NFT operations for solving string constraints replace(_re)() and replace(_re)_all() #391

Merged
merged 42 commits into from
Mar 6, 2024

Conversation

Adda0
Copy link
Collaborator

@Adda0 Adda0 commented Mar 1, 2024

This PR implements the first part of implementation of reluctant replace operations for string solving. This PR includes implementation of functions to create reluctant NFAs and NFTs which perform the reluctant match of a regex, and reluctant replacement operations (for replace_re_all() and replace_re() operations), respectively. Furthermore, the PR implements creation of begin marker DFT which precedes the reluctant replace NFT in reluctant replace modelling.

This PR implements creation of NFTs for reluctant replace of:

  • general regular expression (expected to be the slowest, but handles all regular expression cases) being replaced with a literal,
  • literal being replaced with a literal, and
  • single symbol being replaced with a literal (including a single symbol).

Further implementation except for optimization of the current methods may include generation of NFTs for finite regular language replacement. However, I believe that in our implementation (using data structure Delta), the NFT's state space would explode

Copy link

codecov bot commented Mar 1, 2024

Codecov Report

Attention: Patch coverage is 92.60204% with 29 lines in your changes are missing coverage. Please review.

Project coverage is 74.66%. Comparing base (f0ac876) to head (73ad4f6).
Report is 1 commits behind head on states_with_levels.

Files Patch % Lines
src/nft/operations.cc 75.71% 13 Missing and 4 partials ⚠️
src/nft/strings.cc 95.58% 6 Missing and 6 partials ⚠️
Additional details and impacted files
@@                  Coverage Diff                   @@
##           states_with_levels     #391      +/-   ##
======================================================
+ Coverage               73.43%   74.66%   +1.23%     
======================================================
  Files                      43       43              
  Lines                    5180     5487     +307     
  Branches                 1173     1215      +42     
======================================================
+ Hits                     3804     4097     +293     
- Misses                    939      947       +8     
- Partials                  437      443       +6     

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

@koniksedy koniksedy self-requested a review March 1, 2024 09:43
@Adda0 Adda0 force-pushed the reluctant_replace branch 2 times, most recently from 92907d7 to 793521e Compare March 1, 2024 12:45
@Adda0 Adda0 removed the request for review from koniksedy March 1, 2024 12:52
@Adda0 Adda0 force-pushed the reluctant_replace branch from fae9217 to 567492b Compare March 4, 2024 09:54
@Adda0 Adda0 force-pushed the reluctant_replace branch from 9c696e8 to 73ad4f6 Compare March 6, 2024 11:48
@Adda0 Adda0 marked this pull request as ready for review March 6, 2024 11:48
@Adda0 Adda0 requested a review from koniksedy March 6, 2024 11:48
@Adda0
Copy link
Collaborator Author

Adda0 commented Mar 6, 2024

I will merge the PR immediately due to time constraint reasons. The reviewers can submit their review later and the issues raised in the reviews will be resolved in future PRs.

@Adda0 Adda0 merged commit 5a9b4de into states_with_levels Mar 6, 2024
18 checks passed
@Adda0 Adda0 deleted the reluctant_replace branch March 6, 2024 11:59
Adda0 added a commit that referenced this pull request Mar 28, 2024
Implement NFT operations for solving string constraints `replace(_re)()` and `replace(_re)_all()`
Adda0 added a commit that referenced this pull request Apr 15, 2024
Implement NFT operations for solving string constraints `replace(_re)()` and `replace(_re)_all()`
Adda0 added a commit that referenced this pull request Nov 18, 2024
Implement NFT operations for solving string constraints `replace(_re)()` and `replace(_re)_all()`
Adda0 added a commit that referenced this pull request Nov 21, 2024
Implement NFT operations for solving string constraints `replace(_re)()` and `replace(_re)_all()`
Adda0 added a commit that referenced this pull request Nov 21, 2024
Implement NFT operations for solving string constraints `replace(_re)()` and `replace(_re)_all()`
Adda0 added a commit that referenced this pull request Nov 22, 2024
Implement NFT operations for solving string constraints `replace(_re)()` and `replace(_re)_all()`
Adda0 added a commit that referenced this pull request Dec 2, 2024
Implement NFT operations for solving string constraints `replace(_re)()` and `replace(_re)_all()`
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