someone wrote:

> 
> With:
> 
>   F: RealClosure(Q)
> 
>   Z ==> Integer
>   Q ==> Fraction Z  
>   UP  ==> Polynomial F
>   RAT ==> Fraction UP
>   
>   import Kernel(F)
> 
> the call:
> 
>   sol := get_rational_solutions2(coerce(p)@RAT, kernel x)
> 
> gives me:
> 
>    >> Apparent user error:
>    Cannot coerce F 
>       of mode (RealClosure (Fraction (Integer))) 
>       to mode (Ring)
> 
> but we know:
> 
> (6) -> RealClosure (Fraction (Integer)) has Ring
> 
>    (6)  true
>                                                                 Type:
> Boolean
> 
> so I don't see what is so apparent here.
> Maybe it's just too late.

The error message is uniformative, but given that 'get_rational_solutions2'
is not visible here _some_ error is expected.
 
> > Maximal root is well defined only if coefficients are numbers.
> 
> The polynomial is univariate f.e over Q, so my coefficients
> are indeed numbers.

Even that is tricky: your extension has multiple embeddings into
complex numbers.  The set of real root and maximal real root
depends on the embedding of coefficient field.  So if you really
need maximal root, you need to fix the embedding.

> > In FriCAS ATM that works without problems if you have rational
> > coeffiecients or coefficients from RealClosure.  I would
> > probably first find all integer roots, then maximal one between
> > them.  If the code above is correct you want to check if
> > maximal root is an integer.  As long as you have order on
> > coefficients you can use Sturm segences to check if there
> > is any root bigger than maximal integer root.  For
> > finding integer roots you may look at function
> > 'get_rational_solutions2' in 'ElementaryRischDEX'
> > which finds rational roots of a rational function given as
> > expression (that is we treat expression as rational function
> > with respect to a kernel (given as second argument)).
> 
> Thanks! I tried to use this function in the code
> but failed as you can see above.
<snip>
> It as an internal function of this domain and I can not
> play with it in the interpreter :-/
> 
> Maybe such a function for integer and rational roots
> should go into an own public package?

Yes, it ATM it is internal -- I needed rational roots for computing
integrals and apparently there was no usable function in sight,
so I wrote it.  Current version is specialized for expressions
(I wrote exactly what was needed for integration), but the method
works as long as 'reducedSystem' works, that is base ring must
satisfy 'LinearlyExplicitRingOver(Integer)' (alas, for
RealClosure(Fraction(Integer)) 'reducedSystem' is unimplemented).

And yes, generic version of 'get_rational_solutions2' should
go to some public package (probably we should create a package
for it).

-- 
                              Waldek Hebisch
[email protected] 

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to