% Some current rule of degree I was not rule of degree I
aux_1(I) :- r(R,I), not aux_o(R,I).

% Some rule that had degree I has not degree I now
aux_2(I) :- aux_o(R,I), not r(R,I).

aux_nonequal(I) :- aux_1(I).
aux_nonequal(I) :- aux_2(I).

aux_somenonequalbefore(I) :-
  aux_degree(I),aux_degree(J),J<I,aux_nonequal(J).

aux_better :- 
  aux_degree(I),aux_1(I), not aux_2(I), not aux_somenonequalbefore(I).

:- not aux_better.