LAWSMul.mulhi_value: law of bend-osdev-word64@0.1.1.0 Import: import bend-osdev-word64@0.1.1.0/LAWS_mul.bend as LAWSMul Lines 8-16 of bend-osdev-word64@0.1.1.0/LAWS_mul.bend: https://jend.leeeet.dev/read.txt?path=bend-osdev-word64@0.1.1.0/LAWS_mul.bend&start_line=8&end_line=16 import Base import bend-osdev-u32@0.1.0.0/u32.bend as U import bend-osdev-word64@0.1.1.0/word64.bend as W # Multiplication. W64.mulhi(a, b) is the high 32 bits of the product of two # 32-bit words: with the low 32 bits (U32.mul), the whole product. W64.mul # is the product modulo 2^64: its value is the low 64 bits of the product of # the values (U32Nat.low, from bend-osdev-u32), what wraps is 2^64 times the # rest, and with the product no more than a word's value nothing wraps. law mulhi_value: for +a: U32 for +b: U32 {Nat.add(U32.to_nat(U32.mul(a, b)), U.U32Nat.dbl(32n, U32.to_nat(W.W64.mulhi(a, b)))) == Nat.mul(U32.to_nat(a), U32.to_nat(b)) : Nat} Uses (19): 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=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.add https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.and 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.mul https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.shrn https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.to_nat https://jend.leeeet.dev/definition.txt?path=bend-osdev-u32@0.1.0.0/LAWS.bend&name=u32_add_wrap https://jend.leeeet.dev/definition.txt?path=bend-osdev-u32@0.1.0.0/LAWS.bend&name=u32_and_65535 https://jend.leeeet.dev/definition.txt?path=bend-osdev-u32@0.1.0.0/LAWS.bend&name=u32_mul_low https://jend.leeeet.dev/definition.txt?path=bend-osdev-u32@0.1.0.0/LAWS.bend&name=u32_shrn_value https://jend.leeeet.dev/definition.txt?path=bend-osdev-u32@0.1.0.0/u32.bend&name=U32Nat.bit https://jend.leeeet.dev/definition.txt?path=bend-osdev-u32@0.1.0.0/u32.bend&name=U32Nat.dbl https://jend.leeeet.dev/definition.txt?path=bend-osdev-word64@0.1.1.0/PROOF_mul.bend&name=wm.k https://jend.leeeet.dev/definition.txt?path=bend-osdev-word64@0.1.1.0/PROOF_mul.bend&name=wu.lt https://jend.leeeet.dev/definition.txt?path=bend-osdev-word64@0.1.1.0/word64.bend&name=W64.mulhi