diff options
Diffstat (limited to 'src/algebra')
-rw-r--r-- | src/algebra/Makefile.in | 2 | ||||
-rw-r--r-- | src/algebra/float.spad.pamphlet | 46 | ||||
-rw-r--r-- | src/algebra/fraction.spad.pamphlet | 50 | ||||
-rw-r--r-- | src/algebra/gaussian.spad.pamphlet | 47 | ||||
-rw-r--r-- | src/algebra/integer.spad.pamphlet | 45 | ||||
-rw-r--r-- | src/algebra/list.spad.pamphlet | 50 | ||||
-rw-r--r-- | src/algebra/sf.spad.pamphlet | 38 | ||||
-rw-r--r-- | src/algebra/si.spad.pamphlet | 47 | ||||
-rw-r--r-- | src/algebra/string.spad.pamphlet | 38 | ||||
-rw-r--r-- | src/algebra/symbol.spad.pamphlet | 43 |
10 files changed, 8 insertions, 398 deletions
diff --git a/src/algebra/Makefile.in b/src/algebra/Makefile.in index f116a4d8..0f52ada6 100644 --- a/src/algebra/Makefile.in +++ b/src/algebra/Makefile.in @@ -1225,7 +1225,7 @@ axiom_algebra_layer_14 = \ MPC2 MPC3 MPOLY MPRFF \ MRATFAC MULTSQFR NORMRETR NPCOEF \ NSUP NTPOLFN ODP ODEPRIM \ - ODEPRRIC OMPKG OMSERVER PADEPAC \ + ODEPRRIC OMPKG PADEPAC \ PADICRAT PADICRC PCOMP PDECOMP \ PF PFBR PFBRU PFOTOOLS \ PFRPAC PGCD PINTERPA PLEQN \ diff --git a/src/algebra/float.spad.pamphlet b/src/algebra/float.spad.pamphlet index 917d4490..ffafb040 100644 --- a/src/algebra/float.spad.pamphlet +++ b/src/algebra/float.spad.pamphlet @@ -119,7 +119,7 @@ N ==> NonNegativeInteger Float(): - Join(FloatingPointSystem, DifferentialRing, ConvertibleTo String, OpenMath,_ + Join(FloatingPointSystem, DifferentialRing, ConvertibleTo String,_ CoercibleTo DoubleFloat, TranscendentalFunctionCategory, _ ConvertibleTo InputForm,ConvertibleFrom SF) with / : (%, I) -> % @@ -210,50 +210,6 @@ Float(): cosSeries: % -> % -- cos(x) by taylor series |x| < 1/2 piRamanujan: () -> % -- pi using Ramanujans series - writeOMFloat(dev: OpenMathDevice, x: %): Void == - OMputApp(dev) - OMputSymbol(dev, "bigfloat1", "bigfloat") - OMputInteger(dev, mantissa x) - OMputInteger(dev, 2) - OMputInteger(dev, exponent x) - OMputEndApp(dev) - - OMwrite(x: %): String == - s: String := "" - sp := OM_-STRINGTOSTRINGPTR(s)$Lisp - dev: OpenMathDevice := OMopenString(sp pretend String, OMencodingXML()) - OMputObject(dev) - writeOMFloat(dev, x) - OMputEndObject(dev) - OMclose(dev) - s := OM_-STRINGPTRTOSTRING(sp)$Lisp pretend String - s - - OMwrite(x: %, wholeObj: Boolean): String == - s: String := "" - sp := OM_-STRINGTOSTRINGPTR(s)$Lisp - dev: OpenMathDevice := OMopenString(sp pretend String, OMencodingXML()) - if wholeObj then - OMputObject(dev) - writeOMFloat(dev, x) - if wholeObj then - OMputEndObject(dev) - OMclose(dev) - s := OM_-STRINGPTRTOSTRING(sp)$Lisp pretend String - s - - OMwrite(dev: OpenMathDevice, x: %): Void == - OMputObject(dev) - writeOMFloat(dev, x) - OMputEndObject(dev) - - OMwrite(dev: OpenMathDevice, x: %, wholeObj: Boolean): Void == - if wholeObj then - OMputObject(dev) - writeOMFloat(dev, x) - if wholeObj then - OMputEndObject(dev) - shift2(x,y) == sign(x)*shift(sign(x)*x,y) asin x == diff --git a/src/algebra/fraction.spad.pamphlet b/src/algebra/fraction.spad.pamphlet index 21162627..6fecb082 100644 --- a/src/algebra/fraction.spad.pamphlet +++ b/src/algebra/fraction.spad.pamphlet @@ -311,7 +311,6 @@ QuotientFieldCategoryFunctions2(A, B, R, S): Exports == Impl where ++ If S is also a GcdDomain, then gcd's between numerator and ++ denominator will be cancelled during all operations. Fraction(S: IntegralDomain): QuotientFieldCategory S with - if S has IntegerNumberSystem and S has OpenMath then OpenMath if S has canonical and S has GcdDomain and S has canonicalUnitNormal then canonical ++ \spad{canonical} means that equal elements are in fact identical. @@ -353,55 +352,6 @@ Fraction(S: IntegralDomain): QuotientFieldCategory S with negative? x => -floor(-x) 1 + wholePart x - if S has OpenMath then - -- TODO: somwhere this file does something which redefines the division - -- operator. Doh! - - writeOMFrac(dev: OpenMathDevice, x: %): Void == - OMputApp(dev) - OMputSymbol(dev, "nums1", "rational") - OMwrite(dev, x.num, false) - OMwrite(dev, x.den, false) - OMputEndApp(dev) - - OMwrite(x: %): String == - s: String := "" - sp := OM_-STRINGTOSTRINGPTR(s)$Lisp - dev: OpenMathDevice := _ - OMopenString(sp pretend String, OMencodingXML()) - OMputObject(dev) - writeOMFrac(dev, x) - OMputEndObject(dev) - OMclose(dev) - s := OM_-STRINGPTRTOSTRING(sp)$Lisp pretend String - s - - OMwrite(x: %, wholeObj: Boolean): String == - s: String := "" - sp := OM_-STRINGTOSTRINGPTR(s)$Lisp - dev: OpenMathDevice := _ - OMopenString(sp pretend String, OMencodingXML()) - if wholeObj then - OMputObject(dev) - writeOMFrac(dev, x) - if wholeObj then - OMputEndObject(dev) - OMclose(dev) - s := OM_-STRINGPTRTOSTRING(sp)$Lisp pretend String - s - - OMwrite(dev: OpenMathDevice, x: %): Void == - OMputObject(dev) - writeOMFrac(dev, x) - OMputEndObject(dev) - - OMwrite(dev: OpenMathDevice, x: %, wholeObj: Boolean): Void == - if wholeObj then - OMputObject(dev) - writeOMFrac(dev, x) - if wholeObj then - OMputEndObject(dev) - if S has GcdDomain then cancelGcd: % -> S normalize: % -> % diff --git a/src/algebra/gaussian.spad.pamphlet b/src/algebra/gaussian.spad.pamphlet index 44e9b918..c87d880a 100644 --- a/src/algebra/gaussian.spad.pamphlet +++ b/src/algebra/gaussian.spad.pamphlet @@ -547,55 +547,10 @@ ComplexPatternMatch(R, S, CS) : C == T where ++ \spadtype {Complex(R)} creates the domain of elements of the form ++ \spad{a + b * i} where \spad{a} and b come from the ring R, ++ and i is a new element such that \spad{i**2 = -1}. -Complex(R:CommutativeRing): ComplexCategory(R) with - if R has OpenMath then OpenMath +Complex(R:CommutativeRing): ComplexCategory(R) == add Rep := Record(real:R, imag:R) - if R has OpenMath then - writeOMComplex(dev: OpenMathDevice, x: %): Void == - OMputApp(dev) - OMputSymbol(dev, "complex1", "complex__cartesian") - OMwrite(dev, real x) - OMwrite(dev, imag x) - OMputEndApp(dev) - - OMwrite(x: %): String == - s: String := "" - sp := OM_-STRINGTOSTRINGPTR(s)$Lisp - dev: OpenMathDevice := OMopenString(sp pretend String, OMencodingXML()) - OMputObject(dev) - writeOMComplex(dev, x) - OMputEndObject(dev) - OMclose(dev) - s := OM_-STRINGPTRTOSTRING(sp)$Lisp pretend String - s - - OMwrite(x: %, wholeObj: Boolean): String == - s: String := "" - sp := OM_-STRINGTOSTRINGPTR(s)$Lisp - dev: OpenMathDevice := OMopenString(sp pretend String, OMencodingXML()) - if wholeObj then - OMputObject(dev) - writeOMComplex(dev, x) - if wholeObj then - OMputEndObject(dev) - OMclose(dev) - s := OM_-STRINGPTRTOSTRING(sp)$Lisp pretend String - s - - OMwrite(dev: OpenMathDevice, x: %): Void == - OMputObject(dev) - writeOMComplex(dev, x) - OMputEndObject(dev) - - OMwrite(dev: OpenMathDevice, x: %, wholeObj: Boolean): Void == - if wholeObj then - OMputObject(dev) - writeOMComplex(dev, x) - if wholeObj then - OMputEndObject(dev) - 0 == [0, 0] 1 == [1, 0] zero? x == zero?(x.real) and zero?(x.imag) diff --git a/src/algebra/integer.spad.pamphlet b/src/algebra/integer.spad.pamphlet index cc3fbff5..9052e19d 100644 --- a/src/algebra/integer.spad.pamphlet +++ b/src/algebra/integer.spad.pamphlet @@ -70,7 +70,7 @@ IntegerSolveLinearPolynomialEquation(): C ==T ++ Description: \spadtype{Integer} provides the domain of arbitrary precision ++ integers. -Integer: Join(IntegerNumberSystem, ConvertibleTo String, OpenMath) with +Integer: Join(IntegerNumberSystem, ConvertibleTo String) with canonical ++ mathematical equality is data structure equality. canonicalsClosed @@ -110,49 +110,6 @@ Integer: Join(IntegerNumberSystem, ConvertibleTo String, OpenMath) with x,y: % n: NonNegativeInteger - writeOMInt(dev: OpenMathDevice, x: %): Void == - if negative? x then - OMputApp(dev) - OMputSymbol(dev, "arith1", "unary__minus") - OMputInteger(dev, (-x) pretend Integer) - OMputEndApp(dev) - else - OMputInteger(dev, x pretend Integer) - - OMwrite(x: %): String == - s: String := "" - sp: String := OM_-STRINGTOSTRINGPTR(s)$Lisp - dev: OpenMathDevice := OMopenString(sp, OMencodingXML()) - OMputObject(dev) - writeOMInt(dev, x) - OMputEndObject(dev) - OMclose(dev) - OM_-STRINGPTRTOSTRING(sp)$Lisp - - OMwrite(x: %, wholeObj: Boolean): String == - s: String := "" - sp: String := OM_-STRINGTOSTRINGPTR(s)$Lisp - dev: OpenMathDevice := OMopenString(sp, OMencodingXML()) - if wholeObj then - OMputObject(dev) - writeOMInt(dev, x) - if wholeObj then - OMputEndObject(dev) - OMclose(dev) - OM_-STRINGPTRTOSTRING(sp)$Lisp - - OMwrite(dev: OpenMathDevice, x: %): Void == - OMputObject(dev) - writeOMInt(dev, x) - OMputEndObject(dev) - - OMwrite(dev: OpenMathDevice, x: %, wholeObj: Boolean): Void == - if wholeObj then - OMputObject(dev) - writeOMInt(dev, x) - if wholeObj then - OMputEndObject(dev) - zero? x == x = %icst0 one? x == x = %icst1 0 == %icst0 diff --git a/src/algebra/list.spad.pamphlet b/src/algebra/list.spad.pamphlet index bb770203..1d5a8522 100644 --- a/src/algebra/list.spad.pamphlet +++ b/src/algebra/list.spad.pamphlet @@ -269,7 +269,6 @@ List(S:Type): Exports == Implementation where ++ setDifference(u1,u2) returns a list of the elements ++ of \spad{u1} that are not also in \spad{u2}. ++ The order of elements in the resulting list is unspecified. - if S has OpenMath then OpenMath Implementation ==> IndexedList(S, LISTMININDEX) add @@ -283,55 +282,6 @@ List(S:Type): Exports == Implementation where cons(s, l) == %pair(s,l) append(l:%, t:%) == %lconcat(l,t) - if S has OpenMath then - writeOMList(dev: OpenMathDevice, x: %): Void == - OMputApp(dev) - OMputSymbol(dev, "list1", "list") - -- The following didn't compile because the compiler isn't - -- convinced that `xval' is a S. Duhhh! MCD. - --for xval in x repeat - -- OMwrite(dev, xval, false) - while not null x repeat - OMwrite(dev,first x,false) - x := rest x - OMputEndApp(dev) - - OMwrite(x: %): String == - s: String := "" - sp := OM_-STRINGTOSTRINGPTR(s)$Lisp - dev: OpenMathDevice := OMopenString(sp pretend String, OMencodingXML()) - OMputObject(dev) - writeOMList(dev, x) - OMputEndObject(dev) - OMclose(dev) - s := OM_-STRINGPTRTOSTRING(sp)$Lisp pretend String - s - - OMwrite(x: %, wholeObj: Boolean): String == - s: String := "" - sp := OM_-STRINGTOSTRINGPTR(s)$Lisp - dev: OpenMathDevice := OMopenString(sp pretend String, OMencodingXML()) - if wholeObj then - OMputObject(dev) - writeOMList(dev, x) - if wholeObj then - OMputEndObject(dev) - OMclose(dev) - s := OM_-STRINGPTRTOSTRING(sp)$Lisp pretend String - s - - OMwrite(dev: OpenMathDevice, x: %): Void == - OMputObject(dev) - writeOMList(dev, x) - OMputEndObject(dev) - - OMwrite(dev: OpenMathDevice, x: %, wholeObj: Boolean): Void == - if wholeObj then - OMputObject(dev) - writeOMList(dev, x) - if wholeObj then - OMputEndObject(dev) - if S has SetCategory then setUnion(l1:%,l2:%) == removeDuplicates concat(l1,l2) diff --git a/src/algebra/sf.spad.pamphlet b/src/algebra/sf.spad.pamphlet index a6ed7e59..e15fdddd 100644 --- a/src/algebra/sf.spad.pamphlet +++ b/src/algebra/sf.spad.pamphlet @@ -250,7 +250,7 @@ FloatingPointSystem(): Category == RealNumberSystem() with ++ \spadtype{Float} is that it is much more expensive than small floats when the latter can be used. -- I've put some timing comparisons in the notes for the Float -- domain about the difference in speed between the two domains. -DoubleFloat(): Join(FloatingPointSystem, DifferentialRing, OpenMath, +DoubleFloat(): Join(FloatingPointSystem, DifferentialRing, TranscendentalFunctionCategory, ConvertibleTo InputForm) with / : (%, Integer) -> % ++ x / i computes the division from x by an integer i. @@ -330,42 +330,6 @@ DoubleFloat(): Join(FloatingPointSystem, DifferentialRing, OpenMath, manexp: % -> MER - OMwrite(x: %): String == - s: String := "" - sp := OM_-STRINGTOSTRINGPTR(s)$Lisp - dev: OpenMathDevice := OMopenString(sp pretend String, OMencodingXML()) - OMputObject(dev) - OMputFloat(dev, convert x) - OMputEndObject(dev) - OMclose(dev) - s := OM_-STRINGPTRTOSTRING(sp)$Lisp pretend String - s - - OMwrite(x: %, wholeObj: Boolean): String == - s: String := "" - sp := OM_-STRINGTOSTRINGPTR(s)$Lisp - dev: OpenMathDevice := OMopenString(sp pretend String, OMencodingXML()) - if wholeObj then - OMputObject(dev) - OMputFloat(dev, convert x) - if wholeObj then - OMputEndObject(dev) - OMclose(dev) - s := OM_-STRINGPTRTOSTRING(sp)$Lisp pretend String - s - - OMwrite(dev: OpenMathDevice, x: %): Void == - OMputObject(dev) - OMputFloat(dev, convert x) - OMputEndObject(dev) - - OMwrite(dev: OpenMathDevice, x: %, wholeObj: Boolean): Void == - if wholeObj then - OMputObject(dev) - OMputFloat(dev, convert x) - if wholeObj then - OMputEndObject(dev) - base() == %fbase() mantissa x == manexp(x).MANTISSA exponent x == manexp(x).EXPONENT diff --git a/src/algebra/si.spad.pamphlet b/src/algebra/si.spad.pamphlet index f8296439..7b58a44f 100644 --- a/src/algebra/si.spad.pamphlet +++ b/src/algebra/si.spad.pamphlet @@ -183,7 +183,7 @@ IntegerNumberSystem(): Category == -- QSLEFTSHIFT, QSADDMOD, QSDIFMOD, QSMULTMOD -SingleInteger(): Join(IntegerNumberSystem,OrderedFinite,BooleanLogic,OpenMath) with +SingleInteger(): Join(IntegerNumberSystem,OrderedFinite,BooleanLogic) with canonical ++ \spad{canonical} means that mathematical equality is implied by data structure equality. canonicalsClosed @@ -237,51 +237,6 @@ SingleInteger(): Join(IntegerNumberSystem,OrderedFinite,BooleanLogic,OpenMath) w import %bitior: (%,%) -> % from Foreign Builtin import %bitxor: (%,%) -> % from Foreign Builtin - writeOMSingleInt(dev: OpenMathDevice, x: %): Void == - if negative? x then - OMputApp(dev) - OMputSymbol(dev, "arith1", "unary_minus") - OMputInteger(dev, convert(-x)) - OMputEndApp(dev) - else - OMputInteger(dev, convert(x)) - - OMwrite(x: %): String == - s: String := "" - sp := OM_-STRINGTOSTRINGPTR(s)$Lisp - dev: OpenMathDevice := OMopenString(sp pretend String, OMencodingXML()) - OMputObject(dev) - writeOMSingleInt(dev, x) - OMputEndObject(dev) - OMclose(dev) - s := OM_-STRINGPTRTOSTRING(sp)$Lisp pretend String - s - - OMwrite(x: %, wholeObj: Boolean): String == - s: String := "" - sp := OM_-STRINGTOSTRINGPTR(s)$Lisp - dev: OpenMathDevice := OMopenString(sp pretend String, OMencodingXML()) - if wholeObj then - OMputObject(dev) - writeOMSingleInt(dev, x) - if wholeObj then - OMputEndObject(dev) - OMclose(dev) - s := OM_-STRINGPTRTOSTRING(sp)$Lisp pretend String - s - - OMwrite(dev: OpenMathDevice, x: %): Void == - OMputObject(dev) - writeOMSingleInt(dev, x) - OMputEndObject(dev) - - OMwrite(dev: OpenMathDevice, x: %, wholeObj: Boolean): Void == - if wholeObj then - OMputObject(dev) - writeOMSingleInt(dev, x) - if wholeObj then - OMputEndObject(dev) - reducedSystem(m: Matrix %) == m pretend Matrix(Integer) coerce(x):OutputForm == rep(x)::OutputForm convert(x:%):Integer == rep x diff --git a/src/algebra/string.spad.pamphlet b/src/algebra/string.spad.pamphlet index 2271f92b..6ad08dc3 100644 --- a/src/algebra/string.spad.pamphlet +++ b/src/algebra/string.spad.pamphlet @@ -493,7 +493,7 @@ the coercion. MINSTRINGINDEX ==> 1 -- as of 3/14/90. String(): Public == Private where - Public == Join(StringAggregate(), OpenMath) with + Public == StringAggregate with string: Integer -> % ++ \spad{string i} returns the decimal representation of ++ \spad{i} in a string @@ -505,42 +505,6 @@ String(): Public == Private where string(n: Integer) == %i2s n string(f: DoubleFloat) == %f2s(f)$Foreign(Builtin) - OMwrite(x: %): String == - s: String := "" - sp := OM_-STRINGTOSTRINGPTR(s)$Lisp - dev: OpenMathDevice := OMopenString(sp pretend String, OMencodingXML()) - OMputObject(dev) - OMputString(dev, x pretend String) - OMputEndObject(dev) - OMclose(dev) - s := OM_-STRINGPTRTOSTRING(sp)$Lisp pretend String - s - - OMwrite(x: %, wholeObj: Boolean): String == - s: String := "" - sp := OM_-STRINGTOSTRINGPTR(s)$Lisp - dev: OpenMathDevice := OMopenString(sp pretend String, OMencodingXML()) - if wholeObj then - OMputObject(dev) - OMputString(dev, x pretend String) - if wholeObj then - OMputEndObject(dev) - OMclose(dev) - s := OM_-STRINGPTRTOSTRING(sp)$Lisp pretend String - s - - OMwrite(dev: OpenMathDevice, x: %): Void == - OMputObject(dev) - OMputString(dev, x pretend String) - OMputEndObject(dev) - - OMwrite(dev: OpenMathDevice, x: %, wholeObj: Boolean): Void == - if wholeObj then - OMputObject(dev) - OMputString(dev, x pretend String) - if wholeObj then - OMputEndObject(dev) - @ \section{License} diff --git a/src/algebra/symbol.spad.pamphlet b/src/algebra/symbol.spad.pamphlet index 67539450..7f80ecdb 100644 --- a/src/algebra/symbol.spad.pamphlet +++ b/src/algebra/symbol.spad.pamphlet @@ -22,7 +22,7 @@ Symbol(): Exports == Implementation where L ==> List OutputForm Scripts ==> Record(sub:L,sup:L,presup:L,presub:L,args:L) - Exports ==> Join(OrderedSet, ConvertibleTo InputForm, OpenMath, + Exports ==> Join(OrderedSet, ConvertibleTo InputForm, ConvertibleTo Symbol,CoercibleFrom String, ConvertibleTo Pattern Integer, ConvertibleTo Pattern Float, PatternMatchable Integer, PatternMatchable Float) with @@ -82,47 +82,6 @@ Symbol(): Exports == Implementation where ALPHAS:String:="ABCDEFGHIJKLMNOPQRSTUVWXYZ" alphas:String:="abcdefghijklmnopqrstuvwxyz" - writeOMSym(dev: OpenMathDevice, x: %): Void == - scripted? x => - error "Cannot convert a scripted symbol to OpenMath" - OMputVariable(dev, x pretend Symbol) - - OMwrite(x: %): String == - s: String := "" - sp := OM_-STRINGTOSTRINGPTR(s)$Lisp - dev: OpenMathDevice := OMopenString(sp pretend String, OMencodingXML()) - OMputObject(dev) - writeOMSym(dev, x) - OMputEndObject(dev) - OMclose(dev) - s := OM_-STRINGPTRTOSTRING(sp)$Lisp pretend String - s - - OMwrite(x: %, wholeObj: Boolean): String == - s: String := "" - sp := OM_-STRINGTOSTRINGPTR(s)$Lisp - dev: OpenMathDevice := OMopenString(sp pretend String, OMencodingXML()) - if wholeObj then - OMputObject(dev) - writeOMSym(dev, x) - if wholeObj then - OMputEndObject(dev) - OMclose(dev) - s := OM_-STRINGPTRTOSTRING(sp)$Lisp pretend String - s - - OMwrite(dev: OpenMathDevice, x: %): Void == - OMputObject(dev) - writeOMSym(dev, x) - OMputEndObject(dev) - - OMwrite(dev: OpenMathDevice, x: %, wholeObj: Boolean): Void == - if wholeObj then - OMputObject(dev) - writeOMSym(dev, x) - if wholeObj then - OMputEndObject(dev) - hd:String := "*" lhd := #hd ord0 := ord char("0")$Character |