This will need to recursively perform a true "deep copy" on the locators. For example:
type T is { x : any nat, y : any nat }
{ x : any nat |-> 0, y : any nat |-> 1 } --> t : T
copy(t) --> var newT : T
should generate code equivalent to (this is just the copy(t) --> var newT : T part).
T newT = T(true, t.x, t.y);
We will need to handle lists and maps similarly (for maps, using the store list of keys to iterate through it).
This will need to recursively perform a true "deep copy" on the locators. For example:
should generate code equivalent to (this is just the
copy(t) --> var newT : Tpart).We will need to handle lists and maps similarly (for maps, using the store list of keys to iterate through it).