Compares only whether:
other
@override bool operator ==(Object other) => other is TermPair && term1 == other.term1 && term2 == other.term2;