I am working through Hassan Ait-Kaci's book Warren's Abstract Machine - A Tutorial Reconstruction. Currently I am stuck on section 2.4, "Argument Registers".
To be precise, what I don't understand is how to get from these register assignments (p.22) (for query p(Z,h(Z,W),f(W))):
A1 = Z
A2 = h(A1,X4)
A3 = f(X4)
X4 = W
to these instructions (p.24):
put_variable X4,A1
put_structure h/2,A2
set_value X4
set_variable X5
put_structure f/1,A3
set_value X5
call p/3
Like, where does X5 come from all of a sudden? In the register assignments, X4 refers to variable W, and there's no X5. But in the instructions, X5 refers to (what is/was essentially) W, and X4 now refers to Z. I am not seeing an explanation in the book. What am I missing?