]> matita.cs.unibo.it Git - helm.git/commitdiff
Modified mode "abstparam" due to changes to LAMBDA and PROD. To verify if there are...
authorMatteo Selmi <matteo.selmi@mail.polimi.it>
Wed, 6 Nov 2002 15:15:27 +0000 (15:15 +0000)
committerMatteo Selmi <matteo.selmi@mail.polimi.it>
Wed, 6 Nov 2002 15:15:27 +0000 (15:15 +0000)
helm/style/params.xsl

index b5b7f9b88ee7357497be3ec9d189cc76bf11245e..3d16f62e2af2836ce8e52d3cfe106dfee2591f4d 100644 (file)
     <xsl:when test="($noparams != 0) and ((name(.)=string($binder)) or (name(.)=&quot;CAST&quot;))">
      <xsl:choose>
      <xsl:when test="name(.) = string($binder)">
-      <xsl:if test="$target = 0">
-       <xsl:choose>
-       <xsl:when test="string($binder) = &quot;LAMBDA&quot;">
-        <m:ci>
-         <xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="target/@binder"/></xsl:with-param></xsl:call-template>
-        </m:ci>
-       </xsl:when>
-       <xsl:otherwise> 
-        <Param name="{target/@binder}">
-         <xsl:apply-templates select="source"/>
-        </Param>
-       </xsl:otherwise>
-       </xsl:choose>
-      </xsl:if>
-      <xsl:apply-templates select="target/*[1]" mode="abstparams">
-       <xsl:with-param name="noparams" select="$noparams - 1"/>
+      <xsl:choose>
+       <xsl:when test="$noparams >= count(decl)">
+        <xsl:for-each select="decl">
+         <xsl:if test="$target = 0">
+          <xsl:choose>
+          <xsl:when test="string($binder) = &quot;LAMBDA&quot;">
+           <m:ci>
+            <xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="@binder"/></xsl:with-param></xsl:call-template>
+           </m:ci>
+          </xsl:when>
+          <xsl:otherwise> 
+           <Param name="{@binder}">
+            <xsl:apply-templates select="*[1]"/>
+           </Param>
+          </xsl:otherwise>
+          </xsl:choose>
+         </xsl:if> 
+       </xsl:for-each>
+        <xsl:apply-templates select="target/*[1]" mode="abstparams">
+       <xsl:with-param name="noparams" select="$noparams - count(decl)"/>
        <xsl:with-param name="target" select="$target"/>
        <xsl:with-param name="binder" select="$binder"/>
-      </xsl:apply-templates>
+        </xsl:apply-templates>
+       </xsl:when>
+       <xsl:otherwise>
+        <xsl:for-each select="decl[$noparams > position()]">
+         <xsl:if test="$target = 0">
+          <xsl:choose>
+          <xsl:when test="string($binder) = &quot;LAMBDA&quot;">
+           <m:ci>
+            <xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="@binder"/></xsl:with-param></xsl:call-template>
+           </m:ci>
+          </xsl:when>
+          <xsl:otherwise> 
+           <Param name="{@binder}">
+            <xsl:apply-templates select="*[1]"/>
+           </Param>
+          </xsl:otherwise>
+          </xsl:choose>
+         </xsl:if> 
+       </xsl:for-each>
+        <xsl:choose>
+        <xsl:when test="name(.)=&quot;PROD&quot;">
+         <xsl:apply-templates select="decl[position()=$noparams]" mode="prod"/>
+        </xsl:when>
+        <xsl:otherwise>
+         <xsl:apply-templates select="decl[position()=$noparams]" mode="lambda"/>
+        </xsl:otherwise>
+       </xsl:choose>
+       </xsl:otherwise>
+      </xsl:choose>
      </xsl:when>
      <xsl:otherwise>
       <xsl:apply-templates select="term/*[1]" mode="abstparams">
 <xsl:param name="count" select="0"/>
  <xsl:choose>
  <xsl:when test="name(.) = &quot;PROD&quot;">
-  <xsl:apply-templates select="target/*[1]" mode="counting">
-   <xsl:with-param name="noparams" select="$noparams"/>
-   <xsl:with-param name="count" select="$count + 1"/>
-  </xsl:apply-templates>
+  <xsl:value-of select="count(decl)- $noparams"/>
  </xsl:when>
  <xsl:when test="name(.) = &quot;CAST&quot;">
   <xsl:apply-templates select="term/*[1]" mode="counting">