boolean updateEquivalence(DistinctPairSet.DistinctPair pair, int firstIndex, int secondIndex, boolean rightDistinct) {
      if (firstIndex != -1 && secondIndex != -1 && firstIndex != secondIndex) return true;
      return update(rightDistinct, !rightDistinct, () -> {
        if (firstIndex == secondIndex && !pair.isOrdered()) {
          DfaVariableValue canonicalVariable = pair.getFirst().getCanonicalVariable();
          if (canonicalVariable != null) {
            return new MergePatch(!rightDistinct, ms -> ms.removeEquivalence(canonicalVariable));
          }
        }
        return null;
      });
    }
boolean updateEquivalence(DistinctPairSet.DistinctPair pair, int firstIndex, int secondIndex, boolean rightDistinct)