aboutsummaryrefslogtreecommitdiff
path: root/src/algebra
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2011-08-10 16:50:47 +0000
committerdos-reis <gdr@axiomatics.org>2011-08-10 16:50:47 +0000
commite6b1636fe3b19b148f347f6b9f00642db83c5ddc (patch)
tree79d6b46a38a96ac51ad2396fb137a163eb3a7f65 /src/algebra
parent0a0661e0c50e9c3e160d54b8e0a5b891d419e2bc (diff)
downloadopen-axiom-e6b1636fe3b19b148f347f6b9f00642db83c5ddc.tar.gz
* algebra/Makefile.in (oa_strap_0_sources): Don't include OM.
(axiom_algebra_layer_0): Don't include OM, OMCONN, OMDEV. (axiom_algebra_layer_4): Don't include OMENC. (axiom_algebra_layer_14): Don't include OMPKG. (axiom_algebra_layer_19): Don't include OMERR, OMERRK. (axiom_algebra_layer_20): Don't include OMEXPR. * algebra/omcat.spad.pamphlet: Remove. * algebra/omdev.spad.pamphlet: Remove. * algebra/omerror.spad.pamphlet: Remove. * algebra/omserver.spad.pamphlet: Remove. * algebra/openmath.spad.pamphlet: Remove.
Diffstat (limited to 'src/algebra')
-rw-r--r--src/algebra/Makefile.in21
-rw-r--r--src/algebra/exposed.lsp.pamphlet9
-rw-r--r--src/algebra/omcat.spad.pamphlet85
-rw-r--r--src/algebra/omdev.spad.pamphlet397
-rw-r--r--src/algebra/omerror.spad.pamphlet150
-rw-r--r--src/algebra/omserver.spad.pamphlet122
-rw-r--r--src/algebra/openmath.spad.pamphlet331
7 files changed, 9 insertions, 1106 deletions
diff --git a/src/algebra/Makefile.in b/src/algebra/Makefile.in
index 0f52ada6..bb7f11e7 100644
--- a/src/algebra/Makefile.in
+++ b/src/algebra/Makefile.in
@@ -113,7 +113,7 @@ oa_strap_0_sources = \
RNG SRING RING ORDRING LMODULE RMODULE BMODULE \
COMRING ENTIRER ALGEBRA MODULE DIVRING FIELD \
DIFFSPC DIFFDOM DIFRING LINEXP PATMAB CFCAT REAL \
- INTDOM GCDDOM PID UFD OINTDOM INS OM \
+ INTDOM GCDDOM PID UFD OINTDOM INS \
CHARZ CHARNZ STEP IEVALAB EVALAB \
AGG HOAGG CLAGG ELTAB ELTAGG IXAGG LNAGG \
FLAGG ELAGG RCAGG URAGG STAGG LSAGG A1AGG \
@@ -259,9 +259,8 @@ strap-0/FPATMAB.$(FASLEXT): strap-0/PATMAB.$(FASLEXT)
strap-0/BOOLEAN.$(FASLEXT): strap-0/ORDFIN.$(FASLEXT) \
strap-0/PROPLOG.$(FASLEXT) strap-0/KONVERT.$(FASLEXT)
-strap-0/OM.$(FASLEXT): strap-0/TYPE.$(FASLEXT)
strap-0/INT.$(FASLEXT): strap-0/INS.$(FASLEXT) \
- strap-0/KONVERT.$(FASLEXT) strap-0/OM.$(FASLEXT)
+ strap-0/KONVERT.$(FASLEXT)
strap-0/NNI.$(FASLEXT): strap-0/INT.$(FASLEXT)
strap-0/PI.$(FASLEXT): strap-0/NNI.$(FASLEXT)
@@ -617,9 +616,8 @@ SPADFILES= \
${OUTSRC}/numode.spad ${OUTSRC}/numquad.spad ${OUTSRC}/numsolve.spad \
${OUTSRC}/numtheor.spad \
${OUTSRC}/oct.spad ${OUTSRC}/odealg.spad ${OUTSRC}/odeef.spad \
- ${OUTSRC}/oderf.spad ${OUTSRC}/omcat.spad ${OUTSRC}/omdev.spad \
- ${OUTSRC}/omerror.spad ${OUTSRC}/omserver.spad ${OUTSRC}/opalg.spad \
- ${OUTSRC}/openmath.spad ${OUTSRC}/op.spad ${OUTSRC}/ore.spad \
+ ${OUTSRC}/oderf.spad ${OUTSRC}/opalg.spad \
+ ${OUTSRC}/op.spad ${OUTSRC}/ore.spad \
${OUTSRC}/outform.spad ${OUTSRC}/out.spad \
${OUTSRC}/pade.spad ${OUTSRC}/padiclib.spad ${OUTSRC}/padic.spad \
${OUTSRC}/paramete.spad ${OUTSRC}/partperm.spad ${OUTSRC}/patmatch1.spad \
@@ -819,7 +817,7 @@ axiom_algebra_layer_0 = \
AHYP ATTREG CFCAT ELTAB KOERCE KONVERT \
KRCFROM KVTFROM IEVALAB IEVALAB- EVALAB EVALAB- \
RETRACT RETRACT- SETCAT SETCAT- VOID SEGCAT \
- MSYSCMD FINITE OM OMCONN OMDEV OUT \
+ MSYSCMD FINITE OUT \
PRIMCAT PRINT PTRANFN SPFCAT TYPE UTYPE \
BMODULE BASTYPE BASTYPE- STEP LMODULE \
RMODULE ALGEBRA ALGEBRA- SGROUP SGROUP- ABELSG \
@@ -969,7 +967,7 @@ $(OUT)/PALETTE.$(FASLEXT): $(OUT)/COLOR.$(FASLEXT)
axiom_algebra_layer_4 = \
ANON OSI COMM COMPPROP ESCONT1 EXIT \
FAMONC FORMULA1 IDPC NONE NUMINT \
- ODECAT COLOR OMENC ONECOMP2 OPTCAT \
+ ODECAT COLOR ONECOMP2 OPTCAT \
PALETTE PARPCURV PARPC2 PARSCURV PARSC2 PARSURF \
PARSU2 PATRES2 PATTERN1 PDECAT \
REPSQ REPDB RFDIST RIDIST SPACEC SPLNODE \
@@ -1225,7 +1223,7 @@ axiom_algebra_layer_14 = \
MPC2 MPC3 MPOLY MPRFF \
MRATFAC MULTSQFR NORMRETR NPCOEF \
NSUP NTPOLFN ODP ODEPRIM \
- ODEPRRIC OMPKG PADEPAC \
+ ODEPRRIC PADEPAC \
PADICRAT PADICRC PCOMP PDECOMP \
PF PFBR PFBRU PFOTOOLS \
PFRPAC PGCD PINTERPA PLEQN \
@@ -1325,7 +1323,6 @@ axiom_algebra_layer_18_objects = \
$(OUT)/TSETCAT.$(FASLEXT): $(OUT)/PSETCAT.$(FASLEXT) $(OUT)/RPOLCAT.$(FASLEXT)
$(OUT)/FPARFRAC.$(FASLEXT): $(OUT)/DIFFSPC.$(FASLEXT)
$(OUT)/FEXPR.$(FASLEXT): $(OUT)/EXPR.$(FASLEXT)
-$(OUT)/OMERR.$(FASLEXT): $(OUT)/OMERRK.$(FASLEXT)
axiom_algebra_layer_19 = \
ACPLOT ANTISYM ATTRBUT \
@@ -1344,7 +1341,7 @@ axiom_algebra_layer_19 = \
NAGC06 NAGD03 NAGE01 NAGE02 \
NAGE04 NAGF07 NAGS NAGSP \
NREP NUMFMT OC OC- \
- ODEPACK ODERAT OMERR OMERRK \
+ ODEPACK ODERAT \
OPTPACK PATTERN OVAR \
PMKERNEL PMSYM PRIMELT \
QALGSET2 QEQUAT RECLOS REP1 \
@@ -1385,7 +1382,7 @@ axiom_algebra_layer_20 = \
INTAF INTALG INTEF INTG0 \
INTHERAL INTPAF INTPM INTTOOLS \
ITRIGMNP JORDAN KOVACIC LF \
- LIE LODOF LSQM OMEXPR \
+ LIE LODOF LSQM \
MCMPLX MULTFACT NAGD01 NAGD02 \
NAGF01 NAGF02 NAGF04 NCEP \
NLINSOL NSMP NUMERIC OCT \
diff --git a/src/algebra/exposed.lsp.pamphlet b/src/algebra/exposed.lsp.pamphlet
index 2b24b303..97cdea86 100644
--- a/src/algebra/exposed.lsp.pamphlet
+++ b/src/algebra/exposed.lsp.pamphlet
@@ -145,7 +145,6 @@
(|ExpressionFunctions2| . EXPR2)
(|ExpressionSpaceFunctions2| . ES2)
(|ExpressionSpaceODESolver| . EXPRODE)
- (|ExpressionToOpenMath| . OMEXPR)
(|ExpressionToUnivariatePowerSeries| . EXPR2UPS)
(|Factored| . FR)
(|FactoredFunctions2| . FR2)
@@ -287,13 +286,6 @@
(|OneDimensionalArrayFunctions2| . ARRAY12)
(|OnePointCompletion| . ONECOMP)
(|OnePointCompletionFunctions2| . ONECOMP2)
- (|OpenMathConnection| . OMCONN)
- (|OpenMathDevice| . OMDEV)
- (|OpenMathEncoding| . OMENC)
- (|OpenMathError| . OMERR)
- (|OpenMathErrorKind| . OMERRK)
- (|OpenMathPackage| . OMPKG)
- (|OpenMathServerPackage| . OMSERVER)
(|OperationsQuery| . OPQUERY)
(|OrderedCompletion| . ORDCOMP)
(|OrderedCompletionFunctions2| . ORDCOMP2)
@@ -722,7 +714,6 @@
(|Object| . OBJECT)
(|OctonionCategory| . OC)
(|OneDimensionalArrayAggregate| . A1AGG)
- (|OpenMath| . OM)
(|OperatorCategory| . OPERCAT)
(|OrderedAbelianGroup| . OAGROUP)
(|OrderedAbelianMonoid| . OAMON)
diff --git a/src/algebra/omcat.spad.pamphlet b/src/algebra/omcat.spad.pamphlet
deleted file mode 100644
index 638aa325..00000000
--- a/src/algebra/omcat.spad.pamphlet
+++ /dev/null
@@ -1,85 +0,0 @@
-\documentclass{article}
-\usepackage{open-axiom}
-\begin{document}
-\title{\$SPAD/src/algebra omcat.spad}
-\author{Mike Dewar, Vilya Harvey}
-\maketitle
-\begin{abstract}
-\end{abstract}
-\eject
-\tableofcontents
-\eject
-\section{category OM OpenMath}
-<<category OM OpenMath>>=
-)abbrev category OM OpenMath
-++ Author: Mike Dewar & Vilya Harvey
-++ Basic Functions: OMwrite
-++ Related Constructors:
-++ Also See:
-++ AMS Classifications:
-++ Keywords:
-++ References:
-++ Description:
-++ \spadtype{OpenMath} provides operations for exporting an object
-++ in OpenMath format.
-
-OpenMath(): Category == with
- OMwrite : % -> String
- ++ OMwrite(u) returns the OpenMath XML encoding of \axiom{u} as a
- ++ complete OpenMath object.
- OMwrite : (%, Boolean) -> String
- ++ OMwrite(u, true) returns the OpenMath XML encoding of \axiom{u}
- ++ as a complete OpenMath object; OMwrite(u, false) returns the
- ++ OpenMath XML encoding of \axiom{u} as an OpenMath fragment.
- OMwrite : (OpenMathDevice, %) -> Void
- ++ OMwrite(dev, u) writes the OpenMath form of \axiom{u} to the
- ++ OpenMath device \axiom{dev} as a complete OpenMath object.
- OMwrite : (OpenMathDevice, %, Boolean) -> Void
- ++ OMwrite(dev, u, true) writes the OpenMath form of \axiom{u} to
- ++ the OpenMath device \axiom{dev} as a complete OpenMath object;
- ++ OMwrite(dev, u, false) writes the object as an OpenMath fragment.
-
-@
-\section{License}
-<<license>>=
---Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd.
---All rights reserved.
---
---Redistribution and use in source and binary forms, with or without
---modification, are permitted provided that the following conditions are
---met:
---
--- - Redistributions of source code must retain the above copyright
--- notice, this list of conditions and the following disclaimer.
---
--- - Redistributions in binary form must reproduce the above copyright
--- notice, this list of conditions and the following disclaimer in
--- the documentation and/or other materials provided with the
--- distribution.
---
--- - Neither the name of The Numerical ALgorithms Group Ltd. nor the
--- names of its contributors may be used to endorse or promote products
--- derived from this software without specific prior written permission.
---
---THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
---IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
---TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
---PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
---OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
---EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
---PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
---PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
---LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
---NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
---SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-@
-<<*>>=
-<<license>>
-
-<<category OM OpenMath>>
-@
-\eject
-\begin{thebibliography}{99}
-\bibitem{1} nothing
-\end{thebibliography}
-\end{document}
diff --git a/src/algebra/omdev.spad.pamphlet b/src/algebra/omdev.spad.pamphlet
deleted file mode 100644
index d2897a37..00000000
--- a/src/algebra/omdev.spad.pamphlet
+++ /dev/null
@@ -1,397 +0,0 @@
-\documentclass{article}
-\usepackage{open-axiom}
-\begin{document}
-\title{\$SPAD/src/algebra omdev.spad}
-\author{Vilya Harvey}
-\maketitle
-\begin{abstract}
-\end{abstract}
-\eject
-\tableofcontents
-\eject
-\section{domain OMENC OpenMathEncoding}
-<<domain OMENC OpenMathEncoding>>=
-)abbrev domain OMENC OpenMathEncoding
-++ Author: Vilya Harvey
-++ Date Created:
-++ Date Last Updated:
-++ Basic Functions:
-++ Related Constructors:
-++ Also See:
-++ AMS Classifications:
-++ Keywords:
-++ References:
-++ Description:
-++ \spadtype{OpenMathEncoding} is the set of valid OpenMath encodings.
-OpenMathEncoding(): SetCategory with
- OMencodingUnknown : () -> %
- ++ OMencodingUnknown() is the constant for unknown encoding types. If this
- ++ is used on an input device, the encoding will be autodetected.
- ++ It is invalid to use it on an output device.
- OMencodingXML : () -> %
- ++ OMencodingXML() is the constant for the OpenMath XML encoding.
- OMencodingSGML : () -> %
- ++ OMencodingSGML() is the constant for the deprecated OpenMath SGML encoding.
- OMencodingBinary : () -> %
- ++ OMencodingBinary() is the constant for the OpenMath binary encoding.
- == add
- Rep := SingleInteger
-
- =(u,v) == (u=v)$Rep
-
- import Rep
-
- coerce(u) ==
- u::Rep = 0$Rep => "Unknown"::OutputForm
- u::Rep = 1$Rep => "Binary"::OutputForm
- u::Rep = 2::Rep => "XML"::OutputForm
- u::Rep = 3::Rep => "SGML"::OutputForm
- error "Bogus OpenMath Encoding Type"
-
- OMencodingUnknown(): % == 0::Rep
- OMencodingBinary(): % == 1::Rep
- OMencodingXML(): % == 2::Rep
- OMencodingSGML(): % == 3::Rep
-
-@
-\section{domain OMDEV OpenMathDevice}
-<<domain OMDEV OpenMathDevice>>=
-import Void
-import String
-import Integer
-import DoubleFloat
-import String
-import Symbol
-import OpenMathEncoding
-)abbrev domain OMDEV OpenMathDevice
-++ Author: Vilya Harvey
-++ Date Created:
-++ Date Last Updated:
-++ Basic Functions:
-++ Related Constructors:
-++ Also See:
-++ AMS Classifications:
-++ Keywords:
-++ References:
-++ Description: \spadtype{OpenMathDevice} provides support for reading
-++ and writing openMath objects to files, strings etc. It also provides
-++ access to low-level operations from within the interpreter.
-
-
-OpenMathDevice(): with
- OMopenFile : (String, String, OpenMathEncoding) -> %
- ++ OMopenFile(f,mode,enc) opens file \axiom{f} for reading or writing
- ++ OpenMath objects (depending on \axiom{mode} which can be "r", "w"
- ++ or "a" for read, write and append respectively), in the encoding
- ++ \axiom{enc}.
- OMopenString : (String, OpenMathEncoding) -> %
- ++ OMopenString(s,mode) opens the string \axiom{s} for reading or writing
- ++ OpenMath objects in encoding \axiom{enc}.
- OMclose : % -> Void
- ++ OMclose(dev) closes \axiom{dev}, flushing output if necessary.
- OMsetEncoding : (%, OpenMathEncoding) -> Void
- ++ OMsetEncoding(dev,enc) sets the encoding used for reading or writing
- ++ OpenMath objects to or from \axiom{dev} to \axiom{enc}.
- OMputApp : % -> Void
- ++ OMputApp(dev) writes a begin application token to \axiom{dev}.
- OMputAtp : % -> Void
- ++ OMputAtp(dev) writes a begin attribute pair token to \axiom{dev}.
- OMputAttr : % -> Void
- ++ OMputAttr(dev) writes a begin attribute token to \axiom{dev}.
- OMputBind : % -> Void
- ++ OMputBind(dev) writes a begin binder token to \axiom{dev}.
- OMputBVar : % -> Void
- ++ OMputBVar(dev) writes a begin bound variable list token to \axiom{dev}.
- OMputError : % -> Void
- ++ OMputError(dev) writes a begin error token to \axiom{dev}.
- OMputObject : % -> Void
- ++ OMputObject(dev) writes a begin object token to \axiom{dev}.
- OMputEndApp : % -> Void
- ++ OMputEndApp(dev) writes an end application token to \axiom{dev}.
- OMputEndAtp : % -> Void
- ++ OMputEndAtp(dev) writes an end attribute pair token to \axiom{dev}.
- OMputEndAttr : % -> Void
- ++ OMputEndAttr(dev) writes an end attribute token to \axiom{dev}.
- OMputEndBind : % -> Void
- ++ OMputEndBind(dev) writes an end binder token to \axiom{dev}.
- OMputEndBVar : % -> Void
- ++ OMputEndBVar(dev) writes an end bound variable list token to \axiom{dev}.
- OMputEndError : % -> Void
- ++ OMputEndError(dev) writes an end error token to \axiom{dev}.
- OMputEndObject: % -> Void
- ++ OMputEndObject(dev) writes an end object token to \axiom{dev}.
- OMputInteger : (%, Integer) -> Void
- ++ OMputInteger(dev,i) writes the integer \axiom{i} to \axiom{dev}.
- OMputFloat : (%, DoubleFloat) -> Void
- ++ OMputFloat(dev,i) writes the float \axiom{i} to \axiom{dev}.
- OMputVariable : (%, Symbol) -> Void
- ++ OMputVariable(dev,i) writes the variable \axiom{i} to \axiom{dev}.
- OMputString : (%, String) -> Void
- ++ OMputString(dev,i) writes the string \axiom{i} to \axiom{dev}.
- OMputSymbol : (%, String, String) -> Void
- ++ OMputSymbol(dev,cd,s) writes the symbol \axiom{s} from CD \axiom{cd}
- ++ to \axiom{dev}.
-
- OMgetApp : % -> Void
- ++ OMgetApp(dev) reads a begin application token from \axiom{dev}.
- OMgetAtp : % -> Void
- ++ OMgetAtp(dev) reads a begin attribute pair token from \axiom{dev}.
- OMgetAttr : % -> Void
- ++ OMgetAttr(dev) reads a begin attribute token from \axiom{dev}.
- OMgetBind : % -> Void
- ++ OMgetBind(dev) reads a begin binder token from \axiom{dev}.
- OMgetBVar : % -> Void
- ++ OMgetBVar(dev) reads a begin bound variable list token from \axiom{dev}.
- OMgetError : % -> Void
- ++ OMgetError(dev) reads a begin error token from \axiom{dev}.
- OMgetObject : % -> Void
- ++ OMgetObject(dev) reads a begin object token from \axiom{dev}.
- OMgetEndApp : % -> Void
- ++ OMgetEndApp(dev) reads an end application token from \axiom{dev}.
- OMgetEndAtp : % -> Void
- ++ OMgetEndAtp(dev) reads an end attribute pair token from \axiom{dev}.
- OMgetEndAttr : % -> Void
- ++ OMgetEndAttr(dev) reads an end attribute token from \axiom{dev}.
- OMgetEndBind : % -> Void
- ++ OMgetEndBind(dev) reads an end binder token from \axiom{dev}.
- OMgetEndBVar : % -> Void
- ++ OMgetEndBVar(dev) reads an end bound variable list token from \axiom{dev}.
- OMgetEndError : % -> Void
- ++ OMgetEndError(dev) reads an end error token from \axiom{dev}.
- OMgetEndObject: % -> Void
- ++ OMgetEndObject(dev) reads an end object token from \axiom{dev}.
- OMgetInteger : % -> Integer
- ++ OMgetInteger(dev) reads an integer from \axiom{dev}.
- OMgetFloat : % -> DoubleFloat
- ++ OMgetFloat(dev) reads a float from \axiom{dev}.
- OMgetVariable : % -> Symbol
- ++ OMgetVariable(dev) reads a variable from \axiom{dev}.
- OMgetString : % -> String
- ++ OMgetString(dev) reads a string from \axiom{dev}.
- OMgetSymbol : % -> Record(cd:String, name:String)
- ++ OMgetSymbol(dev) reads a symbol from \axiom{dev}.
-
- OMgetType : % -> Symbol
- ++ OMgetType(dev) returns the type of the next object on \axiom{dev}.
- == add
- OMopenFile(fname: String, fmode: String, enc: OpenMathEncoding): % ==
- OM_-OPENFILEDEV(fname, fmode, enc)$Lisp
- OMopenString(str: String, enc: OpenMathEncoding): % ==
- OM_-OPENSTRINGDEV(str, enc)$Lisp
- OMclose(dev: %): Void ==
- OM_-CLOSEDEV(dev)$Lisp
- OMsetEncoding(dev: %, enc: OpenMathEncoding): Void ==
- OM_-SETDEVENCODING(dev, enc)$Lisp
-
- OMputApp(dev: %): Void == OM_-PUTAPP(dev)$Lisp
- OMputAtp(dev: %): Void == OM_-PUTATP(dev)$Lisp
- OMputAttr(dev: %): Void == OM_-PUTATTR(dev)$Lisp
- OMputBind(dev: %): Void == OM_-PUTBIND(dev)$Lisp
- OMputBVar(dev: %): Void == OM_-PUTBVAR(dev)$Lisp
- OMputError(dev: %): Void == OM_-PUTERROR(dev)$Lisp
- OMputObject(dev: %): Void == OM_-PUTOBJECT(dev)$Lisp
- OMputEndApp(dev: %): Void == OM_-PUTENDAPP(dev)$Lisp
- OMputEndAtp(dev: %): Void == OM_-PUTENDATP(dev)$Lisp
- OMputEndAttr(dev: %): Void == OM_-PUTENDATTR(dev)$Lisp
- OMputEndBind(dev: %): Void == OM_-PUTENDBIND(dev)$Lisp
- OMputEndBVar(dev: %): Void == OM_-PUTENDBVAR(dev)$Lisp
- OMputEndError(dev: %): Void == OM_-PUTENDERROR(dev)$Lisp
- OMputEndObject(dev: %): Void == OM_-PUTENDOBJECT(dev)$Lisp
- OMputInteger(dev: %, i: Integer): Void == OM_-PUTINT(dev, i)$Lisp
- OMputFloat(dev: %, f: DoubleFloat): Void == OM_-PUTFLOAT(dev, f)$Lisp
- --OMputByteArray(dev: %, b: Array Byte): Void == OM_-PUTBYTEARRAY(dev, b)$Lisp
- OMputVariable(dev: %, v: Symbol): Void == OM_-PUTVAR(dev, v)$Lisp
- OMputString(dev: %, s: String): Void == OM_-PUTSTRING(dev, s)$Lisp
- OMputSymbol(dev: %, cd: String, nm: String): Void == OM_-PUTSYMBOL(dev, cd, nm)$Lisp
-
- OMgetApp(dev: %): Void == OM_-GETAPP(dev)$Lisp
- OMgetAtp(dev: %): Void == OM_-GETATP(dev)$Lisp
- OMgetAttr(dev: %): Void == OM_-GETATTR(dev)$Lisp
- OMgetBind(dev: %): Void == OM_-GETBIND(dev)$Lisp
- OMgetBVar(dev: %): Void == OM_-GETBVAR(dev)$Lisp
- OMgetError(dev: %): Void == OM_-GETERROR(dev)$Lisp
- OMgetObject(dev: %): Void == OM_-GETOBJECT(dev)$Lisp
- OMgetEndApp(dev: %): Void == OM_-GETENDAPP(dev)$Lisp
- OMgetEndAtp(dev: %): Void == OM_-GETENDATP(dev)$Lisp
- OMgetEndAttr(dev: %): Void == OM_-GETENDATTR(dev)$Lisp
- OMgetEndBind(dev: %): Void == OM_-GETENDBIND(dev)$Lisp
- OMgetEndBVar(dev: %): Void == OM_-GETENDBVAR(dev)$Lisp
- OMgetEndError(dev: %): Void == OM_-GETENDERROR(dev)$Lisp
- OMgetEndObject(dev: %): Void == OM_-GETENDOBJECT(dev)$Lisp
- OMgetInteger(dev: %): Integer == OM_-GETINT(dev)$Lisp
- OMgetFloat(dev: %): DoubleFloat == OM_-GETFLOAT(dev)$Lisp
- --OMgetByteArray(dev: %): Array Byte == OM_-GETBYTEARRAY(dev)$Lisp
- OMgetVariable(dev: %): Symbol == OM_-GETVAR(dev)$Lisp
- OMgetString(dev: %): String == OM_-GETSTRING(dev)$Lisp
- OMgetSymbol(dev: %): Record(cd:String, name:String) == OM_-GETSYMBOL(dev)$Lisp
-
- OMgetType(dev: %): Symbol == OM_-GETTYPE(dev)$Lisp
-
-@
-\section{domain OMCONN OpenMathConnection}
-<<domain OMCONN OpenMathConnection>>=
-import Void
-import Boolean
-import SingleInteger
-import String
-import OpenMathDevice
-)abbrev domain OMCONN OpenMathConnection
-++ Author: Vilya Harvey
-++ Date Created:
-++ Date Last Updated:
-++ Basic Functions:
-++ Related Constructors:
-++ Also See:
-++ AMS Classifications:
-++ Keywords:
-++ References:
-++ Description: \spadtype{OpenMathConnection} provides low-level functions
-++ for handling connections to and from \spadtype{OpenMathDevice}s.
-
-
-OpenMathConnection(): with
- OMmakeConn : SingleInteger -> % ++ \spad{OMmakeConn}
- OMcloseConn : % -> Void ++ \spad{OMcloseConn}
- OMconnInDevice: %-> OpenMathDevice ++ \spad{OMconnInDevice:}
- OMconnOutDevice: %-> OpenMathDevice ++ \spad{OMconnOutDevice:}
- OMconnectTCP : (%, String, SingleInteger) -> Boolean ++ \spad{OMconnectTCP}
- OMbindTCP : (%, SingleInteger) -> Boolean ++ \spad{OMbindTCP}
- == add
- OMmakeConn(timeout: SingleInteger): % == OM_-MAKECONN(timeout)$Lisp
- OMcloseConn(conn: %): Void == OM_-CLOSECONN(conn)$Lisp
-
- OMconnInDevice(conn: %): OpenMathDevice ==
- OM_-GETCONNINDEV(conn)$Lisp
- OMconnOutDevice(conn: %): OpenMathDevice ==
- OM_-GETCONNOUTDEV(conn)$Lisp
-
- OMconnectTCP(conn: %, host: String, port: SingleInteger): Boolean ==
- OM_-CONNECTTCP(conn, host, port)$Lisp
- OMbindTCP(conn: %, port: SingleInteger): Boolean ==
- OM_-BINDTCP(conn, port)$Lisp
-
-@
-\section{package OMPKG OpenMathPackage}
-<<package OMPKG OpenMathPackage>>=
-)abbrev package OMPKG OpenMathPackage
-++ Author: Vilya Harvey
-++ Date Created:
-++ Date Last Updated:
-++ Basic Functions:
-++ Related Constructors:
-++ Also See:
-++ AMS Classifications:
-++ Keywords:
-++ References:
-++ Description: \spadtype{OpenMathPackage} provides some simple utilities
-++ to make reading OpenMath objects easier.
-
-OpenMathPackage(): with
- OMread : OpenMathDevice -> Any
- ++ OMread(dev) reads an OpenMath object from \axiom{dev} and passes it
- ++ to AXIOM.
- OMreadFile : String -> Any
- ++ OMreadFile(f) reads an OpenMath object from \axiom{f} and passes it
- ++ to AXIOM.
- OMreadStr : String -> Any
- ++ OMreadStr(f) reads an OpenMath object from \axiom{f} and passes it
- ++ to AXIOM.
- OMlistCDs : () -> List(String)
- ++ OMlistCDs() lists all the CDs supported by AXIOM.
- OMlistSymbols : String -> List(String)
- ++ OMlistSymbols(cd) lists all the symbols in \axiom{cd}.
- OMsupportsCD? : String -> Boolean
- ++ OMsupportsCD?(cd) returns true if AXIOM supports \axiom{cd}, false
- ++ otherwise.
- OMsupportsSymbol? : (String, String) -> Boolean
- ++ OMsupportsSymbol?(s,cd) returns true if AXIOM supports symbol \axiom{s}
- ++ from CD \axiom{cd}, false otherwise.
- OMunhandledSymbol : (String, String) -> Exit
- ++ OMunhandledSymbol(s,cd) raises an error if AXIOM reads a symbol which it
- ++ is unable to handle. Note that this is different from an unexpected
- ++ symbol.
- == add
- import OpenMathEncoding
- import OpenMathDevice
- import String
-
- OMunhandledSymbol(u,v) ==
- error concat ["AXIOM is unable to process the symbol ",u," from CD ",v,"."]
-
- OMread(dev: OpenMathDevice): Any ==
- interpret(OM_-READ(dev)$Lisp :: InputForm)
-
- OMreadFile(filename: String): Any ==
- dev := OMopenFile(filename, "r", OMencodingUnknown())
- res: Any := interpret(OM_-READ(dev)$Lisp :: InputForm)
- OMclose(dev)
- res
-
- OMreadStr(str: String): Any ==
- strp := OM_-STRINGTOSTRINGPTR(str)$Lisp
- dev := OMopenString(strp pretend String, OMencodingUnknown())
- res: Any := interpret(OM_-READ(dev)$Lisp :: InputForm)
- OMclose(dev)
- res
-
- OMlistCDs(): List(String) ==
- OM_-LISTCDS()$Lisp pretend List(String)
-
- OMlistSymbols(cd: String): List(String) ==
- OM_-LISTSYMBOLS(cd)$Lisp pretend List(String)
-
- import SExpression
-
- OMsupportsCD?(cd: String): Boolean ==
- not null? OM_-SUPPORTSCD(cd)$Lisp
-
- OMsupportsSymbol?(cd: String, name: String): Boolean ==
- not null? OM_-SUPPORTSSYMBOL(cd, name)$Lisp
-
-@
-\section{License}
-<<license>>=
---Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd.
---All rights reserved.
---
---Redistribution and use in source and binary forms, with or without
---modification, are permitted provided that the following conditions are
---met:
---
--- - Redistributions of source code must retain the above copyright
--- notice, this list of conditions and the following disclaimer.
---
--- - Redistributions in binary form must reproduce the above copyright
--- notice, this list of conditions and the following disclaimer in
--- the documentation and/or other materials provided with the
--- distribution.
---
--- - Neither the name of The Numerical ALgorithms Group Ltd. nor the
--- names of its contributors may be used to endorse or promote products
--- derived from this software without specific prior written permission.
---
---THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
---IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
---TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
---PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
---OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
---EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
---PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
---PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
---LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
---NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
---SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-@
-<<*>>=
-<<license>>
-
-<<domain OMENC OpenMathEncoding>>
-<<domain OMDEV OpenMathDevice>>
-<<domain OMCONN OpenMathConnection>>
-<<package OMPKG OpenMathPackage>>
-@
-\eject
-\begin{thebibliography}{99}
-\bibitem{1} nothing
-\end{thebibliography}
-\end{document}
diff --git a/src/algebra/omerror.spad.pamphlet b/src/algebra/omerror.spad.pamphlet
deleted file mode 100644
index 50843010..00000000
--- a/src/algebra/omerror.spad.pamphlet
+++ /dev/null
@@ -1,150 +0,0 @@
-\documentclass{article}
-\usepackage{open-axiom}
-\begin{document}
-\title{\$SPAD/src/algebra omerror.spad}
-\author{Vilya Harvey}
-\maketitle
-\begin{abstract}
-\end{abstract}
-\eject
-\tableofcontents
-\eject
-\section{domain OMERRK OpenMathErrorKind}
-<<domain OMERRK OpenMathErrorKind>>=
-)abbrev domain OMERRK OpenMathErrorKind
-++ Author: Vilya Harvey
-++ Date Created:
-++ Date Last Updated:
-++ Basic Functions:
-++ Related Constructors:
-++ Also See:
-++ AMS Classifications:
-++ Keywords:
-++ References:
-++ Description: \spadtype{OpenMathErrorKind} represents different kinds
-++ of OpenMath errors: specifically parse errors, unknown CD or symbol
-++ errors, and read errors.
-OpenMathErrorKind() : SetCategory with
- coerce : Symbol -> %
- ++ coerce(u) creates an OpenMath error object of an appropriate type if
- ++ \axiom{u} is one of \axiom{OMParseError}, \axiom{OMReadError},
- ++ \axiom{OMUnknownCD} or \axiom{OMUnknownSymbol}, otherwise it
- ++ raises a runtime error.
- OMParseError? : % -> Boolean
- ++ OMParseError?(u) tests whether u is an OpenMath parsing error.
- OMUnknownCD? : % -> Boolean
- ++ OMUnknownCD?(u) tests whether u is an OpenMath unknown CD error.
- OMUnknownSymbol? : % -> Boolean
- ++ OMUnknownSymbol?(u) tests whether u is an OpenMath unknown symbol error.
- OMReadError? : % -> Boolean
- ++ OMReadError?(u) tests whether u is an OpenMath read error.
- == add
- Rep := Union(parseError:"OMParseError", unknownCD:"OMUnknownCD",
- unknownSymbol:"OMUnknownSymbol",readError:"OMReadError")
-
- OMParseError?(u) == (u case parseError)$Rep
- OMUnknownCD?(u) == (u case unknownCD)$Rep
- OMUnknownSymbol?(u) == (u case unknownSymbol)$Rep
- OMReadError?(u) == (u case readError)$Rep
-
- coerce(s:Symbol):% ==
- s = OMParseError => ["OMParseError"]$Rep
- s = OMUnknownCD => ["OMUnknownCD"]$Rep
- s = OMUnknownSymbol => ["OMUnknownSymbol"]$Rep
- s = OMReadError => ["OMReadError"]$Rep
- error concat(string s, " is not a valid OpenMathErrorKind.")
-
- a = b == (a=b)$Rep
-
- coerce(e:%):OutputForm == coerce(e)$Rep
-
-@
-\section{domain OMERR OpenMathError}
-<<domain OMERR OpenMathError>>=
-)abbrev domain OMERR OpenMathError
-++ Author: Vilya Harvey
-++ Date Created:
-++ Date Last Updated:
-++ Basic Functions:
-++ Related Constructors:
-++ Also See:
-++ AMS Classifications:
-++ Keywords:
-++ References:
-++ Description: \spadtype{OpenMathError} is the domain of OpenMath errors.
-OpenMathError() : SetCategory with
- errorKind : % -> OpenMathErrorKind
- ++ errorKind(u) returns the type of error which u represents.
- errorInfo : % -> List Symbol
- ++ errorInfo(u) returns information about the error u.
- omError : (OpenMathErrorKind, List Symbol) -> %
- ++ omError(k,l) creates an instance of OpenMathError.
- == add
- Rep := Record(err:OpenMathErrorKind, info:List Symbol)
-
- import List String
-
- coerce(e:%):OutputForm ==
- OMParseError? e.err => message "Error parsing OpenMath object"
- infoSize := #(e.info)
- OMUnknownCD? e.err =>
- not one? infoSize => error "Malformed info list in OMUnknownCD"
- message concat("Cannot handle CD ",string first e.info)
- OMUnknownSymbol? e.err =>
- not 2=infoSize => error "Malformed info list in OMUnknownSymbol"
- message concat ["Cannot handle Symbol ",
- string e.info.2, " from CD ", string e.info.1]
- OMReadError? e.err =>
- message "OpenMath read error"
- error "Malformed OpenMath Error"
-
- omError(e:OpenMathErrorKind,i:List Symbol):% == [e,i]$Rep
-
- errorKind(e:%):OpenMathErrorKind == e.err
- errorInfo(e:%):List Symbol == e.info
-
-@
-\section{License}
-<<license>>=
---Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd.
---All rights reserved.
---
---Redistribution and use in source and binary forms, with or without
---modification, are permitted provided that the following conditions are
---met:
---
--- - Redistributions of source code must retain the above copyright
--- notice, this list of conditions and the following disclaimer.
---
--- - Redistributions in binary form must reproduce the above copyright
--- notice, this list of conditions and the following disclaimer in
--- the documentation and/or other materials provided with the
--- distribution.
---
--- - Neither the name of The Numerical ALgorithms Group Ltd. nor the
--- names of its contributors may be used to endorse or promote products
--- derived from this software without specific prior written permission.
---
---THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
---IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
---TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
---PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
---OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
---EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
---PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
---PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
---LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
---NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
---SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-@
-<<*>>=
-<<license>>
-
-<<domain OMERRK OpenMathErrorKind>>
-<<domain OMERR OpenMathError>>
-@
-\eject
-\begin{thebibliography}{99}
-\bibitem{1} nothing
-\end{thebibliography}
-\end{document}
diff --git a/src/algebra/omserver.spad.pamphlet b/src/algebra/omserver.spad.pamphlet
deleted file mode 100644
index cd09ad27..00000000
--- a/src/algebra/omserver.spad.pamphlet
+++ /dev/null
@@ -1,122 +0,0 @@
-\documentclass{article}
-\usepackage{open-axiom}
-\begin{document}
-\title{\$SPAD/src/algebra omserver.spad}
-\author{Vilya Harvey}
-\maketitle
-\begin{abstract}
-\end{abstract}
-\eject
-\tableofcontents
-\eject
-\section{package OMSERVER OpenMathServerPackage}
-<<package OMSERVER OpenMathServerPackage>>=
-)abbrev package OMSERVER OpenMathServerPackage
-++ Author: Vilya Harvey
-++ Date Created:
-++ Date Last Updated:
-++ Basic Functions:
-++ Related Constructors:
-++ Also See:
-++ AMS Classifications:
-++ Keywords:
-++ References:
-++ Description: \spadtype{OpenMathServerPackage} provides the necessary
-++ operations to run AXIOM as an OpenMath server, reading/writing objects
-++ to/from a port. Please note the facilities available here are very basic.
-++ The idea is that a user calls e.g. \axiom{Omserve(4000,60)} and then
-++ another process sends OpenMath objects to port 4000 and reads the result.
-
-OpenMathServerPackage(): with
- OMreceive : OpenMathConnection -> Any
- ++ OMreceive(c) reads an OpenMath object from connection \axiom{c} and
- ++ returns the appropriate AXIOM object.
- OMsend : (OpenMathConnection, Any) -> Void
- ++ OMsend(c,u) attempts to output \axiom{u} on \aciom{c} in OpenMath.
- OMserve : (SingleInteger, SingleInteger) -> Void
- ++ OMserve(portnum,timeout) puts AXIOM into server mode on port number
- ++ \axiom{portnum}. The parameter \axiom{timeout} specifies the timeout
- ++ period for the connection.
- == add
- import OpenMathDevice
- import OpenMathConnection
- import OpenMathPackage
- import OpenMath
-
-
-
- OMreceive(conn: OpenMathConnection): Any ==
- dev: OpenMathDevice := OMconnInDevice(conn)
- OMsetEncoding(dev, OMencodingUnknown());
- OMread(dev)
-
- OMsend(conn: OpenMathConnection, value: Any): Void ==
- dev: OpenMathDevice := OMconnOutDevice(conn)
- OMsetEncoding(dev, OMencodingXML());
- --retractable?(value)$AnyFunctions1(Expression Integer) =>
- -- OMwrite(dev, retract(value)$AnyFunctions1(Expression Integer), true)
- retractable?(value)$AnyFunctions1(Integer) =>
- OMwrite(dev, retract(value)$AnyFunctions1(Integer), true)
- retractable?(value)$AnyFunctions1(Float) =>
- OMwrite(dev, retract(value)$AnyFunctions1(Float), true)
- retractable?(value)$AnyFunctions1(SingleInteger) =>
- OMwrite(dev, retract(value)$AnyFunctions1(SingleInteger), true)
- retractable?(value)$AnyFunctions1(DoubleFloat) =>
- OMwrite(dev, retract(value)$AnyFunctions1(DoubleFloat), true)
- retractable?(value)$AnyFunctions1(String) =>
- OMwrite(dev, retract(value)$AnyFunctions1(String), true)
-
- OMserve(portNum: SingleInteger, timeout: SingleInteger): Void ==
- conn: OpenMathConnection := OMmakeConn(timeout)
- OMbindTCP(conn, portNum)
- val: Any
- while true repeat
- val := OMreceive(conn)
- OMsend(conn, val)
-
-@
-\section{License}
-<<license>>=
---Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd.
---All rights reserved.
--- Copyright (C) 2007-2010, Gabriel Dos Reis.
--- All rights reserved.
---
---Redistribution and use in source and binary forms, with or without
---modification, are permitted provided that the following conditions are
---met:
---
--- - Redistributions of source code must retain the above copyright
--- notice, this list of conditions and the following disclaimer.
---
--- - Redistributions in binary form must reproduce the above copyright
--- notice, this list of conditions and the following disclaimer in
--- the documentation and/or other materials provided with the
--- distribution.
---
--- - Neither the name of The Numerical ALgorithms Group Ltd. nor the
--- names of its contributors may be used to endorse or promote products
--- derived from this software without specific prior written permission.
---
---THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
---IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
---TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
---PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
---OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
---EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
---PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
---PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
---LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
---NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
---SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-@
-<<*>>=
-<<license>>
-
-<<package OMSERVER OpenMathServerPackage>>
-@
-\eject
-\begin{thebibliography}{99}
-\bibitem{1} nothing
-\end{thebibliography}
-\end{document}
diff --git a/src/algebra/openmath.spad.pamphlet b/src/algebra/openmath.spad.pamphlet
index 24a53ae4..e69de29b 100644
--- a/src/algebra/openmath.spad.pamphlet
+++ b/src/algebra/openmath.spad.pamphlet
@@ -1,331 +0,0 @@
-\documentclass{article}
-\usepackage{open-axiom}
-\begin{document}
-\title{\$SPAD/src/algebra openmath.spad}
-\author{Mike Dewar, Vilya Harvey}
-\maketitle
-\begin{abstract}
-\end{abstract}
-\eject
-\tableofcontents
-\eject
-\section{package OMEXPR ExpressionToOpenMath}
-<<package OMEXPR ExpressionToOpenMath>>=
-)abbrev package OMEXPR ExpressionToOpenMath
-++ Author: Mike Dewar & Vilya Harvey
-++ Date Created:
-++ Date Last Updated:
-++ Basic Functions:
-++ Related Constructors:
-++ Also See:
-++ AMS Classifications:
-++ Keywords:
-++ References:
-++ Description: \spadtype{ExpressionToOpenMath} provides support for
-++ converting objects of type \spadtype{Expression} into OpenMath.
-ExpressionToOpenMath(R: Join(OpenMath, Ring)): with
- OMwrite : Expression R -> String
- OMwrite : (Expression R, Boolean) -> String
- OMwrite : (OpenMathDevice, Expression R) -> Void
- OMwrite : (OpenMathDevice, Expression R, Boolean) -> Void
- == add
- import Expression R
- SymInfo ==> Record(cd:String, name:String)
- import SymInfo
- import Record(key: Symbol, entry: SymInfo)
- import AssociationList(Symbol, SymInfo)
- import OMENC
-
- ----------------------------
- -- Local translation tables.
- ----------------------------
-
- nullaryFunctionAList : AssociationList(Symbol, SymInfo) := construct [_
- [pi, ["nums1", "pi"]] ]
-
- unaryFunctionAList : AssociationList(Symbol, SymInfo) := construct [_
- [exp, ["transc1", "exp"]],_
- [log, ["transc1", "ln"]],_
- [sin, ["transc1", "sin"]],_
- [cos, ["transc1", "cos"]],_
- [tan, ["transc1", "tan"]],_
- [cot, ["transc1", "cot"]],_
- [sec, ["transc1", "sec"]],_
- [csc, ["transc1", "csc"]],_
- [asin, ["transc1", "arcsin"]],_
- [acos, ["transc1", "arccos"]],_
- [atan, ["transc1", "arctan"]],_
- [acot, ["transc1", "arccot"]],_
- [asec, ["transc1", "arcsec"]],_
- [acsc, ["transc1", "arccsc"]],_
- [sinh, ["transc1", "sinh"]],_
- [cosh, ["transc1", "cosh"]],_
- [tanh, ["transc1", "tanh"]],_
- [coth, ["transc1", "coth"]],_
- [sech, ["transc1", "sech"]],_
- [csch, ["transc1", "csch"]],_
- [asinh, ["transc1", "arcsinh"]],_
- [acosh, ["transc1", "arccosh"]],_
- [atanh, ["transc1", "arctanh"]],_
- [acoth, ["transc1", "arccoth"]],_
- [asech, ["transc1", "arcsech"]],_
- [acsch, ["transc1", "arccsch"]],_
- [factorial, ["integer1", "factorial"]],_
- [abs, ["arith1", "abs"]] ]
-
- -- Still need the following unary functions:
- -- digamma
- -- Gamma
- -- airyAi
- -- airyBi
- -- erf
- -- Ei
- -- Si
- -- Ci
- -- li
- -- dilog
-
- -- Still need the following binary functions:
- -- Gamma(a, x)
- -- Beta(x,y)
- -- polygamma(k,x)
- -- besselJ(v,x)
- -- besselY(v,x)
- -- besselI(v,x)
- -- besselK(v,x)
- -- permutation(n, m)
- -- summation(x:%, n:Symbol) : as opposed to "definite" sum
- -- product(x:%, n:Symbol) : ditto
-
- ------------------------
- -- Forward declarations.
- ------------------------
-
- outputOMExpr : (OpenMathDevice, Expression R) -> Void
-
- -------------------------
- -- Local helper functions
- -------------------------
-
- outputOMArith1(dev: OpenMathDevice, sym: String, args: List Expression R): Void ==
- OMputApp(dev)
- OMputSymbol(dev, "arith1", sym)
- for arg in args repeat
- OMwrite(dev, arg, false)
- OMputEndApp(dev)
-
- outputOMLambda(dev: OpenMathDevice, ex: Expression R, var: Expression R): Void ==
- OMputBind(dev)
- OMputSymbol(dev, "fns1", "lambda")
- OMputBVar(dev)
- OMwrite(dev, var, false)
- OMputEndBVar(dev)
- OMwrite(dev, ex, false)
- OMputEndBind(dev)
-
- outputOMInterval(dev: OpenMathDevice, lo: Expression R, hi: Expression R): Void ==
- OMputApp(dev)
- OMputSymbol(dev, "interval1", "interval")
- OMwrite(dev, lo, false)
- OMwrite(dev, hi, false)
- OMputEndApp(dev)
-
- outputOMIntInterval(dev: OpenMathDevice, lo: Expression R, hi: Expression R): Void ==
- OMputApp(dev)
- OMputSymbol(dev, "interval1", "integer__interval")
- OMwrite(dev, lo, false)
- OMwrite(dev, hi, false)
- OMputEndApp(dev)
-
- outputOMBinomial(dev: OpenMathDevice, args: List Expression R): Void ==
- not #args=2 => error "Wrong number of arguments to binomial"
- OMputApp(dev)
- OMputSymbol(dev, "combinat1", "binomial")
- for arg in args repeat
- OMwrite(dev, arg, false)
- OMputEndApp(dev)
-
- outputOMPower(dev: OpenMathDevice, args: List Expression R): Void ==
- not #args=2 => error "Wrong number of arguments to power"
- outputOMArith1(dev, "power", args)
-
- outputOMDefsum(dev: OpenMathDevice, args: List Expression R): Void ==
- #args ~= 5 => error "Unexpected number of arguments to a defsum"
- OMputApp(dev)
- OMputSymbol(dev, "arith1", "sum")
- outputOMIntInterval(dev, args.4, args.5)
- outputOMLambda(dev, eval(args.1, args.2, args.3), args.3)
- OMputEndApp(dev)
-
- outputOMDefprod(dev: OpenMathDevice, args: List Expression R): Void ==
- #args ~= 5 => error "Unexpected number of arguments to a defprod"
- OMputApp(dev)
- OMputSymbol(dev, "arith1", "product")
- outputOMIntInterval(dev, args.4, args.5)
- outputOMLambda(dev, eval(args.1, args.2, args.3), args.3)
- OMputEndApp(dev)
-
- outputOMDefint(dev: OpenMathDevice, args: List Expression R): Void ==
- #args ~= 5 => error "Unexpected number of arguments to a defint"
- OMputApp(dev)
- OMputSymbol(dev, "calculus1", "defint")
- outputOMInterval(dev, args.4, args.5)
- outputOMLambda(dev, eval(args.1, args.2, args.3), args.3)
- OMputEndApp(dev)
-
- outputOMInt(dev: OpenMathDevice, args: List Expression R): Void ==
- #args ~= 3 => error "Unexpected number of arguments to a defint"
- OMputApp(dev)
- OMputSymbol(dev, "calculus1", "int")
- outputOMLambda(dev, eval(args.1, args.2, args.3), args.3)
- OMputEndApp(dev)
-
- outputOMFunction(dev: OpenMathDevice, op: Symbol, args: List Expression R): Void ==
- nargs := #args
- zero? nargs =>
- omOp: Union(SymInfo, "failed") := search(op, nullaryFunctionAList)
- omOp case "failed" =>
- msg := concat ["No OpenMath definition for nullary function ", string op]
- error msg
- OMputSymbol(dev, omOp.cd, omOp.name)
- one? nargs =>
- omOp: Union(SymInfo, "failed") := search(op, unaryFunctionAList)
- omOp case "failed" =>
- msg := concat ["No OpenMath definition for unary function ", string op]
- error msg
- OMputApp(dev)
- OMputSymbol(dev, omOp.cd, omOp.name)
- for arg in args repeat
- OMwrite(dev, arg, false)
- OMputEndApp(dev)
- -- Most of the binary operators cannot be handled trivialy like the
- -- unary ones since they have bound variables of one kind or another.
- -- The special functions should be straightforward, but we don't have
- -- a CD for them yet :-)
- op = %defint => outputOMDefint(dev, args)
- op = integral => outputOMInt(dev, args)
- op = %defsum => outputOMDefsum(dev, args)
- op = %defprod => outputOMDefprod(dev, args)
- op = %power => outputOMPower(dev, args)
- op = binomial => outputOMBinomial(dev, args)
- msg := concat ["No OpenMath definition for function ", string op]
- error msg
-
- outputOMExpr(dev: OpenMathDevice, ex: Expression R): Void ==
- ground? ex => OMwrite(dev, ground ex, false)
- not((v := retractIfCan(ex)@Union(Symbol,"failed")) case "failed") =>
- OMputVariable(dev, v)
- not((w := isPlus ex) case "failed") => outputOMArith1(dev, "plus", w)
- not((w := isTimes ex) case "failed") => outputOMArith1(dev, "times", w)
- --not((y := isMult ex) case "failed") =>
- -- outputOMArith("times", [OMwrite(y.coef)$Integer,
- -- OMwrite(coerce y.var)])
- -- At the time of writing we don't need both isExpt and isPower
- -- here but they may be relevent when we integrate this stuff into
- -- the main Expression code. Note that if we don't check that
- -- the exponent is non-trivial we get thrown into an infinite recursion.
- not (((x := isExpt ex) case "failed") or one? x.exponent) =>
- not((s := symbolIfCan(x.var)@Union(Symbol,"failed")) case "failed") =>
- --outputOMPower(dev, [s::Expression(R), (x.exponent)::Expression(R)])
- OMputApp(dev)
- OMputSymbol(dev, "arith1", "power")
- OMputVariable(dev, s)
- OMputInteger(dev, x.exponent)
- OMputEndApp(dev)
- -- TODO: add error handling code here...
- not (((z := isPower ex) case "failed") or one? z.exponent) =>
- outputOMPower(dev, [ z.val, z.exponent::Expression R ])
- --OMputApp(dev)
- --OMputSymbol(dev, "arith1", "power")
- --outputOMExpr(dev, z.val)
- --OMputInteger(dev, z.exponent)
- --OMputEndApp(dev)
- -- Must only be one top-level Kernel by this point
- k : Kernel Expression R := first kernels ex
- outputOMFunction(dev, name operator k, argument k)
-
-
- ----------
- -- Exports
- ----------
-
- OMwrite(ex: Expression R): String ==
- s: String := ""
- sp := OM_-STRINGTOSTRINGPTR(s)$Lisp
- dev: OpenMathDevice := OMopenString(sp pretend String, OMencodingXML())
- OMputObject(dev)
- outputOMExpr(dev, ex)
- OMputEndObject(dev)
- OMclose(dev)
- s := OM_-STRINGPTRTOSTRING(sp)$Lisp pretend String
- s
-
- OMwrite(ex: Expression R, wholeObj: Boolean): String ==
- s: String := ""
- sp := OM_-STRINGTOSTRINGPTR(s)$Lisp
- dev: OpenMathDevice := OMopenString(sp pretend String, OMencodingXML())
- if wholeObj then
- OMputObject(dev)
- outputOMExpr(dev, ex)
- if wholeObj then
- OMputEndObject(dev)
- OMclose(dev)
- s := OM_-STRINGPTRTOSTRING(sp)$Lisp pretend String
- s
-
- OMwrite(dev: OpenMathDevice, ex: Expression R): Void ==
- OMputObject(dev)
- outputOMExpr(dev, ex)
- OMputEndObject(dev)
-
- OMwrite(dev: OpenMathDevice, ex: Expression R, wholeObj: Boolean): Void ==
- if wholeObj then
- OMputObject(dev)
- outputOMExpr(dev, ex)
- if wholeObj then
- OMputEndObject(dev)
-
-@
-\section{License}
-<<license>>=
---Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd.
---All rights reserved.
---
---Redistribution and use in source and binary forms, with or without
---modification, are permitted provided that the following conditions are
---met:
---
--- - Redistributions of source code must retain the above copyright
--- notice, this list of conditions and the following disclaimer.
---
--- - Redistributions in binary form must reproduce the above copyright
--- notice, this list of conditions and the following disclaimer in
--- the documentation and/or other materials provided with the
--- distribution.
---
--- - Neither the name of The Numerical ALgorithms Group Ltd. nor the
--- names of its contributors may be used to endorse or promote products
--- derived from this software without specific prior written permission.
---
---THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
---IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
---TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
---PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
---OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
---EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
---PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
---PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
---LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
---NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
---SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-@
-<<*>>=
-<<license>>
-
-<<package OMEXPR ExpressionToOpenMath>>
-@
-\eject
-\begin{thebibliography}{99}
-\bibitem{1} nothing
-\end{thebibliography}
-\end{document}