]> matita.cs.unibo.it Git - helm.git/commitdiff
First experimental commit of the notation (partial!) for real numbers.
authorClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Tue, 10 Dec 2002 17:50:45 +0000 (17:50 +0000)
committerClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Tue, 10 Dec 2002 17:50:45 +0000 (17:50 +0000)
helm/meta_style/positive.xsl

index 6a99d12ffa7b30c5fd2c84c1e8f0de634300220d..baee6a907dc32489f78f1a09aa170b95b2b5de67 100644 (file)
@@ -173,5 +173,46 @@ and @uri='cic:/Coq/ZArith/fast_integer/positive.ind' and @noConstr='2']">
  </xsl:choose>
 </xsl:template>
 
+<!-- **************************** Reals ******************************** -->
+
+<xsl:template match="APPLY[CONST[position() = 1 and @uri='cic:/Coq/Reals/Rdefinitions/Rplus.con'] and count(*) = 3]" mode="pure">
+  <xsl:variable name="result">
+   <xsl:apply-templates select="." mode="reals"/>
+  </xsl:variable>
+  <xsl:choose>
+   <xsl:when test="string($result) = ''">
+    <m:apply helm:xref="{@id}">
+      <m:plus xmlns:m="http://www.w3.org/1998/Math/MathML" definitionURL="{CONST[1]/@uri}" helm:xref="{CONST[1]/@id}"/>
+      <xsl:apply-templates select="*[2]" mode="noannot"/>
+      <xsl:apply-templates select="*[3]" mode="noannot"/>
+    </m:apply>
+   </xsl:when>
+   <xsl:otherwise>
+    <m:cn helm:xref="{CONST[1]/@id}"><xsl:value-of select="$result"/></m:cn>
+   </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="APPLY[CONST[position() = 1 and @uri='cic:/Coq/Reals/Rdefinitions/Rplus.con'] and CONST[position() = 2 and @uri='cic:/Coq/Reals/Rdefinitions/R1.con'] and count(*) = 3]" mode="reals">
+  <xsl:param name="real_counter" select="0"/>
+  <xsl:variable name="result">
+   <xsl:apply-templates select="*[3]" mode="reals">
+    <xsl:with-param name="real_counter" select="$real_counter + 1"/>
+   </xsl:apply-templates>
+  </xsl:variable>
+  <xsl:choose>
+   <xsl:when test="string($result) = ''"/>
+   <xsl:otherwise>
+    <xsl:value-of select="$result"/>
+   </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="CONST[@uri='cic:/Coq/Reals/Rdefinitions/R1.con']" mode="reals">
+  <xsl:param name="real_counter" select="0"/>
+  <xsl:value-of select="$real_counter + 1"/>
+</xsl:template>
+
+<xsl:template match="*" mode="reals"/>
 
 </xsl:stylesheet>