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, Guidi -->
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>
59 <!-- Unary Operations and power -->
61 <xsl:template match="APPLY[CONST[
62 attribute::uri='cic:/Coq/Reals/Rdefinitions/Ropp.con' or
63 attribute::uri='cic:/Coq/Reals/Rbasic_fun/Rabsolu.con' or
64 attribute::uri='cic:/Coq/Reals/Rfunctions/fact.con' or
65 attribute::uri='cic:/Coq/Reals/Rbase/Rsqr.con']]" mode="pure">
67 <xsl:when test="count(child::*) = 2">
68 <xsl:variable name="elem">
70 <xsl:when test="CONST/@uri='cic:/Coq/Reals/Rdefinitions/Ropp.con'">
71 <xsl:value-of select="'minus'"/>
73 <xsl:when test="CONST/@uri='cic:/Coq/Reals/Rbasic_fun/Rabsolu.con'">
74 <xsl:value-of select="'abs'"/>
76 <xsl:when test="CONST/@uri='cic:/Coq/Reals/Rfunctions/fact.con'">
77 <xsl:value-of select="'factorial'"/>
79 <xsl:when test="CONST/@uri='cic:/Coq/Reals/Rbase/Rsqr.con'">
80 <xsl:value-of select="'power'"/>
84 <m:apply helm:xref="{@id}">
85 <xsl:element name="{concat('m:',$elem)}">
86 <xsl:attribute name="definitionURL">
87 <xsl:value-of select="CONST/@uri"/>
89 <xsl:attribute name="helm:xref">
90 <xsl:value-of select="CONST/@id"/>
93 <xsl:apply-templates select="*[2]" mode="noannot"/>
94 <xsl:if test="string($elem)='power'">
95 <m:cn><xsl:value-of select="*[2]/@value"/></m:cn>
105 <xsl:template match="APPLY[CONST[
106 attribute::uri='cic:/Coq/Reals/Rdefinitions/Rinv.con']]" mode="pure">
108 <xsl:when test="count(child::*) = 2">
109 <m:apply helm:xref="{@id}">
111 <xsl:apply-templates select="*[2]" mode="noannot"/>
114 <xsl:attribute name="definitionURL">
115 <xsl:value-of select="CONST/@uri"/>
117 <xsl:attribute name="helm:xref">
118 <xsl:value-of select="CONST/@id"/>
131 <!-- Binary Operations and Relations -->
133 <xsl:template match="APPLY[CONST/@uri='cic:/Coq/Reals/Rdefinitions/Rle.con']" mode="pure">
134 <xsl:call-template name="mk-mml-infix">
135 <xsl:with-param name="c-tag" select="CONST"/>
136 <xsl:with-param name="m-tag" select="'leq'"/>
140 <xsl:template match="APPLY[CONST/@uri='cic:/Coq/Reals/Rdefinitions/Rlt.con']" mode="pure">
141 <xsl:call-template name="mk-mml-infix">
142 <xsl:with-param name="c-tag" select="CONST"/>
143 <xsl:with-param name="m-tag" select="'lt'"/>
147 <xsl:template match="APPLY[CONST/@uri='cic:/Coq/Reals/Rdefinitions/Rge.con']" mode="pure">
148 <xsl:call-template name="mk-mml-infix">
149 <xsl:with-param name="c-tag" select="CONST"/>
150 <xsl:with-param name="m-tag" select="'geq'"/>
154 <xsl:template match="APPLY[CONST/@uri='cic:/Coq/Reals/Rdefinitions/Rgt.con']" mode="pure">
155 <xsl:call-template name="mk-mml-infix">
156 <xsl:with-param name="c-tag" select="CONST"/>
157 <xsl:with-param name="m-tag" select="'gt'"/>
161 <xsl:template match="APPLY[CONST/@uri='cic:/Coq/Reals/Rdefinitions/Rplus.con']" mode="pure">
162 <xsl:call-template name="mk-mml-infix">
163 <xsl:with-param name="c-tag" select="CONST"/>
164 <xsl:with-param name="m-tag" select="'plus'"/>
168 <xsl:template match="APPLY[CONST/@uri='cic:/Coq/Reals/Rdefinitions/Rminus.con']" mode="pure">
169 <xsl:call-template name="mk-mml-infix">
170 <xsl:with-param name="c-tag" select="CONST"/>
171 <xsl:with-param name="m-tag" select="'minus'"/>
175 <xsl:template match="APPLY[CONST/@uri='cic:/Coq/Reals/Rdefinitions/Rmult.con']" mode="pure">
176 <xsl:call-template name="mk-mml-infix">
177 <xsl:with-param name="c-tag" select="CONST"/>
178 <xsl:with-param name="m-tag" select="'times'"/>
182 <xsl:template match="APPLY[CONST/@uri='cic:/Coq/Reals/Rdefinitions/Rdiv.con']" mode="pure">
183 <xsl:call-template name="mk-mml-infix">
184 <xsl:with-param name="c-tag" select="CONST"/>
185 <xsl:with-param name="m-tag" select="'divide'"/>
189 <xsl:template match="APPLY[CONST/@uri='cic:/Coq/Reals/Rbasic_fun/Rmin.con']" mode="pure">
190 <xsl:call-template name="mk-mml-infix">
191 <xsl:with-param name="c-tag" select="CONST"/>
192 <xsl:with-param name="m-tag" select="'min'"/>
196 <xsl:template match="APPLY[CONST/@uri='cic:/Coq/Reals/Rbasic_fun/Rmax.con']" mode="pure">
197 <xsl:call-template name="mk-mml-infix">
198 <xsl:with-param name="c-tag" select="CONST"/>
199 <xsl:with-param name="m-tag" select="'max'"/>
203 <xsl:template match="APPLY[CONST/@uri='cic:/Coq/Reals/Rfunctions/pow.con']" mode="pure">
204 <xsl:call-template name="mk-mml-infix">
205 <xsl:with-param name="c-tag" select="CONST"/>
206 <xsl:with-param name="m-tag" select="'power'"/>
212 <xsl:template match="APPLY[CONST[
213 attribute::uri='cic:/Coq/Reals/Rlimit/limit1_in.con']]" mode="pure">
215 <xsl:when test="count(child::*) = 5">
219 <xsl:when test="name(*[2]) = 'LAMBDA'">
220 <m:apply helm:xref="{@id}">
222 <xsl:attribute name="definitionURL">
223 <xsl:value-of select="CONST/@uri"/>
225 <xsl:attribute name="helm:xref">
226 <xsl:value-of select="CONST/@id"/>
231 <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>
235 <xsl:apply-templates select="*[5]" mode="noannot"/>
237 <xsl:apply-templates select="*[2]/target" mode="noannot"/>
241 <m:apply helm:xref="{@id}">
243 <xsl:attribute name="definitionURL">
244 <xsl:value-of select="CONST/@uri"/>
246 <xsl:attribute name="helm:xref">
247 <xsl:value-of select="CONST/@id"/>
254 <xsl:apply-templates select="*[5]" mode="noannot"/>
257 <m:csymbol>app</m:csymbol>
258 <xsl:apply-templates select="*[2]" mode="noannot"/>
264 <xsl:apply-templates select="*[4]" mode="noannot"/>
273 <!-- DIFFERENTIATION -->
275 <xsl:template match="APPLY[CONST[
276 attribute::uri='cic:/Coq/Reals/Rderiv/D_in.con']]" mode="pure">
278 <xsl:when test="count(child::*) = 4">
282 <xsl:when test="name(*[2]) = 'LAMBDA'">
283 <m:apply helm:xref="{@id}">
285 <xsl:attribute name="definitionURL">
286 <xsl:value-of select="CONST/@uri"/>
288 <xsl:attribute name="helm:xref">
289 <xsl:value-of select="CONST/@id"/>
293 <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>
295 <xsl:apply-templates select="*[2]/target" mode="noannot"/>
299 <m:apply helm:xref="{@id}">
305 <m:csymbol>app</m:csymbol>
306 <xsl:apply-templates select="*[2]" mode="noannot"/>
312 <xsl:apply-templates select="*[4]" mode="noannot"/>