law to_nat_pack4

lawful-words@0.1.0.0 · LAWS.bend:348

import lawful-words@0.1.0.0/LAWS.bend as LAWS
import Base
import lawful-words@0.1.0.0/defs.bend as D

348# The number a packed word stands for.
349law to_nat_pack4:
350  for b0: U32
351  for b1: U32
352  for b2: U32
353  for b3: U32
354  for h0: {U32.is_lt(b0, 256) == True{} : Bool}
355  for h1: {U32.is_lt(b1, 256) == True{} : Bool}
356  for h2: {U32.is_lt(b2, 256) == True{} : Bool}
357  for h3: {U32.is_lt(b3, 256) == True{} : Bool}
358  {U32.to_nat(D.pack4(b0, b1, b2, b3)) == Nat.add(U32.to_nat(b0), Nat.add(Nat.mul(U32.to_nat(b1), Nat.pow(2n, 8n)), Nat.add(Nat.mul(U32.to_nat(b2), Nat.pow(2n, 16n)), Nat.mul(U32.to_nat(b3), Nat.pow(2n, 24n))))) : Nat}

Uses (10)

Used by (0)

No other definition uses this definition.