Part of the reason for the confusion, I think, is because the common
OutputForm for polynomials does not typographically identify polynomial
variables versus coefficients. But if, say the polynomial variables were
always printed in bold face roman type but the coefficients were printed in
italic, it might be more clear what is going on.
I think that this is a very nice idee. I guess this could be even realized on
text terminals, couldn't it?
I hope nobody is constructing something like
DMP([x], DMP([x], DMP([x], Integer)))
What are the possible typefaces of x?
Ufff... what's that???
P := DMP([x], DMP([x], Integer))
a:P := x
DistributedMultivariatePolynomial([x],
DistributedMultivariatePolynomial([x],Integer)) is not a valid
type.
Why would Axiom forbid P and allow
Q := DMP([x], Polynomial Integer)
b:Q := x
(6) x
Type: DistributedMultivariatePolynomial([x],Polynomial Integer)
???
And why is that???
(15) -> R := Polynomial Polynomial Integer
(15) Polynomial Polynomial Integer
Type:
Domain
(16) -> c: R := x
Polynomial Polynomial Integer is not a valid type.
Yes, now I do my homework and look into the sources of DMP.
Well, my understanding of SPAD is a bit limited, but DMP builds on
GeneralDistributedMultivariatePolynomial (GDMP) and I cannot find
anything that looks like aborting the domain instantiation.
So let's do the following...
Copy the code from DistributedMultivariatePolynomial and just rename the
domain.
--begin aaa.spad
)abbrev domain RHX RHXPolynomial
RHXPolynomial(vl,R): public == private where
vl : List Symbol
R : Ring
E ==> DirectProduct(#vl,NonNegativeInteger)
OV ==> OrderedVariableList(vl)
public == PolynomialCategory(R,E,OV) with
reorder: (%,List Integer) -> %
private ==
GeneralDistributedMultivariatePolynomial(vl,R,E)
--end aaa.spad
Then say
)compile aaa.spad
P := RHX([x], RHX([x], Integer))
a:P := x
(2) x
Type: RHXPolynomial([x],RHXPolynomial([x],Integer))
Hmm, just by renaming of DMP to RHX I get a different behaviour?
This tells me that I don't have to look into the Algebra sources to find
why DMP([x], DMP([x], Integer)) is not a valid type. :-(
I hope at some point you agree with me that the interpreter or whoever
forbids to construct DMP([x], DMP([x], Integer)) ) should NOT add
knowledge that is not derivable from the SPAD code in Algebra.
Ralf
_______________________________________________
Axiom-developer mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/axiom-developer