code: def solve_generic(polys, opt, strict=False):
      """
      Solve a generic system of polynomial equations.
  
      Returns all possible solutions over C[x_1, x_2, ..., x_m] of a
      set F = { f_1, f_2, ..., f_n } of polynomial equations, using
      Groebner basis approach. For now only zero-dimensional systems
      are supported, which means F can have at most a finite number
      of solutions. If the basis contains only the ground, None is
      returned.
  
      The algorithm works by the fact that, supposing G is the basis
      of F with respect to an elimination order (here lexicographic
      order is used), G and F generate the same ideal, they have the
      same set of solutions. By the elimination property, if G is a
      reduced, zero-dimensional Groebner basis, then there exists an
      univariate polynomial in G (in its last variable). This can be
      solved by computing its roots. Substituting all computed roots
      for the last (eliminated) variable in other elements of G, new
      polynomial system is generated. Applying the above procedure
      recursively, a finite number of solutions can be found.
  
      The ability of finding all solutions by this procedure depends
      on the root finding algorithms. If no solutions were found, it
      means only that roots() failed, but the system is solvable. To
      overcome this difficulty use numerical algorithms instead.
  
      Parameters
      ==========
  
      polys: a list/tuple/set
          Listing all the polynomial equations that are needed to be solved
      opt: an Options object
          For specifying keyword arguments and generators
      strict: a boolean
          If strict is True, NotImplementedError will be raised if the solution
          is known to be incomplete
  
      Returns
      =======
  
      List[Tuple]
          a list of tuples with elements being solutions for the
          symbols in the order they were passed as gens
      None
          None is returned when the computed basis contains only the ground.
  
      References
      ==========
  
      .. [Buchberger01] B. Buchberger, Groebner Bases: A Short
      Introduction for Systems Theorists, In: R. Moreno-Diaz,
      B. Buchberger, J.L. Freire, Proceedings of EUROCAST'01,
      February, 2001
  
      .. [Cox97] D. Cox, J. Little, D. O'Shea, Ideals, Varieties
      and Algorithms, Springer, Second Edition, 1997, pp. 112
  
      Raises
      ========
  
      NotImplementedError
          If the system is not zero-dimensional (does not have a finite
          number of solutions)
  
      UnsolvableFactorError
          If ``strict`` is True and not all solution components are
          expressible in radicals
  
      Examples
      ========
  
      >>> from sympy import Poly, Options
      >>> from sympy.solvers.polysys import solve_generic
      >>> from sympy.abc import x, y
      >>> NewOption = Options((x, y), {'domain': 'ZZ'})
  
      >>> a = Poly(x - y + 5, x, y, domain='ZZ')
      >>> b = Poly(x + y - 3, x, y, domain='ZZ')
      >>> solve_generic([a, b], NewOption)
      [(-1, 4)]
  
      >>> a = Poly(x - 2*y + 5, x, y, domain='ZZ')
      >>> b = Poly(2*x - y - 3, x, y, domain='ZZ')
      >>> solve_generic([a, b], NewOption)
      [(11/3, 13/3)]
  
      >>> a = Poly(x**2 + y, x, y, domain='ZZ')
      >>> b = Poly(x + y*4, x, y, domain='ZZ')
      >>> solve_generic([a, b], NewOption)
      [(0, 0), (1/4, -1/16)]
  
      >>> a = Poly(x**5 - x + y**3, x, y, domain='ZZ')
      >>> b = Poly(y**2 - 1, x, y, domain='ZZ')
      >>> solve_generic([a, b], NewOption, strict=True)
      Traceback (most recent call last):
      ...
      UnsolvableFactorError
  
      """
  
      def _is_univariate(f):
          """Returns True if 'f' is univariate in its last variable."""
          for monom in f.monoms():
              if any(monom[:-1]):
                  return False
  
          return True
  
      def _subs_root(f, gen, zero):
          """Replace generator with a root so that the result is nice."""
          p = f.as_expr({gen: zero})
  
          if f.degree(gen) >= 2:
              p = p.expand(deep=False)
  
          return p
  
      def _solve_reduced_system(system, gens, entry=False):
          """Recursively solves reduced polynomial systems."""
          if len(system) == len(gens) == 1:
              # the below line will produce UnsolvableFactorError if
              # strict=True and the solution from `roots` is incomplete
              zeros = list(
                  roots(system[0], gens[-1], strict=strict).keys()
              )
              return [(zero,) for zero in zeros]
  
          basis = groebner(system, gens, polys=True)
  
          if len(basis) == 1 and basis[0].is_ground:
              if not entry:
                  return []
              else:
                  return None
  
          univariate = list(filter(_is_univariate, basis))
  
          if len(basis) < len(gens):
              raise NotImplementedError(
                  filldedent(
                      """
                  only zero-dimensional systems supported
                  (finite number of solutions)
                  """
                  )
              )
  
          if len(univariate) == 1:
              f = univariate.pop()
          else:
              raise NotImplementedError(
                  filldedent(
                      """
                  only zero-dimensional systems supported
                  (finite number of solutions)
                  """
                  )
              )
  
          gens = f.gens
          gen = gens[-1]
  
          # the below line will produce UnsolvableFactorError if
          # strict=True and the solution from `roots` is incomplete
          zeros = list(roots(f.ltrim(gen), strict=strict).keys())
  
          if not zeros:
              return []
  
          if len(basis) == 1:
              return [(zero,) for zero in zeros]
  
          solutions = []
  
          for zero in zeros:
              new_system = []
              new_gens = gens[:-1]
  
              for b in basis[:-1]:
                  eq = _subs_root(b, gen, zero)
  
                  if eq is not S.Zero:
                      new_system.append(eq)
  
              for solution in _solve_reduced_system(
                  new_system, new_gens
              ):
                  solutions.append(solution + (zero,))
  
          if solutions and len(solutions[0]) != len(gens):
              raise NotImplementedError(
                  filldedent(
                      """
                  only zero-dimensional systems supported
                  (finite number of solutions)
                  """
                  )
              )
          return solutions
  
      try:
          result = _solve_reduced_system(polys, opt.gens, entry=True)
      except CoercionFailed:
          raise NotImplementedError
  
      if result is not None:
          return sorted(result, key=default_sort_key)
  
file_path: sympy/sympy/solvers/polysys.py
imports: import itertools
  from sympy.core import S
  from sympy.core.sorting import default_sort_key
  from sympy.polys import Poly, groebner, roots
  from sympy.polys.polytools import parallel_poly_from_expr
  from sympy.polys.polyerrors import ComputationFailed, PolificationFailed, CoercionFailed
  from sympy.simplify import rcollect
  from sympy.utilities import postfixes
  from sympy.utilities.misc import filldedent
label_desc: Use image node_id 3 for calling a global function with example usage: solve_generic(polys, opt, strict) and returns: True, p, solutions, sorted, unknown, list, unknown, False, list, None