def PT
import lawful-bytes@0.1.1.0/proof_append.bend as ProofAppendimport Base
import lawful-bytes@0.1.1.0/proof_core.bend as C
import lawful-words@0.1.0.0/defs.bend as W
import lawful-arrays@0.1.0.0/proof_tree.bend as P
import lawful-arrays@0.1.0.0/proof_index.bend as I
143# The tree after pushing x onto BT(ld, td).
144def PT(+ld: U32, +td: P.Tree<U32>, +x: U32) -> P.Tree<U32>:
145 I.set_tree(U32, td, (ld >> 2n : U32), W.put_byte(C.WD(td, (ld >> 2n : U32)), U32.to_nat((ld .&. 3 : U32)), x))