[om] Manipulating Structured Data

David Carlisle davidc at nag.co.uk
Tue Nov 19 10:57:30 CET 2002


  For example,  I only want to sum up the  positive members in a list P, i.e.,
  

  <OMOBJ>
       <OMA>
            <OMS  cd="fns2"  name="apply_to_list"/>
            <OMS  cd="arith1"  name="plus"/>
            <OMV  name="P"/>
       </OMA>
  </OMOBJ>




You could filter the list first to get the list of positive elements as
in




<OMOBJ>
     <OMA>
          <OMS  cd="fns2"  name="apply_to_list"/>
          <OMS  cd="arith1"  name="plus"/>
          <OMA>
            <OMS  cd="list1"  name="suchthat"/>
            <OMV  name="P"/>
            <OMBIND>
              <OMS cd="fns1" name="lambda"/>
              <OMBVAR>
               <OMV name="x"/>
              </OMBVAR>
              <OMA>
                <OMS cd="relation1" name="gt"/>
                <OMV>name="x"/>
                <OMI>0</OMI>
              </OMA>
            </OMBIND>            
     </OMA>
</OMOBJ>

see
http://monet.nag.co.uk/cocoon/openmath/cd/list1.html#suchthat

David

_____________________________________________________________________
This message has been checked for all known viruses by Star Internet
delivered through the MessageLabs Virus Scanning Service. For further
information visit http://www.star.net.uk/stats.asp or alternatively call
Star Internet for details on the Virus Scanning Service.
--
om at openmath.org  -  general discussion on OpenMath
Post public announcements to om-announce at openmath.org
Automatic list maintenance software at majordomo at openmath.org
Mail om-owner at openmath.org for assistance with any problems



More information about the Om mailing list