def internal_adc_not

bend-mathlib@0.8.1.0 · u32.bend:424

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

424def internal_adc_not(n: Nat, a: Word(n), b: Word(n), c: Bool) -> {Word.adc(n, a, b, True{}, c) == Word.adc(n, a, Word.not(n, b), False{}, c) : Word(n)}:
425  match n:
426    case 0n:
427      {==}
428    case 1n++p:
429      match a b:
430        case WCon{False{}, +at} WCon{+bb, +bt}:
431          +c = c
432          Equal.cong(Word(p), Word(1n+p), w => WCon{Bool.xor(Bool.not(bb), c), w}, Word.adc(p, at, bt, True{}, Bool.and(Bool.not(bb), c)), Word.adc(p, at, Word.not(p, bt), False{}, Bool.and(Bool.not(bb), c)), internal_adc_not(p, at, bt, Bool.and(Bool.not(bb), c)))
433        case WCon{True{}, +at} WCon{+bb, +bt}:
434          +c = c
435          Equal.cong(Word(p), Word(1n+p), w => WCon{Bool.not(Bool.xor(Bool.not(bb), c)), w}, Word.adc(p, at, bt, True{}, Bool.or(Bool.not(bb), c)), Word.adc(p, at, Word.not(p, bt), False{}, Bool.or(Bool.not(bb), c)), internal_adc_not(p, at, bt, Bool.or(Bool.not(bb), c)))

Uses (11)

Used by (2)