law word_adc_wrap_sym

bend-mathlib@0.8.1.0 · u32.bend:1028

import bend-mathlib@0.8.1.0/u32.bend as U32
import Base

1028# The adder wraps modulo 2^n: to_nat (adc a b False c) = (a + b + carry-in) % 2^n, reversed to rewrite toward the simple side.
1029law word_adc_wrap_sym:
1030  for n: Nat
1031  for a: Word(n)
1032  for b: Word(n)
1033  for c: Bool
1034  {Nat.mod(Nat.add(Nat.add(Word.to_nat(n, a), Word.to_nat(n, b)), Bool.pick(Nat, c, 1n, 0n)), Nat.pow(2n, n)) == Word.to_nat(n, Word.adc(n, a, b, False{}, c)) : Nat}

Uses (11)

Used by (0)

No other definition uses this definition.