code: def truthtable2expr(tt, conj=False):
      
      if conj:
          outer, inner = (And, Or)
          nums = tt.pcdata.iter_zeros()
      else:
          outer, inner = (Or, And)
          nums = tt.pcdata.iter_ones()
      inputs = [exprvar(v.names, v.indices) for v in tt.inputs]
      terms = [boolfunc.num2term(num, inputs, conj) for num in nums]
      return outer(*[inner(*term) for term in terms])
docs: Convert a truth table into an expression.