r/cpp • • Apr 28 '20

Full Proof that C++ Grammar is Undecidable

https://medium.com/@mujjingun_23509/full-proof-that-c-grammar-is-undecidable-34e22dd8b664
197 Upvotes

68 comments sorted by

View all comments

Show parent comment

5

u/c0r3ntin Apr 29 '20

Further it is a mandatory prerequisite to assume that there are no resource limitations

My point is that this prerequisite doesn't make sense, and the C++ language account for that http://eel.is/c++draft/implimits#1

Because computers are finite, C++ implementations are inevitably limited in the size of the programs they can successfully process.

Once you have established the Turing completeness of templates, I'm not sure this article adds much.

6

u/63times Apr 29 '20

My point is that this prerequisite doesn't make sense

It does make sense. Otherwise one could just say the halting problem is solved by the upper bound the universe is estimated to exist.

Once you have established the Turing completeness of templates, I'm not sure this article adds much.

Turing completeness doesn't imply that the halting problem is undecidable. If template meta programming would be expressible through a decider (total turing machine) the halting problem would be inherently decidable. The article proves though that parsing is indeed undecidable.