law num_view_t

lawful-fields@0.1.1.0 · proof_num.bend:663

import lawful-fields@0.1.1.0/proof_num.bend as ProofNum
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
import lawful-bytes@0.1.1.0/proof_core.bend as K
import lawful-arrays@0.1.0.0/proof_tree.bend as P

663# The law, with the bound 2^32 and the constant's value put in only here.
664law num_view_t:
665  for +len: U32
666  for +t: P.Tree<U32>
667  for +d: Nat
668  for +from: U32
669  for +to: U32
670  for +h: {D.ok(K.BT(len, t), d) == True{} : Bool}
671  for +hft: {U32.is_le(from, to) == True{} : Bool}
672  for +ht: {Nat.is_le(U32.to_nat(to), D.size(K.BT(len, t))) == True{} : Bool}
673  {F.nat_of(Pair.snd(D.Bytes, Maybe<&2, U32>, C.num(K.BT(len, t), from, to))) == F.decb(D.slice(D.view(K.BT(len, t)), U32.to_nat(from), Nat.sub(U32.to_nat(to), U32.to_nat(from))), Nat.pow(2n, 32n)) : Maybe<&2, Nat>}

Uses (22)

Used by (1)