- <!-- Algebra equality (eq_transitive_unfolded) -->
- <!-- It requires a special mode "eq_transitive"-->
- <!-- togliere il parametro -->
- <xsl:when test="CONST[attribute::uri='cic:/Algebra/CSetoids/CSetoid_basics/eq_transitive_unfolded.con'] and count(child::*) = 7">
- <m:apply>
- <m:csymbol>eq_chain</m:csymbol>
- <xsl:apply-templates mode="noannot" select="*[3]"/>
- <xsl:apply-templates mode="eq_transitive" select="*[6]"/>
- <xsl:apply-templates mode="noannot" select="*[4]"/>
- <xsl:apply-templates mode="eq_transitive" select="*[7]"/>
- <xsl:apply-templates mode="noannot" select="*[5]"/>
- </m:apply>
- </xsl:when>
- <!-- Algebra disequalities -->
- <!-- It requires a special mode "diseq"-->
- <!-- togliere il parametro -->
- <xsl:when test="CONST[attribute::uri='cic:/Algebra/COrdFields/Basic_Properties_of_leEq/leEq_transitive.con'] and count(child::*) = 7">
- <m:apply>
- <m:csymbol>diseq_chain</m:csymbol>
- <xsl:apply-templates mode="noannot" select="*[3]"/>
- <xsl:apply-templates mode="diseq" select="*[6]">
- <xsl:with-param name="rel" select="'leq'"/>
- </xsl:apply-templates>
- <xsl:apply-templates mode="noannot" select="*[4]"/>
- <xsl:apply-templates mode="diseq" select="*[7]">
- <xsl:with-param name="rel" select="'leq'"/>
- </xsl:apply-templates>
- <xsl:apply-templates mode="noannot" select="*[5]"/>
- </m:apply>
- </xsl:when>
- <xsl:when test="CONST[attribute::uri='cic:/Algebra/COrdFields/Basic_Properties_of_leEq/leEq_wdl.con'] and count(child::*) = 7">
- <m:apply>
- <m:csymbol>diseq_chain</m:csymbol>
- <xsl:apply-templates mode="noannot" select="*[5]"/>
- <m:eq/>
- <!-- <m:ci><xsl:value-of select="'eq'"/></m:ci> -->
- <xsl:call-template name="generate_side_proof">
- <xsl:with-param name="proof" select="*[7]"/>
- <xsl:with-param name="show_statement" select="0"/>
- </xsl:call-template>
- <xsl:apply-templates mode="noannot" select="*[3]"/>
- <xsl:apply-templates mode="diseq" select="*[6]">
- <xsl:with-param name="rel" select="'leq'"/>
- </xsl:apply-templates>
- <xsl:apply-templates mode="noannot" select="*[4]"/>
- </m:apply>
- </xsl:when>
- <xsl:when test="CONST[attribute::uri='cic:/Algebra/COrdFields/Basic_Properties_of_leEq/leEq_less_trans.con'] and count(child::*) = 7">
- <m:apply>
- <m:csymbol>diseq_chain</m:csymbol>
- <xsl:apply-templates mode="noannot" select="*[3]"/>
- <xsl:apply-templates mode="diseq" select="*[6]">
- <xsl:with-param name="rel" select="'leq'"/>
- </xsl:apply-templates>
- <xsl:apply-templates mode="noannot" select="*[4]"/>
- <xsl:apply-templates mode="diseq" select="*[7]">
- <xsl:with-param name="rel" select="'lt'"/>
- </xsl:apply-templates>
- <xsl:apply-templates mode="noannot" select="*[5]"/>
- </m:apply>
- </xsl:when>
- <xsl:when test="CONST[attribute::uri='cic:/Algebra/COrdFields/Basic_Properties_of_leEq/less_leEq_trans.con'] and count(child::*) = 7">
- <m:apply>
- <m:csymbol>diseq_chain</m:csymbol>
- <xsl:apply-templates mode="noannot" select="*[3]"/>
- <xsl:apply-templates mode="diseq" select="*[6]">
- <xsl:with-param name="rel" select="'lt'"/>
- </xsl:apply-templates>
- <xsl:apply-templates mode="noannot" select="*[4]"/>
- <xsl:apply-templates mode="diseq" select="*[7]">
- <xsl:with-param name="rel" select="'leq'"/>
- </xsl:apply-templates>
- <xsl:apply-templates mode="noannot" select="*[5]"/>
- </m:apply>
- </xsl:when>
- <xsl:when test="CONST[attribute::uri='cic:/Algebra/COrdFields/Basic_Properties_of_leEq/leEq_wdr.con'] and count(child::*) = 7">
- <m:apply>
- <m:csymbol>diseq_chain</m:csymbol>
- <xsl:apply-templates mode="noannot" select="*[3]"/>
- <xsl:apply-templates mode="diseq" select="*[6]">
- <xsl:with-param name="rel" select="'leq'"/>
- </xsl:apply-templates>
- <xsl:apply-templates mode="noannot" select="*[4]"/>
- <xsl:apply-templates mode="diseq" select="*[7]">
- <xsl:with-param name="rel" select="'eq'"/>
- </xsl:apply-templates>
- <xsl:apply-templates mode="noannot" select="*[5]"/>
- </m:apply>
- </xsl:when>
- <xsl:when test="CONST[attribute::uri='cic:/Algebra/COrdFields/COrdField_axioms/less_transitive_unfolded.con'] and count(child::*) = 7">
- <m:apply>
- <m:csymbol>diseq_chain</m:csymbol>
- <xsl:apply-templates mode="noannot" select="*[3]"/>
- <xsl:apply-templates mode="diseq" select="*[6]">
- <xsl:with-param name="rel" select="'lt'"/>
- </xsl:apply-templates>
- <xsl:apply-templates mode="noannot" select="*[4]"/>
- <xsl:apply-templates mode="diseq" select="*[7]">
- <xsl:with-param name="rel" select="'lt'"/>
- </xsl:apply-templates>
- <xsl:apply-templates mode="noannot" select="*[5]"/>
- </m:apply>
- </xsl:when>
- <!-- togliere il parametro -->
- <xsl:when test="CONST[attribute::uri='cic:/Algebra/COrdFields/COrdField_axioms/less_wdr.con'] and count(child::*) = 7">
- <m:apply>
- <m:csymbol>diseq_chain</m:csymbol>
- <xsl:apply-templates mode="noannot" select="*[3]"/>
- <xsl:apply-templates mode="diseq" select="*[6]">
- <xsl:with-param name="rel" select="'lt'"/>
- </xsl:apply-templates>
- <xsl:apply-templates mode="noannot" select="*[4]"/>
- <xsl:apply-templates mode="diseq" select="*[7]">
- <xsl:with-param name="rel" select="'eq'"/>
- </xsl:apply-templates>
- <xsl:apply-templates mode="noannot" select="*[5]"/>
- </m:apply>
- </xsl:when>
- <!-- togliere il parametro -->
- <xsl:when test="CONST[attribute::uri='cic:/Algebra/COrdFields/COrdField_axioms/less_wdl.con'] and count(child::*) = 7">
- <m:apply>
- <m:csymbol>diseq_chain</m:csymbol>
- <xsl:apply-templates mode="noannot" select="*[5]"/>
- <m:eq/>
- <!-- <m:ci><xsl:value-of select="'eq'"/></m:ci> -->
- <xsl:call-template name="generate_side_proof">
- <xsl:with-param name="proof" select="*[7]"/>
- <xsl:with-param name="show_statement" select="0"/>
- </xsl:call-template>
- <xsl:apply-templates mode="noannot" select="*[3]"/>
- <xsl:apply-templates mode="diseq" select="*[6]">
- <xsl:with-param name="rel" select="'lt'"/>
- </xsl:apply-templates>
- <xsl:apply-templates mode="noannot" select="*[4]"/>
- </m:apply>
- </xsl:when>
- <!-- EQUALITY -->
- <xsl:when test="CONST[
- attribute::uri='cic:/Coq/Init/Logic/Equality/eq_ind.con' or
- attribute::uri='cic:/Coq/Init/Logic/Logic_lemmas/eq_ind_r.con' or
- attribute::uri='cic:/Coq/Init/Logic_Type/eqT_ind.con' or
- attribute::uri='cic:/Coq/Init/Logic_Type/eqT_ind_r.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: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:when test="CONST[
- attribute::uri='cic:/Coq/Init/Logic/Equality/eq_ind.con' or
- attribute::uri='cic:/Coq/Init/Logic/Logic_lemmas/eq_ind_r.con' or
- attribute::uri='cic:/Coq/Init/Logic_Type/eqT_ind.con' or
- attribute::uri='cic:/Coq/Init/Logic_Type/eqT_ind_r.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: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>
- </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: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: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: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:value-of select="1"/>
- </xsl:with-param>
- </xsl:apply-templates>
- </m:apply>
- </m:apply>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <!-- False_ind -->
- <xsl:when test="CONST[
- attribute::uri='cic:/Coq/Init/Logic/False_ind.con'] and
- count(child::*) = 3">
- <m:apply helm:xref="{@id}">
- <m:csymbol>false_ind</m:csymbol>
- <m:ci>cic:/Coq/Init/Logic/False_ind.con</m:ci>
- <xsl:apply-templates mode="noannot" select="*[3]"/>
- </m:apply>
- </xsl:when>
- <!-- gestire meglio il caso di and_ind quando la prova
- non e' della forma \x.\y.M -->
- <xsl:when test="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="CONST[
- attribute::uri='cic:/Coq/Init/Logic/Disjunction/or_ind.con']
- and count(child::*) = 7">
- <xsl:choose>
- <xsl:when test="name(*[5])='LAMBDA'
- and name(*[6])='LAMBDA'">
- <xsl:variable name="definition_url"
- select="'cic:/Coq/Init/Logic/Disjunction/or.ind'"/>
- <m:apply helm:xref="{@id}">
- <m:csymbol>full_or_ind</m:csymbol>
- <xsl:apply-templates mode="noannot" select="*[7]"/>
- <xsl:apply-templates mode="pure"
- select="$InnerTypes/InnerTypes/TYPE[@of=$id]/*"/>
- <m:apply>
- <m:csymbol>left_case</m:csymbol>
- <m:bvar>
- <m:ci>
- <xsl:value-of select="*[5]/target/@binder"/>
- </m:ci>
- <m:type>
- <xsl:apply-templates mode="pure" select="*[5]/source/*[1]"/>
- </m:type>
- </m:bvar>
- <xsl:apply-templates mode="noannot" select="*[5]/target/*[1]"/>
- </m:apply>
- <m:apply>
- <m:csymbol>right_case</m:csymbol>
- <m:bvar>
- <m:ci>
- <xsl:apply-templates mode="pure" select="*[6]/target/@binder"/>
- </m:ci>
- <m:type>
- <xsl:apply-templates mode="pure" select="*[6]/source/*[1]"/>
- </m:type>
- </m:bvar>
- <xsl:apply-templates mode="noannot" select="*[6]/target/*[1]"/>
- </m:apply>
- </m:apply>
- </xsl:when>
- <xsl:otherwise>
- <m:apply helm:xref="{@id}">
- <m:csymbol>or_ind</m:csymbol>
- <xsl:apply-templates mode="noannot" select="*[7]"/>
- <xsl:apply-templates mode="pure"
- select="$InnerTypes/InnerTypes/TYPE[@of=$id]/*"/>
- <xsl:apply-templates mode="pure" select="*[5]"/>
- <xsl:apply-templates mode="pure" select="*[6]"/>
- </m:apply>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <!-- ex_ind, exT_ind -->
- <xsl:when test="(CONST[attribute::uri='cic:/Coq/Init/Logic_Type/exT_ind.con'] or
- CONST[attribute::uri='cic:/Coq/Init/Logic/First_order_quantifiers/ex_ind.con'])
- and count(child::*) = 6
- and name(*[5])='LAMBDA'
- and name(*[5]/target/*[1])='LAMBDA'">
- <m:apply helm:xref="{@id}">
- <m:csymbol>ex_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(*[1])='CONST'">