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">
38 <!-- ************************* LOGIC *********************************-->
43 <xsl:template match="CONST[attribute::uri='cic:/Coq/Reals/Rdefinitions/R.con']" mode="pure">
50 <xsl:template match="CONST[attribute::uri='cic:/Coq/Reals/Rdefinitions/R0.con']" mode="pure">
51 <m:cn definitionURL="{@uri}" helm:xref="{@id}">0</m:cn>
54 <xsl:template match="CONST[attribute::uri='cic:/Coq/Reals/Rdefinitions/R1.con']" mode="pure">
55 <m:cn definitionURL="{@uri}" helm:xref="{@id}">1</m:cn>
58 <!-- Unary Operations and power -->
60 <xsl:template match="APPLY[CONST/@uri='cic:/Coq/Reals/Rdefinitions/Ropp.con']" mode="pure">
61 <xsl:call-template name="mk-mml-op-noannot">
62 <xsl:with-param name="arity" select="1"/>
63 <xsl:with-param name="c-tag" select="CONST"/>
64 <xsl:with-param name="m-tag" select="'minus'"/>
68 <xsl:template match="APPLY[CONST/@uri='cic:/Coq/Reals/Rbasic_fun/Rabsolu.con']" mode="pure">
69 <xsl:call-template name="mk-mml-op-noannot">
70 <xsl:with-param name="arity" select="1"/>
71 <xsl:with-param name="c-tag" select="CONST"/>
72 <xsl:with-param name="m-tag" select="'abs'"/>
76 <xsl:template match="APPLY[CONST/@uri='cic:/Coq/Reals/Rfunctions/fact.con']" mode="pure">
77 <xsl:call-template name="mk-mml-op-noannot">
78 <xsl:with-param name="arity" select="1"/>
79 <xsl:with-param name="c-tag" select="CONST"/>
80 <xsl:with-param name="m-tag" select="'factorial'"/>
84 <xsl:template match="APPLY[CONST/@uri='cic:/Coq/Reals/Rbase/Rsqr.con']" mode="pure">
85 <xsl:variable name="mbody">
86 <xsl:apply-templates select="*[2]" mode="noannot"/>
89 <xsl:call-template name="out-mml-op">
90 <xsl:with-param name="arity" select="1"/>
91 <xsl:with-param name="c-tag" select="CONST"/>
92 <xsl:with-param name="m-tag" select="'power'"/>
93 <xsl:with-param name="mbody" select="$mbody"/>
97 <xsl:template match="APPLY[CONST/@uri='cic:/Coq/Reals/Rdefinitions/Rinv.con']" mode="pure">
98 <xsl:variable name="mbody1">
99 <xsl:apply-templates select="*[2]" mode="noannot"/>
100 <xsl:variable name="mbody2">
103 <xsl:call-template name="out-mml-op">
104 <xsl:with-param name="arity" select="1"/>
105 <xsl:with-param name="c-tag" select="CONST"/>
106 <xsl:with-param name="m-tag" select="'minus'"/>
107 <xsl:with-param name="mbody" select="$mbody2"/>
110 <xsl:call-template name="out-mml-op">
111 <xsl:with-param name="arity" select="1"/>
112 <xsl:with-param name="c-tag" select="CONST"/>
113 <xsl:with-param name="m-tag" select="'power'"/>
114 <xsl:with-param name="mbody" select="$mbody1"/>
118 <!-- Binary Operations and Relations -->
120 <xsl:template match="APPLY[CONST/@uri='cic:/Coq/Reals/Rdefinitions/Rle.con']" mode="pure">
121 <xsl:call-template name="mk-mml-op-noannot">
122 <xsl:with-param name="arity" select="2"/>
123 <xsl:with-param name="c-tag" select="CONST"/>
124 <xsl:with-param name="m-tag" select="'leq'"/>
128 <xsl:template match="APPLY[CONST/@uri='cic:/Coq/Reals/Rdefinitions/Rlt.con']" mode="pure">
129 <xsl:call-template name="mk-mml-op-noannot">
130 <xsl:with-param name="arity" select="2"/>
131 <xsl:with-param name="c-tag" select="CONST"/>
132 <xsl:with-param name="m-tag" select="'lt'"/>
136 <xsl:template match="APPLY[CONST/@uri='cic:/Coq/Reals/Rdefinitions/Rge.con']" mode="pure">
137 <xsl:call-template name="mk-mml-op-noannot">
138 <xsl:with-param name="arity" select="2"/>
139 <xsl:with-param name="c-tag" select="CONST"/>
140 <xsl:with-param name="m-tag" select="'geq'"/>
144 <xsl:template match="APPLY[CONST/@uri='cic:/Coq/Reals/Rdefinitions/Rgt.con']" mode="pure">
145 <xsl:call-template name="mk-mml-op-noannot">
146 <xsl:with-param name="arity" select="2"/>
147 <xsl:with-param name="c-tag" select="CONST"/>
148 <xsl:with-param name="m-tag" select="'gt'"/>
152 <xsl:template match="APPLY[CONST/@uri='cic:/Coq/Reals/Rdefinitions/Rplus.con']" mode="pure">
153 <xsl:call-template name="mk-mml-op-noannot">
154 <xsl:with-param name="arity" select="2"/>
155 <xsl:with-param name="c-tag" select="CONST"/>
156 <xsl:with-param name="m-tag" select="'plus'"/>
160 <xsl:template match="APPLY[CONST/@uri='cic:/Coq/Reals/Rdefinitions/Rminus.con']" mode="pure">
161 <xsl:call-template name="mk-mml-op-noannot">
162 <xsl:with-param name="arity" select="2"/>
163 <xsl:with-param name="c-tag" select="CONST"/>
164 <xsl:with-param name="m-tag" select="'minus'"/>
168 <xsl:template match="APPLY[CONST/@uri='cic:/Coq/Reals/Rdefinitions/Rmult.con']" mode="pure">
169 <xsl:call-template name="mk-mml-op-noannot">
170 <xsl:with-param name="arity" select="2"/>
171 <xsl:with-param name="c-tag" select="CONST"/>
172 <xsl:with-param name="m-tag" select="'times'"/>
176 <xsl:template match="APPLY[CONST/@uri='cic:/Coq/Reals/Rdefinitions/Rdiv.con']" mode="pure">
177 <xsl:call-template name="mk-mml-op-noannot">
178 <xsl:with-param name="arity" select="2"/>
179 <xsl:with-param name="c-tag" select="CONST"/>
180 <xsl:with-param name="m-tag" select="'divide'"/>
184 <xsl:template match="APPLY[CONST/@uri='cic:/Coq/Reals/Rbasic_fun/Rmin.con']" mode="pure">
185 <xsl:call-template name="mk-mml-op-noannot">
186 <xsl:with-param name="arity" select="2"/>
187 <xsl:with-param name="c-tag" select="CONST"/>
188 <xsl:with-param name="m-tag" select="'min'"/>
192 <xsl:template match="APPLY[CONST/@uri='cic:/Coq/Reals/Rbasic_fun/Rmax.con']" mode="pure">
193 <xsl:call-template name="mk-mml-op-noannot">
194 <xsl:with-param name="arity" select="2"/>
195 <xsl:with-param name="c-tag" select="CONST"/>
196 <xsl:with-param name="m-tag" select="'max'"/>
200 <xsl:template match="APPLY[CONST/@uri='cic:/Coq/Reals/Rfunctions/pow.con']" mode="pure">
201 <xsl:call-template name="mk-mml-op-noannot">
202 <xsl:with-param name="arity" select="2"/>
203 <xsl:with-param name="c-tag" select="CONST"/>
204 <xsl:with-param name="m-tag" select="'power'"/>
210 <xsl:template match="APPLY[CONST[
211 attribute::uri='cic:/Coq/Reals/Rlimit/limit1_in.con']]" mode="pure">
213 <xsl:when test="count(child::*) = 5">
217 <xsl:when test="name(*[2]) = 'LAMBDA'">
218 <m:apply helm:xref="{@id}">
220 <xsl:attribute name="definitionURL">
221 <xsl:value-of select="CONST/@uri"/>
223 <xsl:attribute name="helm:xref">
224 <xsl:value-of select="CONST/@id"/>
229 <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>
233 <xsl:apply-templates select="*[5]" mode="noannot"/>
235 <xsl:apply-templates select="*[2]/target" mode="noannot"/>
239 <m:apply helm:xref="{@id}">
241 <xsl:attribute name="definitionURL">
242 <xsl:value-of select="CONST/@uri"/>
244 <xsl:attribute name="helm:xref">
245 <xsl:value-of select="CONST/@id"/>
252 <xsl:apply-templates select="*[5]" mode="noannot"/>
255 <m:csymbol>app</m:csymbol>
256 <xsl:apply-templates select="*[2]" mode="noannot"/>
262 <xsl:apply-templates select="*[4]" mode="noannot"/>
271 <!-- DIFFERENTIATION -->
273 <xsl:template match="APPLY[CONST[
274 attribute::uri='cic:/Coq/Reals/Rderiv/D_in.con']]" mode="pure">
276 <xsl:when test="count(child::*) = 4">
280 <xsl:when test="name(*[2]) = 'LAMBDA'">
281 <m:apply helm:xref="{@id}">
283 <xsl:attribute name="definitionURL">
284 <xsl:value-of select="CONST/@uri"/>
286 <xsl:attribute name="helm:xref">
287 <xsl:value-of select="CONST/@id"/>
291 <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>
293 <xsl:apply-templates select="*[2]/target" mode="noannot"/>
297 <m:apply helm:xref="{@id}">
303 <m:csymbol>app</m:csymbol>
304 <xsl:apply-templates select="*[2]" mode="noannot"/>
310 <xsl:apply-templates select="*[4]" mode="noannot"/>