PROOF.AP.swap_t: def of bend-osdev-array@0.1.0.1 Import: import bend-osdev-array@0.1.0.1/PROOF.bend as PROOF Lines 545-555 of bend-osdev-array@0.1.0.1/PROOF.bend: https://jend.leeeet.dev/read.txt?path=bend-osdev-array@0.1.0.1/PROOF.bend&start_line=545&end_line=555 import Base def AP.swap_t(-T: Data, t: AP.Tree, n: U32, +i: U32, v: T, z: Bool) -> AP.Tree: match t z: case APLeaf{x} _: APLeaf{v} case APNode{xs, ys} True{}: +h = U32.shr(n) APNode{AP.swap_t(T, xs, h, i, v, U32.is_lt(i, U32.shr(h))), ys} case APNode{xs, ys} False{}: +h = U32.shr(n) +j = U32.sub(i, h) APNode{xs, AP.swap_t(T, ys, h, j, v, U32.is_lt(j, U32.shr(h)))} Uses (6): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.is_lt https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.shr https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.sub https://jend.leeeet.dev/definition.txt?path=bend-osdev-array@0.1.0.1/PROOF.bend&name=AP.Tree