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">
38 <!-- ************************* LOGIC *********************************-->
42 <xsl:template match="APPLY[MUTIND[attribute::uri='cic:/Coq/Init/Logic/Conjunction/and.ind'] and (count(child::*) = 3)]" mode="pure">
43 <m:apply helm:xref="{@id}">
44 <m:and definitionURL="{MUTIND/@uri}" helm:xref="{MUTIND/@id}"/>
45 <xsl:apply-templates select="*[2]" mode="noannot"/>
46 <xsl:apply-templates select="*[3]" mode="noannot"/>
52 <xsl:template match="APPLY[MUTIND[attribute::uri='cic:/Coq/Init/Logic/Disjunction/or.ind'] and (count(child::*) = 3)]" mode="pure">
53 <m:apply helm:xref="{@id}">
54 <m:or definitionURL="{MUTIND/@uri}" helm:xref="{MUTIND/@id}"/>
55 <xsl:apply-templates select="*[2]" mode="noannot"/>
56 <xsl:apply-templates select="*[3]" mode="noannot"/>
62 <xsl:template match="APPLY[CONST[attribute::uri='cic:/Coq/Init/Logic/not.con'] and (count(child::*) = 2)]" mode="pure">
63 <m:apply helm:xref="{@id}">
64 <m:not definitionURL="{CONST/@uri}" helm:xref="{MUTIND/@id}"/>
65 <xsl:apply-templates select="*[2]" mode="noannot"/>
71 <xsl:template match="APPLY[CONST[attribute::uri='cic:/Coq/Init/Logic/Equivalence/iff.ind'] and (count(child::*) = 3)]" mode="pure">
72 <m:apply helm:xref="{@id}">
73 <m:iff definitionURL="{CONST/@uri}" helm:xref="{CONST/@id}"/>
74 <xsl:apply-templates select="*[2]" mode="noannot"/>
75 <xsl:apply-templates select="*[3]" mode="noannot"/>
82 <xsl:template match="APPLY[MUTIND[attribute::uri='cic:/Coq/Init/Logic/First_order_quantifiers/ex.ind' or attribute::uri='cic:/Coq/Init/Logic_Type/exT.ind'] and (count(child::*) = 3)]" mode="pure">
83 <m:apply helm:xref="{@id}">
84 <m:exists definitionURL="{MUTIND/@uri}" helm:xref="{MUTIND/@id}"/>
86 <xsl:when test="name(*[3]) = 'LAMBDA'">
88 <m:ci><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></m:ci>
90 <xsl:apply-templates select="LAMBDA/target" mode="noannot"/>
97 <m:csymbol>app</m:csymbol>
98 <xsl:apply-templates select="*[3]" mode="noannot"/>
106 <xsl:template match="APPLY[MUTIND[attribute::uri='cic:/Coq/Init/Logic/First_order_quantifiers/ex2.ind' or attribute::uri='cic:/Coq/Init/Logic_Type/exT2.ind'] and (count(child::*) = 4)]" mode="pure">
107 <m:apply helm:xref="{@id}">
108 <m:exists definitionURL="{MUTIND/@uri}" helm:xref="{MUTIND/@id}"/>
110 <xsl:when test="name(*[3]) = 'LAMBDA'">
111 <xsl:variable name="bvarname" select="*[3]/target/@binder"/>
113 <m:ci><xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="$bvarname"/></xsl:with-param></xsl:call-template></m:ci>
116 <xsl:apply-templates select="LAMBDA[1]/target" mode="noannot"/>
119 <xsl:when test="(name(*[4]) = 'LAMBDA') and
120 ($bvarname = *[4]/target/@binder)">
121 <xsl:apply-templates select="LAMBDA[2]/target" mode="noannot"/>
125 <m:csymbol>app</m:csymbol>
126 <xsl:apply-templates select="*[4]" mode="noannot"/>
127 <m:ci><xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="$bvarname"/></xsl:with-param></xsl:call-template></m:ci>
134 <xsl:when test="name(*[4]) = 'LAMBDA'">
135 <xsl:variable name="bvarname" select="*[4]/target/@binder"/>
137 <m:ci><xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="$bvarname"/></xsl:with-param></xsl:call-template></m:ci>
141 <m:csymbol>app</m:csymbol>
142 <xsl:apply-templates select="*[3]" mode="noannot"/>
143 <m:ci><xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="$bvarname"/></xsl:with-param></xsl:call-template></m:ci>
146 <xsl:apply-templates select="*[4]/target" mode="noannot"/>
154 <m:csymbol>app</m:csymbol>
155 <xsl:apply-templates select="*[3]" mode="noannot"/>
160 <m:csymbol>app</m:csymbol>
161 <xsl:apply-templates select="*[4]" mode="noannot"/>
173 <xsl:template match="APPLY[MUTIND[attribute::uri='cic:/Coq/Init/Logic/Equality/eq.ind'] and (count(child::*) = 4)]" mode="pure">
174 <m:apply helm:xref="{@id}">
175 <m:eq definitionURL="{MUTIND/@uri}" helm:xref="{MUTIND/@id}"/>
176 <xsl:apply-templates select="*[3]" mode="noannot"/>
177 <xsl:apply-templates select="*[4]" mode="noannot"/>
182 <!-- TYPE EQUALITY -->
184 <xsl:template match="APPLY[MUTIND[attribute::uri='cic:/Coq/Init/Logic_Type/eqT.ind'] and (count(child::*) = 4)]" mode="pure">
185 <m:apply helm:xref="{@id}">
186 <m:eq definitionURL="{MUTIND/@uri}" helm:xref="{MUTIND/@id}"/>
187 <xsl:apply-templates select="*[3]" mode="noannot"/>
188 <xsl:apply-templates select="*[4]" mode="noannot"/>
193 <!-- NOT and EQ have no parameters -->
194 <xsl:template match="APPLY[CONST[attribute::uri='cic:/Coq/Init/Logic/not.con']
195 and (count(child::*) = 2) and APPLY[MUTIND[attribute::uri='cic:/Coq/Init/Logic/Equality/eq.ind']]]" mode="pure">
197 <xsl:when test="count(APPLY/child::*) = 4">
198 <m:apply helm:xref="{@id}">
200 <xsl:apply-templates select="*[2]/*[3]" mode="noannot"/>
201 <xsl:apply-templates select="*[2]/*[4]" mode="set"/>
211 <xsl:template match="APPLY[CONST[attribute::uri='cic:/Coq/Init/Logic/not.con']
212 and (count(child::*) = 2) and APPLY[MUTIND[attribute::uri='cic:/Coq/Init/Logic_Type/eqT.ind']]]" mode="pure">
214 <xsl:when test="count(APPLY/child::*) = 4">
215 <m:apply helm:xref="{@id}">
217 <xsl:apply-templates select="*[2]/*[3]" mode="noannot"/>
218 <xsl:apply-templates select="*[2]/*[4]" mode="set"/>
227 <!-- ************************ DATATYPES ******************************* -->
229 <!-- no datatypes in MathML content -->
232 <!-- *************************** PEANO ********************************* -->
234 <xsl:template match="APPLY[MUTIND[attribute::uri='cic:/Coq/Init/Peano/le.ind'] and (count(child::*) = 3)]" mode="pure">
235 <m:apply helm:xref="{@id}">
236 <m:leq definitionURL="{MUTIND/@uri}" helm:xref="{MUTIND/@id}"/>
237 <xsl:apply-templates select="*[2]" mode="noannot"/>
238 <xsl:apply-templates select="*[3]" mode="noannot"/>
242 <xsl:template match="APPLY[CONST[attribute::uri='cic:/Coq/Init/Peano/lt.con'] and (count(child::*) = 3)]" mode="pure">
243 <m:apply helm:xref="{@id}">
244 <m:lt definitionURL="{CONST/@uri}" helm:xref="{CONST/@id}"/>
245 <xsl:apply-templates select="*[2]" mode="noannot"/>
246 <xsl:apply-templates select="*[3]" mode="noannot"/>
250 <xsl:template match="APPLY[CONST[attribute::uri='cic:/Coq/Init/Peano/ge.con'] and (count(child::*) = 3)]" mode="pure">
251 <m:apply helm:xref="{@id}">
252 <m:geq definitionURL="{CONST/@uri}" helm:xref="{CONST/@id}"/>
253 <xsl:apply-templates select="*[2]" mode="noannot"/>
254 <xsl:apply-templates select="*[3]" mode="noannot"/>
258 <xsl:template match="APPLY[CONST[attribute::uri='cic:/Coq/Init/Peano/gt.con'] and (count(child::*) = 3)]" mode="pure">
259 <m:apply helm:xref="{@id}">
260 <m:gt definitionURL="{CONST/@uri}" helm:xref="{CONST/@id}"/>
261 <xsl:apply-templates select="*[2]" mode="noannot"/>
262 <xsl:apply-templates select="*[3]" mode="noannot"/>