On the Hardness of Learning Regular Expressions
Idan Attias, Lev Reyzin, Nathan Srebro, Gal Vardi
TL;DR
This paper addresses the computational hardness of learning regular expressions (REs) by establishing PAC and MQ hardness under both distribution-free and uniform distributions, including extended REs with complement and intersection. The authors leverage reductions from DNFs to REs for distribution-free hardness and develop a local PRG framework to prove hardness under the uniform distribution, showing that even weak learning of REs of size $n^{\epsilon}$ is intractable. They also translate Boolean formulas into extended REs to transfer hardness results to $RE(\cap)$ and $RE(\neg)$ under the uniform distribution, under cryptographic assumptions. A key message is that learnability is governed by the chosen description language (RE length) rather than the regular-language class itself, underscoring the importance of representation when assessing tractability and suggesting several open questions for plain REs and NFAs under the uniform distribution.
Abstract
Despite the theoretical significance and wide practical use of regular expressions, the computational complexity of learning them has been largely unexplored. We study the computational hardness of improperly learning regular expressions in the PAC model and with membership queries. We show that PAC learning is hard even under the uniform distribution on the hypercube, and also prove hardness of distribution-free learning with membership queries. Furthermore, if regular expressions are extended with complement or intersection, we establish hardness of learning with membership queries even under the uniform distribution. We emphasize that these results do not follow from existing hardness results for learning DFAs or NFAs, since the descriptive complexity of regular languages can differ exponentially between DFAs, NFAs, and regular expressions.
