Martin Rubey wrote:
> Waldek Hebisch <[email protected]> writes:
>
> > Martin Rubey wrote:
> >> Do we really want to declare all integers less than 2 non-prime? Eg.,
> >> prime?(-5) gives false.
> >>
> >> Martin
> >>
> >> (Apart from this, I was a little surprised that we don't even have
> >> prime? for polynomials, etc.)
> >
> > In UniqueFactorizationDomain we have:
> >
> > prime?: % -> Boolean
> > ++ prime?(x) tests if x can never be written as the product of
> > two
> > ++ non-units of the ring,
> > ++ i.e., x is an irreducible element.
> >
> >
> > So the problem is that apropriate polynomial domains should have
> > UniqueFactorizationDomain.
>
> OK, I see there is a default definition. I guess this goes to the
> discussion whether PolynomialFactorizationExplicit is a bad idea...
>
IMHO code to support PolynomialFactorizationExplicit is bad, and
we should do it in a different way. We should definitely have
some way to propagate information about factorization so that
domains for which we can factorize have UniqueFactorizationDomain.
ATM it is not clear for me if PolynomialFactorizationExplicit is
good for this purpose.
> > And for consistency integers should use the same definition, that
> > is apply absolute value before proper primality test.
>
> Yes. Should I apply the following patch?:
>
> prime? n ==
> n < 0 => n := -n
> n < two => false
>
Yes.
--
Waldek Hebisch
[email protected]
--
You received this message because you are subscribed to the Google Groups
"FriCAS - computer algebra system" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/fricas-devel?hl=en.