def test_and(): @apply_passes([bool_to_bit()]) def and_f(x, y): return x and y assert inspect.getsource(and_f) == '''\
def test_xor(): @apply_passes([bool_to_bit()]) def xor(x, y): return x and not y or not x and y assert inspect.getsource(xor) == '''\
def test_or(): @apply_passes([bool_to_bit()]) def or_f(x, y): return x or y assert inspect.getsource(or_f) == '''\
def test_not(): @apply_passes([bool_to_bit()]) def not_f(x): return not x assert inspect.getsource(not_f) == '''\
def __init__(self, assembler=None): if assembler is None: assembler=Assembler _AsmFamily.__init__(self, assembler, AssembledADT) _RewriterFamily.__init__(self, (ssa(), bool_to_bit(), if_to_phi(self.Bit.ite)))