Copying cells over the memory oracle #
Memory.copy src dst n copies the n cells from src to the n cells from dst, one read and
one write per cell, in increasing order. A structure that grows into a larger block, such as a
doubling array or a resizing hash table, moves its contents this way. When the two ranges do not
overlap, the copy leaves memory as Cslib.WordRAM.ArrayCopy.copyPrefix describes, the same
function that specifies the word RAM's copy routine. It costs 2 n memory units, and its
operations are admissible when both ranges are allocated and the copied cells hold words.
Main definitions #
Memory.copy: copyncells.
Main results #
Memory.clientState_copy: the memory after the copy.Memory.totalCost_copy: its cost.Memory.validHistory_copy: its admissibility.
The memory after a copy between non-overlapping ranges: the destination holds the source, and the frontier is unchanged.
A copy is admissible when both ranges are allocated, they do not overlap, and the copied cells hold words.