aboutsummaryrefslogtreecommitdiff
path: root/src/algebra
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2009-05-25 18:04:22 +0000
committerdos-reis <gdr@axiomatics.org>2009-05-25 18:04:22 +0000
commite9cb4189b0833dd88163889d9b68a00b2e15f26c (patch)
tree1ed2443eedbd14e14b9ce6474bc9bfa1b392a3f8 /src/algebra
parent785f36fcc98e8cbbd206342a73b274bc361508d6 (diff)
downloadopen-axiom-e9cb4189b0833dd88163889d9b68a00b2e15f26c.tar.gz
* algebra/kl.spad.pamphlet (KernelFunctions2): Remove OrderedSet
requirements. * algebra/op.spad.pamphlet (BasicOperatorFunctions1): Likewise.
Diffstat (limited to 'src/algebra')
-rw-r--r--src/algebra/kl.spad.pamphlet2
-rw-r--r--src/algebra/op.spad.pamphlet81
2 files changed, 38 insertions, 45 deletions
diff --git a/src/algebra/kl.spad.pamphlet b/src/algebra/kl.spad.pamphlet
index de767784..14077426 100644
--- a/src/algebra/kl.spad.pamphlet
+++ b/src/algebra/kl.spad.pamphlet
@@ -258,7 +258,7 @@ Kernel(S: SetCategory): Exports == Implementation where
)abbrev package KERNEL2 KernelFunctions2
++ Description:
++ This package exports some auxiliary functions on kernels
-KernelFunctions2(R:OrderedSet, S:OrderedSet): with
+KernelFunctions2(R: SetCategory, S: SetCategory): with
constantKernel: R -> Kernel S
++ constantKernel(r) \undocumented
constantIfCan : Kernel S -> Union(R, "failed")
diff --git a/src/algebra/op.spad.pamphlet b/src/algebra/op.spad.pamphlet
index dc1f4220..a467dd0e 100644
--- a/src/algebra/op.spad.pamphlet
+++ b/src/algebra/op.spad.pamphlet
@@ -251,13 +251,12 @@ BasicOperatorFunctions1(A:SetCategory): Exports == Implementation where
derivative : OP -> Union(List(List A -> A), "failed")
++ derivative(op) returns the value of the "%diff" property of
++ op if it has one, and "failed" otherwise.
- if A has OrderedSet then
- constantOperator: A -> OP
- ++ constantOperator(a) returns a nullary operator op
- ++ such that \spad{op()} always evaluate to \spad{a}.
- constantOpIfCan : OP -> Union(A, "failed")
- ++ constantOpIfCan(op) returns \spad{a} if op is the constant
- ++ nullary operator always returning \spad{a}, "failed" otherwise.
+ constantOperator: A -> OP
+ ++ constantOperator(a) returns a nullary operator op
+ ++ such that \spad{op()} always evaluate to \spad{a}.
+ constantOpIfCan : OP -> Union(A, "failed")
+ ++ constantOpIfCan(op) returns \spad{a} if op is the constant
+ ++ nullary operator always returning \spad{a}, "failed" otherwise.
Implementation ==> add
macro EVAL == '%eval
@@ -288,43 +287,37 @@ BasicOperatorFunctions1(A:SetCategory): Exports == Implementation where
derivative(op, [f first #1]$List(List A -> A))
error "Operator is not unary"
- if A has OrderedSet then
- cdisp : (OutputForm, List OutputForm) -> OutputForm
- csex : (InputForm, List InputForm) -> InputForm
- eqconst?: (OP, OP) -> Boolean
- ltconst?: (OP, OP) -> Boolean
- constOp : A -> OP
-
- opconst:OP :=
- comparison(equality(operator('constant, 0), eqconst?),
- ltconst?)
-
- cdisp(a, l) == a
- csex(a, l) == a
-
- eqconst?(a, b) ==
- (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)
-
- ltconst?(a, b) ==
- (va := property(a, CONST)) case nothing => has?(b, CONST)
- ((vb := property(b, CONST)) case None) and
- ((va@None) pretend A) < ((vb@None) pretend A)
-
- constOp a ==
- setProperty(display(copy opconst, cdisp(a::OutputForm, #1)),
- CONST, a pretend None)
-
- constantOpIfCan op ==
- is?(op,'constant) and
- ((u := property(op, CONST)) case None) => (u@None) pretend A
- "failed"
-
- if A has ConvertibleTo InputForm then
- constantOperator a == input(constOp a, csex(convert a, #1))
- else
- constantOperator a == constOp a
+ cdisp(a: OutputForm, l: List OutputForm): OutputForm == a
+
+ csex(a: InputForm, l: List InputForm): InputForm == a
+
+ eqconst?(a: OP, b: OP): Boolean ==
+ (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)
+
+ ltconst?(a: OP, b: OP): Boolean ==
+ (va := property(a, CONST)) case nothing => has?(b, CONST)
+ ((vb := property(b, CONST)) case None) and
+ before?((va@None) pretend A, (vb@None) pretend A)
+
+ opconst:OP :=
+ comparison(equality(operator('constant, 0), eqconst?),
+ ltconst?)
+
+ constOp(a: A): OP ==
+ setProperty(display(copy opconst, cdisp(a::OutputForm, #1)),
+ CONST, a pretend None)
+
+ constantOpIfCan op ==
+ is?(op,'constant) and
+ ((u := property(op, CONST)) case None) => (u@None) pretend A
+ "failed"
+
+ if A has ConvertibleTo InputForm then
+ constantOperator a == input(constOp a, csex(convert a, #1))
+ else
+ constantOperator a == constOp a
@
\section{package COMMONOP CommonOperators}