Runtime Environments & Parameter Passing

Answer & solution
Official answer: D
Our answer: D under implicit local-a binding
The intended pseudocode treats a=1 inside m as introducing a local a, while reference parameter y remains an alias of the outer a=3. Then local a=y−a=2. Passing it by reference to n makes x and dynamically resolved a refer to that same local cell: x=x*a stores 4, and both prints show 4, D. If a=1 instead assigns the existing outer dynamically scoped a, y aliases it, so a=y−a becomes 0 and the output is 0, 0. The source lacks an explicit local declaration, so its binding convention must be supplied.
Distinguish parameter aliasing from name lookup. Under the intended local-binding interpretation, y aliases the global cell containing 3, while m's local a first contains 1 and then 2. n's formal x aliases that local cell, and dynamic lookup of its free name a finds the active m frame, also that same cell. Thus the assignment squares 2 in place. Under assignment-to-existing-binding semantics both y and a refer to the global cell before subtraction, making 1−1=0. The printed key chooses the former semantics but does not remove the source ambiguity.