law cut_ends_t

lawful-fields@0.1.1.0 · proof_cut.bend:921

import lawful-fields@0.1.1.0/proof_cut.bend as ProofCut
import Base
import lawful-bytes@0.1.1.0/defs.bend as D
import lawful-fields@0.1.1.0/defs.bend as F
import lawful-fields@0.1.1.0/fields.bend as K
import lawful-bytes@0.1.1.0/proof_core.bend as C
import lawful-arrays@0.1.0.0/proof_tree.bend as P

921law cut_ends_t:
922  for +len: U32
923  for +t: P.Tree<U32>
924  for +d: Nat
925  for +from: U32
926  for +to: U32
927  for +sep: U32
928  for +n: Nat
929  for +h: {D.ok(C.BT(len, t), d) == True{} : Bool}
930  for +hft: {U32.is_le(from, to) == True{} : Bool}
931  for +ht: {Nat.is_le(U32.to_nat(to), D.size(C.BT(len, t))) == True{} : Bool}
932  for +hs: {U32.is_lt(sep, 256) == True{} : Bool}
933  {F.nats(Pair.snd(D.Bytes, List<&2, U32>, K.cut(C.BT(len, t), from, to, sep, n))) == List.take(&2, Nat, F.ends(F.split(D.slice(D.view(C.BT(len, t)), U32.to_nat(from), Nat.sub(U32.to_nat(to), U32.to_nat(from))), sep), U32.to_nat(from)), n) : List<&2, Nat>}

Uses (23)

Used by (3)