Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
| Download
GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it
Project: cocalc-sagemath-dev-slelievre
Views: 4183461[1X2 [33X[0;0Y[5XOpenMath[105X[101X[1X functionality in [5XGAP[105X[101X[1X[133X[101X234[1X2.1 [33X[0;0YViewing [5XOpenMath[105X[101X[1X representation of an object[133X[101X56[1X2.1-1 OMPrint[101X78[29X[2XOMPrint[102X( [3Xobj[103X ) [32X function910[33X[0;0YOMPrint writes the default XML [5XOpenMath[105X encoding of [5XGAP[105X object [3Xobj[103X to the11standard output.[133X1213[33X[0;0YOne can try it with different [5XGAP[105X objects to see if they can be converted to14[5XOpenMath[105X and learn how their [5XOpenMath[105X representation looks like. Here we15show the encoding for lists of integers and rationals:[133X1617[4X[32X Example [32X[104X18[4X[28X[128X[104X19[4X[25Xgap>[125X [27XOMPrint( [ 1, 1/2 ] ); [127X[104X20[4X[28X<OMOBJ xmlns="http://www.openmath.org/OpenMath" version="2.0">[128X[104X21[4X[28X <OMA>[128X[104X22[4X[28X <OMS cd="list1" name="list"/>[128X[104X23[4X[28X <OMI>1</OMI>[128X[104X24[4X[28X <OMA>[128X[104X25[4X[28X <OMS cd="nums1" name="rational"/>[128X[104X26[4X[28X <OMI>1</OMI>[128X[104X27[4X[28X <OMI>2</OMI>[128X[104X28[4X[28X </OMA>[128X[104X29[4X[28X </OMA>[128X[104X30[4X[28X</OMOBJ>[128X[104X31[4X[28X[128X[104X32[4X[32X[104X3334[33X[0;0YStrings are encoded using [10X<OMSTR>[110X tags:[133X3536[4X[32X Example [32X[104X37[4X[28X[128X[104X38[4X[25Xgap>[125X [27XOMPrint( "This is a string" );[127X[104X39[4X[28X<OMOBJ xmlns="http://www.openmath.org/OpenMath" version="2.0">[128X[104X40[4X[28X <OMSTR>This is a string</OMSTR>[128X[104X41[4X[28X</OMOBJ>[128X[104X42[4X[28X[128X[104X43[4X[32X[104X4445[33X[0;0YCyclotomics may be encoded in different ways dependently on their46properties:[133X4748[4X[32X Example [32X[104X49[4X[28X[128X[104X50[4X[25Xgap>[125X [27XOMPrint( 1-2*E(4) ); [127X[104X51[4X[28X<OMOBJ xmlns="http://www.openmath.org/OpenMath" version="2.0">[128X[104X52[4X[28X <OMA>[128X[104X53[4X[28X <OMS cd="complex1" name="complex_cartesian"/>[128X[104X54[4X[28X <OMI>1</OMI>[128X[104X55[4X[28X <OMI>-2</OMI>[128X[104X56[4X[28X </OMA>[128X[104X57[4X[28X</OMOBJ>[128X[104X58[4X[25Xgap>[125X [27XOMPrint(E(3)); [127X[104X59[4X[28X<OMOBJ xmlns="http://www.openmath.org/OpenMath" version="2.0">[128X[104X60[4X[28X <OMA>[128X[104X61[4X[28X <OMS cd="arith1" name="plus"/>[128X[104X62[4X[28X <OMA>[128X[104X63[4X[28X <OMS cd="arith1" name="times"/>[128X[104X64[4X[28X <OMI>1</OMI>[128X[104X65[4X[28X <OMA>[128X[104X66[4X[28X <OMS cd="algnums" name="NthRootOfUnity"/>[128X[104X67[4X[28X <OMI>3</OMI>[128X[104X68[4X[28X <OMI>1</OMI>[128X[104X69[4X[28X </OMA>[128X[104X70[4X[28X </OMA>[128X[104X71[4X[28X </OMA>[128X[104X72[4X[28X</OMOBJ>[128X[104X73[4X[28X[128X[104X74[4X[32X[104X7576[33X[0;0YVarious encodings may be used for various types of groups:[133X7778[4X[32X Example [32X[104X79[4X[28X[128X[104X80[4X[25Xgap>[125X [27XOMPrint( Group( (1,2) ) );[127X[104X81[4X[28X<OMOBJ xmlns="http://www.openmath.org/OpenMath" version="2.0">[128X[104X82[4X[28X <OMA>[128X[104X83[4X[28X <OMS cd="permgp1" name="group"/>[128X[104X84[4X[28X <OMS cd="permutation1" name="right_compose"/>[128X[104X85[4X[28X <OMA>[128X[104X86[4X[28X <OMS cd="permut1" name="permutation"/>[128X[104X87[4X[28X <OMI>2</OMI>[128X[104X88[4X[28X <OMI>1</OMI>[128X[104X89[4X[28X </OMA>[128X[104X90[4X[28X </OMA>[128X[104X91[4X[28X</OMOBJ>[128X[104X92[4X[25Xgap>[125X [27XOMPrint( Group( [ [ [ 1, 2 ],[ 0, 1 ] ] ] ) );[127X[104X93[4X[28X<OMOBJ xmlns="http://www.openmath.org/OpenMath" version="2.0">[128X[104X94[4X[28X <OMA>[128X[104X95[4X[28X <OMS cd="group1" name="group_by_generators"/>[128X[104X96[4X[28X <OMA>[128X[104X97[4X[28X <OMS cd="linalg2" name="matrix"/>[128X[104X98[4X[28X <OMA>[128X[104X99[4X[28X <OMS cd="linalg2" name="matrixrow"/>[128X[104X100[4X[28X <OMI>1</OMI>[128X[104X101[4X[28X <OMI>2</OMI>[128X[104X102[4X[28X </OMA>[128X[104X103[4X[28X <OMA>[128X[104X104[4X[28X <OMS cd="linalg2" name="matrixrow"/>[128X[104X105[4X[28X <OMI>0</OMI>[128X[104X106[4X[28X <OMI>1</OMI>[128X[104X107[4X[28X </OMA>[128X[104X108[4X[28X </OMA>[128X[104X109[4X[28X </OMA>[128X[104X110[4X[28X</OMOBJ>[128X[104X111[4X[25Xgap>[125X [27XOMPrint( FreeGroup( 2 ) ); [127X[104X112[4X[28X<OMOBJ xmlns="http://www.openmath.org/OpenMath" version="2.0">[128X[104X113[4X[28X <OMA>[128X[104X114[4X[28X <OMS cd="fpgroup1" name="free_groupn"/>[128X[104X115[4X[28X <OMI>2</OMI>[128X[104X116[4X[28X </OMA>[128X[104X117[4X[28X</OMOBJ>[128X[104X118[4X[28X[128X[104X119[4X[32X[104X120121[33X[0;0YProducing [5XOpenMath[105X representation of polynomials, one may get a warning:[133X122123[4X[32X Example [32X[104X124[4X[28X[128X[104X125[4X[25Xgap>[125X [27Xx:=Indeterminate(Rationals,"x");; y:=Indeterminate(Rationals,"y");;[127X[104X126[4X[25Xgap>[125X [27XOMPrint(x^2+y);[127X[104X127[4X[28X#I Warning : polynomial will be printed using its default ring [128X[104X128[4X[28X#I because the default OpenMath polynomial ring is not specified [128X[104X129[4X[28X#I or it is not contained in the default OpenMath polynomial ring.[128X[104X130[4X[28X#I You may ignore this or call SetOpenMathDefaultPolynomialRing to fix it.[128X[104X131[4X[28X<OMOBJ xmlns="http://www.openmath.org/OpenMath" version="2.0">[128X[104X132[4X[28X <OMA>[128X[104X133[4X[28X <OMS cd="polyd1" name="DMP"/>[128X[104X134[4X[28X <OMA id="polyring9qiY2oOaiITWUORb" >[128X[104X135[4X[28X <OMS cd="polyd1" name="poly_ring_d"/>[128X[104X136[4X[28X <OMS cd="setname1" name="Q"/>[128X[104X137[4X[28X <OMI>2</OMI>[128X[104X138[4X[28X </OMA>[128X[104X139[4X[28X <OMA>[128X[104X140[4X[28X <OMS cd="polyd1" name="SDMP"/>[128X[104X141[4X[28X <OMA>[128X[104X142[4X[28X <OMS cd="polyd1" name="term"/>[128X[104X143[4X[28X <OMI>1</OMI>[128X[104X144[4X[28X <OMI>0</OMI>[128X[104X145[4X[28X <OMI>1</OMI>[128X[104X146[4X[28X </OMA>[128X[104X147[4X[28X <OMA>[128X[104X148[4X[28X <OMS cd="polyd1" name="term"/>[128X[104X149[4X[28X <OMI>1</OMI>[128X[104X150[4X[28X <OMI>2</OMI>[128X[104X151[4X[28X <OMI>0</OMI>[128X[104X152[4X[28X </OMA>[128X[104X153[4X[28X </OMA>[128X[104X154[4X[28X </OMA>[128X[104X155[4X[28X</OMOBJ>[128X[104X156[4X[28X[128X[104X157[4X[32X[104X158159[33X[0;0YIndeed, now when another polynomial will be printed, it will belong to a160ring with a different identifier (despite [5XGAP[105X will be able to perform161arithmetical operations on these polynomials like when they belong to the162same ground ring):[133X163164[4X[32X Example [32X[104X165[4X[28X[128X[104X166[4X[25Xgap>[125X [27XOMPrint(x+1);[127X[104X167[4X[28X#I Warning : polynomial will be printed using its default ring [128X[104X168[4X[28X#I because the default OpenMath polynomial ring is not specified [128X[104X169[4X[28X#I or it is not contained in the default OpenMath polynomial ring.[128X[104X170[4X[28X#I You may ignore this or call SetOpenMathDefaultPolynomialRing to fix it.[128X[104X171[4X[28X<OMOBJ xmlns="http://www.openmath.org/OpenMath" version="2.0">[128X[104X172[4X[28X <OMA>[128X[104X173[4X[28X <OMS cd="polyd1" name="DMP"/>[128X[104X174[4X[28X <OMA id="polyring0LqlkhnCyLldcoBl" >[128X[104X175[4X[28X <OMS cd="polyd1" name="poly_ring_d_named"/>[128X[104X176[4X[28X <OMS cd="setname1" name="Q"/>[128X[104X177[4X[28X <OMV name="x"/>[128X[104X178[4X[28X </OMA>[128X[104X179[4X[28X <OMA>[128X[104X180[4X[28X <OMS cd="polyd1" name="SDMP"/>[128X[104X181[4X[28X <OMA>[128X[104X182[4X[28X <OMS cd="polyd1" name="term"/>[128X[104X183[4X[28X <OMI>1</OMI>[128X[104X184[4X[28X <OMI>1</OMI>[128X[104X185[4X[28X </OMA>[128X[104X186[4X[28X <OMA>[128X[104X187[4X[28X <OMS cd="polyd1" name="term"/>[128X[104X188[4X[28X <OMI>1</OMI>[128X[104X189[4X[28X <OMI>0</OMI>[128X[104X190[4X[28X </OMA>[128X[104X191[4X[28X </OMA>[128X[104X192[4X[28X </OMA>[128X[104X193[4X[28X</OMOBJ>[128X[104X194[4X[28X[128X[104X195[4X[32X[104X196197[33X[0;0YThus, the warning means that it is not guaranteed that the polynomial ring198will have the same identifier [10X<OMA id="polyring..." >[110X when another or same199polynomial from this ring will be printed next time. If this may constitute200a problem, for example, if a list of polynomial is being exchanged with201another system and it is crucial that all of them will belong to the same202ring, then such ring must be created explicitly and then203[10XSetOpenMathDefaultPolynomialRing[110X must be called:[133X204205[4X[32X Example [32X[104X206[4X[28X[128X[104X207[4X[25Xgap>[125X [27Xx:=Indeterminate(Rationals,"x");; y:=Indeterminate(Rationals,"y");;[127X[104X208[4X[25Xgap>[125X [27XR:=PolynomialRing(Rationals,[x,y]);;[127X[104X209[4X[25Xgap>[125X [27XSetOpenMathDefaultPolynomialRing(R);[127X[104X210[4X[25Xgap>[125X [27XOMPrint(x^2+y);[127X[104X211[4X[28X<OMOBJ xmlns="http://www.openmath.org/OpenMath" version="2.0">[128X[104X212[4X[28X <OMA>[128X[104X213[4X[28X <OMS cd="polyd1" name="DMP"/>[128X[104X214[4X[28X <OMA id="polyring9eNcBGFHXkjl2kWh" >[128X[104X215[4X[28X <OMS cd="polyd1" name="poly_ring_d"/>[128X[104X216[4X[28X <OMS cd="setname1" name="Q"/>[128X[104X217[4X[28X <OMI>2</OMI>[128X[104X218[4X[28X </OMA>[128X[104X219[4X[28X <OMA>[128X[104X220[4X[28X <OMS cd="polyd1" name="SDMP"/>[128X[104X221[4X[28X <OMA>[128X[104X222[4X[28X <OMS cd="polyd1" name="term"/>[128X[104X223[4X[28X <OMI>1</OMI>[128X[104X224[4X[28X <OMI>0</OMI>[128X[104X225[4X[28X <OMI>0</OMI>[128X[104X226[4X[28X </OMA>[128X[104X227[4X[28X <OMA>[128X[104X228[4X[28X <OMS cd="polyd1" name="term"/>[128X[104X229[4X[28X <OMI>1</OMI>[128X[104X230[4X[28X <OMI>0</OMI>[128X[104X231[4X[28X <OMI>0</OMI>[128X[104X232[4X[28X </OMA>[128X[104X233[4X[28X </OMA>[128X[104X234[4X[28X </OMA>[128X[104X235[4X[28X</OMOBJ>[128X[104X236[4X[28X[128X[104X237[4X[32X[104X238239[33X[0;0YNow we can see that both polynomials belong to the ring with the same240identifier, and the [5XOpenMath[105X representation of the 2nd polynomial properly241reflects that it belongs to a polynomial ring with two variables.[133X242243[4X[32X Example [32X[104X244[4X[28X[128X[104X245[4X[25Xgap>[125X [27XOMPrint(x+1); [127X[104X246[4X[28X<OMOBJ xmlns="http://www.openmath.org/OpenMath" version="2.0">[128X[104X247[4X[28X <OMA>[128X[104X248[4X[28X <OMS cd="polyd1" name="DMP"/>[128X[104X249[4X[28X <OMR href="#polyring9eNcBGFHXkjl2kWh" />[128X[104X250[4X[28X <OMA>[128X[104X251[4X[28X <OMS cd="polyd1" name="SDMP"/>[128X[104X252[4X[28X <OMA>[128X[104X253[4X[28X <OMS cd="polyd1" name="term"/>[128X[104X254[4X[28X <OMI>1</OMI>[128X[104X255[4X[28X <OMI>0</OMI>[128X[104X256[4X[28X <OMI>0</OMI>[128X[104X257[4X[28X </OMA>[128X[104X258[4X[28X <OMA>[128X[104X259[4X[28X <OMS cd="polyd1" name="term"/>[128X[104X260[4X[28X <OMI>1</OMI>[128X[104X261[4X[28X <OMI>0</OMI>[128X[104X262[4X[28X <OMI>0</OMI>[128X[104X263[4X[28X </OMA>[128X[104X264[4X[28X </OMA>[128X[104X265[4X[28X </OMA>[128X[104X266[4X[28X</OMOBJ> [128X[104X267[4X[28X[128X[104X268[4X[32X[104X269270[1X2.1-2 OMString[101X271272[29X[2XOMString[102X( [3Xobj[103X ) [32X function273274[33X[0;0YOMString returns a string with the default XML [5XOpenMath[105X encoding of [5XGAP[105X275object [3Xobj[103X. If used with the [9Xnoomobj[109X option, then initial and final <OMOBJ>276tags will be omitted.[133X277278[4X[32X Example [32X[104X279[4X[28X[128X[104X280[4X[25Xgap>[125X [27XOMString(42);[127X[104X281[4X[28X"<OMOBJ xmlns=\"http://www.openmath.org/OpenMath\" version=\"2.0\"> <OMI>42</OMI> </OMOBJ>"[128X[104X282[4X[25Xgap>[125X [27XOMString([1,2]:noomobj); [127X[104X283[4X[28X"<OMA> <OMS cd=\"list1\" name=\"list\"/> <OMI>1</OMI> <OMI>2</OMI> </OMA>"[128X[104X284[4X[28X[128X[104X285[4X[32X[104X286287288[1X2.2 [33X[0;0YReading [5XOpenMath[105X[101X[1X code from streams and strings[133X[101X289290[1X2.2-1 OMGetObject[101X291292[29X[2XOMGetObject[102X( [3Xstream[103X ) [32X function293294[33X[0;0Y[3Xstream[103X is an input stream (see [2XInputTextFile[102X ([14XReference: InputTextFile[114X),295[2XInputTextUser[102X ([14XReference: InputTextUser[114X), [2XInputTextString[102X ([14XReference:296InputTextString[114X), [2XInputOutputLocalProcess[102X ([14XReference:297InputOutputLocalProcess[114X), [2XInputOutputTCPStream[102X ([14XSCSCP: InputOutputTCPStream298(for client)[114X), [2XInputOutputTCPStream[102X ([14XSCSCP: InputOutputTCPStream (for299server)[114X)) with an [5XOpenMath[105X object on it. [2XOMGetObject[102X takes precisely one300object off [3Xstream[103X and returns it as a GAP object. Both XML and binary301[5XOpenMath[105X encoding are supported: autodetection is used.[133X302303[33X[0;0YThis may be used to retrieve objects from a file. In the following example304we demonsrate reading the same content in binary and XML formats using the305test files supplied with the package (the package autodetects whether binary306or XML encoding is used):[133X307308[4X[32X Example [32X[104X309[4X[28X[128X[104X310[4X[25Xgap>[125X [27Xtxml:=Filename(DirectoriesPackageLibrary("openmath","tst"),"test3.omt");; [127X[104X311[4X[25Xgap>[125X [27Xtbin:=Filename(DirectoriesPackageLibrary("openmath","tst"),"test3.bin");; [127X[104X312[4X[25Xgap>[125X [27Xxstream := InputTextFile( txml );; bstream := InputTextFile( tbin );; [127X[104X313[4X[25Xgap>[125X [27Xx:=OMGetObject(xstream); y:=OMGetObject(bstream);[127X[104X314[4X[28X912873912381273891[128X[104X315[4X[28X912873912381273891[128X[104X316[4X[25Xgap>[125X [27Xx:=OMGetObject(xstream); y:=OMGetObject(bstream);[127X[104X317[4X[28XE(4)[128X[104X318[4X[28XE(4)[128X[104X319[4X[25Xgap>[125X [27XCloseStream(xstream);CloseStream(bstream);[127X[104X320[4X[28X[128X[104X321[4X[32X[104X322323[33X[0;0YTo paste an [5XOpenMath[105X object directly into standard input execute the324following command in GAP:[133X325326[4X[32X Example [32X[104X327[4X[28X[128X[104X328[4X[25Xgap>[125X [27Xs:= InputTextUser();; g := OMGetObject(s); CloseStream(s);[127X[104X329[4X[25Xgap>[125X [27X[127X[104X330[4X[28X[128X[104X331[4X[32X[104X332333[33X[0;0YFor XML [5XOpenMath[105X, this function requires that the [5XGAP[105X package [5XGAPDoc[105X is334available.[133X335336[1X2.2-2 EvalOMString[101X337338[29X[2XEvalOMString[102X( [3Xomstr[103X ) [32X function339340[33X[0;0YThis function is an analog of [2XEvalString[102X ([14XReference: EvalString[114X). Its341argument [3Xomstr[103X must be a string containing a single [5XOpenMath[105X object.342[2XEvalOMString[102X will return the [5XGAP[105X object represented by [3Xomstr[103X.[133X343344[33X[0;0YIf [3Xomstr[103X contains more [5XOpenMath[105X objects, the rest will be ignored.[133X345346[4X[32X Example [32X[104X347[4X[28X[128X[104X348[4X[25Xgap>[125X [27Xs:="<OMOBJ><OMS cd=\"setname1\" name=\"Z\"/></OMOBJ>";;[127X[104X349[4X[25Xgap>[125X [27XEvalOMString(s);[127X[104X350[4X[28XIntegers[128X[104X351[4X[25Xgap>[125X [27XG:=SL(2,5);; G=EvalOMString(OMString(G));[127X[104X352[4X[28Xtrue[128X[104X353[4X[28X[128X[104X354[4X[32X[104X355356357[1X2.3 [33X[0;0YWriting [5XOpenMath[105X[101X[1X code to streams[133X[101X358359[33X[0;0YWhile it is possible to read [5XOpenMath[105X code directly from a stream, writing360[5XOpenMath[105X to streams uses a different setup. It requires special objects361called [5XOpenMath[105X [13Xwriters[113X, which encapsulate streams and may be viewed as362transducers accepting [5XGAP[105X objects and writing them to a stream in the XML or363binary [5XOpenMath[105X[133X364365[33X[0;0YSuch setup makes it possible to re-use the same stream for both binary and366XML [5XOpenMath[105X communication, using different [5XOpenMath[105X writers in different367calls. It also allows to re-use most of the high-level code for [5XGAP[105X to368[5XOpenMath[105X conversion, having separate methods for generating binary and XML369[5XOpenMath[105X only for low-level output ([5XOpenMath[105X tags and basic objects). This370makes easier adding support to new mathematical objects and private content371dictionaries as described in Chapter [14X3[114X since it does not require changing372the low-level functionality.[133X373374[1X2.3-1 IsOpenMathWriter[101X375376[29X[2XIsOpenMathWriter[102X[32X Category377[29X[2XIsOpenMathXMLWriter[102X[32X Category378[29X[2XIsOpenMathBinaryWriter[102X[32X Category379380[33X[0;0Y[2XIsOpenMathWriter[102Xis a category for [5XOpenMath[105X writers. It has two381subcategories: [2XIsOpenMathXMLWriter[102X and [2XIsOpenMathBinaryWriter[102X.[133X382383[1X2.3-2 OpenMathXMLWriter[101X384385[29X[2XOpenMathXMLWriter[102X( [3Xs[103X ) [32X function386387[33X[0;0Yfor a stream [3Xs[103X, returns an object in the category [2XIsOpenMathXMLWriter[102X388([14X2.3-1[114X).[133X389390[1X2.3-3 OpenMathBinaryWriter[101X391392[29X[2XOpenMathBinaryWriter[102X( [3Xs[103X ) [32X function393394[33X[0;0Yfor a stream [3Xs[103X, returns an object in the category [2XOpenMathBinaryWriter[102X.[133X395396[1X2.3-4 OMPutObject[101X397398[29X[2XOMPutObject[102X( [3Xstream[103X, [3Xobj[103X ) [32X function399[29X[2XOMPutObjectNoOMOBJtags[102X( [3Xstream[103X, [3Xobj[103X ) [32X function400401[33X[0;0Y[2XOMPutObject[102X writes (appends) the XML [5XOpenMath[105X encoding of the [5XGAP[105X object [3Xobj[103X402to output stream [3Xstream[103X (see [2XInputTextFile[102X ([14XReference: InputTextFile[114X),403[2XOutputTextUser[102X ([14XReference: OutputTextUser[114X), [2XOutputTextString[102X ([14XReference:404OutputTextString[114X), [2XInputOutputTCPStream[102X ([14XSCSCP: InputOutputTCPStream (for405client)[114X), [2XInputOutputTCPStream[102X ([14XSCSCP: InputOutputTCPStream (for server)[114X)).[133X406407[33X[0;0YThe second version does the same but without <OMOBJ> tags, what may be408useful for assembling complex [5XOpenMath[105X objects.[133X409410[4X[32X Example [32X[104X411[4X[28X[128X[104X412[4X[25Xgap>[125X [27Xg := [[1,2],[1,0]];;[127X[104X413[4X[25Xgap>[125X [27Xt := "";[127X[104X414[4X[28X""[128X[104X415[4X[25Xgap>[125X [27Xs := OutputTextString(t, true);;[127X[104X416[4X[25Xgap>[125X [27Xw:=OpenMathXMLWriter( s );[127X[104X417[4X[28X<OpenMath XML writer to OutputTextString(0)>[128X[104X418[4X[25Xgap>[125X [27XOMPutObject(w, g);[127X[104X419[4X[25Xgap>[125X [27XCloseStream(s);[127X[104X420[4X[25Xgap>[125X [27XPrint(t);[127X[104X421[4X[28X<OMOBJ xmlns="http://www.openmath.org/OpenMath" version="2.0">[128X[104X422[4X[28X <OMA>[128X[104X423[4X[28X <OMS cd="linalg2" name="matrix"/>[128X[104X424[4X[28X <OMA>[128X[104X425[4X[28X <OMS cd="linalg2" name="matrixrow"/>[128X[104X426[4X[28X <OMI>1</OMI>[128X[104X427[4X[28X <OMI>2</OMI>[128X[104X428[4X[28X </OMA>[128X[104X429[4X[28X <OMA>[128X[104X430[4X[28X <OMS cd="linalg2" name="matrixrow"/>[128X[104X431[4X[28X <OMI>1</OMI>[128X[104X432[4X[28X <OMI>0</OMI>[128X[104X433[4X[28X </OMA>[128X[104X434[4X[28X </OMA>[128X[104X435[4X[28X</OMOBJ>[128X[104X436[4X[28X[128X[104X437[4X[32X[104X438439[1X2.3-5 OMPlainString[101X440441[29X[2XOMPlainString[102X( [3Xstring[103X ) [32X function442443[33X[0;0Y[2XOMPlainString[102X wraps the string into a [5XGAP[105X object of a special kind called an444[5XOpenMath[105X plain string. Internally such object is represented as a string,445but [2XOMPutObject[102X ([14X2.3-4[114X) threat it in a different way: instead of converting446it into a <OMSTR> object, an [5XOpenMath[105X plain string will be plainly447substituted into the output (this explains its name) without decorating it448with <OMSTR> tags.[133X449450[33X[0;0YIt is assumed that [5XOpenMath[105X plain string contains valid [5XOpenMath[105X code; no451actual validation is performed during its creation. Such functionality may452be useful to compose some [5XOpenMath[105X code at the [5XGAP[105X level to communicate it453to the other system, in particular, to send there symbols which are not454supported by [5XGAP[105X, for example:[133X455456[4X[32X Example [32X[104X457[4X[28X[128X[104X458[4X[25Xgap>[125X [27Xs:=OMPlainString("<OMS cd=\"nums1\" name=\"pi\"/>");[127X[104X459[4X[28X<OMS cd="nums1" name="pi"/>[128X[104X460[4X[25Xgap>[125X [27XOMPrint(s); [127X[104X461[4X[28X<OMOBJ xmlns="http://www.openmath.org/OpenMath" version="2.0">[128X[104X462[4X[28X <OMS cd="nums1" name="pi"/>[128X[104X463[4X[28X</OMOBJ>[128X[104X464[4X[28X[128X[104X465[4X[32X[104X466467468[1X2.4 [33X[0;0YUtilities[133X[101X469470[1X2.4-1 OMTestXML[101X471472[29X[2XOMTestXML[102X( [3Xobj[103X ) [32X function473[29X[2XOMTest[102X( [3Xobj[103X ) [32X function474475[33X[0;0YConverts [3Xobj[103X to XML [5XOpenMath[105X and back. Returns true if and only if [3Xobj[103X is476unchanged (as a [5XGAP[105X object) by this operation. The [5XOpenMath[105X standard does477not stipulate that converting to and from [5XOpenMath[105X should be the identity478function so this is a useful diagnostic tool.[133X479480[4X[32X Example [32X[104X481[4X[28X[128X[104X482[4X[25Xgap>[125X [27XOMTestXML([[1..10],[1/2,2+E(4)],ZmodnZObj(2,6),(1,2),true,"string"]); [127X[104X483[4X[28Xtrue[128X[104X484[4X[28X[128X[104X485[4X[32X[104X486487[33X[0;0Y[2XOMTest[102X is a synonym to [2XOMTestXML[102X[133X488489[1X2.4-2 OMTestBinary[101X490491[29X[2XOMTestBinary[102X( [3Xobj[103X ) [32X function492493[33X[0;0YConverts [3Xobj[103X to binary [5XOpenMath[105X and back. Returns true if and only if [3Xobj[103X is494unchanged (as a [5XGAP[105X object) by this operation. The [5XOpenMath[105X standard does495not stipulate that converting to and from [5XOpenMath[105X should be the identity496function so this is a useful diagnostic tool.[133X497498[4X[32X Example [32X[104X499[4X[28X[128X[104X500[4X[25Xgap>[125X [27XOMTestBinary([[1..10],[1/2,2+E(4)],ZmodnZObj(2,6),(1,2),true,"string"]); [127X[104X501[4X[28Xtrue[128X[104X502[4X[28X[128X[104X503[4X[32X[104X504505506507