|
|
|
|
|
by eru
4687 days ago
|
|
An alternative solution is to provide a list of matches and non-matches, and look for the shortest or simplest regex that separates the two. (Finding the actual minimal regex, instead of just a reasonable guess, might be a computationally tough problem. I guess it's in coNP and might be in NP, too. An algorithm in P would be nice to find.) Update: Finding any separating regex would be in P. A separating finite automaton is easy to find, and then you just convert that into a regex. Now, how do you find the minimal regex? |
|
preferably python but a link to theory is useful too.