%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%A  openmath.msk                GAP documentation              Andrew Solomon
%%
%A  @(#)$Id: openmath.msk,v 1.1 2000/03/10 12:59:35 andrews Exp $
%%
%Y  (C) 1999 School Math and Comp. Sci., University of St.  Andrews, Scotland
%%
\Chapter{OpenMath functionality in GAP}

After loading the share package
the following operations are available.

\Declaration{OMPrint}
\beginexample
gap> g := Group((1,2,3));;
gap> OMPrint(g);
<OMOBJ>
	<OMA>
		<OMS cd="group1" name="Group"/>
		<OMA>
			<OMS cd="permut1" name="Permutation"/>
			<OMI> 2</OMI>
			<OMI> 3</OMI>
			<OMI> 1</OMI>
		</OMA>
	</OMA>
</OMOBJ>
\endexample


\Declaration{OMGetObject}
This may be used to retrieve objects from a file,
for example:
\beginexample
gap> stream := InputTextFile(test3.omt");;
gap> OMGetObject(stream);
912873912381273891
\endexample
or it can be used to retrieve them from standard input - 
one may paste an OpenMath object direcly into standard input
after issuing GAP with the following commands:
\beginexample
gap> stream := InputTextUser();;
gap> g := OMGetObject(stream);
\endexample


\Declaration{OMPutObject}
\beginexample
gap> g := [[1,2],[1,0]];;
gap> t := "";
""
gap> s := OutputTextString(t, true);;
gap> OMPutObject(s, g);
gap> CloseStream(s);
gap> Print(t);
<OMOBJ>
	<OMA>
		<OMS cd="linalg1" name="matrix"/>
		<OMA>
			<OMS cd="linalg1" name="matrixrow"/>
			<OMI> 1</OMI>
			<OMI> 2</OMI>
		</OMA>
		<OMA>
			<OMS cd="linalg1" name="matrixrow"/>
			<OMI> 1</OMI>
			<OMI> 0</OMI>
		</OMA>
	</OMA>
</OMOBJ>
\endexample

\Declaration{OMTest}






%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%E
