def fast_find.go

lawful-bytes@0.1.1.0 · PROOF.bend:455

import lawful-bytes@0.1.1.0/PROOF.bend as PROOF
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
import lawful-bytes@0.1.1.0/proof_core.bend as C
import lawful-bytes@0.1.1.0/proof_fast_find.bend as FF

455def fast_find.go(-b: D.Bytes, +d: Nat, +from: U32, +to: U32, +c: U32, h: {D.ok(b, d) == True{} : Bool}, hft: {U32.is_le(from, to) == True{} : Bool}, ht: {Nat.is_le(U32.to_nat(to), D.size(b)) == True{} : Bool}, hc: {U32.is_lt(c, 256) == True{} : Bool}, m_b: C.BMirror(b)) ->
456  {FA.find(b, from, to, c) == B.find(b, from, to, c) : D.Bytes & U32}:
457  (+l_b, m2_b) = m_b
458  (+t_b, +e_b) = m2_b
459  %e_b : {FA.find(_, from, to, c) == B.find(_, from, to, c) : D.Bytes & U32}
460  +h_t = C.tr(x => {D.ok(x, d) == True{} : Bool}, b, l_b, t_b, e_b, h)
461  +ht_t = C.tr(x => {Nat.is_le(U32.to_nat(to), D.size(x)) == True{} : Bool}, b, l_b, t_b, e_b, ht)
462  FF.fast_find_t(l_b, t_b, d, from, to, c, h_t, hft, ht_t, hc)

Uses (17)

Used by (1)