Clone Detection
The core of the cone detection algorithm is a data-flow analysis to identify multiple dynamic writes that each take as input the same array value. What we really want is path-sensitive linear types, but we're not doing that, so what we have instead is a path insensitive data-flow analysis with a decent enough conservative approximation.
The lattice value is the set of nodeID that have been used, the two nodes of interest are phi and writes; phis insert their arguments to the use set and remove their output from the used set, but do not indicate a clone if their argument is already in the used set. For writes, we add their array argument to the used set and remove their output from the used set and indicate a clone if their array argument is already in the used set. This just determines which writes are offending, further analysis is required to determine where to place the clone, what writes are offending with respect to what other writes, etc.
See photos: https://drive.google.com/file/d/1_Mvpss_3nvJ2lSemlhZhQTlFZM8f3ESH/view?usp=sharing