This reduction is really cool. I love reductions like this. Is there a general consensus to use "regular expression" to refer to the actual regular ones and "regex" to refer to the non-regular variants?
Sat solver on top of regex matcher
21–30 of 53 posts
Re: Sat solver on top of regex matcher
#22That is quite literally a formal proof that "regex+backreferences" is NP-complete, since SAT is the index NP-complete problem.
Re: Sat solver on top of regex matcher
#23That is quite literally a formal proof that "regex+backreferences" is NP-complete, since SAT is the index NP-complete problem.
The author is also incorrect in stating However the author incorrectly states that only 3SAT problems are solvable. Proof that 3SAT is NP-hard does not exclude broader SAT.
Re: Sat solver on top of regex matcher
#24This reduction is really cool. I love reductions like this. Is there a general consensus to use "regular expression" to refer to the actual regular ones and "regex" to refer to the non-regular variants?
Yes, for at least ten years and likely much longer. https://cstheory.stackexchange.com/q/448/362
Personally I make the distinction, but I've noticed many many people do not, hence the question.
Re: Sat solver on top of regex matcher
#25Earlier quoted context omitted.
Yes, for at least ten years and likely much longer. https://cstheory.stackexchange.com/q/448/362
Interesting, I wasn't aware of the history. Personally I make the distinction, but I've noticed many many people do not, hence the question.
Re: Sat solver on top of regex matcher
#26That is quite literally a formal proof that "regex+backreferences" is NP-complete, since SAT is the index NP-complete problem.
I assume this result is already known in the literature?
Re: Sat solver on top of regex matcher
#27Re: Sat solver on top of regex matcher
#28That is quite literally a formal proof that "regex+backreferences" is NP-complete, since SAT is the index NP-complete problem.
Proving that a problem is NP-complete requires proving that it is NP-hard and in NP. Reducing SAT to regex matching with backreferences does the former. The latter requires proving that any solution can be checked in polynomial time. The author is also incorrect in stating However the author incorrectly states that only 3SAT problems are solvable. Proof that 3SAT is NP-hard does not exclude broader SAT.
Every SAT problem can be converted into a 3-SAT problem so that's also not really an issue, they are both NPC
Re: Sat solver on top of regex matcher
#29That is quite literally a formal proof that "regex+backreferences" is NP-complete, since SAT is the index NP-complete problem.
Jokes apart: I'd love for you to elaborate a bit more on this. I'm pretty sure I would benefit a lot from a more expanded, "dumber" explanation.
Re: Sat solver on top of regex matcher
#30> Another practical usage I've heard: match "string" or 'string', but not "string'. You don't need backreferences for that: '[^']*'|"[^"]*"
The common case of only two pairs of quotes is indeed regular, but if you want to support either all Unicode quotes (about 60 pairs of them) or C++11 raw string literals `R"delim(...)delim"` (intrinsically not regular) you are out of luck.