<!-- http://cs.unibo.it/helm/. -->
<!--***********************************************************************-->
-<!-- XSLT version 0.1 of theory objects to theory sections: -->
+<!-- XSLT version 0.1 of theory sections to theory sections with objects -->
<!-- First draft: March 08 2001, Irene Schena -->
<!--***********************************************************************-->
</Variable>
</xsl:template>
-<!--*******************************************-->
-<!-- ABSTRACTING PARAMETERS AND COUNTING -->
-<!--*******************************************-->
-<!-- Si dimentica i CAST dei termini che astrae. Nel caso dell'astrazione -->
-<!-- dei lambda dei pattern del CASE, qualora i lambda non si trovino -->
-<!-- nella forma weak-head, astrae solo i lambda che trova e restituisce -->
-<!-- un corpo depurato da tutti i primi cast che precedono il termine -->
-<!-- restituito. -->
+</xsl:stylesheet>
+
+
-<xsl:template match="*" mode="abstparams">
-<xsl:param name="noparams" select="0"/>
-<xsl:param name="target" select="0"/>
-<xsl:param name="binder">PROD</xsl:param>
- <xsl:choose>
- <xsl:when test="($noparams != 0) and ((name(.)=string($binder)) or (name(.)="CAST"))">
- <xsl:choose>
- <xsl:when test="name(.) = string($binder)">
- <xsl:if test="$target = 0">
- <xsl:choose>
- <xsl:when test="string($binder) = "LAMBDA"">
- <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:with-param name="target" select="$target"/>
- <xsl:with-param name="binder" select="$binder"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="term/*[1]" mode="abstparams">
- <xsl:with-param name="noparams" select="$noparams"/>
- <xsl:with-param name="target" select="$target"/>
- <xsl:with-param name="binder" select="$binder"/>
- </xsl:apply-templates>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="($target = 1) and ($noparams != 0)">
- <m:apply>
- <m:csymbol>app</m:csymbol>
- <xsl:apply-templates select="."/>
- <xsl:call-template name="printparam"><xsl:with-param name="noleft" select="$noparams"/></xsl:call-template>
- </m:apply>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="$noparams != 0">
- <xsl:call-template name="printparam"><xsl:with-param name="noleft" select="$noparams"/></xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:if test="$target = 1">
- <xsl:apply-templates select="."/>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-<xsl:template name="printparam">
-<xsl:param name="noleft" select="0"/>
-<xsl:param name="number" select="1"/>
- <xsl:if test="$noleft != 0">
- <m:ci><xsl:call-template name="insert_subscript"><xsl:with-param name="node_value">$<xsl:value-of select="$number"/></xsl:with-param></xsl:call-template></m:ci>
- <xsl:call-template name="printparam"><xsl:with-param name="noleft" select="$noleft - 1"/><xsl:with-param name="number" select="$number + 1"/></xsl:call-template>
- </xsl:if>
-</xsl:template>
-<xsl:template match="*" mode="counting">
-<xsl:param name="noparams" select="0"/>
-<xsl:param name="count" select="0"/>
- <xsl:choose>
- <xsl:when test="name(.) = "PROD"">
- <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:when>
- <xsl:when test="name(.) = "CAST"">
- <xsl:apply-templates select="term/*[1]" mode="counting">
- <xsl:with-param name="noparams" select="$noparams"/>
- <xsl:with-param name="count" select="$count"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$count - $noparams"/>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-</xsl:stylesheet>
</xsl:template>
+<!--*******************************************-->
+<!-- ABSTRACTING PARAMETERS AND COUNTING -->
+<!--*******************************************-->
+<!-- Si dimentica i CAST dei termini che astrae. Nel caso dell'astrazione -->
+<!-- dei lambda dei pattern del CASE, qualora i lambda non si trovino -->
+<!-- nella forma weak-head, astrae solo i lambda che trova e restituisce -->
+<!-- un corpo depurato da tutti i primi cast che precedono il termine -->
+<!-- restituito. -->
+
+<xsl:template match="*" mode="abstparams">
+<xsl:param name="noparams" select="0"/>
+<xsl:param name="target" select="0"/>
+<xsl:param name="binder">PROD</xsl:param>
+ <xsl:choose>
+ <xsl:when test="($noparams != 0) and ((name(.)=string($binder)) or (name(.)="CAST"))">
+ <xsl:choose>
+ <xsl:when test="name(.) = string($binder)">
+ <xsl:if test="$target = 0">
+ <xsl:choose>
+ <xsl:when test="string($binder) = "LAMBDA"">
+ <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:with-param name="target" select="$target"/>
+ <xsl:with-param name="binder" select="$binder"/>
+ </xsl:apply-templates>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates select="term/*[1]" mode="abstparams">
+ <xsl:with-param name="noparams" select="$noparams"/>
+ <xsl:with-param name="target" select="$target"/>
+ <xsl:with-param name="binder" select="$binder"/>
+ </xsl:apply-templates>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="($target = 1) and ($noparams != 0)">
+ <m:apply>
+ <m:csymbol>app</m:csymbol>
+ <xsl:apply-templates select="."/>
+ <xsl:call-template name="printparam"><xsl:with-param name="noleft" select="$noparams"/></xsl:call-template>
+ </m:apply>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="$noparams != 0">
+ <xsl:call-template name="printparam"><xsl:with-param name="noleft" select="$noparams"/></xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:if test="$target = 1">
+ <xsl:apply-templates select="."/>
+ </xsl:if>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+<xsl:template name="printparam">
+<xsl:param name="noleft" select="0"/>
+<xsl:param name="number" select="1"/>
+ <xsl:if test="$noleft != 0">
+ <m:ci><xsl:call-template name="insert_subscript"><xsl:with-param name="node_value">$<xsl:value-of select="$number"/></xsl:with-param></xsl:call-template></m:ci>
+ <xsl:call-template name="printparam"><xsl:with-param name="noleft" select="$noleft - 1"/><xsl:with-param name="number" select="$number + 1"/></xsl:call-template>
+ </xsl:if>
+</xsl:template>
+
+<xsl:template match="*" mode="counting">
+<xsl:param name="noparams" select="0"/>
+<xsl:param name="count" select="0"/>
+ <xsl:choose>
+ <xsl:when test="name(.) = "PROD"">
+ <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:when>
+ <xsl:when test="name(.) = "CAST"">
+ <xsl:apply-templates select="term/*[1]" mode="counting">
+ <xsl:with-param name="noparams" select="$noparams"/>
+ <xsl:with-param name="count" select="$count"/>
+ </xsl:apply-templates>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$count - $noparams"/>
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
</xsl:stylesheet>