def check_solutions(eq):
 s = diophantine(eq)
 factors = Mul.make_args(eq)
 var = list(eq.free_symbols)
 var.sort(key=default_sort_key)
 while s:
  solution = s.pop()
  for f in factors:
   if (diop_simplify(f.subs(zip(var, solution))) == 0):
    break
  else:
   return False
 return True

def check_solutions ( eq ) : s = diophantine ( eq ) factors = Mul . make_args ( eq ) var = list ( eq . free_symbols ) var . sort ( key = default_sort_key ) while s : solution = s . pop ( ) for f in factors : if ( diop_simplify ( f . subs ( zip ( var , solution ) ) ) == 0 ) : break else : return False return True
determines whether solutions returned by diophantine() satisfy the original equation .