Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Via the pumping lemma, you can easily prove that testing whether a number is a prime number cannot be implemented as a regular expression.


Via the context-free pumping lemma, you can even prove that prime numbers don't form a context-free language either.


And via Parikh's theorem, with a one-symbol alphabet, regular and context-free languages are the same.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: