law word_adc_exact_sym
import bend-mathlib@0.8.1.0/u32.bend as U32import Base
import bend-mathlib@0.8.1.0/nat.bend as MNat
1004# The adder is exact below the overflow: a + b + carry-in < 2^n implies to_nat (adc a b False c) = a + b + carry-in, reversed to rewrite toward the simple side.
1005law word_adc_exact_sym:
1006 for n: Nat
1007 for a: Word(n)
1008 for b: Word(n)
1009 for c: Bool
1010 for h: MNat.lt(Nat.add(Nat.add(Word.to_nat(n, a), Word.to_nat(n, b)), Bool.pick(Nat, c, 1n, 0n)), Nat.pow(2n, n))
1011 {Nat.add(Nat.add(Word.to_nat(n, a), Word.to_nat(n, b)), Bool.pick(Nat, c, 1n, 0n)) == Word.to_nat(n, Word.adc(n, a, b, False{}, c)) : Nat}
Uses (11)
Used by (0)
No other definition uses this definition.