Here are some notes I took when I tried to allow expressions ove finite fields.
when making ZMOD
an OrderedSet
in the obvious way, I can have EXPR ZMOD 5
and EXPR PF 5
.
However, not all things work that should:
a:EXPR PF 5 := 2
a < 3$EXPR PF 5
gives false
, as does 3$EXPR PF 5 < a
The reason for this is that in polycat.spad/POLYCAT
, the following definition is
used. It should be OrderedStructure
, maybe:
if R has OrderedSet then
p:% < q:% ==
(dp:= degree p) < (dq := degree q) => (leadingCoefficient q) > 0
dq < dp => (leadingCoefficient p) < 0
-- leadingCoefficient(p - q) < 0
-- the last test works only if < is compatible with -
-- the following works, but is slower, of course
leadingCoefficient(p) < leadingCoefficient(q)
Furthermore, saying:
a:EXPR PF 3 := 2
eval(a^x,x=5)
gives 2^2
unevaluated.
Here we have two problems at once:
- it should be
2^5=32=2
rather than 2^2=4=1
(that is, it treats x
as an element
of EXPR PF 3
rather than an integer. Question: is a^(b::EXPR PF 3)
meaningful? Rather not, since the power laws do
not hold: 2=2*1=2^1*2^2=2^3=2^0=1 (3)
What is required so that a^b
is well defined?
- it should evaluate the expression.
This happens in COMBF
, since... Hmmm, I didn't take notes here anymore. I probably didn't find out.