def cp_cmp(c, d):
 zero = Polyn(c[2]).ring.zero
 c0 = lbp(c[0], zero, Num(c[2]))
 d0 = lbp(d[0], zero, Num(d[2]))
 r = lbp_cmp(c0, d0)
 if (r == (-1)):
  return (-1)
 if (r == 0):
  c1 = lbp(c[3], zero, Num(c[5]))
  d1 = lbp(d[3], zero, Num(d[5]))
  r = lbp_cmp(c1, d1)
  if (r == (-1)):
   return (-1)
 return 1

def cp_cmp ( c , d ) : zero = Polyn ( c [ 2 ] ) . ring . zero c0 = lbp ( c [ 0 ] , zero , Num ( c [ 2 ] ) ) d0 = lbp ( d [ 0 ] , zero , Num ( d [ 2 ] ) ) r = lbp_cmp ( c0 , d0 ) if ( r == ( - 1 ) ) : return ( - 1 ) if ( r == 0 ) : c1 = lbp ( c [ 3 ] , zero , Num ( c [ 5 ] ) ) d1 = lbp ( d [ 3 ] , zero , Num ( d [ 5 ] ) ) r = lbp_cmp ( c1 , d1 ) if ( r == ( - 1 ) ) : return ( - 1 ) return 1
compare two critical pairs c and d .