(terms)
return simplified_terms
Reduces a set of minterms, if possible, to a simplified set of minterms
    with one less variable in the terms using QM method.
Reduces a set of minterms, if possible, to a simplified set of minterms
    with one less variable in the terms using QM method.
Reduces a set of minterms if possible to a simplified set of minterms with one less variable in the terms using QM method .
def _simplified_pairs(terms):
    """
    Reduces a set of minterms, if possible, to a simplified set of minterms
    with one less variable in the terms using QM method.
    """
    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