TAOCP 2.4 Exercise 8
The statement "`MOVE CORRESPONDING \(\alpha\) TO \(\beta\)`" is exactly the same as "`MOVE \(\alpha\) TO \(\beta\)`" when the structures $\alpha$ and $\beta$ are _identical in layout and names of fiel...
Section 2.4: Multilinked Structures
Exercise 8. [**] [10] Under what circumstances is "MOVE CORRESPONDING \alpha TO \beta"
exactly the same as "MOVE \alpha TO \beta", according to the definition in
the text?
Verified: no
Solve time: 31s
The statement "MOVE CORRESPONDING \(\alpha\) TO \(\beta\)" is exactly the same as "MOVE \(\alpha\) TO \(\beta\)" when the structures $\alpha$ and $\beta$ are identical in layout and names of fields, so that every component of $\alpha$ has a corresponding component in $\beta$ and vice versa. In this case, each corresponding component of $\alpha$ is moved to the component of $\beta$ with the same name, which is exactly the same as moving the entire structure as a single object.
If the structures differ in field names, order, or hierarchy, "MOVE CORRESPONDING" only moves matching components, whereas "MOVE" moves the whole structure regardless of names. Therefore the two statements coincide precisely when $\alpha$ and $\beta$ have the same set of fields with the same names in the same hierarchical arrangement. This completes the proof. ∎