grzegorzmazur / yacas

Computer calculations made easy
http://www.yacas.org
GNU Lesser General Public License v2.1
124 stars 24 forks source link

convert back to OpenMath dummy yacasform #301

Open MarcoCostantini opened 4 years ago

MarcoCostantini commented 4 years ago

This is the opposite of #300 Let's consider an OpenMath object unknown to Yacas:

<OMOBJ xmlns="http://www.openmath.org/OpenMath" version="2.0"><OMS cd="foo" name="bar"/></OMOBJ> 

if this object is converted to Yacas, then a dummy object yacasform is created, and this is OK:

In> FromString("<OMOBJ xmlns=\"http://www.openmath.org/OpenMath\" version=\"2.0\"><OMS cd=\"foo\" name=\"bar\"/></OMOBJ> ")OMRead()
Out> yacasform

Of course, it's not possible to do much with this dummy object, but it should be possible at least to convert it back to OpenMath, to get the starting object, but it doesn't work:

In> OMForm(%)
<OMOBJ>
  <OMV name="yacasform"/>
</OMOBJ>
Out> True

The same for OMA OpenMath objects:

In> FromString("<OMOBJ xmlns=\"http://www.openmath.org/OpenMath\" version=\"2.0\"><OMA><OMS cd=\"foo\" name=\"bar\"/><OMI>1</OMI><OMI>2</OMI><OMI>3</OMI></OMA></OMOBJ> ")OMRead()
Out> yacasform(1,2,3)
In> OMForm(%)
<OMOBJ>
  <OMA>
    <OMS cd="yacas" name="yacasform"/>
    <OMI>1</OMI>
    <OMI>2</OMI>
    <OMI>3</OMI>
  </OMA>
</OMOBJ>
Out> True
In>