ProofFastFind.fi: law of lawful-bytes@0.1.1.0 Import: import lawful-bytes@0.1.1.0/proof_fast_find.bend as ProofFastFind Lines 706-728 of lawful-bytes@0.1.1.0/proof_fast_find.bend: https://jend.leeeet.dev/read.txt?path=lawful-bytes@0.1.1.0/proof_fast_find.bend&start_line=706&end_line=728 import Base import lawful-bytes@0.1.1.0/defs.bend as D import lawful-bytes@0.1.1.0/fast.bend as FA import lawful-bytes@0.1.1.0/proof_core.bend as C import lawful-bytes@0.1.1.0/proof_fast_word.bend as FW import lawful-arrays@0.1.0.0/proof_tree.bend as P # The loop invariant, for 1 + k words left (wi's included): the answer, capped # at to, is the first c from the start o bytes into word wi. law fi: for +k: Nat for +z: Bool for +len: U32 for +t: P.Tree for +d: Nat for +to: U32 for +c: U32 for +wi: U32 for +o: Nat for +v: U32 for +h: {D.ok(C.BT(len, t), d) == True{} : Bool} for +ht: {Nat.is_le(U32.to_nat(to), U32.to_nat(len)) == True{} : Bool} for +hc: {U32.is_lt(c, 256) == True{} : Bool} for +ho: {Nat.is_lt(o, 4n) == True{} : Bool} for +hs: {Nat.is_le(SS(wi, o), U32.to_nat(to)) == True{} : Bool} for +he1: {Nat.is_le(U32.to_nat(to), Nat.mul(Nat.add(U32.to_nat(wi), 1n+k), 4n)) == True{} : Bool} for +he2: {Nat.is_lt(Nat.mul(Nat.add(U32.to_nat(wi), k), 4n), U32.to_nat(to)) == True{} : Bool} for +hv: {FW.P0(v) == Nat.add(o, D.run_len(AW(t, wi, o), c)) : Nat} for +hz: {U32.is_zero(FA.zb(v)) == z : Bool} {U32.to_nat(U32.min(FG(1n+k, z, wi, FA.zb(v), FA.rep(c), t), to)) == D.first(UB(t), SS(wi, o), U32.to_nat(to), c) : Nat} Uses (48): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Equal.cong https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Equal.sym https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Equal.trans https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.add 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.is_lt https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.mul https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.pow https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.add 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.is_zero https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.min https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.to_nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.xor https://jend.leeeet.dev/definition.txt?path=lawful-arrays@0.1.0.0/proof_base.bend&name=subst https://jend.leeeet.dev/definition.txt?path=lawful-arrays@0.1.0.0/proof_tree.bend&name=Tree https://jend.leeeet.dev/definition.txt?path=lawful-bytes@0.1.1.0/defs.bend&name=first 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=run_len https://jend.leeeet.dev/definition.txt?path=lawful-bytes@0.1.1.0/fast.bend&name=rep https://jend.leeeet.dev/definition.txt?path=lawful-bytes@0.1.1.0/fast.bend&name=zb https://jend.leeeet.dev/definition.txt?path=lawful-bytes@0.1.1.0/proof_core.bend&name=BT https://jend.leeeet.dev/definition.txt?path=lawful-bytes@0.1.1.0/proof_core.bend&name=WD https://jend.leeeet.dev/definition.txt?path=lawful-bytes@0.1.1.0/proof_core.bend&name=inc_fits https://jend.leeeet.dev/definition.txt?path=lawful-bytes@0.1.1.0/proof_core.bend&name=ok_d https://jend.leeeet.dev/definition.txt?path=lawful-bytes@0.1.1.0/proof_core.bend&name=ok_len https://jend.leeeet.dev/definition.txt?path=lawful-bytes@0.1.1.0/proof_fast_find.bend&name=AW https://jend.leeeet.dev/definition.txt?path=lawful-bytes@0.1.1.0/proof_fast_find.bend&name=FG https://jend.leeeet.dev/definition.txt?path=lawful-bytes@0.1.1.0/proof_fast_find.bend&name=SS https://jend.leeeet.dev/definition.txt?path=lawful-bytes@0.1.1.0/proof_fast_find.bend&name=UB https://jend.leeeet.dev/definition.txt?path=lawful-bytes@0.1.1.0/proof_fast_find.bend&name=fhit https://jend.leeeet.dev/definition.txt?path=lawful-bytes@0.1.1.0/proof_fast_find.bend&name=fnone0 https://jend.leeeet.dev/definition.txt?path=lawful-bytes@0.1.1.0/proof_fast_find.bend&name=fskip https://jend.leeeet.dev/definition.txt?path=lawful-bytes@0.1.1.0/proof_fast_find.bend&name=hv0 https://jend.leeeet.dev/definition.txt?path=lawful-bytes@0.1.1.0/proof_fast_find.bend&name=pow_le4 https://jend.leeeet.dev/definition.txt?path=lawful-bytes@0.1.1.0/proof_fast_find.bend&name=wlt https://jend.leeeet.dev/definition.txt?path=lawful-bytes@0.1.1.0/proof_fast_word.bend&name=P0 https://jend.leeeet.dev/definition.txt?path=lawful-words@0.1.0.0/proof_nat.bend&name=add_assoc https://jend.leeeet.dev/definition.txt?path=lawful-words@0.1.0.0/proof_nat.bend&name=add_zero https://jend.leeeet.dev/definition.txt?path=lawful-words@0.1.0.0/proof_nat.bend&name=le_add_mono_l https://jend.leeeet.dev/definition.txt?path=lawful-words@0.1.0.0/proof_nat.bend&name=le_lt_trans https://jend.leeeet.dev/definition.txt?path=lawful-words@0.1.0.0/proof_nat.bend&name=le_mul_r https://jend.leeeet.dev/definition.txt?path=lawful-words@0.1.0.0/proof_nat.bend&name=le_zero_l https://jend.leeeet.dev/definition.txt?path=lawful-words@0.1.0.0/proof_nat.bend&name=lt_le_trans https://jend.leeeet.dev/definition.txt?path=lawful-words@0.1.0.0/proof_nat.bend&name=lt_to_le