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">
38 <!--******************************************************************-->
39 <!-- Variable containing the absolute path of the CIC file -->
40 <!--******************************************************************-->
42 <xsl:variable name="absPath">http://localhost:8081/getciconly?uri=</xsl:variable>
44 <!-- ************************* LOGIC *********************************-->
49 <xsl:template match="CONST[attribute::uri='cic:/Coq/Reals/Rdefinitions/R.con']" mode="pure">
56 <xsl:template match="CONST[attribute::uri='cic:/Coq/Reals/Rdefinitions/R0.con']" mode="pure">
57 <m:cn definitionURL="{@uri}" helm:xref="{@id}">0</m:cn>
60 <xsl:template match="CONST[attribute::uri='cic:/Coq/Reals/Rdefinitions/R1.con']" mode="pure">
61 <m:cn definitionURL="{@uri}" helm:xref="{@id}">1</m:cn>
66 <!-- Unary Operations and power -->
68 <xsl:template match="APPLY[CONST[
69 attribute::uri='cic:/Coq/Reals/Rdefinitions/Ropp.con' or
70 attribute::uri='cic:/Coq/Reals/Rbasic_fun/Rabsolu.con' or
71 attribute::uri='cic:/Coq/Reals/Rfunctions/fact.con' or
72 attribute::uri='cic:/Coq/Reals/Rbase/Rsqr.con']]" mode="pure">
74 <xsl:when test="count(child::*) = 2">
75 <xsl:variable name="elem">
77 <xsl:when test="CONST/@uri='cic:/Coq/Reals/Rdefinitions/Ropp.con'">
78 <xsl:value-of select="'minus'"/>
80 <xsl:when test="CONST/@uri='cic:/Coq/Reals/Rbasic_fun/Rabsolu.con'">
81 <xsl:value-of select="'abs'"/>
83 <xsl:when test="CONST/@uri='cic:/Coq/Reals/Rfunctions/fact.con'">
84 <xsl:value-of select="'factorial'"/>
86 <xsl:when test="CONST/@uri='cic:/Coq/Reals/Rbase/Rsqr.con'">
87 <xsl:value-of select="'power'"/>
91 <m:apply helm:xref="{@id}">
92 <xsl:element name="{concat('m:',$elem)}">
93 <xsl:attribute name="definitionURL">
94 <xsl:value-of select="CONST/@uri"/>
96 <xsl:attribute name="helm:xref">
97 <xsl:value-of select="CONST/@id"/>
100 <xsl:apply-templates select="*[2]" mode="noannot"/>
101 <xsl:if test="string($elem)='power'">
102 <m:cn><xsl:value-of select="*[2]/@value"/></m:cn>
112 <xsl:template match="APPLY[CONST[
113 attribute::uri='cic:/Coq/Reals/Rdefinitions/Rinv.con']]" mode="pure">
115 <xsl:when test="count(child::*) = 2">
116 <m:apply helm:xref="{@id}">
118 <xsl:apply-templates select="*[2]" mode="noannot"/>
121 <xsl:attribute name="definitionURL">
122 <xsl:value-of select="CONST/@uri"/>
124 <xsl:attribute name="helm:xref">
125 <xsl:value-of select="CONST/@id"/>
138 <!-- Binary Operations and Relations -->
140 <xsl:template match="APPLY[CONST[
141 attribute::uri='cic:/Coq/Reals/Rdefinitions/Rplus.con' or
142 attribute::uri='cic:/Coq/Reals/Rdefinitions/Rminus.con' or
143 attribute::uri='cic:/Coq/Reals/Rdefinitions/Rmult.con' or
144 attribute::uri='cic:/Coq/Reals/Rdefinitions/Rle.con' or
145 attribute::uri='cic:/Coq/Reals/Rdefinitions/Rlt.con' or
146 attribute::uri='cic:/Coq/Reals/Rdefinitions/Rge.con' or
147 attribute::uri='cic:/Coq/Reals/Rdefinitions/Rgt.con' or
148 attribute::uri='cic:/Coq/Reals/Rbasic_fun/Rmin.con' or
149 attribute::uri='cic:/Coq/Reals/Rfunctions/pow.con']]" mode="pure">
151 <xsl:when test="count(child::*) = 3">
152 <xsl:variable name="elem">
154 <xsl:when test="CONST/@uri='cic:/Coq/Reals/Rdefinitions/Rplus.con'">
155 <xsl:value-of select="'plus'"/>
157 <xsl:when test="CONST/@uri='cic:/Coq/Reals/Rdefinitions/Rminus.con'">
158 <xsl:value-of select="'minus'"/>
160 <xsl:when test="CONST/@uri='cic:/Coq/Reals/Rdefinitions/Rmult.con'">
161 <xsl:value-of select="'times'"/>
163 <xsl:when test="CONST/@uri='cic:/Coq/Reals/Rdefinitions/Rle.con'">
164 <xsl:value-of select="'leq'"/>
166 <xsl:when test="CONST/@uri='cic:/Coq/Reals/Rdefinitions/Rlt.con'">
167 <xsl:value-of select="'lt'"/>
169 <xsl:when test="CONST/@uri='cic:/Coq/Reals/Rdefinitions/Rge.con'">
170 <xsl:value-of select="'geq'"/>
172 <xsl:when test="CONST/@uri='cic:/Coq/Reals/Rdefinitions/Rgt.con'">
173 <xsl:value-of select="'gt'"/>
175 <xsl:when test="CONST/@uri='cic:/Coq/Reals/Rbasic_fun/Rmin.con'">
176 <xsl:value-of select="'min'"/>
178 <xsl:when test="CONST/@uri='cic:/Coq/Reals/Rfunctions/pow.con'">
179 <xsl:value-of select="'power'"/>
183 <m:apply helm:xref="{@id}">
184 <xsl:element name="{concat('m:',$elem)}">
185 <xsl:attribute name="definitionURL">
186 <xsl:value-of select="CONST/@uri"/>
188 <xsl:attribute name="helm:xref">
189 <xsl:value-of select="CONST/@id"/>
192 <xsl:apply-templates select="*[2]" mode="noannot"/>
193 <xsl:apply-templates select="*[3]" mode="noannot"/>
204 <xsl:template match="APPLY[CONST[
205 attribute::uri='cic:/Coq/Reals/Rlimit/limit1_in.con']]" mode="pure">
207 <xsl:when test="count(child::*) = 5">
211 <xsl:when test="name(*[2]) = 'LAMBDA'">
212 <m:apply helm:xref="{@id}">
214 <xsl:attribute name="definitionURL">
215 <xsl:value-of select="CONST/@uri"/>
217 <xsl:attribute name="helm:xref">
218 <xsl:value-of select="CONST/@id"/>
223 <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>
227 <xsl:apply-templates select="*[5]" mode="noannot"/>
229 <xsl:apply-templates select="*[2]/target" mode="noannot"/>
233 <m:apply helm:xref="{@id}">
235 <xsl:attribute name="definitionURL">
236 <xsl:value-of select="CONST/@uri"/>
238 <xsl:attribute name="helm:xref">
239 <xsl:value-of select="CONST/@id"/>
246 <xsl:apply-templates select="*[5]" mode="noannot"/>
249 <m:csymbol>app</m:csymbol>
250 <xsl:apply-templates select="*[2]" mode="noannot"/>
256 <xsl:apply-templates select="*[4]" mode="noannot"/>
265 <!-- DIFFERENTIATION -->
267 <xsl:template match="APPLY[CONST[
268 attribute::uri='cic:/Coq/Reals/Rderiv/D_in.con']]" mode="pure">
270 <xsl:when test="count(child::*) = 4">
274 <xsl:when test="name(*[2]) = 'LAMBDA'">
275 <m:apply helm:xref="{@id}">
277 <xsl:attribute name="definitionURL">
278 <xsl:value-of select="CONST/@uri"/>
280 <xsl:attribute name="helm:xref">
281 <xsl:value-of select="CONST/@id"/>
285 <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>
287 <xsl:apply-templates select="*[2]/target" mode="noannot"/>
291 <m:apply helm:xref="{@id}">
297 <m:csymbol>app</m:csymbol>
298 <xsl:apply-templates select="*[2]" mode="noannot"/>
304 <xsl:apply-templates select="*[4]" mode="noannot"/>