diff options
author | dos-reis <gdr@axiomatics.org> | 2011-09-15 15:09:25 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2011-09-15 15:09:25 +0000 |
commit | 9025c74466dcd1c38dde5e4c63934ff0b2e4f18d (patch) | |
tree | 447b28f9159920ca29a18fa9647bf7120dc3619c /src/algebra | |
parent | f5060cfd48a6993c7a6bd6b739e3d37bd234453a (diff) | |
download | open-axiom-9025c74466dcd1c38dde5e4c63934ff0b2e4f18d.tar.gz |
* algebra/alql.spad.pamphlet (IndexCard): Now satisfies
CoercibleFrom String. Remove explicit coerce export.
* algebra/carten.spad.pamphlet (CartesianTensor): Remove explicit
coerce export. Add satisfaction of CoercibleFrom appropriate
domains.
* algebra/color.spad.pamphlet (Palette): Relace explicit coerce
export with CoercibleTo %.
* algebra/constant.spad.pamphlet (InnerAlgebraicNumber): Likewise.
* algebra/dpolcat.spad.pamphlet (DifferentialVariableCategory):
Likewise.
Diffstat (limited to 'src/algebra')
-rw-r--r-- | src/algebra/alql.spad.pamphlet | 6 | ||||
-rw-r--r-- | src/algebra/carten.spad.pamphlet | 17 | ||||
-rw-r--r-- | src/algebra/color.spad.pamphlet | 5 | ||||
-rw-r--r-- | src/algebra/constant.spad.pamphlet | 10 | ||||
-rw-r--r-- | src/algebra/dpolcat.spad.pamphlet | 3 |
5 files changed, 9 insertions, 32 deletions
diff --git a/src/algebra/alql.spad.pamphlet b/src/algebra/alql.spad.pamphlet index 38162c30..400c612e 100644 --- a/src/algebra/alql.spad.pamphlet +++ b/src/algebra/alql.spad.pamphlet @@ -41,7 +41,7 @@ DataList(S:OrderedSet) : Exports == Implementation where ++ This domain implements a container of information ++ about the AXIOM library IndexCard() : Exports == Implementation where - Exports == OrderedSet with + Exports == Join(OrderedSet,CoercibleFrom String) with elt: (%,Symbol) -> String ++ elt(ic,s) selects a particular field from \axiom{ic}. Valid fields ++ are \axiom{name, nargs, exposed, type, abbreviation, kind, origin, @@ -50,10 +50,6 @@ IndexCard() : Exports == Implementation where ++ display(ic) prints a summary of the information contained in \axiom{ic}. fullDisplay: % -> Void ++ fullDisplay(ic) prints all of the information contained in \axiom{ic}. - coerce: String -> % - ++ coerce(s) converts \axiom{s} into an \axiom{IndexCard}. Warning: if - ++ \axiom{s} is not of the right format then an error will occur when using - ++ it. Implementation == add macro I == Integer Rep == String diff --git a/src/algebra/carten.spad.pamphlet b/src/algebra/carten.spad.pamphlet index 2e0369dd..a1fd01f6 100644 --- a/src/algebra/carten.spad.pamphlet +++ b/src/algebra/carten.spad.pamphlet @@ -131,20 +131,9 @@ CartesianTensor(minix, dim, R): Exports == Implementation where R: CommutativeRing Exports ==> Join(GradedAlgebra(R, NNI), GradedModule(I, NNI),_ - Eltable(I,R)) with - - coerce: DP(dim, R) -> % - ++ coerce(v) views a vector as a rank 1 tensor. - coerce: SM(dim, R) -> % - ++ coerce(m) views a matrix as a rank 2 tensor. - - coerce: List R -> % - ++ coerce([r_1,...,r_dim]) allows tensors to be constructed - ++ using lists. - - coerce: List % -> % - ++ coerce([t_1,...,t_dim]) allows tensors to be constructed - ++ using lists. + Eltable(I,R),CoercibleFrom DP(dim,R),_ + CoercibleFrom SM(dim,R),CoercibleFrom List R,_ + CoercibleFrom List %) with rank: % -> NNI ++ rank(t) returns the tensorial rank of t (that is, the diff --git a/src/algebra/color.spad.pamphlet b/src/algebra/color.spad.pamphlet index 76b8ea9b..32d76dd3 100644 --- a/src/algebra/color.spad.pamphlet +++ b/src/algebra/color.spad.pamphlet @@ -164,7 +164,7 @@ Palette(): Exports == Implementation where C ==> Color SHADE ==> ["Dark","Dim","Bright","Pastel","Light"] - Exports ==> SetCategory with + Exports ==> Join(SetCategory,CoercibleFrom C) with dark : C -> % ++ dark(c) sets the shade of the indicated hue of c to it's lowest value. dim : C -> % @@ -179,9 +179,6 @@ Palette(): Exports == Implementation where ++ hue(p) returns the hue field of the indicated palette p. shade : % -> I ++ shade(p) returns the shade index of the indicated palette p. - coerce : C -> % - ++ coerce(c) sets the average shade for the palette to that of the - ++ indicated color c. Implementation ==> add import I diff --git a/src/algebra/constant.spad.pamphlet b/src/algebra/constant.spad.pamphlet index 34138adc..186d6afb 100644 --- a/src/algebra/constant.spad.pamphlet +++ b/src/algebra/constant.spad.pamphlet @@ -30,9 +30,8 @@ InnerAlgebraicNumber(): Exports == Implementation where LinearlyExplicitRingOver Z, RealConstant, LinearlyExplicitRingOver Fraction Z, CharacteristicZero, - ConvertibleTo Complex Float, DifferentialRing) with - coerce : P -> % - ++ coerce(p) returns p viewed as an algebraic number. + ConvertibleTo Complex Float, DifferentialRing, + CoercibleFrom P) with numer : % -> P ++ numer(f) returns the numerator of f viewed as a ++ polynomial in the kernels over Z. @@ -164,9 +163,8 @@ AlgebraicNumber(): Exports == Implementation where LinearlyExplicitRingOver Z, RealConstant, LinearlyExplicitRingOver Fraction Z, CharacteristicZero, - ConvertibleTo Complex Float, DifferentialRing) with - coerce : P -> % - ++ coerce(p) returns p viewed as an algebraic number. + ConvertibleTo Complex Float, DifferentialRing, + CoercibleFrom P) with numer : % -> P ++ numer(f) returns the numerator of f viewed as a ++ polynomial in the kernels over Z. diff --git a/src/algebra/dpolcat.spad.pamphlet b/src/algebra/dpolcat.spad.pamphlet index 64ca21c2..f5004895 100644 --- a/src/algebra/dpolcat.spad.pamphlet +++ b/src/algebra/dpolcat.spad.pamphlet @@ -89,9 +89,6 @@ DifferentialVariableCategory(S:OrderedSet): Category == weight : $ -> NonNegativeInteger ++ weight(v) returns the weight of the derivative v. -- Example: weight(v) - coerce : S -> $ - ++ coerce(s) returns s, viewed as the zero-th order derivative of s. - -- Example: coerce('s); differentiate(%,5) add import NumberFormats coerce (s:S):$ == makeVariable(s, 0) |