def AP.get_swap_same

bend-osdev-array@0.1.0.1 · PROOF.bend:667

import bend-osdev-array@0.1.0.1/PROOF.bend as PROOF
import Base

667def AP.get_swap_same(-T: Data, t: AP.Tree<T>, n: U32, +i: U32, +v: T, z: Bool) -> {AP.get_v(T, AP.swap_t(T, t, n, i, v, z), n, i, z) == v : T}:
668  match t z:
669    case APLeaf{x} _:
670      {==}
671    case APNode{xs, ys} True{}:
672      +h = U32.shr(n)
673      AP.get_swap_same(T, xs, h, i, v, U32.is_lt(i, U32.shr(h)))
674    case APNode{xs, ys} False{}:
675      +h = U32.shr(n)
676      +j = U32.sub(i, h)
677      AP.get_swap_same(T, ys, h, j, v, U32.is_lt(j, U32.shr(h)))

Uses (8)

Used by (1)