Skip to content

feat: S[ubs]tring.{posOf,contains}S[ubs]tr#172

Closed
JamesGallicchio wants to merge 3 commits intoleanprover-community:mainfrom
JamesGallicchio:feat/isSubstr
Closed

feat: S[ubs]tring.{posOf,contains}S[ubs]tr#172
JamesGallicchio wants to merge 3 commits intoleanprover-community:mainfrom
JamesGallicchio:feat/isSubstr

Conversation

@JamesGallicchio
Copy link
Copy Markdown
Collaborator

Adds functions for finding or checking existence of strings in strings and substrings in substrings and those things in between.

Worst-case O(nm) runtime on all new functions, where n = |s|, m = |pattern|.

fgdorais added a commit to fgdorais/batteries that referenced this pull request Jul 7, 2023
fgdorais added a commit to fgdorais/batteries that referenced this pull request Jul 7, 2023
@fgdorais fgdorais mentioned this pull request Jul 7, 2023
1 task
@fgdorais
Copy link
Copy Markdown
Collaborator

fgdorais commented Jul 12, 2023

#178 now incorporates this PR with worst case O(n+m) runtime on all new functions, where n = |s|, m = |pattern|.

fgdorais added a commit to fgdorais/batteries that referenced this pull request Aug 4, 2023
fgdorais added a commit to fgdorais/batteries that referenced this pull request Aug 15, 2023
fgdorais added a commit to fgdorais/batteries that referenced this pull request Aug 17, 2023
@fgdorais fgdorais added the WIP work in progress label Aug 21, 2023
@fgdorais
Copy link
Copy Markdown
Collaborator

I'm marking this as WIP since it's incorporated into #178. (At least partly, I think I modified some bits.) If you want to close it, that's fine too. Remember that you can always comment on #178 if the edits I made are inappropriate for your needs.

@kim-em
Copy link
Copy Markdown
Collaborator

kim-em commented Aug 21, 2023

I think it's fine to just close. @JamesGallicchio is probably happy with the outcome of a faster implementation, and can take the credit for nerd-snipping @fgdorais into making the #178 PR. :-) Of course can be re-opened etc if I've missed something.

@kim-em kim-em closed this Aug 21, 2023
@JamesGallicchio
Copy link
Copy Markdown
Collaborator Author

At first I was thinking the naive implementation should be kept around as the reference implementation against which we verify correctness, but then I decided that I do not care about the functional correctness of string matching :-)

@digama0
Copy link
Copy Markdown
Member

digama0 commented Aug 22, 2023

the naive implementation isn't naive enough to be usable as a model for functional correctness. I would prefer <:+: on the underlying lists for the model.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

WIP work in progress

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants