Machine-translated by Google. Questions are authored in English.
Top

Discussion

Assertion (A): Quadruples are preferred to triples when the intermediate code will be optimised.
Reason (R): A triple names its result by its own position, so moving an instruction invalidates every reference to it.

  • A.A is true but R is false
  • B.A is false but R is true
  • C.Both A and R are true, and R is the correct explanation of A
  • D.Both A and R are true, but R is not the correct explanation of A

Answer: C

Correct answer: Both A and R are true, and R is the correct explanation of A

Both are true and the reason gives the mechanism. Optimisation moves and removes instructions constantly, and in a triple representation an instruction’s identity is its position, so every such change invalidates the references to it. A quadruple names its result explicitly and is unaffected.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.