def _convert_to_varsSOP(minterm, variables):
 temp = []
 for (i, m) in enumerate(minterm):
  if (m == 0):
   temp.append(Not(variables[i]))
  elif (m == 1):
   temp.append(variables[i])
  else:
   pass
 return And(*temp)

def _convert_to_varsSOP ( minterm , variables ) : temp = [ ] for ( i , m ) in enumerate ( minterm ) : if ( m == 0 ) : temp . append ( Not ( variables [ i ] ) ) elif ( m == 1 ) : temp . append ( variables [ i ] ) else : pass return And ( * temp )
converts a term in the expansion of a function from binary to its variable form .