Now I have a more general question for the theoriticians: If a programming language were indeed a CFL, would it have the power to be as expressive as a Turing machine? In other words, can a programming language that is represented completely via a CFG be able to express all computable programs?
This dilemma is a little beyond my expertise in the area. At first glance seems as though the specification for all possible Turing machines could not be expressed with a CFG -- there must be all-but-infinitely-many states, and the transition function must be well-defined. This doesn't seem possible in a CFG, due to the same type of problem with predefining variables, as demerphq correctly points out above. I'm actually proctoring a test this morning in our Theory of Computing class, so I will ask the prof what he thinks and get back to you on it ;)
Anyway, great question dystrophy, and enjoy taking Theory of Computation. Every programmer can use a good dose of theory. Just remember to be nice to your theory TA's, OK? ;)
Update: Well, the good professor seems to recall a Princeton research project that was a compiler that would compile and execute any input at all, including garbage. So there's a CFG-definable program specification which was Turing-expressible. He also thought the set of all Algol 66 or 68 programs might have been context-free. So it would seem that the set of all programs of a language need not be context-sensitive.
blokhead
In reply to Re: original definition vs final language
by blokhead
in thread original definition vs final language
by dystrophy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |