Reroot primitive arrays on access (fix #12947).
Reroot primitive arrays on access (fix #12947).

Semi-persistent arrays are supposed to have amortized O(1) complexity.
This commit ensures it, without forcing the user to litter its functions
with explicit calls to reroot.

This commit also makes rerootk faster by carrying the array along the
dependency chain rather than recomputing it at every step.

ejgallego/coq,JasonGross/coq,SkySkimmer/coq,Zimmi48/coq,JasonGross/coq,coq/coq,JasonGross/coq,ejgallego/coq,Zimmi48/coq,Zimmi48/coq,silene/coq,coq/coq,Zimmi48/coq,coq/coq,silene/coq,gares/coq,gares/coq,SkySkimmer/coq,SkySkimmer/coq,silene/coq,coq/coq,ejgallego/coq,ejgallego/coq,gares/coq,gares/coq,gares/coq,SkySkimmer/coq,JasonGross/coq