law wd_get

lawful-bytes@0.1.1.0 · proof_core.bend:450

import lawful-bytes@0.1.1.0/proof_core.bend as ProofCore
import Base
import lawful-arrays@0.1.0.0/defs.bend as A
import lawful-arrays@0.1.0.0/proof_tree.bend as P

450# Word k (in range) is the k-th of the word list.
451law wd_get:
452  for +t: P.Tree<U32>
453  for +d: Nat
454  for +k: U32
455  for +hf: {A.full(U32, P.fromT(U32, t), d) == True{} : Bool}
456  for +hd: {Nat.is_le(d, 29n) == True{} : Bool}
457  for +hk: {Nat.is_lt(U32.to_nat(k), Nat.pow(2n, d)) == True{} : Bool}
458  {List.get(&2, U32, WL(t), U32.to_nat(k)) == Some{WD(t, k)} : Maybe<&2, U32>}

Uses (19)

Used by (6)