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

Search: Optionally require symbols to be adjacent (low priority) #57

Closed
david-a-wheeler opened this issue May 28, 2023 · 6 comments
Closed
Labels
Alg related to algorithms

Comments

@david-a-wheeler
Copy link
Contributor

david-a-wheeler commented May 28, 2023

Search is easy to use, but it's hard to be specific because it allows 0+ symbols between each symbol.

It'd be nice to have an option (irrelevant in regex) to require that "symbols must be adjacent". If enabled, the pattern specifies a sequence of symbols that must be adjacent (though they could be inside a matching statement). Obviously this is only useful once the search pattern can search on variables (since otherwise there are few useful working patterns).

As a bonus you might add symbols that re-add flexibility. E.g., $$ for one symbol, $+ for 1 or more unspecified symbols, and $*for 0 or more symbols. But that could be done later or never. I'm not sure what the right specifiers should be in this case, and that extra flexibility would require backtracking (or using a DFA which would be complete overkill in this case).

@david-a-wheeler david-a-wheeler changed the title Search: Optionally require symbols to be adjacent Search: Optionally require symbols to be adjacent (low priority) May 28, 2023
@expln expln added the Alg related to algorithms label Jun 7, 2023
@expln
Copy link
Owner

expln commented Oct 26, 2024

This functionality is available on dev. To mark symbols as adjacent add a modifier before the pattern $+. $ begins a list of modifiers. + stands for "adjacent". There are other modifiers available as well. They are listed in this document https://github.com/expln/metamath-lamp-docs/blob/master/explorer/search_by_pattern.md

As you pointed out, the feature of re-adding flexibility requires much more efforts to implement. So, I am currently not planning to implement it.

@david-a-wheeler
Copy link
Contributor Author

Awesome! Let me know when that's in a released version, and I'll update the doc to match.

My primary desire now is #77 (full unification) but obviously that's a subtle algorithm that is much harder :-).

Repository owner deleted a comment from Igorocky Nov 1, 2024
@expln
Copy link
Owner

expln commented Nov 1, 2024

Awesome! Let me know when that's in a released version, and I'll update the doc to match.

Sure. I am going to release what currently is in the dev version after some testing. I also created a CHANGELOG.md, so it should be easier to track changes now.

My primary desire now is #77 (full unification) but obviously that's a subtle algorithm that is much harder :-).

Yeah, I remember that issue :)

@expln
Copy link
Owner

expln commented Nov 2, 2024

@david-a-wheeler

Hi David, this feature is released in version 25.

@expln expln closed this as completed Nov 2, 2024
@expln expln removed the ready-on-dev label Nov 2, 2024
@david-a-wheeler
Copy link
Contributor Author

  1. Awesome! Thank you so much!
  2. Uh oh, I'd better get moving to update the guide :-). A happy "problem".

@expln
Copy link
Owner

expln commented Nov 2, 2024

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Alg related to algorithms
Projects
None yet
Development

No branches or pull requests

2 participants