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.
I consider it a bug.
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.
Good. Then we declare PF(2) to be Algebra(R) where R is just the ring
you described above, i.e. R = S^(-1)Z where S is the multiplicativ set
of all odd integers. Even if this sounds more complicated it is less a
lie than the current Algebra(Fraction 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.
Sounds like you want to lift. Nice idea actually. But if that is the
case than you should rather create a series domain that never computes
above a critical order. I'd call this a polynomial. Maybe a polynomial
that in some sense behaves lazily like a 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.
I'm, of course, in favour not to eliminate that option. But still, I
want correctness.
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...
;-) I agree, that 3) will not happen in the next two weeks. But again,
why do we have a type system, if we choose to ignore it? So final goal
should be 3).
Wasn't there some horizon in 50 years? ;-)
Ralf
--
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.