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: October 2001 -->
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 <!-- ************************* ALGEBRA *********************************-->
44 <xsl:template match="APPLY[CONST/@uri='cic:/Algebra/CSemiGroups/csg_unit.con']" mode="pure">
45 <m:ci definitionURL="{CONST/@uri}" helm:xref="{@id}">0</m:ci>
48 <xsl:template match="APPLY[CONST/@uri='cic:/Algebra/CRings/cr_one.con']" mode="pure">
49 <m:ci definitionURL="{CONST/@uri}" helm:xref="{@id}">1</m:ci>
52 <!-- Unary Operations -->
54 <xsl:template match="APPLY[CONST/@uri='cic:/Algebra/CGroups/cg_inv.con']" mode="pure">
55 <xsl:call-template name="mk-mml-op-noannot">
56 <xsl:with-param name="arity" select="1"/>
57 <xsl:with-param name="hide" select="1"/>
58 <xsl:with-param name="c-tag" select="CONST"/>
59 <xsl:with-param name="m-tag" select="'minus'"/>
63 <xsl:template match="APPLY[CONST/@uri='cic:/Algebra/CMetricFields/CMetric_Fields/cmf_abs.con']" mode="pure">
64 <xsl:call-template name="mk-mml-op-noannot">
65 <xsl:with-param name="hide" select="1"/>
66 <xsl:with-param name="c-tag" select="CONST"/>
67 <xsl:with-param name="m-tag" select="'abs'"/>
72 <xsl:template match="APPLY[CONST/@uri='cic:/Algebra/CRings/exponentiation/nexp.con']" mode="pure">
73 <xsl:variable name="mbody1">
74 <xsl:apply-templates select="*[2]" mode="noannot"/>
75 <xsl:variable name="mbody2">
78 <xsl:call-template name="out-mml-op">
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="'minus'"/>
82 <xsl:with-param name="mbody" select="$mbody2"/>
85 <xsl:call-template name="out-mml-op">
86 <xsl:with-param name="arity" select="1"/>
87 <xsl:with-param name="c-tag" select="CONST"/>
88 <xsl:with-param name="m-tag" select="'power'"/>
89 <xsl:with-param name="mbody" select="$mbody1"/>
94 <!-- Binary Operations and Relations -->
96 <!-- setoid equality -->
98 <xsl:template match="APPLY[CONST/@uri='cic:/Algebra/CSetoids/cs_eq.con']" mode="pure">
99 <xsl:call-template name="mk-mml-op-noannot">
100 <xsl:with-param name="hide" select="1"/>
101 <xsl:with-param name="c-tag" select="CONST"/>
102 <xsl:with-param name="m-tag" select="'eq'"/>
108 <xsl:template match="APPLY[CONST/@uri='cic:/Algebra/CSetoids/cs_ap.con']" mode="pure">
109 <xsl:call-template name="mk-mml-op-noannot">
110 <xsl:with-param name="hide" select="1"/>
111 <xsl:with-param name="c-tag" select="CONST"/>
112 <xsl:with-param name="m-tag" select="'neq'"/>
116 <xsl:template match="APPLY[CONST/@uri='cic:/Algebra/COrdFields/leEq.con']" mode="pure">
117 <xsl:call-template name="mk-mml-op-noannot">
118 <xsl:with-param name="hide" select="1"/>
119 <xsl:with-param name="arity" select="2"/>
120 <xsl:with-param name="c-tag" select="CONST"/>
121 <xsl:with-param name="m-tag" select="'leq'"/>
125 <xsl:template match="APPLY[CONST/@uri='cic:/Algebra/COrdFields/cof_less.con']" mode="pure">
126 <xsl:call-template name="mk-mml-op-noannot">
127 <xsl:with-param name="hide" select="1"/>
128 <xsl:with-param name="c-tag" select="CONST"/>
129 <xsl:with-param name="m-tag" select="'lt'"/>
134 <xsl:template match="APPLY[CONST/@uri='cic:/Coq/Reals/Rdefinitions/Rge.con']" mode="pure">
135 <xsl:call-template name="mk-mml-op-noannot">
136 <xsl:with-param name="arity" select="2"/>
137 <xsl:with-param name="c-tag" select="CONST"/>
138 <xsl:with-param name="m-tag" select="'geq'"/>
142 <xsl:template match="APPLY[CONST/@uri='cic:/Coq/Reals/Rdefinitions/Rgt.con']" mode="pure">
143 <xsl:call-template name="mk-mml-op-noannot">
144 <xsl:with-param name="arity" select="2"/>
145 <xsl:with-param name="c-tag" select="CONST"/>
146 <xsl:with-param name="m-tag" select="'gt'"/>
151 <xsl:template match="APPLY[CONST/@uri='cic:/Algebra/CRings/cr_plus.con' or
152 CONST/@uri='cic:/Algebra/CSemiGroups/csg_op.con']" mode="pure">
153 <xsl:call-template name="mk-mml-op-noannot">
154 <xsl:with-param name="hide" select="1"/>
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:/Algebra/CRings/cr_minus.con' or
161 CONST/@uri='cic:/Algebra/CGroups/cg_minus.con']" mode="pure">
162 <xsl:call-template name="mk-mml-op-noannot">
163 <xsl:with-param name="hide" select="1"/>
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:/Algebra/CRings/cr_mult.con']" mode="pure">
170 <xsl:call-template name="mk-mml-op-noannot">
171 <xsl:with-param name="hide" select="1"/>
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:/Algebra/CFields/cf_div.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="hide" select="1"/>
181 <xsl:with-param name="c-tag" select="CONST"/>
182 <xsl:with-param name="m-tag" select="'divide'"/>
186 <xsl:template match="APPLY[CONST/@uri='cic:/Algebra/CRings/Ring_constructions/nzpro.con' and count(*)='4']" mode="pure">
187 <xsl:apply-templates select="*[3]" mode="pure"/>
191 <xsl:template match="APPLY[CONST/@uri='cic:/Coq/Reals/Rbasic_fun/Rmin.con']" mode="pure">
192 <xsl:call-template name="mk-mml-op-noannot">
193 <xsl:with-param name="arity" select="2"/>
194 <xsl:with-param name="c-tag" select="CONST"/>
195 <xsl:with-param name="m-tag" select="'min'"/>
199 <xsl:template match="APPLY[CONST/@uri='cic:/Coq/Reals/Rbasic_fun/Rmax.con']" mode="pure">
200 <xsl:call-template name="mk-mml-op-noannot">
201 <xsl:with-param name="arity" select="2"/>
202 <xsl:with-param name="c-tag" select="CONST"/>
203 <xsl:with-param name="m-tag" select="'max'"/>
209 <xsl:template match="APPLY[CONST/@uri='cic:/Algebra/CRings/exponentiation/nexp.con']" mode="pure">
210 <xsl:variable name="no_params">
211 <xsl:call-template name="get_no_params">
212 <xsl:with-param name="first_uri" select="$CICURI"/>
213 <xsl:with-param name="second_uri" select="CONST/@uri"/>
216 <xsl:call-template name="mk-mml-op-noannot">
217 <xsl:with-param name="hide" select="$no_params"/>
218 <xsl:with-param name="c-tag" select="CONST"/>
219 <xsl:with-param name="m-tag" select="'power'"/>
223 <xsl:template match="APPLY[CONST/@uri='cic:/Algebra/CRings/exponentiation/nexp_op.con' or CONST/@uri='cic:/Algebra/Expon/Zexp_def/zexp.con']" mode="pure">
224 <xsl:variable name="no_params">
225 <xsl:call-template name="get_no_params">
226 <xsl:with-param name="first_uri" select="$CICURI"/>
227 <xsl:with-param name="second_uri" select="CONST/@uri"/>
230 <xsl:variable name="mbody">
231 <xsl:apply-templates mode="noannot" select="*[3+$no_params]"/>
232 <xsl:apply-templates mode="noannot" select="*[2+$no_params]"/>
234 <xsl:call-template name="out-mml-op">
235 <xsl:with-param name="hide" select="$no_params"/>
236 <xsl:with-param name="arity" select="2"/>
237 <xsl:with-param name="c-tag" select="CONST"/>
238 <xsl:with-param name="m-tag" select="'power'"/>
239 <xsl:with-param name="mbody" select="$mbody"/>
243 <xsl:template match="APPLY[CONST/@uri='cic:/Algebra/COrdFields/absSmall.con']" mode="pure">
244 <xsl:variable name="mbody">
245 <m:apply helm:xref="{@id}">
246 <m:abs definitionURL="{CONST/@uri}" helm:xref="{CONST/@id}"/>
247 <xsl:apply-templates select="*[4]" mode="noannot"/>
249 <xsl:apply-templates select="*[3]" mode="noannot"/>
251 <xsl:call-template name="out-mml-op">
252 <xsl:with-param name="hide" select="1"/>
253 <xsl:with-param name="arity" select="2"/>
254 <xsl:with-param name="c-tag" select="CONST"/>
255 <xsl:with-param name="m-tag" select="'lt'"/>
256 <xsl:with-param name="mbody" select="$mbody"/>
260 <xsl:template match="APPLY[CONST[
261 attribute::uri='cic:/Algebra/COrdFields/OrdField_Cauchy/seqLimit.con']]" mode="pure">
262 <xsl:variable name="no_params">
263 <xsl:call-template name="get_no_params">
264 <xsl:with-param name="first_uri" select="$CICURI"/>
265 <xsl:with-param name="second_uri" select="CONST/@uri"/>
269 <xsl:when test="count(child::*) = 3+$no_params">
270 <m:apply helm:xref="{@id}">
271 <m:eq definitionURL="{CONST/@uri}" helm:xref="{@id}" />
273 <xsl:when test="name(*[2+$no_params]) = 'LAMBDA'">
274 <m:apply helm:xref="{CONST/@id}">
275 <m:limit definitionURL="{CONST/@uri}" helm:xref="{CONST/@id}"/>
278 <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>
284 <xsl:apply-templates select="*[2+$no_params]/target/*[1]" mode="noannot"/>
288 <m:apply helm:xref="{CONST/@id}">
289 <m:limit definitionURL="{CONST/@uri}" helm:xref="{CONST/@id}"/>
297 <m:csymbol>app</m:csymbol>
298 <xsl:apply-templates select="*[2+$no_params]" mode="noannot"/>
304 <xsl:apply-templates select="*[3+$no_params]" mode="noannot"/>
313 <xsl:template match="APPLY[CONST[
314 attribute::uri='cic:/Algebra/CSums/Sums/sum0.con']]" mode="pure">
315 <xsl:variable name="no_params">
316 <xsl:call-template name="get_no_params">
317 <xsl:with-param name="first_uri" select="$CICURI"/>
318 <xsl:with-param name="second_uri" select="CONST/@uri"/>
322 <xsl:when test="count(child::*) = 3+$no_params">
324 <xsl:when test="name(*[3+$no_params]) = 'LAMBDA'">
325 <m:apply helm:xref="{CONST/@id}">
326 <m:sum definitionURL="{CONST/@uri}" helm:xref="{CONST/@id}"/>
329 <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>
336 <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>
338 <xsl:apply-templates mode="noannot" select="*[2+$no_params]"/>
341 <xsl:apply-templates select="*[3+$no_params]/target/*[1]" mode="noannot"/>
345 <m:apply helm:xref="{CONST/@id}">
346 <m:sum definitionURL="{CONST/@uri}" helm:xref="{CONST/@id}"/>
354 <xsl:apply-templates mode="noannot" select="*[2+$no_params]"/>
358 <m:csymbol>app</m:csymbol>
359 <xsl:apply-templates select="*[3+$no_params]" mode="noannot"/>
373 <xsl:template match="APPLY[CONST[
374 attribute::uri='cic:/Algebra/CSums/Sums/sum.con']]" mode="pure">
375 <xsl:variable name="no_params">
376 <xsl:call-template name="get_no_params">
377 <xsl:with-param name="first_uri" select="$CICURI"/>
378 <xsl:with-param name="second_uri" select="CONST/@uri"/>
382 <xsl:when test="count(child::*) = 4+$no_params">
384 <xsl:when test="name(*[4+$no_params]) = 'LAMBDA'">
385 <m:apply helm:xref="{CONST/@id}">
386 <m:sum definitionURL="{CONST/@uri}" helm:xref="{CONST/@id}"/>
389 <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>
393 <xsl:apply-templates mode="noannot" select="*[2+$no_params]"/>
396 <xsl:apply-templates mode="noannot" select="*[3+$no_params]"/>
398 <xsl:apply-templates select="*[4+$no_params]/target/*[1]" mode="noannot"/>
402 <m:apply helm:xref="{CONST/@id}">
403 <m:sum definitionURL="{CONST/@uri}" helm:xref="{CONST/@id}"/>
408 <xsl:apply-templates mode="noannot" select="*[2+$no_params]"/>
411 <xsl:apply-templates mode="noannot" select="*[3+$no_params]"/>
414 <m:csymbol>app</m:csymbol>
415 <xsl:apply-templates select="*[4+$no_params]" mode="noannot"/>
430 <xsl:template match="APPLY[CONST/@uri='cic:/Algebra/CPolynomials/CPoly_CRing_ctd/cpoly_apply_fun.con']" mode="pure">
431 <xsl:variable name="no_params">
432 <xsl:call-template name="get_no_params">
433 <xsl:with-param name="first_uri" select="$CICURI"/>
434 <xsl:with-param name="second_uri" select="CONST/@uri"/>
438 <xsl:when test="count(child::*) = 3+$no_params">
440 <m:csymbol>app</m:csymbol>
441 <xsl:apply-templates mode="noannot" select="*[2+$no_params]"/>
442 <xsl:apply-templates mode="noannot" select="*[3+$no_params]"/>