private static boolean isSameRelation(DfaRelation dfaRel, DfaVariableValue var, Relation relation) {
    DfaValue counterpart;
    RelationType type;
    if (dfaRel.leftOperand() == var) {
      type = dfaRel.relationType();
      counterpart = dfaRel.rightOperand();
    }
    else if (dfaRel.rightOperand() == var) {
      type = dfaRel.relationType().getFlipped();
      counterpart = dfaRel.leftOperand();
    }
    else {
      return false;
    }
    return counterpart == relation.myCounterpart && type != null;
  }
private static boolean isSameRelation(DfaRelation dfaRel, DfaVariableValue var, Relation relation)