aboutsummaryrefslogtreecommitdiff
path: root/src/algebra
diff options
context:
space:
mode:
Diffstat (limited to 'src/algebra')
-rw-r--r--src/algebra/algfunc.spad.pamphlet6
-rw-r--r--src/algebra/combfunc.spad.pamphlet4
-rw-r--r--src/algebra/constant.spad.pamphlet2
-rw-r--r--src/algebra/efstruc.spad.pamphlet22
-rw-r--r--src/algebra/elemntry.spad.pamphlet2
-rw-r--r--src/algebra/expr.spad.pamphlet10
-rw-r--r--src/algebra/fspace.spad.pamphlet18
-rw-r--r--src/algebra/intef.spad.pamphlet6
-rw-r--r--src/algebra/integrat.spad.pamphlet12
-rw-r--r--src/algebra/kl.spad.pamphlet26
-rw-r--r--src/algebra/laplace.spad.pamphlet4
-rw-r--r--src/algebra/limitps.spad.pamphlet8
-rw-r--r--src/algebra/liouv.spad.pamphlet2
-rw-r--r--src/algebra/manip.spad.pamphlet8
-rw-r--r--src/algebra/odeef.spad.pamphlet2
-rw-r--r--src/algebra/op.spad.pamphlet31
-rw-r--r--src/algebra/pfo.spad.pamphlet4
-rw-r--r--src/algebra/rdeef.spad.pamphlet4
18 files changed, 84 insertions, 87 deletions
diff --git a/src/algebra/algfunc.spad.pamphlet b/src/algebra/algfunc.spad.pamphlet
index 30cbb285..9d70445d 100644
--- a/src/algebra/algfunc.spad.pamphlet
+++ b/src/algebra/algfunc.spad.pamphlet
@@ -307,9 +307,6 @@ AlgebraicFunction(R, F): Exports == Implementation where
P ==> SparseMultivariatePolynomial(R, K)
UP ==> SparseUnivariatePolynomial F
UPR ==> SparseUnivariatePolynomial R
- ALGOP ==> "%alg"
- SPECIALDISP ==> "%specialDisp"
- SPECIALDIFF ==> "%specialDiff"
Exports ==> with
rootOf : (UP, SE) -> F
@@ -343,6 +340,9 @@ AlgebraicFunction(R, F): Exports == Implementation where
-- un-export when the compiler accepts conditional local functions!
Implementation ==> add
+ macro ALGOP == '%alg
+ macro SPECIALDISP == '%specialDisp
+ macro SPECIALDIFF == '%specialDiff
ialg : List F -> F
dvalg: (List F, SE) -> F
dalg : List F -> OutputForm
diff --git a/src/algebra/combfunc.spad.pamphlet b/src/algebra/combfunc.spad.pamphlet
index fdf4405d..41fe5af5 100644
--- a/src/algebra/combfunc.spad.pamphlet
+++ b/src/algebra/combfunc.spad.pamphlet
@@ -210,7 +210,7 @@ caused nested products and summations to fail. (Issue~\#72)
oppow [expr.val, (expr.exponent)*y]
oppow [x, y]
- belong? op == has?(op, "comb")
+ belong? op == has?(op, 'comb)
fourth l == third rest l
dvpow1 l == second(l) * first(l) ** (second l - 1)
factorials x == facts(x, variables x)
@@ -690,7 +690,7 @@ FunctionalSpecialFunction(R, F): Exports == Implementation where
airyAi(x) == opAiryAi(x)
airyBi(x) == opAiryBi(x)
- belong? op == has?(op, "special")
+ belong? op == has?(op, 'special)
operator op ==
is?(op,'abs) => opabs
diff --git a/src/algebra/constant.spad.pamphlet b/src/algebra/constant.spad.pamphlet
index 5672e9af..0e28c371 100644
--- a/src/algebra/constant.spad.pamphlet
+++ b/src/algebra/constant.spad.pamphlet
@@ -23,7 +23,6 @@ InnerAlgebraicNumber(): Exports == Implementation where
FE ==> Expression Z
K ==> Kernel %
P ==> SparseMultivariatePolynomial(Z, K)
- ALGOP ==> "%alg"
SUP ==> SparseUnivariatePolynomial
Exports ==> Join(ExpressionSpace, AlgebraicallyClosedField,
@@ -58,6 +57,7 @@ InnerAlgebraicNumber(): Exports == Implementation where
++ norm(f,l) computes the norm of the algebraic number f
++ with respect to the extension generated by kernels l
Implementation ==> FE add
+ macro ALGOP == '%alg
Rep := FE
diff --git a/src/algebra/efstruc.spad.pamphlet b/src/algebra/efstruc.spad.pamphlet
index d10c7744..fe6d0bb3 100644
--- a/src/algebra/efstruc.spad.pamphlet
+++ b/src/algebra/efstruc.spad.pamphlet
@@ -299,14 +299,14 @@ ElementaryFunctionStructurePackage(R,F): Exports == Implementation where
is?(k, "%paren"::SY) or is?(k, "%box"::SY) =>
empty? rest args => z
kf
- if has?(op := operator k, "htrig") then iez := inv(ez := exp z)
+ 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)
- if has?(op, "trig") then tz2 := tan(z / (2::F))
+ 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)
@@ -758,14 +758,14 @@ TrigonometricManipulations(R, F): Exports == Implementation where
explogs2trigs locexplogs eval(f, l.ker, l.val)
locexplogs f ==
- any?(has?(#1, "rtrig"),
+ any?(has?(#1, 'rtrig),
operators(g := realElementary f))$List(BasicOperator) =>
localexplogs(f, g, variables g)
F2FG g
complexNormalize(f, x) ==
g : F
- any?(has?(operator #1, "rtrig"),
+ any?(has?(operator #1, 'rtrig),
[k for k in tower(g := realElementary(f, x))
| member?(x, variables(k::F))]$List(K))$List(K) =>
FG2F(rischNormalize(localexplogs(f, g, [x]), x).func)
@@ -773,7 +773,7 @@ TrigonometricManipulations(R, F): Exports == Implementation where
complexNormalize f ==
l := variables(g := realElementary f)
- any?(has?(#1, "rtrig"), operators g)$List(BasicOperator) =>
+ any?(has?(#1, 'rtrig), operators g)$List(BasicOperator) =>
h := localexplogs(f, g, l)
for x in l repeat h := rischNormalize(h, x).func
FG2F h
@@ -782,14 +782,14 @@ TrigonometricManipulations(R, F): Exports == Implementation where
complexElementary(f, x) ==
g : F
- any?(has?(operator #1, "rtrig"),
+ any?(has?(operator #1, 'rtrig),
[k for k in tower(g := realElementary(f, x))
| member?(x, variables(k::F))]$List(K))$List(K) =>
FG2F localexplogs(f, g, [x])
g
complexElementary f ==
- any?(has?(#1, "rtrig"),
+ any?(has?(#1, 'rtrig),
operators(g := realElementary f))$List(BasicOperator) =>
FG2F localexplogs(f, g, variables g)
g
@@ -880,14 +880,14 @@ ComplexTrigonometricManipulations(R, F): Exports == Implementation where
| is?(k, "tan"::SY) or is?(k, "cot"::SY)], lx)
complexElementary f ==
- any?(has?(#1, "rtrig"),
+ any?(has?(#1, 'rtrig),
operators(g := realElementary f))$List(BasicOperator) =>
localexplogs(f, g, variables g)
g
complexElementary(f, x) ==
g : F
- any?(has?(operator #1, "rtrig"),
+ any?(has?(operator #1, 'rtrig),
[k for k in tower(g := realElementary(f, x))
| member?(x, variables(k::F))]$List(K))$List(K) =>
localexplogs(f, g, [x])
@@ -895,7 +895,7 @@ ComplexTrigonometricManipulations(R, F): Exports == Implementation where
complexNormalize(f, x) ==
g : F
- any?(has?(operator #1, "rtrig"),
+ any?(has?(operator #1, 'rtrig),
[k for k in tower(g := realElementary(f, x))
| member?(x, variables(k::F))]$List(K))$List(K) =>
(rischNormalize(localexplogs(f, g, [x]), x).func)
@@ -903,7 +903,7 @@ ComplexTrigonometricManipulations(R, F): Exports == Implementation where
complexNormalize f ==
l := variables(g := realElementary f)
- any?(has?(#1, "rtrig"), operators g)$List(BasicOperator) =>
+ any?(has?(#1, 'rtrig), operators g)$List(BasicOperator) =>
h := localexplogs(f, g, l)
for x in l repeat h := rischNormalize(h, x).func
h
diff --git a/src/algebra/elemntry.spad.pamphlet b/src/algebra/elemntry.spad.pamphlet
index 356bf647..e0f0c440 100644
--- a/src/algebra/elemntry.spad.pamphlet
+++ b/src/algebra/elemntry.spad.pamphlet
@@ -279,7 +279,7 @@ ElementaryFunction(R, F): Exports == Implementation where
posrem(n, m) == ((r := n rem m) < 0 => r + m; r)
valueOrPole rec == (rec.pole => INV; rec.func)
- belong? op == has?(op, "elem")
+ belong? op == has?(op, 'elem)
operator op ==
is?(op,'pi) => oppi
diff --git a/src/algebra/expr.spad.pamphlet b/src/algebra/expr.spad.pamphlet
index 548fc9a5..4a47ea75 100644
--- a/src/algebra/expr.spad.pamphlet
+++ b/src/algebra/expr.spad.pamphlet
@@ -31,9 +31,6 @@ Expression(R:OrderedSet): Exports == Implementation where
FSF ==> FunctionalSpecialFunction(R, %)
ESD ==> ExpressionSpace_&(%)
FSD ==> FunctionSpace_&(%, R)
- SYMBOL ==> "%symbol"
- ALGOP ==> "%alg"
- POWER ==> '%power
SUP ==> SparseUnivariatePolynomial
Exports ==> FunctionSpace R with
@@ -58,6 +55,9 @@ Expression(R:OrderedSet): Exports == Implementation where
if R has RetractableTo Integer then RetractableTo AN
Implementation ==> add
+ macro SYMBOL == '%symbol
+ macro ALGOP == '%alg
+ macro POWER == '%power
import KernelFunctions2(R, %)
retNotUnit : % -> R
@@ -134,7 +134,7 @@ Expression(R:OrderedSet): Exports == Implementation where
coerce(p:MP):% == coerce(p)$Rep
reduce x == reduc(x, algkernels kernels x)
commonk(x, y) == commonk0(algkernels kernels x, algkernels kernels y)
- algkernels l == select_!(has?(operator #1, ALGOP), l)
+ algkernels l == select!(has?(operator #1, ALGOP), l)
toprat f == ratDenom(f, algkernels kernels f)$AlgebraicManipulations(R, %)
x:MP / y:MP ==
@@ -739,7 +739,7 @@ PatternMatchAssertions(): Exports == Implementation where
FE ==> Expression Integer
Exports ==> with
- assert : (Symbol, String) -> FE
+ assert : (Symbol, Identifier) -> FE
++ assert(x, s) makes the assertion s about x.
constant: Symbol -> FE
++ constant(x) tells the pattern matcher that x should
diff --git a/src/algebra/fspace.spad.pamphlet b/src/algebra/fspace.spad.pamphlet
index d5af612b..91e565d3 100644
--- a/src/algebra/fspace.spad.pamphlet
+++ b/src/algebra/fspace.spad.pamphlet
@@ -394,14 +394,6 @@ FunctionSpace(R:OrderedSet): Category == Definition where
MP ==> SparseMultivariatePolynomial(R, K)
QF==> PolynomialCategoryQuotientFunctions(IndexedExponents K,K,R,MP,%)
- ODD ==> "odd"
- EVEN ==> "even"
-
- SPECIALDIFF ==> "%specialDiff"
- SPECIALDISP ==> "%specialDisp"
- SPECIALEQUAL ==> "%specialEqual"
- SPECIALINPUT ==> "%specialInput"
-
Definition ==> Join(ExpressionSpace, RetractableTo SY, Patternable R,
FullyPatternMatchable R, FullyRetractableTo R) with
ground? : % -> Boolean
@@ -522,6 +514,14 @@ FunctionSpace(R:OrderedSet): Category == Definition where
++ univariate(f, k) returns f viewed as a univariate fraction in k.
if R has RetractableTo Z then RetractableTo Fraction Z
add
+ macro ODD == 'odd
+ macro EVEN == 'even
+
+ macro SPECIALDIFF == '%specialDiff
+ macro SPECIALDISP == '%specialDisp
+ macro SPECIALEQUAL == '%specialEqual
+ macro SPECIALINPUT == '%specialInput
+
import BasicOperatorFunctions1(%)
-- these are needed in Ring only, but need to be declared here
@@ -757,7 +757,7 @@ FunctionSpace(R:OrderedSet): Category == Definition where
v::SY = x => 1
0
(fn := property(operator k, SPECIALDIFF)) case None =>
- ((fn::None) pretend ((List %, SY) -> %)) (argument k, x)
+ ((fn@None) pretend ((List %, SY) -> %)) (argument k, x)
+/[g * differentiate(y,x) for g in kderiv k for y in argument k]
smpderiv(p, x) ==
diff --git a/src/algebra/intef.spad.pamphlet b/src/algebra/intef.spad.pamphlet
index c6b93681..7e96e6f2 100644
--- a/src/algebra/intef.spad.pamphlet
+++ b/src/algebra/intef.spad.pamphlet
@@ -40,8 +40,6 @@ ElementaryIntegration(R, F): Exports == Implementation where
U3 ==> Union(Record(mainpart:F, limitedlogs:LLG), "failed")
ANS ==> Record(special:F, integrand:F)
FAIL==> error "failed - cannot handle that integrand"
- ALGOP ==> "%alg"
- OPDIFF ==> "%diff"::SE
Exports ==> with
lfextendedint: (F, SE, F) -> U2
@@ -62,6 +60,8 @@ ElementaryIntegration(R, F): Exports == Implementation where
++ containing f and k1,...,kn (the ki's must be logs).
Implementation ==> add
+ macro ALGOP == '%alg
+ macro OPDIFF == '%diff
import IntegrationTools(R, F)
import ElementaryRischDE(R, F)
import RationalIntegration(F, UP)
@@ -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"::SE) or has?(operator k, 'prim)
tanint(f, x, k) ==
eta' := differentiate(eta := first argument k, x)
diff --git a/src/algebra/integrat.spad.pamphlet b/src/algebra/integrat.spad.pamphlet
index 97eb0d2e..9fce6205 100644
--- a/src/algebra/integrat.spad.pamphlet
+++ b/src/algebra/integrat.spad.pamphlet
@@ -72,7 +72,7 @@ FunctionSpaceComplexIntegration(R, F): Exports == Implementation where
internalIntegrate(f, x) ==
f := distribute(f, x::F)
g : F
- any?(has?(operator #1, "rtrig"),
+ any?(has?(operator #1, 'rtrig),
[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
@@ -110,8 +110,6 @@ FunctionSpaceIntegration(R, F): Exports == Implementation where
SE ==> Symbol
IR ==> IntegrationResult F
FG ==> Expression G
- ALGOP ==> "%alg"
- TANTEMP ==> "%temptan"::SE
Exports ==> with
integrate: (F, SE) -> Union(F, List F)
@@ -119,6 +117,8 @@ FunctionSpaceIntegration(R, F): Exports == Implementation where
++ where x is viewed as a real variable.
Implementation ==> add
+ macro ALGOP == '%alg
+ macro TANTEMP == '%temptan
import IntegrationTools(R, F)
import ElementaryIntegration(R, F)
import ElementaryIntegration(G, FG)
@@ -199,13 +199,13 @@ FunctionSpaceIntegration(R, F): Exports == Implementation where
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)
- ht := any?(has?(operator #1, "htrig"), 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)
- rtg := any?(has?(operator #1, "rtrig"), tg)
- el := any?(has?(operator #1, "elem"), 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,
diff --git a/src/algebra/kl.spad.pamphlet b/src/algebra/kl.spad.pamphlet
index b2ba8cad..d07e5b90 100644
--- a/src/algebra/kl.spad.pamphlet
+++ b/src/algebra/kl.spad.pamphlet
@@ -123,14 +123,6 @@ Kernel(S:OrderedSet): Exports == Implementation where
N ==> NonNegativeInteger
OP ==> BasicOperator
- SYMBOL ==> "%symbol"
- PMPRED ==> "%pmpredicate"
- PMOPT ==> "%pmoptional"
- PMMULT ==> "%pmmultiple"
- PMCONST ==> "%pmconstant"
- SPECIALDISP ==> "%specialDisp"
- SPECIALEQUAL ==> "%specialEqual"
- SPECIALINPUT ==> "%specialInput"
Exports ==> Join(CachableSet, Patternable S) with
name : % -> Symbol
@@ -157,6 +149,14 @@ Kernel(S:OrderedSet): Exports == Implementation where
if S has ConvertibleTo InputForm then ConvertibleTo InputForm
Implementation ==> add
+ macro SYMBOL == '%symbol
+ macro PMPRED == '%pmpredicate
+ macro PMOPT == '%pmoptional
+ macro PMMULT == '%pmmultiple
+ macro PMCONST == '%pmconstant
+ macro SPECIALDISP == '%specialDisp
+ macro SPECIALEQUAL == '%specialEqual
+ macro SPECIALINPUT == '%specialInput
import SortedCache(%)
Rep := Record(op:OP, arg:List S, nest:N, posit:N)
@@ -179,8 +179,8 @@ Kernel(S:OrderedSet): Exports == Implementation where
kernel s == kernel(assert(operator(s,0),SYMBOL), nil(), 1)
preds o ==
- (u := property(o, PMPRED)) case "failed" => nil()
- (u::None) pretend List(Any)
+ (u := property(o, PMPRED)) case nothing => nil()
+ (u@None) pretend List(Any)
symbolIfCan k ==
has?(operator k, SYMBOL) => name operator k
@@ -207,7 +207,7 @@ Kernel(S:OrderedSet): Exports == Implementation where
coerce(k:%):OutputForm ==
(v := symbolIfCan k) case Symbol => v::Symbol::OutputForm
(f := property(o := operator k, SPECIALDISP)) case None =>
- ((f::None) pretend (List S -> OutputForm)) (argument k)
+ ((f@None) pretend (List S -> OutputForm)) (argument k)
l := [x::OutputForm for x in argument k]$List(OutputForm)
(u := display o) case "failed" => prefix(name(o)::OutputForm, l)
(u::(List OutputForm -> OutputForm)) l
@@ -217,7 +217,7 @@ Kernel(S:OrderedSet): Exports == Implementation where
k1.op ~= k2.op => B2Z(k1.op < k2.op)
(n1 := #(argument k1)) ~= (n2 := #(argument k2)) => B2Z(n1 < n2)
((func := property(operator k1, SPECIALEQUAL)) case None) and
- (((func::None) pretend ((%, %) -> Boolean)) (k1, k2)) => 0
+ (((func@None) pretend ((%, %) -> Boolean)) (k1, k2)) => 0
for x1 in argument(k1) for x2 in argument(k2) repeat
x1 ~= x2 => return B2Z(x1 < x2)
0
@@ -226,7 +226,7 @@ Kernel(S:OrderedSet): Exports == Implementation where
convert(k:%):InputForm ==
(v := symbolIfCan k) case Symbol => convert(v::Symbol)@InputForm
(f := property(o := operator k, SPECIALINPUT)) case None =>
- ((f::None) pretend (List S -> InputForm)) (argument k)
+ ((f@None) pretend (List S -> InputForm)) (argument k)
l := [convert x for x in argument k]$List(InputForm)
(u := input operator k) case "failed" =>
convert concat(convert name operator k, l)
diff --git a/src/algebra/laplace.spad.pamphlet b/src/algebra/laplace.spad.pamphlet
index ad8647f4..9652f91d 100644
--- a/src/algebra/laplace.spad.pamphlet
+++ b/src/algebra/laplace.spad.pamphlet
@@ -30,8 +30,6 @@ LaplaceTransform(R, F): Exports == Implementation where
OFE ==> OrderedCompletion F
EQ ==> Equation OFE
- ALGOP ==> "%alg"
- SPECIALDIFF ==> "%specialDiff"
Exports ==> with
laplace: (F, SE, SE) -> F
@@ -42,6 +40,8 @@ LaplaceTransform(R, F): Exports == Implementation where
++ compute the transform.
Implementation ==> add
+ macro ALGOP == '%alg
+ macro SPECIALDIFF == '%specialDiff
import IntegrationTools(R, F)
import ElementaryIntegration(R, F)
import PatternMatchIntegration(R, F)
diff --git a/src/algebra/limitps.spad.pamphlet b/src/algebra/limitps.spad.pamphlet
index faf927cc..2ae98c68 100644
--- a/src/algebra/limitps.spad.pamphlet
+++ b/src/algebra/limitps.spad.pamphlet
@@ -563,8 +563,6 @@ ElementaryFunctionSign(R,F): Exports == Implementation where
P ==> SparseMultivariatePolynomial(R, K)
U ==> Union(Z, "failed")
FS2 ==> FunctionSpaceFunctions2
- POSIT ==> "positive"
- NEGAT ==> "negative"
Exports ==> with
sign: F -> U
@@ -577,6 +575,8 @@ ElementaryFunctionSign(R,F): Exports == Implementation where
++ if s is "left", or above if s is "right".
Implementation ==> add
+ macro POSIT == 'positive
+ macro NEGAT == 'negative
import ToolsForSign R
import RationalFunctionSign(R)
import PowerSeriesLimitPackage(R, F)
@@ -700,8 +700,8 @@ ElementaryFunctionSign(R,F): Exports == Implementation where
us::Z
kerSign k ==
- has?(op := operator k, "NEGAT") => -1
- has?(op, "POSIT") or is?(op, "pi"::SY) or is?(op,"exp"::SY) or
+ 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
empty?(arg := argument k) => "failed"
(s := sign first arg) case "failed" =>
diff --git a/src/algebra/liouv.spad.pamphlet b/src/algebra/liouv.spad.pamphlet
index 4145f37f..7f730bfd 100644
--- a/src/algebra/liouv.spad.pamphlet
+++ b/src/algebra/liouv.spad.pamphlet
@@ -91,7 +91,7 @@ LiouvillianFunction(R, F): Exports == Implementation where
li x == opli x
dilog x == opli2 x
- belong? op == has?(op, "prim")
+ belong? op == has?(op, 'prim)
isi x == kernel(opsi, x)
ici x == kernel(opci, x)
ierf x == (zero? x => 0; kernel(operf, x))
diff --git a/src/algebra/manip.spad.pamphlet b/src/algebra/manip.spad.pamphlet
index 17fb455a..49c0e5ce 100644
--- a/src/algebra/manip.spad.pamphlet
+++ b/src/algebra/manip.spad.pamphlet
@@ -206,8 +206,6 @@ AlgebraicManipulations(R, F): Exports == Implementation where
P ==> SparseMultivariatePolynomial(R, K)
RF ==> Fraction P
REC ==> Record(ker:List K, exponent: List Z)
- ALGOP ==> "%alg"
- NTHR ==> "nthRoot"
Exports ==> with
rootSplit: F -> F
@@ -251,6 +249,8 @@ AlgebraicManipulations(R, F): Exports == Implementation where
++ rootKerSimp(op,f,n) should be local but conditional.
Implementation ==> add
+ macro ALGOP == '%alg
+ macro NTHR == 'nthRoot
import PolynomialCategoryQuotientFunctions(IndexedExponents K,K,R,P,F)
innerRF : (F, List K) -> F
@@ -264,8 +264,8 @@ AlgebraicManipulations(R, F): Exports == Implementation where
ratDenom(x:F, l:List K):F == innerRF(x, algkernels l)
ratDenom(x:F, y:F) == ratDenom(x, [y])
ratDenom(x:F, l:List F) == ratDenom(x, [retract(y)@K for y in l]$List(K))
- algkernels l == select_!(has?(operator #1, ALGOP), l)
- rootkernels l == select_!(is?(operator #1, NTHR::SY), l)
+ algkernels l == select!(has?(operator #1, ALGOP), l)
+ rootkernels l == select!(is?(operator #1, NTHR::SY), l)
ratPoly x ==
numer univariate(denom(ratDenom inv(dummy::P::F - x))::F, dummy)
diff --git a/src/algebra/odeef.spad.pamphlet b/src/algebra/odeef.spad.pamphlet
index 9795f76d..ed29a09c 100644
--- a/src/algebra/odeef.spad.pamphlet
+++ b/src/algebra/odeef.spad.pamphlet
@@ -105,7 +105,6 @@ ElementaryFunctionLODESolver(R, F, L): Exports == Implementation where
LQ ==> LinearOrdinaryDifferentialOperator1 RF
REC ==> Record(particular: F, basis: List F)
U ==> Union(REC, "failed")
- ALGOP ==> "%alg"
Exports ==> with
solve: (L, F, SY) -> U
@@ -125,6 +124,7 @@ ElementaryFunctionLODESolver(R, F, L): Exports == Implementation where
++ \spad{x} is the dependent variable.
Implementation ==> add
+ macro ALGOP == '%alg
import Kovacic(F, UP)
import ODETools(F, L)
import RationalLODE(F, UP)
diff --git a/src/algebra/op.spad.pamphlet b/src/algebra/op.spad.pamphlet
index 54f8639c..d8987ace 100644
--- a/src/algebra/op.spad.pamphlet
+++ b/src/algebra/op.spad.pamphlet
@@ -86,8 +86,6 @@ BasicOperator(): Exports == Implementation where
++ it has one attached, "failed" otherwise.
is? : ($, Symbol) -> Boolean
++ is?(op, s) tests if the name of op is s.
- has? : ($, String) -> Boolean
- ++ has?(op, s) tests if property s is attached to op.
has? : (%, Identifier) -> Boolean
++ \spad{has?(op,p)} tests if property \spad{s} is attached to \spad{op}.
assert : ($, String) -> $
@@ -142,7 +140,6 @@ BasicOperator(): Exports == Implementation where
otherwise => nothing
assert(op: %, s: String) == setProperty(op, s, NIL$Lisp)
assert(op: %, p: Identifier) == setProperty(op, p, NIL$Lisp)
- has?(op: %, name: String) == key?(name, rep(op).props)
has?(op: %, name: Identifier) == key?(STRING(name)$Lisp, rep(op).props)
weight(op, n) == setProperty(op, WEIGHT, n pretend None)
nullary? op == zero? rep(op).narg
@@ -229,9 +226,6 @@ BasicOperator(): Exports == Implementation where
++ Keywords: operator.
BasicOperatorFunctions1(A:SetCategory): Exports == Implementation where
OP ==> BasicOperator
- EVAL ==> "%eval"
- CONST ==> "%constant"
- DIFF ==> "%diff"
Exports ==> with
evaluate : (OP, List A) -> Union(A, "failed")
@@ -270,22 +264,25 @@ BasicOperatorFunctions1(A:SetCategory): Exports == Implementation where
++ nullary operator always returning \spad{a}, "failed" otherwise.
Implementation ==> add
+ macro EVAL == '%eval
+ macro CONST == '%constant
+ macro DIFF == '%diff
evaluate(op:OP, func:A -> A) == evaluate(op, func first #1)
evaluate op ==
- (func := property(op, EVAL)) case "failed" => "failed"
- (func::None) pretend (List A -> A)
+ (func := property(op, EVAL)) case nothing => "failed"
+ (func@None) pretend (List A -> A)
evaluate(op:OP, args:List A) ==
- (func := property(op, EVAL)) case "failed" => "failed"
- ((func::None) pretend (List A -> A)) args
+ (func := property(op, EVAL)) case nothing => "failed"
+ ((func@None) pretend (List A -> A)) args
evaluate(op:OP, func:List A -> A) ==
setProperty(op, EVAL, func pretend None)
derivative op ==
- (func := property(op, DIFF)) case "failed" => "failed"
- ((func::None) pretend List(List A -> A))
+ (func := property(op, DIFF)) case nothing => "failed"
+ ((func@None) pretend List(List A -> A))
derivative(op:OP, grad:List(List A -> A)) ==
setProperty(op, DIFF, grad pretend None)
@@ -310,14 +307,14 @@ BasicOperatorFunctions1(A:SetCategory): Exports == Implementation where
csex(a, l) == a
eqconst?(a, b) ==
- (va := property(a, CONST)) case "failed" => not has?(b, CONST)
+ (va := property(a, CONST)) case nothing => not has?(b, CONST)
((vb := property(b, CONST)) case None) and
- ((va::None) pretend A) = ((vb::None) pretend A)
+ ((va@None) pretend A) = ((vb@None) pretend A)
ltconst?(a, b) ==
- (va := property(a, CONST)) case "failed" => has?(b, CONST)
+ (va := property(a, CONST)) case nothing => has?(b, CONST)
((vb := property(b, CONST)) case None) and
- ((va::None) pretend A) < ((vb::None) pretend A)
+ ((va@None) pretend A) < ((vb@None) pretend A)
constOp a ==
setProperty(display(copy opconst, cdisp(a::OutputForm, #1)),
@@ -325,7 +322,7 @@ BasicOperatorFunctions1(A:SetCategory): Exports == Implementation where
constantOpIfCan op ==
is?(op,'constant) and
- ((u := property(op, CONST)) case None) => (u::None) pretend A
+ ((u := property(op, CONST)) case None) => (u@None) pretend A
"failed"
if A has ConvertibleTo InputForm then
diff --git a/src/algebra/pfo.spad.pamphlet b/src/algebra/pfo.spad.pamphlet
index 5a36f184..e5232cc1 100644
--- a/src/algebra/pfo.spad.pamphlet
+++ b/src/algebra/pfo.spad.pamphlet
@@ -237,7 +237,6 @@ FunctionSpaceReduce(R, F): Exports == Implementation where
Q ==> Fraction Integer
UP ==> SparseUnivariatePolynomial Q
K ==> Kernel F
- ALGOP ==> "%alg"
Exports ==> with
bringDown: F -> Q
@@ -248,6 +247,7 @@ FunctionSpaceReduce(R, F): Exports == Implementation where
++ newReduc() \undocumented
Implementation ==> add
+ macro ALGOP == '%alg
import SparseUnivariatePolynomialFunctions2(F, Q)
import PolynomialCategoryQuotientFunctions(IndexedExponents K,
K, R, SparseMultivariatePolynomial(R, K), F)
@@ -312,7 +312,6 @@ PointsOfFiniteOrder(R0, F, UP, UPUP, R): Exports == Implementation where
RC0 ==> Record(ncurve:UPUPQ, disc:Z)
ID ==> FractionalIdeal(UP, QF, UPUP, R)
SMP ==> SparseMultivariatePolynomial(R0,K)
- ALGOP ==> "%alg"
Exports ==> with
order : FD -> Union(N, "failed")
@@ -323,6 +322,7 @@ PointsOfFiniteOrder(R0, F, UP, UPUP, R): Exports == Implementation where
++ torsionIfCan(f)\ undocumented
Implementation ==> add
+ macro ALGOP == '%alg
import IntegerPrimesPackage(Z)
import PointsOfFiniteOrderTools(UPQ, UPUPQ)
import UnivariatePolynomialCommonDenominator(Z, Q, UPQ)
diff --git a/src/algebra/rdeef.spad.pamphlet b/src/algebra/rdeef.spad.pamphlet
index 6e141ea0..787393b1 100644
--- a/src/algebra/rdeef.spad.pamphlet
+++ b/src/algebra/rdeef.spad.pamphlet
@@ -25,7 +25,6 @@ IntegrationTools(R:OrderedSet, F:FunctionSpace R): Exp == Impl where
IR ==> IntegrationResult F
ANS ==> Record(special:F, integrand:F)
U ==> Union(ANS, "failed")
- ALGOP ==> "%alg"
Exp ==> with
varselect: (List K, SE) -> List K
@@ -57,6 +56,7 @@ IntegrationTools(R:OrderedSet, F:FunctionSpace R): Exp == Impl where
++ on any remaining unintegrable part.
Impl ==> add
+ macro ALGOP == '%alg
better?: (K, K) -> Boolean
union(l1, l2) == setUnion(l1, l2)
@@ -179,7 +179,6 @@ ElementaryRischDE(R, F): Exports == Implementation where
UEX ==> Union(Record(ratpart:F, coeff:F), "failed")
PSOL==> Record(ans:F, right:F, sol?:Boolean)
FAIL==> error("Function not supported by Risch d.e.")
- ALGOP ==> "%alg"
Exports ==> with
rischDE: (Z, F, F, SE, (F, LF) -> U, (F, F) -> UEX) -> PSOL
@@ -191,6 +190,7 @@ ElementaryRischDE(R, F): Exports == Implementation where
++ ext is an extended integration function.
Implementation ==> add
+ macro ALGOP == '%alg
import IntegrationTools(R, F)
import TranscendentalRischDE(F, UP)
import TranscendentalIntegration(F, UP)