LAWSDiv.divmod_value: law of bend-osdev-word64@0.1.1.0 Import: import bend-osdev-word64@0.1.1.0/LAWS_div.bend as LAWSDiv Lines 8-15 of bend-osdev-word64@0.1.1.0/LAWS_div.bend: https://jend.leeeet.dev/read.txt?path=bend-osdev-word64@0.1.1.0/LAWS_div.bend&start_line=8&end_line=15 import Base import bend-osdev-word64@0.1.1.0/word64.bend as W # Division (shift and subtract, 64 steps): for b not 0, the quotient and the # remainder are the Nat ones, a = q b + r with r < b; by 0, the quotient is 0 # and the remainder a. law divmod_value: for +a: W.W64 for +b: W.W64 for h: {W.W64.is_zero(b) == False{} : Bool} {Nat.add(Nat.mul(W.W64.to_nat(W.W64.div(a, b)), W.W64.to_nat(b)), W.W64.to_nat(W.W64.mod(a, b))) == W.W64.to_nat(a) : Nat} Uses (15): 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=U32 https://jend.leeeet.dev/definition.txt?path=bend-osdev-word64@0.1.1.0/PROOF_div.bend&name=wd.dz https://jend.leeeet.dev/definition.txt?path=bend-osdev-word64@0.1.1.0/PROOF_div.bend&name=wd.p1 https://jend.leeeet.dev/definition.txt?path=bend-osdev-word64@0.1.1.0/word64.bend&name=W64 https://jend.leeeet.dev/definition.txt?path=bend-osdev-word64@0.1.1.0/word64.bend&name=W64.div https://jend.leeeet.dev/definition.txt?path=bend-osdev-word64@0.1.1.0/word64.bend&name=W64.divmod.pick https://jend.leeeet.dev/definition.txt?path=bend-osdev-word64@0.1.1.0/word64.bend&name=W64.fst https://jend.leeeet.dev/definition.txt?path=bend-osdev-word64@0.1.1.0/word64.bend&name=W64.is_zero https://jend.leeeet.dev/definition.txt?path=bend-osdev-word64@0.1.1.0/word64.bend&name=W64.mod https://jend.leeeet.dev/definition.txt?path=bend-osdev-word64@0.1.1.0/word64.bend&name=W64.snd https://jend.leeeet.dev/definition.txt?path=bend-osdev-word64@0.1.1.0/word64.bend&name=W64.to_nat