ProofValue.wv.gsub: def of bend-osdev-word64@0.1.1.0 Import: import bend-osdev-word64@0.1.1.0/proof_value.bend as ProofValue Lines 508-515 of bend-osdev-word64@0.1.1.0/proof_value.bend: https://jend.leeeet.dev/read.txt?path=bend-osdev-word64@0.1.1.0/proof_value.bend&start_line=508&end_line=515 import Base import bend-osdev-u32@0.1.0.0/u32.bend as U import bend-osdev-u32@0.1.0.0/LAWS.bend as UL # W64.sub at width n: the difference plus the subtrahend is the minuend, # plus 2^(2n) when the subtrahend is the larger def wv.gsub(+n: Nat, +ah: Word(n), +al: Word(n), +bh: Word(n), +bl: Word(n)) -> {Nat.add(Nat.add(Word.to_nat(n, Word.sub(n, al, bl)), U.U32Nat.dbl(n, Word.to_nat(n, wv.subhi(n, ah, al, bh, bl)))), wv.V(n, bh, bl)) == Nat.add(wv.V(n, ah, al), wv.Q(n, U.U32Nat.bit(Nat.is_lt(wv.V(n, ah, al), wv.V(n, bh, bl))))) : Nat}: +hs = wv.val_lt2(n, Word.to_nat(n, Word.sub(n, al, bl)), Word.to_nat(n, wv.subhi(n, ah, al, bh, bl)), UL.word_value_lt(n, Word.sub(n, al, bl)), UL.word_value_lt(n, wv.subhi(n, ah, al, bh, bl))) +hb = wv.val_lt2(n, Word.to_nat(n, bl), Word.to_nat(n, bh), UL.word_value_lt(n, bl), UL.word_value_lt(n, bh)) +ch = wv.char_sub(n, Nat.add(U.U32Nat.bit(Cmp.is_lt(Word.cmp(n, ah, bh))), U.U32Nat.bit(Cmp.is_lt(Word.cmp(n, Word.sub(n, ah, bh), wv.bitw(n, wv.c1sub(n, al, bl)))))), Nat.add(Word.to_nat(n, Word.sub(n, al, bl)), U.U32Nat.dbl(n, Word.to_nat(n, wv.subhi(n, ah, al, bh, bl)))), wv.V(n, ah, al), wv.V(n, bh, bl), wv.gsub.sum(n, ah, al, bh, bl), hs, hb) %ch : {Nat.add(Nat.add(Word.to_nat(n, Word.sub(n, al, bl)), U.U32Nat.dbl(n, Word.to_nat(n, wv.subhi(n, ah, al, bh, bl)))), wv.V(n, bh, bl)) == Nat.add(wv.V(n, ah, al), wv.Q(n, _)) : Nat} wv.gsub.sum(n, ah, al, bh, bl) Uses (19): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Cmp.is_lt 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.is_lt https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Word https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Word.cmp https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Word.sub https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Word.to_nat https://jend.leeeet.dev/definition.txt?path=bend-osdev-u32@0.1.0.0/LAWS.bend&name=word_value_lt 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_value.bend&name=wv.Q https://jend.leeeet.dev/definition.txt?path=bend-osdev-word64@0.1.1.0/proof_value.bend&name=wv.V https://jend.leeeet.dev/definition.txt?path=bend-osdev-word64@0.1.1.0/proof_value.bend&name=wv.bitw https://jend.leeeet.dev/definition.txt?path=bend-osdev-word64@0.1.1.0/proof_value.bend&name=wv.c1sub https://jend.leeeet.dev/definition.txt?path=bend-osdev-word64@0.1.1.0/proof_value.bend&name=wv.char_sub https://jend.leeeet.dev/definition.txt?path=bend-osdev-word64@0.1.1.0/proof_value.bend&name=wv.gsub.sum https://jend.leeeet.dev/definition.txt?path=bend-osdev-word64@0.1.1.0/proof_value.bend&name=wv.subhi https://jend.leeeet.dev/definition.txt?path=bend-osdev-word64@0.1.1.0/proof_value.bend&name=wv.val_lt2