</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: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:when>
<xsl:otherwise>
- <xsl:for-each select="decl[$noparams > position()]">
+ <xsl:for-each select="decl[$noparams >= position()]">
<xsl:if test="$target = 0">
<xsl:choose>
<xsl:when test="string($binder) = "LAMBDA"">
</xsl:choose>
</xsl:if>
</xsl:for-each>
- <xsl:choose>
- <xsl:when test="name(.)="PROD"">
- <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:if test="$target = 1">
+ <xsl:choose>
+ <xsl:when test="name(.)="PROD"">
+ <xsl:apply-templates select="decl[position()=$noparams+1]" mode="prod"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates select="decl[position()=$noparams+1]" mode="lambda_prop"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:param name="count" select="0"/>
<xsl:choose>
<xsl:when test="name(.) = "PROD"">
- <xsl:value-of select="count(decl)- $noparams"/>
+ <xsl:apply-templates select="target/*[1]" mode="counting">
+ <xsl:with-param name="noparams" select="$noparams"/>
+ <xsl:with-param name="count" select="$count + count(decl)"/>
+ </xsl:apply-templates>
</xsl:when>
<xsl:when test="name(.) = "CAST"">
<xsl:apply-templates select="term/*[1]" mode="counting">