> Nothing changed in Factored, but now Polynomial(Integer) has
> UniqueFactorizationDomain.  Now coercion to Factored is
> performing factorization:
> 
> (1) -> (x^2 - 1)::Factored(?)
> 
>    (1)  (x - 1)(x + 1)
>                                           Type: Factored(Polynomial(Integer))
> 
> This coercion is performed after subtraction.

Yes. I understand your example and don't have a problem with it.
Coercion is an operation and is allowed to do something.

Now, in my original posting I used p+1 and who knows, why type the
interpreter give to + and 1 and what magic coercions happen in between
even though the result finally is Factored Polynomial Integer.

But where is the coercion in the session below? Everything happens
inside F, so there shouldn't be need for a coercion, and, in fact, I
cannot see from the code of Factored, where there is a coercion or
anything that produces a factored form in (5).

Ralf

(1) -> F ==> Factored Polynomial Integer
                                                                   Type:
Void
(2) -> e: F := 1

   (2)  1
                                          Type:
Factored(Polynomial(Integer))
(3) -> p: F := (x-1)^2*(x+1)

               2
   (3)  (x - 1) (x + 1)
                                          Type:
Factored(Polynomial(Integer))
(4) -> q: F := p + e

         3    2
   (4)  x  - x  - x + 2
                                          Type:
Factored(Polynomial(Integer))
(5) -> r: F := q - e

               2
   (5)  (x - 1) (x + 1)
                                          Type:
Factored(Polynomial(Integer))

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to