- <!-- EQUALITY -->
- <xsl:when test="name()= 'APPLY' and CONST[
- attribute::uri='cic:/Coq/Init/Logic/Equality/eq_ind.con' or
- attribute::uri='cic:/Coq/Init/Logic_Type/eqT_ind.con' or
- attribute::uri='cic:/Coq/Zarith/auxiliary/eqT_ind_r.con'] and count(child::*) = 7">
- <m:apply>
- <m:csymbol>rw_step</m:csymbol>
- <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]"/>
- </m:apply>
- </xsl:when>
- <!-- EQUALITY with extra-parameters -->
- <xsl:when test="name()= 'APPLY' and CONST[
- attribute::uri='cic:/Coq/Init/Logic_Type/eqT_ind.con' or
- attribute::uri='cic:/Coq/Zarith/auxiliary/eqT_ind_r.con'] and count(child::*) > 7">
- <xsl:variable name="no_extraproofs" select="count(*[position()>7 and @sort='Prop' and (name(.)='LAMBDA' or name(.)='LETIN' or name(.)='APPLY' or name(.)='MUTCASE' or name(.)='FIX' or name(.)='COFIX')])"/>
- <xsl:choose>
- <xsl:when test="$no_extraproofs=0">
- <m:apply>
- <m:csymbol>rewrite_and_apply</m:csymbol>
- <m:apply>
- <m:csymbol>rw_step</m:csymbol>
- <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]"/>
- </m:apply>
- <xsl:apply-templates mode="noannot" select="*[position()>7]"/>
- </m:apply>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="*[5]/@sort='Prop'">
- <m:apply helm:xref="{@id}">
- <m:csymbol>letin</m:csymbol>
- <m:apply>
- <m:csymbol>let</m:csymbol>
- <m:ci>
- <xsl:call-template name="insert_subscript">
- <xsl:with-param name="node_value" select="'h1'"/>
- </xsl:call-template>
- </m:ci>
- <xsl:apply-templates mode="noannot" select="*[5]"/>
- </m:apply>
- <xsl:call-template name="gen_let">
- <xsl:with-param name="init_pos" select="1"/>
- <xsl:with-param name="from" select="7"/>
- </xsl:call-template>
- <m:apply>
- <m:csymbol>rewrite_and_apply</m:csymbol>
- <m:apply>
- <m:csymbol>rw_step</m:csymbol>
- <m:ci>
- <xsl:call-template name="insert_subscript">
- <xsl:with-param name="node_value" select="'h1'"/>
- </xsl:call-template>
- </m:ci>
- <xsl:apply-templates mode="pure" select="*[3]"/>
- <xsl:apply-templates mode="pure" select="*[6]"/>
- <xsl:apply-templates mode="pure" select="*[7]"/>
- </m:apply>
- <xsl:apply-templates mode="flat" select="*[8]">
- <xsl:with-param name="n">
- <xsl:value-of select="2"/>
- </xsl:with-param>
- </xsl:apply-templates>
- </m:apply>
- </m:apply>
- </xsl:when>
- <xsl:otherwise>
- <m:apply helm:xref="{@id}">
- <m:csymbol>letin</m:csymbol>
- <xsl:call-template name="gen_let">
- <xsl:with-param name="init_pos" select="0"/>
- <xsl:with-param name="form" select="7"/>
- </xsl:call-template>
- <m:apply>
- <m:csymbol>rewrite_and_apply</m:csymbol>
- <m:apply>
- <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]"/>
- </m:apply>
- <xsl:apply-templates mode="flat" select="*[8]">
- <xsl:with-param name="n">
- <xsl:value-of select="1"/>
- </xsl:with-param>
- </xsl:apply-templates>
- </m:apply>
- </m:apply>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <!-- gestire meglio il caso di and_ind quando la prova
- non e' della forma \x.\y.M -->
- <xsl:when test="name()= 'APPLY' and CONST[
- attribute::uri='cic:/Coq/Init/Logic/Conjunction/and_ind.con']
- and count(child::*) = 6
- and name(*[5])='LAMBDA'
- and name(*[5]/target/*[1])='LAMBDA'">
- <m:apply helm:xref="{@id}">
- <m:csymbol>and_ind</m:csymbol>
- <xsl:apply-templates mode="noannot" select="*[6]"/>
- <m:ci><xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="*[5]/target/@binder"/></xsl:with-param></xsl:call-template></m:ci>
- <xsl:apply-templates mode="pure" select="*[5]/source/*"/>
- <m:ci><xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="*[5]/target/LAMBDA/target/@binder"/></xsl:with-param></xsl:call-template></m:ci>
- <xsl:apply-templates mode="pure" select="*[5]/target/LAMBDA/source/*"/>
- <xsl:apply-templates mode="proof_transform" select="*[5]/target/LAMBDA/target/*"/>
- </m:apply>
- </xsl:when>
- <xsl:when test="name()= 'APPLY' and CONST[
- attribute::uri='cic:/Coq/Init/Logic/Disjunction/or_ind.con']
- and count(child::*) = 7">