LAWS.cut_view: law of lawful-fields@0.1.1.0 Import: import lawful-fields@0.1.1.0/LAWS.bend as LAWS Lines 9-22 of lawful-fields@0.1.1.0/LAWS.bend: https://jend.leeeet.dev/read.txt?path=lawful-fields@0.1.1.0/LAWS.bend&start_line=9&end_line=22 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 C # cut answers the end offsets of the first n pieces of from .. to-1, split at # sep: the pieces those ends delimit are the first n of F.split. law cut_view: for b: D.Bytes for d: Nat for from: U32 for to: U32 for sep: U32 for n: Nat for h: {D.ok(b, d) == True{} : Bool} for hft: {U32.is_le(from, to) == True{} : Bool} for ht: {Nat.is_le(U32.to_nat(to), D.size(b)) == True{} : Bool} for hs: {U32.is_lt(sep, 256) == True{} : Bool} {F.pieces(Pair.snd(D.Bytes, List<&2, U32>, C.cut(b, from, to, sep, n)), D.view(b), U32.to_nat(from)) == List.take(&2, List<&2, U32>, F.split(D.slice(D.view(b), U32.to_nat(from), Nat.sub(U32.to_nat(to), U32.to_nat(from))), sep), n) : List<&2, List<&2, U32>>} Uses (21): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List.take https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.is_le https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.sub https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Pair.snd 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_le 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.to_nat https://jend.leeeet.dev/definition.txt?path=lawful-bytes@0.1.1.0/defs.bend&name=Bytes https://jend.leeeet.dev/definition.txt?path=lawful-bytes@0.1.1.0/defs.bend&name=ok https://jend.leeeet.dev/definition.txt?path=lawful-bytes@0.1.1.0/defs.bend&name=size https://jend.leeeet.dev/definition.txt?path=lawful-bytes@0.1.1.0/defs.bend&name=slice https://jend.leeeet.dev/definition.txt?path=lawful-bytes@0.1.1.0/defs.bend&name=view https://jend.leeeet.dev/definition.txt?path=lawful-bytes@0.1.1.0/proof_core.bend&name=bmirror https://jend.leeeet.dev/definition.txt?path=lawful-fields@0.1.1.0/PROOF.bend&name=cut_view.go https://jend.leeeet.dev/definition.txt?path=lawful-fields@0.1.1.0/defs.bend&name=pieces https://jend.leeeet.dev/definition.txt?path=lawful-fields@0.1.1.0/defs.bend&name=split https://jend.leeeet.dev/definition.txt?path=lawful-fields@0.1.1.0/fields.bend&name=cut