Ralf Hemmecke wrote:
> Any idea what happens here?
> 
> Don't ask whether that is useful. I just realized that 'sin' is 
> implemented in UnivariateTaylorSeries if the coefficient domain 
> satisfies Algebra(Fraction Integer).
> 
> Looks somehow like a bug to me. I have the suspicion that the code to 
> compute the sine series relies on differentiation and therefore on 
> CharacteristicZero.
> 
> Ralf
> 
> 
>                   FriCAS (AXIOM fork) Computer Algebra System
>                              Version: FriCAS 1.0.9
>                 Timestamp: Monday February 1, 2010 at 22:13:35
> -----------------------------------------------------------------------------
>     Issue )copyright to view copyright notices.
>     Issue )summary for a summary of useful system commands.
>     Issue )quit to leave FriCAS and return to shell.
> -----------------------------------------------------------------------------
> 
> (1) ->
> (1) -> P := PrimeField 2
> 
>     (1)  PrimeField(2)
>  
> Type: Type
> (2) -> P has Algebra Fraction Integer
> 
>     (2)  true
>                                                                  Type: 
> Boolean
> (3) -> T := UnivariateTaylorSeries(P, t, 0)
> 
>     (3)  UnivariateTaylorSeries(PrimeField(2),t,0)
>  
> Type: Type
> (4) -> t: T := monomial(1,1)
> 
>     (4)  t
>                                Type: 
> UnivariateTaylorSeries(PrimeField(2),t,0)
> 
> (5) -> sin(t)
> 
> 
>     >> Error detected within library code:
>     not invertible
> 


AFAICS your problem is really with 'P has Algebra Fraction Integer':

(3) -> inv2 := 1/2
        1
   (3)  -
        2
                                                      Type: Fraction(Integer)
(4) -> inv2*1$P                      
 
   >> Error detected within library code:
   not invertible


If this is a bug depends on point of view.  Namely, you can not
multiply elements of GF(2) by arbitrary rationals, but you can
by all rationals with denominator relatively prime to 2, which is
much more than integer.

At first glance power series like sin over finite fields make no
sense.  But if chartacteristic is p the first p terms are well
defined, so one can still compute initial part of the series.
In fact, one could try to do various computations on elementary
functions in finite field.  It is easy to choose p big enough
to that all numbers which we will invert are nonzero mod p.
This has potential of significantly speeding up expression
manipulation.

Now, to allow such modular computations with expressions there
are various possibilities:

1) Allow finite fields as coefficient and throw error when
  faced with non-invertible element

2) Re-implement all expression domains allowing explicitely for
  failure (using 'recip' instead of '/', having things like
  'integrateIfCan, etc...).

3) Re-organize expression domains to allow finite fields, but
   still warranty that operations can be done.

If we want faithfully follow Axiom paradigm than only 2) or 3) would
be acceptable. 3) would be ideal, but I am affraid that the best
we can get in this direction would be some combination of
2) and 3).  I must say that I consider 2) as very ugly. So 1)
looks like best alternative...


-- 
                              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.

Reply via email to