3 <!-- Copyright (C) 2000, HELM Team -->
5 <!-- This file is part of HELM, an Hypertextual, Electronic -->
6 <!-- Library of Mathematics, developed at the Computer Science -->
7 <!-- Department, University of Bologna, Italy. -->
9 <!-- HELM is free software; you can redistribute it and/or -->
10 <!-- modify it under the terms of the GNU General Public License -->
11 <!-- as published by the Free Software Foundation; either version 2 -->
12 <!-- of the License, or (at your option) any later version. -->
14 <!-- HELM is distributed in the hope that it will be useful, -->
15 <!-- but WITHOUT ANY WARRANTY; without even the implied warranty of -->
16 <!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -->
17 <!-- GNU General Public License for more details. -->
19 <!-- You should have received a copy of the GNU General Public License -->
20 <!-- along with HELM; if not, write to the Free Software -->
21 <!-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, -->
22 <!-- MA 02111-1307, USA. -->
24 <!-- For details, see the HELM World-Wide-Web page, -->
25 <!-- http://cs.unibo.it/helm/. -->
27 <!--******************************************************************-->
29 <!-- First draft: April 3 2000 -->
30 <!-- HELM Group: Asperti, Padovani, Sacerdoti, Schena -->
31 <!--******************************************************************-->
33 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
34 xmlns:m="http://www.w3.org/1998/Math/MathML"
35 xmlns:helm="http://www.cs.unibo.it/helm"
36 xmlns:xlink="http://www.w3.org/1999/xlink">
39 <!-- ************************* LOGIC *********************************-->
44 <xsl:template match="CONST[attribute::uri='cic:/Coq/Reals/Rdefinitions/R.con']" mode="pure">
51 <xsl:template match="CONST[attribute::uri='cic:/Coq/Reals/Rdefinitions/R0.con']" mode="pure">
52 <m:cn definitionURL="{@uri}" helm:xref="{@id}">0</m:cn>
55 <xsl:template match="CONST[attribute::uri='cic:/Coq/Reals/Rdefinitions/R1.con']" mode="pure">
56 <m:cn definitionURL="{@uri}" helm:xref="{@id}">1</m:cn>
61 <!-- Unary Operations and power -->
63 <xsl:template match="APPLY[CONST[
64 attribute::uri='cic:/Coq/Reals/Rdefinitions/Ropp.con' or
65 attribute::uri='cic:/Coq/Reals/Rbasic_fun/Rabsolu.con' or
66 attribute::uri='cic:/Coq/Reals/Rfunctions/fact.con' or
67 attribute::uri='cic:/Coq/Reals/Rbase/Rsqr.con']]" mode="pure">
69 <xsl:when test="count(child::*) = 2">
70 <xsl:variable name="elem">
72 <xsl:when test="CONST/@uri='cic:/Coq/Reals/Rdefinitions/Ropp.con'">
73 <xsl:value-of select="'minus'"/>
75 <xsl:when test="CONST/@uri='cic:/Coq/Reals/Rbasic_fun/Rabsolu.con'">
76 <xsl:value-of select="'abs'"/>
78 <xsl:when test="CONST/@uri='cic:/Coq/Reals/Rfunctions/fact.con'">
79 <xsl:value-of select="'factorial'"/>
81 <xsl:when test="CONST/@uri='cic:/Coq/Reals/Rbase/Rsqr.con'">
82 <xsl:value-of select="'power'"/>
86 <m:apply helm:xref="{@id}">
87 <xsl:element name="{concat('m:',$elem)}">
88 <xsl:attribute name="definitionURL">
89 <xsl:value-of select="CONST/@uri"/>
91 <xsl:attribute name="helm:xref">
92 <xsl:value-of select="CONST/@id"/>
95 <xsl:apply-templates select="*[2]" mode="noannot"/>
96 <xsl:if test="string($elem)='power'">
97 <m:cn><xsl:value-of select="*[2]/@value"/></m:cn>
107 <xsl:template match="APPLY[CONST[
108 attribute::uri='cic:/Coq/Reals/Rdefinitions/Rinv.con']]" mode="pure">
110 <xsl:when test="count(child::*) = 2">
111 <m:apply helm:xref="{@id}">
113 <xsl:apply-templates select="*[2]" mode="noannot"/>
116 <xsl:attribute name="definitionURL">
117 <xsl:value-of select="CONST/@uri"/>
119 <xsl:attribute name="helm:xref">
120 <xsl:value-of select="CONST/@id"/>
133 <!-- Binary Operations and Relations -->
135 <xsl:template match="APPLY[CONST[
136 attribute::uri='cic:/Coq/Reals/Rdefinitions/Rplus.con' or
137 attribute::uri='cic:/Coq/Reals/Rdefinitions/Rminus.con' or
138 attribute::uri='cic:/Coq/Reals/Rdefinitions/Rmult.con' or
139 attribute::uri='cic:/Coq/Reals/Rdefinitions/Rle.con' or
140 attribute::uri='cic:/Coq/Reals/Rdefinitions/Rlt.con' or
141 attribute::uri='cic:/Coq/Reals/Rdefinitions/Rge.con' or
142 attribute::uri='cic:/Coq/Reals/Rdefinitions/Rgt.con' or
143 attribute::uri='cic:/Coq/Reals/Rbasic_fun/Rmin.con' or
144 attribute::uri='cic:/Coq/Reals/Rfunctions/pow.con']]" mode="pure">
146 <xsl:when test="count(child::*) = 3">
147 <xsl:variable name="elem">
149 <xsl:when test="CONST/@uri='cic:/Coq/Reals/Rdefinitions/Rplus.con'">
150 <xsl:value-of select="'plus'"/>
152 <xsl:when test="CONST/@uri='cic:/Coq/Reals/Rdefinitions/Rminus.con'">
153 <xsl:value-of select="'minus'"/>
155 <xsl:when test="CONST/@uri='cic:/Coq/Reals/Rdefinitions/Rmult.con'">
156 <xsl:value-of select="'times'"/>
158 <xsl:when test="CONST/@uri='cic:/Coq/Reals/Rdefinitions/Rle.con'">
159 <xsl:value-of select="'leq'"/>
161 <xsl:when test="CONST/@uri='cic:/Coq/Reals/Rdefinitions/Rlt.con'">
162 <xsl:value-of select="'lt'"/>
164 <xsl:when test="CONST/@uri='cic:/Coq/Reals/Rdefinitions/Rge.con'">
165 <xsl:value-of select="'geq'"/>
167 <xsl:when test="CONST/@uri='cic:/Coq/Reals/Rdefinitions/Rgt.con'">
168 <xsl:value-of select="'gt'"/>
170 <xsl:when test="CONST/@uri='cic:/Coq/Reals/Rbasic_fun/Rmin.con'">
171 <xsl:value-of select="'min'"/>
173 <xsl:when test="CONST/@uri='cic:/Coq/Reals/Rfunctions/pow.con'">
174 <xsl:value-of select="'power'"/>
178 <m:apply helm:xref="{@id}">
179 <xsl:element name="{concat('m:',$elem)}">
180 <xsl:attribute name="definitionURL">
181 <xsl:value-of select="CONST/@uri"/>
183 <xsl:attribute name="helm:xref">
184 <xsl:value-of select="CONST/@id"/>
187 <xsl:apply-templates select="*[2]" mode="noannot"/>
188 <xsl:apply-templates select="*[3]" mode="noannot"/>
199 <xsl:template match="APPLY[CONST[
200 attribute::uri='cic:/Coq/Reals/Rlimit/limit1_in.con']]" mode="pure">
202 <xsl:when test="count(child::*) = 5">
206 <xsl:when test="name(*[2]) = 'LAMBDA'">
207 <m:apply helm:xref="{@id}">
209 <xsl:attribute name="definitionURL">
210 <xsl:value-of select="CONST/@uri"/>
212 <xsl:attribute name="helm:xref">
213 <xsl:value-of select="CONST/@id"/>
218 <xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="LAMBDA/target/@binder"/></xsl:with-param></xsl:call-template>
222 <xsl:apply-templates select="*[5]" mode="noannot"/>
224 <xsl:apply-templates select="*[2]/target" mode="noannot"/>
228 <m:apply helm:xref="{@id}">
230 <xsl:attribute name="definitionURL">
231 <xsl:value-of select="CONST/@uri"/>
233 <xsl:attribute name="helm:xref">
234 <xsl:value-of select="CONST/@id"/>
241 <xsl:apply-templates select="*[5]" mode="noannot"/>
244 <m:csymbol>app</m:csymbol>
245 <xsl:apply-templates select="*[2]" mode="noannot"/>
251 <xsl:apply-templates select="*[4]" mode="noannot"/>
260 <!-- DIFFERENTIATION -->
262 <xsl:template match="APPLY[CONST[
263 attribute::uri='cic:/Coq/Reals/Rderiv/D_in.con']]" mode="pure">
265 <xsl:when test="count(child::*) = 4">
269 <xsl:when test="name(*[2]) = 'LAMBDA'">
270 <m:apply helm:xref="{@id}">
272 <xsl:attribute name="definitionURL">
273 <xsl:value-of select="CONST/@uri"/>
275 <xsl:attribute name="helm:xref">
276 <xsl:value-of select="CONST/@id"/>
280 <m:ci><xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="LAMBDA[1]/target/@binder"/></xsl:with-param></xsl:call-template></m:ci>
282 <xsl:apply-templates select="*[2]/target" mode="noannot"/>
286 <m:apply helm:xref="{@id}">
292 <m:csymbol>app</m:csymbol>
293 <xsl:apply-templates select="*[2]" mode="noannot"/>
299 <xsl:apply-templates select="*[4]" mode="noannot"/>