LAWS.fast_find: law of lawful-bytes@0.1.1.0 Import: import lawful-bytes@0.1.1.0/LAWS.bend as LAWS Lines 414-427 of lawful-bytes@0.1.1.0/LAWS.bend: https://jend.leeeet.dev/read.txt?path=lawful-bytes@0.1.1.0/LAWS.bend&start_line=414&end_line=427 import Base import lawful-bytes@0.1.1.0/defs.bend as D import lawful-bytes@0.1.1.0/bytes.bend as B import lawful-bytes@0.1.1.0/fast.bend as FA # The word-at-a-time find gives exactly the reference result (the same Bytes # and the same index). c must be a byte value: the search compares 8 bits per # byte. law fast_find: for b: D.Bytes for d: Nat for from: U32 for to: U32 for c: U32 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 hc: {U32.is_lt(c, 256) == True{} : Bool} {FA.find(b, from, to, c) == B.find(b, from, to, c) : D.Bytes & U32} Uses (15): 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.is_le https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Pair 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/PROOF.bend&name=fast_find.go https://jend.leeeet.dev/definition.txt?path=lawful-bytes@0.1.1.0/bytes.bend&name=find 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/fast.bend&name=find https://jend.leeeet.dev/definition.txt?path=lawful-bytes@0.1.1.0/proof_core.bend&name=bmirror