]> matita.cs.unibo.it Git - helm.git/commitdiff
basic notations for arithmetics
authorFerruccio Guidi <ferruccio.guidi@unibo.it>
Tue, 20 Mar 2001 17:21:14 +0000 (17:21 +0000)
committerFerruccio Guidi <ferruccio.guidi@unibo.it>
Tue, 20 Mar 2001 17:21:14 +0000 (17:21 +0000)
helm/style/arith.xsl [new file with mode: 0644]
helm/style/contentlib.xsl [new file with mode: 0644]

diff --git a/helm/style/arith.xsl b/helm/style/arith.xsl
new file mode 100644 (file)
index 0000000..6179303
--- /dev/null
@@ -0,0 +1,88 @@
+<?xml version="1.0"?>
+
+<!-- Copyright (C) 2000, HELM Team                                     -->
+<!--                                                                   -->
+<!-- This file is part of HELM, an Hypertextual, Electronic            -->
+<!-- Library of Mathematics, developed at the Computer Science         -->
+<!-- Department, University of Bologna, Italy.                         -->
+<!--                                                                   -->
+<!-- HELM is free software; you can redistribute it and/or             -->
+<!-- modify it under the terms of the GNU General Public License       -->
+<!-- as published by the Free Software Foundation; either version 2    -->
+<!-- of the License, or (at your option) any later version.            -->
+<!--                                                                   -->
+<!-- HELM is distributed in the hope that it will be useful,           -->
+<!-- but WITHOUT ANY WARRANTY; without even the implied warranty of    -->
+<!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the     -->
+<!-- GNU General Public License for more details.                      -->
+<!--                                                                   -->
+<!-- You should have received a copy of the GNU General Public License -->
+<!-- along with HELM; if not, write to the Free Software               -->
+<!-- Foundation, Inc., 59 Temple Place - Suite 330, Boston,            -->
+<!-- MA  02111-1307, USA.                                              -->
+<!--                                                                   -->
+<!-- For details, see the HELM World-Wide-Web page,                    -->
+<!-- http://cs.unibo.it/helm/.                                         -->
+
+<!--******************************************************************--> 
+<!-- Arithmetics                                                             -->
+<!-- First draft: March 20 2001, Ferruccio Guidi                      -->
+<!--******************************************************************-->
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                              xmlns:m="http://www.w3.org/1998/Math/MathML"
+                              xmlns:helm="http://www.cs.unibo.it/helm"
+                              xmlns:xlink="http://www.w3.org/1999/xlink">
+
+<!-- ************************** ARITHMETICS ****************************** -->
+
+<xsl:template match="APPLY[MUTIND/@uri='cic:/Coq/Init/Peano/le.ind']" mode="pure">
+   <xsl:call-template name="mk-mml-infix">
+      <xsl:with-param name="c-tag" select="MUTIND"/>
+      <xsl:with-param name="m-tag" select="'leq'"/>
+   </xsl:call-template>
+</xsl:template>
+
+<xsl:template match="APPLY[CONST/@uri='cic:/Coq/Init/Peano/lt.con']" mode="pure">
+   <xsl:call-template name="mk-mml-infix">
+      <xsl:with-param name="c-tag" select="CONST"/>
+      <xsl:with-param name="m-tag" select="'lt'"/>
+   </xsl:call-template>
+</xsl:template>
+
+<xsl:template match="APPLY[CONST/@uri='cic:/Coq/Init/Peano/ge.con']" mode="pure">
+   <xsl:call-template name="mk-mml-infix">
+      <xsl:with-param name="c-tag" select="CONST"/>
+      <xsl:with-param name="m-tag" select="'geg'"/>
+   </xsl:call-template>
+</xsl:template>
+
+<xsl:template match="APPLY[CONST/@uri='cic:/Coq/Init/Peano/gt.con']" mode="pure">
+   <xsl:call-template name="mk-mml-infix">
+      <xsl:with-param name="c-tag" select="CONST"/>
+      <xsl:with-param name="m-tag" select="'gt'"/>
+   </xsl:call-template>
+</xsl:template>
+
+<xsl:template match="APPLY[CONST/@uri='cic:/Coq/Init/Peano/plus.con']" mode="pure">
+   <xsl:call-template name="mk-mml-infix">
+      <xsl:with-param name="c-tag" select="CONST"/>
+      <xsl:with-param name="m-tag" select="'plus'"/>
+   </xsl:call-template>
+</xsl:template>
+
+<xsl:template match="APPLY[CONST/@uri='cic:/Coq/Arith/Minus/minus.con']" mode="pure">
+   <xsl:call-template name="mk-mml-infix">
+      <xsl:with-param name="c-tag" select="CONST"/>
+      <xsl:with-param name="m-tag" select="'minus'"/>
+   </xsl:call-template>
+</xsl:template>
+
+<xsl:template match="APPLY[CONST/@uri='cic:/Coq/Init/Peano/mult.con']" mode="pure">
+   <xsl:call-template name="mk-mml-infix">
+      <xsl:with-param name="c-tag" select="CONST"/>
+      <xsl:with-param name="m-tag" select="'times'"/>
+   </xsl:call-template>
+</xsl:template>
+
+</xsl:stylesheet>
diff --git a/helm/style/contentlib.xsl b/helm/style/contentlib.xsl
new file mode 100644 (file)
index 0000000..5fcc918
--- /dev/null
@@ -0,0 +1,61 @@
+<?xml version="1.0"?>
+
+<!-- Copyright (C) 2000, HELM Team                                     -->
+<!--                                                                   -->
+<!-- This file is part of HELM, an Hypertextual, Electronic            -->
+<!-- Library of Mathematics, developed at the Computer Science         -->
+<!-- Department, University of Bologna, Italy.                         -->
+<!--                                                                   -->
+<!-- HELM is free software; you can redistribute it and/or             -->
+<!-- modify it under the terms of the GNU General Public License       -->
+<!-- as published by the Free Software Foundation; either version 2    -->
+<!-- of the License, or (at your option) any later version.            -->
+<!--                                                                   -->
+<!-- HELM is distributed in the hope that it will be useful,           -->
+<!-- but WITHOUT ANY WARRANTY; without even the implied warranty of    -->
+<!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the     -->
+<!-- GNU General Public License for more details.                      -->
+<!--                                                                   -->
+<!-- You should have received a copy of the GNU General Public License -->
+<!-- along with HELM; if not, write to the Free Software               -->
+<!-- Foundation, Inc., 59 Temple Place - Suite 330, Boston,            -->
+<!-- MA  02111-1307, USA.                                              -->
+<!--                                                                   -->
+<!-- For details, see the HELM World-Wide-Web page,                    -->
+<!-- http://cs.unibo.it/helm/.                                         -->
+
+<!--******************************************************************--> 
+<!-- Library for MML Content                                          -->
+<!-- First draft: March 20 2001, Ferruccio Guidi                      -->
+<!--******************************************************************-->
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                              xmlns:m="http://www.w3.org/1998/Math/MathML"
+                              xmlns:helm="http://www.cs.unibo.it/helm"
+                              xmlns:xlink="http://www.w3.org/1999/xlink">
+
+<xsl:template name="mk-mml-infix"> <!-- make MML node for infix operator --> 
+   <xsl:param name="c-tag"/>       <!-- CIC    tag -->
+   <xsl:param name="m-tag"/>       <!-- MathML tag -->
+   <xsl:choose>
+      <xsl:when test="count(child::*) = 3">
+         <m:apply helm:xref="{@id}">
+            <xsl:element name="{concat('m:',$m-tag)}">
+               <xsl:attribute name="definitionURL">
+                  <xsl:value-of select="$c-tag/@uri"/> 
+               </xsl:attribute>
+               <xsl:attribute name="helm:xref">
+                  <xsl:value-of select="$c-tag/@id"/>
+               </xsl:attribute>
+            </xsl:element>
+            <xsl:apply-templates select="*[2]" mode="noannot"/>
+            <xsl:apply-templates select="*[3]" mode="noannot"/>
+         </m:apply>
+      </xsl:when>
+      <xsl:otherwise>
+         <xsl:apply-imports/>
+      </xsl:otherwise>
+   </xsl:choose>
+</xsl:template>
+
+</xsl:stylesheet>