]> matita.cs.unibo.it Git - helm.git/commitdiff
----------------------------------------------------------------------
authorIrene Schena <irene.schena@unibo.it>
Fri, 1 Feb 2002 17:08:31 +0000 (17:08 +0000)
committerIrene Schena <irene.schena@unibo.it>
Fri, 1 Feb 2002 17:08:31 +0000 (17:08 +0000)
Modified Files:
1) arith.xsl mmlctop.xsl-0.14 mmlextension.xsl xslt_index.txt: added
mml presentation for (dis)equalities and new proof elements and some
additions for Algebra elements
Added Files:
2) mmlnotation.xsl: mml presentation notations
----------------------------------------------------------------------

helm/style/arith.xsl
helm/style/mmlextension.xsl
helm/style/mmlnotation.xsl [new file with mode: 0644]
helm/style/xslt_index.txt

index 0751b123c530f65ce246dc098430de58d4a3f24e..73616e353dda73bc167fbcb9ca015e4d794e6821 100644 (file)
@@ -61,7 +61,7 @@ and @uri='cic:/Coq/Init/Datatypes/nat.ind' and @noConstr='2']">
   <xsl:otherwise>
    <m:apply helm:xref="{$iden}">
     <m:plus/>
-    <m:ci><xsl:value-of select="$n"/></m:ci>
+    <m:cn><xsl:value-of select="$n"/></m:cn>
     <xsl:apply-templates select="." mode="pure"/>
    </m:apply>
   </xsl:otherwise>
index 6dce30b65a73b02bf009013469380fd523eb18a0..7e9bd1e5f085b1711a8a64458e66c7d9db7f211c 100644 (file)
@@ -40,10 +40,12 @@ which generates the toplevel element (see for instance xlink) -->
                               xmlns:xlink="http://www.w3.org/1999/xlink">
 
 <!-- OLD: <xsl:import href="mml2mmlv1_0.xsl"/> -->
-<xsl:import href="mmlctop.xsl-0.14"/>
+
+<xsl:import href="mmlnotation.xsl"/>
 
 <xsl:import href="mmltheoryextension.xsl"/>
 
+
 <xsl:param name="explodeall" select="false()"/>
 
 <!--***********************************************************************-->
@@ -614,7 +616,10 @@ which generates the toplevel element (see for instance xlink) -->
           <m:mtd>
            <m:mrow>
             <m:mo stretchy="false">(</m:mo>
-            <xsl:apply-templates select="*[position()=2]"/>
+<!-- added precedence to app = FUNCTION_PREC (99) -->
+            <xsl:apply-templates select="*[position()=2]">
+             <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
+            </xsl:apply-templates>
            </m:mrow>
           </m:mtd>
          </m:mtr>
@@ -623,7 +628,10 @@ which generates the toplevel element (see for instance xlink) -->
           <m:mtd>
            <m:mrow>
             <m:mphantom><m:mtext>(</m:mtext></m:mphantom>
-            <xsl:apply-templates select="."/>
+<!-- added precedence to app = FUNCTION_PREC (99) -->
+            <xsl:apply-templates select=".">
+             <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
+            </xsl:apply-templates>
            </m:mrow>
           </m:mtd>
          </m:mtr>
@@ -639,10 +647,16 @@ which generates the toplevel element (see for instance xlink) -->
        </xsl:when>
        <xsl:otherwise>
         <m:mo stretchy="false">(</m:mo>
-        <xsl:apply-templates select="*[position()=2]"/>
+<!-- added precedence to app = FUNCTION_PREC (99) -->
+        <xsl:apply-templates select="*[position()=2]">
+         <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
+        </xsl:apply-templates>
         <xsl:for-each select="*[position()>2]">
          <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
-         <xsl:apply-templates select="."/>
+<!-- added precedence to app = FUNCTION_PREC (99) -->
+         <xsl:apply-templates select=".">
+          <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
+         </xsl:apply-templates>
         </xsl:for-each>
         <m:mo stretchy="false">)</m:mo>
        </xsl:otherwise>
@@ -1000,7 +1014,7 @@ which generates the toplevel element (see for instance xlink) -->
            <m:mtr>
             <m:mtd>
              <m:mrow>
-              <m:mtext mathcolor="Maroon">We&#x00a0;can&#x00a0;prove</m:mtext>
+              <m:mtext mathcolor="Red">We&#x00a0;can&#x00a0;prove</m:mtext>
               <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
               <xsl:apply-templates select="*[position()=3]"/>
               <m:mrow>
@@ -1026,7 +1040,71 @@ which generates the toplevel element (see for instance xlink) -->
           <m:mtr>
            <m:mtd>
             <m:mrow>
-             <m:mtext mathcolor="Maroon">we&#x00a0;proved</m:mtext>
+             <m:mtext mathcolor="Red">we&#x00a0;proved</m:mtext>
+             <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
+             <xsl:apply-templates select="*[position()=3]"/>
+             <m:mrow>
+              <m:mphantom>
+               <m:mtext>_</m:mtext>
+              </m:mphantom>
+              <xsl:if test="$test">
+               <m:mtext mathcolor="Green">(hide&#x00a0;details)</m:mtext>
+              </xsl:if>
+             </m:mrow>
+            </m:mrow>
+           </m:mtd>
+          </m:mtr>
+         </m:mtable>
+        </xsl:variable>
+        <xsl:choose>
+         <xsl:when test="$test">
+          <m:maction actiontype="toggle">
+           <xsl:copy-of select="$hidden_details"/>
+           <xsl:copy-of select="$shown_details"/>
+          </m:maction>
+         </xsl:when>
+         <xsl:otherwise>
+          <xsl:copy-of select="$shown_details"/>
+         </xsl:otherwise>
+        </xsl:choose>
+      </xsl:when>
+      <!-- SIDE_PROOF -->
+      <xsl:when test="$name='side_proof'">
+        <xsl:variable name="test" select="(not($explodeall))"/>
+        <xsl:variable name="hidden_details">
+         <xsl:if test="$test">
+          <!-- Details hided (default) -->
+          <m:mtable align="baseline 1" equalrows="false" columnalign="left">
+           <m:mtr>
+            <m:mtd>
+             <m:mrow>
+              <m:mtext mathcolor="Red">We&#x00a0;can&#x00a0;prove</m:mtext>
+              <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
+              <xsl:apply-templates select="*[position()=3]"/>
+              <m:mrow>
+               <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
+               <m:mtext mathcolor="Green">(explain)</m:mtext>
+              </m:mrow>
+             </m:mrow>
+            </m:mtd>
+           </m:mtr>
+          </m:mtable>
+         </xsl:if>
+        </xsl:variable>
+        <xsl:variable name="shown_details">
+         <!-- Show details -->
+         <m:mtable align="baseline 1" equalrows="false" columnalign="left">
+          <m:mtr>
+           <m:mtd>
+            <m:mrow>
+             <xsl:apply-templates select="*[position()=2]"/>
+            </m:mrow>
+           </m:mtd>
+          </m:mtr>
+          <m:mtr>
+           <m:mtd>
+            <m:mrow>
+             <m:mtext mathcolor="Red">we&#x00a0;proved</m:mtext>
              <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
              <xsl:apply-templates select="*[position()=3]"/>
              <m:mrow>
@@ -1060,14 +1138,14 @@ which generates the toplevel element (see for instance xlink) -->
          <m:mtr>
           <m:mtd>
            <m:mrow>
-            <xsl:apply-templates select="*[2]"/>
+            <xsl:apply-templates select="*[position()=2]"/>
            </m:mrow>
           </m:mtd>
          </m:mtr>
          <m:mtr>
           <m:mtd>
            <m:mrow>
-            <xsl:apply-templates select="*[3]"/>
+            <xsl:apply-templates select="*[position()=3]"/>
            </m:mrow>
           </m:mtd>
          </m:mtr>
@@ -1078,7 +1156,7 @@ which generates the toplevel element (see for instance xlink) -->
         <m:mtr>
          <m:mtd>
           <m:mrow>
-           <m:mtext mathcolor="red">We&#x00a0;prove</m:mtext>
+           <m:mtext mathcolor="Red">We&#x00a0;prove</m:mtext>
            <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
            <xsl:apply-templates select="../*[3]"/>
           </m:mrow>
@@ -1087,7 +1165,7 @@ which generates the toplevel element (see for instance xlink) -->
         <m:mtr>
          <m:mtd>
           <m:mrow>
-           <m:mtext mathcolor="red">by&#x00a0;induction&#x00a0;on</m:mtext>
+           <m:mtext mathcolor="Red">by&#x00a0;induction&#x00a0;on</m:mtext>
            <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
            <xsl:apply-templates 
             select="*[position()=last()]/*[position()=last()]"/>
@@ -1119,7 +1197,7 @@ which generates the toplevel element (see for instance xlink) -->
         <m:mtr>
          <m:mtd>
           <m:mrow>
-           <m:mtext mathcolor="red">Case</m:mtext>
+           <m:mtext mathcolor="Red">Case</m:mtext>
            <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
            <xsl:apply-templates select="*[2]"/>
           </m:mrow>
@@ -1134,7 +1212,7 @@ which generates the toplevel element (see for instance xlink) -->
              <m:mtr>
               <m:mtd>
                <m:mrow>
-                <m:mtext mathcolor="red">By&#x00a0;induction&#x00a0;hypothesis,&#x00a0;we&#x00a0;have:</m:mtext>
+                <m:mtext mathcolor="Red">By&#x00a0;induction&#x00a0;hypothesis,&#x00a0;we&#x00a0;have:</m:mtext>
                </m:mrow>
               </m:mtd>
              </m:mtr>
@@ -1540,6 +1618,92 @@ which generates the toplevel element (see for instance xlink) -->
          </m:mtr>
         </m:mtable>
       </xsl:when>
+      <!-- EQ_CHAIN -->
+      <xsl:when test="$name='eq_chain'">
+       <m:mtable align="baseline 1" equalrows="false" columnalign="left">
+        <m:mtr>
+         <m:mtd>
+          <m:mrow>
+           <m:mtext mathcolor="Red">We&#x00a0;have&#x00a0;the&#x00a0;following&#x00a0;equality&#x00a0;chain:</m:mtext>
+          </m:mrow>
+         </m:mtd>
+        </m:mtr>
+        <xsl:for-each select="*[position() mod 2 = 0]">
+        <xsl:variable name="pos" select="position()"/>
+        <m:mtr>
+         <m:mtd>
+          <m:mrow>
+           <xsl:choose>
+           <xsl:when test="$pos = 1">
+            <xsl:apply-templates select="."/>
+            <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
+            <m:mo>=</m:mo>
+           </xsl:when>
+           <xsl:otherwise>
+            <m:mo>=</m:mo>
+            <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
+            <xsl:apply-templates select="."/>
+           </xsl:otherwise>
+           </xsl:choose>
+          </m:mrow>
+         </m:mtd>
+        </m:mtr>
+        <xsl:if test="$pos != last()">
+        <m:mtr>
+         <m:mtd>
+          <m:mrow>
+           <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
+           <xsl:apply-templates select="../*[position()=2*$pos +1]"/>
+          </m:mrow>
+         </m:mtd>
+        </m:mtr>
+        </xsl:if>
+        </xsl:for-each>
+       </m:mtable>
+      </xsl:when>
+      <!-- DISEQ_CHAIN -->
+      <xsl:when test="$name='diseq_chain'">
+       <m:mtable align="baseline 1" equalrows="false" columnalign="left">
+        <m:mtr>
+         <m:mtd>
+          <m:mrow>
+           <m:mtext mathcolor="Red">We&#x00a0;have&#x00a0;the&#x00a0;following&#x00a0;disequality&#x00a0;chain:</m:mtext>
+          </m:mrow>
+         </m:mtd>
+        </m:mtr>
+        <xsl:for-each select="*[position() mod 3 = 2]">
+        <xsl:variable name="pos" select="position()"/>
+        <m:mtr>
+         <m:mtd>
+          <m:mrow>
+           <xsl:choose>
+           <xsl:when test="$pos = 1">
+            <xsl:apply-templates select="."/>
+            <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
+            <mo><xsl:apply-templates select="../*[position()=3*$pos]"/></mo>
+           </xsl:when>
+           <xsl:otherwise>
+            <mo><xsl:apply-templates select="../*[position()=3*($pos - 1)]"/></mo>
+            <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
+            <xsl:apply-templates select="."/>
+           </xsl:otherwise>
+           </xsl:choose>
+          </m:mrow>
+         </m:mtd>
+        </m:mtr>
+        <xsl:if test="$pos != last()">
+        <m:mtr>
+         <m:mtd>
+          <m:mrow>
+           <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
+           <xsl:apply-templates select="../*[position()=3*$pos +1]"/>
+          </m:mrow>
+         </m:mtd>
+        </m:mtr>
+        </xsl:if>
+        </xsl:for-each>
+       </m:mtable>
+      </xsl:when>
       <!-- ***************************************** -->
       <!-- *********** NOTATIONS ******************* -->
       <!-- ***************************************** -->
@@ -1549,7 +1713,7 @@ which generates the toplevel element (see for instance xlink) -->
 <!-- no font for ApplyFunction: <m:mo>&#xe8a0;</m:mo> -->
         <m:mo stretchy="false">[</m:mo>
         <xsl:apply-templates select="*[4]"/>
-        <m:mo mathcolor="green">
+        <m:mo mathcolor="Green">
          <xsl:if test="$id != ''">
           <xsl:attribute name="m:xref"><xsl:value-of select="$id"/></xsl:attribute>
          </xsl:if>&#8592;</m:mo>
@@ -1559,7 +1723,7 @@ which generates the toplevel element (see for instance xlink) -->
       <!-- lift -->
       <xsl:when test="$name='lift'">
         <m:msup>
-         <m:mo mathcolor="green">
+         <m:mo mathcolor="Green">
           <xsl:if test="$id != ''">
            <xsl:attribute name="m:xref"><xsl:value-of select="$id"/></xsl:attribute>
           </xsl:if>&#8593;</m:mo>
@@ -1574,7 +1738,7 @@ which generates the toplevel element (see for instance xlink) -->
       <!-- lift_with_base -->
       <xsl:when test="$name='lift_with_base'">
         <m:msubsup>
-         <m:mo mathcolor="green">
+         <m:mo mathcolor="Green">
           <xsl:if test="$id != ''">
            <xsl:attribute name="m:xref"><xsl:value-of select="$id"/></xsl:attribute>
           </xsl:if>&#8593;</m:mo>
@@ -1591,11 +1755,11 @@ which generates the toplevel element (see for instance xlink) -->
       <xsl:when test="$name='beta_red1'">
         <xsl:apply-templates select="*[2]"/>
         <m:munder>
-         <m:mo mathcolor="green">
+         <m:mo mathcolor="Green">
           <xsl:if test="$id != ''">
            <xsl:attribute name="m:xref"><xsl:value-of select="$id"/></xsl:attribute>
           </xsl:if>&#8594;</m:mo>
-          <m:mi mathcolor="green">&#946;</m:mi>
+          <m:mi mathcolor="Green">&#946;</m:mi>
         </m:munder>
         <xsl:apply-templates select="*[3]"/>
       </xsl:when>
@@ -1603,12 +1767,12 @@ which generates the toplevel element (see for instance xlink) -->
       <xsl:when test="$name='beta_red'">
         <xsl:apply-templates select="*[2]"/>
         <m:munderover>
-         <m:mo mathcolor="green">
+         <m:mo mathcolor="Green">
           <xsl:if test="$id != ''">
            <xsl:attribute name="m:xref"><xsl:value-of select="$id"/></xsl:attribute>
           </xsl:if>&#8594;</m:mo>
-          <m:mi mathcolor="green">&#946;</m:mi>
-          <m:mi mathcolor="green">*</m:mi>
+          <m:mi mathcolor="Green">&#946;</m:mi>
+          <m:mi mathcolor="Green">*</m:mi>
         </m:munderover>
         <xsl:apply-templates select="*[3]"/>
       </xsl:when>
@@ -1616,11 +1780,11 @@ which generates the toplevel element (see for instance xlink) -->
       <xsl:when test="$name='par_beta_red1'">
         <xsl:apply-templates select="*[2]"/>
         <m:munder>
-         <m:mo mathcolor="green">
+         <m:mo mathcolor="Green">
           <xsl:if test="$id != ''">
            <xsl:attribute name="m:xref"><xsl:value-of select="$id"/></xsl:attribute>
           </xsl:if>&#8658;</m:mo>
-          <m:mi mathcolor="green">&#946;</m:mi>
+          <m:mi mathcolor="Green">&#946;</m:mi>
         </m:munder>
         <xsl:apply-templates select="*[3]"/>
       </xsl:when>
@@ -1628,12 +1792,12 @@ which generates the toplevel element (see for instance xlink) -->
       <xsl:when test="$name='par_beta_red'">
         <xsl:apply-templates select="*[2]"/>
         <m:munderover>
-         <m:mo mathcolor="green">
+         <m:mo mathcolor="Green">
           <xsl:if test="$id != ''">
            <xsl:attribute name="m:xref"><xsl:value-of select="$id"/></xsl:attribute>
           </xsl:if>&#8658;</m:mo>
-          <m:mi mathcolor="green">&#946;</m:mi>
-          <m:mi mathcolor="green">*</m:mi>
+          <m:mi mathcolor="Green">&#946;</m:mi>
+          <m:mi mathcolor="Green">*</m:mi>
         </m:munderover>
         <xsl:apply-templates select="*[3]"/>
       </xsl:when>
@@ -1649,7 +1813,7 @@ which generates the toplevel element (see for instance xlink) -->
       <!-- isomorphic -->
       <xsl:when test="$name='isomorphic'">
         <xsl:apply-templates select="*[2]"/>
-        <m:mo mathcolor="green">
+        <m:mo mathcolor="Green">
          <xsl:if test="$id != ''">
           <xsl:attribute name="m:xref"><xsl:value-of select="$id"/></xsl:attribute>
          </xsl:if>&#8773;</m:mo>
@@ -1698,7 +1862,7 @@ which generates the toplevel element (see for instance xlink) -->
          <m:mtr>
           <m:mtd>
            <m:mrow>
-            <m:mtext mathcolor="Maroon">we&#x00a0;get</m:mtext>
+            <m:mtext mathcolor="Red">we&#x00a0;get</m:mtext>
             <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
             <xsl:apply-templates select="."/>
            </m:mrow>
@@ -1716,7 +1880,7 @@ which generates the toplevel element (see for instance xlink) -->
          <m:mtr>
           <m:mtd>
            <m:mrow>
-            <m:mtext mathcolor="Maroon">we&#x00a0;get</m:mtext>
+            <m:mtext mathcolor="Red">we&#x00a0;get</m:mtext>
             <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
             <xsl:apply-templates select="."/>
            </m:mrow>
@@ -1771,282 +1935,6 @@ which generates the toplevel element (see for instance xlink) -->
     </m:mrow>
 </xsl:template>
 
-<!-- *********************************** -->
-<!-- BASE SET OF MATHML CONTENT ELEMENTS -->
-<!-- *********************************** -->
-
-<!-- Logic -->
-
-<xsl:template match = "m:apply[m:eq[1]]">
- <xsl:variable name="charlength">
-  <xsl:apply-templates select="*[1]" mode="charcount"/>
- </xsl:variable>
- <xsl:choose>
-  <xsl:when test="$charlength >= $framewidth">
-   <m:mtable align="baseline 1" equalrows="false" columnalign="left">
-    <xsl:if test="@id">
-     <xsl:attribute name="m:xref">
-      <xsl:value-of select="@id"/>
-     </xsl:attribute>
-    </xsl:if>    
-    <m:mtr>
-     <m:mtd>
-      <m:mrow>
-       <m:mo stretchy="false">(</m:mo>
-       <xsl:apply-templates select="*[position()=2]"/>
-      </m:mrow>
-     </m:mtd>
-    </m:mtr>
-    <xsl:for-each select = "*[position()>2]">
-     <m:mtr>
-      <m:mtd>
-       <m:mrow>
-        <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
-        <m:mo>
-         <xsl:if test="m:in/@id">
-          <xsl:attribute name="m:xref">
-           <xsl:value-of select="m:in/@id"/>
-          </xsl:attribute>
-         </xsl:if>=</m:mo>
-        <xsl:apply-templates select="."/>
-       </m:mrow>
-      </m:mtd>
-     </m:mtr>
-    </xsl:for-each>
-    <m:mtr>
-     <m:mtd>
-      <m:mrow>
-       <m:mo stretchy="false">)</m:mo>
-      </m:mrow>
-     </m:mtd>
-    </m:mtr>
-   </m:mtable>
-  </xsl:when>
-  <xsl:otherwise>
-   <xsl:apply-imports/>
-  </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-
-<xsl:template match = "m:apply[m:and[1]|m:or[1]
-          |m:geq[1]|m:leq[1]|m:gt[1]|m:lt[1]
-          |m:in[1]|m:intesect[1]|m:union[1]|m:subset[1]
-          |m:prsubset|m:setdiff[1]]">
- <xsl:variable name="symbol">
-  <xsl:choose>
-   <xsl:when test="m:and[1]">
-    <xsl:value-of select="'&#8743;'"/>
-   </xsl:when>
-   <xsl:when test="m:or[1]">
-    <xsl:value-of select="'&#8744;'"/>
-   </xsl:when>
-   <xsl:when test="m:geq[1]">
-    <xsl:value-of select="'&#8805;'"/>
-   </xsl:when>
-   <xsl:when test="m:leq[1]">
-    <xsl:value-of select="'&#8804;'"/>
-   </xsl:when>
-   <xsl:when test="m:gt[1]">
-    <xsl:value-of select="'&#62;'"/>
-   </xsl:when>
-   <xsl:when test="m:lt[1]">
-    <xsl:value-of select="'&#60;&#32;'"/>
-   </xsl:when>
-   <xsl:when test="m:eq[1]">
-    <xsl:value-of select="'&#61;'"/>
-   </xsl:when>
-   <xsl:when test="m:in[1]">
-    <xsl:value-of select="'&#x02208;'"/>
-   </xsl:when>
-   <xsl:when test="m:subset[1]">
-    <xsl:value-of select="'&#x02286;'"/>
-   </xsl:when>
-   <xsl:when test="m:prsubset[1]">
-    <xsl:value-of select="'&#x02282;'"/>
-   </xsl:when>
-   <xsl:when test="m:intersect[1]">
-    <xsl:value-of select="'&#x022C2;'"/>
-   </xsl:when>
-   <xsl:when test="m:union[1]">
-    <xsl:value-of select="'&#x022C3;'"/>
-   </xsl:when>
-   <xsl:when test="m:setdiff[1]">
-    <xsl:value-of select="'&#x02216;'"/>
-   </xsl:when>
-  </xsl:choose>
- </xsl:variable>
- <xsl:variable name="charlength">
-  <xsl:apply-templates select="*[1]" mode="charcount"/>
- </xsl:variable>
- <xsl:choose>
-  <xsl:when test="$charlength >= $framewidth">
-   <m:mtable align="baseline 1" equalrows="false" columnalign="left">
-    <xsl:if test="@id">
-     <xsl:attribute name="m:xref">
-      <xsl:value-of select="@id"/>
-     </xsl:attribute>
-    </xsl:if>    
-    <m:mtr>
-     <m:mtd>
-      <m:mrow>
-       <m:mo stretchy="false">(</m:mo>
-       <xsl:apply-templates select="*[position()=2]"/>
-      </m:mrow>
-     </m:mtd>
-    </m:mtr>
-    <xsl:for-each select = "*[position()>2]">
-     <m:mtr>
-      <m:mtd>
-       <m:mrow>
-        <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
-        <m:mo>
-         <xsl:if test="*[1]/@id">
-          <xsl:attribute name="m:xref">
-           <xsl:value-of select="*[1]/@id"/>
-          </xsl:attribute>
-         </xsl:if><xsl:value-of select="$symbol"/></m:mo>
-        <xsl:apply-templates select="."/>
-       </m:mrow>
-      </m:mtd>
-     </m:mtr>
-    </xsl:for-each>
-    <m:mtr>
-     <m:mtd>
-      <m:mrow>
-       <m:mo stretchy="false">)</m:mo>
-      </m:mrow>
-     </m:mtd>
-    </m:mtr>
-   </m:mtable>
-  </xsl:when>
-  <xsl:otherwise>
-   <xsl:apply-imports/>
-  </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match = "m:set">
- <xsl:choose>
-  <xsl:when test="count(child::*) = 0">
-   <m:mi>
-    <xsl:if test="@id">
-     <xsl:attribute name="m:xref">
-      <xsl:value-of select="@id"/>
-     </xsl:attribute>
-    </xsl:if>&#x02205;</m:mi>
-  </xsl:when>
-  <xsl:otherwise>
-   <xsl:variable name="charlength">
-    <xsl:apply-templates select="*[1]" mode="charcount"/>
-   </xsl:variable>
-   <xsl:choose>
-    <xsl:when test="$charlength >= $framewidth">
-     <xsl:choose>
-      <xsl:when test="name(*[1]) = 'm:bvar'">
-       <m:mtable align="baseline 1" equalrows="false" columnalign="left">
-        <m:mtr>
-         <m:mtd>
-          <m:mrow>
-           <m:mo stretchy="false">
-            <xsl:if test="@id">
-             <xsl:attribute name="m:xref">
-              <xsl:value-of select="@id"/>
-             </xsl:attribute>
-            </xsl:if>{</m:mo>
-           <xsl:apply-templates select="*[position()=1]"/>
-          </m:mrow>
-         </m:mtd>
-        </m:mtr>
-        <m:mtr>
-         <m:mtd>
-          <m:mrow>
-           <m:mphantom><m:mtext>{</m:mtext></m:mphantom>
-           <m:mo stretchy="false">|</m:mo>
-           <xsl:apply-templates select="m:condition/*[1]"/>
-          </m:mrow>
-         </m:mtd>
-        </m:mtr>
-        <m:mtr>
-         <m:mtd>
-          <m:mrow>
-           <m:mo stretchy="false">
-            <xsl:if test="@id">
-             <xsl:attribute name="m:xref">
-              <xsl:value-of select="@id"/>
-             </xsl:attribute>
-            </xsl:if>}</m:mo>
-          </m:mrow>
-         </m:mtd>
-        </m:mtr>
-       </m:mtable>
-      </xsl:when>
-      <xsl:otherwise>
-       <m:mtable align="baseline 1" equalrows="false" columnalign="left">
-        <m:mtr>
-         <m:mtd>
-          <m:mrow>
-           <m:mo stretchy="false">
-            <xsl:if test="@id">
-             <xsl:attribute name="m:xref">
-              <xsl:value-of select="@id"/>
-             </xsl:attribute>
-            </xsl:if>{</m:mo>
-           <xsl:apply-templates select="*[position()=1]"/>
-           <xsl:if test="position() != last()">
-            <mo>,</mo>
-           </xsl:if>
-          </m:mrow>
-         </m:mtd>
-        </m:mtr>
-        <xsl:for-each select = "*[position()>2]">
-         <m:mtr>
-          <m:mtd>
-           <m:mrow>
-            <m:mphantom><m:mtext>{</m:mtext></m:mphantom>
-            <xsl:apply-templates select="."/>
-            <xsl:if test="position() != last()">
-             <mo>,</mo>
-            </xsl:if>
-           </m:mrow>
-          </m:mtd>
-         </m:mtr>
-        </xsl:for-each>
-        <m:mtr>
-         <m:mtd>
-          <m:mrow>
-           <m:mo stretchy="false">
-            <xsl:if test="@id">
-             <xsl:attribute name="m:xref">
-              <xsl:value-of select="@id"/>
-             </xsl:attribute>
-            </xsl:if>}</m:mo>
-          </m:mrow>
-         </m:mtd>
-        </m:mtr>
-       </m:mtable>
-      </xsl:otherwise>
-     </xsl:choose>
-    </xsl:when>
-    <xsl:otherwise>
-     <xsl:apply-imports/>
-    </xsl:otherwise>
-   </xsl:choose>
-  </xsl:otherwise>
- </xsl:choose>
-</xsl:template>      
-
-<xsl:template match = "m:apply[m:card[1]]">
-  <m:mfenced open="|" close="|" stretchy="false">
-    <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-      <xsl:attribute name="m:xref">
-        <xsl:value-of select="@id"/>
-      </xsl:attribute>
-    </xsl:if>
-  <xsl:apply-templates select="*[2]"/>
-  </m:mfenced>
-</xsl:template>
-
 
 <!--**********************-->
 <!--       COUNTING       -->
@@ -2129,3 +2017,4 @@ which generates the toplevel element (see for instance xlink) -->
 </xsl:template>
 
 </xsl:stylesheet> 
+
diff --git a/helm/style/mmlnotation.xsl b/helm/style/mmlnotation.xsl
new file mode 100644 (file)
index 0000000..a89a2e4
--- /dev/null
@@ -0,0 +1,343 @@
+<?xml version="1.0"?>
+
+<!-- Copyright (C) 2000, HELM Team                                     -->
+<!--                                                                   -->
+<!-- This file is part of HELM, an Hypertextual, Electronic            -->
+<!-- Library of Mathematics, developed at the Computer Science         -->
+<!-- Department, University of Bologna, Italy.                         -->
+<!--                                                                   -->
+<!-- HELM is free software; you can redistribute it and/or             -->
+<!-- modify it under the terms of the GNU General Public License       -->
+<!-- as published by the Free Software Foundation; either version 2    -->
+<!-- of the License, or (at your option) any later version.            -->
+<!--                                                                   -->
+<!-- HELM is distributed in the hope that it will be useful,           -->
+<!-- but WITHOUT ANY WARRANTY; without even the implied warranty of    -->
+<!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the     -->
+<!-- GNU General Public License for more details.                      -->
+<!--                                                                   -->
+<!-- You should have received a copy of the GNU General Public License -->
+<!-- along with HELM; if not, write to the Free Software               -->
+<!-- Foundation, Inc., 59 Temple Place - Suite 330, Boston,            -->
+<!-- MA  02111-1307, USA.                                              -->
+<!--                                                                   -->
+<!-- For details, see the HELM World-Wide-Web page,                    -->
+<!-- http://cs.unibo.it/helm/.                                         -->
+
+<!--***********************************************************************--> 
+<!-- Notational extensions to the XSLT version 0.07 of MathML content      -->
+<!-- to presentation:                                                      -->
+<!-- First draft: February 19 2000, Andrea Asperti, Irene Schena           -->
+<!-- Revised: March 3 2000, Irene Schena                                   -->
+<!-- Revised: March 15 2000, Claudio Sacerdoti Coen, Irene Schena          -->
+<!-- Revised: March 21 2000, Irene Schena                                  -->
+<!--***********************************************************************--> 
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                              xmlns:m="http://www.w3.org/1998/Math/MathML">
+
+<xsl:import href="mmlctop.xsl-0.14"/>
+
+
+<!-- *********************************** -->
+<!-- BASE SET OF MATHML CONTENT ELEMENTS -->
+<!-- *********************************** -->
+
+<!-- Logic -->
+
+<xsl:template match = "m:apply[m:eq[1]]">
+ <xsl:variable name="charlength">
+  <xsl:apply-templates select="*[1]" mode="charcount"/>
+ </xsl:variable>
+ <xsl:choose>
+  <xsl:when test="$charlength >= $framewidth">
+   <m:mtable align="baseline 1" equalrows="false" columnalign="left">
+    <xsl:if test="@id">
+     <xsl:attribute name="m:xref">
+      <xsl:value-of select="@id"/>
+     </xsl:attribute>
+    </xsl:if>    
+    <m:mtr>
+     <m:mtd>
+      <m:mrow>
+       <m:mo stretchy="false">(</m:mo>
+       <xsl:apply-templates select="*[position()=2]"/>
+      </m:mrow>
+     </m:mtd>
+    </m:mtr>
+    <xsl:for-each select = "*[position()>2]">
+     <m:mtr>
+      <m:mtd>
+       <m:mrow>
+        <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
+        <m:mo>
+         <xsl:if test="m:in/@id">
+          <xsl:attribute name="m:xref">
+           <xsl:value-of select="m:in/@id"/>
+          </xsl:attribute>
+         </xsl:if>=</m:mo>
+        <xsl:apply-templates select="."/>
+       </m:mrow>
+      </m:mtd>
+     </m:mtr>
+    </xsl:for-each>
+    <m:mtr>
+     <m:mtd>
+      <m:mrow>
+       <m:mo stretchy="false">)</m:mo>
+      </m:mrow>
+     </m:mtd>
+    </m:mtr>
+   </m:mtable>
+  </xsl:when>
+  <xsl:otherwise>
+   <xsl:apply-imports/>
+  </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+
+<xsl:template match = "m:apply[m:and[1]|m:or[1]
+          |m:geq[1]|m:leq[1]|m:gt[1]|m:lt[1]
+          |m:in[1]|m:intesect[1]|m:union[1]|m:subset[1]
+          |m:prsubset|m:setdiff[1]]">
+ <xsl:variable name="symbol">
+  <xsl:choose>
+   <xsl:when test="m:and[1]">
+    <xsl:value-of select="'&#8743;'"/>
+   </xsl:when>
+   <xsl:when test="m:or[1]">
+    <xsl:value-of select="'&#8744;'"/>
+   </xsl:when>
+   <xsl:when test="m:geq[1]">
+    <xsl:value-of select="'&#8805;'"/>
+   </xsl:when>
+   <xsl:when test="m:leq[1]">
+    <xsl:value-of select="'&#8804;'"/>
+   </xsl:when>
+   <xsl:when test="m:gt[1]">
+    <xsl:value-of select="'&#62;'"/>
+   </xsl:when>
+   <xsl:when test="m:lt[1]">
+    <xsl:value-of select="'&#60;&#32;'"/>
+   </xsl:when>
+   <xsl:when test="m:eq[1]">
+    <xsl:value-of select="'&#61;'"/>
+   </xsl:when>
+   <xsl:when test="m:in[1]">
+    <xsl:value-of select="'&#x02208;'"/>
+   </xsl:when>
+   <xsl:when test="m:subset[1]">
+    <xsl:value-of select="'&#x02286;'"/>
+   </xsl:when>
+   <xsl:when test="m:prsubset[1]">
+    <xsl:value-of select="'&#x02282;'"/>
+   </xsl:when>
+   <xsl:when test="m:intersect[1]">
+    <xsl:value-of select="'&#x022C2;'"/>
+   </xsl:when>
+   <xsl:when test="m:union[1]">
+    <xsl:value-of select="'&#x022C3;'"/>
+   </xsl:when>
+   <xsl:when test="m:setdiff[1]">
+    <xsl:value-of select="'&#x02216;'"/>
+   </xsl:when>
+  </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="charlength">
+  <xsl:apply-templates select="*[1]" mode="charcount"/>
+ </xsl:variable>
+ <xsl:choose>
+  <xsl:when test="$charlength >= $framewidth">
+   <m:mtable align="baseline 1" equalrows="false" columnalign="left">
+    <xsl:if test="@id">
+     <xsl:attribute name="m:xref">
+      <xsl:value-of select="@id"/>
+     </xsl:attribute>
+    </xsl:if>    
+    <m:mtr>
+     <m:mtd>
+      <m:mrow>
+       <m:mo stretchy="false">(</m:mo>
+       <xsl:apply-templates select="*[position()=2]"/>
+      </m:mrow>
+     </m:mtd>
+    </m:mtr>
+    <xsl:for-each select = "*[position()>2]">
+     <m:mtr>
+      <m:mtd>
+       <m:mrow>
+        <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
+        <m:mo>
+         <xsl:if test="*[1]/@id">
+          <xsl:attribute name="m:xref">
+           <xsl:value-of select="*[1]/@id"/>
+          </xsl:attribute>
+         </xsl:if><xsl:value-of select="$symbol"/></m:mo>
+        <xsl:apply-templates select="."/>
+       </m:mrow>
+      </m:mtd>
+     </m:mtr>
+    </xsl:for-each>
+    <m:mtr>
+     <m:mtd>
+      <m:mrow>
+       <m:mo stretchy="false">)</m:mo>
+      </m:mrow>
+     </m:mtd>
+    </m:mtr>
+   </m:mtable>
+  </xsl:when>
+  <xsl:otherwise>
+   <xsl:apply-imports/>
+  </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+<xsl:template match = "m:set">
+ <xsl:choose>
+  <xsl:when test="count(child::*) = 0">
+   <m:mi>
+    <xsl:if test="@id">
+     <xsl:attribute name="m:xref">
+      <xsl:value-of select="@id"/>
+     </xsl:attribute>
+    </xsl:if>&#x02205;</m:mi>
+  </xsl:when>
+  <xsl:otherwise>
+   <xsl:variable name="charlength">
+    <xsl:apply-templates select="*[1]" mode="charcount"/>
+   </xsl:variable>
+   <xsl:choose>
+    <xsl:when test="$charlength >= $framewidth">
+     <xsl:choose>
+      <xsl:when test="name(*[1]) = 'm:bvar'">
+       <m:mtable align="baseline 1" equalrows="false" columnalign="left">
+        <m:mtr>
+         <m:mtd>
+          <m:mrow>
+           <m:mo stretchy="false">
+            <xsl:if test="@id">
+             <xsl:attribute name="m:xref">
+              <xsl:value-of select="@id"/>
+             </xsl:attribute>
+            </xsl:if>{</m:mo>
+           <xsl:apply-templates select="*[position()=1]"/>
+          </m:mrow>
+         </m:mtd>
+        </m:mtr>
+        <m:mtr>
+         <m:mtd>
+          <m:mrow>
+           <m:mphantom><m:mtext>{</m:mtext></m:mphantom>
+           <m:mo stretchy="false">|</m:mo>
+           <xsl:apply-templates select="m:condition/*[1]"/>
+          </m:mrow>
+         </m:mtd>
+        </m:mtr>
+        <m:mtr>
+         <m:mtd>
+          <m:mrow>
+           <m:mo stretchy="false">
+            <xsl:if test="@id">
+             <xsl:attribute name="m:xref">
+              <xsl:value-of select="@id"/>
+             </xsl:attribute>
+            </xsl:if>}</m:mo>
+          </m:mrow>
+         </m:mtd>
+        </m:mtr>
+       </m:mtable>
+      </xsl:when>
+      <xsl:otherwise>
+       <m:mtable align="baseline 1" equalrows="false" columnalign="left">
+        <m:mtr>
+         <m:mtd>
+          <m:mrow>
+           <m:mo stretchy="false">
+            <xsl:if test="@id">
+             <xsl:attribute name="m:xref">
+              <xsl:value-of select="@id"/>
+             </xsl:attribute>
+            </xsl:if>{</m:mo>
+           <xsl:apply-templates select="*[position()=1]"/>
+           <xsl:if test="position() != last()">
+            <mo>,</mo>
+           </xsl:if>
+          </m:mrow>
+         </m:mtd>
+        </m:mtr>
+        <xsl:for-each select = "*[position()>2]">
+         <m:mtr>
+          <m:mtd>
+           <m:mrow>
+            <m:mphantom><m:mtext>{</m:mtext></m:mphantom>
+            <xsl:apply-templates select="."/>
+            <xsl:if test="position() != last()">
+             <mo>,</mo>
+            </xsl:if>
+           </m:mrow>
+          </m:mtd>
+         </m:mtr>
+        </xsl:for-each>
+        <m:mtr>
+         <m:mtd>
+          <m:mrow>
+           <m:mo stretchy="false">
+            <xsl:if test="@id">
+             <xsl:attribute name="m:xref">
+              <xsl:value-of select="@id"/>
+             </xsl:attribute>
+            </xsl:if>}</m:mo>
+          </m:mrow>
+         </m:mtd>
+        </m:mtr>
+       </m:mtable>
+      </xsl:otherwise>
+     </xsl:choose>
+    </xsl:when>
+    <xsl:otherwise>
+     <xsl:apply-imports/>
+    </xsl:otherwise>
+   </xsl:choose>
+  </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>      
+
+<xsl:template match = "m:apply[m:card[1]]">
+  <m:mfenced open="|" close="|" stretchy="false">
+    <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
+      <xsl:attribute name="m:xref">
+        <xsl:value-of select="@id"/>
+      </xsl:attribute>
+    </xsl:if>
+  <xsl:apply-templates select="*[2]"/>
+  </m:mfenced>
+</xsl:template>
+
+
+<xsl:template match = "m:eq[((preceding-sibling::*/text()='eq_chain') or (preceding-sibling::*/text()='diseq_chain'))] | m:neq[((preceding-sibling::*/text()='eq_chain') or (preceding-sibling::*/text()='diseq_chain'))] | m:lt[((preceding-sibling::*/text()='eq_chain') or (preceding-sibling::*/text()='diseq_chain'))] | m:gt[((preceding-sibling::*/text()='eq_chain') or (preceding-sibling::*/text()='diseq_chain'))] | m:leq[((preceding-sibling::*/text()='eq_chain') or (preceding-sibling::*/text()='diseq_chain'))] | m:geq[((preceding-sibling::*/text()='eq_chain') or (preceding-sibling::*/text()='diseq_chain'))]">
+  <xsl:choose>
+  <xsl:when test="local-name(.) = 'neq'">
+   <xsl:value-of select="'&#8800;'"/>
+  </xsl:when>
+  <xsl:when test="local-name(.) = 'lt'">
+   <xsl:value-of select="'&#60;&#32;'"/>
+  </xsl:when>
+  <xsl:when test="local-name(.) = 'gt'">
+   <xsl:value-of select="'&#62;'"/>
+  </xsl:when>
+  <xsl:when test="local-name(.) = 'leq'">
+   <xsl:value-of select="'&#8804;'"/>
+  </xsl:when>
+  <xsl:when test="local-name(.) = 'geq'">
+   <xsl:value-of select="'&#8805;'"/>
+  </xsl:when>
+  <xsl:otherwise>
+   <xsl:value-of select="'&#61;'"/>
+  </xsl:otherwise>
+  </xsl:choose>       
+</xsl:template>
+
+
+</xsl:stylesheet>
\ No newline at end of file
index 0ae6f66a700f939d51ace1682db8e909a4718fae..8028625ceff8209991ace0b6f472d592500274d6 100644 (file)
@@ -24,6 +24,7 @@ mk_meta_graph.xsl
 mk_meta_theory.xsl
 mmlctop.xsl-0.14
 mmlextension.xsl
+mmlnotation.xsl
 mmltheoryextension.xsl
 objcontent.xsl
 objtheorycontent.xsl