def is_groebner(G, ring):
 for i in range(len(G)):
  for j in range((i + 1), len(G)):
   s = spoly(G[i], G[j])
   s = s.rem(G)
   if s:
    return False
 return True

def is_groebner ( G , ring ) : for i in range ( len ( G ) ) : for j in range ( ( i + 1 ) , len ( G ) ) : s = spoly ( G [ i ] , G [ j ] ) s = s . rem ( G ) if s : return False return True
check if g is a groebner basis .