def maj

bend-kit-lemmas@0.1.1.0 · lemmas.bend:291

import bend-kit-lemmas@0.1.1.0/lemmas.bend as Lemmas
import Base

291# The carry out of a full adder: set when two or three of the bits are set.
292def maj(x: Bool, y: Bool, c: Bool) -> Bool:
293  match x y:
294    case False{} False{}:
295      False{}
296    case True{} True{}:
297      True{}
298    case False{} True{}:
299      c
300    case True{} False{}:
301      c

Uses (1)

Used by (1)