LAWS.cut_ends: law of lawful-fields@0.1.1.0 Import: import lawful-fields@0.1.1.0/LAWS.bend as LAWS Lines 24-37 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=24&end_line=37 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 # The ends are exactly where split's pieces end, counted from from (so they # increase, and each next piece starts just after the previous end). law cut_ends: 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.nats(Pair.snd(D.Bytes, List<&2, U32>, C.cut(b, from, to, sep, n))) == List.take(&2, Nat, F.ends(F.split(D.slice(D.view(b), U32.to_nat(from), Nat.sub(U32.to_nat(to), U32.to_nat(from))), sep), U32.to_nat(from)), n) : List<&2, Nat>} Uses (22): 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_ends.go https://jend.leeeet.dev/definition.txt?path=lawful-fields@0.1.1.0/defs.bend&name=ends https://jend.leeeet.dev/definition.txt?path=lawful-fields@0.1.1.0/defs.bend&name=nats 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