]> matita.cs.unibo.it Git - helm.git/commitdiff
First version of Di Lena's stylesheet generator (for the HELM DTD).
authorClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Thu, 21 Nov 2002 16:58:01 +0000 (16:58 +0000)
committerClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Thu, 21 Nov 2002 16:58:01 +0000 (16:58 +0000)
13 files changed:
helm/meta_style/.cvsignore [new file with mode: 0644]
helm/meta_style/Makefile [new file with mode: 0644]
helm/meta_style/algebra.xml [new file with mode: 0644]
helm/meta_style/arith.xml [new file with mode: 0644]
helm/meta_style/basic.xml [new file with mode: 0644]
helm/meta_style/meta_cic2mathml.xsl [new file with mode: 0644]
helm/meta_style/modeset.xsl [new file with mode: 0644]
helm/meta_style/operator.dtd [new file with mode: 0644]
helm/meta_style/positive.xsl [new file with mode: 0644]
helm/meta_style/reals.xml [new file with mode: 0644]
helm/meta_style/set.xml [new file with mode: 0644]
helm/meta_style/subst.pl [new file with mode: 0755]
helm/meta_style/xslt_index.txt [new file with mode: 0644]

diff --git a/helm/meta_style/.cvsignore b/helm/meta_style/.cvsignore
new file mode 100644 (file)
index 0000000..b889488
--- /dev/null
@@ -0,0 +1,5 @@
+algebra.xsl
+arith.xsl
+basic.xsl
+reals.xsl
+set.xsl
diff --git a/helm/meta_style/Makefile b/helm/meta_style/Makefile
new file mode 100644 (file)
index 0000000..7bb4737
--- /dev/null
@@ -0,0 +1,56 @@
+XSLTPROC = xsltproc --timing
+FORMAT = xmllint --format
+SUBST = ./subst.pl
+METASTYLESHEET = meta_cic2mathml.xsl
+TMP1 = .tmpfile1
+TMP2 = .tmpfile2
+
+all: algebra.xsl arith.xsl basic.xsl reals.xsl set.xsl
+
+clean:
+       rm -f algebra.xsl arith.xsl basic.xsl reals.xsl set.xsl
+
+algebra.xsl: algebra.xml $(METASTYLESHEET)
+       @echo "**** PROCESSING algebra.xml ****"
+       @$(XSLTPROC) $(METASTYLESHEET) algebra.xml > $(TMP1)
+       @$(FORMAT) $(TMP1) > $(TMP2)
+       @mv $(TMP2) algebra.xsl
+       @rm $(TMP1)
+       @$(SUBST) oxsl: xsl: algebra.xsl
+       @$(SUBST) xmlns:oxsl xmlns:xsl algebra.xsl
+
+arith.xsl: arith.xml $(METASTYLESHEET)
+       @echo "**** PROCESSING arith.xml ****"
+       @$(XSLTPROC) $(METASTYLESHEET) arith.xml > $(TMP1)
+       @$(FORMAT) $(TMP1) > $(TMP2)
+       @mv $(TMP2) arith.xsl
+       @rm $(TMP1)
+       @$(SUBST) oxsl: xsl: arith.xsl
+       @$(SUBST) xmlns:oxsl xmlns:xsl arith.xsl
+
+basic.xsl: basic.xml $(METASTYLESHEET)
+       @echo "**** PROCESSING basic.xml ****"
+       @$(XSLTPROC) $(METASTYLESHEET) basic.xml > $(TMP1)
+       @$(FORMAT) $(TMP1) > $(TMP2)
+       @mv $(TMP2) basic.xsl
+       @rm $(TMP1)
+       @$(SUBST) oxsl: xsl: basic.xsl
+       @$(SUBST) xmlns:oxsl xmlns:xsl basic.xsl
+
+reals.xsl: reals.xml $(METASTYLESHEET)
+       @echo "**** PROCESSING reals.xml ****"
+       @$(XSLTPROC) $(METASTYLESHEET) reals.xml > $(TMP1)
+       @$(FORMAT) $(TMP1) > $(TMP2)
+       @mv $(TMP2) reals.xsl
+       @rm $(TMP1)
+       @$(SUBST) oxsl: xsl: reals.xsl
+       @$(SUBST) xmlns:oxsl xmlns:xsl reals.xsl
+
+set.xsl: set.xml $(METASTYLESHEET)
+       @echo "**** PROCESSING set.xml ****"
+       @$(XSLTPROC) $(METASTYLESHEET) set.xml > $(TMP1)
+       @$(FORMAT) $(TMP1) > $(TMP2)
+       @mv $(TMP2) set.xsl
+       @rm $(TMP1)
+       @$(SUBST) oxsl: xsl: set.xsl
+       @$(SUBST) xmlns:oxsl xmlns:xsl set.xsl
diff --git a/helm/meta_style/algebra.xml b/helm/meta_style/algebra.xml
new file mode 100644 (file)
index 0000000..119effa
--- /dev/null
@@ -0,0 +1,204 @@
+<!DOCTYPE OpList SYSTEM "operator.dtd">
+
+<OpList xmlns:m="http://www.w3.org/1998/Math/MathML">
+
+<!-- Unary Operations -->
+
+<Operator
+ name  = "0"
+ uri   = "cic:/Algebra/CSemiGroups/csg_unit.con"
+ arity = "1">
+       <mop tag="ci" helm:xref="$APP-ID">0</mop>
+</Operator>
+
+<Operator
+ name  = "1"
+ uri   = "cic:/Algebra/CRings/cr_one.con"
+ arity = "1">
+       <mop tag="ci" helm:xref="$APP-ID">1</mop>
+</Operator>
+
+<Operator
+ name  = "*****"
+ uri   = "cic:/Algebra/CGroups/cg_inv.con"
+ hide  = "1"
+ arity = "1"
+ m-tag = "minus"/>
+
+<Operator
+ name  = "*****"
+ uri   = "cic:/Algebra/CMetricFields/CMetric_Fields/cmf_abs.con"
+ hide  = "1"
+ arity = "2"
+ m-tag = "abs"/>
+
+<!-- Binary Operations and Relations -->
+
+<Operator
+ name  = "SETOID EQUALITY"
+ uri   = "cic:/Algebra/CSetoids/cs_eq.con"
+ hide  = "1"
+ arity = "2"
+ m-tag = "eq"/>
+
+<Operator
+ name  = "APART"
+ uri   = "cic:/Algebra/CSetoids/cs_ap.con"
+ hide  = "1"
+ arity = "2"
+ m-tag = "neq"/>
+
+<Operator
+ name  = "*****"
+ uri   = "cic:/Algebra/COrdFields/leEq.con"
+ hide  = "1"
+ arity = "2"
+ m-tag = "leq"/>
+
+<Operator
+ name  = "*****"
+ uri   = "cic:/Algebra/COrdFields/cof_less.con"
+ hide  = "1"
+ arity = "2"
+ m-tag = "lt"/>
+
+<Operator
+ name  = "*****"
+ uri   = "cic:/Algebra/CRings/cr_plus.con | cic:/Algebra/CSemiGroups/csg_op.con"
+ hide  = "1"
+ arity = "2"
+ m-tag = "plus"/>
+
+<Operator
+ name  = "*****"
+ uri   = "cic:/Algebra/CRings/cr_minus.con | cic:/Algebra/CGroups/cg_minus.con"
+ hide  = "1"
+ arity = "2"
+ m-tag = "minus"/>
+
+<Operator
+ name  = "*****"
+ uri   = "cic:/Algebra/CRings/cr_mult.con"
+ hide  = "1"
+ arity = "2"
+ m-tag = "times"/>
+
+<Operator
+ name  = "*****"
+ uri   = "cic:/Algebra/CFields/cf_div.con"
+ hide  = "1"
+ arity = "2"
+ m-tag = "divide"/>
+
+<Operator
+ name  = "*****"
+ uri   = "cic:/Algebra/CRings/Ring_constructions/nzpro.con"
+ cook  = "true"
+ arity = "2">
+       <param id="1"/>
+</Operator>
+
+<Operator
+ name  = "*****"
+ uri   = "cic:/Algebra/CRings/exponentiation/nexp.con"
+ cook  = "true"
+ arity = "2"
+ m-tag = "power"/>
+
+<Operator
+ name  = "*****"
+ uri   = "cic:/Algebra/CRings/exponentiation/nexp_op.con | cic:/Algebra/Expon/Zexp_def/zexp.con"
+ cook  = "true"
+ arity = "2">
+       <mapp>
+               <mop tag="power"/>
+               <param id="2"/>
+               <param id="1"/>
+       </mapp>
+</Operator>
+
+
+<Operator
+ name  = "*****"
+ uri   = "cic:/Algebra/COrdFields/absSmall.con"
+ hide  = "1"
+ arity = "2">
+       <mapp>
+               <mop tag="lt"/>
+               <mapp>
+                       <mop tag="abs"/>
+                       <param id="2"/>
+               </mapp>
+               <param id="1"/>
+       </mapp>
+</Operator>
+
+<Operator
+ name  = "*****"
+ uri   = "cic:/Algebra/CPolynomials/CPoly_CRing_ctd/cpoly_apply_fun.con"
+ cook  = "true"
+ arity = "2"> 
+       <mapp>
+               <m:csymbol>app</m:csymbol>
+               <param id="1"/>
+               <param id="2"/>
+       </mapp>
+</Operator>
+
+<Operator
+ name  = "********"
+ uri   = "cic:/Algebra/COrdFields/OrdField_Cauchy/seqLimit.con"
+ cook  = "true"
+ arity = "2">
+       <mapp>
+               <mop tag="eq" helm:xref="$APP-ID"/>
+               <mapp helm:xref="$OP-ID">
+                       <mop tag="limit"/>
+                       <mbvar name="x"/>
+                       <m:lowlimit>
+                               <m:infinity/>
+                       </m:lowlimit>
+                       <param id="1" bvar="x"/>
+               </mapp>
+               <param id="2"/>
+       </mapp>
+</Operator>
+
+<Operator
+ name  = "********"
+ uri   = "cic:/Algebra/CSums/Sums/sum0.con"
+ cook  = "true"
+ arity = "2">
+       <m:apply helm:xref="$OP-ID">
+               <mop tag="sum"/>
+               <mbvar name="x"/>
+               <m:condition>
+                       <m:apply>
+                               <m:lt/>
+                               <mvar name="x"/>
+                               <param id="1"/>
+                       </m:apply>
+               </m:condition>
+               <param id="2" bvar="x"/>
+       </m:apply>
+</Operator>
+
+<Operator
+ name  = "SUM"
+ uri   = "cic:/Algebra/CSums/Sums/sum.con"
+ cook  = "true"
+ arity = "3">
+       <m:apply helm:xref="$OP-ID">
+               <mop tag="sum"/>
+               <mbvar name="x"/>
+               <m:lowlimit>
+                       <param id="1"/>
+               </m:lowlimit>
+               <m:uplimit>
+                       <param id="2"/>
+               </m:uplimit>
+               <param id="3" bvar="x"/>
+       </m:apply>
+</Operator>
+
+</OpList>
diff --git a/helm/meta_style/arith.xml b/helm/meta_style/arith.xml
new file mode 100644 (file)
index 0000000..17fc523
--- /dev/null
@@ -0,0 +1,69 @@
+<!DOCTYPE OpList SYSTEM "operator.dtd">
+
+<!-- ************************** ARITHMETICS ****************************** -->
+
+<OpList xmlns:m="http://www.w3.org/1998/Math/MathML">
+
+<import href="positive.xsl"/>
+
+<Operator
+ name  = "LESS EQUAL"
+ uri   = "cic:/Coq/Init/Peano/le.ind | cic:/Coq/ZArith/zarith_aux/Zle.con"
+ arity = "2"
+ m-tag = "leq"/>
+
+<Operator
+ name  = "LESS THAN"
+ uri   = "cic:/Coq/Init/Peano/lt.con | cic:/Coq/ZArith/zarith_aux/Zlt.con"
+ arity = "2"
+ m-tag = "lt"/>
+
+<Operator
+ name  = "GREATER EQUAL"
+ uri   = "cic:/Coq/Init/Peano/ge.con | cic:/Coq/ZArith/zarith_aux/Zge.con"
+ arity = "2"
+ m-tag = "geq"/>
+
+<Operator
+ name  = "GREATER THAN"
+ uri   = "cic:/Coq/Init/Peano/gt.con | cic:/Coq/ZArith/zarith_aux/Zgt.con"
+ arity = "2"
+ m-tag = "gt"/>
+
+<Operator
+ name  = "*****"
+ uri   = "cic:/Coq/Init/Peano/plus.con | cic:/Coq/ZArith/fast_integer/fast_integers/Zplus.con"
+ arity = "2"
+ m-tag = "plus"/>
+
+<Operator
+ name  = "*****"
+ uri   = "cic:/Coq/Arith/Minus/minus.con | cic:/Coq/ZArith/zarith_aux/Zminus.con"
+ arity = "2"
+ m-tag = "minus"/>
+<Operator
+ name  = "*****"
+ uri   = "cic:/Coq/Init/Peano/mult.con | cic:/Coq/ZArith/fast_integer/fast_integers/Zmult.con"
+ arity = "2"
+ m-tag = "times"/>
+
+<Operator
+ name  = "*****"
+ uri   = "cic:/Coq/Arith/Min/min.con | cic:/Coq/ZArith/zarith_aux/Zmin.con"
+ arity = "2"
+ m-tag = "min"/>
+
+<Operator
+ name  = "*****"
+ uri   = "cic:/Coq/ZArith/fast_integer/fast_integers/Zopp.con"
+ arity = "1"
+ m-tag = "minus"/>
+
+<Operator
+ name  = "*****"
+ uri   = "cic:/Coq/ZArith/zarith_aux/absolu.con"
+ arity = "1"
+ m-tag = "abs"/>
+                                               
+</OpList>
diff --git a/helm/meta_style/basic.xml b/helm/meta_style/basic.xml
new file mode 100644 (file)
index 0000000..8b4c245
--- /dev/null
@@ -0,0 +1,77 @@
+<!DOCTYPE OpList SYSTEM "operator.dtd">
+
+
+<OpList xmlns:m="http://www.w3.org/1998/Math/MathML">
+
+<!-- ************************* LOGIC *********************************-->
+
+<Operator
+ name  = "AND"
+ uri   = "cic:/Coq/Init/Logic/Conjunction/and.ind"
+ arity = "2"
+ m-tag = "and"/>
+
+<Operator
+ name  = "OR"
+ uri   = "cic:/Coq/Init/Logic/Disjunction/or.ind"
+ arity = "2"
+ m-tag = "or"/>
+
+<Operator
+ name  = "NOT" 
+ uri   = "cic:/Coq/Init/Logic/not.con"
+ arity = "1"
+ m-tag = "not"/>
+<!-- EQUALITY and TYPE EQUALITY -->
+
+<Operator
+ name  = "EQUALITY and TYPE EQUALITY"
+ uri   = "cic:/Coq/Init/Logic/Equality/eq.ind | cic:/Coq/Init/Logic_Type/eqT.ind"
+ hide  = "1"
+ arity = "2"
+ m-tag = "eq"/>
+
+<NotOperator
+ name  = "NOT-EQ and NOT-EQT"
+ uri   = "cic:/Coq/Init/Logic/Equality/eq.ind | cic:/Coq/Init/Logic_Type/eqT.ind"
+ hide  = "1"
+ arity = "2">
+       <mapp>
+               <m:neq/>
+               <param id="1"/>
+               <param id="2" mode="set"/>
+       </mapp>
+</NotOperator>
+
+<Operator
+ name  = "EXIST"
+ uri   = "cic:/Coq/Init/Logic/First_order_quantifiers/ex.ind | cic:/Coq/Init/Logic_Type/exT.ind"
+ arity = "2">
+       <mapp>
+               <mop tag="exist"/>
+               <mbvar name="x"/>
+               <m:condition>
+                       <param id="1" mode="pure"/>
+               </m:condition>
+               <param id="2" bvar="x"/>
+       </mapp>
+</Operator>
+
+<Operator
+ name  = "EXIST"
+ uri   = "cic:/Coq/Init/Logic/First_order_quantifiers/ex2.ind | cic:/Coq/Init/Logic_Type/exT2.ind"
+ hide  = "1"
+ arity = "2">
+       <mapp>
+               <mop tag="exist"/>
+               <mbvar name="x"/>
+               <m:condition>
+                       <param id="1" bvar="x"/>
+               </m:condition>
+               <param id="2" bvar="x"/>
+       </mapp>
+</Operator>
+
+</OpList>
diff --git a/helm/meta_style/meta_cic2mathml.xsl b/helm/meta_style/meta_cic2mathml.xsl
new file mode 100644 (file)
index 0000000..005821e
--- /dev/null
@@ -0,0 +1,1314 @@
+<?xml version="1.0"?>
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                              xmlns:m="http://www.w3.org/1998/Math/MathML"
+                              xmlns:helm="http://www.cs.unibo.it/helm"
+                              xmlns:oxsl="http://www.w3.org/1999/XSL/TransformAlias">
+
+<xsl:output method="xml"/>
+
+<xsl:namespace-alias stylesheet-prefix="oxsl" result-prefix="xsl"/>
+
+<xsl:template match="OpList">
+       <xsl:comment> Copyright (C) 2000, HELM Team                                     </xsl:comment>
+       <xsl:comment>                                                                   </xsl:comment>
+       <xsl:comment> This file is part of HELM, an Hypertextual, Electronic            </xsl:comment>
+       <xsl:comment> Library of Mathematics, developed at the Computer Science         </xsl:comment>
+       <xsl:comment> Department, University of Bologna, Italy.                         </xsl:comment>
+       <xsl:comment>                                                                   </xsl:comment>
+       <xsl:comment> HELM is free software; you can redistribute it and/or             </xsl:comment>
+       <xsl:comment> modify it under the terms of the GNU General Public License       </xsl:comment>
+       <xsl:comment> as published by the Free Software Foundation; either version 2    </xsl:comment>
+       <xsl:comment> of the License, or (at your option) any later version.            </xsl:comment>
+       <xsl:comment>                                                                   </xsl:comment>
+       <xsl:comment> HELM is distributed in the hope that it will be useful,           </xsl:comment>
+       <xsl:comment> but WITHOUT ANY WARRANTY; without even the implied warranty of    </xsl:comment>
+       <xsl:comment> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the     </xsl:comment>
+       <xsl:comment> GNU General Public License for more details.                      </xsl:comment>
+       <xsl:comment>                                                                   </xsl:comment>
+       <xsl:comment> You should have received a copy of the GNU General Public License </xsl:comment>
+       <xsl:comment> along with HELM; if not, write to the Free Software               </xsl:comment>
+       <xsl:comment> Foundation, Inc., 59 Temple Place - Suite 330, Boston,            </xsl:comment>
+       <xsl:comment> MA  02111-1307, USA.                                              </xsl:comment>
+       <xsl:comment>                                                                   </xsl:comment>
+       <xsl:comment> For details, see the HELM World-Wide-Web page,                    </xsl:comment>
+       <xsl:comment> http://cs.unibo.it/helm/.                                         </xsl:comment>
+       
+       <oxsl:stylesheet version="1.0">
+               <xsl:apply-templates/>
+       </oxsl:stylesheet>
+</xsl:template>
+
+<xsl:template match="import">
+       <oxsl:import href="{@href}"/>
+</xsl:template>
+
+<xsl:template match="include">
+       <oxsl:include href="{@href}"/>
+</xsl:template>
+
+<xsl:template match="Operator|NotOperator">
+       <xsl:variable name="uri">
+               <xsl:call-template name="remove_white_spaces">
+                       <xsl:with-param name="uri" select="@uri"/>
+               </xsl:call-template>
+       </xsl:variable>
+
+       <xsl:variable name="not">
+               <xsl:choose>
+                       <xsl:when test="name() = 'Operator'">false</xsl:when>
+                       <xsl:otherwise>true</xsl:otherwise>
+               </xsl:choose>
+       </xsl:variable>
+
+       <xsl:choose>
+               <xsl:when test="@arity = 0 and @hide = 0 and $not = 'true'">
+                       <xsl:call-template name="out_comment">
+                               <xsl:with-param name="name" select="concat($uri,': &quot;not&quot; cannot  be applyed to a constant operator')"/>
+                       </xsl:call-template>
+               </xsl:when>
+               <xsl:when test="@arity = 0 and @hide = 0 and @cook = 'true'">
+                       <xsl:call-template name="out_comment">
+                               <xsl:with-param name="name" select="concat($uri,': a constant operator cannot be cooked')"/>
+                       </xsl:call-template>
+               </xsl:when>
+               <xsl:otherwise>
+                       <!-- All uris in uri1 list (if not empty) have CONST c-tag -->
+                       <xsl:variable name="uri1">
+                               <xsl:call-template name="select_uris">
+                                       <xsl:with-param name="uris"  select="$uri"/>
+                                       <xsl:with-param name="c-tag" select="'CONST'"/>
+                               </xsl:call-template>
+                       </xsl:variable>
+                       
+                       <!-- All uris in uri2 list (if not empty) have MUTIND c-tag -->
+                       <xsl:variable name="uri2">
+                               <xsl:call-template name="select_uris">
+                                       <xsl:with-param name="uris"  select="$uri"/>
+                                       <xsl:with-param name="c-tag" select="'MUTIND'"/>
+                               </xsl:call-template>
+                       </xsl:variable>
+
+                       <xsl:if test="$uri1 != ''">
+                               <xsl:call-template name="out_template">
+                                       <xsl:with-param name="name"  select="@name"/>
+                                       <xsl:with-param name="not"   select="$not"/>
+                                       <xsl:with-param name="uri"   select="$uri1"/>
+                                       <xsl:with-param name="cook"  select="@cook"/>
+                                       <xsl:with-param name="hide"  select="@hide"/>
+                                       <xsl:with-param name="arity" select="@arity"/>
+                                       <xsl:with-param name="m-tag" select="@m-tag"/>
+                                       <xsl:with-param name="c-tag" select="'CONST'"/>
+                               </xsl:call-template>
+                       </xsl:if>
+
+                       <xsl:if test="$uri2 != ''">
+                               <xsl:call-template name="out_template">
+                                       <xsl:with-param name="name"  select="@name"/>
+                                       <xsl:with-param name="not"   select="$not"/>
+                                       <xsl:with-param name="uri"   select="$uri2"/>
+                                       <xsl:with-param name="cook"  select="@cook"/>
+                                       <xsl:with-param name="hide"  select="@hide"/>
+                                       <xsl:with-param name="arity" select="@arity"/>
+                                       <xsl:with-param name="m-tag" select="@m-tag"/>
+                                       <xsl:with-param name="c-tag" select="'MUTIND'"/>
+                               </xsl:call-template>
+                       </xsl:if>
+               </xsl:otherwise>
+       </xsl:choose>
+</xsl:template>
+
+<xsl:template match="OpSet|NotOpSet">
+       <xsl:variable name="uri">
+               <xsl:call-template name="remove_white_spaces">
+                       <xsl:with-param name="uri" select="@uri"/>
+               </xsl:call-template>
+       </xsl:variable>
+
+       <xsl:variable name="not">
+               <xsl:choose>
+                       <xsl:when test="name() = 'OpSet'">false</xsl:when>
+                       <xsl:otherwise>true</xsl:otherwise>
+               </xsl:choose>
+       </xsl:variable>
+
+       <xsl:choose>
+               <xsl:when test="*[name() = 'Case']/@arity = 0 and @hide = 0 and $not = 'true'">
+                       <xsl:call-template name="out_comment">
+                               <xsl:with-param name="name" select="concat($uri,': &quot;not&quot; cannot  be applyed to a constant operator')"/>
+                       </xsl:call-template>
+               </xsl:when>
+               <xsl:when test="*[name() = 'Case']/@arity = 0 and @hide = 0 and @cook = 'true'">
+                       <xsl:call-template name="out_comment">
+                               <xsl:with-param name="name" select="concat($uri,': a constant operator cannot be cooked')"/>
+                       </xsl:call-template>
+               </xsl:when>
+               <xsl:otherwise>
+                       <xsl:variable name="uri1">
+                               <xsl:call-template name="select_uris">
+                                       <xsl:with-param name="uris"  select="$uri"/>
+                                       <xsl:with-param name="c-tag" select="'CONST'"/>
+                               </xsl:call-template>
+                       </xsl:variable>
+
+                       <xsl:variable name="uri2">
+                               <xsl:call-template name="select_uris">
+                                       <xsl:with-param name="uris"  select="$uri"/>
+                                       <xsl:with-param name="c-tag" select="'MUTIND'"/>
+                               </xsl:call-template>
+                       </xsl:variable>
+
+                       <xsl:if test="$uri1 != ''">
+                               <xsl:call-template name="out_template_set">
+                                       <xsl:with-param name="name"  select="@name"/>
+                                       <xsl:with-param name="not"   select="$not"/>
+                                       <xsl:with-param name="uri"   select="$uri1"/>
+                                       <xsl:with-param name="cook"  select="@cook"/>
+                                       <xsl:with-param name="hide"  select="@hide"/>
+                                       <xsl:with-param name="m-tag" select="@m-tag"/>
+                                       <xsl:with-param name="c-tag" select="'CONST'"/>
+                               </xsl:call-template>
+                       </xsl:if>
+
+                       <xsl:if test="$uri2 != ''">
+                               <xsl:call-template name="out_template_set">
+                                       <xsl:with-param name="name"  select="@name"/>
+                                       <xsl:with-param name="not"   select="$not"/>
+                                       <xsl:with-param name="uri"   select="$uri2"/>
+                                       <xsl:with-param name="cook"  select="@cook"/>
+                                       <xsl:with-param name="hide"  select="@hide"/>
+                                       <xsl:with-param name="m-tag" select="@m-tag"/>
+                                       <xsl:with-param name="c-tag" select="'MUTIND'"/>
+                               </xsl:call-template>
+                       </xsl:if>
+               </xsl:otherwise>
+       </xsl:choose>
+</xsl:template>
+
+<!-- *********************************************************************** -->
+<!--                             MAIN FUNCTIONS                              -->
+<!-- *********************************************************************** -->
+
+
+<xsl:template name="out_template">
+       <xsl:param name="name"/>
+       <xsl:param name="not"   select="'false'"/>
+       <xsl:param name="uri"/>
+       <xsl:param name="cook"  select="'false'"/>
+       <xsl:param name="hide"  select="0"/>
+       <xsl:param name="arity" select="0"/>
+       <xsl:param name="m-tag"/>
+       <xsl:param name="c-tag"/>
+
+       <xsl:variable name="apply_not">
+               <xsl:if test="$not = 'true'">*[2]/</xsl:if>
+       </xsl:variable>
+
+       <xsl:variable name="match">
+               <xsl:call-template name="out_match">
+                       <xsl:with-param name="not"   select="$not"/>
+                       <xsl:with-param name="uri"   select="$uri"/>
+                       <xsl:with-param name="cook"  select="$cook"/>
+                       <xsl:with-param name="hide"  select="$hide"/>
+                       <xsl:with-param name="arity" select="$arity"/>
+                       <xsl:with-param name="c-tag" select="$c-tag"/>
+               </xsl:call-template>    
+       </xsl:variable>
+
+       <xsl:variable name="op_uri_attr">
+               <xsl:variable name="tmp_op_uri_attr">
+                       <xsl:call-template name="op_uri_attr">
+                               <xsl:with-param name="not"   select="$not"/>
+                               <xsl:with-param name="c-tag" select="$c-tag"/>
+                               <xsl:with-param name="const" select="$arity = 0 and $hide = 0"/>
+                       </xsl:call-template>
+               </xsl:variable>
+               <xsl:value-of select="substring-after(substring-before($tmp_op_uri_attr,'}'),'{')"/>
+       </xsl:variable>
+
+       <!--                     TEMPLATE                     -->
+       <xsl:call-template name="out_comment">
+               <xsl:with-param name="name" select="$name"/>
+       </xsl:call-template>
+
+       <oxsl:template match="{$match}" mode="pure">
+               <xsl:choose>
+                       <xsl:when test="$cook = 'true'">
+                               <oxsl:variable name="no_params">
+                                       <oxsl:variable name="no_params_tmp">
+                                               <oxsl:call-template name="get_no_params">
+                                                       <oxsl:with-param name="first_uri"  select="$CICURI"/>
+                                                       <oxsl:with-param name="second_uri" select="{$op_uri_attr}"/>
+                                               </oxsl:call-template>
+                                       </oxsl:variable>
+                                       <oxsl:value-of select="number($no_params_tmp)"/>
+                               </oxsl:variable>
+                               <oxsl:choose>
+                                       <oxsl:when test="{concat('count(',$apply_not,'*) = $no_params + ',$arity + $hide + 1)}">
+                                               <xsl:call-template name="out_body">
+                                                       <xsl:with-param name="c-tag" select="$c-tag"/>
+                                                       <xsl:with-param name="m-tag" select="$m-tag"/>
+                                                       <xsl:with-param name="cook"  select="$cook"/>
+                                                       <xsl:with-param name="hide"  select="$hide"/>
+                                                       <xsl:with-param name="arity" select="$arity"/>
+                                                       <xsl:with-param name="not"   select="$not"/>
+                                               </xsl:call-template>
+                                        </oxsl:when>
+                                        <oxsl:otherwise>
+                                               <oxsl:apply-imports/>
+                                       </oxsl:otherwise>
+                               </oxsl:choose>
+                       </xsl:when>
+                       <xsl:otherwise>
+                               <xsl:call-template name="out_body">
+                                       <xsl:with-param name="c-tag" select="$c-tag"/>
+                                       <xsl:with-param name="m-tag" select="$m-tag"/>
+                                       <xsl:with-param name="cook"  select="$cook"/>
+                                       <xsl:with-param name="hide"  select="$hide"/>
+                                       <xsl:with-param name="arity" select="$arity"/>
+                                       <xsl:with-param name="not"   select="$not"/>
+                               </xsl:call-template>
+                       </xsl:otherwise>
+               </xsl:choose>
+       </oxsl:template>
+</xsl:template>
+
+<xsl:template name="out_template_set">
+       <xsl:param name="name"/>
+       <xsl:param name="not"  select="'false'"/>
+       <xsl:param name="cook" select="'false'"/>
+       <xsl:param name="uri"/>
+       <xsl:param name="hide" select="0"/>
+       <xsl:param name="m-tag"/>
+       <xsl:param name="c-tag"/>
+
+       <xsl:variable name="no_params_var">
+               <xsl:if test="$cook = 'true'">$no_params + </xsl:if>
+       </xsl:variable>
+
+       <xsl:variable name="match">
+               <xsl:call-template name="out_match_op">
+                       <xsl:with-param name="not"   select="$not"/> 
+                       <xsl:with-param name="uri"   select="$uri"/> 
+                       <xsl:with-param name="c-tag" select="$c-tag"/>
+               </xsl:call-template>
+       </xsl:variable>
+
+       <xsl:variable name="apply_not">
+               <xsl:if test="$not = 'true'">*[2]/</xsl:if>
+       </xsl:variable>
+
+       <xsl:variable name="op_uri_attr">
+               <xsl:variable name="tmp_op_uri_attr">
+                       <xsl:call-template name="op_uri_attr">
+                               <xsl:with-param name="not"   select="$not"/>
+                               <xsl:with-param name="c-tag" select="$c-tag"/>
+                       </xsl:call-template>
+               </xsl:variable>
+               <xsl:value-of select="substring-after(substring-before($tmp_op_uri_attr,'}'),'{')"/>
+       </xsl:variable>
+
+
+       <!--                     TEMPLATE                     -->
+       <xsl:call-template name="out_comment">
+               <xsl:with-param name="name" select="$name"/>
+       </xsl:call-template>
+       
+       <oxsl:template match="{concat('APPLY[',$match,']')}" mode="pure">
+               <xsl:if test="$cook = 'true'">
+                       <oxsl:variable name="no_params">
+                               <oxsl:variable name="no_params_tmp">
+                                       <oxsl:call-template name="get_no_params">
+                                               <oxsl:with-param name="first_uri"  select="$CICURI"/>
+                                               <oxsl:with-param name="second_uri" select="{$op_uri_attr}"/>
+                                       </oxsl:call-template>
+                               </oxsl:variable>
+                               <oxsl:value-of select="number($no_params_tmp)"/>
+                       </oxsl:variable>
+               </xsl:if>       
+               <oxsl:choose>
+                       <xsl:for-each select="Case">
+                               <oxsl:when test="{concat('count(',$apply_not,'*) = ',$no_params_var,@arity + $hide + 1)}">
+                                       <xsl:call-template name="out_body">
+                                               <xsl:with-param name="c-tag" select="$c-tag"/>
+                                               <xsl:with-param name="m-tag" select="$m-tag"/>
+                                               <xsl:with-param name="cook"  select="$cook"/>
+                                               <xsl:with-param name="hide"  select="$hide"/>
+                                               <xsl:with-param name="arity" select="@arity"/>
+                                               <xsl:with-param name="not"   select="$not"/>
+                                       </xsl:call-template>
+                               </oxsl:when>
+                       </xsl:for-each>
+                               <oxsl:otherwise>
+                                       <oxsl:apply-imports/>
+                               </oxsl:otherwise>
+               </oxsl:choose>
+       </oxsl:template>
+</xsl:template>
+
+<xsl:template name="out_comment">
+       <xsl:param name="name"/>
+       <xsl:if test="$name">
+               <xsl:comment>
+                       <xsl:value-of select="concat(' ',$name,' ')"/>
+               </xsl:comment>
+       </xsl:if>                                                               
+</xsl:template>
+
+<!-- Returns a regular expression with matching operators -->
+<xsl:template name="out_match_op">
+       <xsl:param name="not"  select="'false'"/>
+       <xsl:param name="uri"/>
+       <xsl:param name="c-tag"/>
+       
+       <!-- application with not operator -->
+       <xsl:variable name="app_not">
+               <xsl:if test="$not = 'true'">CONST[@uri='cic:/Coq/Init/Logic/not.con'] and </xsl:if>
+       </xsl:variable>
+
+       <xsl:variable name="uris">
+               <xsl:call-template name="test_on_uris">
+                       <xsl:with-param name="uris" select="$uri"/>
+               </xsl:call-template>
+       </xsl:variable>
+
+       <xsl:variable name="app_op">
+               <xsl:if test="$not = 'true'">APPLY[</xsl:if>
+               <xsl:value-of select="concat($c-tag,'[',$uris,']')"/>
+               <xsl:if test="$not = 'true'">]</xsl:if>
+       </xsl:variable>
+
+       <xsl:value-of select="concat($app_not,$app_op)"/>
+</xsl:template>
+
+<!-- Returns a test on apply node children number-->
+<xsl:template name="out_match_child">
+       <xsl:param name="not"   select="'false'"/>
+       <xsl:param name="cook"  select="'false'"/>
+       <xsl:param name="hide"  select="0"/>
+       <xsl:param name="arity" select="0"/>
+
+       <!--
+               Test on children number only if the operator is concatenated with not of 
+               if it is not constant and it has not to be cooked.
+               It is not possible to concatenate a constant operator with not.
+       -->
+       <xsl:if test="$not = 'true' or (($arity != 0 or $hide != 0) and $cook = 'false')">
+               <xsl:choose>
+                       <!-- if the operator has been concatenated with not, the root apply node must have only two child -->
+                       <xsl:when test="$not = 'true'">
+                               <xsl:variable name="test_apply_children">
+                                       <xsl:if test="$cook = 'false'">
+                                               <xsl:value-of select="concat(' and count(*[2]/*) = ',$arity + $hide + 1)"/>
+                                       </xsl:if>
+                               </xsl:variable>
+                               
+                               <xsl:value-of select="concat('count(*) = 2',$test_apply_children)"/>
+                       </xsl:when>
+                       <xsl:otherwise>
+                               <xsl:value-of select="concat('count(*) = ',$arity + $hide + 1)"/>
+                       </xsl:otherwise>
+               </xsl:choose>
+       </xsl:if>
+</xsl:template>
+
+<xsl:template name="out_match">
+       <xsl:param name="not"   select="'false'"/>
+       <xsl:param name="uri"/>
+       <xsl:param name="cook"  select="'false'"/>
+       <xsl:param name="hide"  select="0"/>
+       <xsl:param name="arity" select="0"/>
+       <xsl:param name="c-tag"/>
+       
+       <!--           TEST ON OPERATOR(S) TYPE         -->
+       <xsl:variable name="match_op">
+               <xsl:call-template name="out_match_op">
+                       <xsl:with-param name="not"   select="$not"/>
+                       <xsl:with-param name="uri"   select="$uri"/>
+                       <xsl:with-param name="hide"  select="$hide"/>
+                       <xsl:with-param name="c-tag" select="$c-tag"/>
+               </xsl:call-template>
+       </xsl:variable>
+               
+       <!--           TEST ON CHILD(REN) NUMBER         -->
+       <xsl:variable name="match_child">
+               <xsl:call-template name="out_match_child">
+                       <xsl:with-param name="not"   select="$not"/>
+                       <xsl:with-param name="cook"  select="$cook"/>
+                       <xsl:with-param name="hide"  select="$hide"/>
+                       <xsl:with-param name="arity" select="$arity"/>
+               </xsl:call-template>
+       </xsl:variable>
+
+       <xsl:choose>
+               <!-- not a constant operator -->
+               <xsl:when test="$arity != 0 or $hide != 0">
+                       <xsl:choose>
+                               <xsl:when test="$match_child != ''">
+                                       <xsl:value-of select="concat('APPLY[',$match_op,' and ',$match_child,']')"/>
+                               </xsl:when>
+                               <xsl:otherwise>
+                                       <xsl:value-of select="concat('APPLY[',$match_op,']')"/>
+                               </xsl:otherwise>
+                       </xsl:choose>
+               </xsl:when>
+               <xsl:otherwise>
+                       <xsl:choose>
+                               <xsl:when test="$match_child != ''">
+                                       <xsl:value-of select="concat($match_op,' and ',$match_child)"/>
+                               </xsl:when>
+                               <xsl:otherwise>
+                                       <xsl:value-of select="$match_op"/>
+                               </xsl:otherwise>
+                       </xsl:choose>
+               </xsl:otherwise>
+       </xsl:choose>
+</xsl:template>
+
+<xsl:template name="out_params">
+       <xsl:param name="params" select="1"/>
+       <xsl:param name="cook"   select="'false'"/>
+       <xsl:param name="hide"   select="0"/>
+       <xsl:param name="not"    select="'false'"/>
+       <xsl:param name="mode"   select="'noannot'"/>
+       <xsl:param name="arity"  select="0"/>
+
+       <xsl:if test="$params &lt;= $arity">
+               <xsl:variable name="param">
+                       <xsl:call-template name="param">
+                               <xsl:with-param name="id"    select="$params"/>
+                               <xsl:with-param name="not"   select="$not"/>
+                               <xsl:with-param name="cook"  select="$cook"/>
+                               <xsl:with-param name="hide"  select="$hide"/>
+                       </xsl:call-template>
+               </xsl:variable>
+
+               <oxsl:apply-templates select="{$param}" mode="{$mode}"/>
+               
+               <xsl:call-template name="out_params">
+                       <xsl:with-param name="params" select="$params + 1"/>
+                       <xsl:with-param name="cook"   select="$cook"/>
+                       <xsl:with-param name="hide"   select="$hide"/>
+                       <xsl:with-param name="not"    select="$not"/>
+                       <xsl:with-param name="mode"   select="$mode"/>
+                       <xsl:with-param name="arity"  select="$arity"/>
+               </xsl:call-template>
+       </xsl:if>
+</xsl:template>
+
+
+<xsl:template name="out_body">
+       <xsl:param name="c-tag"/>
+       <xsl:param name="cook"  select="'false'"/>
+       <xsl:param name="m-tag"/>
+       <xsl:param name="hide"  select="0"/>
+       <xsl:param name="arity" select="0"/>
+       <xsl:param name="not"   select="'false'"/>
+
+       <xsl:choose>
+               <!--            SIMPLE TRANSFORMATIONS            -->
+               <xsl:when test="count(*) = 0">
+                       <xsl:variable name="xref">{@id}</xsl:variable>
+
+                       <xsl:variable name="definitionURL">
+                               <xsl:call-template name="op_uri_attr">
+                                       <xsl:with-param name="not"   select="$not"/>
+                                       <xsl:with-param name="c-tag" select="$c-tag"/>
+                                       <xsl:with-param name="const" select="$arity = 0 and $hide = 0"/>
+                               </xsl:call-template>
+                       </xsl:variable>
+
+                        <xsl:variable name="helm:xref">
+                               <xsl:call-template name="op_id_attr">
+                                       <xsl:with-param name="not"   select="$not"/>
+                                       <xsl:with-param name="c-tag" select="$c-tag"/>
+                                       <xsl:with-param name="const" select="$arity = 0 and $hide = 0"/>
+                               </xsl:call-template>
+                        </xsl:variable>
+               
+                       <!--            APPLY            -->
+                       <m:apply helm:xref="{$xref}">
+                               <!--            OPERATOR            -->
+                               <xsl:element name="{concat('m:',$m-tag)}">
+                                       <xsl:attribute name="definitionURL">
+                                               <xsl:value-of select="$definitionURL"/>
+                                       </xsl:attribute>
+                                       <xsl:attribute name="helm:xref">
+                                               <xsl:value-of select="$helm:xref"/>
+                                       </xsl:attribute>
+                               </xsl:element>
+                               <!--            PARAMS            -->
+                               <xsl:call-template name="out_params">
+                                       <xsl:with-param name="cook"   select="$cook"/>
+                                       <xsl:with-param name="hide"   select="$hide"/>  
+                                       <xsl:with-param name="not"    select="$not"/>
+                                       <xsl:with-param name="arity"  select="$arity"/>
+                               </xsl:call-template>
+                       </m:apply>
+               </xsl:when>
+               <!--            COMPLEX TRANSFORMATIONS            -->
+               <xsl:otherwise>
+                       <xsl:apply-templates>
+                               <xsl:with-param name="c-tag" select="$c-tag"/>
+                               <xsl:with-param name="cook"  select="$cook"/>
+                               <xsl:with-param name="hide"  select="$hide"/>
+                               <xsl:with-param name="arity" select="$arity"/>
+                               <xsl:with-param name="not"   select="$not"/>
+                       </xsl:apply-templates>
+               </xsl:otherwise>
+       </xsl:choose>
+</xsl:template>
+
+<xsl:template name="out_mvar">
+       <xsl:param name="vname"/>
+       
+       <m:ci>
+               <xsl:choose>
+                       <xsl:when test="(ancestor-or-self::*[preceding-sibling::*[(name() = 'mbvar') and (@name = $vname)]]/preceding-sibling::*[(name() = 'mbvar') and (@name = $vname)])[position() = last()]">
+                               <oxsl:value-of select="{concat('$bvar_',$vname)}"/>
+                       </xsl:when>
+                       <xsl:otherwise>
+                               <xsl:value-of select="$vname"/>
+                       </xsl:otherwise>
+               </xsl:choose>
+       </m:ci>
+</xsl:template>
+
+
+<xsl:template name="out_choose_binder">
+       <xsl:param name="binded_params" select="''"/>
+       <xsl:param name="not"           select="'false'"/>
+       <xsl:param name="cook"          select="'false'"/>
+       <xsl:param name="hide"          select="0"/>
+       <xsl:param name="binder"/>
+       
+       <xsl:if test="$binded_params != ''">
+               <xsl:choose>
+                       <xsl:when test="contains($binded_params,'+')">
+                               <xsl:call-template name="out_choose_binder">
+                                       <xsl:with-param name="binded_params" select="substring-before($binded_params,'+')"/>
+                                       <xsl:with-param name="not"           select="$not"/>
+                                       <xsl:with-param name="cook"          select="$cook"/>
+                                       <xsl:with-param name="hide"          select="$hide"/>
+                                       <xsl:with-param name="binder"        select="$binder"/>
+                               </xsl:call-template>
+
+                               <xsl:call-template name="out_choose_binder">
+                                       <xsl:with-param name="binded_params" select="substring-after($binded_params,'+')"/>
+                                       <xsl:with-param name="not"           select="$not"/>
+                                       <xsl:with-param name="cook"          select="$cook"/>
+                                       <xsl:with-param name="hide"          select="$hide"/>
+                                       <xsl:with-param name="binder"        select="$binder"/>
+                               </xsl:call-template>
+                       </xsl:when>
+                       <xsl:otherwise>
+                               <xsl:variable name="param">
+                                       <xsl:call-template name="param">
+                                               <xsl:with-param name="id"    select="$binded_params"/>
+                                               <xsl:with-param name="not"   select="$not"/>
+                                               <xsl:with-param name="cook"  select="$cook"/>
+                                               <xsl:with-param name="hide"  select="$hide"/>
+                                       </xsl:call-template>
+                               </xsl:variable>
+
+                               <oxsl:when test="{concat('name(',$param,') = ',&quot;'LAMBDA'&quot;)}">
+                                       <oxsl:value-of select="{concat($param,$binder)}"/>
+                               </oxsl:when>
+                       </xsl:otherwise>
+               </xsl:choose>
+       </xsl:if>
+</xsl:template>
+
+<!-- *********************************************************************** -->
+<!--                     META LANGUAGE FOR MathML                            --> 
+<!-- *********************************************************************** -->
+       
+<xsl:template match="mapp">
+       <xsl:param name="c-tag"/>
+       <xsl:param name="cook"  select="'false'"/>
+       <xsl:param name="hide"  select="0"/>
+       <xsl:param name="arity" select="0"/>
+       <xsl:param name="not"   select="'false'"/>
+       
+       <xsl:variable name="helm:xref">
+               <xsl:choose>
+                       <xsl:when test="@xref">
+                               <xsl:call-template name="set_attribute">
+                                       <xsl:with-param name="attr"  select="@xref"/>
+                                       <xsl:with-param name="c-tag" select="$c-tag"/>
+                                       <xsl:with-param name="hide"  select="$hide"/>
+                                       <xsl:with-param name="arity" select="$arity"/>
+                                       <xsl:with-param name="not"   select="$not"/>
+                               </xsl:call-template>
+                       </xsl:when>
+                       <xsl:otherwise>{@id}</xsl:otherwise>
+               </xsl:choose>
+       </xsl:variable>
+
+       <m:apply helm:xref="{$helm:xref}">
+               <xsl:call-template name="copy_attributes">
+                       <xsl:with-param name="c-tag"  select="$c-tag"/>
+                       <xsl:with-param name="hide"   select="$hide"/>
+                       <xsl:with-param name="arity"  select="$arity"/>
+                       <xsl:with-param name="not"    select="$not"/>
+                       <xsl:with-param name="ignore" select="'xref'"/>
+               </xsl:call-template>
+       
+               <xsl:apply-templates>
+                       <xsl:with-param name="c-tag" select="$c-tag"/>
+                       <xsl:with-param name="cook"  select="$cook"/>
+                       <xsl:with-param name="hide"  select="$hide"/>
+                       <xsl:with-param name="arity" select="$arity"/>
+                       <xsl:with-param name="not"   select="$not"/>
+               </xsl:apply-templates>
+       </m:apply>
+</xsl:template>
+
+
+<xsl:template match="mop">
+       <xsl:param name="c-tag"/>
+       <xsl:param name="cook"  select="'false'"/>
+       <xsl:param name="hide"  select="0"/>
+       <xsl:param name="arity" select="0"/>
+       <xsl:param name="not"   select="'false'"/>
+
+       <!-- set definitonURL attribute -->
+       <xsl:variable name="definitionURL">
+               <xsl:choose>
+                       <xsl:when test="@definitionURL">
+                               <xsl:call-template name="set_attribute">
+                                       <xsl:with-param name="attr"  select="@definitionURL"/>
+                                       <xsl:with-param name="c-tag" select="$c-tag"/>
+                                       <xsl:with-param name="hide"  select="$hide"/>
+                                       <xsl:with-param name="arity" select="$arity"/>
+                                       <xsl:with-param name="not"   select="$not"/>
+                               </xsl:call-template>
+                       </xsl:when>
+                       <xsl:otherwise>
+                               <xsl:call-template name="op_uri_attr">
+                                       <xsl:with-param name="not"   select="$not"/>
+                                       <xsl:with-param name="c-tag" select="$c-tag"/>
+                                       <xsl:with-param name="const" select="$arity = 0 and $hide = 0"/>
+                               </xsl:call-template>
+                       </xsl:otherwise>
+               </xsl:choose>
+       </xsl:variable>
+
+       <!-- set helm:xref attribute -->
+       <xsl:variable name="helm:xref">
+               <xsl:choose>
+                       <xsl:when test="@xref">
+                               <xsl:call-template name="set_attribute">
+                                       <xsl:with-param name="attr"  select="@xref"/>
+                                       <xsl:with-param name="c-tag" select="$c-tag"/>
+                                       <xsl:with-param name="hide"  select="$hide"/>
+                                       <xsl:with-param name="arity" select="$arity"/>
+                                       <xsl:with-param name="not"   select="$not"/>
+                               </xsl:call-template>
+                       </xsl:when>
+                       <xsl:otherwise>
+                               <xsl:call-template name="op_id_attr">
+                                       <xsl:with-param name="not"   select="$not"/>
+                                       <xsl:with-param name="c-tag" select="$c-tag"/>
+                                       <xsl:with-param name="const" select="$arity = 0 and $hide = 0"/>
+                               </xsl:call-template>
+                       </xsl:otherwise>
+               </xsl:choose>
+       </xsl:variable>
+
+       <xsl:element name="{concat('m:',@tag)}">
+               <xsl:attribute name="definitionURL">
+                       <xsl:value-of select="$definitionURL"/>
+               </xsl:attribute>
+               <xsl:attribute name="helm:xref">
+                       <xsl:value-of select="$helm:xref"/>
+               </xsl:attribute>
+               
+               <xsl:call-template name="copy_attributes">
+                       <xsl:with-param name="c-tag"  select="$c-tag"/>
+                       <xsl:with-param name="hide"   select="$hide"/>
+                       <xsl:with-param name="arity"  select="$arity"/>
+                       <xsl:with-param name="not"    select="$not"/>
+                       <xsl:with-param name="ignore" select="'xref + definitionURL + tag'"/>
+               </xsl:call-template>
+               
+               <xsl:apply-templates>
+                       <xsl:with-param name="c-tag" select="$c-tag"/>
+                       <xsl:with-param name="cook"  select="$cook"/>
+                       <xsl:with-param name="hide"  select="$hide"/>
+                       <xsl:with-param name="arity" select="$arity"/>
+                       <xsl:with-param name="not"   select="$not"/>
+               </xsl:apply-templates>
+       </xsl:element>
+</xsl:template>
+
+<xsl:template match="param">
+       <xsl:param name="cook" select="'false'"/>
+       <xsl:param name="hide" select="0"/>
+       <xsl:param name="not"  select="'false'"/>
+
+       <xsl:variable name="param">
+               <xsl:call-template name="param">
+                       <xsl:with-param name="id"    select="@id"/>
+                       <xsl:with-param name="not"   select="$not"/>
+                       <xsl:with-param name="cook"  select="$cook"/>
+                       <xsl:with-param name="hide"  select="$hide"/>
+               </xsl:call-template>
+       </xsl:variable>
+
+       <xsl:choose>
+               <xsl:when test="@bvar">
+                       <oxsl:choose>
+                               <oxsl:when test="{concat('name(',$param,') = ',&quot;'LAMBDA'&quot;)}">
+                                       <oxsl:apply-templates select="{concat($param,'/target')}" mode="{@mode}"/>
+                               </oxsl:when>
+                               <oxsl:otherwise>
+                                       <m:apply>
+                                               <m:csymbol>app</m:csymbol>
+                                               <oxsl:apply-templates select="{$param}" mode="{@mode}"/>
+                                               <m:ci>
+                                                       <xsl:value-of select="@bvar"/>
+                                               </m:ci>
+                                       </m:apply>
+                               </oxsl:otherwise>
+                       </oxsl:choose>
+               </xsl:when>
+               <xsl:otherwise>
+                       <oxsl:apply-templates select="{$param}" mode="{@mode}"/>
+               </xsl:otherwise>
+       </xsl:choose>
+</xsl:template>
+
+<xsl:template match="m:*">
+       <xsl:param name="c-tag"/>
+       <xsl:param name="cook"  select="'false'"/>
+       <xsl:param name="hide"  select="0"/>
+       <xsl:param name="arity" select="0"/>
+       <xsl:param name="not"   select="'false'"/>
+       
+       <xsl:copy>
+               <xsl:call-template name="copy_attributes">
+                       <xsl:with-param name="c-tag" select="$c-tag"/>
+                       <xsl:with-param name="hide"  select="$hide"/>
+                       <xsl:with-param name="arity" select="$arity"/>
+                       <xsl:with-param name="not"   select="$not"/>
+               </xsl:call-template>
+       
+               <xsl:apply-templates>
+                       <xsl:with-param name="c-tag" select="$c-tag"/>
+                       <xsl:with-param name="cook"  select="$cook"/>
+                       <xsl:with-param name="hide"  select="$hide"/>
+                       <xsl:with-param name="arity" select="$arity"/>
+                       <xsl:with-param name="not"   select="$not"/>
+               </xsl:apply-templates>
+       </xsl:copy>
+</xsl:template>
+
+<xsl:template match="mbvar">
+       <xsl:param name="c-tag"/>
+       <xsl:param name="cook"  select="'false'"/>
+       <xsl:param name="hide"  select="0"/>
+       <xsl:param name="arity" select="0"/>
+       <xsl:param name="not"   select="'false'"/>
+
+       <xsl:variable name="binded_params">
+               <xsl:call-template name="get_binded_params">
+                       <xsl:with-param name="var"  select="@name"/>
+                       <xsl:with-param name="node" select="following-sibling::*"/>
+               </xsl:call-template>
+       </xsl:variable>
+
+       <xsl:variable name="test">
+               <xsl:call-template name="test_on_lambda">
+                       <xsl:with-param name="binded_params" select="$binded_params"/>
+                       <xsl:with-param name="not"           select="$not"/>
+                       <xsl:with-param name="cook"          select="$cook"/>
+                       <xsl:with-param name="hide"          select="$hide"/>
+               </xsl:call-template>
+       </xsl:variable>
+
+       <xsl:variable name="binder">/target/@binder</xsl:variable>
+
+       <xsl:choose>
+               <xsl:when test="$binded_params != ''">
+                       <oxsl:variable name="{concat('bvar_',@name)}">
+                               <oxsl:choose>
+                                       <!-- one or more lambdas exist -->
+                                       <oxsl:when test="{$test}">
+                                               <xsl:choose>
+                                                       <!-- binded params > 1 (more than 1 lambda) -->
+                                                       <xsl:when test="contains($binded_params,'+')">
+                                                               <oxsl:variable name="binder">
+                                                                       <oxsl:choose>
+                                                                               <xsl:call-template name="out_choose_binder">
+                                                                                       <xsl:with-param name="binded_params" select="$binded_params"/>
+                                                                                       <xsl:with-param name="not"           select="$not"/>
+                                                                                       <xsl:with-param name="hide"          select="$hide"/>
+                                                                                       <xsl:with-param name="cook"          select="$cook"/>
+                                                                                       <xsl:with-param name="binder"        select="$binder"/>
+                                                                               </xsl:call-template>
+                                                                       </oxsl:choose>
+                                                               </oxsl:variable>
+                                                               <oxsl:call-template name="insert_subscript">
+                                                                       <oxsl:with-param name="node_value" select="$binder"/>
+                                                               </oxsl:call-template>
+                                                       </xsl:when>
+                                                       <!-- binded parms = 1 (1 lambda) -->
+                                                       <xsl:otherwise>
+                                                               <xsl:variable name="param">
+                                                                       <xsl:call-template name="param">
+                                                                               <xsl:with-param name="id"    select="$binded_params"/>
+                                                                               <xsl:with-param name="not"   select="$not"/>
+                                                                               <xsl:with-param name="cook"  select="$cook"/>
+                                                                               <xsl:with-param name="hide"  select="$hide"/>
+                                                                       </xsl:call-template>
+                                                               </xsl:variable>
+                                                       
+                                                               <oxsl:call-template name="insert_subscript">
+                                                                       <oxsl:with-param name="node_value" select="{concat($param,$binder)}"/>
+                                                               </oxsl:call-template>
+                                                       </xsl:otherwise>
+                                               </xsl:choose>
+                                       </oxsl:when>
+                                       <!-- no one lambda -->
+                                       <oxsl:otherwise>
+                                               <xsl:value-of select="@name"/>
+                                       </oxsl:otherwise>
+                               </oxsl:choose>
+                       </oxsl:variable>
+
+                       <m:bvar>
+                               <m:ci>
+                                       <oxsl:value-of select="{concat('$bvar_',@name)}"/>
+                               </m:ci>
+                               <xsl:apply-templates>
+                                       <xsl:with-param name="c-tag" select="$c-tag"/>
+                                       <xsl:with-param name="cook"  select="$cook"/>
+                                       <xsl:with-param name="hide"  select="$hide"/>
+                                       <xsl:with-param name="arity" select="$arity"/>
+                                       <xsl:with-param name="not"   select="$not"/>
+                               </xsl:apply-templates>
+                       </m:bvar>
+               </xsl:when>
+               <xsl:otherwise>
+                       <m:bvar>
+                               <m:ci>
+                                       <xsl:value-of select="@name"/>
+                               </m:ci>
+                               <xsl:apply-templates>
+                                       <xsl:with-param name="c-tag" select="$c-tag"/>
+                                       <xsl:with-param name="cook"  select="$cook"/>
+                                       <xsl:with-param name="hide"  select="$hide"/>
+                                       <xsl:with-param name="arity" select="$arity"/>
+                                       <xsl:with-param name="not"   select="$not"/>
+                               </xsl:apply-templates>
+                       </m:bvar>
+               </xsl:otherwise>
+       </xsl:choose>
+</xsl:template>
+
+<xsl:template match="mvar">
+       <xsl:call-template name="out_mvar">
+               <xsl:with-param name="vname" select="@name"/>
+       </xsl:call-template>
+</xsl:template>
+
+
+
+<!-- *********************************************************************** -->
+<!--                          AUXILIARY FUNCTIONS                            -->
+<!-- *********************************************************************** -->
+
+
+<!-- Returns a value if all uris in the list have the same c-tag  -->
+<xsl:template name="get_c_tag">
+       <xsl:param name="uri" select="''"/>
+       
+       <xsl:if test="$uri != ''">
+               <xsl:choose>
+                       <xsl:when test="contains($uri,'|')">
+                               <xsl:variable name="c-tag1">
+                                       <xsl:call-template name="get_c_tag">
+                                               <xsl:with-param name="uri" select="substring-before($uri,'|')"/>
+                                       </xsl:call-template>
+                               </xsl:variable>
+                       
+                               <xsl:variable name="c-tag2">
+                                       <xsl:call-template name="get_c_tag">
+                                               <xsl:with-param name="uri" select="substring-after($uri,'|')"/>
+                                       </xsl:call-template>
+                               </xsl:variable>
+
+                               <xsl:if test="$c-tag1 = $c-tag2">
+                                       <xsl:value-of select="$c-tag1"/>
+                               </xsl:if>
+                       </xsl:when>
+                       <xsl:otherwise>
+                               <xsl:choose>
+                                       <xsl:when test="substring($uri,string-length($uri)-3) = '.con'">CONST</xsl:when>
+                                       <xsl:when test="substring($uri,string-length($uri)-3) = '.ind'">MUTIND</xsl:when>
+                               </xsl:choose>
+                       </xsl:otherwise>
+               </xsl:choose>
+       </xsl:if>
+</xsl:template>
+
+<!-- Creates a list selecting uris according to c-tag specified -->
+<xsl:template name="select_uris">
+       <xsl:param name="uris" select="''"/>
+       <xsl:param name="c-tag"/>
+
+       <xsl:if test="$uris != ''">
+               <xsl:choose>
+                       <xsl:when test="contains($uris,'|')">
+                               <xsl:variable name="list1">
+                                       <xsl:call-template name="select_uris">
+                                               <xsl:with-param name="uris"  select="substring-before($uris,'|')"/>
+                                               <xsl:with-param name="c-tag" select="$c-tag"/>
+                                       </xsl:call-template>
+                               </xsl:variable>
+
+                               <xsl:variable name="list2">
+                                       <xsl:call-template name="select_uris">
+                                               <xsl:with-param name="uris"  select="substring-after($uris,'|')"/>
+                                               <xsl:with-param name="c-tag" select="$c-tag"/>
+                                       </xsl:call-template>
+                               </xsl:variable>
+
+                               <xsl:choose>
+                                       <xsl:when test="$list1 != '' and $list2 != ''">
+                                               <xsl:value-of select="concat($list1,'|',$list2)"/>
+                                       </xsl:when>
+                                       <xsl:when test="$list1 != '' and $list2 = ''">
+                                               <xsl:value-of select="$list1"/>
+                                       </xsl:when>
+                                       <xsl:when test="$list1 = '' and $list2 != ''">
+                                               <xsl:value-of select="$list2"/>
+                                       </xsl:when>
+                               </xsl:choose>
+                       </xsl:when>
+                       <xsl:otherwise>
+                               <xsl:variable name="c-tag1">
+                                       <xsl:call-template name="get_c_tag">
+                                               <xsl:with-param name="uri" select="$uris"/>
+                                       </xsl:call-template>
+                               </xsl:variable>
+
+                               <xsl:if test="$c-tag1 = $c-tag">
+                                       <xsl:value-of select="$uris"/>
+                               </xsl:if>
+                       </xsl:otherwise>
+               </xsl:choose>
+       </xsl:if>
+</xsl:template>
+
+<!-- Returns a xpath expression matching on uri attributes -->
+<xsl:template name="test_on_uris">
+       <xsl:param name="uris" select="''"/>
+
+       <xsl:if test="$uris != ''">
+               <xsl:choose>
+                       <xsl:when test="contains($uris,'|')">
+                               <xsl:variable name="expr1">
+                                       <xsl:call-template name="test_on_uris"> 
+                                               <xsl:with-param name="uris" select="substring-before($uris,'|')"/>
+                                       </xsl:call-template>
+                               </xsl:variable>
+
+                               <xsl:variable name="expr2">
+                                       <xsl:call-template name="test_on_uris"> 
+                                               <xsl:with-param name="uris" select="substring-after($uris,'|')"/>
+                                       </xsl:call-template>
+                               </xsl:variable>
+
+                               <xsl:value-of select="concat($expr1,' or ',$expr2)"/>
+                       </xsl:when>
+                       <xsl:otherwise>
+                               <xsl:value-of select="concat('@uri=',&quot;'&quot;,$uris,&quot;'&quot;)"/>
+                       </xsl:otherwise>
+               </xsl:choose>
+       </xsl:if>
+</xsl:template>
+
+<!-- Returns a xpath expression testing on LAMBDA node existence -->
+<xsl:template name="test_on_lambda">
+       <xsl:param name="binded_params" select="''"/>
+       <xsl:param name="not"           select="'false'"/>
+       <xsl:param name="cook"          select="'false'"/>
+       <xsl:param name="hide"          select="0"/>
+       
+       <xsl:if test="$binded_params != ''">
+               <xsl:choose>
+                       <xsl:when test="contains($binded_params,'+')">
+                               <xsl:variable name="expr1">
+                                       <xsl:call-template name="test_on_lambda">
+                                               <xsl:with-param name="binded_params" select="substring-before($binded_params,'+')"/>
+                                               <xsl:with-param name="not"           select="$not"/>
+                                               <xsl:with-param name="cook"          select="$cook"/>
+                                               <xsl:with-param name="hide"          select="$hide"/>
+                                       </xsl:call-template>
+                               </xsl:variable>
+
+                               <xsl:variable name="expr2">
+                                       <xsl:call-template name="test_on_lambda">
+                                               <xsl:with-param name="binded_params" select="substring-after($binded_params,'+')"/>
+                                               <xsl:with-param name="not"           select="$not"/>
+                                               <xsl:with-param name="cook"          select="$cook"/>
+                                               <xsl:with-param name="hide"          select="$hide"/>
+                                       </xsl:call-template>
+                               </xsl:variable>
+                               
+                               <xsl:value-of select="concat($expr1,' or ',$expr2)"/>
+                       </xsl:when>
+                       <xsl:otherwise>
+                               <xsl:variable name="param">
+                                       <xsl:call-template name="param">
+                                               <xsl:with-param name="id"    select="$binded_params"/>
+                                               <xsl:with-param name="not"   select="$not"/>
+                                               <xsl:with-param name="cook"  select="$cook"/>
+                                               <xsl:with-param name="hide"  select="$hide"/>
+                                       </xsl:call-template>
+                               </xsl:variable>
+
+                               <xsl:value-of select="concat('name(',$param,') = ',&quot;'LAMBDA'&quot;)"/>                             
+                       </xsl:otherwise>
+               </xsl:choose>
+       </xsl:if>
+</xsl:template>
+
+<!-- Removes white spaces from uris list -->
+<xsl:template name="remove_white_spaces">
+       <xsl:param name="uri" select="''"/>
+
+       <xsl:if test="$uri != ''">
+               <xsl:choose>
+                       <xsl:when test="contains($uri,'|')">
+                               <xsl:variable name="uri1">
+                                       <xsl:call-template name="remove_white_spaces">
+                                               <xsl:with-param name="uri" select="substring-before($uri,'|')"/>
+                                       </xsl:call-template>
+                               </xsl:variable>
+
+                               <xsl:variable name="uri2">
+                                       <xsl:call-template name="remove_white_spaces">
+                                               <xsl:with-param name="uri" select="substring-after($uri,'|')"/>
+                                       </xsl:call-template>
+                               </xsl:variable>
+
+                               <xsl:value-of select="concat($uri1,'|',$uri2)"/>
+                       </xsl:when>
+                       <xsl:otherwise>
+                               <xsl:value-of select="normalize-space($uri)"/>
+                       </xsl:otherwise>
+               </xsl:choose>
+       </xsl:if>
+</xsl:template>
+
+<!-- 
+       Returns a list of params id attributes concatenated with '+'.
+       The params'id attribute are selected according to the value of bindig variable 'var'  
+ -->
+<xsl:template name="get_binded_params">
+       <xsl:param name="var"/>
+       <xsl:param name="node"/>
+
+       <xsl:if test="count($node) != 0">
+               <xsl:choose>
+                       <!-- another variable declaration with same name -->
+                       <xsl:when test="($node[1][name() = 'mbvar']) and ($node[1][@name = $var])"></xsl:when>
+                       <!-- a binded param -->
+                       <xsl:when test="($node[1][name() = 'param']) and ($node[1][@bvar = $var])">
+                               <!-- search on siblings -->
+                               <xsl:variable name="siblings_params">
+                                       <xsl:call-template name="get_binded_params">
+                                               <xsl:with-param name="var"  select="$var"/>
+                                               <xsl:with-param name="node" select="$node[position() > 1]"/>
+                                       </xsl:call-template>
+                               </xsl:variable>
+                               <xsl:choose>
+                                       <xsl:when test="$siblings_params != ''">
+                                               <xsl:value-of select="concat($node[1]/@id,'+',$siblings_params)"/>
+                                       </xsl:when>
+                                       <xsl:otherwise> 
+                                               <xsl:value-of select="$node[1]/@id"/>
+                                       </xsl:otherwise>
+                               </xsl:choose>
+                       </xsl:when>
+                       <xsl:otherwise>
+                               <!-- search on siblings -->
+                               <xsl:variable name="siblings_params">
+                                       <xsl:call-template name="get_binded_params">
+                                               <xsl:with-param name="var"  select="$var"/>
+                                               <xsl:with-param name="node" select="$node[position() > 1]"/>
+                                       </xsl:call-template>
+                               </xsl:variable>
+                               <!-- search on children -->
+                               <xsl:variable name="children_params">
+                                       <xsl:call-template name="get_binded_params">
+                                               <xsl:with-param name="var"  select="$var"/>
+                                               <xsl:with-param name="node" select="$node[1]/child::*"/>
+                                       </xsl:call-template>
+                               </xsl:variable>
+
+                               <xsl:choose>
+                                       <xsl:when test="$children_params != '' and $siblings_params != ''">
+                                               <xsl:value-of select="concat($children_params,'+',$siblings_params)"/>
+                                       </xsl:when>
+                                       <xsl:when test="$children_params != '' and $siblings_params = ''">
+                                               <xsl:value-of select="$children_params"/>
+                                       </xsl:when>
+                                       <xsl:when test="$children_params = '' and $siblings_params != ''">
+                                               <xsl:value-of select="$siblings_params"/>
+                                       </xsl:when>     
+                               </xsl:choose>
+                       </xsl:otherwise>
+               </xsl:choose>
+       </xsl:if>
+</xsl:template>
+
+<!-- Returns a xpath string with the location of the parameter with the id specified -->
+<xsl:template name="param">
+       <xsl:param name="id"/>
+       <xsl:param name="not"   select="'false'"/>
+       <xsl:param name="cook"  select="'false'"/>
+       <xsl:param name="hide"  select="0"/>
+
+       <xsl:variable name="apply_not">
+               <xsl:if test="$not = 'true'">*[2]/</xsl:if>
+       </xsl:variable>
+
+       <xsl:variable name="no_params_var">
+               <xsl:if test="$cook = 'true'">$no_params+</xsl:if>
+       </xsl:variable>
+
+       <xsl:value-of select="concat($apply_not,'*[',$no_params_var,$id + $hide + 1,']')"/>
+</xsl:template>
+
+<!-- Returns a xpath string with the location of the operator uri attribute -->
+<xsl:template name="op_uri_attr">
+       <xsl:param name="not"   select="'false'"/>
+       <xsl:param name="c-tag"/>
+       <xsl:param name="const" select="'false'"/>
+
+       <xsl:call-template name="op_attr">
+               <xsl:with-param name="attr_type" select="'@uri'"/>
+               <xsl:with-param name="not"       select="$not"/>
+               <xsl:with-param name="c-tag"     select="$c-tag"/>
+               <xsl:with-param name="const"     select="$const"/>
+       </xsl:call-template>
+</xsl:template>
+
+<!-- Returns a xpath string with the location of the operator id attribute -->
+<xsl:template name="op_id_attr">
+       <xsl:param name="not"  select="'false'"/>
+       <xsl:param name="c-tag"/>
+       <xsl:param name="const" select="'false'"/>
+       
+       <xsl:call-template name="op_attr">
+               <xsl:with-param name="attr_type" select="'@id'"/>
+               <xsl:with-param name="not"       select="$not"/>
+               <xsl:with-param name="c-tag"     select="$c-tag"/>
+               <xsl:with-param name="const"     select="$const"/>
+       </xsl:call-template>
+</xsl:template>
+       
+
+<!-- Returns a xpath string with the location of the operator uri or id attribute -->
+<xsl:template name="op_attr">
+       <xsl:param name="attr_type"/>
+       <xsl:param name="not"  select="'false'"/>
+       <xsl:param name="c-tag"/>
+       <xsl:param name="const" select="'false'"/>
+
+       <xsl:variable name="apply">
+               <xsl:if test="$not = 'true'">APPLY/</xsl:if>
+       </xsl:variable>
+       
+       <xsl:choose>
+               <xsl:when test="$const = 'true'">
+                       <xsl:value-of select="concat('{',$attr_type,'}')"/>     
+               </xsl:when>
+               <xsl:otherwise>
+                       <xsl:value-of select="concat('{',$apply,$c-tag,'/',$attr_type,'}')"/>                   
+               </xsl:otherwise>
+       </xsl:choose>
+</xsl:template>
+
+<xsl:template name="copy_attributes">
+       <xsl:param name="c-tag"/>
+       <xsl:param name="hide"   select="0"/>
+       <xsl:param name="arity"  select="0"/>
+       <xsl:param name="not"    select="'false'"/>
+       <xsl:param name="ignore" select="''"/>
+       
+       <xsl:variable name="test">
+               <xsl:call-template name="test_on_attributes">
+                       <xsl:with-param name="names" select="$ignore"/>
+               </xsl:call-template>
+       </xsl:variable>
+       
+       <xsl:for-each select="@*">
+               <xsl:if test="contains($test,concat('+',name(),'+')) = false()">
+                       <xsl:attribute name="{name()}">
+                               <xsl:call-template name="set_attribute">
+                                       <xsl:with-param name="attr"  select="."/>
+                                       <xsl:with-param name="c-tag" select="$c-tag"/>
+                                       <xsl:with-param name="hide"  select="$hide"/>
+                                       <xsl:with-param name="arity" select="$arity"/>
+                                       <xsl:with-param name="not"   select="$not"/>
+                               </xsl:call-template>
+                       </xsl:attribute>
+               </xsl:if>
+       </xsl:for-each>
+</xsl:template>
+
+<xsl:template name="test_on_attributes">
+       <xsl:param name="names" select="''"/>
+
+       <xsl:choose>
+               <xsl:when test="contains($names,'+')">
+                       <xsl:variable name="name">
+                               <xsl:call-template name="test_on_attributes">
+                                       <xsl:with-param name="names" select="normalize-space(substring-after($names,'+'))"/>
+                               </xsl:call-template>
+                       </xsl:variable>
+
+                       <xsl:value-of select="concat('+',normalize-space(substring-before($names,'+')),$name)"/>        
+               </xsl:when>
+               <xsl:otherwise>
+                       <xsl:value-of select="concat('+',normalize-space($names),'+')"/>
+               </xsl:otherwise>
+       </xsl:choose>
+</xsl:template>
+
+<xsl:template name="set_attribute">
+       <xsl:param name="attr"/>
+       <xsl:param name="c-tag"/>
+       <xsl:param name="hide"  select="0"/>
+       <xsl:param name="arity" select="0"/>
+       <xsl:param name="not"   select="'false'"/>
+       
+       <xsl:choose>
+               <xsl:when test="$attr = '$APP-ID'">{@id}</xsl:when>
+               <xsl:when test="$attr = '$OP-ID' or $attr = '$OP-URI'">
+                       <xsl:variable name="attr_type">
+                               <xsl:choose>
+                                       <xsl:when test="$attr = '$OP-ID'">@id</xsl:when>
+                                       <xsl:otherwise>@uri</xsl:otherwise>
+                               </xsl:choose>
+                       </xsl:variable>
+
+                       <xsl:call-template name="op_attr">
+                               <xsl:with-param name="attr_type" select="$attr_type"/>
+                               <xsl:with-param name="not"       select="$not"/>
+                               <xsl:with-param name="c-tag"     select="$c-tag"/>
+                               <xsl:with-param name="const"     select="$arity = 0 and $hide = 0"/>
+                       </xsl:call-template>
+               </xsl:when>
+               <xsl:otherwise>
+                       <xsl:value-of select="$attr"/>
+               </xsl:otherwise>
+       </xsl:choose>
+</xsl:template>
+
+</xsl:stylesheet>
diff --git a/helm/meta_style/modeset.xsl b/helm/meta_style/modeset.xsl
new file mode 100644 (file)
index 0000000..9c0af40
--- /dev/null
@@ -0,0 +1,65 @@
+<?xml version="1.0"?>
+
+<!-- Copyright (C) 2000, HELM Team                                     -->
+<!--                                                                   -->
+<!-- This file is part of HELM, an Hypertextual, Electronic            -->
+<!-- Library of Mathematics, developed at the Computer Science         -->
+<!-- Department, University of Bologna, Italy.                         -->
+<!--                                                                   -->
+<!-- HELM is free software; you can redistribute it and/or             -->
+<!-- modify it under the terms of the GNU General Public License       -->
+<!-- as published by the Free Software Foundation; either version 2    -->
+<!-- of the License, or (at your option) any later version.            -->
+<!--                                                                   -->
+<!-- HELM is distributed in the hope that it will be useful,           -->
+<!-- but WITHOUT ANY WARRANTY; without even the implied warranty of    -->
+<!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the     -->
+<!-- GNU General Public License for more details.                      -->
+<!--                                                                   -->
+<!-- You should have received a copy of the GNU General Public License -->
+<!-- along with HELM; if not, write to the Free Software               -->
+<!-- Foundation, Inc., 59 Temple Place - Suite 330, Boston,            -->
+<!-- MA  02111-1307, USA.                                              -->
+<!--                                                                   -->
+<!-- For details, see the HELM World-Wide-Web page,                    -->
+<!-- http://cs.unibo.it/helm/.                                         -->
+
+<!--******************************************************************--> 
+<!-- Basic Set Theory                                                 -->
+<!-- First draft: April 3 2000                                        -->
+<!-- HELM Group: Asperti, Padovani, Sacerdoti, Schena                 -->
+<!--******************************************************************-->
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                              xmlns:m="http://www.w3.org/1998/Math/MathML"
+                              xmlns:helm="http://www.cs.unibo.it/helm">
+
+
+<!-- ************************* LOGIC *********************************-->
+
+
+
+<xsl:template match="*" mode="set">
+    <xsl:choose>
+     <xsl:when test="name() = 'LAMBDA'">
+      <m:set>
+       <m:bvar>
+        <m:ci>
+         <xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="target/@binder"/></xsl:with-param></xsl:call-template>
+        </m:ci>
+        <m:type>
+         <xsl:apply-templates select="source" mode="noannot"/>
+        </m:type>
+       </m:bvar>
+       <m:condition>
+        <xsl:apply-templates select="target" mode="noannot"/>
+       </m:condition>
+      </m:set>
+     </xsl:when>
+     <xsl:otherwise>
+      <xsl:apply-templates select="." mode="noannot"/>
+     </xsl:otherwise>
+    </xsl:choose>
+</xsl:template>
+
+</xsl:stylesheet>
diff --git a/helm/meta_style/operator.dtd b/helm/meta_style/operator.dtd
new file mode 100644 (file)
index 0000000..c764669
--- /dev/null
@@ -0,0 +1,71 @@
+<?xml encoding="ISO-8859-1"?>
+
+<!-- CIC operators description: -->
+
+<!ELEMENT OpList ((include|import)*, (OpSet|NotOpSet|Operator|NotOperator)+)>
+
+<!ELEMENT include EMPTY>
+<!ATTLIST include
+          href CDATA #REQUIRED>
+
+<!ELEMENT import EMPTY>
+<!ATTLIST import
+          href CDATA #REQUIRED>
+
+<!ELEMENT OpSet (Case,Case+)>
+<!ATTLIST OpSet
+          name  CDATA        #IMPLIED
+          cook  (true|false) "false"
+                 uri   CDATA        #REQUIRED
+          hide  NMTOKEN      "0"
+          m-tag CDATA        #IMPLIED>
+
+<!ELEMENT NotOpSet (Case,Case+)>
+<!ATTLIST NotOpSet
+          name  CDATA        #IMPLIED
+          uri   CDATA        #REQUIRED
+                 cook  (true|false) "false"
+          hide  NMTOKEN      "0"
+          m-tag CDATA        #IMPLIED>
+
+<!ELEMENT Case (mapp|mop|param|mbvar|mvar|PCDATA)*>
+<!ATTLIST Case
+          arity NMTOKEN #REQUIRED>
+
+<!ELEMENT Operator (mapp|mop|param|mbvar|mvar|PCDATA)*>
+<!ATTLIST Operator
+          name  CDATA        #IMPLIED
+          uri   CDATA        #REQUIRED
+                 cook  (true|false) "false"
+          hide  NMTOKEN      "0" 
+          arity NMTOKEN      "0" 
+          m-tag CDATA        #IMPLIED>
+
+<!ELEMENT NotOperator (mapp|mop|param|mbvar|mvar|PCDATA)*>
+<!ATTLIST NotOperator
+          name  CDATA        #IMPLIED
+          uri   CDATA        #REQUIRED
+                 cook  (true|false) "false"
+          hide  NMTOKEN      "0"
+          arity NMTOKEN      "0"
+          m-tag CDATA        #IMPLIED>
+
+<!ELEMENT mop (mop|mapp|param|PCDATA)*>
+<!ATTLIST mop
+          tag CDATA #REQUIRED>
+
+<!ELEMENT mapp (mop|mapp|param|mbvar|mvar|PCDATA)+>
+
+<!ELEMENT param EMPTY>
+<!ATTLIST param
+          id   CDATA #REQUIRED
+          bvar CDATA #IMPLIED
+          mode CDATA "noannot">
+
+<!ELEMENT mbvar (PCDATA)*>
+<!ATTLIST mbvar
+          name CDATA #REQUIRED>
+
+<!ELEMENT mvar EMPTY>
+<!ATTLIST mvar
+          name CDATA #REQUIRED>
diff --git a/helm/meta_style/positive.xsl b/helm/meta_style/positive.xsl
new file mode 100644 (file)
index 0000000..f52b647
--- /dev/null
@@ -0,0 +1,177 @@
+<?xml version="1.0"?>
+
+<!-- Copyright (C) 2000, HELM Team                                     -->
+<!--                                                                   -->
+<!-- This file is part of HELM, an Hypertextual, Electronic            -->
+<!-- Library of Mathematics, developed at the Computer Science         -->
+<!-- Department, University of Bologna, Italy.                         -->
+<!--                                                                   -->
+<!-- HELM is free software; you can redistribute it and/or             -->
+<!-- modify it under the terms of the GNU General Public License       -->
+<!-- as published by the Free Software Foundation; either version 2    -->
+<!-- of the License, or (at your option) any later version.            -->
+<!--                                                                   -->
+<!-- HELM is distributed in the hope that it will be useful,           -->
+<!-- but WITHOUT ANY WARRANTY; without even the implied warranty of    -->
+<!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the     -->
+<!-- GNU General Public License for more details.                      -->
+<!--                                                                   -->
+<!-- You should have received a copy of the GNU General Public License -->
+<!-- along with HELM; if not, write to the Free Software               -->
+<!-- Foundation, Inc., 59 Temple Place - Suite 330, Boston,            -->
+<!-- MA  02111-1307, USA.                                              -->
+<!--                                                                   -->
+<!-- For details, see the HELM World-Wide-Web page,                    -->
+<!-- http://cs.unibo.it/helm/.                                         -->
+
+<!--******************************************************************--> 
+<!-- Arithmetics                                                      -->
+<!-- First draft: March 20 2001, Ferruccio Guidi                      -->
+<!-- Zarith: July 2001, Andrea Asperti                                -->
+<!--******************************************************************-->
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                              xmlns:m="http://www.w3.org/1998/Math/MathML"
+                              xmlns:helm="http://www.cs.unibo.it/helm">
+
+<!-- ************************** ARITHMETICS ****************************** -->
+
+<!-- S and O -->
+<xsl:template match="APPLY[*[position()=1 and name()='MUTCONSTRUCT' and @uri='cic:/Coq/Init/Datatypes/nat.ind' and @noConstr='2'] and count(*)=2]" mode="pure">
+   <xsl:apply-templates select="*[2]" mode="succ">
+    <xsl:with-param name="n" select="1"/>
+    <xsl:with-param name="iden" select="@id"/>
+   </xsl:apply-templates>
+</xsl:template>
+
+<xsl:template match="*" mode="succ">
+ <xsl:param name="n" select="0"/>
+ <xsl:param name="iden" select="''"/>
+ <xsl:choose>
+  <xsl:when test="name()='APPLY' and *[position()=1 and name()='MUTCONSTRUCT'
+and @uri='cic:/Coq/Init/Datatypes/nat.ind' and @noConstr='2']">
+   <xsl:apply-templates select="*[2]" mode="succ">
+    <xsl:with-param name="n" select="$n +1"/>
+    <xsl:with-param name="iden" select="$iden"/>
+   </xsl:apply-templates>
+  </xsl:when>
+  <xsl:when test="name()='MUTCONSTRUCT' and @uri='cic:/Coq/Init/Datatypes/nat.ind' and @noConstr='1'">
+   <m:cn helm:xref="{$iden}"><xsl:value-of select="$n"/></m:cn>
+  </xsl:when>
+  <xsl:otherwise>
+   <m:apply helm:xref="{$iden}">
+    <m:plus/>
+    <m:cn><xsl:value-of select="$n"/></m:cn>
+    <xsl:apply-templates select="." mode="pure"/>
+   </m:apply>
+  </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+
+<!-- **************************** Zarith ******************************** -->
+
+
+
+<xsl:template match="APPLY[*[position()=1 and name()='MUTCONSTRUCT' and @uri='cic:/Coq/ZArith/fast_integer/fast_integers/Z.ind' and @noConstr='2'] and count(*)=2]" mode="pure">
+   <xsl:apply-templates select="*[2]" mode="Zpositive">
+    <xsl:with-param name="base" select="0"/>
+    <xsl:with-param name="exp" select="1"/>
+    <xsl:with-param name="iden" select="*[2]/@id"/>
+   </xsl:apply-templates>
+</xsl:template>
+<xsl:template match="APPLY[*[position()=1 and name()='MUTCONSTRUCT' and @uri='cic:/Coq/ZArith/fast_integer/fast_integers/Z.ind' and @noConstr='3'] and count(*)=2]" mode="pure">
+   <m:apply helm:xref="{@id}">
+    <m:minus definitionURL="{*[1]/@uri}" helm:xref="{*[1]/@id}"/>
+    <xsl:apply-templates select="*[2]" mode="Zpositive">
+     <xsl:with-param name="base" select="0"/>
+     <xsl:with-param name="exp" select="1"/>
+     <xsl:with-param name="iden" select="*[2]/@id"/>
+    </xsl:apply-templates>
+   </m:apply>
+</xsl:template>
+
+<xsl:template match="MUTCONSTRUCT[@uri='cic:/Coq/ZArith/fast_integer/fast_integers/Z.ind' and @noConstr='1']" mode="pure">
+   <m:ci definitionURL="{@uri}" helm:xref="{@id}">0</m:ci>
+</xsl:template>
+
+<!-- prova di notazione per positive -->
+
+<xsl:template match="APPLY[*[position()=1 and name()='MUTCONSTRUCT' and @uri='cic:/Coq/ZArith/fast_integer/fast_integers/positive.ind']]" mode="pure">
+   <xsl:apply-templates select="." mode="Zpositive">
+    <xsl:with-param name="base" select="0"/>
+    <xsl:with-param name="exp" select="1"/>
+    <xsl:with-param name="iden" select="@id"/>
+   </xsl:apply-templates>
+</xsl:template>
+
+<xsl:template match="MUTCONSTRUCT[@uri='cic:/Coq/ZArith/fast_integer/fast_integers/positive.ind' and @noConstr='3']" mode="pure">
+ <m:ci definitionURL="{@uri}" helm:xref="{@id}">1</m:ci>
+</xsl:template> 
+
+<xsl:template match="*" mode="Zpositive">
+ <xsl:param name="base" select="0"/>
+ <xsl:param name="exp" select="1"/>
+ <xsl:param name="iden" select="''"/>
+ <xsl:choose>
+  <xsl:when test="name()='APPLY' and *[position()=1 and name()='MUTCONSTRUCT'
+and @uri='cic:/Coq/ZArith/fast_integer/fast_integers/positive.ind' and @noConstr='1']">
+   <xsl:apply-templates select="*[2]" mode="Zpositive">
+    <xsl:with-param name="base" select="$base + $exp"/>
+    <xsl:with-param name="exp" select="2 * $exp"/>
+    <xsl:with-param name="iden" select="$iden"/>
+   </xsl:apply-templates>
+  </xsl:when>
+  <xsl:when test="name()='APPLY' and *[position()=1 and name()='MUTCONSTRUCT' 
+and @uri='cic:/Coq/ZArith/fast_integer/fast_integers/positive.ind' and @noConstr='2']">
+   <xsl:apply-templates select="*[2]" mode="Zpositive">
+    <xsl:with-param name="base" select="$base"/>
+    <xsl:with-param name="exp" select="2 * $exp"/>
+    <xsl:with-param name="iden" select="$iden"/>
+   </xsl:apply-templates>
+  </xsl:when>
+  <xsl:when test="name()='MUTCONSTRUCT' and @uri='cic:/Coq/ZArith/fast_integer/fast_integers/positive.ind' and @noConstr='3'">
+   <m:ci helm:xref="{$iden}"><xsl:value-of select="$base + $exp"/></m:ci>
+  </xsl:when>
+  <xsl:otherwise>
+   <xsl:choose>
+    <xsl:when test="$base = 0">
+     <xsl:choose>
+      <xsl:when test="$exp = 1">
+       <xsl:apply-templates select="." mode="pure"/>
+      </xsl:when>
+      <xsl:otherwise>
+       <m:apply helm:xref="{$iden}">
+        <m:times/>
+        <m:ci><xsl:value-of select="$exp"/></m:ci>
+        <xsl:apply-templates select="." mode="pure"/>
+       </m:apply>
+      </xsl:otherwise>
+     </xsl:choose>
+    </xsl:when>
+    <xsl:otherwise>
+     <m:apply helm:xref="{$iden}">
+      <m:plus/>
+      <m:ci><xsl:value-of select="$base"/></m:ci>
+      <xsl:choose>
+       <xsl:when test="$exp = 1">
+        <xsl:apply-templates select="." mode="pure"/>
+       </xsl:when>
+       <xsl:otherwise>
+        <m:apply helm:xref="{$iden}">
+         <m:times/>
+         <m:ci><xsl:value-of select="$exp"/></m:ci>
+         <xsl:apply-templates select="." mode="pure"/>
+        </m:apply>
+       </xsl:otherwise>
+      </xsl:choose>
+     </m:apply>
+    </xsl:otherwise>
+   </xsl:choose>
+  </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+
+</xsl:stylesheet>
diff --git a/helm/meta_style/reals.xml b/helm/meta_style/reals.xml
new file mode 100644 (file)
index 0000000..b4cdf2d
--- /dev/null
@@ -0,0 +1,163 @@
+<!DOCTYPE OpList SYSTEM "operator.dtd">
+
+<OpList xmlns:m="http://www.w3.org/1998/Math/MathML">
+
+<!-- Unary Operations and power -->
+
+<Operator
+ name  = "0"
+ uri   = "cic:/Coq/Reals/Rdefinitions/R0.con">
+       <mop tag="cn">0</mop>
+</Operator>
+
+<Operator
+ name  = "1"
+ uri   = "cic:/Coq/Reals/Rdefinitions/R1.con">
+       <mop tag="cn">1</mop>
+</Operator>
+
+<Operator
+ name  = "*****"
+ uri   = "cic:/Coq/Reals/Rdefinitions/Ropp.con"
+ arity = "1"
+ m-tag = "minus"/>
+
+<Operator
+ name  = "*****"
+ uri   = "cic:/Coq/Reals/Rbasic_fun/Rabsolu.con"
+ arity = "1"
+ m-tag = "abs"/>
+
+<Operator
+ name  = "*****"
+ uri   = "cic:/Coq/Reals/Rfunctions/fact.con"
+ arity = "1"
+ m-tag = "factorial"/>
+
+<Operator
+ name  = "*****"
+ uri   = "cic:/Coq/Reals/Rbase/Rsqr.con"
+ arity = "1">
+       <mapp>
+               <mop tag="power"/>
+               <param id="1"/>
+               <m:cn>2</m:cn>
+       </mapp>
+</Operator>
+
+<Operator
+ name  = "*****"
+ uri   = "cic:/Coq/Reals/Rdefinitions/Rinv.con"
+ arity = "1">
+       <mapp>
+               <mop tag="power"/>
+               <param id="1"/>
+               <mapp>
+                       <mop tag="minus"/>
+                       <m:cn>1</m:cn>
+               </mapp>
+       </mapp>
+</Operator>
+
+<!-- Binary Operations and Relations -->
+
+<Operator
+ name  = "*****"
+ uri   = "cic:/Coq/Reals/Rdefinitions/Rle.con"
+ arity = "2"
+ m-tag = "leq"/>
+
+<Operator
+ name  = "*****"
+ uri   = "cic:/Coq/Reals/Rdefinitions/Rlt.con"
+ arity = "2"
+ m-tag = "lt"/>
+
+<Operator
+ name  = "*****"
+ uri   = "cic:/Coq/Reals/Rdefinitions/Rge.con"
+ arity = "2"
+ m-tag = "geq"/>
+
+<Operator
+ name  = "*****"
+ uri   = "cic:/Coq/Reals/Rdefinitions/Rgt.con"
+ arity = "2"
+ m-tag = "gt"/>
+
+<Operator
+ name  = "*****"
+ uri   = "cic:/Coq/Reals/Rdefinitions/Rplus.con"
+ arity = "2"
+ m-tag = "plus"/>
+
+<Operator
+ name  = "*****"
+ uri   = "cic:/Coq/Reals/Rdefinitions/Rminus.con"
+ arity = "2"
+ m-tag = "minus"/>
+
+<Operator
+ name  = "*****"
+ uri   = "cic:/Coq/Reals/Rdefinitions/Rmult.con"
+ arity = "2"
+ m-tag = "times"/>
+
+<Operator
+ name  = "*****"
+ uri   = "cic:/Coq/Reals/Rdefinitions/Rdiv.con"
+ arity = "2"
+ m-tag = "divide"/>
+
+<Operator
+ name  = "*****"
+ uri   = "cic:/Coq/Reals/Rbasic_fun/Rmin.con"
+ arity = "2"
+ m-tag = "min"/>
+
+<Operator
+ name  = "*****"
+ uri   = "cic:/Coq/Reals/Rbasic_fun/Rmax.con"
+ arity = "2"
+ m-tag = "max"/>
+
+<Operator
+ name  = "*****"
+ uri   = "cic:/Coq/Reals/Rfunctions/pow.con"
+ arity = "2"
+ m-tag = "power"/>
+
+<Operator
+ name  = "LIMIT"
+ uri   = "cic:/Coq/Reals/Rlimit/limit1_in.con"
+ arity = "4">
+       <m:apply>
+               <m:eq/>
+               <mapp>
+                       <mop tag="limit"/>
+                       <mbvar name="x"/>
+                       <m:lowlimit>
+                               <param id="4"/>
+                       </m:lowlimit>
+                       <param id="1" bvar="x"/>
+               </mapp>
+               <param id="3"/>
+       </m:apply>
+</Operator>
+
+<Operator
+ name  = "DIFFERENTIATION"
+ uri   = "cic:/Coq/Reals/Rderiv/D_in.con"
+ arity = "3">
+       <m:apply>
+               <m:eq/>
+               <mapp>
+                       <mop tag="diff"/>
+                       <mbvar name="x"/>
+                       <param id="1" bvar="x"/>
+               </mapp>
+               <param id="3"/>
+       </m:apply>
+</Operator>
+
+</OpList>
diff --git a/helm/meta_style/set.xml b/helm/meta_style/set.xml
new file mode 100644 (file)
index 0000000..9384b84
--- /dev/null
@@ -0,0 +1,315 @@
+<!DOCTYPE OpList SYSTEM "operator.dtd">
+
+<OpList xmlns:m="http://www.w3.org/1998/Math/MathML">
+
+<import href="modeset.xsl"/>
+
+<Operator
+ name  = "IN"
+ uri   = "cic:/Coq/Sets/Ensembles/Ensembles/In.con"
+ cook  = "true"
+ arity = "2">
+       <mapp>
+               <mop tag="in"/>
+               <param id="2"/>
+               <param id="1" mode="set"/>
+       </mapp>
+</Operator>
+
+<NotOperator
+ name  = "NOT IN"
+ uri   = "cic:/Coq/Sets/Ensembles/Ensembles/In.con"
+ cook  = "true"
+ arity = "2">
+       <mapp>
+               <m:notin/>
+               <param id="2"/>
+               <param id="1" mode="set"/>
+       </mapp>
+</NotOperator>
+
+<Operator
+ name  = "EMPTY SET"
+ uri   = "cic:/Coq/Sets/Ensembles/Ensembles/Empty_set.ind"
+ cook  = "true">
+       <mop tag="set" helm:xref="$APP-ID"/>
+</Operator>
+
+<Operator
+ name  = "EMPTY SET"
+ uri   = "cic:/Coq/Sets/Ensembles/Ensembles/Empty_set.ind"
+ cook  = "true"
+ arity = "1">
+       <mapp>
+               <m:in definitionURL="cic:/Coq/Sets/Ensembles/Ensembles/In.con"/>
+               <param id="1"/>
+               <mop tag="set" helm:xref="$APP-ID"/>
+       </mapp>
+</Operator>
+
+<OpSet
+ name  = "SINGLETON"
+ uri   = "cic:/Coq/Sets/Ensembles/Ensembles/Singleton.ind"
+ cook  = "true">
+
+       <Case arity="1">
+               <mop tag="set" helm:xref="$APP-ID">
+                       <param id="1"/>
+               </mop>
+       </Case>
+
+       <Case arity="2">
+               <mapp>
+                       <m:in definitionURL="cic:/Coq/Sets/Ensembles/Ensembles/In.con"/>
+                       <param id="2"/>
+                       <m:set definitionURL="$OP-URI">
+                               <param id="1"/>
+                       </m:set>
+               </mapp>
+       </Case>
+</OpSet>
+
+<OpSet
+ name  = "COUPLE"
+ uri   = "cic:/Coq/Sets/Ensembles/Ensembles/Couple.ind"
+ cook  = "true">
+       
+       <Case arity="2">
+               <mop tag="set" helm:xref="$APP-ID">
+                       <param id="1"/>
+                       <param id="2"/>
+               </mop>
+       </Case>
+
+       <Case arity="3">
+               <mapp>
+                       <m:in definitionURL="cic:/Coq/Sets/Ensembles/Ensembles/In.con"/>
+                       <param id="3"/>
+                       <m:set definitionURL="$OP-URI">
+                               <param id="1"/>
+                               <param id="2"/>
+                       </m:set>
+               </mapp>
+       </Case>
+</OpSet>
+
+<OpSet
+ name  = "TRIPLE"
+ uri   = "cic:/Coq/Sets/Ensembles/Ensembles/Triple.ind"
+ cook  = "true">
+       <Case arity="3">
+               <mop tag="set">
+                       <param id="1"/>
+                       <param id="2"/>
+                       <param id="3"/>
+               </mop>
+       </Case>
+       <Case arity="4">
+               <mapp>
+                       <m:in definitionURL="cic:/Coq/Sets/Ensembles/Ensembles/In.con"/>
+                       <param id="4"/>
+                       <m:set definitionURL="$OP-URI">
+                               <param id="1"/>
+                               <param id="2"/>
+                               <param id="3"/>
+                       </m:set>
+               </mapp>
+       </Case>
+</OpSet>
+
+<OpSet
+ name  = "INTERSECTION"
+ uri   = "cic:/Coq/Sets/Ensembles/Ensembles/Intersection.ind"
+ cook  = "true">
+
+       <Case arity="2">
+               <mapp>
+                       <mop tag="intersect"/>
+                       <param id="1" mode="set"/>
+                       <param id="2" mode="set"/>
+               </mapp>
+       </Case>
+
+       <Case arity="3">
+               <mapp>
+                       <m:in/>
+                       <param id="3"/>
+                       <m:apply>
+                               <mop tag="intersect"/>
+                               <param id="1" mode="set"/>
+                               <param id="2" mode="set"/>
+                       </m:apply>
+               </mapp>
+       </Case>
+</OpSet>
+
+<OpSet
+ name  = "UNION"
+ uri   = "cic:/Coq/Sets/Ensembles/Ensembles/Union.ind"
+ cook  = "true">
+       
+       <Case arity="2">
+               <mapp>
+                       <mop tag="union"/>
+                       <param id="1" mode="set"/>
+                       <param id="2" mode="set"/>              
+               </mapp>
+       </Case>
+       <Case arity="3">
+               <mapp>
+                       <m:in/>
+                       <param id="3"/> 
+                       <m:apply>       
+                               <mop tag="union"/>
+                               <param id="1" mode="set"/>
+                               <param id="2" mode="set"/>
+                       </m:apply>      
+               </mapp>
+       </Case>
+</OpSet>
+
+<Operator
+ name  = "INCLUDED"
+ uri   = "cic:/Coq/Sets/Ensembles/Ensembles/Included.con"
+ cook  = "true"
+ arity = "2">
+       <mapp>
+               <mop tag="subset"/>
+               <param id="1" mode="set"/>
+               <param id="2" mode="set"/>
+       </mapp>
+</Operator>
+
+<Operator
+ name  = "STRICTLY INCLUDED"
+ uri   = "cic:/Coq/Sets/Ensembles/Ensembles/Strict_Included.con"
+ cook  = "true"
+ arity = "2">
+       <mapp>
+               <mop tag="prsubset"/>
+               <param id="1" mode="set"/>
+               <param id="2" mode="set"/>
+       </mapp>
+</Operator>
+
+<OpSet
+ name  = "SET-DIFF"
+ uri   = "cic:/Coq/Sets/Ensembles/Ensembles/Setminus.con"
+ cook  = "true">
+
+       <Case arity="2">
+               <mapp>
+                       <mop tag="setdiff"/>
+                       <param id="1" mode="set"/>
+                       <param id="2" mode="set"/>
+               </mapp>
+       </Case>
+
+       <Case arity="3">
+               <mapp>
+                       <m:in/>
+                       <param id="3"/> 
+                       <m:apply>
+                               <mop tag="setdiff"/>
+                               <param id="1" mode="set"/>
+                               <param id="2" mode="set"/>
+                       </m:apply>
+               </mapp>
+       </Case>
+</OpSet>
+
+<OpSet
+ name  = "ADD-ELEM"
+ uri   = "cic:/Coq/Sets/Ensembles/Ensembles/Add.con"
+ cook  = "true">
+
+       <Case arity="2">
+               <mapp>
+                       <mop tag="union"/>
+                       <param id="1" mode="set"/>
+                       <m:set>
+                               <param id="2" mode="set"/>
+                       </m:set>
+               </mapp>
+       </Case>
+
+       <Case arity="3">
+               <mapp>
+                       <m:in/>
+                       <param id="3"/>
+                       <m:apply>
+                               <mop tag="union"/>
+                               <param id="1" mode="set"/>
+                               <m:set>
+                                       <param id="2"/>
+                               </m:set>
+                       </m:apply>
+               </mapp>
+       </Case>
+</OpSet>
+
+<OpSet
+ name  = "SUBTRACT-ELEM"
+ uri   = "cic:/Coq/Sets/Ensembles/Ensembles/Subtract.con"
+ cook  = "true">
+
+       <Case arity="2">
+               <mapp>
+                       <mop tag="setdiff"/>
+                       <param id="1" mode="set"/>
+                       <m:set>
+                               <param id="2"/>
+                       </m:set>
+               </mapp>
+       </Case>
+
+       <Case arity="3">
+               <mapp>
+                       <m:in/>
+                       <param id="3"/>
+                       <m:apply>
+                               <mop tag="setdiff"/>
+                               <param id="1" mode="set"/>
+                               <m:set>
+                                       <param id="2"/>
+                               </m:set>
+                       </m:apply>
+               </mapp>
+       </Case>
+</OpSet>
+
+<Operator
+ name  = "CARD"
+ uri   = "cic:/Coq/Sets/Finite_sets/Ensembles_finis/cardinal.ind"
+ cook  = "true"
+ arity = "2">
+       <mapp>
+               <m:eq/>
+               <m:apply>
+                       <mop tag="card"/>
+                       <param id="1" mode="set"/>
+               </m:apply>
+               <param id="2"/>
+       </mapp>
+</Operator>
+
+<Operator
+ name  = "SIGMA"
+ uri   = "cic:/Coq/Init/Specif/Subsets/sig.ind"
+ arity = "2">
+       <m:set>
+               <mbvar name="x">
+                       <m:type>
+                               <param id="1"/>
+                       </m:type>
+               </mbvar>
+               <m:condition>
+                       <param id="2" bvar="x"/>
+               </m:condition>
+       </m:set>
+</Operator>
+
+</OpList>
diff --git a/helm/meta_style/subst.pl b/helm/meta_style/subst.pl
new file mode 100755 (executable)
index 0000000..27ca245
--- /dev/null
@@ -0,0 +1,17 @@
+#!/usr/bin/perl
+
+
+open(FILE, $ARGV[2]) || die("Error: cannot open \"$ARGV[2]\" for reading.\n");
+@file = <FILE>;
+close(FILE);
+
+open(FILE, ">$ARGV[2]");
+
+foreach $line (@file)
+{
+       $line =~ s/$ARGV[0]/$ARGV[1]/g; 
+       
+       print FILE "$line";
+}
+
+close(FILE);
diff --git a/helm/meta_style/xslt_index.txt b/helm/meta_style/xslt_index.txt
new file mode 100644 (file)
index 0000000..889ce4c
--- /dev/null
@@ -0,0 +1,7 @@
+algebra.xsl
+arith.xsl
+basic.xsl
+reals.xsl
+set.xsl
+positive.xsl
+modeset.xsl