def dmp_irreducible_p(f, u, K):
 (_, factors) = dmp_factor_list(f, u, K)
 if (not factors):
  return True
 elif (len(factors) > 1):
  return False
 else:
  (_, k) = factors[0]
  return (k == 1)

def dmp_irreducible_p ( f , u , K ) : ( _ , factors ) = dmp_factor_list ( f , u , K ) if ( not factors ) : return True elif ( len ( factors ) > 1 ) : return False else : ( _ , k ) = factors [ 0 ] return ( k == 1 )
returns true if f has no factors over its domain .