This is OpenMath.info, produced by Macaulay2, version 1.25.05

OpenMath -- OpenMath support
****************************

Description
===========

This package provides methods  for representing Macaulay2 objects using the
OpenMath (see https://openmath.org/ ) standard and vice versa.

See also
========

  * val(XMLnode) -- Evaluate an XMLnode containing OpenMath

Author
======

  * Dan Roozemond (see http://magma.maths.usyd.edu.au/~danr )
    <dan.roozemond@gmail.com>

Version
=======

This documentation describes version 0.2.2 of OpenMath.

Citation
========

If you have used this package in your research, please cite it as follows:

+----------------------------------------------------------------------------+
|@misc{OpenMathSource,                                                       |
|  title = {{OpenMath: OpenMath for \emph{Macaulay2}. Version~0.2.2}},       |
|  author = {Dan Roozemond},                                                 |
|  howpublished = {A \emph{Macaulay2} package available at                   |
|    \url{https://github.com/Macaulay2/M2/tree/master/M2/Macaulay2/packages}}|
|}                                                                           |
|                                                                            |
+----------------------------------------------------------------------------+

Exports
=======

  * Functions and commands
      * openMath -- Turn an arbitrary Macaulay2 object into
        OpenMath (if possible)
      * val -- Evaluate an XMLnode containing OpenMath
  * Methods
      * "openMath(Thing)" -- see openMath, -- Turn an arbitrary
        Macaulay2 object into OpenMath (if possible)
      * "val(XMLnode)" -- see val, -- Evaluate an XMLnode containing
        OpenMath
      * "value(XMLnode)" -- see val, -- Evaluate an XMLnode
        containing OpenMath

For the programmer
==================

The object OpenMath, is a package (Macaulay2Doc),
defined in OpenMath.m2, with auxiliary files in OpenMath/.

-------------------------------------------------------------------------------

The source of this document is in OpenMath.m2:85:0.

openMath -- Turn an arbitrary Macaulay2 object into OpenMath (if possible)
**************************************************************************

  * Usage:
        openMath x
  * Inputs:
      * x
  * Outputs:
      * an XMLnode describing x

Description
===========

We show how to convert a random integer to OpenMath and print it as XML
+------------------------------------+
|i1 : v = openMath 42                |
|                                    |
|o1 = <OMI "42"                      |
|                                    |
|o1 : XMLnode                        |
+------------------------------------+
|i2 : toLibxmlNode v                 |
|                                    |
|o2 = <OMI>42</OMI>                  |
|                                    |
|o2 : LibxmlNode (xmlTypeDescription)|
+------------------------------------+
We show how to represent 2*3 in OpenMath
+------------------------------------------+
|i3 : v = openMath (hold 2*3)              |
|                                          |
|o3 = <OMA                                 |
|       <OMS cd="arith1" name="times"      |
|       <OMI "2"                           |
|       <OMI "3"                           |
|                                          |
|o3 : XMLnode                              |
+------------------------------------------+
|i4 : toLibxmlNode v                       |
|                                          |
|o4 = <OMA>                                |
|           <OMS cd="arith1" name="times"/>|
|           <OMI>2</OMI>                   |
|           <OMI>3</OMI>                   |
|         </OMA>                           |
|                                          |
|o4 : LibxmlNode (xmlTypeDescription)      |
+------------------------------------------+

See also
========

  * val(XMLnode) -- Evaluate an XMLnode containing OpenMath

Ways to use openMath:
=====================

  * "openMath(Thing)"

For the programmer
==================

The object openMath, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in OpenMath.m2:133:0.

val -- Evaluate an XMLnode containing OpenMath
**********************************************

  * Usage:
        val x
  * Inputs:
      * x
  * Outputs:
      * the value of the OpenMath object described by x

Description
===========

+-----------------------------------------------------------------------------+
|i1 : t = parse ///<OMA><OMS cd="arith1"                                      |
|                                                                             |
|o1 = <OMA                                                                    |
|       <OMS cd="arith1" name="plus"                                          |
|       <OMI "1"                                                              |
|       <OMI "2"                                                              |
|                                                                             |
|o1 : XMLnode                                                                 |
|-----------------------------------------------------------------------------|
|name="plus"/><OMI>1</OMI><OMI>2</OMI></OMA>///                               |
+-----------------------------------------------------------------------------+
|i2 : val t                                                                   |
|                                                                             |
|o2 = 3                                                                       |
+-----------------------------------------------------------------------------+

See also
========

  * openMath -- Turn an arbitrary Macaulay2 object into
    OpenMath (if possible)

Ways to use val:
================

  * "val(XMLnode)"

For the programmer
==================

The object val, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in OpenMath.m2:109:0.