aboutsummaryrefslogtreecommitdiff
path: root/src/algebra
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2009-05-15 16:47:28 +0000
committerdos-reis <gdr@axiomatics.org>2009-05-15 16:47:28 +0000
commit530c1ee0f24568ecb6d61c3ce2c7af1863595fdf (patch)
treeaa2766372d474b05b0f7749c35829c52c328369b /src/algebra
parentd9fed70309979e063c16c35be9756c4ce76b2136 (diff)
downloadopen-axiom-530c1ee0f24568ecb6d61c3ce2c7af1863595fdf.tar.gz
* algebra/expr.spad.pamphlet (FunctionSpaceAttachPredicates): Tidy.
(FunctionSpaceAssertions): Likewise. * algebra/op.spad.pamphlet (BasicOperator): Tidy. (CommonOperators): Likewise.
Diffstat (limited to 'src/algebra')
-rw-r--r--src/algebra/expr.spad.pamphlet20
-rw-r--r--src/algebra/op.spad.pamphlet36
2 files changed, 28 insertions, 28 deletions
diff --git a/src/algebra/expr.spad.pamphlet b/src/algebra/expr.spad.pamphlet
index 5124454a..548fc9a5 100644
--- a/src/algebra/expr.spad.pamphlet
+++ b/src/algebra/expr.spad.pamphlet
@@ -594,7 +594,6 @@ FunctionSpaceAttachPredicates(R, F, D): Exports == Implementation where
D: Type
K ==> Kernel F
- PMPRED ==> "%pmpredicate"
Exports ==> with
suchThat: (F, D -> Boolean) -> F
@@ -606,6 +605,7 @@ FunctionSpaceAttachPredicates(R, F, D): Exports == Implementation where
++ Error: if x is not a symbol.
Implementation ==> add
+ macro PMPRED == '%pmpredicate
import AnyFunctions1(D -> Boolean)
st : (K, List Any) -> F
@@ -616,8 +616,8 @@ FunctionSpaceAttachPredicates(R, F, D): Exports == Implementation where
mkk op == kernel(op, empty()$List(F))
preds k ==
- (u := property(operator k, PMPRED)) case "failed" => empty()
- (u::None) pretend List(Any)
+ (u := property(operator k, PMPRED)) case nothing => empty()
+ (u@None) pretend List(Any)
st(k, l) ==
mkk assert(setProperty(copy operator k, PMPRED,
@@ -643,12 +643,9 @@ FunctionSpaceAssertions(R, F): Exports == Implementation where
F: FunctionSpace R
K ==> Kernel F
- PMOPT ==> "%pmoptional"
- PMMULT ==> "%pmmultiple"
- PMCONST ==> "%pmconstant"
Exports ==> with
- assert : (F, String) -> F
+ assert : (F, Identifier) -> F
++ assert(x, s) makes the assertion s about x.
++ Error: if x is not a symbol.
constant: F -> F
@@ -667,17 +664,18 @@ FunctionSpaceAssertions(R, F): Exports == Implementation where
++ Error: if x is not a symbol.
Implementation ==> add
- ass : (K, String) -> F
- asst : (K, String) -> F
+ macro PMOPT == '%pmoptional
+ macro PMMULT == '%pmmultiple
+ macro PMCONST == '%pmconstant
mkk : BasicOperator -> F
mkk op == kernel(op, empty()$List(F))
- ass(k, s) ==
+ ass(k: K, s: Identifier): F ==
has?(op := operator k, s) => k::F
mkk assert(copy op, s)
- asst(k, s) ==
+ asst(k: K, s: Identifier): F ==
has?(op := operator k, s) => k::F
mkk assert(op, s)
diff --git a/src/algebra/op.spad.pamphlet b/src/algebra/op.spad.pamphlet
index 617ea416..54f8639c 100644
--- a/src/algebra/op.spad.pamphlet
+++ b/src/algebra/op.spad.pamphlet
@@ -88,6 +88,8 @@ BasicOperator(): Exports == Implementation where
++ 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) -> $
++ assert(op, s) attaches property s to op.
++ Argument op is modified "in place", i.e. no copy is made.
@@ -99,7 +101,7 @@ BasicOperator(): Exports == Implementation where
++ Argument op is modified "in place", i.e. no copy is made.
deleteProperty!: ($, Identifier) -> $
++ \spad{deleteProperty!(op, p)} unattaches property \spad{p} from
- ++ \spad{op}. Argument \spad}op} is modified "in place",
+ ++ \spad{op}. Argument \spad{op} is modified "in place",
++ i.e. no copy is made.
property : ($, String) -> Union(None, "failed")
++ property(op, s) returns the value of property s if
@@ -140,7 +142,8 @@ 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) == key?(name, rep(op).props)
+ 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
unary? op == one? rep(op).narg
@@ -346,11 +349,6 @@ BasicOperatorFunctions1(A:SetCategory): Exports == Implementation where
CommonOperators(): Exports == Implementation where
OP ==> BasicOperator
O ==> OutputForm
- POWER ==> '%power
- ALGOP ==> "%alg"
- EVEN ==> "even"
- ODD ==> "odd"
- DUMMYVAR ==> "%dummyVar"
Exports ==> with
operator: Symbol -> OP
@@ -359,6 +357,11 @@ CommonOperators(): Exports == Implementation where
++ the result has no semantics.
Implementation ==> add
+ macro POWER == '%power
+ macro ALGOP == '%alg
+ macro EVEN == 'even
+ macro ODD == 'odd
+ DUMMYVAR ==> "%dummyVar"
dpi : List O -> O
dgamma : List O -> O
dquote : List O -> O
@@ -498,20 +501,19 @@ CommonOperators(): Exports == Implementation where
input(oproot,
convert [convert("**"::Symbol)@InputForm, first #1, 1 / second #1])
for op in algop repeat assert(op, ALGOP)
- for op in rtrigop repeat assert(op, "rtrig")
- for op in htrigop repeat assert(op, "htrig")
- for op in trigop repeat assert(op, "trig")
- for op in elemop repeat assert(op, "elem")
- for op in primop repeat assert(op, "prim")
- for op in combop repeat assert(op, "comb")
- for op in specop repeat assert(op, "special")
- for op in anyop repeat assert(op, "any")
+ for op in rtrigop repeat assert(op, 'rtrig)
+ for op in htrigop repeat assert(op, 'htrig)
+ for op in trigop repeat assert(op, 'trig)
+ for op in elemop repeat assert(op, 'elem)
+ for op in primop repeat assert(op, 'prim)
+ for op in combop repeat assert(op, 'comb)
+ for op in specop repeat assert(op, 'special)
+ for op in anyop repeat assert(op, 'any)
for op in evenop repeat assert(op, EVEN)
for op in oddop repeat assert(op, ODD)
for op in dummyvarop1 repeat setDummyVar(op, 1)
for op in dummyvarop2 repeat setDummyVar(op, 2)
- assert(oppren, "linear")
- void
+ assert(oppren, 'linear)
@
\section{License}