Array.tupd: def of bend-collections-laws-crypto@1.0.0.0 Import: import bend-collections-laws-crypto@1.0.0.0/proofs/lib/array.bend as Array Lines 63-74 of bend-collections-laws-crypto@1.0.0.0/proofs/lib/array.bend: https://jend.leeeet.dev/read.txt?path=bend-collections-laws-crypto@1.0.0.0/proofs/lib/array.bend&start_line=63&end_line=74 import Base import bend-collections-laws-crypto@1.0.0.0/spec/lib/common.bend as SC def tupd(-T: Data, d: Nat, t: Tree, +j: Nat, +v: T, left: Bool) -> Tree: match d t left: case 0n TLeaf{x} _: TLeaf{v} case 0n TNode{l, r} _: TNode{l, r} case 1n+p TLeaf{x} _: TLeaf{x} case 1n+ +p TNode{l, r} True{}: TNode{tupd(T, p, l, j, v, ndec(p, j)), r} case 1n+ +p TNode{l, r} False{}: TNode{l, tupd(T, p, r, Nat.sub(j, SC.pow2(p)), v, ndec(p, Nat.sub(j, SC.pow2(p))))} 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=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.sub https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/proofs/lib/array.bend&name=Tree https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/proofs/lib/array.bend&name=ndec https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/spec/lib/common.bend&name=pow2