/usr/share/axiom-20170501/src/algebra/UPOLYC2.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 | )abbrev package UPOLYC2 UnivariatePolynomialCategoryFunctions2
++ Description:
++ Mapping from polynomials over R to polynomials over S
++ given a map from R to S assumed to send zero to zero.
UnivariatePolynomialCategoryFunctions2(R,PR,S,PS) : SIG == CODE where
R : Ring
PR : UnivariatePolynomialCategory R
S : Ring
PS : UnivariatePolynomialCategory S
SIG ==> with
map : (R -> S, PR) -> PS
++ map(f, p) takes a function f from R to S,
++ and applies it to each (non-zero) coefficient of a polynomial p
++ over R, getting a new polynomial over S.
++ Note that since the map is not applied to zero elements, it may map
++ zero to zero.
CODE ==> add
map(f, p) ==
ans:PS := 0
while p ^= 0 repeat
ans := ans + monomial(f leadingCoefficient p, degree p)
p := reductum p
ans
|