diff options
author | dos-reis <gdr@axiomatics.org> | 2009-05-18 23:46:53 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2009-05-18 23:46:53 +0000 |
commit | aa129f3b4eaacbeae2837fb7e5c67a1a1a373eaa (patch) | |
tree | 2a10e3ef795b0e2625f642cf2d1d47c7e695a88e /src/algebra | |
parent | 7f0313f8c6cce367c51cf5bb6bc8c073a466191b (diff) | |
download | open-axiom-aa129f3b4eaacbeae2837fb7e5c67a1a1a373eaa.tar.gz |
* algebra/curve.spad.pamphlet: Use literal symbols.
* algebra/defintef.spad.pamphlet: Likewise.
* algebra/defintrf.spad.pamphlet: Likewise.
* algebra/divisor.spad.pamphlet: Likewise.
* algebra/efstruc.spad.pamphlet: Likewise.
* algebra/exprode.spad.pamphlet: Likewise.
* algebra/fspace.spad.pamphlet: Likewise.
* algebra/intaf.spad.pamphlet: Likewise.
* algebra/intef.spad.pamphlet: Likewise.
* algebra/integrat.spad.pamphlet: Likewise.
* algebra/intpm.spad.pamphlet: Likewise.
* algebra/laplace.spad.pamphlet: Likewise.
* algebra/limitps.spad.pamphlet: Likewise.
* algebra/liouv.spad.pamphlet: Likewise.
* algebra/odeef.spad.pamphlet: Likewise.
* algebra/oderf.spad.pamphlet: Likewise.
* algebra/rdeef.spad.pamphlet: Likewise.
* algebra/symbol.spad.pamphlet: Likewise.
* algebra/transsolve.spad.pamphlet: Likewise.
Diffstat (limited to 'src/algebra')
-rw-r--r-- | src/algebra/curve.spad.pamphlet | 4 | ||||
-rw-r--r-- | src/algebra/defintef.spad.pamphlet | 18 | ||||
-rw-r--r-- | src/algebra/defintrf.spad.pamphlet | 4 | ||||
-rw-r--r-- | src/algebra/divisor.spad.pamphlet | 2 | ||||
-rw-r--r-- | src/algebra/efstruc.spad.pamphlet | 100 | ||||
-rw-r--r-- | src/algebra/exprode.spad.pamphlet | 2 | ||||
-rw-r--r-- | src/algebra/fspace.spad.pamphlet | 16 | ||||
-rw-r--r-- | src/algebra/intaf.spad.pamphlet | 18 | ||||
-rw-r--r-- | src/algebra/intef.spad.pamphlet | 24 | ||||
-rw-r--r-- | src/algebra/integrat.spad.pamphlet | 12 | ||||
-rw-r--r-- | src/algebra/intpm.spad.pamphlet | 4 | ||||
-rw-r--r-- | src/algebra/laplace.spad.pamphlet | 12 | ||||
-rw-r--r-- | src/algebra/limitps.spad.pamphlet | 4 | ||||
-rw-r--r-- | src/algebra/liouv.spad.pamphlet | 4 | ||||
-rw-r--r-- | src/algebra/odeef.spad.pamphlet | 2 | ||||
-rw-r--r-- | src/algebra/oderf.spad.pamphlet | 4 | ||||
-rw-r--r-- | src/algebra/rdeef.spad.pamphlet | 14 | ||||
-rw-r--r-- | src/algebra/strap/SYMBOL.lsp | 4 | ||||
-rw-r--r-- | src/algebra/symbol.spad.pamphlet | 2 | ||||
-rw-r--r-- | src/algebra/transsolve.spad.pamphlet | 2 |
20 files changed, 127 insertions, 125 deletions
diff --git a/src/algebra/curve.spad.pamphlet b/src/algebra/curve.spad.pamphlet index 11d82292..37d330ee 100644 --- a/src/algebra/curve.spad.pamphlet +++ b/src/algebra/curve.spad.pamphlet @@ -211,8 +211,8 @@ FunctionFieldCategory(F, UP, UPUP): Category == Definition where d := commonDenominator(coordinates(w := integralBasis()))::RF n := #w vars := [concat(string u, string i)::SY for i in 1..n] - x := "%%dummy1"::SY - y := "%%dummy2"::SY + x := '%%dummy1 + y := '%%dummy2 select_!(zero?(degree(#1, x)) and zero?(degree(#1, y)), lexGroebner([v::P - UPUP2P(lift(d * w.i), x::P, y::P) for v in vars for i in 1..n], concat([x, y], vars))) diff --git a/src/algebra/defintef.spad.pamphlet b/src/algebra/defintef.spad.pamphlet index 9426ab08..e4fb77e3 100644 --- a/src/algebra/defintef.spad.pamphlet +++ b/src/algebra/defintef.spad.pamphlet @@ -108,9 +108,9 @@ ElementaryFunctionDefiniteIntegration(R, F): Exports == Implementation where (z := isExpt p) case "failed" => "failed" k := z.var -- functions with no real zeros - is?(k, "exp"::SE) or is?(k, "acot"::SE) or is?(k, "cosh"::SE) => false + is?(k, 'exp) or is?(k, 'acot) or is?(k, 'cosh) => false -- special case for log - is?(k, "log"::SE) => + is?(k, 'log) => (w := moreThan(b, 1)) case "failed" or not(w::B) => w moreThan(-a, -1) "failed" @@ -144,21 +144,21 @@ ElementaryFunctionDefiniteIntegration(R, F): Exports == Implementation where nullary? operator kk => false f := first argument kk -- functions which are defined over all the reals: - is?(kk, "exp"::SE) or is?(kk, "sin"::SE) or is?(kk, "cos"::SE) - or is?(kk, "sinh"::SE) or is?(kk, "cosh"::SE) or is?(kk, "tanh"::SE) - or is?(kk, "sech"::SE) or is?(kk, "atan"::SE) or is?(kk, "acot"::SE) - or is?(kk, "asinh"::SE) => checkForPole(f, x, k, a, b) + is?(kk, 'exp) or is?(kk, 'sin) or is?(kk, 'cos) + or is?(kk, 'sinh) or is?(kk, 'cosh) or is?(kk, 'tanh) + or is?(kk, 'sech) or is?(kk, 'atan) or is?(kk, 'acot) + or is?(kk, 'asinh) => checkForPole(f, x, k, a, b) -- functions which are defined on (-1,+1): - is?(kk, "asin"::SE) or is?(kk, "acos"::SE) or is?(kk, "atanh"::SE) => + is?(kk, 'asin) or is?(kk, 'acos) or is?(kk, 'atanh) => ((w := checkForPole(f, x, k, a, b)) case "failed") or (w::B) => w ((w := posit(f - 1, x, k, a, b)) case "failed") or (w::B) => w negat(f + 1, x, k, a, b) -- functions which are defined on (+1, +infty): - is?(kk, "acosh"::SE) => + is?(kk, 'acosh) => ((w := checkForPole(f, x, k, a, b)) case "failed") or (w::B) => w negat(f - 1, x, k, a, b) -- functions which are defined on (0, +infty): - is?(kk, "log"::SE) => + is?(kk, 'log) => ((w := checkForPole(f, x, k, a, b)) case "failed") or (w::B) => w negat(f, x, k, a, b) "failed" diff --git a/src/algebra/defintrf.spad.pamphlet b/src/algebra/defintrf.spad.pamphlet index dcd67691..421f1aa4 100644 --- a/src/algebra/defintrf.spad.pamphlet +++ b/src/algebra/defintrf.spad.pamphlet @@ -97,7 +97,7 @@ DefiniteIntegrationTools(R, F): Exports == Implementation where error "integrate: last argument must be 'noPole'" computeInt(k, f, a, b, eval?) == - is?(f, "integral"::SE) => "failed" + is?(f, 'integral) => "failed" if not eval? then f := mkLogPos f ((ib := findLimit(f, k, b, "left", eval?)) case "failed") or ((ia := findLimit(f, k, a, "right", eval?)) case "failed") => "failed" @@ -116,7 +116,7 @@ DefiniteIntegrationTools(R, F): Exports == Implementation where mkLogPos f == lk := empty()$List(K) lv := empty()$List(F) - for k in kernels f | is?(k, "log"::SE) repeat + for k in kernels f | is?(k, 'log) repeat if (v := mkKerPos k) case F then lk := concat(k, lk) lv := concat(v::F, lv) diff --git a/src/algebra/divisor.spad.pamphlet b/src/algebra/divisor.spad.pamphlet index c0fbbc1f..c256a122 100644 --- a/src/algebra/divisor.spad.pamphlet +++ b/src/algebra/divisor.spad.pamphlet @@ -658,7 +658,7 @@ HyperellipticFiniteDivisor(F, UP, UPUP, R): Exports == Implementation where hyper:UP := uhyper::UP gen:Z := ((degree(hyper)::Z - 1) exquo 2)::Z -- genus of the curve - dvd:O := "div"::Symbol::O + dvd:O := 'div::O zer:O := 0::Z::O makeDivisor : (UP, UP, R) -> % diff --git a/src/algebra/efstruc.spad.pamphlet b/src/algebra/efstruc.spad.pamphlet index fe6d0bb3..320842e5 100644 --- a/src/algebra/efstruc.spad.pamphlet +++ b/src/algebra/efstruc.spad.pamphlet @@ -127,8 +127,6 @@ ElementaryFunctionStructurePackage(R,F): Exports == Implementation where SMP ==> SparseMultivariatePolynomial(R, K) REC ==> Record(func:F, kers: List K, vals:List F) U ==> Union(vec:Vector Q, func:F, fail: Boolean) - POWER ==> "%power"::SY - NTHR ==> "nthRoot"::SY Exports ==> with normalize: F -> F @@ -159,6 +157,8 @@ ElementaryFunctionStructurePackage(R,F): Exports == Implementation where ++ tanQ(q,a) is a local function with a conditional implementation. Implementation ==> add + macro POWER == '%power + macro NTHR == 'nthRoot import TangentExpansions F import IntegrationTools(R, F) import IntegerLinearDependence F @@ -242,35 +242,35 @@ ElementaryFunctionStructurePackage(R,F): Exports == Implementation where [f, empty(), empty()] deprel(ker, k, x) == - is?(k, "log"::SY) or is?(k, "exp"::SY) => + is?(k, 'log) or is?(k, 'exp) => qdeprel([differentiate(g, x) for g in toY ker], differentiate(ktoY k, x)) - is?(k, "atan"::SY) or is?(k, "tan"::SY) => + is?(k, 'atan) or is?(k, 'tan) => qdeprel([differentiate(g, x) for g in toU ker], differentiate(ktoU k, x)) is?(k, NTHR) => rootDep(ker, k) - comb? and is?(k, "factorial"::SY) => - factdeprel([x for x in ker | is?(x,"factorial"::SY) and x~=k],k) + comb? and is?(k, 'factorial) => + factdeprel([x for x in ker | is?(x,'factorial) and x~=k],k) [true] ktoY k == - is?(k, "log"::SY) => k::F - is?(k, "exp"::SY) => first argument k + is?(k, 'log) => k::F + is?(k, 'exp) => first argument k 0 ktoZ k == - is?(k, "log"::SY) => first argument k - is?(k, "exp"::SY) => k::F + is?(k, 'log) => first argument k + is?(k, 'exp) => k::F 0 ktoU k == - is?(k, "atan"::SY) => k::F - is?(k, "tan"::SY) => first argument k + is?(k, 'atan) => k::F + is?(k, 'tan) => first argument k 0 ktoV k == - is?(k, "tan"::SY) => k::F - is?(k, "atan"::SY) => first argument k + is?(k, 'tan) => k::F + is?(k, 'atan) => first argument k 0 smpElem(p, l) == @@ -284,41 +284,41 @@ ElementaryFunctionStructurePackage(R,F): Exports == Implementation where empty?(args :List F := [realElem(a, l) for a in argument k]) => kf z := first args is?(k, POWER) => (zero? z => 0; exp(last(args) * log z)) - is?(k, "cot"::SY) => inv tan z - is?(k, "acot"::SY) => atan inv z - is?(k, "asin"::SY) => atan(z / sqrt(1 - z**2)) - is?(k, "acos"::SY) => atan(sqrt(1 - z**2) / z) - is?(k, "asec"::SY) => atan sqrt(1 - z**2) - is?(k, "acsc"::SY) => atan inv sqrt(1 - z**2) - is?(k, "asinh"::SY) => log(sqrt(1 + z**2) + z) - is?(k, "acosh"::SY) => log(sqrt(z**2 - 1) + z) - is?(k, "atanh"::SY) => log((z + 1) / (1 - z)) / (2::F) - is?(k, "acoth"::SY) => log((z + 1) / (z - 1)) / (2::F) - is?(k, "asech"::SY) => log((inv z) + sqrt(inv(z**2) - 1)) - is?(k, "acsch"::SY) => log((inv z) + sqrt(1 + inv(z**2))) - is?(k, "%paren"::SY) or is?(k, "%box"::SY) => + is?(k, 'cot) => inv tan z + is?(k, 'acot) => atan inv z + is?(k, 'asin) => atan(z / sqrt(1 - z**2)) + is?(k, 'acos) => atan(sqrt(1 - z**2) / z) + is?(k, 'asec) => atan sqrt(1 - z**2) + is?(k, 'acsc) => atan inv sqrt(1 - z**2) + is?(k, 'asinh) => log(sqrt(1 + z**2) + z) + is?(k, 'acosh) => log(sqrt(z**2 - 1) + z) + is?(k, 'atanh) => log((z + 1) / (1 - z)) / (2::F) + is?(k, 'acoth) => log((z + 1) / (z - 1)) / (2::F) + is?(k, 'asech) => log((inv z) + sqrt(inv(z**2) - 1)) + is?(k, 'acsch) => log((inv z) + sqrt(1 + inv(z**2))) + is?(k, '%paren) or is?(k, '%box) => empty? rest args => z kf if has?(op := operator k, 'htrig) then iez := inv(ez := exp z) - is?(k, "sinh"::SY) => (ez - iez) / (2::F) - is?(k, "cosh"::SY) => (ez + iez) / (2::F) - is?(k, "tanh"::SY) => (ez - iez) / (ez + iez) - is?(k, "coth"::SY) => (ez + iez) / (ez - iez) - is?(k, "sech"::SY) => 2 * inv(ez + iez) - is?(k, "csch"::SY) => 2 * inv(ez - iez) + is?(k, 'sinh) => (ez - iez) / (2::F) + is?(k, 'cosh) => (ez + iez) / (2::F) + is?(k, 'tanh) => (ez - iez) / (ez + iez) + is?(k, 'coth) => (ez + iez) / (ez - iez) + is?(k, 'sech) => 2 * inv(ez + iez) + is?(k, 'csch) => 2 * inv(ez - iez) if has?(op, 'trig) then tz2 := tan(z / (2::F)) - is?(k, "sin"::SY) => 2 * tz2 / (1 + tz2**2) - is?(k, "cos"::SY) => (1 - tz2**2) / (1 + tz2**2) - is?(k, "sec"::SY) => (1 + tz2**2) / (1 - tz2**2) - is?(k, "csc"::SY) => (1 + tz2**2) / (2 * tz2) + is?(k, 'sin) => 2 * tz2 / (1 + tz2**2) + is?(k, 'cos) => (1 - tz2**2) / (1 + tz2**2) + is?(k, 'sec) => (1 + tz2**2) / (1 - tz2**2) + is?(k, 'csc) => (1 + tz2**2) / (2 * tz2) op args --The next 5 functions are used by normalize, once a relation is found depeval(f, lk, k, v) == - is?(k, "log"::SY) => logeval(f, lk, k, v) - is?(k, "exp"::SY) => expeval(f, lk, k, v) - is?(k, "tan"::SY) => taneval(f, lk, k, v) - is?(k, "atan"::SY) => ataneval(f, lk, k, v) + is?(k, 'log) => logeval(f, lk, k, v) + is?(k, 'exp) => expeval(f, lk, k, v) + is?(k, 'tan) => taneval(f, lk, k, v) + is?(k, 'atan) => ataneval(f, lk, k, v) is?(k, NTHR) => rooteval(f, lk, k, v(minIndex v)) [f, empty(), empty()] @@ -358,7 +358,7 @@ ElementaryFunctionStructurePackage(R,F): Exports == Implementation where u := first argument k fns := toU lk c := u - +/[qelt(v, i) * x for i in minIndex v .. maxIndex v for x in fns] - (rec := goodCoef(v, lk, "tan"::SY)) case "failed" => + (rec := goodCoef(v, lk, 'tan)) case "failed" => tannosimp(f, lk, k, v, fns, c) v0 := retract(inv qelt(v, rec.index))@Z lv := [qelt(v, i) for i in minIndex v .. maxIndex v | @@ -369,7 +369,7 @@ ElementaryFunctionStructurePackage(R,F): Exports == Implementation where [eval(f, [rec.ker], [g]), [rec.ker], [g]] tannosimp(f, lk, k, v, fns, c) == - every?(is?(#1, "tan"::SY), lk) => + every?(is?(#1, 'tan), lk) => dd := (d := (cd := splitDenominator v).den)::F newt := [tan(u / dd) for u in fns]$List(F) newtan := [tanNa(t, d) for t in newt]$List(F) @@ -383,7 +383,7 @@ ElementaryFunctionStructurePackage(R,F): Exports == Implementation where [eval(f, [k], [h]), [k], [h]] expnosimp(f, lk, k, v, fns, g) == - every?(is?(#1, "exp"::SY), lk) => + every?(is?(#1, 'exp), lk) => dd := (d := (cd := splitDenominator v).den)::F newe := [exp(y / dd) for y in fns]$List(F) newexp := [e ** d for e in newe]$List(F) @@ -463,7 +463,7 @@ ElementaryFunctionStructurePackage(R,F): Exports == Implementation where y := first argument k fns := toY lk g := y - +/[qelt(v, i) * z for i in minIndex v .. maxIndex v for z in fns] - (rec := goodCoef(v, lk, "exp"::SY)) case "failed" => + (rec := goodCoef(v, lk, 'exp)) case "failed" => expnosimp(f, lk, k, v, fns, exp g) v0 := retract(inv qelt(v, rec.index))@Z lv := [qelt(v, i) for i in minIndex v .. maxIndex v | @@ -520,7 +520,6 @@ InnerTrigonometricManipulations(R,F,FG): Exports == Implementation where KG ==> Kernel FG PG ==> SparseMultivariatePolynomial(GR, KG) UP ==> SparseUnivariatePolynomial PG - NTHR ==> "nthRoot"::SY Exports ==> with GF2FG : GF -> FG @@ -543,6 +542,7 @@ InnerTrigonometricManipulations(R,F,FG): Exports == Implementation where ++ \spad{exp(2*u)} otherwise. Implementation ==> add + macro NTHR == 'nthRoot ker2explogs: (KG, List KG, List SY) -> FG smp2explogs: (PG, List KG, List SY) -> FG supexp : (UP, GF, GF, Z) -> GF @@ -744,12 +744,12 @@ TrigonometricManipulations(R, F): Exports == Implementation where -- "failed" otherwise kcomplex k == op := operator k - is?(k, "nthRoot"::SY) => + is?(k, 'nthRoot) => arg := argument k even?(retract(n := second arg)@Z) and ((u := sign(first arg)) case Z) and (u::Z < 0) => op(s1, n / 2::F) * op(- first arg, n) "failed" - is?(k, "log"::SY) and ((u := sign(a := first argument k)) case Z) + is?(k, 'log) and ((u := sign(a := first argument k)) case Z) and (u::Z < 0) => op(- a) + ipi "failed" @@ -796,7 +796,7 @@ TrigonometricManipulations(R, F): Exports == Implementation where localexplogs(f, g, lx) == trigs2explogs(F2FG g, [K2KG k for k in tower f - | is?(k, "tan"::SY) or is?(k, "cot"::SY)], lx) + | is?(k, 'tan) or is?(k, 'cot)], lx) trigs f == real? f => f @@ -877,7 +877,7 @@ ComplexTrigonometricManipulations(R, F): Exports == Implementation where localexplogs(f, g, lx) == trigs2explogs(g, [k for k in tower f - | is?(k, "tan"::SY) or is?(k, "cot"::SY)], lx) + | is?(k, 'tan) or is?(k, 'cot)], lx) complexElementary f == any?(has?(#1, 'rtrig), diff --git a/src/algebra/exprode.spad.pamphlet b/src/algebra/exprode.spad.pamphlet index 2693eabf..8a9bf6d4 100644 --- a/src/algebra/exprode.spad.pamphlet +++ b/src/algebra/exprode.spad.pamphlet @@ -155,7 +155,7 @@ ExpressionSpaceODESolver(R, F): Exports == Implementation where checkSystem(diffeq, yx, lv) == for k in kernels diffeq repeat - is?(k, "%diff"::SY) => + is?(k, '%diff) => return div2exquo subst(diffRhsK(k, diffeq), yx, lv) 0 diff --git a/src/algebra/fspace.spad.pamphlet b/src/algebra/fspace.spad.pamphlet index 91e565d3..6196c550 100644 --- a/src/algebra/fspace.spad.pamphlet +++ b/src/algebra/fspace.spad.pamphlet @@ -24,9 +24,6 @@ ExpressionSpace(): Category == Defn where K ==> Kernel % OP ==> BasicOperator SY ==> Symbol - PAREN ==> "%paren"::SY - BOX ==> "%box"::SY - DUMMYVAR ==> "%dummyVar" Defn ==> Join(OrderedSet, RetractableTo K, InnerEvalable(K, %), Evalable %) with @@ -168,6 +165,9 @@ ExpressionSpace(): Category == Defn where -- subst:(%, List K, List %) -> % -- eval:(%, List Symbol, List(List % -> %)) -> % + macro PAREN == '%paren + macro BOX == '%box + macro DUMMYVAR == '%dummyVar allKernels: % -> Set K listk : % -> List K allk : List % -> Set K @@ -287,7 +287,7 @@ ExpressionSpace(): Category == Defn where distribute(x, y) == ky := retract y unwrap([k for k in listk x | - is?(k, "%paren"::SY) and member?(ky, listk(k::%))], x) + is?(k, '%paren) and member?(ky, listk(k::%))], x) -- in case of conflicting substitutions e.g. [x = a, x = b], -- the first one prevails. @@ -556,8 +556,8 @@ FunctionSpace(R:OrderedSet): Category == Definition where equaldiff : (K,K)->Boolean debugA: (List % ,List %,Boolean) -> Boolean - opdiff := operator("%diff"::SY)$CommonOperators() - opquote := operator("applyQuote"::SY)$CommonOperators + opdiff := operator('%diff)$CommonOperators() + opquote := operator('applyQuote)$CommonOperators ground? x == retractIfCan(x)@Union(R,"failed") case R ground x == retract x @@ -572,8 +572,8 @@ FunctionSpace(R:OrderedSet): Category == Definition where subs(fn, k) == kernel(operator k,[fn x for x in argument k]$List(%)) operator op == - is?(op, "%diff"::SY) => opdiff - is?(op, "%quote"::SY) => opquote + is?(op, '%diff) => opdiff + is?(op, '%quote) => opquote error "Unknown operator" if R has ConvertibleTo InputForm then diff --git a/src/algebra/intaf.spad.pamphlet b/src/algebra/intaf.spad.pamphlet index 83ba77fb..d226fa79 100644 --- a/src/algebra/intaf.spad.pamphlet +++ b/src/algebra/intaf.spad.pamphlet @@ -600,8 +600,8 @@ PureAlgebraicIntegration(R, F, L): Exports == Implementation where palgint(f, x, y) == (v := linearInXIfCan(x, y)) case "failed" => (u := quadIfCan(x, y)) case "failed" => - is?(y, "nthRoot"::SY) => prootintegrate(f, x, y) - is?(y, "rootOf"::SY) => palgintegrate(f, x, y) + is?(y, 'nthRoot) => prootintegrate(f, x, y) + is?(y, 'rootOf) => palgintegrate(f, x, y) FAIL palgint0(f, x, y, u.coef, u.poly) palgint0(f, x, y, dumk, v.xsub, v.dxsub) @@ -609,8 +609,8 @@ PureAlgebraicIntegration(R, F, L): Exports == Implementation where palgextint(f, x, y, g) == (v := linearInXIfCan(x, y)) case "failed" => (u := quadIfCan(x, y)) case "failed" => - is?(y, "nthRoot"::SY) => prootextint(f, x, y, g) - is?(y, "rootOf"::SY) => palgext(f, x, y, g) + is?(y, 'nthRoot) => prootextint(f, x, y, g) + is?(y, 'rootOf) => palgext(f, x, y, g) FAIL palgextint0(f, x, y, g, u.coef, u.poly) palgextint0(f, x, y, g, dumk, v.xsub, v.dxsub) @@ -618,8 +618,8 @@ PureAlgebraicIntegration(R, F, L): Exports == Implementation where palglimint(f, x, y, lu) == (v := linearInXIfCan(x, y)) case "failed" => (u := quadIfCan(x, y)) case "failed" => - is?(y, "nthRoot"::SY) => prootlimint(f, x, y, lu) - is?(y, "rootOf"::SY) => palglim(f, x, y, lu) + is?(y, 'nthRoot) => prootlimint(f, x, y, lu) + is?(y, 'rootOf) => palglim(f, x, y, lu) FAIL palglimint0(f, x, y, lu, u.coef, u.poly) palglimint0(f, x, y, lu, dumk, v.xsub, v.dxsub) @@ -627,7 +627,7 @@ PureAlgebraicIntegration(R, F, L): Exports == Implementation where palgRDE(nfp, f, g, x, y, rde) == (v := linearInXIfCan(x, y)) case "failed" => (u := quadIfCan(x, y)) case "failed" => - is?(y, "nthRoot"::SY) => prootRDE(nfp, f, g, x, y, rde) + is?(y, 'nthRoot) => prootRDE(nfp, f, g, x, y, rde) palgRDE1(nfp, g, x, y) palgRDE0(f, g, x, y, rde, u.coef, u.poly) palgRDE0(f, g, x, y, rde, dumk, v.xsub, v.dxsub) @@ -722,8 +722,8 @@ AlgebraicIntegration(R, F): Exports == Implementation where (multivariate(cf, t) * k::F) algint(f, t, y, derivation) == - is?(y, "nthRoot"::SY) => rootintegrate(f, t, y, derivation) - is?(y, "rootOf"::SY) => algintegrate(f, t, y, derivation) + is?(y, 'nthRoot) => rootintegrate(f, t, y, derivation) + is?(y, 'rootOf) => algintegrate(f, t, y, derivation) FAIL @ diff --git a/src/algebra/intef.spad.pamphlet b/src/algebra/intef.spad.pamphlet index 7e96e6f2..ab6821ba 100644 --- a/src/algebra/intef.spad.pamphlet +++ b/src/algebra/intef.spad.pamphlet @@ -99,7 +99,7 @@ ElementaryIntegration(R, F): Exports == Implementation where tryChangeVar: (F, K, SE) -> Union(IR, "failed") droponex : (F, F, K, F) -> Union(F, "failed") - prim?(k, x) == is?(k, "log"::SE) or has?(operator k, 'prim) + prim?(k, x) == is?(k, 'log) or has?(operator k, 'prim) tanint(f, x, k) == eta' := differentiate(eta := first argument k, x) @@ -147,7 +147,7 @@ ElementaryIntegration(R, F): Exports == Implementation where alglfint(f, k, l, x) == xf := x::F symbolIfCan(kx := ksec(k,l,x)) case SE => addx(palgint(f, kx, k), xf) - is?(kx, "exp"::SE) => addx(algexpint(f, kx, k, x), xf) + is?(kx, 'exp) => addx(algexpint(f, kx, k, x), xf) prim?(kx, x) => addx(algprimint(f, kx, k, x), xf) has?(operator kx, ALGOP) => rec := primitiveElement(kx::F, k::F) @@ -167,7 +167,7 @@ ElementaryIntegration(R, F): Exports == Implementation where ky := retract(y)@K r := u::Record(ratpart:F, coeff:F) [eval(r.ratpart,ky,rec.primelt), eval(r.coeff,ky,rec.primelt)] - is?(kx, "exp"::SE) or is?(kx, "log"::SE) => FAIL + is?(kx, 'exp) or is?(kx, 'log) => FAIL unkextint(f, x, g) alglflimint(f, k, l, x, lu) == @@ -183,7 +183,7 @@ ElementaryIntegration(R, F): Exports == Implementation where [eval(r.mainpart, ky, rec.primelt), [[eval(rc.coeff, ky, rec.primelt), eval(rc.logand,ky, rec.primelt)] for rc in r.limitedlogs]] - is?(kx, "exp"::SE) or is?(kx, "log"::SE) => FAIL + is?(kx, 'exp) or is?(kx, 'log) => FAIL unklimint(f, x, lu) if R has Join(ConvertibleTo Pattern Integer, PatternMatchable Integer) @@ -199,8 +199,8 @@ ElementaryIntegration(R, F): Exports == Implementation where empty?(l := varselect(kernels f, x)) => (xf * f)::IR symbolIfCan(k := kmax l) case SE => map(multivariate(#1, k), integrate univariate(f, k)) - is?(k, "tan"::SE) => addx(tanint(f, x, k), xf) - is?(k, "exp"::SE) => addx(expint(f, x, k), xf) + is?(k, 'tan) => addx(tanint(f, x, k), xf) + is?(k, 'exp) => addx(expint(f, x, k), xf) prim?(k, x) => addx(primint(f, x, k), xf) has?(operator k, ALGOP) => alglfint(f, k, l, x) unknownint(f, x) @@ -233,7 +233,7 @@ ElementaryIntegration(R, F): Exports == Implementation where case SE => map(multivariate(#1, k), extendedint(univariate(f, k), univariate(g, k))) - is?(k, "exp"::SE) => expextint(f, x, k, g) + is?(k, 'exp) => expextint(f, x, k, g) prim?(k, x) => primextint(f, x, k, g) has?(operator k, ALGOP) => alglfextint(f, k, l, x, g) unkextint(f, x, g) @@ -243,7 +243,7 @@ ElementaryIntegration(R, F): Exports == Implementation where symbolIfCan(k := kmax(l)) case SE => map(multivariate(#1, k), limitedint(univariate(f, k), [univariate(u, k) for u in lu])) - is?(k, "exp"::SE) => explimint(f, x, k, lu) + is?(k, 'exp) => explimint(f, x, k, lu) prim?(k, x) => primlimint(f, x, k, lu) has?(operator k, ALGOP) => alglflimint(f, k, l, x, lu) unklimint(f, x, lu) @@ -254,7 +254,7 @@ ElementaryIntegration(R, F): Exports == Implementation where primextint(f, x, k, g) == lk := varselect([a for a in tower f - | k ~= a and is?(a, "log"::SE)], x) + | k ~= a and is?(a, 'log)], x) (u1 := primextendedint(univariate(f, k), differentiate(#1, differentiate(#1, x), differentiate(k::F, x)::UP), lfextlimint(#1, x, k, lk), univariate(g, k))) case "failed" @@ -278,7 +278,7 @@ ElementaryIntegration(R, F): Exports == Implementation where primint(f, x, k) == lk := varselect([a for a in tower f - | k ~= a and is?(a, "log"::SE)], x) + | k ~= a and is?(a, 'log)], x) r1 := primintegrate(univariate(f, k), differentiate(#1, differentiate(#1, x), differentiate(k::F, x)::UP), lfextlimint(#1, x, k, lk)) @@ -289,7 +289,7 @@ ElementaryIntegration(R, F): Exports == Implementation where case "failed") => u1 twr := tower f empty?(lg := [kk for kk in lk | not member?(kk, twr)]) => "failed" - is?(k, "log"::SE) => + is?(k, 'log) => (u2 := lflimitedint(f, x, [first argument u for u in union(lg, [k])])) case "failed" => "failed" @@ -313,7 +313,7 @@ ElementaryIntegration(R, F): Exports == Implementation where primlimint(f, x, k, lu) == lk := varselect([a for a in tower f - | k ~= a and is?(a, "log"::SE)], x) + | k ~= a and is?(a, 'log)], x) (u1 := primlimitedint(univariate(f, k), differentiate(#1, differentiate(#1, x), differentiate(k::F, x)::UP), lfextlimint(#1, x, k, lk), [univariate(u, k) for u in lu])) diff --git a/src/algebra/integrat.spad.pamphlet b/src/algebra/integrat.spad.pamphlet index 9fce6205..fb83e7f3 100644 --- a/src/algebra/integrat.spad.pamphlet +++ b/src/algebra/integrat.spad.pamphlet @@ -76,7 +76,7 @@ FunctionSpaceComplexIntegration(R, F): Exports == Implementation where [k for k in tower(g := realElementary(f, x)) | member?(x, variables(k::F))]$List(Kernel F))$List(Kernel F) => h := trigs2explogs(F2FG g, [K2KG k for k in tower f - | is?(k, "tan"::SE) or is?(k, "cot"::SE)], [x]) + | is?(k, 'tan) or is?(k, 'cot)], [x]) real?(g := FG2F h) => internalIntegrate0(rootSimp(rischNormalize(g, x).func), x) real?(g := FG2F(h := rootSimp(rischNormalize(h, x).func))) => @@ -149,7 +149,7 @@ FunctionSpaceIntegration(R, F): Exports == Implementation where tan2temp k == kernel(optemp, argument k, height k)$K trans? f == - any?(is?(#1,"log"::SE) or is?(#1,"exp"::SE) or is?(#1,"atan"::SE), + any?(is?(#1,'log) or is?(#1,'exp) or is?(#1,'atan), operators f)$List(BasicOperator) mkPrimh(f, x, h, comp) == @@ -198,19 +198,19 @@ FunctionSpaceIntegration(R, F): Exports == Implementation where R has complex or not real? f => complexIntegrate(f, x) f := distribute(f, x::F) tf := [k for k in tower f | member?(x, variables(k::F)@List(SE))]$List(K) - ltf := select(is?(operator #1, "tan"::SE), tf) + ltf := select(is?(operator #1, 'tan), tf) ht := any?(has?(operator #1, 'htrig), tf) rec := rischNormalize(realElementary(f, x), x) g := rootSimp(rec.func) tg := [k for k in tower g | member?(x, variables(k::F))]$List(K) - ltg := select(is?(operator #1, "tan"::SE), tg) + ltg := select(is?(operator #1, 'tan), tg) rtg := any?(has?(operator #1, 'rtrig), tg) el := any?(has?(operator #1, 'elem), tg) i:IR if (comp := goComplex?(rtg, tg, ltg)) then i := map(FG2F, lfintegrate(trigs2explogs(F2FG g, - [K2KG k for k in tf | is?(k, "tan"::SE) or - is?(k, "cot"::SE)], [x]), x)) + [K2KG k for k in tf | is?(k, 'tan) or + is?(k, 'cot)], [x]), x)) else i := lfintegrate(g, x) ltg := setDifference(ltg, ltf) -- tan's added by normalization (u := rinteg(i, f, x, el and ht, comp)) case F => diff --git a/src/algebra/intpm.spad.pamphlet b/src/algebra/intpm.spad.pamphlet index 3fb0f60a..aca1a275 100644 --- a/src/algebra/intpm.spad.pamphlet +++ b/src/algebra/intpm.spad.pamphlet @@ -138,10 +138,10 @@ PatternMatchIntegration(R, F): Exports == Implementation where goodlilog? : (K, P) -> Boolean gooddilog? : (K, P, P) -> Boolean - goodlilog?(k, p) == is?(k, "log"::SY) and one? minimumDegree(p, k) + goodlilog?(k, p) == is?(k, 'log) and one? minimumDegree(p, k) gooddilog?(k, p, q) == - is?(k, "log"::SY) and one? degree(p, k) and zero? degree(q, k) + is?(k, 'log) and one? degree(p, k) and zero? degree(q, k) -- matches the integral to a result of the form d * erf(u) or d * ei(u) -- returns [case, u, d] diff --git a/src/algebra/laplace.spad.pamphlet b/src/algebra/laplace.spad.pamphlet index 9652f91d..28e2a1dd 100644 --- a/src/algebra/laplace.spad.pamphlet +++ b/src/algebra/laplace.spad.pamphlet @@ -116,7 +116,7 @@ LaplaceTransform(R, F): Exports == Implementation where -- returns [a, c, b] iff f = a * exp(c * t + b) -- and b and c do not involve t aexp(f, t) == - is?(f, "exp"::SE) => + is?(f, 'exp) => (v := isLinear(first argument(retract(f)@K),t)) case "failed" => "failed" [1, v.nconst, v.const] @@ -162,7 +162,7 @@ LaplaceTransform(R, F): Exports == Implementation where lapkernel(f, t, tt, ss) == (k := retractIfCan(f)@Union(K, "failed")) case "failed" => "failed" empty?(arg := argument(k::K)) => "failed" - is?(op := operator k, "%diff"::SE) => + is?(op := operator k, '%diff) => not( #arg = 3) => "failed" not(is?(arg.3, t)) => "failed" fint := eval(arg.1, arg.2, tt) @@ -170,11 +170,11 @@ LaplaceTransform(R, F): Exports == Implementation where ss * locallaplace(fint, t, tt, s, ss) - eval(fint, tt = 0) not (empty?(rest arg)) => "failed" member?(t, variables(a := first(arg) / tt)) => "failed" - is?(op := operator k, "Si"::SE) => atan(a / ss) / ss - is?(op, "Ci"::SE) => log((ss**2 + a**2) / a**2) / (2 * ss) - is?(op, "Ei"::SE) => log((ss + a) / a) / ss + is?(op := operator k, 'Si) => atan(a / ss) / ss + is?(op, 'Ci) => log((ss**2 + a**2) / a**2) / (2 * ss) + is?(op, 'Ei) => log((ss + a) / a) / ss if F has SpecialFunctionCategory then - is?(op, "log"::SE) => (digamma(1) - log(a) - log(ss)) / ss + is?(op, 'log) => (digamma(1) - log(a) - log(ss)) / ss "failed" -- Below we try to apply one of the texbook rules for computing diff --git a/src/algebra/limitps.spad.pamphlet b/src/algebra/limitps.spad.pamphlet index 2ae98c68..b2f66076 100644 --- a/src/algebra/limitps.spad.pamphlet +++ b/src/algebra/limitps.spad.pamphlet @@ -701,8 +701,8 @@ ElementaryFunctionSign(R,F): Exports == Implementation where kerSign k == has?(op := operator k, NEGAT) => -1 - has?(op, POSIT) or is?(op, "pi"::SY) or is?(op,"exp"::SY) or - is?(op,"cosh"::SY) or is?(op,"sech"::SY) => 1 + has?(op, POSIT) or is?(op, 'pi) or is?(op,'exp) or + is?(op,'cosh) or is?(op,'sech) => 1 empty?(arg := argument k) => "failed" (s := sign first arg) case "failed" => is?(op,"nthRoot" :: SY) => diff --git a/src/algebra/liouv.spad.pamphlet b/src/algebra/liouv.spad.pamphlet index 7f730bfd..587f8b23 100644 --- a/src/algebra/liouv.spad.pamphlet +++ b/src/algebra/liouv.spad.pamphlet @@ -104,7 +104,7 @@ LiouvillianFunction(R, F): Exports == Implementation where kernel(opint, l) ddint l == - int(integrand(l)::O * hconcat("d"::SE::O, third(l)::O), + int(integrand(l)::O * hconcat('d::O, third(l)::O), third(rest l)::O, third(rest rest l)::O) eqint(k1,k2) == @@ -178,7 +178,7 @@ LiouvillianFunction(R, F): Exports == Implementation where pint : List INP -> INP - pint l == convert concat(convert("integral"::SE)@INP, l) + pint l == convert concat(convert('integral)@INP, l) inint l == r2:= convert([convert("::"::SE)@INP,convert(third l)@INP,convert("Symbol"::SE)@INP]@List INP)@INP pint [convert(integrand l)@INP, r2] diff --git a/src/algebra/odeef.spad.pamphlet b/src/algebra/odeef.spad.pamphlet index ed29a09c..8f71bbc0 100644 --- a/src/algebra/odeef.spad.pamphlet +++ b/src/algebra/odeef.spad.pamphlet @@ -360,7 +360,6 @@ ElementaryFunctionODESolver(R, F): Exports == Implementation where SYS ==> Record(mat:M, vec: V) U ==> Union(REC, F, "failed") UU ==> Union(F, "failed") - OPDIFF ==> "%diff"::SY Exports ==> with solve: (M, V, SY) -> Union(VEC, "failed") @@ -426,6 +425,7 @@ ElementaryFunctionODESolver(R, F): Exports == Implementation where ++ \spad{dy/dx = f(x,y)}; Implementation ==> add + macro OPDIFF == '%diff import ODEIntegration(R, F) import IntegrationTools(R, F) import NonLinearFirstOrderODESolver(R, F) diff --git a/src/algebra/oderf.spad.pamphlet b/src/algebra/oderf.spad.pamphlet index 96e1f9f1..08ba4213 100644 --- a/src/algebra/oderf.spad.pamphlet +++ b/src/algebra/oderf.spad.pamphlet @@ -751,10 +751,10 @@ ODEIntegration(R, F): Exports == Implementation where -- checks if a non-sum expr is of the form c * log(g) for a rational number c isQlog f == - is?(f, "log"::SY) => [1, first argument(retract(f)@K)] + is?(f, 'log) => [1, first argument(retract(f)@K)] (v := isTimes f) case List(F) and (#(l := v::List(F)) <= 3) => l := reverse_! sort_! l - is?(first l, "log"::SY) and ((u := isQ rest l) case Q) => + is?(first l, 'log) and ((u := isQ rest l) case Q) => [u::Q, first argument(retract(first(l))@K)] "failed" "failed" diff --git a/src/algebra/rdeef.spad.pamphlet b/src/algebra/rdeef.spad.pamphlet index 787393b1..0f5c1ffb 100644 --- a/src/algebra/rdeef.spad.pamphlet +++ b/src/algebra/rdeef.spad.pamphlet @@ -76,7 +76,7 @@ IntegrationTools(R:OrderedSet, F:FunctionSpace R): Exp == Impl where better?(x, y) == height(y) ~= height(x) => height(y) < height(x) has?(operator y, ALGOP) or - (is?(y, "exp"::SE) and not is?(x, "exp"::SE) + (is?(y,'exp) and not is?(x, 'exp) and not has?(operator x, ALGOP)) if R has IntegralDomain then @@ -108,7 +108,7 @@ IntegrationTools(R:OrderedSet, F:FunctionSpace R): Exp == Impl where cont(unitNormal(leadingCoefficient q).unit * content q, rest l) linearLog?(k, f, x) == - is?(k, "log"::SE) and + is?(k, 'log) and ((u := retractIfCan(univariate(f,k))@Union(UP,"failed")) case UP) and one?(degree(u::UP)) and not member?(x, variables leadingCoefficient(u::UP)) @@ -226,7 +226,7 @@ ElementaryRischDE(R, F): Exports == Implementation where RF2GP f == (numer(f)::GP exquo denom(f)::GP)::GP logdiff(twr, bad) == - [u for u in twr | is?(u, "log"::SE) and not member?(u, bad)] + [u for u in twr | is?(u, 'log) and not member?(u, bad)] rischDEalg(n, nfp, f, g, k, l, x, limint, extint) == symbolIfCan(kx := ksec(k, l, x)) case SE => @@ -252,7 +252,7 @@ ElementaryRischDE(R, F): Exports == Implementation where freeOf?(y := g / nfp, x) => [y, g, true] vl := varselect(union(kernels nfp, kernels g), x) symbolIfCan(k := kmax vl) case SE => normalise0(n, f, g, x) - is?(k, "log"::SE) or is?(k, "exp"::SE) => + is?(k, 'log) or is?(k, 'exp) => normalise(n, nfp, f, g, x, k, limitedint, extendedint) has?(operator k, ALGOP) => rischDEalg(n, nfp, f, g, k, vl, x, limitedint, extendedint) @@ -294,12 +294,12 @@ ElementaryRischDE(R, F): Exports == Implementation where newg := univariate(p::F * g, k) twr := union(logdiff(tower f, empty()), logdiff(tower g, empty())) ans1 := - is?(k, "log"::SE) => + is?(k, 'log) => rischDElog(twr, newf, newg, x, k, differentiate(#1, differentiate(#1, x), differentiate(k::F, x)::UP), limitedint, extendedint) - is?(k, "exp"::SE) => + is?(k, 'exp) => rischDEexp(twr, newf, newg, x, k, differentiate(#1, differentiate(#1, x), monomial(differentiate(first argument k, x), 1)), @@ -312,7 +312,7 @@ ElementaryRischDE(R, F): Exports == Implementation where disasters := empty()$Data fnum := numer f fden := denom f - for u in varselect(kernels f, x) | is?(u, "log"::SE) repeat + for u in varselect(kernels f, x) | is?(u, 'log) repeat logand := first argument u if zero?(degree univariate(fden, u)) and one?(degree(num := univariate(fnum, u))) then diff --git a/src/algebra/strap/SYMBOL.lsp b/src/algebra/strap/SYMBOL.lsp index c216ea58..6e61215a 100644 --- a/src/algebra/strap/SYMBOL.lsp +++ b/src/algebra/strap/SYMBOL.lsp @@ -113,6 +113,8 @@ (DECLAIM (FTYPE (FUNCTION (|%Shell|) |%Thing|) |SYMBOL;sample;$;35|)) +(PUT '|SYMBOL;sample;$;35| '|SPADreplace| '(XLAM NIL '|aSymbol|)) + (DEFUN |SYMBOL;writeOMSym| (|dev| |x| $) (COND ((|SYMBOL;scripted?;$B;30| |x| $) @@ -752,7 +754,7 @@ (|error| "Cannot convert a symbol to a list if it is not subscripted")) ('T |sy|))) -(DEFUN |SYMBOL;sample;$;35| ($) (|SYMBOL;coerce;S$;8| "aSymbol" $)) +(DEFUN |SYMBOL;sample;$;35| ($) (DECLARE (IGNORE $)) '|aSymbol|) (DEFUN |Symbol| () (PROG () diff --git a/src/algebra/symbol.spad.pamphlet b/src/algebra/symbol.spad.pamphlet index b41a4f0a..6287037b 100644 --- a/src/algebra/symbol.spad.pamphlet +++ b/src/algebra/symbol.spad.pamphlet @@ -314,7 +314,7 @@ Symbol(): Exports == Implementation where error "Cannot convert a symbol to a list if it is not subscripted" sy pretend List(%) - sample() == "aSymbol"::% + sample() == 'aSymbol @ diff --git a/src/algebra/transsolve.spad.pamphlet b/src/algebra/transsolve.spad.pamphlet index d3c23777..f4bb6f6b 100644 --- a/src/algebra/transsolve.spad.pamphlet +++ b/src/algebra/transsolve.spad.pamphlet @@ -283,7 +283,7 @@ TransSolvePackage(R) : Exports == Implementation where while testRootk(var1,y) repeat varlistk1:=tableXkernels(var1,y) for i in varlistk1 repeat - if is?(i, "nthRoot"::S) then + if is?(i, 'nthRoot) then var1:=eliminateKernRoot(var1,first kernels(i::RE)) var1 |