def _simplified_pairs(terms):
 simplified_terms = []
 todo = list(range(len(terms)))
 for (i, ti) in enumerate(terms[:(-1)]):
  for (j_i, tj) in enumerate(terms[(i + 1):]):
   index = _check_pair(ti, tj)
   if (index != (-1)):
    todo[i] = todo[((j_i + i) + 1)] = None
    newterm = ti[:]
    newterm[index] = 3
    if (newterm not in simplified_terms):
     simplified_terms.append(newterm)
 simplified_terms.extend([terms[i] for i in [_ for _ in todo if (_ is not None)]])
 return simplified_terms

def _simplified_pairs ( terms ) : simplified_terms = [ ] todo = list ( range ( len ( terms ) ) ) for ( i , ti ) in enumerate ( terms [ : ( - 1 ) ] ) : for ( j_i , tj ) in enumerate ( terms [ ( i + 1 ) : ] ) : index = _check_pair ( ti , tj ) if ( index != ( - 1 ) ) : todo [ i ] = todo [ ( ( j_i + i ) + 1 ) ] = None newterm = ti [ : ] newterm [ index ] = 3 if ( newterm not in simplified_terms ) : simplified_terms . append ( newterm ) simplified_terms . extend ( [ terms [ i ] for i in [ _ for _ in todo if ( _ is not None ) ] ] ) return simplified_terms
reduces a set of minterms .