LAWS.to_nat_pack4: law of lawful-words@0.1.0.0 Import: import lawful-words@0.1.0.0/LAWS.bend as LAWS Lines 348-358 of lawful-words@0.1.0.0/LAWS.bend: https://jend.leeeet.dev/read.txt?path=lawful-words@0.1.0.0/LAWS.bend&start_line=348&end_line=358 import Base import lawful-words@0.1.0.0/defs.bend as D # The number a packed word stands for. law to_nat_pack4: for b0: U32 for b1: U32 for b2: U32 for b3: U32 for h0: {U32.is_lt(b0, 256) == True{} : Bool} for h1: {U32.is_lt(b1, 256) == True{} : Bool} for h2: {U32.is_lt(b2, 256) == True{} : Bool} for h3: {U32.is_lt(b3, 256) == True{} : Bool} {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): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.add https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.mul https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.pow https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.is_lt https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.to_nat https://jend.leeeet.dev/definition.txt?path=lawful-words@0.1.0.0/defs.bend&name=pack4 https://jend.leeeet.dev/definition.txt?path=lawful-words@0.1.0.0/proof_bytes.bend&name=to_nat_pack4