/usr/share/axiom-20170501/src/algebra/COMMUPC.spad is in axiom-source 20170501-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | )abbrev package COMMUPC CommuteUnivariatePolynomialCategory
++ Author: Manuel Bronstein
++ Description:
++ A package for swapping the order of two variables in a tower of two
++ UnivariatePolynomialCategory extensions.
CommuteUnivariatePolynomialCategory(R, UP, UPUP) : SIG == CODE where
R : Ring
UP : UnivariatePolynomialCategory R
UPUP : UnivariatePolynomialCategory UP
N ==> NonNegativeInteger
SIG ==> with
swap : UPUP -> UPUP
++ swap(p(x,y)) returns p(y,x).
CODE ==> add
makePoly: (UP, N) -> UPUP
-- converts P(x,y) to P(y,x)
swap poly ==
ans:UPUP := 0
while poly ^= 0 repeat
ans := ans + makePoly(leadingCoefficient poly, degree poly)
poly := reductum poly
ans
makePoly(poly, d) ==
ans:UPUP := 0
while poly ^= 0 repeat
ans := ans +
monomial(monomial(leadingCoefficient poly, d), degree poly)
poly := reductum poly
ans
|