/usr/share/axiom-20170501/src/algebra/PFOTOOLS.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 | )abbrev package PFOTOOLS PointsOfFiniteOrderTools
++ Author: Manuel Bronstein
++ Date Created: 25 Aug 1988
++ Date Last Updated: 11 Jul 1990
++ Description:
++ Utilities for PFOQ and PFO
PointsOfFiniteOrderTools(UP, UPUP) : SIG == CODE where
UP : UnivariatePolynomialCategory Fraction Integer
UPUP : UnivariatePolynomialCategory Fraction UP
PI ==> PositiveInteger
N ==> NonNegativeInteger
Z ==> Integer
Q ==> Fraction Integer
SIG ==> with
getGoodPrime : Z -> PI
++ getGoodPrime n returns the smallest prime not dividing n
badNum : UP -> Record(den:Z, gcdnum:Z)
++ badNum(p) \undocumented
badNum : UPUP -> Z
++ badNum(u) \undocumented
mix : List Record(den:Z, gcdnum:Z) -> Z
++ mix(l) \undocumented
doubleDisc : UPUP -> Z
++ doubleDisc(u) \undocumented
polyred : UPUP -> UPUP
++ polyred(u) \undocumented
CODE ==> add
import IntegerPrimesPackage(Z)
import UnivariatePolynomialCommonDenominator(Z, Q, UP)
mix l == lcm(lcm [p.den for p in l], gcd [p.gcdnum for p in l])
badNum(p:UPUP) == mix [badNum(retract(c)@UP) for c in coefficients p]
polyred r ==
lcm [commonDenominator(retract(c)@UP) for c in coefficients r] * r
badNum(p:UP) ==
cd := splitDenominator p
[cd.den, gcd [retract(c)@Z for c in coefficients(cd.num)]]
getGoodPrime n ==
p:PI := 3
while zero?(n rem p) repeat
p := nextPrime(p::Z)::PI
p
doubleDisc r ==
d := retract(discriminant r)@UP
retract(discriminant((d exquo gcd(d, differentiate d))::UP))@Z
|