[Om] Specification of functions, preserving function signatures

W Naylor wn at cs.bath.ac.uk
Thu Dec 8 14:50:20 CET 2005


Hi all,

as part of my project, I am implementing an OpenMath phrasebook for aldor 
(http://www.aldor.org/). I am looking at mappings for function objects, 
these can be specified using:

<OMBIND>
  <OMS cd="fns1" name="lambda"/>
...

however this holds no typing information. One possible solution is to use 
attribution where the attribute is 
<OMS cd="ecc" name="type"/>
this has role 'semantic-attribution' so preserves semantic information, an 
example would be f:Z->N x +-> x^2 as
<OMATR>
  <OMATP>
    <OMS cd="ecc" name="type"/>
    <OMS cd="setname1" name="N"/>
  </OMATP>
  <OMBIND>
    <OMS cd="fns1" name="lambda"/>
    <OMBVAR>
      <OMATR>
        <OMATP>
          <OMS cd="ecc" name="type"/>
          <OMS cd="setname1" name="Z"/>
        </OMATP>
        <OMV name="x"/>
      </OMATR>
    </OMBVAR>
    <OMA>
      <OMS cd="arith1" name="power"/>
      <OMV name="x"/>
      <OMI>2</OMI>
    </OMA>
  </OMBIND>
</OMATR>

(I personally find this a bit ugly)

Another possibility is to use the function symbol from fns3

<OMA>
  <OMS cd="fns3" name="function"/>
  <OMS cd="setname1" name="Z"/>
  <OMS cd="setname1" name="N"/>
  <OMBIND>
    <OMS cd="fns1" name="lambda"/>
    <OMBVAR>
      <OMV name="x"/>
    </OMBVAR>
    <OMA>
      <OMS cd="arith1" name="power"/>
      <OMV name="x"/>
      <OMI>2</OMI>
    </OMA>
  </OMBIND>
</OMA>

I find the second solution nicer (the type information is kept together, 
though multiple arguments will involve cross products ... not so nice on 
the aldor side :-| ), however fns3 is an experimental CD, whereas 
semantic-attribution is in the OM2 specification.

I would appreciate other peoples opinion/experience on this matter

cheers,

Bill
 

-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
-
-                  Dr. W.A. Naylor
-
-                  http://www.cs.bath.ac.uk/~wn
-                  http://orcca.on.ca/~bill
-
-                  work tel: +44 1225 386183
-
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*



More information about the Om mailing list