/usr/share/axiom-20170501/src/algebra/RF.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 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 | )abbrev package RF RationalFunction
++ Author: Manuel Bronstein
++ Date Created: 1987
++ Date Last Updated: 18 April 1991
++ Description:
++ Utilities that provide the same top-level manipulations on
++ fractions than on polynomials.
-- Do not make into a domain!
RationalFunction(R) : SIG == CODE where
R : IntegralDomain
V ==> Symbol
P ==> Polynomial R
Q ==> Fraction P
QF ==> PolynomialCategoryQuotientFunctions(IndexedExponents Symbol,
Symbol, R, P, Q)
SIG ==> with
variables : Q -> List V
++ variables(f) returns the list of variables appearing
++ in the numerator or the denominator of f.
mainVariable : Q -> Union(V, "failed")
++ mainVariable(f) returns the highest variable appearing
++ in the numerator or the denominator of f, "failed" if
++ f has no variables.
univariate : (Q, V) -> Fraction SparseUnivariatePolynomial Q
++ univariate(f, v) returns f viewed as a univariate
++ rational function in v.
multivariate : (Fraction SparseUnivariatePolynomial Q, V) -> Q
++ multivariate(f, v) applies both the numerator and
++ denominator of f to v.
eval : (Q, V, Q) -> Q
++ eval(f, v, g) returns f with v replaced by g.
eval : (Q, List V, List Q) -> Q
++ eval(f, [v1,...,vn], [g1,...,gn]) returns f with
++ each vi replaced by gi in parallel, vi's appearing
++ inside the gi's are not replaced.
eval : (Q, Equation Q) -> Q
++ eval(f, v = g) returns f with v replaced by g.
++ Error: if v is not a symbol.
eval : (Q, List Equation Q) -> Q
++ eval(f, [v1 = g1,...,vn = gn]) returns f with
++ each vi replaced by gi in parallel, vi's appearing
++ inside the gi's are not replaced.
++ Error: if any vi is not a symbol.
coerce : R -> Q
++ coerce(r) returns r viewed as a rational function over R.
CODE ==> add
foo : (List V, List Q, V) -> Q
peval: (P, List V, List Q) -> Q
coerce(r:R):Q == r::P::Q
variables f == variables(f)$QF
mainVariable f == mainVariable(f)$QF
univariate(f, x) == univariate(f, x)$QF
multivariate(f, x) == multivariate(f, x)$QF
eval(x:Q, s:V, y:Q) == eval(x, [s], [y])
eval(x:Q, eq:Equation Q) == eval(x, [eq])
foo(ls, lv, x) == match(ls, lv, x, x::Q)$ListToMap(V, Q)
eval(x:Q, l:List Equation Q) ==
eval(x, [retract(lhs eq)@V for eq in l]$List(V),
[rhs eq for eq in l]$List(Q))
eval(x:Q, ls:List V, lv:List Q) ==
peval(numer x, ls, lv) / peval(denom x, ls, lv)
peval(p, ls, lv) ==
map(z1 +-> foo(ls, lv, z1), z2 +-> z2::Q,p)
$PolynomialCategoryLifting(IndexedExponents V,V,R,P,Q)
|