Guys, I must ask. What do you make of this statement?
"Suppose there is a virtual machine containing levels V1 and V2, where V2 is above V1 in the machine heirarchy. The programs written in language V2 must be translated by a program running at level V1."
True or False?
My professor insists that it is true and not ambiguous. I tried to disprove him by showing that the negation was true, but he wouldn't have it. Not sure what else to do, need someone to explain to me why this is not ambiguous.
Name:
Anonymous2011-03-09 17:12
What do you mean the negation is true? That if V1 is above V2 then programs written in V1 must be translated to v1? Well duh.
I'm afraid I don't. A program written for a lower level does not have to be translated to a higher level at all in order to be executed, although one could presumably do that.
You're right though. There's no need to translate it as it could be executed one instruction at a time. Or the machines could have the same instruction set and the V2 program only needs to checked for forbidden operations before running it verbatim. Or it could be sent to an external machine for translation. "Must be translated by" is a pretty odd claim.