law num_view
import lawful-fields@0.1.1.0/LAWS.bend as LAWSimport 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
61# num reads the decimal number in from .. to-1 when it is one and fits a U32.
62law num_view:
63 for b: D.Bytes
64 for d: Nat
65 for from: U32
66 for to: U32
67 for h: {D.ok(b, d) == True{} : Bool}
68 for hft: {U32.is_le(from, to) == True{} : Bool}
69 for ht: {Nat.is_le(U32.to_nat(to), D.size(b)) == True{} : Bool}
70 {F.nat_of(Pair.snd(D.Bytes, Maybe<&2, U32>, C.num(b, from, to))) == F.decb(D.slice(D.view(b), U32.to_nat(from), Nat.sub(U32.to_nat(to), U32.to_nat(from))), Nat.pow(2n, 32n)) : Maybe<&2, Nat>}
Uses (20)
Used by (0)
No other definition uses this definition.