]> matita.cs.unibo.it Git - helm.git/commitdiff
----------------------------------------------------------------------
authorIrene Schena <irene.schena@unibo.it>
Wed, 25 Jul 2001 12:16:02 +0000 (12:16 +0000)
committerIrene Schena <irene.schena@unibo.it>
Wed, 25 Jul 2001 12:16:02 +0000 (12:16 +0000)
Modified Files:
1) content.xsl content_to_html.xsl mmlextension.xsl: added MML
piecewise for Mutcase patterns
----------------------------------------------------------------------

helm/style/content.xsl
helm/style/content_to_html.xsl
helm/style/mmlextension.xsl

index 697624810147482ad5340d17a61d2b1624b04d14..2ce29b43ad68cf7f4299d7c44d87273a70c1625f 100644 (file)
@@ -209,9 +209,13 @@ Amaya o da chi di dovere in /really_very_local/helm/PARSER/example/.../]
      <xsl:apply-templates select="patternsType/*[1]" mode="noannot"/>
      <xsl:apply-templates select="inductiveTerm/*[1]" mode="noannot"/>
      <xsl:variable name="nop"><xsl:value-of select="document(concat(string($absPath),$Turi))/InductiveDefinition/@noParams"/></xsl:variable>
+<piecewise>
      <xsl:for-each select="pattern">
       <xsl:variable name="pos" select="position()"/>
       <xsl:variable name="nopar"><xsl:apply-templates select="document(concat(string($absPath),$Turi))/InductiveDefinition/InductiveType[position()=number($Tindex)+1]/Constructor[position()=number($pos)]/*[1]" mode="counting"><xsl:with-param name="noparams" select="$nop"/></xsl:apply-templates></xsl:variable>
+<piece>
+      <xsl:apply-templates select="./*[1]" mode="abstparams"><xsl:with-param name="noparams" select="$nopar"/><xsl:with-param name="target" select="1"/><xsl:with-param name="binder">LAMBDA</xsl:with-param></xsl:apply-templates>
+
       <xsl:choose>
       <xsl:when test="$nopar = 0">
        <m:ci>
@@ -228,8 +232,9 @@ Amaya o da chi di dovere in /really_very_local/helm/PARSER/example/.../]
         </m:apply>
        </xsl:otherwise>
        </xsl:choose>
-      <xsl:apply-templates select="./*[1]" mode="abstparams"><xsl:with-param name="noparams" select="$nopar"/><xsl:with-param name="target" select="1"/><xsl:with-param name="binder">LAMBDA</xsl:with-param></xsl:apply-templates>
-     </xsl:for-each> 
+</piece>
+     </xsl:for-each>
+</piecewise> 
     </m:apply>
 </xsl:template>
 
index 6e89d8cd9aca806496587743ff5eda61e868042f..110732e912a07b60ffd18a77469e79665496decf 100644 (file)
      <FONT color="red">CASE </FONT>
      <xsl:apply-templates mode="inline" select="*[position()=3]"/>
      <FONT color="red"> OF </FONT>
-     <xsl:for-each select="*[position() mod 2 = 0 and position()>3]">
+     <xsl:for-each select="piecewise/piece">
       <xsl:choose>
        <xsl:when test="not(position() = 1)">
         <xsl:text> | </xsl:text> 
        </xsl:when> 
       </xsl:choose>
-      <xsl:apply-templates mode="inline" select="."/>
+      <xsl:apply-templates mode="inline" select="./*[2]"/>
       <xsl:call-template name="mksymbol-1">
        <xsl:with-param name="symbol" select="'RightArrow'"/>
        <xsl:with-param name="color" select="'green'"/>
        <xsl:with-param name="size" select="'+0'"/>
       </xsl:call-template>
       <xsl:apply-templates mode="inline"
-           select="following-sibling::*[position()= 1]"/>
+           select="./*[1]"/>
      </xsl:for-each>
     </xsl:when>
     <!-- FIX -->
           <xsl:with-param name="current_indent" select="$current_indent + 8"/>
          </xsl:apply-templates>
          <xsl:text> OF </xsl:text> 
-         <xsl:for-each select="*[position() mod 2 = 0 and position()>3]">
+         <xsl:for-each select="piecewise/piece">
          <br/>
          <xsl:call-template name="make_indent">
           <xsl:with-param name="current_indent" select="$current_indent + 2"/> 
              <xsl:text>| </xsl:text>
             </xsl:otherwise>
             </xsl:choose>
-            <xsl:apply-templates select="."/>
+            <xsl:apply-templates select="./*[2]"/>
             <xsl:call-template name="mksymbol-1">
              <xsl:with-param name="symbol" select="'RightArrow'"/>
              <xsl:with-param name="color" select="'green'"/>
              <xsl:with-param name="size" select="'+0'"/>
             </xsl:call-template>
             <xsl:variable name="body_size">
-             <xsl:apply-templates 
-              select="following-sibling::*[1]/*[1]" mode="charcount"/>
+            <xsl:apply-templates select="./*[2]" mode="charcount"/>
             </xsl:variable>
             <xsl:choose>
              <xsl:when test="$body_size > $framewidth">
index 6572c0556c3f93890248c12c0fe70365fbbefaaf..21225aa8638e98d0211d15eccc6a4d0ee7498f47 100644 (file)
@@ -737,8 +737,8 @@ which generates the toplevel element (see for instance xlink) -->
            </m:mrow>
           </m:mtd>
          </m:mtr>
-         <xsl:for-each select="*[position() mod 2 = 0 and position()>3]">
-         <xsl:variable name="charlength"><xsl:apply-templates select="." mode="charcount"><xsl:with-param name="nosibling" select="1"/></xsl:apply-templates></xsl:variable>
+         <xsl:for-each select="piecewise/piece">
+         <xsl:variable name="charlength"><xsl:apply-templates select="./*[2]" mode="charcount"><xsl:with-param name="nosibling" select="1"/></xsl:apply-templates></xsl:variable>
          <m:mtr>
           <m:mtd>
            <m:mrow>
@@ -751,10 +751,10 @@ which generates the toplevel element (see for instance xlink) -->
             </xsl:otherwise>
             </xsl:choose>
             <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
-            <xsl:apply-templates select="."/>
+            <xsl:apply-templates select="./*[2]"/>
             <xsl:if test="$framewidth > $charlength">
              <m:mo mathcolor="Green">&#x21d2;</m:mo>
-             <xsl:apply-templates select="following-sibling::*[position()= 1]"/>
+             <xsl:apply-templates select="./*[1]"/>
             </xsl:if>
            </m:mrow>
           </m:mtd>
@@ -765,7 +765,7 @@ which generates the toplevel element (see for instance xlink) -->
            <m:mrow>
             <m:mphantom><m:mtext>|_</m:mtext></m:mphantom>  
             <m:mo mathcolor="Green">&#x21d2;</m:mo>
-            <xsl:apply-templates select="following-sibling::*[position()= 1]"/>
+            <xsl:apply-templates select="./*[1]"/>
            </m:mrow>
           </m:mtd>
          </m:mtr>
@@ -787,15 +787,15 @@ which generates the toplevel element (see for instance xlink) -->
         <xsl:apply-templates select="*[position()=3]"/>
         <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
         <m:mo>OF</m:mo>
-        <xsl:for-each select="*[position() mod 2 = 0 and position()>3]">
+        <xsl:for-each select="piecewise/piece">
          <xsl:choose>
          <xsl:when test="position() != 1">
           <m:mo stretchy="false">|</m:mo>
          </xsl:when> 
          </xsl:choose>
-         <xsl:apply-templates select="."/>
+         <xsl:apply-templates select="./*[2]"/>
          <m:mo mathcolor="Green">&#x21d2;</m:mo>
-         <xsl:apply-templates select="following-sibling::*[position()= 1]"/>
+         <xsl:apply-templates select="./*[1]"/>
         </xsl:for-each>
         <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
         <m:mo>END</m:mo>