code: def B012(t,i):
      
      if not i:
          return "1"
      nA = Awidth(i)
      nB = Bwidth(i)
      nBB = nB + nA
      if t < nB:
          return "0"+B012(t,i-1)
      elif t < nBB:
          return "1"+A012(t-nB,i-1)
      else:
          return "2"+B012(t-nBB,i-1)
docs: Constructs ternary implication coding (0=not there, 2=U, 1=V)
      t is B column position
      i = |M|-1 to 0