OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xml-dev] Expressing mathematical relationships?

[ Lists Home | Date Index | Thread Index ]

Hi Robin,
I read your examples and here are the problems that I found.
1) Not declarative style
2) Not really XML style
3) it's difficult to adapt to use rule engine

Check this out (MathML Fundamentals):

Let’s take a look at the very simple example of (a + b)2. Here we see how the principles discussed above play out in practice. One form of presentation markup for this example is: 

 <mrow>
   <msup>
     <mfenced>
       <mrow>
         <mi>a</mi>
         <mo>+</mo>
         <mi>b</mi>
       </mrow>
     </mfenced>
     <mn>2</mn>
   </msup>
 </mrow>

This example demonstrates a number of presentation elements. The first element, one that is used a great deal is mrow. This element is used to denote a row of horizontally aligned material. The material contained between the <mrow> and </mrow> tags is considered to be an argument to the mrow element. Thus the whole expression here is contained in an mrow element. As previously noted, almost all mathematical expressions decompose into subexpressions. These subexpressions can, in turn, also be contained in an mrow element. For example, a + b is also contained in an mrow. 

The mfenced element is used to provide fences (braces, brackets, and parentheses) around formula material. It defaults to using parentheses. 

Note the use of the mi element for displaying the variables a and b and the mo element for marking the + operator. 

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

Check this out (RuleML):

<!--  Imp 1
The discount for a customer buying a product is 5.0 percent
if the customer is premium and the product is regular.

Notice that an individual constant can syntactically be an entire phrase
like "5.0 percent". It will unify only with variables and with individuals
having exactly the same spelling (incl. spaces). One could refine this markup
by introducing a constructor term for "percent[5.0]", thus leaving Datalog
towards full Horn logic.
-->

<imp>
  <_head>
    <atom>
      <_opr><rel>discount</rel></_opr>
      <var>customer</var>
      <var>product</var>
      <ind>5.0 percent</ind>
    </atom>
  </_head>
  <_body>
    <and>
      <atom>
        <_opr><rel>premium</rel></_opr>
        <var>customer</var>
      </atom>
      <atom>
        <_opr><rel>regular</rel></_opr>
        <var>product</var>
      </atom>
    </and>
  </_body>
</imp>

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

Conclusion: 
  We need shared XML Rule Markup Language and nobody have it yet in complete form!!!

> Roger L. Costello wrote:
> > Is there any XML technology that is intended for declaratively
> > expressing mathematical relationships, e.g., 
> > 
> >    Din = 2.54*Dcm (Din = distance in inches
> >                    Dcm = distance in centimeters)
> > 
> >    Tc = (5/9)*(Tf-32); (Tc = temperature in degrees Celsius, 
> >                         Tf = temperature in degrees Fahrenheit)
> > 
> >    etc.
> > 
> > Is MathML intended for this?  How about RuleML?
> 
> I don't know about RuleML. MathML should be able to specify such things, however 
> you may be introducing complexity beyond that which you would like to have (it 
> all depends on what your needs are).
> 
> Seeing your other more detailed post on this topic, I thought that you might 
> want to base some solution on XPath. For instance:
> 
> <foo:PropertyEquivalence from='measure:inch'
>                           to='measure:cm'
>                           convert='$in_1 * 2.54'/>
> 
> <foo:PropertyEquivalence from='measure:cm'
>                           to='measure:in'
>                           convert='$in_1 div 2.54'/>
> 
> would allow you to declare that the following are euquivalent:
> 
> <geo:Distance>
>    <measure:inch>2</measure:inch>
> </geo:Distance>
> 
> <geo:Distance>
>    <measure:cm>5.08</measure:cm>
> </geo:Distance>
> 
> You could allow for multiple inputs to your binding:
> 
> <foo:PropertyEquivalence
>                   from='size:width/measure:meter size:length/measure:meter'
>                   to='size:surface/measure:squareMeter'
>                   convert='$in_1 * $in_2'/>
> 
> and perhaps equivalentize, depending on whether it makes sense in that context:
> 
> <flat:Bedroom>
>    <size:width><measure:meter>4</measure:meter></size:width>
>    <size:length><measure:meter>5</measure:meter></size:length>
> </flat:Bedroom>
> 
> <flat:Bedroom>
>    <size:surface>
>      <measure:squareMeter>20</measure:squareMeter>
>    </size:surface>
> </flat:Bedroom>
> 
> so that given the first you could still query for flat:Bedrooms that are larger 
> than 20sqm.
> 
> You may need to throw in stuff from EXSLT Math if you want more than XPath provides.
> 
> -- 
> Robin Berjon <robin.berjon@expway.fr>
> Research Engineer, Expway        http://expway.fr/
> 7FC0 6F5F D864 EFB8 08CE  8E74 58E6 D5DB 4889 2488
> 
> 
> -----------------------------------------------------------------
> The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
> initiative of OASIS <http://www.oasis-open.org>
> 
> The list archives are at http://lists.xml.org/archives/xml-dev/
> 
> To subscribe or unsubscribe from this list use the subscription
> manager: <http://lists.xml.org/ob/adm.pl>
> 






 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS