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/@uri='cic:/Coq/Reals/Rdefinitions/Ropp.con']" mode="pure">
62 <xsl:call-template name="mk-mml-op-noannot">
63 <xsl:with-param name="arity" select="1"/>
64 <xsl:with-param name="c-tag" select="CONST"/>
65 <xsl:with-param name="m-tag" select="'minus'"/>
69 <xsl:template match="APPLY[CONST/@uri='cic:/Coq/Reals/Rbasic_fun/Rabsolu.con']" mode="pure">
70 <xsl:call-template name="mk-mml-op-noannot">
71 <xsl:with-param name="arity" select="1"/>
72 <xsl:with-param name="c-tag" select="CONST"/>
73 <xsl:with-param name="m-tag" select="'abs'"/>
77 <xsl:template match="APPLY[CONST/@uri='cic:/Coq/Reals/Rfunctions/fact.con']" mode="pure">
78 <xsl:call-template name="mk-mml-op-noannot">
79 <xsl:with-param name="arity" select="1"/>
80 <xsl:with-param name="c-tag" select="CONST"/>
81 <xsl:with-param name="m-tag" select="'factorial'"/>
85 <xsl:template match="APPLY[CONST/@uri='cic:/Coq/Reals/Rbase/Rsqr.con']" mode="pure">
86 <xsl:variable name="mbody">
87 <xsl:apply-templates select="*[2]" mode="noannot"/>
90 <xsl:call-template name="out-mml-op">
91 <xsl:with-param name="arity" select="1"/>
92 <xsl:with-param name="c-tag" select="CONST"/>
93 <xsl:with-param name="m-tag" select="'power'"/>
94 <xsl:with-param name="mbody" select="$mbody"/>
98 <xsl:template match="APPLY[CONST/@uri='cic:/Coq/Reals/Rdefinitions/Rinv.con']" mode="pure">
99 <xsl:variable name="mbody1">
100 <xsl:apply-templates select="*[2]" mode="noannot"/>
101 <xsl:variable name="mbody2">
104 <xsl:call-template name="out-mml-op">
105 <xsl:with-param name="arity" select="1"/>
106 <xsl:with-param name="c-tag" select="CONST"/>
107 <xsl:with-param name="m-tag" select="'minus'"/>
108 <xsl:with-param name="mbody" select="$mbody2"/>
111 <xsl:call-template name="out-mml-op">
112 <xsl:with-param name="arity" select="1"/>
113 <xsl:with-param name="c-tag" select="CONST"/>
114 <xsl:with-param name="m-tag" select="'power'"/>
115 <xsl:with-param name="mbody" select="$mbody1"/>
119 <!-- Binary Operations and Relations -->
121 <xsl:template match="APPLY[CONST/@uri='cic:/Coq/Reals/Rdefinitions/Rle.con']" mode="pure">
122 <xsl:call-template name="mk-mml-op-noannot">
123 <xsl:with-param name="arity" select="2"/>
124 <xsl:with-param name="c-tag" select="CONST"/>
125 <xsl:with-param name="m-tag" select="'leq'"/>
129 <xsl:template match="APPLY[CONST/@uri='cic:/Coq/Reals/Rdefinitions/Rlt.con']" mode="pure">
130 <xsl:call-template name="mk-mml-op-noannot">
131 <xsl:with-param name="arity" select="2"/>
132 <xsl:with-param name="c-tag" select="CONST"/>
133 <xsl:with-param name="m-tag" select="'lt'"/>
137 <xsl:template match="APPLY[CONST/@uri='cic:/Coq/Reals/Rdefinitions/Rge.con']" mode="pure">
138 <xsl:call-template name="mk-mml-op-noannot">
139 <xsl:with-param name="arity" select="2"/>
140 <xsl:with-param name="c-tag" select="CONST"/>
141 <xsl:with-param name="m-tag" select="'geq'"/>
145 <xsl:template match="APPLY[CONST/@uri='cic:/Coq/Reals/Rdefinitions/Rgt.con']" mode="pure">
146 <xsl:call-template name="mk-mml-op-noannot">
147 <xsl:with-param name="arity" select="2"/>
148 <xsl:with-param name="c-tag" select="CONST"/>
149 <xsl:with-param name="m-tag" select="'gt'"/>
153 <xsl:template match="APPLY[CONST/@uri='cic:/Coq/Reals/Rdefinitions/Rplus.con']" mode="pure">
154 <xsl:call-template name="mk-mml-op-noannot">
155 <xsl:with-param name="arity" select="2"/>
156 <xsl:with-param name="c-tag" select="CONST"/>
157 <xsl:with-param name="m-tag" select="'plus'"/>
161 <xsl:template match="APPLY[CONST/@uri='cic:/Coq/Reals/Rdefinitions/Rminus.con']" mode="pure">
162 <xsl:call-template name="mk-mml-op-noannot">
163 <xsl:with-param name="arity" select="2"/>
164 <xsl:with-param name="c-tag" select="CONST"/>
165 <xsl:with-param name="m-tag" select="'minus'"/>
169 <xsl:template match="APPLY[CONST/@uri='cic:/Coq/Reals/Rdefinitions/Rmult.con']" mode="pure">
170 <xsl:call-template name="mk-mml-op-noannot">
171 <xsl:with-param name="arity" select="2"/>
172 <xsl:with-param name="c-tag" select="CONST"/>
173 <xsl:with-param name="m-tag" select="'times'"/>
177 <xsl:template match="APPLY[CONST/@uri='cic:/Coq/Reals/Rdefinitions/Rdiv.con']" mode="pure">
178 <xsl:call-template name="mk-mml-op-noannot">
179 <xsl:with-param name="arity" select="2"/>
180 <xsl:with-param name="c-tag" select="CONST"/>
181 <xsl:with-param name="m-tag" select="'divide'"/>
185 <xsl:template match="APPLY[CONST/@uri='cic:/Coq/Reals/Rbasic_fun/Rmin.con']" mode="pure">
186 <xsl:call-template name="mk-mml-op-noannot">
187 <xsl:with-param name="arity" select="2"/>
188 <xsl:with-param name="c-tag" select="CONST"/>
189 <xsl:with-param name="m-tag" select="'min'"/>
193 <xsl:template match="APPLY[CONST/@uri='cic:/Coq/Reals/Rbasic_fun/Rmax.con']" mode="pure">
194 <xsl:call-template name="mk-mml-op-noannot">
195 <xsl:with-param name="arity" select="2"/>
196 <xsl:with-param name="c-tag" select="CONST"/>
197 <xsl:with-param name="m-tag" select="'max'"/>
201 <xsl:template match="APPLY[CONST/@uri='cic:/Coq/Reals/Rfunctions/pow.con']" mode="pure">
202 <xsl:call-template name="mk-mml-op-noannot">
203 <xsl:with-param name="arity" select="2"/>
204 <xsl:with-param name="c-tag" select="CONST"/>
205 <xsl:with-param name="m-tag" select="'power'"/>
211 <xsl:template match="APPLY[CONST[
212 attribute::uri='cic:/Coq/Reals/Rlimit/limit1_in.con']]" mode="pure">
214 <xsl:when test="count(child::*) = 5">
218 <xsl:when test="name(*[2]) = 'LAMBDA'">
219 <m:apply helm:xref="{@id}">
221 <xsl:attribute name="definitionURL">
222 <xsl:value-of select="CONST/@uri"/>
224 <xsl:attribute name="helm:xref">
225 <xsl:value-of select="CONST/@id"/>
230 <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>
234 <xsl:apply-templates select="*[5]" mode="noannot"/>
236 <xsl:apply-templates select="*[2]/target" mode="noannot"/>
240 <m:apply helm:xref="{@id}">
242 <xsl:attribute name="definitionURL">
243 <xsl:value-of select="CONST/@uri"/>
245 <xsl:attribute name="helm:xref">
246 <xsl:value-of select="CONST/@id"/>
253 <xsl:apply-templates select="*[5]" mode="noannot"/>
256 <m:csymbol>app</m:csymbol>
257 <xsl:apply-templates select="*[2]" mode="noannot"/>
263 <xsl:apply-templates select="*[4]" mode="noannot"/>
272 <!-- DIFFERENTIATION -->
274 <xsl:template match="APPLY[CONST[
275 attribute::uri='cic:/Coq/Reals/Rderiv/D_in.con']]" mode="pure">
277 <xsl:when test="count(child::*) = 4">
281 <xsl:when test="name(*[2]) = 'LAMBDA'">
282 <m:apply helm:xref="{@id}">
284 <xsl:attribute name="definitionURL">
285 <xsl:value-of select="CONST/@uri"/>
287 <xsl:attribute name="helm:xref">
288 <xsl:value-of select="CONST/@id"/>
292 <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>
294 <xsl:apply-templates select="*[2]/target" mode="noannot"/>
298 <m:apply helm:xref="{@id}">
304 <m:csymbol>app</m:csymbol>
305 <xsl:apply-templates select="*[2]" mode="noannot"/>
311 <xsl:apply-templates select="*[4]" mode="noannot"/>