def METHOD_NAME(self, var1_ind, var2_ind, anc_var_ind):
    """Replace variables in a list of QClauses (inplace).
    Args:
    var1_ind: index of the first variable
    var2_ind: index of the second variable
    anc_var_ind: an index of an ancillary variable that replaces a
        multiplication of var1_ind and var2_ind
    """
    for c in self.qclauses:
        if (var1_ind in c.vars_ind and
                var2_ind in c.vars_ind and len(c.vars_ind) > 2):
            c.vars_ind.remove(var1_ind)
            c.vars_ind.remove(var2_ind)
            c.vars_ind.append(anc_var_ind)