<xsl:when test="contains($uri,'_ind.con')">
<xsl:variable name="ind_uri"
select="concat(substring-before($uri,'_ind.con'),'.ind')"/>
+ <xsl:variable name="InductiveTypeUrl"><xsl:call-template name="URLofURI4getter"><xsl:with-param name="uri" select="$ind_uri"/></xsl:call-template></xsl:variable>
<xsl:variable name="inductive_def"
- select="document(concat(string($absPath),$ind_uri))/InductiveDefinition"/>
+ select="document($InductiveTypeUrl)/InductiveDefinition"/>
<!-- check if the corresponding inductive definition actually
exists -->
<xsl:choose>
<xsl:apply-templates mode="noannot" select="*[5]"/>
<xsl:apply-templates mode="pure" select="*[3]"/>
<xsl:apply-templates mode="pure" select="*[6]"/>
- <xsl:apply-templates mode="proof_transform" select="*[7]"/>
+ <xsl:call-template name="generate_side_proof">
+ <xsl:with-param name="proof" select="*[7]"/>
+ </xsl:call-template>
+ <!-- <xsl:apply-templates mode="proof_transform" select="*[7]"/> -->
</m:apply>
</xsl:when>
<!-- EQUALITY with extra-parameters -->
<xsl:apply-templates mode="noannot" select="*[5]"/>
<xsl:apply-templates mode="pure" select="*[3]"/>
<xsl:apply-templates mode="pure" select="*[6]"/>
- <xsl:apply-templates mode="pure" select="*[7]"/>
+ <xsl:call-template name="generate_side_proof">
+ <xsl:with-param name="proof" select="*[7]"/>
+ </xsl:call-template>
+ <!-- <xsl:apply-templates mode="pure" select="*[7]"/> -->
</m:apply>
<xsl:apply-templates mode="noannot" select="*[position()>7]"/>
</m:apply>
</m:ci>
<xsl:apply-templates mode="pure" select="*[3]"/>
<xsl:apply-templates mode="pure" select="*[6]"/>
- <xsl:apply-templates mode="pure" select="*[7]"/>
+ <xsl:call-template name="generate_side_proof">
+ <xsl:with-param name="proof" select="*[7]"/>
+ </xsl:call-template>
+ <!-- <xsl:apply-templates mode="pure" select="*[7]"/> -->
</m:apply>
<xsl:apply-templates mode="flat" select="*[8]">
<xsl:with-param name="n">
<m:csymbol>rw_step</m:csymbol>
<xsl:apply-templates mode="pure" select="*[5]"/>
<xsl:apply-templates mode="pure" select="*[3]"/>
- <xsl:apply-templates mode="pure" select="*[6]"/>
- <xsl:apply-templates mode="pure" select="*[7]"/>
+ <xsl:apply-templates mode="pure" select="*[6]"/>
+ <xsl:call-template name="generate_side_proof">
+ <xsl:with-param name="proof" select="*[7]"/>
+ </xsl:call-template>
+ <!-- <xsl:apply-templates mode="pure" select="*[7]"/> -->
</m:apply>
<xsl:apply-templates mode="flat" select="*[8]">
<xsl:with-param name="n">
<xsl:apply-templates mode="noannot" select="target/*[1]/*[5]"/>
<xsl:apply-templates mode="pure" select="target/*[1]/*[3]"/>
<xsl:apply-templates mode="pure" select="target/*[1]/*[6]"/>
- <xsl:apply-templates mode="proof_transform" select="target/*[1]/*[7]"/>
+ <xsl:call-template name="generate_side_proof">
+ <xsl:with-param name="proof" select="target/*[1]/*[7]"/>
+ </xsl:call-template>
+ <!-- <xsl:apply-templates mode="proof_transform" select="target/*[1]/*[7]"/> -->
</m:apply>
</xsl:when>
<xsl:otherwise>
</xsl:choose>
</xsl:template>
+<xsl:template name="is_simple">
+ <xsl:param name="proof" select="/.."/>
+ <xsl:value-of select="(count($proof/*)=0) or ((name($proof)='APPLY') and (count($proof/*[@sort='Prop' and (name(.)='LAMBDA' or name(.)='LETIN' or name(.)='APPLY' or name(.)='MUTCASE' or name(.)='FIX' or name(.)='COFIX')]) = 0))"/>
+</xsl:template>
+
+<xsl:template name="generate_side_proof">
+ <xsl:param name="proof" select="/.."/>
+<!--
+ <xsl:variable name="is_simple">
+ <xsl:call-template name="is_simple">
+ <xsl:with-param name="proof" select="$proof"/>
+ </xsl:call-template>
+ </xsl:variable> -->
+<xsl:variable name="is_simple" select="(count($proof/*)=0) or ((name($proof)='APPLY') and (count($proof/*[@sort='Prop' and (name(.)='LAMBDA' or name(.)='LETIN' or name(.)='APPLY' or name(.)='MUTCASE' or name(.)='FIX' or name(.)='COFIX')]) = 0))"/>
+ <xsl:choose>
+ <xsl:when test="$is_simple">
+ <xsl:choose>
+ <xsl:when test="name($proof)='APPLY'">
+ <xsl:apply-templates select="$proof" mode="letin"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates select="$proof" mode="pure"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates select="$proof" mode="noannot"/>
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+<xsl:variable name="no_subproofs" select="count(*[@sort='Prop' and (name(.)='LAMBDA' or name(.)='LETIN' or name(.)='APPLY' or name(.)='MUTCASE' or name(.)='FIX' or name(.)='COFIX')])"/>
<xsl:template match="APPLY" mode="letin">
<xsl:variable name="no_subproofs" select="count(*[@sort='Prop' and (name(.)='LAMBDA' or name(.)='LETIN' or name(.)='APPLY' or name(.)='MUTCASE' or name(.)='FIX' or name(.)='COFIX')])"/>
<m:ci>.</m:ci>
</xsl:otherwise>
</xsl:choose>
- <xsl:apply-templates mode="previous" select="following-sibling::*[1]"/>
+ <xsl:apply-templates mode="erase" select="following-sibling::*[1]"/>
</xsl:template>
<xsl:template match="*" mode="previous">
<xsl:choose>
- <xsl:when test="$naturalLanguage='yes' and(@sort='Prop' and (name(.)='LAMBDA' or name(.)='LETIN' or name(.)='APPLY' or name(.)='MUTCASE' or name(.)='FIX' or name(.)='COFIX'))">
+ <xsl:when test="$naturalLanguage='yes' and @sort='Prop' and (name(.)='LAMBDA' or name(.)='LETIN' or name(.)='APPLY' or name(.)='MUTCASE' or name(.)='FIX' or name(.)='COFIX')">
<m:ci>previous</m:ci>
</xsl:when>
<xsl:otherwise>
+ <!-- forse bisognerebbe trattare solo l'elemento di testa -->
<xsl:choose>
- <xsl:when test="@sort='Prop' or $naturalLanguage='no' ">
+ <xsl:when test="@sort='Prop' or $naturalLanguage='no'">
<xsl:apply-templates mode="pure" select="."/>
</xsl:when>
<xsl:otherwise>
<xsl:param name="n" select="1"/>
<xsl:variable name="id" select="@id"/>
<xsl:choose>
- <!-- <xsl:when test="key('typeid',@id)"> -->
- <!-- <xsl:when test="$InnerTypes/InnerTypes/TYPE[@of=$id]"> -->
<xsl:when test="$naturalLanguage='yes' and @sort='Prop' and (name(.)='LAMBDA' or name(.)='LETIN' or name(.)='APPLY' or name(.)='MUTCASE' or name(.)='FIX' or name(.)='COFIX')">
<m:ci>
<xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="concat('h',$n)"/></xsl:with-param></xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
- <xsl:when test="@sort='Prop' or $naturalLanguage='no'">
- <xsl:apply-templates mode="pure" select="."/>
- </xsl:when>
- <xsl:otherwise>
- <m:ci>.</m:ci>
- </xsl:otherwise>
+ <xsl:when test="name()='REL' or @sort='Prop' or $naturalLanguage='no'">
+ <xsl:apply-templates mode="pure" select="."/>
+ </xsl:when>
+ <xsl:otherwise>
+ <m:ci>.</m:ci>
+ </xsl:otherwise>
</xsl:choose>
<!-- <xsl:apply-templates mode="pure" select="."/> -->
<xsl:apply-templates mode="flat" select="following-sibling::*[1]">