/usr/share/axiom-20170501/src/algebra/LIMITRF.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 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 | )abbrev package LIMITRF RationalFunctionLimitPackage
++ Author: Manuel Bronstein
++ Date Created: 4 October 1989
++ Date Last Updated: 26 November 1991
++ Description:
++ Computation of limits for rational functions.
RationalFunctionLimitPackage(R) : SIG == CODE where
R : GcdDomain
Z ==> Integer
P ==> Polynomial R
RF ==> Fraction P
EQ ==> Equation
ORF ==> OrderedCompletion RF
OPF ==> OnePointCompletion RF
UP ==> SparseUnivariatePolynomial RF
SE ==> Symbol
QF ==> Fraction SparseUnivariatePolynomial RF
Result ==> Union(ORF, "failed")
TwoSide ==> Record(leftHandLimit:Result, rightHandLimit:Result)
U ==> Union(ORF, TwoSide, "failed")
RFSGN ==> RationalFunctionSign(R)
SIG ==> with
-- The following are the one we really want, but the interpreter cannot
-- handle them...
-- limit: (RF,EQ ORF) -> U
-- ++ limit(f(x),x,a) computes the real two-sided limit lim(x -> a,f(x))
-- complexLimit: (RF,EQ OPF) -> OPF
-- ++ complexLimit(f(x),x,a) computes the complex limit lim(x -> a,f(x))
-- ... so we replace them by the following 4:
limit : (RF,EQ OrderedCompletion P) -> U
++ limit(f(x),x = a) computes the real two-sided limit
++ of f as its argument x approaches \spad{a}.
limit : (RF,EQ RF) -> U
++ limit(f(x),x = a) computes the real two-sided limit
++ of f as its argument x approaches \spad{a}.
complexLimit : (RF,EQ OnePointCompletion P) -> OPF
++ \spad{complexLimit(f(x),x = a)} computes the complex limit
++ of \spad{f} as its argument x approaches \spad{a}.
complexLimit : (RF,EQ RF) -> OPF
++ complexLimit(f(x),x = a) computes the complex limit
++ of f as its argument x approaches \spad{a}.
limit : (RF,EQ RF,String) -> Result
++ limit(f(x),x,a,"left") computes the real limit
++ of f as its argument x approaches \spad{a} from the left;
++ limit(f(x),x,a,"right") computes the corresponding limit as x
++ approaches \spad{a} from the right.
CODE ==> add
import ToolsForSign R
import InnerPolySign(RF, UP)
import RFSGN
import PolynomialCategoryQuotientFunctions(IndexedExponents SE,
SE, R, P, RF)
finiteComplexLimit: (QF, RF) -> OPF
finiteLimit : (QF, RF) -> U
fLimit : (Z, UP, RF, Z) -> Result
-- These 2 should be exported, see comment above
locallimit : (RF, SE, ORF) -> U
locallimitcomplex: (RF, SE, OPF) -> OPF
limit(f:RF,eq:EQ RF) ==
(xx := retractIfCan(lhs eq)@Union(SE,"failed")) case "failed" =>
error "limit: left hand side must be a variable"
x := xx :: SE; a := rhs eq
locallimit(f,x,a::ORF)
complexLimit(f:RF,eq:EQ RF) ==
(xx := retractIfCan(lhs eq)@Union(SE,"failed")) case "failed" =>
error "limit: left hand side must be a variable"
x := xx :: SE; a := rhs eq
locallimitcomplex(f,x,a::OPF)
limit(f:RF,eq:EQ OrderedCompletion P) ==
(p := retractIfCan(lhs eq)@Union(P,"failed")) case "failed" =>
error "limit: left hand side must be a variable"
(xx := retractIfCan(p)@Union(SE,"failed")) case "failed" =>
error "limit: left hand side must be a variable"
x := xx :: SE
a := map(y +-> y::RF,rhs eq)$OrderedCompletionFunctions2(P,RF)
locallimit(f,x,a)
complexLimit(f:RF,eq:EQ OnePointCompletion P) ==
(p := retractIfCan(lhs eq)@Union(P,"failed")) case "failed" =>
error "limit: left hand side must be a variable"
(xx := retractIfCan(p)@Union(SE,"failed")) case "failed" =>
error "limit: left hand side must be a variable"
x := xx :: SE
a := map(y +-> y::RF,rhs eq)$OnePointCompletionFunctions2(P,RF)
locallimitcomplex(f,x,a)
fLimit(n, d, a, dir) ==
(s := signAround(d, a, dir, sign$RFSGN)) case "failed" => "failed"
n * (s::Z) * plusInfinity()
finiteComplexLimit(f, a) ==
zero?(n := (numer f) a) => 0
zero?(d := (denom f) a) => infinity()
(n / d)::OPF
finiteLimit(f, a) ==
zero?(n := (numer f) a) => 0
zero?(d := (denom f) a) =>
(s := sign(n)$RFSGN) case "failed" => "failed"
rhsl := fLimit(s::Z, denom f, a, 1)
lhsl := fLimit(s::Z, denom f, a, -1)
rhsl case "failed" =>
lhsl case "failed" => "failed"
[lhsl, rhsl]
lhsl case "failed" => [lhsl, rhsl]
rhsl::ORF = lhsl::ORF => lhsl::ORF
[lhsl, rhsl]
(n / d)::ORF
locallimit(f,x,a) ==
g := univariate(f, x)
zero?(n := whatInfinity a) => finiteLimit(g, retract a)
(dn := degree numer g) > (dd := degree denom g) =>
(sn := signAround(numer g, n, sign$RFSGN)) case "failed" => "failed"
(sd := signAround(denom g, n, sign$RFSGN)) case "failed" => "failed"
(sn::Z) * (sd::Z) * plusInfinity()
dn < dd => 0
((leadingCoefficient numer g) / (leadingCoefficient denom g))::ORF
limit(f,eq,st) ==
(xx := retractIfCan(lhs eq)@Union(SE,"failed")) case "failed" =>
error "limit: left hand side must be a variable"
x := xx :: SE; a := rhs eq
zero?(n := (numer(g := univariate(f, x))) a) => 0
zero?(d := (denom g) a) =>
(s := sign(n)$RFSGN) case "failed" => "failed"
fLimit(s::Z, denom g, a, direction st)
(n / d)::ORF
locallimitcomplex(f,x,a) ==
g := univariate(f, x)
(r := retractIfCan(a)@Union(RF, "failed")) case RF =>
finiteComplexLimit(g, r::RF)
(dn := degree numer g) > (dd := degree denom g) => infinity()
dn < dd => 0
((leadingCoefficient numer g) / (leadingCoefficient denom g))::OPF
|