]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/style/arith.xsl
Modified Files:
[helm.git] / helm / style / arith.xsl
index 47baf518d577d31d1ef02159c332d07e428265a2..5c46c390f5187579052df6a58800ddd2b1350163 100644 (file)
 
 <!-- ************************** ARITHMETICS ****************************** -->
 
+<!-- S and O -->
+<xsl:template match="APPLY[*[position()=1 and name()='MUTCONSTRUCT' and @uri='cic:/Coq/Init/Datatypes/nat.ind' and @noConstr='2'] and count(*)=2]" mode="pure">
+   <xsl:apply-templates select="*[2]" mode="succ">
+    <xsl:with-param name="n" select="1"/>
+    <xsl:with-param name="iden" select="@id"/>
+   </xsl:apply-templates>
+</xsl:template>
+
+<xsl:template match="*" mode="succ">
+ <xsl:param name="n" select="0"/>
+ <xsl:param name="iden" select="''"/>
+ <xsl:choose>
+  <xsl:when test="name()='APPLY' and *[position()=1 and name()='MUTCONSTRUCT'
+and @uri='cic:/Coq/Init/Datatypes/nat.ind' and @noConstr='2']">
+   <xsl:apply-templates select="*[2]" mode="succ">
+    <xsl:with-param name="n" select="$n +1"/>
+    <xsl:with-param name="iden" select="$iden"/>
+   </xsl:apply-templates>
+  </xsl:when>
+  <xsl:when test="name()='MUTCONSTRUCT' and @uri='cic:/Coq/Init/Datatypes/nat.ind' and @noConstr='1'">
+   <m:cn helm:xref="{$iden}"><xsl:value-of select="$n"/></m:cn>
+  </xsl:when>
+  <xsl:otherwise>
+   <m:apply helm:xref="{$iden}">
+    <m:plus/>
+    <m:cn><xsl:value-of select="$n"/></m:cn>
+    <xsl:apply-templates select="." mode="pure"/>
+   </m:apply>
+  </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+
 <xsl:template match="APPLY[MUTIND/@uri='cic:/Coq/Init/Peano/le.ind']" mode="pure">
    <xsl:call-template name="mk-mml-op-noannot">
       <xsl:with-param name="arity" select="2"/>