stylesheet is now the repository of mowgli.
+++ /dev/null
-algebra.xsl
-arith.xsl
-basic.xsl
-reals.xsl
-set.xsl
-list.xsl
+++ /dev/null
-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 list.xsl
-
-clean:
- rm -f algebra.xsl arith.xsl basic.xsl reals.xsl set.xsl list.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
-
-list.xsl: list.xml $(METASTYLESHEET)
- @echo "**** PROCESSING list.xml ****"
- @$(XSLTPROC) $(METASTYLESHEET) list.xml > $(TMP1)
- @$(FORMAT) $(TMP1) > $(TMP2)
- @mv $(TMP2) list.xsl
- @rm $(TMP1)
- @$(SUBST) oxsl: xsl: list.xsl
- @$(SUBST) xmlns:oxsl xmlns:xsl list.xsl
+++ /dev/null
-<!DOCTYPE OpList SYSTEM "operator.dtd">
-
-<OpList xmlns:m="http://www.w3.org/1998/Math/MathML"
- xmlns:helm="http://www.cs.unibo.it/helm">
-
-<!-- Unary Operations -->
-
-<Operator
- name = "0"
- uri = "cic:/Algebra/algebra/CSemiGroups/csg_unit.con"
- arity = "1">
- <mop tag="ci" helm:xref="$APP-ID">0</mop>
-</Operator>
-
-<Operator
- name = "1"
- uri = "cic:/Algebra/algebra/CRings/cr_one.con"
- arity = "1">
- <mop tag="ci" helm:xref="$APP-ID">1</mop>
-</Operator>
-
-<Operator
- name = "*****"
- uri = "cic:/Algebra/algebra/CGroups/cg_inv.con"
- hide = "1"
- arity = "1"
- m-tag = "minus"/>
-
-<Operator
- name = "*****"
- uri = "cic:/Algebra/reals/CMetricFields/cmf_abs.con"
- hide = "1"
- arity = "2"
- m-tag = "abs"/>
-
-<!-- Binary Operations and Relations -->
-
-<Operator
- name = "SETOID EQUALITY"
- uri = "cic:/Algebra/algebra/CSetoids/cs_eq.con"
- hide = "1"
- arity = "2"
- m-tag = "eq"/>
-
-<Operator
- name = "APART"
- uri = "cic:/Algebra/algebra/CSetoids/cs_ap.con"
- hide = "1"
- arity = "2"
- m-tag = "neq"/>
-
-<Operator
- name = "*****"
- uri = "cic:/Algebra/algebra/COrdFields/leEq.con"
- hide = "1"
- arity = "2"
- m-tag = "leq"/>
-
-<Operator
- name = "*****"
- uri = "cic:/Algebra/algebra/COrdFields/cof_less.con"
- hide = "1"
- arity = "2"
- m-tag = "lt"/>
-
-<Operator
- name = "*****"
- uri = "cic:/Algebra/algebra/CRings/cr_plus.con | cic:/Algebra/algebra/CSemiGroups/csg_op.con"
- hide = "1"
- arity = "2"
- m-tag = "plus"/>
-
-<Operator
- name = "*****"
- uri = "cic:/Algebra/algebra/CRings/cr_minus.con | cic:/Algebra/algebra/CGroups/cg_minus.con"
- hide = "1"
- arity = "2"
- m-tag = "minus"/>
-
-<Operator
- name = "*****"
- uri = "cic:/Algebra/algebra/CRings/cr_mult.con"
- hide = "1"
- arity = "2"
- m-tag = "times"/>
-
-<Operator
- name = "*****"
- uri = "cic:/Algebra/algebra/CFields/cf_div.con"
- hide = "1"
- arity = "2"
- m-tag = "divide"/>
-
-<Operator
- name = "*****"
- uri = "cic:/Algebra/algebra/CRings/nzpro.con"
- cook = "true"
- arity = "2">
- <param id="1"/>
-</Operator>
-
-<Operator
- name = "*****"
- uri = "cic:/Algebra/algebra/CRings/nexp.con"
- cook = "true"
- arity = "2"
- m-tag = "power"/>
-
-<Operator
- name = "*****"
- uri = "cic:/Algebra/algebra/CRings/nexp_op.con | cic:/Algebra/algebra/Expon/zexp.con"
- cook = "true"
- arity = "2">
- <mapp>
- <mop tag="power"/>
- <param id="2"/>
- <param id="1"/>
- </mapp>
-</Operator>
-
-
-<Operator
- name = "*****"
- uri = "cic:/Algebra/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/algebra/CPolynomials/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/algebra/COrdFields/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/algebra/CSums/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/algebra/CSums/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>
+++ /dev/null
-<!DOCTYPE OpList SYSTEM "operator.dtd">
-
-<!-- ************************** ARITHMETICS ****************************** -->
-
-<OpList xmlns:m="http://www.w3.org/1998/Math/MathML">
-
-<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/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/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/Zopp.con"
- arity = "1"
- m-tag = "minus"/>
-
-<Operator
- name = "*****"
- uri = "cic:/Coq/ZArith/zarith_aux/absolu.con"
- arity = "1"
- m-tag = "abs"/>
-
-</OpList>
+++ /dev/null
-<!DOCTYPE OpList SYSTEM "operator.dtd">
-
-
-<OpList xmlns:m="http://www.w3.org/1998/Math/MathML">
-
-<!-- ************************* LOGIC *********************************-->
-
-<Operator
- name = "AND"
- uri = "cic:/Coq/Init/Logic/and.ind"
- arity = "2"
- m-tag = "and"/>
-
-<Operator
- name = "OR"
- uri = "cic:/Coq/Init/Logic/or.ind"
- arity = "2"
- m-tag = "or"/>
-
-<Operator
- name = "IFF"
- uri = "cic:/Coq/Init/Logic/iff.con"
- arity = "2">
- <mapp>
- <m:csymbol>iff</m:csymbol>
- <param id="1"/>
- <param id="2"/>
- </mapp>
-</Operator>
-
-<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/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/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/ex.ind | cic:/Coq/Init/Logic_Type/exT.ind"
- arity = "2">
- <mapp>
- <mop tag="exists"/>
- <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/ex2.ind | cic:/Coq/Init/Logic_Type/exT2.ind"
- hide = "1"
- arity = "2">
- <mapp>
- <mop tag="exists"/>
- <mbvar name="x"/>
- <m:condition>
- <param id="1" bvar="x"/>
- </m:condition>
- <param id="2" bvar="x"/>
- </mapp>
-</Operator>
-
-</OpList>
+++ /dev/null
-<!DOCTYPE OpList SYSTEM "operator.dtd">
-
-<!-- ************************** LISTS ****************************** -->
-
-<OpList xmlns:m="http://www.w3.org/1998/Math/MathML">
-
-<!-- CSC: manca
-<Operator
- name = "CONS"
- uri = "cic:/Coq/Lists/PolyList/list.ind"
- arity = "2"
- m-tag = "???"/>
-
-<Operator
- name = "NIL"
- uri = "cic:/Coq/Lists/PolyList/list.ind"
- arity = "0"
- m-tag = "???"/> -->
-
-<Operator
- name = "APPEND"
- uri = "cic:/Coq/Lists/PolyList/app.con"
- cook = "true"
- arity = "2">
- <mapp>
- <m:csymbol>append</m:csymbol>
- <param id="1"/>
- <param id="2"/>
- </mapp>
-</Operator>
-
-<Operator
- name = "IN"
- uri = "cic:/Coq/Lists/PolyList/In.con | cic:/Coq/Lists/TheoryList/In_spec.ind | cic:/Coq/Lists/ListSet/set_In.con | cic:/Coq/Lists/ListSet/set_mem.con"
- cook = "true"
- arity = "2"
- m-tag = "in"/>
-
-<Operator
- name = "INCL"
- uri = "cic:/Coq/Lists/PolyList/incl.con"
- cook = "true"
- arity = "2"
- m-tag = "subset"/>
-
-<Operator
- name = "INTER"
- uri = "cic:/Coq/Lists/ListSet/set_inter.con"
- cook = "true"
- arity = "2"
- m-tag = "intersect"/>
-
-<Operator
- name = "LENGTH"
- uri = "cic:/Coq/Lists/PolyList/length.con"
- cook = "true"
- arity = "1"
- m-tag = "card"/>
-
-</OpList>
+++ /dev/null
-<?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:variable name="const">
- <xsl:value-of select="@arity = 0 and @hide = 0 and @cook = 'false'"/>
- </xsl:variable>
-
- <xsl:choose>
- <xsl:when test="$const = 'true' and $not = 'true'">
- <xsl:call-template name="out_comment">
- <xsl:with-param name="name" select="concat($uri,': "not" cannot be applyed to a constant operator')"/>
- </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="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:with-param name="const" select="$const"/>
- </xsl:call-template>
- <xsl:if test="@cook = 'true'">
- <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>
-
- <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="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:with-param name="const" select="$const"/>
- </xsl:call-template>
- <xsl:if test="@cook = 'true'">
- <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: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:variable name="const">
- <xsl:value-of select="*[name() = 'Case']/@arity = 0 and @hide = 0 and @cook = 'false'"/>
- </xsl:variable>
-
- <xsl:choose>
- <xsl:when test="$const = 'true' and $not = 'true'">
- <xsl:call-template name="out_comment">
- <xsl:with-param name="name" select="concat($uri,': "not" cannot be applyed to a constant operator')"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="$const = 'true'">
- <xsl:call-template name="out_comment">
- <xsl:with-param name="name" select="concat($uri,': cannot be specified a constant operator when using OpSet element')"/>
- </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="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 test="@cook = 'true'">
- <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>
-
- <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="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 test="@cook = 'true'">
- <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: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:param name="const" select="'false'"/>
-
- <xsl:variable name="match">
- <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="cook" select="$cook"/>
- <xsl:with-param name="c-tag" select="$c-tag"/>
- </xsl:call-template>
- </xsl:variable>
-
- <xsl:variable name="match_child">
- <xsl:if test="$const = '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:value-of select="concat(' and count(*) = 2 and count(*[2]/*) = ',$arity + $hide + 1)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat(' and count(*) = ',$arity + $hide + 1)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </xsl:variable>
-
- <xsl:choose>
- <xsl:when test="$const = 'false'">
- <xsl:value-of select="concat('APPLY[',$match_op,$match_child,']')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$match_op"/>
- </xsl:otherwise>
- </xsl:choose>
- </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: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:with-param name="const" select="$const"/>
- </xsl:call-template>
- </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="match">
- <xsl:variable name="match_op">
- <xsl:call-template name="out_match_op">
- <xsl:with-param name="not" select="$not"/>
- <xsl:with-param name="cook" select="$cook"/>
- <xsl:with-param name="uri" select="$uri"/>
- <xsl:with-param name="c-tag" select="$c-tag"/>
- </xsl:call-template>
- </xsl:variable>
-
- <xsl:variable name="match_child">
- <xsl:if test="$not = 'true'"> and count(*) = 2</xsl:if>
- </xsl:variable>
-
- <xsl:value-of select="concat('APPLY[',$match_op,$match_child,']')"/>
- </xsl:variable>
-
- <xsl:variable name="apply_not">
- <xsl:if test="$not = 'true'">*[2]/</xsl:if>
- </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">
- <oxsl:choose>
- <xsl:for-each select="Case">
- <oxsl:when test="{concat('count(',$apply_not,'*) = ',@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="cook" select="'false'"/>
- <xsl:param name="c-tag"/>
-
- <xsl:variable name="instantiate">
- <xsl:if test="$cook = 'true'">instantiate/</xsl:if>
- </xsl:variable>
-
- <!-- 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($instantiate,$c-tag,'[',$uris,']')"/>
- <xsl:if test="$not = 'true'">]</xsl:if>
- </xsl:variable>
-
- <xsl:value-of select="concat($app_not,$app_op)"/>
-</xsl:template>
-
-<xsl:template name="out_params">
- <xsl:param name="params" select="1"/>
- <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 <= $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="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="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:param name="const" select="'false'"/>
-
- <xsl:choose>
- <!-- SIMPLE TRANSFORMATIONS -->
- <xsl:when test="count(*) = 0">
- <xsl:variable name="xref">
- <xsl:if test="$const = 'false'">{@id}</xsl:if>
- </xsl:variable>
-
- <xsl:variable name="definitionURL">
- <xsl:call-template name="op_uri_attr">
- <xsl:with-param name="not" select="$not"/>
- <xsl:with-param name="cook" select="$cook"/>
- <xsl:with-param name="c-tag" select="$c-tag"/>
- <xsl:with-param name="const" select="$const"/>
- </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="cook" select="$cook"/>
- <xsl:with-param name="c-tag" select="$c-tag"/>
- <xsl:with-param name="const" select="$const"/>
- </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="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:with-param name="const" select="$const"/>
- </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="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="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="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="hide" select="$hide"/>
- </xsl:call-template>
- </xsl:variable>
-
- <oxsl:when test="{concat('name(',$param,') = ',"'LAMBDA'")}">
- <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:param name="const" 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="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:with-param name="const" select="$const"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:if test="$const = 'false'">{@id}</xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <m:apply helm:xref="{$helm:xref}">
- <xsl:call-template name="copy_attributes">
- <xsl:with-param name="cook" select="$cook"/>
- <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="const" select="$const"/>
- <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:with-param name="const" select="$const"/>
- </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'"/>
- <xsl:param name="const" 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="cook" select="$cook"/>
- <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="const" select="$const"/>
- </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="cook" select="$cook"/>
- <xsl:with-param name="c-tag" select="$c-tag"/>
- <xsl:with-param name="const" select="$const"/>
- </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="cook" select="$cook"/>
- <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="const" select="$const"/>
- </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="cook" select="$cook"/>
- <xsl:with-param name="c-tag" select="$c-tag"/>
- <xsl:with-param name="const" select="$const"/>
- </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="cook" select="$cook"/>
- <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="const" select="$const"/>
- <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:with-param name="const" select="$const"/>
- </xsl:apply-templates>
- </xsl:element>
-</xsl:template>
-
-
-<xsl:template match="param">
- <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="hide" select="$hide"/>
- </xsl:call-template>
- </xsl:variable>
-
- <xsl:choose>
- <xsl:when test="@bvar">
- <oxsl:choose>
- <oxsl:when test="{concat('name(',$param,') = ',"'LAMBDA'")}">
- <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:param name="const" select="'false'"/>
-
- <xsl:copy>
- <xsl:call-template name="copy_attributes">
- <xsl:with-param name="cook" select="$cook"/>
- <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="const" select="$const"/>
- </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:with-param name="const" select="$const"/>
- </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:param name="const" 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="hide" select="$hide"/>
- </xsl:call-template>
- </xsl:variable>
-
- <xsl:variable name="binder">/decl/@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="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="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:with-param name="const" select="$const"/>
- </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:with-param name="const" select="$const"/>
- </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=',"'",$uris,"'")"/>
- </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="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="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="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="hide" select="$hide"/>
- </xsl:call-template>
- </xsl:variable>
-
- <xsl:value-of select="concat('name(',$param,') = ',"'LAMBDA'")"/>
- </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="hide" select="0"/>
-
- <xsl:variable name="apply_not">
- <xsl:if test="$not = 'true'">*[2]/</xsl:if>
- </xsl:variable>
-
- <xsl:value-of select="concat($apply_not,'*[',$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="cook" 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="cook" select="$cook"/>
- <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="cook" 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="cook" select="$cook"/>
- <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="cook" select="'false'"/>
- <xsl:param name="c-tag"/>
- <xsl:param name="const" select="'false'"/>
-
- <xsl:variable name="instantiate">
- <xsl:if test="$cook = 'true'">instantiate/</xsl:if>
- </xsl:variable>
-
- <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,$instantiate,$c-tag,'/',$attr_type,'}')"/>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template name="copy_attributes">
- <xsl:param name="cook" select="'false'"/>
- <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="const" 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:variable name="name">
- <xsl:choose>
- <xsl:when test="name() = 'xref'">helm:xref</xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="name()"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <xsl:attribute name="{$name}">
- <xsl:call-template name="set_attribute">
- <xsl:with-param name="attr" select="."/>
- <xsl:with-param name="cook" select="$cook"/>
- <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="const" select="$const"/>
- </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="cook" select="'false'"/>
- <xsl:param name="hide" select="0"/>
- <xsl:param name="arity" select="0"/>
- <xsl:param name="not" select="'false'"/>
- <xsl:param name="const" select="'false'"/>
-
- <xsl:choose>
- <xsl:when test="$attr = '$APP-ID'">
- <xsl:if test="$const = 'false'">{@id}</xsl:if>
- </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="cook" select="$cook"/>
- <xsl:with-param name="c-tag" select="$c-tag"/>
- <xsl:with-param name="const" select="$const"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$attr"/>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-</xsl:stylesheet>
+++ /dev/null
-<?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>
+++ /dev/null
-<?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>
+++ /dev/null
-<?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/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/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/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/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/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/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/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/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>
-
-<!-- **************************** Reals ******************************** -->
-
-<xsl:template match="APPLY[CONST[position() = 1 and @uri='cic:/Coq/Reals/Rdefinitions/Rplus.con'] and count(*) = 3]" mode="pure">
- <xsl:variable name="result">
- <xsl:apply-templates select="." mode="reals"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="string($result) = ''">
- <m:apply helm:xref="{@id}">
- <m:plus xmlns:m="http://www.w3.org/1998/Math/MathML" definitionURL="{CONST[1]/@uri}" helm:xref="{CONST[1]/@id}"/>
- <xsl:apply-templates select="*[2]" mode="noannot"/>
- <xsl:apply-templates select="*[3]" mode="noannot"/>
- </m:apply>
- </xsl:when>
- <xsl:otherwise>
- <m:cn helm:xref="{CONST[1]/@id}"><xsl:value-of select="$result"/></m:cn>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match="APPLY[*[position() = 1 and name()='CONST' and @uri='cic:/Coq/Reals/Rdefinitions/Rplus.con'] and *[position() = 2 and name()='CONST' and @uri='cic:/Coq/Reals/Rdefinitions/R1.con'] and count(*) = 3]" mode="reals">
- <xsl:param name="real_counter" select="0"/>
- <xsl:variable name="result">
- <xsl:apply-templates select="*[3]" mode="reals">
- <xsl:with-param name="real_counter" select="$real_counter + 1"/>
- </xsl:apply-templates>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="string($result) = ''"/>
- <xsl:otherwise>
- <xsl:value-of select="$result"/>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match="CONST[@uri='cic:/Coq/Reals/Rdefinitions/R1.con']" mode="reals">
- <xsl:param name="real_counter" select="0"/>
- <xsl:value-of select="$real_counter + 1"/>
-</xsl:template>
-
-<xsl:template match="*" mode="reals"/>
-
-</xsl:stylesheet>
+++ /dev/null
-<!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>
+++ /dev/null
-<!DOCTYPE OpList SYSTEM "operator.dtd">
-
-<OpList xmlns:m="http://www.w3.org/1998/Math/MathML"
- xmlns:helm="http://www.cs.unibo.it/helm">
-
-<import href="modeset.xsl"/>
-
-<Operator
- name = "IN"
- uri = "cic:/Coq/Sets/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/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/Empty_set.ind"
- cook = "true"
- arity = "1">
- <mapp>
- <m:in definitionURL="cic:/Coq/Sets/Ensembles/In.con"/>
- <param id="1"/>
- <mop tag="set" helm:xref="$APP-ID"/>
- </mapp>
-</Operator>
-
-<Operator
- name = "EMPTY SET"
- uri = "cic:/Coq/Sets/Ensembles/Empty_set.ind"
- cook = "true">
- <mop tag="set" helm:xref="$APP-ID"/>
-</Operator>
-
-
-<Operator
- name = "SINGLETON"
- uri = "cic:/Coq/Sets/Ensembles/Singleton.ind"
- cook = "true"
- arity = "1">
- <mop tag="set" helm:xref="$APP-ID">
- <param id="1"/>
- </mop>
-</Operator>
-
-<Operator
- name = "SINGLETON"
- uri = "cic:/Coq/Sets/Ensembles/Singleton.ind"
- cook = "true"
- arity = "2">
- <mapp>
- <m:in definitionURL="cic:/Coq/Sets/Ensembles/In.con"/>
- <param id="2"/>
- <m:set definitionURL="$OP-URI">
- <param id="1"/>
- </m:set>
- </mapp>
-</Operator>
-
-<Operator
- name = "COUPLE"
- uri = "cic:/Coq/Sets/Ensembles/Couple.ind"
- cook = "true"
- arity = "2">
- <mop tag="set" helm:xref="$APP-ID">
- <param id="1"/>
- <param id="2"/>
- </mop>
-</Operator>
-
-<Operator
- name = "COUPLE"
- uri = "cic:/Coq/Sets/Ensembles/Couple.ind"
- cook = "true"
- arity = "3">
- <mapp>
- <m:in definitionURL="cic:/Coq/Sets/Ensembles/In.con"/>
- <param id="3"/>
- <m:set definitionURL="$OP-URI">
- <param id="1"/>
- <param id="2"/>
- </m:set>
- </mapp>
-</Operator>
-
-<Operator
- name = "TRIPLE"
- uri = "cic:/Coq/Sets/Ensembles/Triple.ind"
- cook = "true"
- arity = "3">
- <mop tag="set">
- <param id="1"/>
- <param id="2"/>
- <param id="3"/>
- </mop>
-</Operator>
-
-<Operator
- name = "TRIPLE"
- uri = "cic:/Coq/Sets/Ensembles/Triple.ind"
- cook = "true"
- arity = "4">
- <mapp>
- <m:in definitionURL="cic:/Coq/Sets/Ensembles/In.con"/>
- <param id="4"/>
- <m:set definitionURL="$OP-URI">
- <param id="1"/>
- <param id="2"/>
- <param id="3"/>
- </m:set>
- </mapp>
-</Operator>
-
-<Operator
- name = "INTERSECTION"
- uri = "cic:/Coq/Sets/Ensembles/Intersection.ind"
- cook = "true"
- arity = "2">
- <mapp>
- <mop tag="intersect"/>
- <param id="1" mode="set"/>
- <param id="2" mode="set"/>
- </mapp>
-</Operator>
-
-<Operator
- name = "INTERSECTION"
- uri = "cic:/Coq/Sets/Ensembles/Intersection.ind"
- cook = "true"
- 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>
-</Operator>
-
-<Operator
- name = "UNION"
- uri = "cic:/Coq/Sets/Ensembles/Union.ind"
- cook = "true"
- arity = "2">
- <mapp>
- <mop tag="union"/>
- <param id="1" mode="set"/>
- <param id="2" mode="set"/>
- </mapp>
-</Operator>
-
-<Operator
- name = "UNION"
- uri = "cic:/Coq/Sets/Ensembles/Union.ind"
- cook = "true"
- 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>
-</Operator>
-
-<Operator
- name = "INCLUDED"
- uri = "cic:/Coq/Sets/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/Strict_Included.con"
- cook = "true"
- arity = "2">
- <mapp>
- <mop tag="prsubset"/>
- <param id="1" mode="set"/>
- <param id="2" mode="set"/>
- </mapp>
-</Operator>
-
-<Operator
- name = "SET-DIFF"
- uri = "cic:/Coq/Sets/Ensembles/Setminus.con"
- cook = "true"
- arity = "2">
- <mapp>
- <mop tag="setdiff"/>
- <param id="1" mode="set"/>
- <param id="2" mode="set"/>
- </mapp>
-</Operator>
-
-<Operator
- name = "SET-DIFF"
- uri = "cic:/Coq/Sets/Ensembles/Setminus.con"
- cook = "true"
- 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>
-</Operator>
-
-<Operator
- name = "ADD-ELEM"
- uri = "cic:/Coq/Sets/Ensembles/Add.con"
- cook = "true"
- arity = "2">
- <mapp>
- <mop tag="union"/>
- <param id="1" mode="set"/>
- <m:set>
- <param id="2" mode="set"/>
- </m:set>
- </mapp>
-</Operator>
-
-<Operator
- name = "ADD-ELEM"
- uri = "cic:/Coq/Sets/Ensembles/Add.con"
- cook = "true"
- 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>
-</Operator>
-
-<Operator
- name = "SUBTRACT-ELEM"
- uri = "cic:/Coq/Sets/Ensembles/Subtract.con"
- cook = "true"
- arity = "2">
- <mapp>
- <mop tag="setdiff"/>
- <param id="1" mode="set"/>
- <m:set>
- <param id="2"/>
- </m:set>
- </mapp>
-</Operator>
-
-<Operator
- name = "SUBTRACT-ELEM"
- uri = "cic:/Coq/Sets/Ensembles/Subtract.con"
- cook = "true"
- 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>
-</Operator>
-
-<Operator
- name = "CARD"
- uri = "cic:/Coq/Sets/Finite_sets/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/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>
+++ /dev/null
-#!/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);
+++ /dev/null
-algebra.xsl
-arith.xsl
-basic.xsl
-reals.xsl
-set.xsl
-list.xsl
-positive.xsl
-modeset.xsl
+++ /dev/null
-<?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/. -->
-
-<!--***********************************************************************-->
-<!-- XSLT version 0.1 of annotated MathML content to MathML presentation: -->
-<!-- First draft: March 29 2000, Claudio Sacerdoti Coen, Irene 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">
-
-<xsl:import href="objcontent.xsl"/>
-
-<xsl:key name="id" use="@id" match="LAMBDA|LETIN|PROD|CAST|REL|SORT|APPLY|VAR|META|CONST|MUTIND|MUTCONSTRUCT|MUTCASE|FIX|COFIX|instantiate|ConstantType|ConstantBody|CurrentProof|InductiveDefinition|Variable"/>
-
-<xsl:template match="ConstantType|ConstantBody|CurrentProof|InductiveDefinition|Variable">
- <xsl:variable name="id" select="@id"/>
- <xsl:choose>
- <xsl:when test="$annotations='yes' and $CICAnnotations/Annotations/Annotation[@of=$id]">
- <annotation helm:xref="{@id}">
- <xsl:apply-templates select="$CICAnnotations/Annotations/Annotation[@of=$id]"/>
- </annotation>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="." mode="noannot"/>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match="LAMBDA|LETIN|PROD|CAST|REL|SORT|APPLY|VAR|META|CONST|MUTIND|MUTCONSTRUCT|MUTCASE|FIX|COFIX|instantiate">
- <xsl:variable name="id" select="@id"/>
- <xsl:choose>
- <xsl:when test="$annotations='yes' and $CICAnnotations/Annotations/Annotation[@of=$id]">
- <annotation helm:xref="{@id}">
- <xsl:apply-templates select="$CICAnnotations/Annotations/Annotation[@of=$id]"/>
- </annotation>
- </xsl:when>
- <xsl:otherwise>
- <m:math>
- <xsl:apply-templates select="." mode="noannot"/>
- </m:math>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<!-- The next two templates must be invoked with the context node -->
-<!-- belonging to the original document DOM tree -->
-
-<xsl:template mode="changecontextdocumentnode" match="*">
- <xsl:param name="id" select="''"/>
- <xsl:apply-templates select="key('id',$id)"/>
-</xsl:template>
-
-<xsl:template mode="changecontextdocumentattribute" match="*">
- <xsl:param name="id" select="''"/>
- <xsl:param name="name" select="''"/>
- <xsl:param name="child" select="''"/>
- <xsl:param name="grandchild" select="''"/>
- <xsl:choose>
- <xsl:when test="$child">
- <xsl:choose>
- <xsl:when test="$grandchild">
- <xsl:value-of select="key('id',$id)/*[position() = $child]/*[position() = $grandchild]/attribute::*[name() = $name]"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="key('id',$id)/*[position() = $child]/attribute::*[name() = $name]"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="key('id',$id)/attribute::*[name() = $name]"/>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<!-- $cicroot holds the root of the original document DOM tree -->
-<!-- The next two templates are trampolines to the previous two -->
-<!-- that are used to change the context node to a node in the -->
-<!-- document DOM tree of $cicroot -->
-
-<xsl:variable name="cicroot" select="/"/>
-
-<xsl:template match="node">
- <xsl:apply-templates select="$cicroot/*[1]" mode="changecontextdocumentnode">
- <xsl:with-param name="id" select="@id"/>
- </xsl:apply-templates>
-</xsl:template>
-
-<xsl:template match="attribute">
- <xsl:apply-templates select="$cicroot/*[1]" mode="changecontextdocumentattribute">
- <xsl:with-param name="id" select="@id"/>
- <xsl:with-param name="name" select="@name"/>
- <xsl:with-param name="child" select="@child"/>
- <xsl:with-param name="grandchild" select="@grandchild"/>
- </xsl:apply-templates>
-</xsl:template>
-
-</xsl:stylesheet>
+++ /dev/null
-<?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/. -->
-
-<!--***********************************************************************-->
-<!-- XSLT version 0.1 of annotated MathML content to MathML presentation: -->
-<!-- First draft: March 29 2000, Claudio Sacerdoti Coen, Irene 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">
-
-<xsl:import href="mmlextension.xsl"/>
-
-<!-- ANNOTATION -->
-
-<xsl:template match="annotation">
- <xsl:choose>
- <xsl:when test=". = /">
- <m:math><m:mrow helm:xref="{@helm:xref}"><xsl:apply-templates/></m:mrow></m:math>
- </xsl:when>
- <xsl:otherwise>
- <m:mrow helm:xref="{@helm:xref}"><xsl:apply-templates/></m:mrow>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match="text()">
- <xsl:variable name="text" select="normalize-space(.)"/>
- <xsl:if test="$text != ''">
- <m:mtext><xsl:value-of select="$text"/></m:mtext>
- </xsl:if>
-</xsl:template>
-
-</xsl:stylesheet>
+++ /dev/null
-<?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/. -->
-
-<!--******************************************************************-->
-<!-- XSLT version 0.1 of CIC objects to MathML content: -->
-<!-- First draft: February 14 2000, Andrea Asperti, Irene Schena -->
-<!-- Revised: March 3 2000, Irene Schena -->
-<!-- Revised: March 10 2000, Irene Schena -->
-<!-- Revised: March 15 2000, Claudio Sacerdoti Coen, Irene 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">
-
-<xsl:include href="params.xsl"/>
-<xsl:include href="ite.xsl"/>
-<!-- adesso sono preprocessate -->
-<!-- <xsl:include href="coercions.xsl"/> -->
-
-<!--<xsl:output
- method="xml"
- version="1.0"
- encoding="ISO-8859-1"
- omit-xml-declaration="no"
- standalone="no"
- doctype-public="http://www.w3.org/TR/REC-MathML"
- indent="yes"
- media-type="text/mathml" /> -->
-
-<!-- DA FARE:
-1)risolvere nella fase di pre-processing le uri relative delle var, settando
-l'attributo
-definitionURL dell'oggetto corrispondente (alcuni punteranno a nulla! -quelli
-che non hanno il file di definizione corrispondente-); [le uri assolute hanno
-la forma cic:/.../ in definitionURL e questo schema di uri verra' risolto da
-Amaya o da chi di dovere in /really_very_local/helm/PARSER/example/.../]
--->
-
-
-<!-- CIC TERMS -->
-
-
-<xsl:template match="LAMBDA" mode="pure">
- <xsl:apply-templates select="*[1]" mode="lambda"/>
-</xsl:template>
-
-<xsl:template match="decl" mode="lambda">
- <m:lambda helm:xref="{@id}">
- <m:bvar>
- <m:ci>
- <xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="@binder"/></xsl:with-param></xsl:call-template>
- </m:ci>
- <m:type>
- <xsl:apply-templates select="*[1]" mode="noannot"/>
- </m:type>
- </m:bvar>
- <xsl:apply-templates select="following-sibling::*[1]" mode="lambda"/>
- </m:lambda>
-</xsl:template>
-
-
-<xsl:template match="target" mode="lambda">
- <xsl:apply-templates select="*[1]" mode="noannot"/>
-</xsl:template>
-
-
-<xsl:template match="LETIN" mode="pure">
- <xsl:apply-templates select="*[1]" mode="letin_pure"/>
-</xsl:template>
-
-<!-- Andrea: mode letin already exists in proofs.xsl, with a
- different meaning -->
-
-<xsl:template match="def" mode="letin_pure">
- <m:apply helm:xref="{@id}">
- <m:csymbol>let_in</m:csymbol>
- <m:bvar>
- <m:ci>
- <xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="@binder"/></xsl:with-param></xsl:call-template>
- </m:ci>
- </m:bvar>
- <xsl:apply-templates select="*[1]" mode="noannot"/>
- <xsl:apply-templates select="following-sibling::*[1]" mode="letin_pure"/>
- </m:apply>
-</xsl:template>
-
-
-<xsl:template match="target" mode="letin_pure">
- <xsl:apply-templates select="*[1]" mode="noannot"/>
-</xsl:template>
-
-
-<xsl:template match="PROD" mode="pure">
- <xsl:apply-templates select="*[1]" mode="prod"/>
-</xsl:template>
-
-
-<xsl:template match="decl" mode="prod">
- <m:apply helm:xref="{@id}">
- <xsl:choose>
- <xsl:when test="string(@binder)= """>
- <m:csymbol>arrow</m:csymbol>
- <xsl:apply-templates select="*[1]" mode="noannot"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="../@type = 'Prop'">
- <m:csymbol>forall</m:csymbol>
- </xsl:when>
- <xsl:otherwise>
- <m:csymbol>prod</m:csymbol>
- </xsl:otherwise>
- </xsl:choose>
- <m:bvar>
- <m:ci>
- <xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="@binder"/></xsl:with-param></xsl:call-template>
- </m:ci>
- <m:type>
- <xsl:apply-templates select="*[1]" mode="noannot"/>
- </m:type>
- </m:bvar>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:apply-templates select="following-sibling::*[1]" mode="prod"/>
- </m:apply>
-</xsl:template>
-
-
-<xsl:template match="target" mode="prod">
- <xsl:apply-templates select="*[1]" mode="noannot"/>
-</xsl:template>
-
-
-<xsl:template match="CAST" mode="pure">
- <m:apply helm:xref="{@id}">
- <m:csymbol>cast</m:csymbol>
- <xsl:apply-templates mode="noannot" select="*/*"/>
- </m:apply>
-</xsl:template>
-
-
-<xsl:template match="REL" mode="pure">
- <m:ci helm:xref="{@id}">
- <xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="@binder"/></xsl:with-param></xsl:call-template>
- </m:ci>
-</xsl:template>
-
-
-<xsl:template match="SORT" mode="pure">
- <m:apply helm:xref="{@id}">
- <m:csymbol>
- <xsl:value-of select="@value"/>
- </m:csymbol>
- </m:apply>
-</xsl:template>
-
-
-<xsl:template match="APPLY" mode="pure">
- <m:apply helm:xref="{@id}">
- <m:csymbol>app</m:csymbol>
- <xsl:apply-templates mode="noannot" select="*"/>
- </m:apply>
-</xsl:template>
-
-
-<!-- Gestione senza pre-processing -->
-<!--
-<xsl:template match="APPLY" mode="pure">
- <xsl:apply-templates mode="coercion" select="."/>
-</xsl:template>
-
-<xsl:template match="APPLY" mode="no_coercion">
- <m:apply helm:xref="{@id}">
- <m:csymbol>app</m:csymbol>
- <xsl:apply-templates mode="noannot" select="*"/>
- </m:apply>
-</xsl:template>
--->
-
-<xsl:template match="VAR" mode="pure">
- <m:ci helm:xref="{@id}">
- <xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:call-template name="name_of_uri_bis">
- <xsl:with-param name="uri" select="@uri"/></xsl:call-template></xsl:with-param></xsl:call-template>
- </m:ci>
-</xsl:template>
-
-
-<xsl:template match="META" mode="pure">
- <m:apply helm:xref="{@id}">
- <m:csymbol>meta</m:csymbol>
- <m:ci>
- <xsl:call-template name="insert_subscript">
- <xsl:with-param name="node_value">
- <xsl:text>?</xsl:text>
- <xsl:value-of select="@no"/>
- </xsl:with-param>
- </xsl:call-template>
- </m:ci>
- <xsl:for-each select="substitution">
- <xsl:choose>
- <xsl:when test="*[1]">
- <xsl:apply-templates select="*[1]" mode="noannot"/>
- </xsl:when>
- <xsl:otherwise>
- <m:ci>_</m:ci>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- </m:apply>
-</xsl:template>
-
-
-<xsl:template match="CONST" mode="pure">
- <m:ci definitionURL="{@uri}" helm:xref="{@id}">
- <xsl:call-template name="insert_subscript">
- <xsl:with-param name="node_value">
- <xsl:call-template name="name_of_uri">
- <xsl:with-param name="uri" select="@uri"/>
- </xsl:call-template>
- </xsl:with-param>
- </xsl:call-template>
- </m:ci>
-</xsl:template>
-
-
-<xsl:template match="MUTIND" mode="pure">
- <m:ci definitionURL="{@uri}" helm:xref="{@id}">
- <xsl:variable name="InductiveTypeUrl"><xsl:call-template name="URLofURI4getter"><xsl:with-param name="uri" select="@uri"/></xsl:call-template></xsl:variable>
- <xsl:variable name="index"><xsl:value-of select="@noType"/></xsl:variable>
- <xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="document($InductiveTypeUrl)/InductiveDefinition/InductiveType[position()=number($index)+1]/@name"/></xsl:with-param></xsl:call-template>
- </m:ci>
-</xsl:template>
-
-
-<xsl:template match="MUTCONSTRUCT" mode="pure">
- <m:ci definitionURL="{@uri}" helm:xref="{@id}">
- <xsl:variable name="InductiveTypeUrl"><xsl:call-template name="URLofURI4getter"><xsl:with-param name="uri" select="@uri"/></xsl:call-template></xsl:variable>
- <xsl:variable name="Tindex"><xsl:value-of select="@noType"/></xsl:variable>
- <xsl:variable name="Cindex"><xsl:value-of select="@noConstr"/></xsl:variable>
- <xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="document($InductiveTypeUrl)/InductiveDefinition/InductiveType[position()=number($Tindex)+1]/Constructor[position()=number($Cindex)]/@name"/></xsl:with-param></xsl:call-template>
- </m:ci>
-</xsl:template>
-
-
-<xsl:template match="MUTCASE" mode="pure">
- <xsl:variable name="Tindex"><xsl:value-of select="@noType"/></xsl:variable>
- <xsl:variable name="Turi"><xsl:value-of select="@uriType"/></xsl:variable>
- <xsl:variable name="InductiveTypeUrl"><xsl:call-template name="URLofURI4getter"><xsl:with-param name="uri" select="$Turi"/></xsl:call-template></xsl:variable>
- <xsl:variable name="InductiveTypeDoc" select="document($InductiveTypeUrl)"/>
- <m:apply helm:xref="{@id}">
- <m:csymbol>mutcase</m:csymbol>
- <xsl:apply-templates select="patternsType/*[1]" mode="noannot"/>
- <xsl:apply-templates select="inductiveTerm/*[1]" mode="noannot"/>
- <xsl:variable name="nop"><xsl:value-of select="$InductiveTypeDoc/InductiveDefinition/@noParams"/></xsl:variable>
- <m:piecewise>
- <xsl:for-each select="pattern">
- <xsl:variable name="pos" select="position()"/>
- <xsl:variable name="nopar"><xsl:apply-templates select="$InductiveTypeDoc/InductiveDefinition/InductiveType[position()=number($Tindex)+1]/Constructor[position()=number($pos)]/*[1]" mode="counting"><xsl:with-param name="noparams" select="$nop"/></xsl:apply-templates></xsl:variable>
- <m:piece>
- <xsl:apply-templates select="./*[1]" mode="abstparams"><xsl:with-param name="noparams" select="$nopar"/><xsl:with-param name="target" select="1"/><xsl:with-param name="binder">LAMBDA</xsl:with-param></xsl:apply-templates>
- <xsl:choose>
- <xsl:when test="$nopar = 0">
- <m:ci>
- <xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="$InductiveTypeDoc/InductiveDefinition/InductiveType[position()=number($Tindex)+1]/Constructor[position()=number($pos)]/@name"/></xsl:with-param></xsl:call-template>
- </m:ci>
- </xsl:when>
- <xsl:otherwise>
- <m:apply>
- <m:csymbol>app</m:csymbol>
- <m:ci>
- <xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="$InductiveTypeDoc/InductiveDefinition/InductiveType[position()=number($Tindex)+1]/Constructor[position()=number($pos)]/@name"/></xsl:with-param></xsl:call-template>
- </m:ci>
- <xsl:apply-templates select="./*[1]" mode="abstparams"><xsl:with-param name="noparams" select="$nopar"/><xsl:with-param name="binder">LAMBDA</xsl:with-param></xsl:apply-templates>
- </m:apply>
- </xsl:otherwise>
- </xsl:choose>
- </m:piece>
- </xsl:for-each>
- </m:piecewise>
- </m:apply>
-</xsl:template>
-
-
-<xsl:template match="FIX" mode="pure">
- <m:apply helm:xref="{@id}">
- <xsl:variable name="findex"><xsl:value-of select="@noFun"/></xsl:variable>
- <m:csymbol>fix</m:csymbol>
- <m:ci><xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="FixFunction[position()=number($findex)+1]/@name"/></xsl:with-param></xsl:call-template></m:ci>
- <xsl:apply-templates mode="pure" select="*"/>
- </m:apply>
-</xsl:template>
-
-
-<xsl:template match="COFIX" mode="pure">
- <m:apply helm:xref="{@id}">
- <xsl:variable name="findex"><xsl:value-of select="@noFun"/></xsl:variable>
- <m:csymbol>cofix</m:csymbol>
- <m:ci><xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="CofixFunction[position()=number($findex)+1]/@name"/></xsl:with-param></xsl:call-template></m:ci>
- <xsl:apply-templates mode="pure" select="*"/>
- </m:apply>
-</xsl:template>
-
-<xsl:template match="instantiate" mode="pure">
- <m:apply>
- <xsl:if test="@id">
- <xsl:attribute name="helm:xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:csymbol>inst</m:csymbol>
- <xsl:apply-templates mode="noannot" select="*[1]" />
- <xsl:for-each select="arg">
- <xsl:variable name="base_path">
- <xsl:call-template name="path">
- <xsl:with-param name="uri" select="../*[1]/@uri"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="varUri" select="concat($base_path,@relUri)"/>
- <m:ci definitionURL="{$varUri}">
- <xsl:call-template name="insert_subscript">
- <xsl:with-param name="node_value">
- <xsl:call-template name="name_of_uri">
- <xsl:with-param name="uri" select="$varUri"/>
- <xsl:with-param name="extension" select="'.var'"/>
- </xsl:call-template>
- </xsl:with-param>
- </xsl:call-template>
- </m:ci>
- <xsl:apply-templates mode ="noannot" select="*[1]" />
- </xsl:for-each>
- </m:apply>
-</xsl:template>
-
-<!-- ELEMENTS OF CIC TERMS -->
-
-<xsl:template match="FixFunction" mode="pure">
- <m:bvar>
- <m:ci><xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="@name"/></xsl:with-param></xsl:call-template></m:ci>
- <m:type><xsl:apply-templates select="type/*[1]" mode="noannot"/></m:type>
- </m:bvar>
- <xsl:apply-templates select="body/*[1]" mode="noannot"/>
-</xsl:template>
-
-
-<xsl:template match="CofixFunction" mode="pure">
- <m:bvar>
- <m:ci><xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="@name"/></xsl:with-param></xsl:call-template></m:ci>
- <m:type><xsl:apply-templates select="type/*[1]" mode="noannot"/></m:type>
- </m:bvar>
- <xsl:apply-templates select="body/*[1]" mode="noannot"/>
-</xsl:template>
-
-</xsl:stylesheet>
+++ /dev/null
-<?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/. -->
-
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:m="http://www.w3.org/1998/Math/MathML">
-
-<!--***********************************************************************-->
-<!-- From MathML content to HTML -->
-<!-- HELM Group: Asperti, Padovani, Sacerdoti, Schena, Guidi -->
-<!--***********************************************************************-->
-
-<xsl:param name="CICURI" select="''"/>
-<xsl:param name="type" select="'standalone'"/>
-<xsl:param name="UNICODEvsSYMBOL" select="'symbol'"/>
-
-<xsl:include href="html_init.xsl"/>
-<xsl:include href="html_set.xsl"/>
-<xsl:include href="html_reals.xsl"/>
-<xsl:include href="html_ccorns.xsl"/>
-
-<xsl:variable name="showcast" select="0"/>
-
-<!--***********************************************************************-->
-<!-- HTML Head and Body -->
-<!--***********************************************************************-->
-
-<!-- <xsl:output method="html" encoding="iso-8859-1"/> -->
-
-<!-- document needs method="xml" and searches locally for the dtd if -->
-<!-- doctype-system is specified (the dtd must exist locally for parsing). -->
-<!-- For having output html must be media-type="html" and for having the -->
-<!-- correct <br /> you must specify at least the remote dtd by means of -->
-<!-- doctype-public -->
-<xsl:output
- method="xml"
- encoding="iso-8859-1"
- media-type="text/html"
- doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" />
-
-<xsl:variable name="framewidth" select="55"/>
-
-<xsl:template name="mksymbol-1">
- <xsl:param name="symbol" select="''"/>
- <xsl:param name="color" select="''"/>
- <xsl:param name="size" select="''"/>
- <xsl:choose>
- <xsl:when test="$UNICODEvsSYMBOL = 'symbol'">
- <xsl:variable name="fontsymbol">
- <xsl:choose>
- <xsl:when test="$symbol = 'append'">
- <xsl:value-of select="'@'"/>
- </xsl:when>
- <xsl:when test="$symbol = 'iff'">
- <xsl:value-of select="'«'"/>
- </xsl:when>
- <xsl:when test="$symbol = 'forall'">
- <xsl:value-of select="'"'"/>
- </xsl:when>
- <xsl:when test="$symbol = 'lambda'">
- <xsl:value-of select="'l'"/>
- </xsl:when>
- <xsl:when test="$symbol = 'prod'">
- <xsl:value-of select="'Õ'"/>
- </xsl:when>
- <xsl:when test="$symbol = 'arrow'">
- <xsl:value-of select="'®'"/>
- </xsl:when>
- <xsl:when test="$symbol = 'RightArrow'">
- <xsl:value-of select="'Þ'"/>
- </xsl:when>
- <xsl:when test="$symbol = 'subst'">
- <xsl:value-of select="'¬'"/>
- </xsl:when>
- <xsl:when test="$symbol = 'lift' or $symbol = 'lift_with_base'">
- <xsl:value-of select="'­'"/>
- </xsl:when>
- <xsl:when test="$symbol = 'beta_red' or $symbol = 'beta_red1'">
- <xsl:value-of select="'®'"/>
- </xsl:when>
- <xsl:when test="$symbol = 'beta'">
- <xsl:value-of select="'b'"/>
- </xsl:when>
- <xsl:when test="$symbol = 'par_beta_red' or $symbol = 'par_beta_red1'">
- <xsl:value-of select="'Þ'"/>
- </xsl:when>
- <xsl:when test="$symbol = 'isomorphic'">
- <xsl:value-of select="'@'"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>???</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <FONT FACE="symbol" SIZE="{$size}" color="{$color}">
- <xsl:value-of select="$fontsymbol"/>
- </FONT>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="unicodesymbol">
- <xsl:choose>
- <xsl:when test="$symbol = 'append'">
- <xsl:value-of select="'@'"/>
- </xsl:when>
- <xsl:when test="$symbol = 'iff'">
- <xsl:value-of select="'↔'"/>
- </xsl:when>
- <xsl:when test="$symbol = 'forall'">
- <xsl:value-of select="'∀'"/>
- </xsl:when>
- <xsl:when test="$symbol = 'lambda'">
- <xsl:value-of select="'λ'"/>
- </xsl:when>
- <xsl:when test="$symbol = 'prod'">
- <xsl:value-of select="'Π'"/>
- </xsl:when>
- <xsl:when test="$symbol = 'arrow'">
- <xsl:value-of select="'→'"/>
- </xsl:when>
- <xsl:when test="$symbol = 'RightArrow'">
- <xsl:value-of select="'⇒'"/>
- </xsl:when>
- <xsl:when test="$symbol = 'subst'">
- <xsl:value-of select="'←'"/>
- </xsl:when>
- <xsl:when test="$symbol = 'lift' or $symbol = 'lift_with_base'">
- <xsl:value-of select="'↑'"/>
- </xsl:when>
- <xsl:when test="$symbol = 'beta_red' or $symbol = 'beta_red1'">
- <xsl:value-of select="'→'"/>
- </xsl:when>
- <xsl:when test="$symbol = 'beta'">
- <xsl:value-of select="'β'"/>
- </xsl:when>
- <xsl:when test="$symbol = 'par_beta_red' or $symbol = 'par_beta_red1'">
- <xsl:value-of select="'⇒'"/>
- </xsl:when>
- <xsl:when test="$symbol = 'isomorphic'">
- <xsl:value-of select="'≅'"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>???</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <FONT color="{$color}">
- <xsl:value-of select="$unicodesymbol"/>
- </FONT>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match="/">
- <xsl:param name="current_indent" select="0"/>
- <xsl:choose>
- <xsl:when test="$type = 'standalone'">
- <html>
- <head>
- <title> <xsl:value-of select="$CICURI"/> </title> <!-- FG -->
- <style> A { text-decoration: none } </style>
- <script>
- <xsl:text disable-output-escaping="yes">
- <![CDATA[
- function Hide(which){
- if (!document.getElementById)
- return
- which.style.display="none"
- }
-
- function Show(which){
- if (!document.getElementById)
- return
- which.style.display=""
- }
-
- document.to_be_deleted = new Array();
- ]]>
- </xsl:text>
- </script>
- </head>
- <body bgcolor="white">
- <xsl:attribute name="onLoad">
- if(document.getElementById)
- for(var i=0;i<document.to_be_deleted.length;i++)
- Hide(document.getElementById(document.to_be_deleted[i]));
- </xsl:attribute>
- <xsl:apply-templates>
- <xsl:with-param name="current_indent" select="0"/>
- </xsl:apply-templates>
- </body>
- </html>
- </xsl:when>
- <xsl:otherwise>
- <to_be_embedded>
- <xsl:apply-templates>
- <xsl:with-param name="current_indent" select="0"/>
- </xsl:apply-templates>
- </to_be_embedded>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<!--***********************************************************************-->
-<!-- Indentation -->
-<!--***********************************************************************-->
-
-<xsl:template name="make_indent">
- <xsl:param name="current_indent" select="0"/>
- <!-- non funziona bene con netscape !!!
- <span>
- <xsl:attribute name="style">
- <xsl:value-of select="concat('margin-left:',string($current_indent div 3), 'em')"/>
- </xsl:attribute>
- </span> -->
- <xsl:if test="$current_indent > 0">
- <xsl:text> </xsl:text>
- <xsl:call-template name="make_indent">
- <xsl:with-param name="current_indent" select="$current_indent - 1"/>
- </xsl:call-template>
- </xsl:if>
-</xsl:template>
-
-<!-- Syntactic Sugar -->
-<xsl:template match="m:type">
-<xsl:param name="current_indent" select="0"/>
-<xsl:apply-templates>
- <xsl:with-param name="current_indent"
- select="$current_indent"/>
-</xsl:apply-templates>
-</xsl:template>
-
-<xsl:template match="m:condition">
-<xsl:param name="current_indent" select="0"/>
-<xsl:apply-templates>
- <xsl:with-param name="current_indent"
- select="$current_indent"/>
-</xsl:apply-templates>
-</xsl:template>
-
-<xsl:template match="m:math">
-<xsl:param name="current_indent" select="0"/>
-<xsl:apply-templates>
- <xsl:with-param name="current_indent"
- select="$current_indent"/>
-</xsl:apply-templates>
-</xsl:template>
-
-<!--*********************************************************************-->
-<!-- INLINE MODE -->
-<!--*********************************************************************-->
-
-<!-- href -->
-<xsl:template mode="inline" match="m:ci">
- <xsl:choose>
- <xsl:when test="boolean(@definitionURL)">
- <a href="{@definitionURL}">
- <xsl:apply-templates/>
- </a>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="."/>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<!-- CSYMBOL -->
-
-<xsl:template match="m:apply[m:csymbol]" mode="inline">
- <xsl:variable name="name">
- <xsl:value-of select="m:csymbol"/>
- </xsl:variable>
- <xsl:variable name="uri"><xsl:value-of select="*[1]/@definitionURL"/></xsl:variable>
- <xsl:choose>
- <!-- FORALL -->
- <xsl:when test="$name='forall'">
- <xsl:call-template name="mksymbol-1">
- <xsl:with-param name="symbol" select="$name"/>
- <xsl:with-param name="color" select="'blue'"/>
- <xsl:with-param name="size" select="'+2'"/>
- </xsl:call-template>
- <xsl:apply-templates select="m:bvar/m:ci"/>
- <xsl:text>:</xsl:text>
- <xsl:apply-templates mode="inline" select="m:bvar/m:type"/>
- <xsl:text>.</xsl:text>
- <xsl:apply-templates mode="inline" select="*[position()=3]"/>
- </xsl:when>
- <xsl:when test="$name='prod'">
- <xsl:call-template name="mksymbol-1">
- <xsl:with-param name="symbol" select="$name"/>
- <xsl:with-param name="color" select="'blue'"/>
- <xsl:with-param name="size" select="'+2'"/>
- </xsl:call-template>
- <xsl:apply-templates mode="inline" select="m:bvar/m:ci"/>
- <xsl:text>:</xsl:text>
- <xsl:apply-templates mode="inline" select="m:bvar/m:type"/>
- <xsl:text>.</xsl:text>
- <xsl:apply-templates mode="inline" select="*[position()=3]"/>
- </xsl:when>
- <!-- ARROW -->
- <xsl:when test="$name='arrow'">
- <xsl:text>(</xsl:text>
- <xsl:apply-templates mode="inline" select="*[position()=2]"/>
- <xsl:call-template name="mksymbol-1">
- <xsl:with-param name="symbol" select="$name"/>
- <xsl:with-param name="color" select="'blue'"/>
- <xsl:with-param name="size" select="'+0'"/>
- </xsl:call-template>
- <xsl:apply-templates mode="inline" select="*[position()=3]"/>
- <xsl:text>)</xsl:text>
- </xsl:when>
- <!-- IFF -->
- <xsl:when test="$name='iff'">
- <xsl:text>(</xsl:text>
- <xsl:apply-templates mode="inline" select="*[position()=2]"/>
- <xsl:call-template name="mksymbol-1">
- <xsl:with-param name="symbol" select="$name"/>
- <xsl:with-param name="color" select="'blue'"/>
- <xsl:with-param name="size" select="'+0'"/>
- </xsl:call-template>
- <xsl:apply-templates mode="inline" select="*[position()=3]"/>
- <xsl:text>)</xsl:text>
- </xsl:when>
- <!-- APPEND -->
- <xsl:when test="$name='append'">
- <xsl:text>(</xsl:text>
- <xsl:apply-templates mode="inline" select="*[position()=2]"/>
- <xsl:call-template name="mksymbol-1">
- <xsl:with-param name="symbol" select="$name"/>
- <xsl:with-param name="color" select="'blue'"/>
- <xsl:with-param name="size" select="'+0'"/>
- </xsl:call-template>
- <xsl:apply-templates mode="inline" select="*[position()=3]"/>
- <xsl:text>)</xsl:text>
- </xsl:when>
- <!-- APP -->
- <xsl:when test="$name='app'">
- <xsl:text>(</xsl:text>
- <xsl:apply-templates mode="inline" select="*[position()=2]"/>
- <xsl:for-each select="*[position()>2]">
- <xsl:text> </xsl:text>
- <xsl:apply-templates mode="inline" select="."/>
- </xsl:for-each>
- <xsl:text>)</xsl:text>
- </xsl:when>
- <!-- CAST -->
- <xsl:when test="$name='cast'">
- <xsl:text>(</xsl:text>
- <xsl:apply-templates mode="inline" select="*[position()=2]"/>
- <xsl:text>:</xsl:text>
- <xsl:apply-templates mode="inline" select="*[position()=3]"/>
- <xsl:text>)</xsl:text>
- </xsl:when>
- <xsl:when test="$name='Prop'">
- <FONT color="violet">Prop</FONT>
- </xsl:when>
- <xsl:when test="$name='Set'">
- <FONT color="violet">Set</FONT>
- </xsl:when>
- <xsl:when test="$name='Type'">
- <FONT color="violet">Type</FONT>
- </xsl:when>
- <!-- MUTCASE -->
- <xsl:when test="$name='mutcase'">
- <xsl:text><</xsl:text>
- <xsl:apply-templates mode="inline" select="*[position()=2]"/>
- <xsl:text>> </xsl:text>
- <FONT color="red">CASE </FONT>
- <xsl:apply-templates mode="inline" select="*[position()=3]"/>
- <FONT color="red"> OF </FONT>
- <xsl:for-each select="m:piecewise/m:piece">
-<!--<xsl:for-each select="*[position() mod 2 = 0 and position()>3]">-->
- <xsl:choose>
- <xsl:when test="not(position() = 1)">
- <xsl:text> | </xsl:text>
- </xsl:when>
- </xsl:choose>
- <xsl:apply-templates mode="inline" select="./*[2]"/>
- <xsl:call-template name="mksymbol-1">
- <xsl:with-param name="symbol" select="'RightArrow'"/>
- <xsl:with-param name="color" select="'green'"/>
- <xsl:with-param name="size" select="'+0'"/>
- </xsl:call-template>
- <xsl:apply-templates mode="inline"
- select="./*[1]"/>
- </xsl:for-each>
- </xsl:when>
-
- <xsl:when test="$name='inst'">
- <xsl:apply-templates select="*[2]" mode="inline"/>
- <FONT color="blue">{</FONT>
- <xsl:for-each select="*[(position()>2) and (position() mod 2 = 1)]">
- <xsl:apply-templates select="following-sibling::*[position() = 1]" mode="inline"/>
- <FONT color="blue">/</FONT>
- <xsl:if test="name()='m:ci'">
- <a href="{@definitionURL}">
- <xsl:apply-templates/>
- </a>
- </xsl:if>
- <!-- <xsl:apply-templates select="." mode="inline"/> -->
- </xsl:for-each>
- <FONT color="blue">}</FONT>
- </xsl:when>
-
- <!-- FIX -->
- <xsl:when test="$name='fix'">
- <FONT color="red">FIX</FONT>
- <xsl:value-of select="m:ci"/>
- <xsl:text>{</xsl:text>
- <xsl:for-each select="m:bvar">
- <xsl:value-of select="m:ci"/>
- <xsl:text>:</xsl:text>
- <xsl:apply-templates mode="inline" select="m:type"/>
- <xsl:text>:=</xsl:text>
- <xsl:apply-templates mode="inline"
- select="following-sibling::*[position() = 1]"/>
- <xsl:choose>
- <xsl:when test="position()=last()">
- <xsl:text>}</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>;</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- </xsl:when>
- <!-- COFIX -->
- <xsl:when test="$name='cofix'">
- <xsl:text>COFIX</xsl:text>
- <xsl:value-of select="m:ci"/>
- <xsl:text>{</xsl:text>
- <xsl:for-each select="m:bvar">
- <xsl:value-of select="m:ci"/>
- <xsl:text>:</xsl:text>
- <xsl:apply-templates mode="inline" select="m:type"/>
- <xsl:text>:=</xsl:text>
- <xsl:apply-templates mode="inline"
- select="following-sibling::*[position() = 1]"/>
- <xsl:choose>
- <xsl:when test="position()=last()">
- <xsl:text>}</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>;</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- </xsl:when>
- <!-- if then else -->
- <xsl:when test="$name='ite'">
- <xsl:text>if </xsl:text>
- <xsl:apply-templates select="*[2]"/>
- <xsl:text> then </xsl:text>
- <xsl:apply-templates select="*[3]"/>
- <xsl:text> else </xsl:text>
- <xsl:apply-templates select="*[4]"/>
- </xsl:when>
- <!-- proof and side_proof -->
- <xsl:when test="$name='proof' or $name='side_proof'">
- <xsl:apply-templates mode="inline" select="*[position()=2]"/>
- <FONT color="red"> proves </FONT>
- <xsl:apply-templates mode="inline" select="*[position()=3]"/>
- <xsl:if test="*[4]">
- <FONT color="red"> which is equivalent to </FONT>
- <xsl:apply-templates mode="inline" select="*[position()=4]"/>
- </xsl:if>
- </xsl:when>
- <!-- letin1 -->
- <xsl:when test="$name='letin1'">
- <xsl:text>letin1 (inline error)</xsl:text>
- </xsl:when>
- <!-- false_ind -->
- <xsl:when test="$name='false_ind'">
- <xsl:apply-templates mode="inline" select="*[3]"/>
- <FONT color="red">Contradiction.</FONT>
- </xsl:when>
- <!-- and_ind -->
- <xsl:when test="$name='and_ind'">
- <FONT color="red">From </FONT>
- <xsl:apply-templates select="*[2]"/>
- <FONT color="red"> we get</FONT>
- (
- <xsl:apply-templates select="*[3]"/>
- ) 
- <xsl:apply-templates mode="inline" select="*[4]"/>
- <FONT color="red"> and </FONT>
- (
- <xsl:apply-templates select="*[5]"/>
- ) 
- <xsl:apply-templates mode="inline" select="*[6]"/>
- ;
- <FONT color="red"> hence </FONT>
- <xsl:apply-templates mode="inline" select="*[7]"/>
- </xsl:when>
-
- <xsl:when test="$name='subst'">
- <xsl:apply-templates select="*[3]" mode="inline"/>
- <xsl:text>[</xsl:text>
- <xsl:apply-templates select="*[4]" mode="inline"/>
- <xsl:choose>
- <xsl:when test="$uri != ''">
- <a href="{$uri}">
- <xsl:call-template name="mksymbol-1">
- <xsl:with-param name="symbol" select="$name"/>
- <xsl:with-param name="color" select="'green'"/>
- <xsl:with-param name="size" select="'+0'"/>
- </xsl:call-template>
- </a>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="mksymbol-1">
- <xsl:with-param name="symbol" select="$name"/>
- <xsl:with-param name="color" select="'green'"/>
- <xsl:with-param name="size" select="'+0'"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:apply-templates select="*[2]" mode="inline"/>
- <xsl:text>]</xsl:text>
- </xsl:when>
-
- <xsl:when test="$name='lift_with_base'">
- <SUB>
- <xsl:apply-templates select="*[3]" mode="inline"/>
- </SUB>
- <xsl:choose>
- <xsl:when test="$uri != ''">
- <a href="{$uri}">
- <xsl:call-template name="mksymbol-1">
- <xsl:with-param name="symbol" select="$name"/>
- <xsl:with-param name="color" select="'green'"/>
- <xsl:with-param name="size" select="'+0'"/>
- </xsl:call-template>
- </a>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="mksymbol-1">
- <xsl:with-param name="symbol" select="$name"/>
- <xsl:with-param name="color" select="'green'"/>
- <xsl:with-param name="size" select="'+0'"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- <SUP>
- <xsl:apply-templates select="*[4]" mode="inline"/>
- </SUP>
- <xsl:text>(</xsl:text>
- <xsl:apply-templates select="*[2]" mode="inline"/>
- <xsl:text>)</xsl:text>
- </xsl:when>
-
- <xsl:when test="$name='lift'">
- <xsl:choose>
- <xsl:when test="$uri != ''">
- <a href="{$uri}">
- <xsl:call-template name="mksymbol-1">
- <xsl:with-param name="symbol" select="$name"/>
- <xsl:with-param name="color" select="'green'"/>
- <xsl:with-param name="size" select="'+0'"/>
- </xsl:call-template>
- </a>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="mksymbol-1">
- <xsl:with-param name="symbol" select="$name"/>
- <xsl:with-param name="color" select="'green'"/>
- <xsl:with-param name="size" select="'+0'"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- <SUP>
- <xsl:apply-templates select="*[2]" mode="inline"/>
- </SUP>
- <xsl:text>(</xsl:text>
- <xsl:apply-templates select="*[3]" mode="inline"/>
- <xsl:text>)</xsl:text>
- </xsl:when>
-
- <!-- reduction -->
- <xsl:when test="$name='beta_red1'">
- <xsl:apply-templates select="*[2]" mode="inline"/>
- <xsl:choose>
- <xsl:when test="$uri != ''">
- <a href="{$uri}">
- <xsl:call-template name="mksymbol-1">
- <xsl:with-param name="symbol" select="$name"/>
- <xsl:with-param name="color" select="'green'"/>
- <xsl:with-param name="size" select="'+0'"/>
- </xsl:call-template>
- <SUB>
- <xsl:call-template name="mksymbol-1">
- <xsl:with-param name="symbol" select="'beta'"/>
- <xsl:with-param name="color" select="'green'"/>
- <xsl:with-param name="size" select="'+0'"/>
- </xsl:call-template>
- </SUB>
- </a>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="mksymbol-1">
- <xsl:with-param name="symbol" select="$name"/>
- <xsl:with-param name="color" select="'green'"/>
- <xsl:with-param name="size" select="'+0'"/>
- </xsl:call-template>
- <SUB>
- <xsl:call-template name="mksymbol-1">
- <xsl:with-param name="symbol" select="'beta'"/>
- <xsl:with-param name="color" select="'green'"/>
- <xsl:with-param name="size" select="'+0'"/>
- </xsl:call-template>
- </SUB>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:apply-templates select="*[3]" mode="inline"/>
- </xsl:when>
-
- <xsl:when test="$name='beta_red'">
- <xsl:apply-templates select="*[2]" mode="inline"/>
- <xsl:choose>
- <xsl:when test="$uri != ''">
- <a href="{$uri}">
- <xsl:call-template name="mksymbol-1">
- <xsl:with-param name="symbol" select="$name"/>
- <xsl:with-param name="color" select="'green'"/>
- <xsl:with-param name="size" select="'+0'"/>
- </xsl:call-template>
- <SUB>
- <xsl:call-template name="mksymbol-1">
- <xsl:with-param name="symbol" select="'beta'"/>
- <xsl:with-param name="color" select="'green'"/>
- <xsl:with-param name="size" select="'+0'"/>
- </xsl:call-template>
- <xsl:text>*</xsl:text>
- </SUB>
- </a>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="mksymbol-1">
- <xsl:with-param name="symbol" select="$name"/>
- <xsl:with-param name="color" select="'green'"/>
- <xsl:with-param name="size" select="'+0'"/>
- </xsl:call-template>
- <SUB>
- <xsl:call-template name="mksymbol-1">
- <xsl:with-param name="symbol" select="'beta'"/>
- <xsl:with-param name="color" select="'green'"/>
- <xsl:with-param name="size" select="'+0'"/>
- </xsl:call-template>
- <xsl:text>*</xsl:text>
- </SUB>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:apply-templates select="*[3]" mode="inline"/>
- </xsl:when>
-
- <xsl:when test="$name='par_beta_red1'">
- <xsl:apply-templates select="*[2]" mode="inline"/>
- <xsl:choose>
- <xsl:when test="$uri != ''">
- <a href="{$uri}">
- <xsl:call-template name="mksymbol-1">
- <xsl:with-param name="symbol" select="$name"/>
- <xsl:with-param name="color" select="'green'"/>
- <xsl:with-param name="size" select="'+0'"/>
- </xsl:call-template>
- <SUB>
- <xsl:call-template name="mksymbol-1">
- <xsl:with-param name="symbol" select="'beta'"/>
- <xsl:with-param name="color" select="'green'"/>
- <xsl:with-param name="size" select="'+0'"/>
- </xsl:call-template>
- </SUB>
- </a>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="mksymbol-1">
- <xsl:with-param name="symbol" select="$name"/>
- <xsl:with-param name="color" select="'green'"/>
- <xsl:with-param name="size" select="'+0'"/>
- </xsl:call-template>
- <SUB>
- <xsl:call-template name="mksymbol-1">
- <xsl:with-param name="symbol" select="'beta'"/>
- <xsl:with-param name="color" select="'green'"/>
- <xsl:with-param name="size" select="'+0'"/>
- </xsl:call-template>
- </SUB>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:apply-templates select="*[3]" mode="inline"/>
- </xsl:when>
-
- <xsl:when test="$name='par_beta_red'">
- <xsl:apply-templates select="*[2]" mode="inline"/>
- <xsl:choose>
- <xsl:when test="$uri != ''">
- <a href="{$uri}">
- <xsl:call-template name="mksymbol-1">
- <xsl:with-param name="symbol" select="$name"/>
- <xsl:with-param name="color" select="'green'"/>
- <xsl:with-param name="size" select="'+0'"/>
- </xsl:call-template>
- <SUB>
- <xsl:call-template name="mksymbol-1">
- <xsl:with-param name="symbol" select="'beta'"/>
- <xsl:with-param name="color" select="'green'"/>
- <xsl:with-param name="size" select="'+0'"/>
- </xsl:call-template>
- <xsl:text>*</xsl:text>
- </SUB>
- </a>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="mksymbol-1">
- <xsl:with-param name="symbol" select="$name"/>
- <xsl:with-param name="color" select="'green'"/>
- <xsl:with-param name="size" select="'+0'"/>
- </xsl:call-template>
- <SUB>
- <xsl:call-template name="mksymbol-1">
- <xsl:with-param name="symbol" select="'beta'"/>
- <xsl:with-param name="color" select="'green'"/>
- <xsl:with-param name="size" select="'+0'"/>
- </xsl:call-template>
- <xsl:text>*</xsl:text>
- </SUB>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:apply-templates select="*[3]" mode="inline"/>
- </xsl:when>
-
- <!-- forgetful -->
- <xsl:when test="$name='forgetful'">
- <xsl:choose>
- <xsl:when test="$uri != ''">
- <a href="{$uri}">|</a>
- </xsl:when>
- <xsl:otherwise>
- |
- </xsl:otherwise>
- </xsl:choose>
- <xsl:apply-templates select="*[2]" mode="inline"/>
- <xsl:choose>
- <xsl:when test="$uri != ''">
- <a href="{$uri}">|</a>
- </xsl:when>
- <xsl:otherwise>
- |
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
-
- <!-- boolean algebra of redexes -->
-
- <!-- isomorphic -->
- <xsl:when test="$name='isomorphic'">
- <xsl:apply-templates select="*[2]" mode="inline"/>
- <xsl:choose>
- <xsl:when test="$uri != ''">
- <a href="{$uri}">
- <xsl:call-template name="mksymbol-1">
- <xsl:with-param name="symbol" select="$name"/>
- <xsl:with-param name="color" select="'green'"/>
- <xsl:with-param name="size" select="'+0'"/>
- </xsl:call-template>
- </a>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="mksymbol-1">
- <xsl:with-param name="symbol" select="$name"/>
- <xsl:with-param name="color" select="'green'"/>
- <xsl:with-param name="size" select="'+0'"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:apply-templates select="*[3]" mode="inline"/>
- </xsl:when>
-
- <!-- INTERP -->
- <xsl:when test="$name='interp'">
- <font color="green">[</font>
- <xsl:apply-templates select="*[2]"/>
- <font color="green">]</font>
- </xsl:when>
-
- </xsl:choose>
-</xsl:template>
-
-<xsl:template mode="inline" match="m:lambda">
- <xsl:call-template name="mksymbol-1">
- <xsl:with-param name="symbol" select="'lambda'"/>
- <xsl:with-param name="color" select="'red'"/>
- <xsl:with-param name="size" select="'+2'"/>
- </xsl:call-template>
- <xsl:apply-templates select="m:bvar/m:ci"/>
- <xsl:text>:</xsl:text>
- <xsl:apply-templates mode="inline" select="m:bvar/m:type"/>
- <xsl:text>.</xsl:text>
- <xsl:apply-templates mode="inline" select="*[position()=2]"/>
-</xsl:template>
-
-<!--*********************************************************************-->
-<!-- COUNTING MODE -->
-<!--*********************************************************************-->
-
-<xsl:template match="m:apply[m:csymbol]">
- <xsl:param name="current_indent" select="0"/>
- <xsl:param name="width" select="$framewidth"/>
- <xsl:variable name="name">
- <xsl:value-of select="m:csymbol"/>
- </xsl:variable>
- <xsl:variable name="charlength">
- <xsl:apply-templates select="m:csymbol" mode="charcount"/>
- </xsl:variable>
- <!-- <xsl:value-of select="$current_indent"/> -->
- <!-- <xsl:value-of select="$charlength"/> -->
- <xsl:variable name="uri"><xsl:value-of select="*[1]/@definitionURL"/></xsl:variable>
- <xsl:choose>
- <!-- inst -->
- <xsl:when test="$name='inst'">
- <xsl:apply-templates select="." mode="inline"/>
- </xsl:when>
- <!-- FORALL -->
- <xsl:when test="$name='forall'">
- <xsl:choose>
- <xsl:when test="$charlength > $framewidth">
- <!-- Π -->
- <xsl:call-template name="mksymbol-1">
- <xsl:with-param name="symbol" select="$name"/>
- <xsl:with-param name="color" select="'blue'"/>
- <xsl:with-param name="size" select="'+2'"/>
- </xsl:call-template>
- <xsl:apply-templates select="m:bvar/m:ci"/>
- <xsl:text>:</xsl:text>
- <xsl:apply-templates select="m:bvar/m:type">
- <xsl:with-param name="current_indent"
- select="$current_indent + 5 + 2*string-length(m:bvar/m:ci)"/>
- </xsl:apply-templates>
- <br/>
- <xsl:call-template name="make_indent">
- <xsl:with-param name="current_indent" select="$current_indent + 2"/>
- </xsl:call-template>
- <xsl:text>.</xsl:text>
- <xsl:apply-templates select="*[position()=3]">
- <xsl:with-param name="current_indent" select="$current_indent + 2"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates mode="inline" select="."/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <!-- PROD -->
- <xsl:when test="$name='prod'">
- <xsl:choose>
- <xsl:when test="$charlength > $framewidth">
- <xsl:call-template name="mksymbol-1">
- <xsl:with-param name="symbol" select="$name"/>
- <xsl:with-param name="color" select="'blue'"/>
- <xsl:with-param name="size" select="'+2'"/>
- </xsl:call-template>
- <xsl:apply-templates select="m:bvar/m:ci"/>
- <xsl:text>:</xsl:text>
- <xsl:apply-templates select="m:bvar/m:type">
- <xsl:with-param name="current_indent"
- select="$current_indent + 5 + 2*string-length(m:bvar/m:ci)"/>
- </xsl:apply-templates><br/>
- <xsl:call-template name="make_indent">
- <xsl:with-param name="current_indent" select="$current_indent + 2"/>
- </xsl:call-template>
- <xsl:text>.</xsl:text>
- <xsl:apply-templates select="*[position()=3]">
- <xsl:with-param name="current_indent" select="$current_indent + 2"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates mode="inline" select="."/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <!-- ARROW -->
- <xsl:when test="$name='arrow'">
- <xsl:choose>
- <xsl:when test="$charlength > $framewidth">
- <xsl:text>(</xsl:text>
- <xsl:apply-templates select="*[position()=2]">
- <xsl:with-param name="current_indent" select="$current_indent + 2"/>
- </xsl:apply-templates>
- <br/>
- <xsl:call-template name="make_indent">
- <xsl:with-param name="current_indent" select="$current_indent + 2"/>
- </xsl:call-template>
- <!-- -> -->
- <xsl:call-template name="mksymbol-1">
- <xsl:with-param name="symbol" select="$name"/>
- <xsl:with-param name="color" select="'blue'"/>
- <xsl:with-param name="size" select="'+0'"/>
- </xsl:call-template>
- <xsl:apply-templates select="*[position()=3]">
- <xsl:with-param name="current_indent" select="$current_indent + 5"/>
- </xsl:apply-templates>
- <xsl:text>)</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates mode="inline" select="."/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <!-- IFF -->
- <xsl:when test="$name='iff'">
- <xsl:choose>
- <xsl:when test="$charlength > $framewidth">
- <xsl:text>(</xsl:text>
- <xsl:apply-templates select="*[position()=2]">
- <xsl:with-param name="current_indent" select="$current_indent + 2"/>
- </xsl:apply-templates>
- <br/>
- <xsl:call-template name="make_indent">
- <xsl:with-param name="current_indent" select="$current_indent + 2"/>
- </xsl:call-template>
- <!-- -> -->
- <xsl:call-template name="mksymbol-1">
- <xsl:with-param name="symbol" select="$name"/>
- <xsl:with-param name="color" select="'blue'"/>
- <xsl:with-param name="size" select="'+0'"/>
- </xsl:call-template>
- <xsl:apply-templates select="*[position()=3]">
- <xsl:with-param name="current_indent" select="$current_indent + 5"/>
- </xsl:apply-templates>
- <xsl:text>)</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates mode="inline" select="."/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <!-- APPEND -->
- <xsl:when test="$name='append'">
- <xsl:choose>
- <xsl:when test="$charlength > $framewidth">
- <xsl:text>(</xsl:text>
- <xsl:apply-templates select="*[position()=2]">
- <xsl:with-param name="current_indent" select="$current_indent + 2"/>
- </xsl:apply-templates>
- <br/>
- <xsl:call-template name="make_indent">
- <xsl:with-param name="current_indent" select="$current_indent + 2"/>
- </xsl:call-template>
- <!-- -> -->
- <xsl:call-template name="mksymbol-1">
- <xsl:with-param name="symbol" select="$name"/>
- <xsl:with-param name="color" select="'blue'"/>
- <xsl:with-param name="size" select="'+0'"/>
- </xsl:call-template>
- <xsl:apply-templates select="*[position()=3]">
- <xsl:with-param name="current_indent" select="$current_indent + 5"/>
- </xsl:apply-templates>
- <xsl:text>)</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates mode="inline" select="."/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <!-- APP -->
- <xsl:when test="$name='app'">
- <xsl:choose>
- <xsl:when test="$charlength > $framewidth">
- <xsl:text>(</xsl:text>
- <xsl:apply-templates select="*[position()=2]">
- <xsl:with-param name="current_indent" select="$current_indent + 2"/>
- </xsl:apply-templates>
- <xsl:for-each select="*[position()>2]">
- <br/>
- <xsl:call-template name="make_indent">
- <xsl:with-param name="current_indent" select="$current_indent + 2"/>
- </xsl:call-template>
- <xsl:apply-templates select=".">
- <xsl:with-param name="current_indent" select="$current_indent + 2"/>
- </xsl:apply-templates>
- </xsl:for-each>
- <xsl:text>)</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates mode="inline" select="."/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$name='cast'">
- <xsl:choose>
- <xsl:when test="$showcast = 1">
- <xsl:choose>
- <xsl:when test="$charlength > $framewidth">
- <xsl:text>(</xsl:text>
- <xsl:apply-templates select="*[position()=2]">
- <xsl:with-param name="current_indent" select="$current_indent + 2"/>
- </xsl:apply-templates><br/>
- <xsl:call-template name="make_indent">
- <xsl:with-param name="current_indent" select="$current_indent + 2"/> </xsl:call-template>
- <xsl:text>:></xsl:text>
- <xsl:apply-templates select="*[position()=3]">
- <xsl:with-param name="current_indent" select="$current_indent + 3"/>
- </xsl:apply-templates>
- <xsl:text>)</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates mode="inline" select="."/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="*[position()=2]">
- <xsl:with-param name="current_indent" select="$current_indent"/>
- </xsl:apply-templates>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$name='Prop'">
- <xsl:text>Prop</xsl:text>
- </xsl:when>
- <xsl:when test="$name='Set'">
- <xsl:text>Set</xsl:text>
- </xsl:when>
- <xsl:when test="$name='Type'">
- <xsl:text>Type</xsl:text>
- </xsl:when>
- <xsl:when test="$name='mutcase'">
- <xsl:choose>
- <xsl:when test="$charlength > $framewidth">
- <xsl:text><</xsl:text>
- <xsl:apply-templates select="*[position()=2]">
- <xsl:with-param name="current_indent" select="$current_indent + 2"/>
- </xsl:apply-templates>
- <xsl:text>> </xsl:text>
- <br/>
- <xsl:call-template name="make_indent">
- <xsl:with-param name="current_indent" select="$current_indent + 2"/> </xsl:call-template>
- <xsl:text>CASE </xsl:text>
- <xsl:apply-templates select="*[position()=3]">
- <xsl:with-param name="current_indent" select="$current_indent + 8"/>
- </xsl:apply-templates>
- <xsl:text> OF </xsl:text>
- <xsl:for-each select="m:piecewise/m:piece">
- <!-- <xsl:for-each select="*[position() mod 2 = 0 and position()>3]">-->
- <br/>
- <xsl:call-template name="make_indent">
- <xsl:with-param name="current_indent" select="$current_indent + 2"/>
- </xsl:call-template>
- <xsl:choose>
- <xsl:when test="position() = 1">
- <xsl:text>  </xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>| </xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:apply-templates select="./*[2]"/>
- <xsl:call-template name="mksymbol-1">
- <xsl:with-param name="symbol" select="'RightArrow'"/>
- <xsl:with-param name="color" select="'green'"/>
- <xsl:with-param name="size" select="'+0'"/>
- </xsl:call-template>
- <xsl:variable name="body_size">
- <xsl:apply-templates
- select="./*[1]/*[1]" mode="charcount"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$body_size > $framewidth">
- <br/>
- <xsl:call-template name="make_indent">
- <xsl:with-param name="current_indent"
- select="$current_indent + 8"/>
- </xsl:call-template>
-<xsl:apply-templates
- select="./*[1]">
- <xsl:with-param name="current_indent"
- select="$current_indent + 8"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="./*[1]"
- mode="inline" />
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates mode="inline" select="."/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <!-- FIX -->
- <xsl:when test="$name='fix'">
- <xsl:choose>
- <xsl:when test="$charlength > $framewidth">
- <xsl:text>FIX</xsl:text>
- <xsl:value-of select="m:ci"/>
- <xsl:text>{</xsl:text>
- <xsl:for-each select="m:bvar">
- <br/>
- <xsl:call-template name="make_indent">
- <xsl:with-param name="current_indent" select="$current_indent + 2"/>
- </xsl:call-template>
- <xsl:value-of select="m:ci"/>
- <xsl:text>:</xsl:text>
- <xsl:apply-templates select="m:type">
- <xsl:with-param name="current_indent"
- select="$current_indent + 5 + string-length(m:ci)"/>
- </xsl:apply-templates>
- <br/>
- <xsl:call-template name="make_indent">
- <xsl:with-param name="current_indent" select="$current_indent + 2"/>
- </xsl:call-template>
- <xsl:text>:=</xsl:text>
- <xsl:apply-templates select="following-sibling::*[position() = 1]">
- <xsl:with-param name="current_indent" select="$current_indent +2"/>
- </xsl:apply-templates>
- </xsl:for-each>
- <br/>
- <xsl:call-template name="make_indent">
- <xsl:with-param name="current_indent" select="$current_indent + 2"/>
- </xsl:call-template>
- <xsl:text>}</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates mode="inline" select="."/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <!-- COFIX -->
- <xsl:when test="$name='cofix'">
- <xsl:choose>
- <xsl:when test="($charlength + 10) > $framewidth">
- <xsl:text>COFIX</xsl:text>
- <xsl:value-of select="m:ci"/>
- <xsl:text>{</xsl:text>
- <br/>
- <xsl:call-template name="make_indent">
- <xsl:with-param name="current_indent" select="$current_indent + 2"/>
- </xsl:call-template>
- <xsl:for-each select="m:bvar">
- <xsl:value-of select="m:ci"/>
- <xsl:text>:</xsl:text>
- <xsl:apply-templates select="m:type">
- <xsl:with-param name="current_indent"
- select="$current_indent + 5 + string-length(m:ci)"/>
- </xsl:apply-templates>
- <br/>
- <xsl:call-template name="make_indent">
- <xsl:with-param name="current_indent" select="$current_indent + 2"/>
- </xsl:call-template>
- <xsl:text>:=</xsl:text>
- <xsl:apply-templates select="following-sibling::*[position() = 1]">
- <xsl:with-param name="current_indent" select="$current_indent + 3"/>
- </xsl:apply-templates>
-
- </xsl:for-each>
- <br/>
- <xsl:call-template name="make_indent">
- <xsl:with-param name="current_indent" select="$current_indent + 2"/>
- </xsl:call-template>
- <xsl:text>}</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates mode="inline" select="m:type"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$name='let_in'">
- <xsl:text>let </xsl:text>
- <xsl:apply-templates select="m:bvar/m:ci"/>
- <xsl:text> := </xsl:text>
- <xsl:apply-templates select="*[3]">
- <xsl:with-param name="current_indent" select="$current_indent+14"/>
- </xsl:apply-templates>
- <br/>
- <xsl:call-template name="make_indent">
- <xsl:with-param name="current_indent" select="$current_indent"/>
- </xsl:call-template>
- <xsl:text>in </xsl:text>
- <xsl:apply-templates select="*[4]">
- <xsl:with-param name="current_indent" select="$current_indent+5"/>
- </xsl:apply-templates>
- </xsl:when>
- <!-- it then else -->
- <xsl:when test="$name='ite'">
- <xsl:text>if </xsl:text>
- <xsl:apply-templates select="*[2]">
- <xsl:with-param name="current_indent" select="$current_indent + 5"/>
- </xsl:apply-templates>
- <BR/>
- <xsl:call-template name="make_indent">
- <xsl:with-param name="current_indent" select="$current_indent + 2"/>
- </xsl:call-template>
- <xsl:text> then </xsl:text>
- <xsl:apply-templates select="*[3]">
- <xsl:with-param name="current_indent" select="$current_indent + 12"/>
- </xsl:apply-templates>
- <BR/>
- <xsl:call-template name="make_indent">
- <xsl:with-param name="current_indent" select="$current_indent + 2"/>
- </xsl:call-template>
- <xsl:text> else </xsl:text>
- <xsl:apply-templates select="*[4]">
- <xsl:with-param name="current_indent" select="$current_indent + 12"/>
- </xsl:apply-templates>
- </xsl:when>
-
- <!-- ***************************************** -->
- <!-- *********** PROOF ELEMENTS ************** -->
- <!-- ***************************************** -->
- <!-- PROOF -->
- <xsl:when test="$name='proof'">
- <xsl:variable name="nonce" select="generate-id()"/>
- <xsl:variable name="freshid1" select="concat('a',$nonce)"/>
- <xsl:variable name="freshid2" select="concat('b',$nonce)"/>
- <xsl:variable name="freshid3" select="concat('c',$nonce)"/>
- <span ID="{$freshid1}">
- <xsl:apply-templates select="*[position()=2]">
- <xsl:with-param name="current_indent" select="$current_indent"/>
- </xsl:apply-templates>
-  
- <xsl:if test="*[4]">
- <br/>
- <xsl:call-template name="make_indent">
- <xsl:with-param name="current_indent" select="$current_indent"/>
- </xsl:call-template>
- <FONT color="red">we proved </FONT>
- <xsl:apply-templates select="*[position()=3]">
- <xsl:with-param name="current_indent" select="$current_indent+16"/>
- </xsl:apply-templates>
- <br/>
- <xsl:call-template name="make_indent">
- <xsl:with-param name="current_indent" select="$current_indent"/>
- </xsl:call-template>
- <FONT color="red">and by delta equivalence</FONT>
- <xsl:apply-templates select="*[position()=5]">
- <xsl:with-param name="current_indent" select="$current_indent+16"/>
- </xsl:apply-templates>
- </xsl:if>
- </span>
- <xsl:choose>
- <xsl:when test="(preceding-sibling::*[1]/text()='letin1') or
- (preceding-sibling::*[1]/text()='rw_step') or
- (name(..)='m:lambda')">
- <br/>
- <xsl:call-template name="make_indent">
- <xsl:with-param name="current_indent" select="$current_indent"/>
- </xsl:call-template>
- <FONT color="red">we proved </FONT>
- </xsl:when>
- <xsl:otherwise>
- <script>
- if(document.getElementById) {
- document.write('\
- <span ID="{$freshid2}">\
- <a style="text-decoration:underline ; color:green" href="" onClick="Show(document.getElementById(\'{$freshid1}\')); Hide(document.getElementById(\'{$freshid2}\'));Show(document.getElementById(\'{$freshid3}\'));return (0==1);">Proof of</a>\
- </span>\
- <span ID="{$freshid3}">\
- <br/>\
- <xsl:call-template name="make_indent">
- <xsl:with-param name="current_indent" select="$current_indent"/>
- </xsl:call-template>\
- <a style="text-decoration:underline ; color:red" href="" onClick="Hide(document.getElementById(\'{$freshid1}\')); Show(document.getElementById(\'{$freshid2}\'));Hide(document.getElementById(\'{$freshid3}\'));return (0==1);">we obtain</a>\
- </span>\
- ');
- document.to_be_deleted.push('<xsl:value-of select="$freshid1"/>');
- document.to_be_deleted.push('<xsl:value-of select="$freshid3"/>');
- document.write(' ');
- } else {
- document.write('\
- <br/>\
- <xsl:call-template name="make_indent">
- <xsl:with-param name="current_indent" select="$current_indent"/>
- </xsl:call-template>\
- <FONT color="red">we proved </FONT>\
- ');
- }
- </script>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:apply-templates select="*[position()=last()]">
- <xsl:with-param name="current_indent" select="$current_indent + 16"/>
- </xsl:apply-templates>
- </xsl:when>
- <!-- side_proof -->
- <xsl:when test="$name='side_proof'">
- <xsl:variable name="nonce" select="generate-id()"/>
- <xsl:variable name="freshid1" select="concat('a',$nonce)"/>
- <xsl:variable name="freshid2" select="concat('b',$nonce)"/>
- <xsl:variable name="freshid3" select="concat('c',$nonce)"/>
- <xsl:variable name="freshid4" select="concat('d',$nonce)"/>
- <span ID="{$freshid1}">
- <xsl:apply-templates select="*[position()=2]">
- <xsl:with-param name="current_indent" select="$current_indent"/>
- </xsl:apply-templates>
-  
- </span>
- <script>
- if(document.getElementById) {
- document.write('\
- <span ID="{$freshid2}">\
- <a style="text-decoration:underline ; color:green" href="" onClick="Show(document.getElementById(\'{$freshid1}\')); Hide(document.getElementById(\'{$freshid2}\'));Show(document.getElementById(\'{$freshid3}\'));Show(document.getElementById(\'{$freshid4}\'));return (0==1);">Justification</a>\
- </span>\
- <span ID="{$freshid3}">\
- <br/>\
- <xsl:call-template name="make_indent">
- <xsl:with-param name="current_indent" select="$current_indent"/>
- </xsl:call-template>\
- <a style="text-decoration:underline ; color:red" href="" onClick="Hide(document.getElementById(\'{$freshid1}\')); Show(document.getElementById(\'{$freshid2}\'));Hide(document.getElementById(\'{$freshid3}\'));Hide(document.getElementById(\'{$freshid4}\'));return (0==1);">we proved</a>\
- </span>\
- ');
- document.to_be_deleted.push('<xsl:value-of select="$freshid1"/>');
- document.to_be_deleted.push('<xsl:value-of select="$freshid3"/>');
- document.to_be_deleted.push('<xsl:value-of select="$freshid4"/>');
- document.write(' ');
- } else {
- document.write('\
- <br/>\
- <xsl:call-template name="make_indent">
- <xsl:with-param name="current_indent" select="$current_indent"/>
- </xsl:call-template>\
- <FONT color="red">we proved </FONT>\
- ');
- }
- </script>
- <span ID="{$freshid4}">
- <xsl:apply-templates select="*[position()=3]">
- <xsl:with-param name="current_indent" select="$current_indent + 16"/>
- </xsl:apply-templates>
- </span>
- </xsl:when>
- <!-- eq_chain -->
- <xsl:when test="$name='eq_chain'">
- <FONT color="red">We have the following equality chain:</FONT>
- <xsl:for-each select="*[position() mod 2 = 0]">
- <xsl:variable name="pos" select="position()"/>
- <br/>
- <xsl:call-template name="make_indent">
- <xsl:with-param name="current_indent" select="$current_indent + 5"/>
- </xsl:call-template>
- <xsl:choose>
- <xsl:when test="$pos=1">
- <xsl:apply-templates select=".">
- <xsl:with-param name="current_indent" select="$current_indent + 5"/>
- </xsl:apply-templates>
- <xsl:text> =</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>= </xsl:text>
- <xsl:apply-templates select=".">
- <xsl:with-param name="current_indent" select="$current_indent + 5"/>
- </xsl:apply-templates>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:if test="$pos != last()">
- <br/>
- <xsl:call-template name="make_indent">
- <xsl:with-param name="current_indent" select="$current_indent + 15"/>
- </xsl:call-template>
- <xsl:apply-templates select="../*[position()=2*$pos +1]">
- <xsl:with-param name="current_indent" select="$current_indent + 15"/>
- </xsl:apply-templates>
- </xsl:if>
- </xsl:for-each>
- </xsl:when>
- <!-- diseq_chain -->
- <xsl:when test="$name='diseq_chain'">
- <FONT color="red">We have the following chain of disequalities:</FONT>
- <xsl:for-each select="*[position() mod 3 = 2]">
- <xsl:variable name="pos" select="position()"/>
- <br/>
- <xsl:call-template name="make_indent">
- <xsl:with-param name="current_indent" select="$current_indent + 5"/>
- </xsl:call-template>
- <xsl:choose>
- <xsl:when test="$pos=1">
- <xsl:apply-templates select=".">
- <xsl:with-param name="current_indent" select="$current_indent + 5"/>
- </xsl:apply-templates>
- <xsl:text> </xsl:text>
- <xsl:apply-templates mode="inline" select="../*[position()=3*$pos]"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates mode="inline" select="../*[position()=3*($pos - 1)]"/>
- <xsl:text> </xsl:text>
- <xsl:apply-templates select=".">
- <xsl:with-param name="current_indent" select="$current_indent + 5"/>
- </xsl:apply-templates>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:if test="$pos != last()">
- <br/>
- <xsl:call-template name="make_indent">
- <xsl:with-param name="current_indent" select="$current_indent + 15"/>
- </xsl:call-template>
- <xsl:apply-templates select="../*[position()=3*$pos +1]">
- <xsl:with-param name="current_indent" select="$current_indent + 15"/>
- </xsl:apply-templates>
- </xsl:if>
- </xsl:for-each>
- </xsl:when>
- <!-- letin1 -->
- <xsl:when test="$name='letin1'">
- <xsl:apply-templates select="*[position()=2]">
- <xsl:with-param name="current_indent" select="$current_indent"/>
- </xsl:apply-templates>
- <br/>
- <xsl:call-template name="make_indent">
- <xsl:with-param name="current_indent" select="$current_indent"/>
- </xsl:call-template>
- <xsl:apply-templates select="*[position()=3]">
- <xsl:with-param name="current_indent" select="$current_indent"/>
- </xsl:apply-templates>
- </xsl:when>
- <!-- letin -->
- <xsl:when test="$name='letin'">
- <xsl:for-each select="*[position()>1 and last()>position()]">
- <xsl:apply-templates select=".">
- <xsl:with-param name="current_indent" select="$current_indent"/>
- </xsl:apply-templates>
- <br/>
- <xsl:call-template name="make_indent">
- <xsl:with-param name="current_indent" select="$current_indent"/>
- </xsl:call-template>
- </xsl:for-each>
- <xsl:apply-templates select="*[position()=last()]">
- <xsl:with-param name="current_indent" select="$current_indent"/>
- </xsl:apply-templates>
- </xsl:when>
- <!-- Let -->
- <xsl:when test="$name='let'">
- (
- <xsl:apply-templates select="m:ci"/>
- )
- <xsl:apply-templates select="*[3]">
- <xsl:with-param name="current_indent" select="$current_indent + 7"/>
- </xsl:apply-templates>
- </xsl:when>
- <!-- rw_step -->
- <xsl:when test="$name='rw_step'">
- <xsl:choose>
- <xsl:when test="name(*[2])='m:apply'">
- <xsl:apply-templates select="*[2]">
- <xsl:with-param name="current_indent" select="$current_indent"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <FONT color="red">Consider </FONT>
- <xsl:apply-templates select="*[2]"/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:variable name="charlength_first">
- <xsl:apply-templates select="*[3]" mode="root_charcount"/>
- </xsl:variable>
- <xsl:variable name="charlength_second">
- <xsl:apply-templates select="*[4]" mode="root_charcount"/>
- </xsl:variable>
- <xsl:variable name="charlength_side_proof">
- <xsl:apply-templates select="*[5]" mode="root_charcount"/>
- </xsl:variable>
- <xsl:variable name="split1"
- select="($charlength_first + $charlength_second) > $framewidth"/>
- <xsl:variable name="split2"
- select="($charlength_second + $charlength_side_proof) > $framewidth"/>
- <!-- <xsl:value-of select="$current_indent"/> -->
- <!-- <xsl:value-of select="string($charlength_second)"/> -->
- <!-- <xsl:value-of select="$charlength_side_proof"/> -->
- <!-- <xsl:value-of select="$split2"/> -->
- <br/>
- <xsl:call-template name="make_indent">
- <xsl:with-param name="current_indent" select="$current_indent"/>
- </xsl:call-template>
- <FONT color="red">Rewrite </FONT>
- <xsl:apply-templates mode="inline" select="*[3]"/>
- <xsl:text> </xsl:text>
- <xsl:if test="$split1">
- <br/>
- <xsl:call-template name="make_indent">
- <xsl:with-param name="current_indent" select="$current_indent + 2"/>
- </xsl:call-template>
- </xsl:if>
- <FONT color="red">with </FONT>
- <xsl:apply-templates mode="inline" select="*[4]"/>
- <xsl:text> </xsl:text>
- <xsl:if test="$split2">
- <br/>
- <xsl:call-template name="make_indent">
- <xsl:with-param name="current_indent" select="$current_indent + 2"/>
- </xsl:call-template>
- </xsl:if>
- <FONT color="red">by </FONT>
- <xsl:apply-templates select="*[5]">
- <xsl:with-param name="current_indent" select="$current_indent+7"/>
- </xsl:apply-templates>
- </xsl:when>
- <!-- rewrite and apply -->
- <xsl:when test="$name='rewrite_and_apply'">
- <xsl:apply-templates select="*[2]">
- <xsl:with-param name="current_indent" select="$current_indent"/>
- </xsl:apply-templates>
- <br/>
- <xsl:call-template name="make_indent">
- <xsl:with-param name="current_indent" select="$current_indent"/>
- </xsl:call-template>
- <FONT color="red">Then apply it to </FONT>
- <xsl:apply-templates select="*[position()>2]"/>
- </xsl:when>
- <!-- by_induction -->
- <xsl:when test="$name='by_induction'">
- <FONT color="red">We prove </FONT>
- <xsl:apply-templates select="../*[3]">
- <xsl:with-param name="current_indent" select="$current_indent+18"/>
- </xsl:apply-templates>
- <br/>
- <xsl:call-template name="make_indent">
- <xsl:with-param name="current_indent" select="$current_indent"/>
- </xsl:call-template>
- <FONT color="red">by induction on </FONT>
- <xsl:apply-templates select="*[position()=last()]/*[position()=last()]">
- <xsl:with-param name="current_indent" select="$current_indent+30"/>
- </xsl:apply-templates>
- <!--
- <br/>
- <xsl:call-template name="make_indent">
- <xsl:with-param name="current_indent" select="$current_indent"/>
- </xsl:call-template>
- <xsl:text>The induction property is</xsl:text>
- <br/>
- <xsl:call-template name="make_indent">
- <xsl:with-param name="current_indent" select="$current_indent"/>
- </xsl:call-template>
- <xsl:apply-templates select="*[3]">
- <xsl:with-param name="current_indent" select="$current_indent"/>
- </xsl:apply-templates>
- -->
- <xsl:apply-templates
- select="*[position()>3 and not(position()=last())]">
- <xsl:with-param name="current_indent" select="$current_indent+4"/>
- </xsl:apply-templates>
- <!-- <br/>
- <xsl:call-template name="make_indent">
- <xsl:with-param name="current_indent" select="$current_indent"/>
- </xsl:call-template>
- <xsl:text>End induction</xsl:text> -->
- </xsl:when>
- <!-- inductive_case -->
- <xsl:when test="$name='inductive_case'">
- <br/>
- <xsl:call-template name="make_indent">
- <xsl:with-param name="current_indent" select="$current_indent"/>
- </xsl:call-template>
- <FONT color="red">Case </FONT>
- <xsl:apply-templates select="*[2]">
- <xsl:with-param name="current_indent" select="$current_indent +10"/>
- </xsl:apply-templates>
- <xsl:if test="*[3]/*[position()>1]">
- <br/>
- <xsl:call-template name="make_indent">
- <xsl:with-param name="current_indent" select="$current_indent+4"/>
- </xsl:call-template>
- <FONT color="red">By induction hypothesis, we have:</FONT>
- <xsl:for-each select="*[3]/*[position()>1]">
- <br/>
- <xsl:call-template name="make_indent">
- <xsl:with-param name="current_indent" select="$current_indent + 4"/>
- </xsl:call-template>
- <xsl:text>(</xsl:text>
- <xsl:apply-templates select="m:ci"/>
- <xsl:text>) </xsl:text>
- <xsl:apply-templates select="m:type">
- <xsl:with-param name="current_indent" select="$current_indent + 8"/>
- </xsl:apply-templates>
- </xsl:for-each>
- </xsl:if>
- <br/>
- <xsl:call-template name="make_indent">
- <xsl:with-param name="current_indent" select="$current_indent + 4"/>
- </xsl:call-template>
- <xsl:apply-templates select="*[4]">
- <xsl:with-param name="current_indent" select="$current_indent +4"/>
- </xsl:apply-templates>
- <!-- <br/>
- <xsl:call-template name="make_indent">
- <xsl:with-param name="current_indent" select="$current_indent"/>
- </xsl:call-template>
- <xsl:text>End Case</xsl:text> -->
- </xsl:when>
- <!-- case_lhs -->
- <xsl:when test="$name='case_lhs'">
- <xsl:choose>
- <xsl:when test="count(*)=2">
- <xsl:apply-templates mode="inline" select="*[2]"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>(</xsl:text>
- <xsl:apply-templates mode="inline" select="*[2]"/>
- <xsl:for-each select="m:bvar">
- <xsl:text> </xsl:text>
- <xsl:apply-templates mode="inline" select="*[1]"/>
- <xsl:text>:</xsl:text>
- <xsl:apply-templates mode="inline" select="m:type/*[1]"/>
- </xsl:for-each>
- <xsl:text>)</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <!-- false_ind -->
- <xsl:when test="$name='false_ind'">
- <xsl:apply-templates select="*[3]">
- <xsl:with-param name="current_indent" select="$current_indent"/>
- </xsl:apply-templates>
- <br/>
- <xsl:call-template name="make_indent">
- <xsl:with-param name="current_indent" select="$current_indent"/>
- </xsl:call-template>
- <FONT color="red">Contradiction.</FONT>
- </xsl:when>
- <!-- and_ind -->
- <xsl:when test="$name='and_ind'">
- <xsl:choose>
- <xsl:when test="name(*[2])='m:apply'">
- <xsl:apply-templates select="*[2]">
- <xsl:with-param name="current_indent" select="$current_indent"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <FONT color="red">Consider </FONT>
- <xsl:apply-templates select="*[2]"/>
- </xsl:otherwise>
- </xsl:choose>
- <br/>
- <xsl:call-template name="make_indent">
- <xsl:with-param name="current_indent" select="$current_indent"/>
- </xsl:call-template>
- <FONT color="red">In particular, we have</FONT>
- <br/>
- <xsl:call-template name="make_indent">
- <xsl:with-param name="current_indent" select="$current_indent"/>
- </xsl:call-template>
- (
- <xsl:apply-templates select="*[3]"/>
- ) 
- <xsl:apply-templates select="*[4]">
- <xsl:with-param name="current_indent" select="$current_indent + 9"/>
- </xsl:apply-templates>
- <br/>
- <xsl:call-template name="make_indent">
- <xsl:with-param name="current_indent" select="$current_indent"/>
- </xsl:call-template>
- (
- <xsl:apply-templates select="*[5]"/>
- ) 
- <xsl:apply-templates select="*[6]">
- <xsl:with-param name="current_indent" select="$current_indent + 9"/>
- </xsl:apply-templates>
- <br/>
- <xsl:call-template name="make_indent">
- <xsl:with-param name="current_indent" select="$current_indent"/>
- </xsl:call-template>
- <xsl:apply-templates select="*[7]">
- <xsl:with-param name="current_indent" select="$current_indent"/>
- </xsl:apply-templates>
- </xsl:when>
- <!-- full_or_ind -->
- <xsl:when test="$name='full_or_ind'">
- <xsl:choose>
- <xsl:when test="name(*[2])='m:apply'">
- <xsl:apply-templates select="*[2]">
- <xsl:with-param name="current_indent" select="$current_indent"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <FONT color="red">Consider </FONT>
- <xsl:apply-templates select="*[2]"/>
- </xsl:otherwise>
- </xsl:choose>
- <br/>
- <xsl:call-template name="make_indent">
- <xsl:with-param name="current_indent" select="$current_indent"/>
- </xsl:call-template>
- <FONT color="red">We proceed by cases to prove </FONT>
- <xsl:apply-templates select="*[3]"/>
- <br/>
- <xsl:call-template name="make_indent">
- <xsl:with-param name="current_indent" select="$current_indent+4"/>
- </xsl:call-template>
- <FONT color="red">Left: suppose </FONT>
- <xsl:text>(</xsl:text>
- <xsl:value-of select="*[4]/m:bvar/m:ci"/>
- <xsl:text>) </xsl:text>
- <xsl:apply-templates
- select="*[4]/m:bvar/m:type/*[1]"/>
- <br/>
- <xsl:call-template name="make_indent">
- <xsl:with-param name="current_indent" select="$current_indent+15"/>
- </xsl:call-template>
- <xsl:apply-templates
- select="*[4]/*[3]">
- <xsl:with-param name="current_indent" select="$current_indent+15"/>
- </xsl:apply-templates>
- <br/>
- <xsl:call-template name="make_indent">
- <xsl:with-param name="current_indent" select="$current_indent+4"/>
- </xsl:call-template>
- <FONT color="red">Right: suppose </FONT>
- <xsl:text>(</xsl:text>
- <xsl:value-of select="*[5]/m:bvar/m:ci"/>
- <xsl:text>) </xsl:text>
- <xsl:apply-templates
- select="*[5]/m:bvar/m:type/*[1]"/>
- <br/>
- <xsl:call-template name="make_indent">
- <xsl:with-param name="current_indent" select="$current_indent+16"/>
- </xsl:call-template>
- <xsl:apply-templates
- select="*[5]/*[3]">
- <xsl:with-param name="current_indent" select="$current_indent+16"/>
- </xsl:apply-templates>
- </xsl:when>
- <!-- or_ind -->
- <xsl:when test="$name='or_ind'">
- <xsl:choose>
- <xsl:when test="name(*[2])='m:apply'">
- <xsl:apply-templates select="*[2]">
- <xsl:with-param name="current_indent" select="$current_indent"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <FONT color="red">Consider </FONT>
- <xsl:apply-templates select="*[2]"/>
- </xsl:otherwise>
- </xsl:choose>
- <br/>
- <xsl:call-template name="make_indent">
- <xsl:with-param name="current_indent" select="$current_indent"/>
- </xsl:call-template>
- <FONT color="red">We prove </FONT>
- <xsl:apply-templates select="*[3]"/>
- <FONT color="red"> by cases:</FONT>
- <br/>
- <xsl:call-template name="make_indent">
- <xsl:with-param name="current_indent" select="$current_indent"/>
- </xsl:call-template>
- Left: 
- <xsl:apply-templates select="*[4]">
- <xsl:with-param name="current_indent" select="$current_indent"/>
- </xsl:apply-templates>
- <br/>
- <xsl:call-template name="make_indent">
- <xsl:with-param name="current_indent" select="$current_indent"/>
- </xsl:call-template>
- Right: 
- <xsl:apply-templates select="*[5]">
- <xsl:with-param name="current_indent" select="$current_indent"/>
- </xsl:apply-templates>
- </xsl:when>
- <!-- Ex_ind -->
- <xsl:when test="$name='ex_ind'">
- <xsl:choose>
- <xsl:when test="name(*[2])='m:apply'">
- <xsl:apply-templates select="*[2]">
- <xsl:with-param name="current_indent" select="$current_indent"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <FONT color="red">Consider </FONT>
- <xsl:apply-templates select="*[2]">
- <xsl:with-param name="current_indent" select="$current_indent"/>
- </xsl:apply-templates>
- </xsl:otherwise>
- </xsl:choose>
- <br/>
- <xsl:call-template name="make_indent">
- <xsl:with-param name="current_indent" select="$current_indent"/>
- </xsl:call-template>
- <FONT color="red">Let </FONT>
- <xsl:apply-templates mode="inline" select="*[3]"/>
- :
- <xsl:apply-templates mode="inline" select="*[4]"/>
- <FONT color="red"> such that</FONT>
- <br/>
- <xsl:call-template name="make_indent">
- <xsl:with-param name="current_indent" select="$current_indent"/>
- </xsl:call-template>
- (
- <xsl:apply-templates mode="inline" select="*[5]"/>
- )
- <xsl:apply-templates select="*[6]">
- <xsl:with-param name="current_indent" select="$current_indent +7"/>
- </xsl:apply-templates>
- <br/>
- <xsl:call-template name="make_indent">
- <xsl:with-param name="current_indent" select="$current_indent"/>
- </xsl:call-template>
- <xsl:apply-templates select="*[7]">
- <xsl:with-param name="current_indent" select="$current_indent"/>
- </xsl:apply-templates>
- </xsl:when>
- <!-- ***************************************** -->
- <!-- *********** LAMBDA ELEMENTS ************** -->
- <!-- ***************************************** -->
- <xsl:when test="$name='subst'">
- <xsl:apply-templates select="*[3]"/>
- <xsl:text>[</xsl:text>
- <xsl:apply-templates select="*[4]"/>
- <xsl:choose>
- <xsl:when test="$uri != ''">
- <a href="{$uri}">
- <xsl:call-template name="mksymbol-1">
- <xsl:with-param name="symbol" select="$name"/>
- <xsl:with-param name="color" select="'blue'"/>
- <xsl:with-param name="size" select="'+0'"/>
- </xsl:call-template>
- </a>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="mksymbol-1">
- <xsl:with-param name="symbol" select="$name"/>
- <xsl:with-param name="color" select="'blue'"/>
- <xsl:with-param name="size" select="'+0'"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:apply-templates select="*[2]"/>
- <xsl:text>]</xsl:text>
- </xsl:when>
-
- <xsl:when test="$name='lift_with_base'">
- <SUB>
- <xsl:apply-templates select="*[3]" mode="inline"/>
- </SUB>
- <xsl:choose>
- <xsl:when test="$uri != ''">
- <a href="{$uri}">
- <xsl:call-template name="mksymbol-1">
- <xsl:with-param name="symbol" select="$name"/>
- <xsl:with-param name="color" select="'green'"/>
- <xsl:with-param name="size" select="'+0'"/>
- </xsl:call-template>
- </a>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="mksymbol-1">
- <xsl:with-param name="symbol" select="$name"/>
- <xsl:with-param name="color" select="'green'"/>
- <xsl:with-param name="size" select="'+0'"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- <SUP>
- <xsl:apply-templates select="*[4]" mode="inline"/>
- </SUP>
- <xsl:text>(</xsl:text>
- <xsl:apply-templates select="*[2]" mode="inline"/>
- <xsl:text>)</xsl:text>
- </xsl:when>
-
- <xsl:when test="$name='lift'">
- <xsl:choose>
- <xsl:when test="$uri != ''">
- <a href="{$uri}">
- <xsl:call-template name="mksymbol-1">
- <xsl:with-param name="symbol" select="$name"/>
- <xsl:with-param name="color" select="'green'"/>
- <xsl:with-param name="size" select="'+0'"/>
- </xsl:call-template>
- </a>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="mksymbol-1">
- <xsl:with-param name="symbol" select="$name"/>
- <xsl:with-param name="color" select="'green'"/>
- <xsl:with-param name="size" select="'+0'"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- <SUP>
- <xsl:apply-templates select="*[2]" mode="inline"/>
- </SUP>
- <xsl:text>(</xsl:text>
- <xsl:apply-templates select="*[3]" mode="inline"/>
- <xsl:text>)</xsl:text>
- </xsl:when>
-
- <!-- reduction -->
- <xsl:when test="$name='beta_red1'">
- <xsl:apply-templates select="*[2]" mode="inline"/>
- <xsl:choose>
- <xsl:when test="$uri != ''">
- <a href="{$uri}">
- <xsl:call-template name="mksymbol-1">
- <xsl:with-param name="symbol" select="$name"/>
- <xsl:with-param name="color" select="'green'"/>
- <xsl:with-param name="size" select="'+0'"/>
- </xsl:call-template>
- <SUB>
- <xsl:call-template name="mksymbol-1">
- <xsl:with-param name="symbol" select="'beta'"/>
- <xsl:with-param name="color" select="'green'"/>
- <xsl:with-param name="size" select="'+0'"/>
- </xsl:call-template>
- </SUB>
- </a>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="mksymbol-1">
- <xsl:with-param name="symbol" select="$name"/>
- <xsl:with-param name="color" select="'green'"/>
- <xsl:with-param name="size" select="'+0'"/>
- </xsl:call-template>
- <SUB>
- <xsl:call-template name="mksymbol-1">
- <xsl:with-param name="symbol" select="'beta'"/>
- <xsl:with-param name="color" select="'green'"/>
- <xsl:with-param name="size" select="'+0'"/>
- </xsl:call-template>
- </SUB>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:apply-templates select="*[3]" mode="inline"/>
- </xsl:when>
-
- <xsl:when test="$name='beta_red'">
- <xsl:apply-templates select="*[2]" mode="inline"/>
- <xsl:choose>
- <xsl:when test="$uri != ''">
- <a href="{$uri}">
- <xsl:call-template name="mksymbol-1">
- <xsl:with-param name="symbol" select="$name"/>
- <xsl:with-param name="color" select="'green'"/>
- <xsl:with-param name="size" select="'+0'"/>
- </xsl:call-template>
- <SUB>
- <xsl:call-template name="mksymbol-1">
- <xsl:with-param name="symbol" select="'beta'"/>
- <xsl:with-param name="color" select="'green'"/>
- <xsl:with-param name="size" select="'+0'"/>
- </xsl:call-template>
- <xsl:text>*</xsl:text>
- </SUB>
- </a>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="mksymbol-1">
- <xsl:with-param name="symbol" select="$name"/>
- <xsl:with-param name="color" select="'green'"/>
- <xsl:with-param name="size" select="'+0'"/>
- </xsl:call-template>
- <SUB>
- <xsl:call-template name="mksymbol-1">
- <xsl:with-param name="symbol" select="'beta'"/>
- <xsl:with-param name="color" select="'green'"/>
- <xsl:with-param name="size" select="'+0'"/>
- </xsl:call-template>
- <xsl:text>*</xsl:text>
- </SUB>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:apply-templates select="*[3]" mode="inline"/>
- </xsl:when>
-
- <xsl:when test="$name='par_beta_red1'">
- <xsl:apply-templates select="*[2]" mode="inline"/>
- <xsl:choose>
- <xsl:when test="$uri != ''">
- <a href="{$uri}">
- <xsl:call-template name="mksymbol-1">
- <xsl:with-param name="symbol" select="$name"/>
- <xsl:with-param name="color" select="'green'"/>
- <xsl:with-param name="size" select="'+0'"/>
- </xsl:call-template>
- <SUB>
- <xsl:call-template name="mksymbol-1">
- <xsl:with-param name="symbol" select="'beta'"/>
- <xsl:with-param name="color" select="'green'"/>
- <xsl:with-param name="size" select="'+0'"/>
- </xsl:call-template>
- </SUB>
- </a>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="mksymbol-1">
- <xsl:with-param name="symbol" select="$name"/>
- <xsl:with-param name="color" select="'green'"/>
- <xsl:with-param name="size" select="'+0'"/>
- </xsl:call-template>
- <SUB>
- <xsl:call-template name="mksymbol-1">
- <xsl:with-param name="symbol" select="'beta'"/>
- <xsl:with-param name="color" select="'green'"/>
- <xsl:with-param name="size" select="'+0'"/>
- </xsl:call-template>
- </SUB>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:apply-templates select="*[3]" mode="inline"/>
- </xsl:when>
-
- <xsl:when test="$name='par_beta_red'">
- <xsl:apply-templates select="*[2]" mode="inline"/>
- <xsl:choose>
- <xsl:when test="$uri != ''">
- <a href="{$uri}">
- <xsl:call-template name="mksymbol-1">
- <xsl:with-param name="symbol" select="$name"/>
- <xsl:with-param name="color" select="'green'"/>
- <xsl:with-param name="size" select="'+0'"/>
- </xsl:call-template>
- <SUB>
- <xsl:call-template name="mksymbol-1">
- <xsl:with-param name="symbol" select="'beta'"/>
- <xsl:with-param name="color" select="'green'"/>
- <xsl:with-param name="size" select="'+0'"/>
- </xsl:call-template>
- <xsl:text>*</xsl:text>
- </SUB>
- </a>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="mksymbol-1">
- <xsl:with-param name="symbol" select="$name"/>
- <xsl:with-param name="color" select="'green'"/>
- <xsl:with-param name="size" select="'+0'"/>
- </xsl:call-template>
- <SUB>
- <xsl:call-template name="mksymbol-1">
- <xsl:with-param name="symbol" select="'beta'"/>
- <xsl:with-param name="color" select="'green'"/>
- <xsl:with-param name="size" select="'+0'"/>
- </xsl:call-template>
- <xsl:text>*</xsl:text>
- </SUB>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:apply-templates select="*[3]" mode="inline"/>
- </xsl:when>
-
- <!-- forgetful -->
- <xsl:when test="$name='forgetful'">
- <xsl:choose>
- <xsl:when test="$uri != ''">
- <a href="{$uri}">|</a>
- </xsl:when>
- <xsl:otherwise>
- |
- </xsl:otherwise>
- </xsl:choose>
- <xsl:apply-templates select="*[2]" mode="inline"/>
- <xsl:choose>
- <xsl:when test="$uri != ''">
- <a href="{$uri}">|</a>
- </xsl:when>
- <xsl:otherwise>
- |
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
-
- <!-- boolean algebra of redexes -->
-
- <!-- isomorphic -->
- <xsl:when test="$name='isomorphic'">
- <xsl:apply-templates select="*[2]" mode="inline"/>
- <xsl:choose>
- <xsl:when test="$uri != ''">
- <a href="{$uri}">
- <xsl:call-template name="mksymbol-1">
- <xsl:with-param name="symbol" select="$name"/>
- <xsl:with-param name="color" select="'green'"/>
- <xsl:with-param name="size" select="'+0'"/>
- </xsl:call-template>
- </a>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="mksymbol-1">
- <xsl:with-param name="symbol" select="$name"/>
- <xsl:with-param name="color" select="'green'"/>
- <xsl:with-param name="size" select="'+0'"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:apply-templates select="*[3]" mode="inline"/>
- </xsl:when>
-
- <!-- INTERP -->
- <xsl:when test="$name='interp'">
- <font color="green">[</font>
- <xsl:apply-templates select="*[2]"/>
- <font color="green">]</font>
- </xsl:when>
-
- </xsl:choose>
-</xsl:template>
-
-<!-- LAMBDA -->
-
-<xsl:template match="m:lambda">
-<xsl:param name="current_indent" select="0"/>
- <xsl:variable name="charlength">
- <xsl:apply-templates select="*[position()=1]" mode="charcount"/>
- <!-- <xsl:apply-templates select="." mode="charcount"/> -->
- </xsl:variable>
- <!-- <xsl:value-of select="$charlength"/> -->
- <!-- <xsl:value-of select="$current_indent"/> -->
- <xsl:choose>
- <xsl:when test="$charlength > $framewidth">
- <!-- λ -->
- <xsl:call-template name="mksymbol-1">
- <xsl:with-param name="symbol" select="'lambda'"/>
- <xsl:with-param name="color" select="'red'"/>
- <xsl:with-param name="size" select="'+2'"/>
- </xsl:call-template>
- <xsl:apply-templates select="m:bvar/m:ci"/>
- <xsl:text>:</xsl:text>
- <xsl:apply-templates select="m:bvar/m:type">
- <xsl:with-param name="current_indent"
- select="$current_indent + 4 + 2*string-length(m:bvar/m:ci)"/>
- </xsl:apply-templates><br/>
- <xsl:call-template name="make_indent">
- <xsl:with-param name="current_indent" select="$current_indent + 2"/>
- </xsl:call-template>
- <xsl:text>.</xsl:text>
- <xsl:apply-templates select="*[position()=2]">
- <xsl:with-param name="current_indent" select="$current_indent + 2"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates mode="inline" select="."/>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<!-- href -->
-<xsl:template match="m:ci">
- <xsl:choose>
- <xsl:when test="boolean(@definitionURL)">
- <a href="{@definitionURL}">
- <xsl:apply-templates/>
- </a>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="."/>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<!-- CHAR COUNTING -->
-
-<!-- enter this counting mode selecting the root -->
-<xsl:template match="*" mode="root_charcount">
-<xsl:param name="incurrent_length" select="0"/>
- <xsl:choose>
- <xsl:when test="count(*)=0">
- <xsl:value-of select="0"/>
- </xsl:when>
- <xsl:when test="name()='m:ci'">
- <xsl:value-of select="string-length()"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="*[1]" mode="charcount">
- <xsl:with-param name="incurrent_length" select="$incurrent_length"/>
- </xsl:apply-templates>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<!-- enter this mode selecting the first child -->
-
-<xsl:template match="m:ci|m:csymbol" mode="charcount">
-<xsl:param name="incurrent_length" select="0"/>
- <xsl:choose>
- <xsl:when test="$framewidth >= ($incurrent_length + string-length())">
- <xsl:variable name="siblength"><xsl:apply-templates select="following-sibling::*[position()=1]" mode="charcount"><xsl:with-param name="incurrent_length" select="$incurrent_length + string-length()"/></xsl:apply-templates></xsl:variable>
- <xsl:choose>
- <xsl:when test="string($siblength) = """>
- <xsl:value-of select="$incurrent_length + string-length()"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="number($siblength)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$incurrent_length + string-length()"/>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match="*" mode="charcount">
- <xsl:param name="incurrent_length" select="0"/>
- <xsl:choose>
- <xsl:when test="count(child::*) = 0">
- <xsl:value-of select="$incurrent_length"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="childlength"><xsl:apply-templates select="*[position()=1]" mode="charcount"><xsl:with-param name="incurrent_length" select="$incurrent_length"/></xsl:apply-templates></xsl:variable>
- <xsl:choose>
- <xsl:when test="$framewidth >= number($childlength)">
- <xsl:variable name="siblength"><xsl:apply-templates select="following-sibling::*[position()=1]" mode="charcount"><xsl:with-param name="incurrent_length" select="$childlength"/></xsl:apply-templates></xsl:variable>
- <xsl:choose>
- <xsl:when test="string($siblength) = """>
- <xsl:value-of select="number($childlength)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="number($siblength)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="number($childlength)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-
-<!--***********************************************************************-->
-<!-- OBJECTS -->
-<!--***********************************************************************-->
-
-<!-- DEFINITION -->
-
-<xsl:template match="Definition">
-<xsl:param name="current_indent" select="0"/>
-<p>
-DEFINITION <xsl:value-of select="@name"/>(<xsl:if test="string(./Params) != """><xsl:value-of select="Params"/></xsl:if>)<br/>
-TYPE =<br/>
- <xsl:call-template name="make_indent">
- <xsl:with-param name="current_indent" select="$current_indent + 7"/>
- </xsl:call-template>
- <xsl:apply-templates select="type/*[1]">
- <xsl:with-param name="current_indent" select="$current_indent + 7"/>
- </xsl:apply-templates><br/>
-BODY =<br/>
- <xsl:call-template name="make_indent">
- <xsl:with-param name="current_indent" select="$current_indent + 7"/>
- </xsl:call-template>
- <xsl:apply-templates select="body/*[1]">
- <xsl:with-param name="current_indent" select="$current_indent + 7"/>
- </xsl:apply-templates>
-</p>
-</xsl:template>
-
-<!-- AXIOM -->
-
-<xsl:template match="Axiom">
-<xsl:param name="current_indent" select="0"/>
-<p>
-AXIOM <xsl:value-of select="@name"/>(<xsl:if test="string(./Params) != """><xsl:value-of select="Params"/></xsl:if>)<br/>
-TYPE =<br/>
- <xsl:call-template name="make_indent">
- <xsl:with-param name="current_indent" select="$current_indent + 7"/>
- </xsl:call-template>
-<xsl:apply-templates select="type/*[1]">
- <xsl:with-param name="current_indent" select="$current_indent + 7"/>
- </xsl:apply-templates>
-</p>
-</xsl:template>
-
-<!-- UNFINISHED PROOF -->
-
-<xsl:template match="CurrentProof">
-<xsl:param name="current_indent" select="0"/>
-<p>
-UNFINISHED PROOF <xsl:value-of select="@name"/>(<xsl:if test="string(./Params) != """><xsl:value-of select="Params"/></xsl:if>)<br/>
-THESIS: <xsl:apply-templates select="type/*[1]">
- <xsl:with-param name="current_indent" select="$current_indent + 8"/>
- </xsl:apply-templates><br/>
-CONJECTURES:
- <xsl:for-each select="Conjecture">
- <br/>
- <xsl:call-template name="make_indent">
- <xsl:with-param name="current_indent" select="$current_indent + 8"/>
- </xsl:call-template>
- <xsl:for-each select="Decl|Def|Hidden">
- <xsl:choose>
- <xsl:when test="name(.)='Decl'">
- <xsl:choose>
- <xsl:when test="@name">
- <xsl:value-of select="@name"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>_</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:text> : </xsl:text>
- <xsl:apply-templates select="./*[1]">
- <xsl:with-param name="current_indent" select="$current_indent"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:when test="name(.)='Def'">
- <xsl:choose>
- <xsl:when test="@name">
- <xsl:value-of select="@name"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>_</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:text> := </xsl:text>
- <xsl:apply-templates select="./*[1]">
- <xsl:with-param name="current_indent" select="$current_indent"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text> _ :? _ </xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- |- <xsl:value-of select="./@no"/> :
- <xsl:apply-templates select="./Goal/*[1]">
- <xsl:with-param name="current_indent" select="$current_indent + 11"/>
- </xsl:apply-templates>
- </xsl:for-each>
- <br/>
-PROOF:
- <xsl:apply-templates select="body/*[1]">
- <xsl:with-param name="current_indent" select="$current_indent + 8"/>
- </xsl:apply-templates>
-</p>
-</xsl:template>
-
-<!-- MUTUAL INDUCTIVE DEFINITION -->
-
-<xsl:template match="InductiveDefinition">
-<xsl:param name="current_indent" select="0"/>
-<p>
- <xsl:for-each select="InductiveType">
- <xsl:choose>
- <xsl:when test="position() = 1">
- <xsl:choose>
- <xsl:when test="string(./@inductive) = "true"">
- INDUCTIVE DEFINITION
- </xsl:when>
- <xsl:otherwise>
- COINDUCTIVE DEFINITION
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- AND
- </xsl:otherwise>
- </xsl:choose>
- <xsl:value-of select="./@name"/>(<xsl:if test="string(../Params) != """><xsl:value-of select="../Params"/></xsl:if>)
- [
- <xsl:if test="string(../Param) != """>
- <xsl:for-each select="../Param">
- <xsl:value-of select="./@name"/>
- :
- <xsl:apply-templates select="*"/>
- </xsl:for-each>
- </xsl:if>
- ] <br/>
- OF ARITY
- <xsl:apply-templates select="./arity/*[1]">
- <xsl:with-param name="current_indent" select="$current_indent + 9"/>
- </xsl:apply-templates> <br/>
- BUILT FROM:
- <xsl:for-each select="./Constructor">
- <br/>
- <xsl:call-template name="make_indent">
- <xsl:with-param name="current_indent" select="$current_indent + 3"/>
- </xsl:call-template>
- <xsl:choose>
- <xsl:when test="position() = 1">
- <xsl:text>  </xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>| </xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:value-of select="./@name"/>
- <xsl:text>: </xsl:text>
- <xsl:apply-templates select="./*[1]">
- <xsl:with-param name="current_indent" select="$current_indent + 2*string-length(./@name) + 5"/>
- </xsl:apply-templates>
- </xsl:for-each>
- </xsl:for-each>
-</p>
-</xsl:template>
-
-<!-- VARIABLE -->
-
-<xsl:template match="Variable">
-<xsl:param name="current_indent" select="0"/>
-<p>
-VARIABLE <xsl:value-of select="@name"/><br/>
-TYPE = <xsl:apply-templates select="type/*[1]">
- <xsl:with-param name="current_indent" select="$current_indent + 7"/>
- </xsl:apply-templates>
-<xsl:if test="body">
-<br/>
-BODY = <xsl:apply-templates select="body/*[1]">
- <xsl:with-param name="current_indent" select="$current_indent + 7"/>
- </xsl:apply-templates>
-</xsl:if>
-</p>
-</xsl:template>
-
-<!--***********************************************************************-->
-<!-- SECTIONS -->
-<!--***********************************************************************-->
-
-<!-- SECTION -->
-
-<xsl:template match="SECTION">
-<xsl:param name="current_indent" select="0"/>
- <h1>BEGIN OF SECTION</h1>
- <xsl:apply-templates/>
- <h1>END OF SECTION</h1>
-</xsl:template>
-
-</xsl:stylesheet>
+++ /dev/null
-<?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/. -->
-
-<!--******************************************************************-->
-<!-- Library for MML Content -->
-<!-- First draft: March 20 2001, Ferruccio Guidi -->
-<!--******************************************************************-->
-
-<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">
-
-<xsl:template name="out-mml-op"> <!-- outputs MML nodes for operators -->
- <xsl:param name="hide" select="0"/> <!-- number of hidden parameters -->
- <xsl:param name="arity"/> <!-- operator arity -->
- <xsl:param name="c-tag"/> <!-- CIC tag -->
- <xsl:param name="m-tag"/> <!-- MathML tag -->
- <xsl:param name="mbody"/> <!-- other sons of m:apply -->
- <xsl:choose>
- <xsl:when test="count(child::*) = $arity + $hide + 1">
- <m:apply helm:xref="{@id}">
- <xsl:element name="{concat('m:',$m-tag)}">
- <xsl:attribute name="definitionURL">
- <xsl:value-of select="$c-tag/@uri"/>
- </xsl:attribute>
- <xsl:attribute name="helm:xref">
- <xsl:value-of select="$c-tag/@id"/>
- </xsl:attribute>
- </xsl:element>
- <xsl:copy-of select="$mbody"/>
- </m:apply>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-imports/>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<!-- noannot -->
-
-<xsl:template name="mk-mml-op-noannot"> <!-- makes MML nodes for operators (noannot mode) -->
- <xsl:param name="hide"
- select="0"/> <!-- hidden params -->
- <xsl:param name="arity"
- select="2"/> <!-- operator arity -->
- <xsl:param name="c-tag"/> <!-- CIC tag -->
- <xsl:param name="m-tag"/> <!-- MathML tag -->
- <xsl:param name="rnset"
- select="*[position() > 1 + $hide]"/> <!-- nodes for recursion -->
- <xsl:variable name="mbody">
- <xsl:apply-templates select="$rnset" mode="noannot"/>
- </xsl:variable>
- <xsl:call-template name="out-mml-op">
- <xsl:with-param name="hide" select="$hide"/>
- <xsl:with-param name="arity" select="$arity"/>
- <xsl:with-param name="c-tag" select="$c-tag"/>
- <xsl:with-param name="m-tag" select="$m-tag"/>
- <xsl:with-param name="mbody" select="$mbody"/>
- </xsl:call-template>
-</xsl:template>
-
-<!-- interp -->
-
-<xsl:template name="start-interp"> <!-- interp mode starter -->
- <xsl:param name="rtree"/>
- <xsl:param name="atree"/>
- <m:apply helm:xref="{@id}">
- <m:csymbol>interp</m:csymbol>
- <xsl:apply-templates mode="interp" select="$rtree">
- <xsl:with-param name="atree" select="$atree"/>
- </xsl:apply-templates>
- </m:apply>
-</xsl:template>
-
-<xsl:template name="mk-mml-op-interp"> <!-- make MML node for operators (interp mode) -->
- <xsl:param name="arity"/> <!-- operator arity -->
- <xsl:param name="c-tag"/> <!-- CIC tag -->
- <xsl:param name="m-tag"/> <!-- MathML tag -->
- <xsl:param name="atree"/> <!-- abstract tree pointer -->
- <xsl:variable name="mbody">
- <xsl:apply-templates select="*[position() > 1]" mode="interp">
- <xsl:with-param name="atree" select="$atree"/>
- </xsl:apply-templates>
- </xsl:variable>
- <xsl:call-template name="out-mml-op">
- <xsl:with-param name="arity" select="$arity"/>
- <xsl:with-param name="c-tag" select="$c-tag"/>
- <xsl:with-param name="m-tag" select="$m-tag"/>
- <xsl:with-param name="mbody" select="$mbody"/>
- </xsl:call-template>
-</xsl:template>
-
-</xsl:stylesheet>
+++ /dev/null
-<?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/. -->
-
-<!--******************************************************************-->
-<!-- Disequalities -->
-<!-- (completely) Revisited: november 2002, Andrea Asperti -->
-<!-- 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 mode="proof_transform" match="APPLY[CONST[attribute::uri='cic:/Algebra/algebra/CSetoids/CSetoid_basics/eq_transitive_unfolded.con'] and count(child::*) = 7]">
- <xsl:variable name="id" select="@id"/>
- <m:apply>
- <m:csymbol>diseq_chain</m:csymbol>
- <xsl:apply-templates mode="noannot" select="*[3]"/>
- <xsl:apply-templates mode="diseq" select="*[6]">
- <xsl:with-param name="rel" select="'eq'"/>
- </xsl:apply-templates>
- <xsl:apply-templates mode="noannot" select="*[4]"/>
- <xsl:apply-templates mode="diseq" select="*[7]">
- <xsl:with-param name="rel" select="'eq'"/>
- </xsl:apply-templates>
- <xsl:apply-templates mode="noannot" select="*[5]"/>
- </m:apply>
-</xsl:template>
-
-<xsl:template mode="proof_transform" match="APPLY[CONST[attribute::uri='cic:/Algebra/algebra/COrdFields/Basic_Properties_of_leEq/leEq_transitive.con'] and count(child::*) = 7]">
- <xsl:variable name="id" select="@id"/>
- <m:apply>
- <m:csymbol>diseq_chain</m:csymbol>
- <xsl:apply-templates mode="noannot" select="*[3]"/>
- <xsl:apply-templates mode="diseq" select="*[6]">
- <xsl:with-param name="rel" select="'leq'"/>
- </xsl:apply-templates>
- <xsl:apply-templates mode="noannot" select="*[4]"/>
- <xsl:apply-templates mode="diseq" select="*[7]">
- <xsl:with-param name="rel" select="'leq'"/>
- </xsl:apply-templates>
- <xsl:apply-templates mode="noannot" select="*[5]"/>
- </m:apply>
-</xsl:template>
-
-<xsl:template mode="proof_transform" match="APPLY[CONST[attribute::uri='cic:/Algebra/algebra/COrdFields/Basic_Properties_of_leEq/leEq_wdl.con'] and count(child::*) = 7]">
- <xsl:variable name="id" select="@id"/>
- <m:apply>
- <m:csymbol>diseq_chain</m:csymbol>
- <xsl:apply-templates mode="noannot" select="*[5]"/>
- <xsl:apply-templates mode="diseq" select="*[7]">
- <xsl:with-param name="rel" select="'eq'"/>
- </xsl:apply-templates>
- <xsl:apply-templates mode="noannot" select="*[3]"/>
- <xsl:apply-templates mode="diseq" select="*[6]">
- <xsl:with-param name="rel" select="'leq'"/>
- </xsl:apply-templates>
- <xsl:apply-templates mode="noannot" select="*[4]"/>
- </m:apply>
-</xsl:template>
-
-<xsl:template mode="proof_transform" match="APPLY[CONST[attribute::uri='cic:/Algebra/algebra/COrdFields/Basic_Properties_of_leEq/leEq_less_trans.con'] and count(child::*) = 7]">
- <xsl:variable name="id" select="@id"/>
- <m:apply>
- <m:csymbol>diseq_chain</m:csymbol>
- <xsl:apply-templates mode="noannot" select="*[3]"/>
- <xsl:apply-templates mode="diseq" select="*[6]">
- <xsl:with-param name="rel" select="'leq'"/>
- </xsl:apply-templates>
- <xsl:apply-templates mode="noannot" select="*[4]"/>
- <xsl:apply-templates mode="diseq" select="*[7]">
- <xsl:with-param name="rel" select="'lt'"/>
- </xsl:apply-templates>
- <xsl:apply-templates mode="noannot" select="*[5]"/>
- </m:apply>
-</xsl:template>
-
-<xsl:template mode="proof_transform" match="APPLY[CONST[attribute::uri='cic:/Algebra/algebra/COrdFields/Basic_Properties_of_leEq/less_leEq_trans.con'] and count(child::*) = 7]">
- <xsl:variable name="id" select="@id"/>
- <m:apply>
- <m:csymbol>diseq_chain</m:csymbol>
- <xsl:apply-templates mode="noannot" select="*[3]"/>
- <xsl:apply-templates mode="diseq" select="*[6]">
- <xsl:with-param name="rel" select="'lt'"/>
- </xsl:apply-templates>
- <xsl:apply-templates mode="noannot" select="*[4]"/>
- <xsl:apply-templates mode="diseq" select="*[7]">
- <xsl:with-param name="rel" select="'leq'"/>
- </xsl:apply-templates>
- <xsl:apply-templates mode="noannot" select="*[5]"/>
- </m:apply>
-</xsl:template>
-
-<xsl:template mode="proof_transform" match="APPLY[CONST[attribute::uri='cic:/Algebra/algebra/COrdFields/Basic_Properties_of_leEq/leEq_wdr.con'] and count(child::*) = 7]">
- <xsl:variable name="id" select="@id"/>
- <m:apply>
- <m:csymbol>diseq_chain</m:csymbol>
- <xsl:apply-templates mode="noannot" select="*[3]"/>
- <xsl:apply-templates mode="diseq" select="*[6]">
- <xsl:with-param name="rel" select="'leq'"/>
- </xsl:apply-templates>
- <xsl:apply-templates mode="noannot" select="*[4]"/>
- <xsl:apply-templates mode="diseq" select="*[7]">
- <xsl:with-param name="rel" select="'eq'"/>
- </xsl:apply-templates>
- <xsl:apply-templates mode="noannot" select="*[5]"/>
- </m:apply>
-</xsl:template>
-
-<xsl:template mode="proof_transform" match="APPLY[CONST[attribute::uri='cic:/Algebra/algebra/COrdFields/COrdField_axioms/less_transitive_unfolded.con'] and count(child::*) = 7]">
- <xsl:variable name="id" select="@id"/>
- <m:apply>
- <m:csymbol>diseq_chain</m:csymbol>
- <xsl:apply-templates mode="noannot" select="*[3]"/>
- <xsl:apply-templates mode="diseq" select="*[6]">
- <xsl:with-param name="rel" select="'lt'"/>
- </xsl:apply-templates>
- <xsl:apply-templates mode="noannot" select="*[4]"/>
- <xsl:apply-templates mode="diseq" select="*[7]">
- <xsl:with-param name="rel" select="'lt'"/>
- </xsl:apply-templates>
- <xsl:apply-templates mode="noannot" select="*[5]"/>
- </m:apply>
-</xsl:template>
-
-<xsl:template mode="proof_transform" match="APPLY[CONST[attribute::uri='cic:/Algebra/algebra/COrdFields/COrdField_axioms/less_wdr.con'] and count(child::*) = 7]">
- <xsl:variable name="id" select="@id"/>
- <m:apply>
- <m:csymbol>diseq_chain</m:csymbol>
- <xsl:apply-templates mode="noannot" select="*[3]"/>
- <xsl:apply-templates mode="diseq" select="*[6]">
- <xsl:with-param name="rel" select="'lt'"/>
- </xsl:apply-templates>
- <xsl:apply-templates mode="noannot" select="*[4]"/>
- <xsl:apply-templates mode="diseq" select="*[7]">
- <xsl:with-param name="rel" select="'eq'"/>
- </xsl:apply-templates>
- <xsl:apply-templates mode="noannot" select="*[5]"/>
- </m:apply>
-</xsl:template>
-
-<xsl:template mode="proof_transform" match="APPLY[CONST[attribute::uri='cic:/Algebra/algebra/COrdFields/COrdField_axioms/less_wdl.con'] and count(child::*) = 7]">
- <xsl:variable name="id" select="@id"/>
- <m:apply>
- <m:csymbol>diseq_chain</m:csymbol>
- <xsl:apply-templates mode="noannot" select="*[5]"/>
- <xsl:apply-templates mode="diseq" select="*[7]">
- <xsl:with-param name="rel" select="'eq'"/>
- </xsl:apply-templates>
- <xsl:apply-templates mode="noannot" select="*[3]"/>
- <xsl:apply-templates mode="diseq" select="*[6]">
- <xsl:with-param name="rel" select="'lt'"/>
- </xsl:apply-templates>
- <xsl:apply-templates mode="noannot" select="*[4]"/>
- </m:apply>
-</xsl:template>
-
-<xsl:template mode="proof_transform" match="APPLY[CONST[attribute::uri='cic:/Coq/Reals/Rbase/Rle_lt_trans.con'] and count(child::*) = 6]">
- <xsl:variable name="id" select="@id"/>
- <m:apply>
- <m:csymbol>diseq_chain</m:csymbol>
- <xsl:apply-templates mode="noannot" select="*[2]"/>
- <xsl:apply-templates mode="diseq" select="*[5]">
- <xsl:with-param name="rel" select="'leq'"/>
- </xsl:apply-templates>
- <xsl:apply-templates mode="noannot" select="*[3]"/>
- <xsl:apply-templates mode="diseq" select="*[6]">
- <xsl:with-param name="rel" select="'lt'"/>
- </xsl:apply-templates>
- <xsl:apply-templates mode="noannot" select="*[4]"/>
- </m:apply>
-</xsl:template>
-
-<xsl:template mode="proof_transform" match="APPLY[CONST[attribute::uri='cic:/Coq/Reals/Rbase/Rlt_le_trans.con'] and count(child::*) = 6]">
- <xsl:variable name="id" select="@id"/>
- <m:apply>
- <m:csymbol>diseq_chain</m:csymbol>
- <xsl:apply-templates mode="noannot" select="*[2]"/>
- <xsl:apply-templates mode="diseq" select="*[5]">
- <xsl:with-param name="rel" select="'lt'"/>
- </xsl:apply-templates>
- <xsl:apply-templates mode="noannot" select="*[3]"/>
- <xsl:apply-templates mode="diseq" select="*[6]">
- <xsl:with-param name="rel" select="'leq'"/>
- </xsl:apply-templates>
- <xsl:apply-templates mode="noannot" select="*[4]"/>
- </m:apply>
-</xsl:template>
-
-<xsl:template mode="diseq" match="*">
- <xsl:param name="rel" select="'eq'"/>
- <xsl:choose>
- <xsl:when test="name()='APPLY'">
- <xsl:variable name="id" select="@id"/>
- <xsl:choose>
- <xsl:when test="CONST[attribute::uri='cic:/Algebra/COrdFields/Basic_Properties_of_leEq/leEq_transitive.con'] and count(child::*) = 7">
- <xsl:apply-templates mode="diseq" select="*[6]">
- <xsl:with-param name="rel" select="'leq'"/>
- </xsl:apply-templates>
- <xsl:apply-templates mode="noannot" select="*[4]"/>
- <xsl:apply-templates mode="diseq" select="*[7]">
- <xsl:with-param name="rel" select="'leq'"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:when test="CONST[attribute::uri='cic:/Algebra/COrdFields/Basic_Properties_of_leEq/leEq_wdl.con'] and count(child::*) = 7">
- <xsl:call-template name="generate_side_proof">
- <xsl:with-param name="proof" select="*[7]"/>
- <xsl:with-param name="show_statement" select="0"/>
- </xsl:call-template>
- <xsl:apply-templates mode="diseq" select="*[7]">
- <xsl:with-param name="rel" select="'eq'"/>
- </xsl:apply-templates>
- <xsl:apply-templates mode="noannot" select="*[3]"/>
- <xsl:apply-templates mode="diseq" select="*[6]">
- <xsl:with-param name="rel" select="'leq'"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:when test="CONST[attribute::uri='cic:/Algebra/COrdFields/Basic_Properties_of_leEq/leEq_less_trans.con'] and count(child::*) = 7">
- <xsl:apply-templates mode="diseq" select="*[6]">
- <xsl:with-param name="rel" select="'leq'"/>
- </xsl:apply-templates>
- <xsl:apply-templates mode="noannot" select="*[4]"/>
- <xsl:apply-templates mode="diseq" select="*[7]">
- <xsl:with-param name="rel" select="'lt'"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:when test="CONST[attribute::uri='cic:/Algebra/COrdFields/Basic_Properties_of_leEq/less_leEq_trans.con'] and count(child::*) = 7">
- <xsl:apply-templates mode="diseq" select="*[6]">
- <xsl:with-param name="rel" select="'lt'"/>
- </xsl:apply-templates>
- <xsl:apply-templates mode="noannot" select="*[4]"/>
- <xsl:apply-templates mode="diseq" select="*[7]">
- <xsl:with-param name="rel" select="'leq'"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:when test="CONST[attribute::uri='cic:/Algebra/COrdFields/Basic_Properties_of_leEq/leEq_wdr.con'] and count(child::*) = 7">
- <xsl:apply-templates mode="diseq" select="*[6]">
- <xsl:with-param name="rel" select="'leq'"/>
- </xsl:apply-templates>
- <xsl:apply-templates mode="noannot" select="*[4]"/>
- <xsl:apply-templates mode="diseq" select="*[7]">
- <xsl:with-param name="rel" select="'eq'"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:when test="CONST[attribute::uri='cic:/Algebra/COrdFields/COrdField_axioms/less_transitive_unfolded.con'] and count(child::*) = 7">
- <xsl:apply-templates mode="diseq" select="*[6]">
- <xsl:with-param name="rel" select="'lt'"/>
- </xsl:apply-templates>
- <xsl:apply-templates mode="noannot" select="*[4]"/>
- <xsl:apply-templates mode="diseq" select="*[7]">
- <xsl:with-param name="rel" select="'lt'"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:when test="CONST[attribute::uri='cic:/Algebra/COrdFields/COrdField_axioms/less_wdr.con'] and count(child::*) = 7">
- <xsl:apply-templates mode="diseq" select="*[6]">
- <xsl:with-param name="rel" select="'lt'"/>
- </xsl:apply-templates>
- <xsl:apply-templates mode="noannot" select="*[4]"/>
- <xsl:apply-templates mode="diseq" select="*[7]">
- <xsl:with-param name="rel" select="'eq'"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:when test="CONST[attribute::uri='cic:/Algebra/COrdFields/COrdField_axioms/less_wdl.con'] and count(child::*) = 7">
- <xsl:apply-templates mode="diseq" select="*[7]">
- <xsl:with-param name="rel" select="'eq'"/>
- </xsl:apply-templates>
- <xsl:apply-templates mode="noannot" select="*[3]"/>
- <xsl:apply-templates mode="diseq" select="*[6]">
- <xsl:with-param name="rel" select="'lt'"/>
- </xsl:apply-templates>
- </xsl:when>
- <!-- REALS -->
- <xsl:when test="CONST[attribute::uri='cic:/Coq/Reals/Rbase/Rlt_le_trans.con'] and count(child::*) = 6">
- <xsl:apply-templates mode="diseq" select="*[5]">
- <xsl:with-param name="rel" select="'lt'"/>
- </xsl:apply-templates>
- <xsl:apply-templates mode="noannot" select="*[3]"/>
- <xsl:apply-templates mode="diseq" select="*[6]">
- <xsl:with-param name="rel" select="'leq'"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:when test="CONST[attribute::uri='cic:/Coq/Reals/Rbase/Rle_lt_trans.con'] and count(child::*) = 6">
- <xsl:apply-templates mode="diseq" select="*[5]">
- <xsl:with-param name="rel" select="'leq'"/>
- </xsl:apply-templates>
- <xsl:apply-templates mode="noannot" select="*[3]"/>
- <xsl:apply-templates mode="diseq" select="*[6]">
- <xsl:with-param name="rel" select="'lt'"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <xsl:element name="{concat('m:',$rel)}"/>
- <xsl:call-template name="generate_side_proof">
- <xsl:with-param name="proof" select="."/>
- <xsl:with-param name="show_statement" select="0"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:element name="{concat('m:',$rel)}"/>
- <xsl:call-template name="generate_side_proof">
- <xsl:with-param name="proof" select="."/>
- <xsl:with-param name="show_statement" select="0"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-
-</xsl:stylesheet>
+++ /dev/null
-<?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/. -->
-
-<!--******************************************************************-->
-<!-- Coercions -->
-<!-- First draft: March 20 2001, Andrea Asperti -->
-<!--******************************************************************-->
-
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-
-<!-- ************************** LAMBDA ****************************** -->
-
-<xsl:param name="CICURI" select="''"/>
-<xsl:param name="getterURL" select="''"/>
-<xsl:include href="getter.xsl"/>
-<xsl:include href="params.xsl"/>
-
-<!-- coercions -->
-
-<xsl:template match="APPLY[CONST[position()='1' and
- (@uri='cic:/Algebra/algebra/CSemiGroups/csg_crr.con' or
- @uri='cic:/Algebra/algebra/CMonoids/cm_crr.con' or
- @uri='cic:/Algebra/algebra/CGroups/cg_crr.con' or
- @uri='cic:/Algebra/algebra/CRings/cr_crr.con' or
- @uri='cic:/Algebra/algebra/CFields/cf_crr.con' or
- @uri='cic:/Algebra/algebra/COrdFields/cof_crr.con' or
- @uri='cic:/Algebra/reals/CReals/crl_crr.con')]]">
- <xsl:apply-templates select="*[position()=last()]"/>
-</xsl:template>
-
-<xsl:template match="APPLY[CONST[position()='1' and
- @uri='cic:/Algebra/algebra/CSetoids/CSetoid_functions/csf_fun.con']]">
- <xsl:variable name="no_params">
- <xsl:call-template name="get_no_params">
- <xsl:with-param name="first_uri" select="$CICURI"/>
- <xsl:with-param name="second_uri" select="CONST[1]/@uri"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="(count(child::*) - number($no_params)) = 3">
- <xsl:choose>
- <xsl:when test="name(*[2+$no_params])='APPLY'">
- <APPLY id="{@id}" sort="{@sort}">
- <xsl:apply-templates select="*[2+$no_params]/*"/>
- <xsl:apply-templates select="*[3+$no_params]"/>
- </APPLY>
- </xsl:when>
- <xsl:otherwise>
- <APPLY id="{@id}" sort="{@sort}">
- <xsl:apply-templates select="*[2+$no_params]"/>
- <xsl:apply-templates select="*[3+$no_params]"/>
- </APPLY>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <APPLY id="{@id}" sort="{@sort}">
- <xsl:apply-templates select="*"/>
- </APPLY>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match="APPLY[CONST[position()='1' and
- @uri='cic:/Algebra/algebra/CSetoids/CSetoid_functions/csbf_fun.con']]">
- <xsl:variable name="no_params">
- <xsl:call-template name="get_no_params">
- <xsl:with-param name="first_uri" select="$CICURI"/>
- <xsl:with-param name="second_uri" select="CONST[1]/@uri"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="(count(child::*) - number($no_params)) = 4">
- <xsl:choose>
- <xsl:when test="name(*[2+$no_params])='APPLY'">
- <APPLY id="{@id}" sort="{@sort}">
- <xsl:apply-templates select="*[2+$no_params]/*"/>
- <xsl:apply-templates select="*[3+$no_params]"/>
- <xsl:apply-templates select="*[4+$no_params]"/>
- </APPLY>
- </xsl:when>
- <xsl:otherwise>
- <APPLY id="{@id}" sort="{@sort}">
- <xsl:apply-templates select="*[2+$no_params]"/>
- <xsl:apply-templates select="*[3+$no_params]"/>
- <xsl:apply-templates select="*[4+$no_params]"/>
- </APPLY>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <APPLY id="{@id}" sort="{@sort}">
- <xsl:apply-templates select="*"/>
- </APPLY>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match="APPLY[CONST[position()='1' and
- @uri='cic:/Algebra/algebra/CSetoids/CSetoid_relations_and_predicates/csr_rel.con']]">
- <xsl:variable name="no_params">
- <xsl:call-template name="get_no_params">
- <xsl:with-param name="first_uri" select="$CICURI"/>
- <xsl:with-param name="second_uri" select="CONST[1]/@uri"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="(count(child::*) - number($no_params)) = 4">
- <xsl:choose>
- <xsl:when test="name(*[2+$no_params])='APPLY'">
- <APPLY id="{@id}" sort="{@sort}">
- <xsl:apply-templates select="*[2+$no_params]/*"/>
- <xsl:apply-templates select="*[3+$no_params]"/>
- <xsl:apply-templates select="*[4+$no_params]"/>
- </APPLY>
- </xsl:when>
- <xsl:otherwise>
- <APPLY id="{@id}" sort="{@sort}">
- <xsl:apply-templates select="*[2+$no_params]"/>
- <xsl:apply-templates select="*[3+$no_params]"/>
- <xsl:apply-templates select="*[4+$no_params]"/>
- </APPLY>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <APPLY id="{@id}" sort="{@sort}">
- <xsl:apply-templates select="*"/>
- </APPLY>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match="APPLY[CONST[position()='1' and
- @uri='cic:/Algebra/algebra/CRings/nat_injection/nring.con']]">
- <xsl:variable name="no_params">
- <xsl:call-template name="get_no_params">
- <xsl:with-param name="first_uri" select="$CICURI"/>
- <xsl:with-param name="second_uri" select="CONST[1]/@uri"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="(count(child::*) - number($no_params)) = 2">
- <xsl:apply-templates select="*[2+$no_params]"/>
- </xsl:when>
- <xsl:otherwise>
- <APPLY id="{@id}" sort="{@sort}">
- <xsl:apply-templates select="*"/>
- </APPLY>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match = "/|*">
- <xsl:copy>
- <xsl:copy-of select="@*"/>
- <xsl:apply-templates select="*"/>
- </xsl:copy>
-</xsl:template>
-
-
-</xsl:stylesheet>
+++ /dev/null
-<?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/. -->
-
-<!--***********************************************************************-->
-<!-- XSLT version 0.1 of theory sections to theory sections with objects -->
-<!-- First draft: March 08 2001, Irene Schena -->
-<!--***********************************************************************-->
-
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:ht="http://www.cs.unibo.it/helm/namespaces/helm-theory">
-
-<!--******************************************************************-->
-<!-- Parameters containing the absolute path of the CIC file -->
-<!--******************************************************************-->
-
-<xsl:import href="links_library.xsl"/>
-
-<xsl:output
- method="xml"
- encoding="iso-8859-1"
- media-type="text/html"
- doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
- doctype-system="DTD/xhtml1-transitional.dtd" />
-
-<!-- THEORY CONTENT ELEMENTS -->
-<!-- document cannot return HTML, transforming it into XML!!! -->
-
-<xsl:template match="ht:THEOREM">
-<xsl:variable name="url"><xsl:call-template name="makeURL4embedding"><xsl:with-param name="type" select="'typeonly'"/><xsl:with-param name="uri" select="@uri"/></xsl:call-template></xsl:variable>
- <xsl:copy>
- <xsl:copy-of select="@*"/>
- <xsl:copy-of select="document(string($url))"/>
- <xsl:value-of select="$url"/>
- </xsl:copy>
-</xsl:template>
-
-<xsl:template match="ht:AXIOM|ht:DEFINITION|ht:VARIABLE">
-<xsl:variable name="url"><xsl:call-template name="makeURL4embedding"><xsl:with-param name="type" select="'embed'"/><xsl:with-param name="uri" select="@uri"/></xsl:call-template></xsl:variable>
- <xsl:copy>
- <xsl:copy-of select="@*"/>
- <xsl:copy-of select="document(string($url))"/>
- </xsl:copy>
-</xsl:template>
-
-<!-- THEORY PRESENTATION ELEMENTS -->
-
-<xsl:template match="ENTITY">
-<xsl:variable name="url"><xsl:call-template name="makeURL4embedding"><xsl:with-param name="type" select="@type"/><xsl:with-param name="uri" select="@uri"/></xsl:call-template></xsl:variable>
- <xsl:variable name="doc_to_embed" select="document(string($url))/to_be_embedded"/>
- <xsl:copy-of select="$doc_to_embed/*|$doc_to_embed/text()"/>
-</xsl:template>
-
-<!-- CONTENT AND PRESENTATION THEORY AND SUBTHEORY -->
-
-<xsl:template match = "/|*">
- <xsl:copy>
- <xsl:copy-of select="@*"/>
- <xsl:apply-templates/>
- </xsl:copy>
-</xsl:template>
-
-</xsl:stylesheet>
+++ /dev/null
-<?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/. -->
-
-<!--***********************************************************************-->
-<!-- XSLT version 0.1 of a generation of id for MathML content elements: -->
-<!-- First draft: April 28 2001, Irene Schena -->
-<!--***********************************************************************-->
-
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:m="http://www.w3.org/1998/Math/MathML">
-
-<xsl:output method="xml"/>
-
-<!-- Copy of the root or m:math or a node different from mml elements -->
-<!-- with all its attributes -->
-<xsl:template match = "/|*|m:math">
- <xsl:copy>
- <xsl:copy-of select="@*"/>
- <xsl:apply-templates/>
- </xsl:copy>
-</xsl:template>
-
-<!-- Generates random id for all mml elements -->
-<xsl:template match = "m:*">
- <xsl:copy>
- <xsl:copy-of select="@*"/>
- <xsl:attribute name="id"><xsl:value-of select="generate-id()"/></xsl:attribute>
- <xsl:apply-templates/>
- </xsl:copy>
-</xsl:template>
-
-</xsl:stylesheet>
+++ /dev/null
-<?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/. -->
-
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-
-<xsl:template name="URLofURI4getter">
- <xsl:param name="uri" select="''"/>
- <xsl:value-of select="$getterURL"/>getxml?uri=<xsl:value-of select="$uri"/>
-</xsl:template>
-
-</xsl:stylesheet>
+++ /dev/null
-<?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/. -->
-
-<!--***********************************************************************-->
-<!-- XSLT version 0.1 of the stylesheet to list the notational stylesheets -->
-<!-- First draft: May 26 2000, C.Sacerdoti Coen, I.Schena, F.Guidi -->
-<!--***********************************************************************-->
-
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-
-<!-- Warning: the first included stylesheet has the lowest precedence -->
-<xsl:include href="contentlib.xsl"/>
-<xsl:include href="basic.xsl"/>
-<xsl:include href="arith.xsl"/>
-<xsl:include href="set.xsl"/>
-<xsl:include href="list.xsl"/>
-<xsl:include href="reals.xsl"/>
-<xsl:include href="ring.xsl"/>
-<xsl:include href="algebra.xsl"/>
-<xsl:include href="lambda.xsl"/>
-<xsl:include href="positive.xsl"/>
-<xsl:include href="ccorn.xsl"/>
-
-</xsl:stylesheet>
+++ /dev/null
-<?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/. -->
-
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:m="http://www.w3.org/1998/Math/MathML">
-
-<xsl:template name="mksymbol-init">
- <xsl:param name="symbol" select="''"/>
- <xsl:choose>
- <xsl:when test="$UNICODEvsSYMBOL = 'symbol'">
- <xsl:variable name="fontsymbol">
- <xsl:choose>
- <xsl:when test="$symbol = 'and'">
- <xsl:value-of select="'Ù'"/>
- </xsl:when>
- <xsl:when test="$symbol = 'or'">
- <xsl:value-of select="'Ú'"/>
- </xsl:when>
- <xsl:when test="$symbol = 'eq'">
- <xsl:value-of select="'='"/>
- </xsl:when>
- <xsl:when test="$symbol = 'neq'">
- <xsl:value-of select="'¹'"/>
- </xsl:when>
- <xsl:when test="$symbol = 'leq'">
- <xsl:value-of select="'£'"/>
- </xsl:when>
- <xsl:when test="$symbol = 'lt'">
- <xsl:value-of select="'<'"/>
- </xsl:when>
- <xsl:when test="$symbol = 'geq'">
- <xsl:value-of select="'³'"/>
- </xsl:when>
- <xsl:when test="$symbol = 'gt'">
- <xsl:value-of select="'>'"/>
- </xsl:when>
- <xsl:when test="$symbol = 'plus'">
- <xsl:value-of select="'+'"/>
- </xsl:when>
- <xsl:when test="$symbol = 'times'">
- <xsl:value-of select="'*'"/>
- </xsl:when>
- <xsl:when test="$symbol = 'divide'">
- <xsl:value-of select="'/'"/>
- </xsl:when>
- <xsl:when test="$symbol = 'minus'">
- <xsl:value-of select="'-'"/>
- </xsl:when>
- <xsl:when test="$symbol = 'not'">
- <xsl:value-of select="'Ø'"/>
- </xsl:when>
- <xsl:when test="$symbol = 'exists'">
- <xsl:value-of select="'$'"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>???</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <FONT FACE="symbol" color="'blue'">
- <xsl:value-of select="$fontsymbol"/>
- </FONT>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="unicodesymbol">
- <xsl:choose>
- <xsl:when test="$symbol = 'and'">
- <xsl:value-of select="'∧'"/>
- </xsl:when>
- <xsl:when test="$symbol = 'or'">
- <xsl:value-of select="'∨'"/>
- </xsl:when>
- <xsl:when test="$symbol = 'eq'">
- <xsl:value-of select="'='"/>
- </xsl:when>
- <xsl:when test="$symbol = 'neq'">
- <xsl:value-of select="'≠'"/>
- </xsl:when>
- <xsl:when test="$symbol = 'leq'">
- <xsl:value-of select="'≤'"/>
- </xsl:when>
- <xsl:when test="$symbol = 'lt'">
- <xsl:value-of select="'< '"/>
- </xsl:when>
- <xsl:when test="$symbol = 'geq'">
- <xsl:value-of select="'≥'"/>
- </xsl:when>
- <xsl:when test="$symbol = 'gt'">
- <xsl:value-of select="'>'"/>
- </xsl:when>
- <xsl:when test="$symbol = 'plus'">
- <xsl:value-of select="'+'"/>
- </xsl:when>
- <xsl:when test="$symbol = 'times'">
- <xsl:value-of select="'∗'"/>
- </xsl:when>
- <xsl:when test="$symbol = 'divide'">
- <xsl:value-of select="'/'"/>
- </xsl:when>
- <xsl:when test="$symbol = 'minus'">
- <xsl:value-of select="'−'"/>
- </xsl:when>
- <xsl:when test="$symbol = 'not'">
- <xsl:value-of select="'¬'"/>
- </xsl:when>
- <xsl:when test="$symbol = 'exists'">
- <xsl:value-of select="'∃'"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>???</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <FONT color="'blue'">
- <xsl:value-of select="$unicodesymbol"/>
- </FONT>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-
-<!--***********************************************************************-->
-<!-- INIT style for HTML -->
-<!-- HELM Group: Asperti, Padovani, Sacerdoti, Schena -->
-<!--***********************************************************************-->
-
-<!-- INLINE MODE : BASIC OPERATORS -->
-
-<xsl:template mode="inline" match="m:infinity">
- <xsl:choose>
- <xsl:when test="$UNICODEvsSYMBOL = 'symbol'">
- <FONT FACE="symbol" color="'blue'">
- <xsl:value-of select="'¥'"/>
- </FONT>
- </xsl:when>
- <xsl:otherwise>
- <FONT color="'blue'">
- <!-- VERIFICARE -->
- <xsl:value-of select="'¥'"/>
- </FONT>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template mode="inline" match="m:eq|m:leq|m:lt|m:geq|m:gt">
- <xsl:variable name="uri"><xsl:value-of select="*[1]/@definitionURL"/></xsl:variable>
- <xsl:choose>
- <xsl:when test="$uri != ''">
- <a href="{$uri}">
- <xsl:call-template name="mksymbol-init">
- <xsl:with-param name="symbol" select="local-name(.)"/>
- </xsl:call-template>
- </a>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="mksymbol-init">
- <xsl:with-param name="symbol" select="local-name(.)"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
- <xsl:template mode="inline" match="m:apply[m:and|m:or|m:eq|m:neq|m:leq|m:lt
- |m:geq|m:gt|m:plus|m:times|m:divide]">
- <xsl:variable name="uri"><xsl:value-of select="*[1]/@definitionURL"/></xsl:variable>
- <xsl:text>(</xsl:text>
- <xsl:apply-templates mode="inline" select="*[2]"/>
- <xsl:choose>
- <xsl:when test="$uri != ''">
- <a href="{$uri}">
- <xsl:call-template name="mksymbol-init">
- <xsl:with-param name="symbol" select="local-name(*[1])"/>
- </xsl:call-template>
- </a>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="mksymbol-init">
- <xsl:with-param name="symbol" select="local-name(*[1])"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:apply-templates mode="inline" select="*[3]"/>
- <xsl:text>)</xsl:text>
- </xsl:template>
-
-<!-- INLINE MODE - MINUS (can be unary!) -->
-
-<xsl:template mode="inline" match="m:apply[m:minus]">
- <xsl:variable name="uri"><xsl:value-of select="*[1]/@definitionURL"/></xsl:variable>
- <xsl:choose>
- <xsl:when test="count(child::*)=2">
- <xsl:choose>
- <xsl:when test="$uri != ''">
- <a href="{$uri}">
- <xsl:call-template name="mksymbol-init">
- <xsl:with-param name="symbol" select="'minus'"/>
- </xsl:call-template>
- </a>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="mksymbol-init">
- <xsl:with-param name="symbol" select="'minus'"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:apply-templates mode="inline" select="*[2]"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>(</xsl:text>
- <xsl:apply-templates mode="inline" select="*[2]"/>
- <xsl:choose>
- <xsl:when test="$uri != ''">
- <a href="{$uri}">
- <xsl:call-template name="mksymbol-init">
- <xsl:with-param name="symbol" select="'minus'"/>
- </xsl:call-template>
- </a>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="mksymbol-init">
- <xsl:with-param name="symbol" select="'minus'"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:apply-templates mode="inline" select="*[3]"/>
- <xsl:text>)</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
-<!-- INLINE MODE NOT -->
-
-<xsl:template mode="inline" match="m:apply[m:not]">
- <xsl:variable name="uri"><xsl:value-of select="m:not/@definitionURL"/></xsl:variable>
- <xsl:choose>
- <xsl:when test="$uri != ''">
- <a href="{$uri}">
- <xsl:call-template name="mksymbol-init">
- <xsl:with-param name="symbol" select="'not'"/>
- </xsl:call-template>
- </a>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="mksymbol-init">
- <xsl:with-param name="symbol" select="'not'"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:apply-templates mode="inline" select="*[2]"/>
-</xsl:template>
-
-<!-- INLINE MODE EXISTS -->
-
- <xsl:template mode="inline" match="m:apply[m:exists]">
- <xsl:variable name="uri"><xsl:value-of select="m:exists/@definitionURL"/></xsl:variable>
- <xsl:choose>
- <xsl:when test="$uri != ''">
- <a href="{$uri}">
- <xsl:call-template name="mksymbol-init">
- <xsl:with-param name="symbol" select="'exists'"/>
- </xsl:call-template>
- </a>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="mksymbol-init">
- <xsl:with-param name="symbol" select="'exists'"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:apply-templates select="m:bvar/m:ci"/>
- <xsl:text>:</xsl:text>
- <xsl:apply-templates mode="inline" select="m:condition"/>
- <xsl:text>.</xsl:text>
- <xsl:apply-templates mode="inline" select="*[last()]"/>
- </xsl:template>
-
-<!-- COUNTING MODE -->
-
-<!-- BASIC OPERATORS -->
-
- <xsl:template match="m:apply[m:and|m:or|m:eq|m:neq|m:leq|m:lt
- |m:geq|m:gt|m:plus|m:times|m:divide]">
- <xsl:param name="current_indent" select="0"/>
- <xsl:param name="width" select="$framewidth"/>
- <xsl:variable name="uri"><xsl:value-of select="*[1]/@definitionURL"/></xsl:variable>
- <xsl:variable name="charlength">
- <xsl:apply-templates select="*[1]" mode="charcount"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$charlength > $framewidth">
- <xsl:text>(</xsl:text>
- <xsl:apply-templates select="*[2]">
- <xsl:with-param name="current_indent" select="$current_indent + 2"/>
- </xsl:apply-templates>
- <BR/>
- <xsl:call-template name="make_indent">
- <xsl:with-param name="current_indent" select="$current_indent + 2"/>
- </xsl:call-template>
- <xsl:choose>
- <xsl:when test="$uri != ''">
- <a href="{$uri}">
- <xsl:call-template name="mksymbol-init">
- <xsl:with-param name="symbol" select="local-name(*[1])"/>
- </xsl:call-template>
- </a>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="mksymbol-init">
- <xsl:with-param name="symbol" select="local-name(*[1])"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:apply-templates select="*[3]">
- <xsl:with-param name="current_indent" select="$current_indent + 2"/>
- </xsl:apply-templates>
- <xsl:text>)</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates mode="inline" select="."/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
-<!-- MINUS (can be unary!) -->
-
-<xsl:template match="m:apply[m:minus]">
- <xsl:param name="current_indent" select="0"/>
- <xsl:param name="width" select="$framewidth"/>
- <xsl:variable name="uri"><xsl:value-of select="*[1]/@definitionURL"/></xsl:variable>
- <xsl:choose>
- <xsl:when test="count(child::*)=2">
- <xsl:choose>
- <xsl:when test="$uri != ''">
- <a href="{$uri}">
- <xsl:call-template name="mksymbol-init">
- <xsl:with-param name="symbol" select="'minus'"/>
- </xsl:call-template>
- </a>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="mksymbol-init">
- <xsl:with-param name="symbol" select="'minus'"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:apply-templates select="*[2]">
- <xsl:with-param name="current_indent" select="$current_indent + 1"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="charlength">
- <xsl:apply-templates select="*[1]" mode="charcount"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$charlength > $framewidth">
- <xsl:text>(</xsl:text>
- <xsl:apply-templates select="*[2]">
- <xsl:with-param name="current_indent" select="$current_indent + 2"/>
- </xsl:apply-templates>
- <BR/>
- <xsl:call-template name="make_indent">
- <xsl:with-param name="current_indent" select="$current_indent + 2"/>
- </xsl:call-template>
- <xsl:choose>
- <xsl:when test="$uri != ''">
- <a href="{$uri}">
- <xsl:call-template name="mksymbol-init">
- <xsl:with-param name="symbol" select="'minus'"/>
- </xsl:call-template>
- </a>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="mksymbol-init">
- <xsl:with-param name="symbol" select="'minus'"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:apply-templates select="*[3]">
- <xsl:with-param name="current_indent" select="$current_indent + 2"/>
- </xsl:apply-templates>
- <xsl:text>)</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates mode="inline" select="."/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
-<!-- NOT -->
-
-<xsl:template match="m:apply[m:not]">
- <xsl:param name="current_indent" select="0"/>
- <xsl:param name="width" select="$framewidth"/>
- <xsl:variable name="uri"><xsl:value-of select="m:not/@definitionURL"/></xsl:variable>
- <xsl:choose>
- <xsl:when test="$uri != ''">
- <a href="{$uri}">
- <xsl:call-template name="mksymbol-init">
- <xsl:with-param name="symbol" select="'not'"/>
- </xsl:call-template>
- </a>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="mksymbol-init">
- <xsl:with-param name="symbol" select="'not'"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:apply-templates select="*[2]"/>
- </xsl:template>
-
-<!-- EXISTS -->
-
- <xsl:template match="m:apply[m:exists]">
- <xsl:param name="current_indent" select="0"/>
- <xsl:param name="width" select="$framewidth"/>
- <xsl:variable name="uri"><xsl:value-of select="m:exists/@definitionURL"/></xsl:variable>
- <xsl:variable name="charlength">
- <xsl:apply-templates select="m:exists" mode="charcount"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$charlength > $framewidth">
- <xsl:choose>
- <xsl:when test="$uri != ''">
- <a href="{$uri}">
- <xsl:call-template name="mksymbol-init">
- <xsl:with-param name="symbol" select="'exists'"/>
- </xsl:call-template>
- </a>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="mksymbol-init">
- <xsl:with-param name="symbol" select="'exists'"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:apply-templates select="m:bvar/m:ci"/>
- <xsl:text>:</xsl:text>
- <xsl:apply-templates select="m:condition">
- <xsl:with-param name="current_indent" select="$current_indent + 2 +
- string-length(bvar/ci)"/>
- </xsl:apply-templates>
- <BR/>
- <xsl:call-template name="make_indent">
- <xsl:with-param name="current_indent" select="$current_indent + 2"/>
- </xsl:call-template>
- <xsl:text>.</xsl:text>
- <xsl:apply-templates select="*[last()]">
- <xsl:with-param name="current_indent" select="$current_indent + 2"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates mode="inline" select="."/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
-
-<!-- COUNTING -->
-
-<xsl:template match="m:cn|m:and|m:or|m:not|m:exists|m:eq|m:neq
- |m:lt|m:leq|m:gt|m:geq|m:plus|m:minus|m:times" mode="charcount">
-<xsl:param name="incurrent_length" select="0"/>
- <xsl:choose>
- <xsl:when test="$framewidth >= ($incurrent_length + string-length())">
- <xsl:variable name="siblength"><xsl:apply-templates select="following-sibling::*[position()=1]" mode="charcount"><xsl:with-param name="incurrent_length" select="$incurrent_length + string-length()"/></xsl:apply-templates></xsl:variable>
- <xsl:choose>
- <xsl:when test="string($siblength) = """>
- <xsl:value-of select="$incurrent_length + string-length()"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="number($siblength)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$incurrent_length + string-length()"/>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-</xsl:stylesheet>
+++ /dev/null
-<?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/. -->
-
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:m="http://www.w3.org/1998/Math/MathML">
-
-<!--***********************************************************************-->
-<!-- INIT style for HTML -->
-<!-- HELM Group: Asperti, Padovani, Sacerdoti, Schena -->
-<!--***********************************************************************-->
-
-<xsl:template name="mksymbol-reals">
- <xsl:param name="symbol" select="''"/>
- <xsl:choose>
- <xsl:when test="$UNICODEvsSYMBOL = 'symbol'">
- <xsl:variable name="fontsymbol">
- <xsl:choose>
- <xsl:when test="$symbol = 'leadsto'">
- <xsl:value-of select="'®'"/>
- </xsl:when>
- <xsl:when test="$symbol = 'sum'">
- <xsl:value-of select="'å'"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>???</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <FONT FACE="symbol" color="'blue'">
- <xsl:value-of select="$fontsymbol"/>
- </FONT>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="unicodesymbol">
- <xsl:choose>
- <xsl:when test="$symbol = 'leadsto'">
- <xsl:value-of select="'→'"/>
- </xsl:when>
- <xsl:when test="$symbol = 'sum'">
- <xsl:value-of select="'∑'"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>???</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <FONT color="'blue'">
- <xsl:value-of select="$unicodesymbol"/>
- </FONT>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<!-- **************************************************************** -->
-<!-- INLINE MODE -->
-<!-- **************************************************************** -->
-
-<!-- SUM -->
-
-<xsl:template mode="inline" match="m:apply[m:sum]">
- <xsl:variable name="uri">
- <xsl:value-of select="m:sum/@definitionURL"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$uri != ''">
- <a href="{$uri}">
- <!--
- <FONT FACE="symbol" color="'blue'">
- <xsl:value-of select="'å'"/>
- </FONT> -->
- <xsl:call-template name="mksymbol-reals">
- <xsl:with-param name="symbol" select="'sum'"/>
- </xsl:call-template>
- </a>
- </xsl:when>
- <xsl:otherwise>
- <!--
- <FONT FACE="symbol" color="'blue'">
- <xsl:value-of select="'å'"/>
- </FONT> -->
- <xsl:call-template name="mksymbol-reals">
- <xsl:with-param name="symbol" select="'sum'"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test="m:condition">
- <SUB>
- <xsl:apply-templates select="m:condition"/>
- </SUB>
- </xsl:when>
- <xsl:otherwise>
- <SUB>
- <xsl:apply-templates select="m:lowlimit/*[1]"/>
- <xsl:call-template name="mksymbol-init">
- <xsl:with-param name="symbol" select="'leq'"/>
- </xsl:call-template>
- <xsl:apply-templates select="m:bvar/*[1]"/>
- <xsl:call-template name="mksymbol-init">
- <xsl:with-param name="symbol" select="'leq'"/>
- </xsl:call-template>
- <xsl:apply-templates select="m:uplimit/*[1]"/>
- </SUB>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:apply-templates mode="inline" select="*[position()=last()]"/>
- </xsl:template>
-
-
-<!-- LIMIT -->
-
-
-<xsl:template mode="inline" match="m:apply[m:limit]">
- <xsl:variable name="uri"><xsl:value-of select="m:limit/@definitionURL"/></xsl:variable>
- <xsl:choose>
- <xsl:when test="$uri != ''">
- <a href="{$uri}">
- <xsl:text>lim</xsl:text>
- </a>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>lim</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- <SUB>
- <xsl:apply-templates select="m:bvar/m:ci"/>
- <xsl:call-template name="mksymbol-reals">
- <xsl:with-param name="symbol" select="'leadsto'"/>
- </xsl:call-template>
- <xsl:apply-templates mode="inline" select="m:lowlimit"/>
- </SUB>
- <xsl:apply-templates mode="inline" select="*[4]"/>
- </xsl:template>
-
-<!-- DIFFERENTIATION -->
-
-<xsl:template mode="inline" match="m:apply[m:diff]">
- <xsl:variable name="uri"><xsl:value-of select="m:diff/@definitionURL"/></xsl:variable>
- <xsl:choose>
- <xsl:when test="$uri != ''">
- <a href="{$uri}">
- <SUP>d</SUP>
- <xsl:text>/</xsl:text>
- <SUB>
- <xsl:text>d</xsl:text>
- <xsl:value-of select="m:bvar/m:ci"/>
- </SUB>
- </a>
- </xsl:when>
- <xsl:otherwise>
- <SUP>d</SUP>
- <xsl:text>/</xsl:text>
- <SUB>
- <xsl:text>d</xsl:text>
- <xsl:value-of select="m:bvar/m:ci"/>
- </SUB>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:apply-templates mode="inline" select="*[3]"/>
- </xsl:template>
-
-<!-- ABSOLUTE VALUE -->
-<xsl:template mode="inline" match="m:apply[m:abs]">
- <xsl:variable name="uri">
- <xsl:value-of select="m:abs/@definitionURL"/>
- </xsl:variable>
- <xsl:text>|</xsl:text>
- <xsl:apply-templates mode="inline" select="*[2]"/>
- <xsl:text>|</xsl:text>
-</xsl:template>
-
-<!-- FACTORIAL -->
-
-<xsl:template mode="inline" match="m:apply[m:fact]">
- <xsl:variable name="uri">
- <xsl:value-of select="m:abs/@definitionURL"/>
- </xsl:variable>
- <xsl:apply-templates mode="inline" select="*[2]"/>
- <xsl:text>!</xsl:text>
-</xsl:template>
-
-<!-- SQUARE ROOT -->
-
-<xsl:template match="m:apply[m:root]">
- <xsl:variable name="uri">
- <xsl:value-of select="m:abs/@definitionURL"/>
- </xsl:variable>
- <xsl:text>(sqr</xsl:text>
- <xsl:apply-templates mode="inline" select="*[2]"/>
- <xsl:text>)</xsl:text>
-</xsl:template>
-
-<!-- POWER -->
-
-<xsl:template mode="inline" match="m:apply[m:power]">
- <xsl:variable name="uri">
- <xsl:value-of select="m:power/@definitionURL"/>
- </xsl:variable>
- <xsl:apply-templates mode="inline" select="*[2]"/>
- <SUP>
- <xsl:apply-templates mode="inline" select="*[3]"/>
- </SUP>
-</xsl:template>
-
-<!-- MIN and MAX (binari: estendere) -->
-
- <xsl:template mode="inline" match="m:apply[m:min|m:max]">
- <xsl:variable name="uri"><xsl:value-of select="*[1]/@definitionURL"/></xsl:variable>
- <xsl:variable name="symbol">
- <xsl:choose>
- <xsl:when test="m:min">
- <xsl:value-of select="'min'"/>
- </xsl:when>
- <xsl:when test="m:max">
- <xsl:value-of select="'max'"/>
- </xsl:when>
- </xsl:choose>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$uri != ''">
- <a href="{$uri}">
- <xsl:value-of select="$symbol"/>
- </a>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$symbol"/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:text>{</xsl:text>
- <xsl:apply-templates mode="inline" select="*[2]"/>
- <xsl:text>, </xsl:text>
- <xsl:apply-templates mode="inline" select="*[3]"/>
- <xsl:text>}</xsl:text>
-</xsl:template>
-
-<!-- **************************************************************** -->
-<!-- COUNTING MODE -->
-<!-- **************************************************************** -->
-
-<xsl:template match="m:apply[m:sum]">
- <xsl:apply-templates mode="inline" select="."/>
-</xsl:template>
-
-<xsl:template match="m:apply[m:limit]">
- <xsl:param name="current_indent" select="0"/>
- <xsl:param name="width" select="$framewidth"/>
- <xsl:variable name="uri"><xsl:value-of select="m:limit/@definitionURL"/></xsl:variable>
- <xsl:variable name="charlength">
- <xsl:apply-templates select="m:limit" mode="charcount"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$charlength > $framewidth">
- <xsl:choose>
- <xsl:when test="$uri != ''">
- <a href="{$uri}">
- <xsl:text>lim</xsl:text>
- </a>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>lim</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- <SUB>
- <xsl:apply-templates select="m:bvar/m:ci"/>
- <xsl:call-template name="mksymbol-reals">
- <xsl:with-param name="symbol" select="'leadsto'"/>
- </xsl:call-template>
- <xsl:apply-templates select="m:lowlimit"/>
- </SUB>
- <BR/>
- <xsl:call-template name="make_indent">
- <xsl:with-param name="current_indent" select="$current_indent + 5"/>
- </xsl:call-template>
- <xsl:apply-templates select="*[4]">
- <xsl:with-param name="current_indent" select="$current_indent + 5"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates mode="inline" select="."/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
-<!-- DIFFERENTIATION -->
-<xsl:template match="m:apply[m:diff]">
- <xsl:param name="current_indent" select="0"/>
- <xsl:param name="width" select="$framewidth"/>
- <xsl:variable name="uri"><xsl:value-of select="m:diff/@definitionURL"/></xsl:variable>
- <xsl:choose>
- <xsl:when test="$uri != ''">
- <a href="{$uri}">
- <SUP>d</SUP>
- <xsl:text>/</xsl:text>
- <SUB>
- <xsl:text>d</xsl:text>
- <xsl:value-of select="m:bvar/m:ci"/>
- </SUB>
- </a>
- </xsl:when>
- <xsl:otherwise>
- <SUP>d</SUP>
- <xsl:text>/</xsl:text>
- <SUB>
- <xsl:text>d</xsl:text>
- <xsl:value-of select="m:bvar/m:ci"/>
- </SUB>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:apply-templates select="*[3]">
- <xsl:with-param name="current_indent" select="$current_indent + 5"/>
- </xsl:apply-templates>
- </xsl:template>
-
-
-<!-- ABSOLUTE VALUE -->
-<xsl:template match="m:apply[m:abs]">
- <xsl:param name="current_indent" select="0"/>
- <xsl:param name="width" select="$framewidth"/>
- <xsl:variable name="uri">
- <xsl:value-of select="m:abs/@definitionURL"/>
- </xsl:variable>
- <xsl:text>|</xsl:text>
- <xsl:apply-templates select="*[2]">
- <xsl:with-param name="current_indent" select="$current_indent + 2"/>
- </xsl:apply-templates>
- <xsl:text>|</xsl:text>
- </xsl:template>
-
-<!-- FACTORIAL -->
-
-<xsl:template match="m:apply[m:fact]">
- <xsl:param name="current_indent" select="0"/>
- <xsl:param name="width" select="$framewidth"/>
- <xsl:variable name="uri">
- <xsl:value-of select="m:abs/@definitionURL"/>
- </xsl:variable>
- <xsl:apply-templates select="*[2]">
- <xsl:with-param name="current_indent" select="$current_indent + 2"/>
- </xsl:apply-templates>
- <xsl:text>!</xsl:text>
- </xsl:template>
-
-<!-- SQUARE ROOT -->
-
-<xsl:template match="m:apply[m:root]">
- <xsl:param name="current_indent" select="0"/>
- <xsl:param name="width" select="$framewidth"/>
- <xsl:variable name="uri">
- <xsl:value-of select="m:abs/@definitionURL"/>
- </xsl:variable>
- <xsl:text>(sqr</xsl:text>
- <xsl:apply-templates select="*[2]">
- <xsl:with-param name="current_indent" select="$current_indent + 5"/>
- </xsl:apply-templates>
- <xsl:text>)</xsl:text>
- </xsl:template>
-
-<!-- POWER -->
-
-<xsl:template match="m:apply[m:power]">
- <xsl:param name="current_indent" select="0"/>
- <xsl:param name="width" select="$framewidth"/>
- <xsl:variable name="uri">
- <xsl:value-of select="m:power/@definitionURL"/>
- </xsl:variable>
- <xsl:apply-templates select="*[2]"/>
- <SUP>
- <xsl:apply-templates select="*[3]"/>
- </SUP>
- </xsl:template>
-
-<!-- MIN and MAX (binari: estendere) -->
-
- <xsl:template match="m:apply[m:min|m:max]">
- <xsl:param name="current_indent" select="0"/>
- <xsl:param name="width" select="$framewidth"/>
- <xsl:variable name="uri"><xsl:value-of select="*[1]/@definitionURL"/></xsl:variable>
- <xsl:variable name="charlength">
- <xsl:apply-templates select="*[1]" mode="charcount"/>
- </xsl:variable>
- <xsl:variable name="symbol">
- <xsl:choose>
- <xsl:when test="m:min">
- <xsl:value-of select="'min'"/>
- </xsl:when>
- <xsl:when test="m:max">
- <xsl:value-of select="'max'"/>
- </xsl:when>
- </xsl:choose>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$charlength > $framewidth">
- <xsl:choose>
- <xsl:when test="$uri != ''">
- <a href="{$uri}">
- <xsl:value-of select="$symbol"/>
- </a>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$symbol"/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:text>{</xsl:text>
- <xsl:apply-templates select="*[2]">
- <xsl:with-param name="current_indent" select="$current_indent + 2"/>
- </xsl:apply-templates>
- <xsl:text>,</xsl:text>
- <BR/>
- <xsl:call-template name="make_indent">
- <xsl:with-param name="current_indent" select="$current_indent + 5"/>
- </xsl:call-template>
- <xsl:apply-templates select="*[3]">
- <xsl:with-param name="current_indent" select="$current_indent + 2"/>
- </xsl:apply-templates>
- <xsl:text>}</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates mode="inline" select="."/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
-<!-- COUNTING -->
-
-<xsl:template match="m:abs|m:fact|m:root|
- m:sum|m:limit|m:diff|m:min|m:max" mode="charcount">
-<xsl:param name="incurrent_length" select="0"/>
- <xsl:choose>
- <xsl:when test="$framewidth >= ($incurrent_length + string-length())">
- <xsl:variable name="siblength"><xsl:apply-templates select="following-sibling::*[position()=1]" mode="charcount"><xsl:with-param name="incurrent_length" select="$incurrent_length + string-length()"/></xsl:apply-templates></xsl:variable>
- <xsl:choose>
- <xsl:when test="string($siblength) = """>
- <xsl:value-of select="$incurrent_length + string-length()"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="number($siblength)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$incurrent_length + string-length()"/>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-</xsl:stylesheet>
+++ /dev/null
-<?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/. -->
-
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:m="http://www.w3.org/1998/Math/MathML">
-
-<!--***********************************************************************-->
-<!-- INIT style for HTML -->
-<!-- HELM Group: Asperti, Padovani, Sacerdoti, Schena -->
-<!--***********************************************************************-->
-
-<xsl:template name="mksymbol">
- <xsl:param name="symbol" select="''"/>
- <xsl:choose>
- <xsl:when test="$UNICODEvsSYMBOL = 'symbol'">
- <xsl:variable name="fontsymbol">
- <xsl:choose>
- <xsl:when test="$symbol = 'emptyset'">
- <xsl:value-of select="'Æ'"/>
- </xsl:when>
- <xsl:when test="$symbol = 'in'">
- <xsl:value-of select="'Î'"/>
- </xsl:when>
- <xsl:when test="$symbol = 'notin'">
- <xsl:value-of select="'Ï'"/>
- </xsl:when>
- <xsl:when test="$symbol = 'intersect'">
- <xsl:value-of select="'Ç'"/>
- </xsl:when>
- <xsl:when test="$symbol = 'union'">
- <xsl:value-of select="'È'"/>
- </xsl:when>
- <xsl:when test="$symbol = 'subset'">
- <xsl:value-of select="'Í'"/>
- </xsl:when>
- <xsl:when test="$symbol = 'prsubset'">
- <xsl:value-of select="'Ì'"/>
- </xsl:when>
- <xsl:when test="$symbol = 'setdiff'">
- <xsl:value-of select="'/'"/>
- </xsl:when>
- </xsl:choose>
- </xsl:variable>
- <FONT FACE="symbol" mathcolor="blue">
- <xsl:value-of select="$fontsymbol"/>
- </FONT>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="unicodesymbol">
- <xsl:choose>
- <xsl:when test="$symbol = 'emptyset'">
- <xsl:value-of select="'∅'"/>
- </xsl:when>
- <xsl:when test="$symbol = 'in'">
- <xsl:value-of select="'∈'"/>
- </xsl:when>
- <xsl:when test="$symbol = 'notin'">
- <xsl:value-of select="'∉'"/>
- </xsl:when>
- <xsl:when test="$symbol = 'intersect'">
- <xsl:value-of select="'∩'"/>
- </xsl:when>
- <xsl:when test="$symbol = 'union'">
- <xsl:value-of select="'∪'"/>
- </xsl:when>
- <xsl:when test="$symbol = 'subset'">
- <xsl:value-of select="'⊆'"/>
- </xsl:when>
- <xsl:when test="$symbol = 'prsubset'">
- <xsl:value-of select="'⊂'"/>
- </xsl:when>
- <xsl:when test="$symbol = 'setdiff'">
- <xsl:value-of select="'/'"/>
- </xsl:when>
- </xsl:choose>
- </xsl:variable>
- <xsl:value-of select="$unicodesymbol"/>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<!-- **************************************************************** -->
-<!-- INLINE MODE -->
-<!-- **************************************************************** -->
-
-<!-- SET -->
-
- <xsl:template mode="inline" match="m:set">
- <xsl:variable name="uri" select="@definitionURL"/>
- <xsl:choose>
- <xsl:when test="count(child::*) = 0">
- <xsl:call-template name="mksymbol">
- <xsl:with-param name="symbol" select="'emptyset'"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="name(*[1]) = 'm:bvar'">
- <xsl:text>{</xsl:text>
- <xsl:apply-templates mode="inline" select="m:bvar/m:ci"/>
- <xsl:text>:</xsl:text>
- <xsl:apply-templates mode="inline" select="m:bvar/m:type"/>
- <xsl:text>|</xsl:text>
- <xsl:apply-templates mode="inline" select="*[position()=2]"/>
- <xsl:text>}</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>{</xsl:text>
- <xsl:for-each select="*">
- <xsl:apply-templates mode="inline" select="."/>
- <xsl:choose>
- <xsl:when test="position() = last()">
- <xsl:text>}</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>,</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
-
-<!-- CARD -->
-<xsl:template mode="inline" match="m:apply[m:card]">
- <xsl:param name="current_indent" select="0"/>
- <xsl:param name="width" select="$framewidth"/>
- <xsl:variable name="uri">
- <xsl:value-of select="m:card/@definitionURL"/>
- </xsl:variable>
- <xsl:text>|</xsl:text>
- <xsl:apply-templates mode="inline" select="*[2]"/>
- <xsl:text>|</xsl:text>
- </xsl:template>
-
-<xsl:template mode="inline" match="m:apply[m:in|m:notin|m:intersect|m:union
- |m:subset|m:prsubset|m:setdiff]">
- <xsl:variable name="uri"><xsl:value-of select="*[1]/@definitionURL"/></xsl:variable>
- <xsl:variable name="symbol">
- <xsl:choose>
- <xsl:when test="m:in">
- <xsl:value-of select="'Î'"/>
- </xsl:when>
- <xsl:when test="m:notin">
- <xsl:value-of select="'Ï'"/>
- </xsl:when>
- <xsl:when test="m:intersect">
- <xsl:value-of select="'Ç'"/>
- </xsl:when>
- <xsl:when test="m:union">
- <xsl:value-of select="'È'"/>
- </xsl:when>
- <xsl:when test="m:subset">
- <xsl:value-of select="'Í'"/>
- </xsl:when>
- <xsl:when test="m:prsubset">
- <xsl:value-of select="'Ì'"/>
- </xsl:when>
- <xsl:when test="m:setdiff">
- <xsl:value-of select="'/'"/>
- </xsl:when>
- </xsl:choose>
- </xsl:variable>
- <xsl:text>(</xsl:text>
- <xsl:apply-templates mode="inline" select="*[2]"/>
- <xsl:choose>
- <xsl:when test="$uri != ''">
- <a href="{$uri}">
- <xsl:call-template name="mksymbol">
- <xsl:with-param name="symbol">
- <xsl:value-of select="local-name(*[1])"/>
- </xsl:with-param>
- </xsl:call-template>
- </a>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="mksymbol">
- <xsl:with-param name="symbol">
- <xsl:value-of select="local-name(*[1])"/>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:apply-templates mode="inline" select="*[3]"/>
- <xsl:text>)</xsl:text>
- </xsl:template>
-
-<!-- *************************************************************** -->
-
-<xsl:template match="m:apply[m:in|m:notin|m:intersect|m:union
- |m:subset|m:prsubset|m:setdiff]">
- <xsl:param name="current_indent" select="0"/>
- <xsl:param name="width" select="$framewidth"/>
- <xsl:variable name="uri"><xsl:value-of select="*[1]/@definitionURL"/></xsl:variable>
- <xsl:variable name="charlength">
- <xsl:apply-templates select="*[1]" mode="charcount"/>
- </xsl:variable>
- <xsl:variable name="symbol">
- <xsl:choose>
- <xsl:when test="m:in">
- <xsl:value-of select="'Î'"/>
- </xsl:when>
- <xsl:when test="m:notin">
- <xsl:value-of select="'Ï'"/>
- </xsl:when>
- <xsl:when test="m:intersect">
- <xsl:value-of select="'Ç'"/>
- </xsl:when>
- <xsl:when test="m:union">
- <xsl:value-of select="'È'"/>
- </xsl:when>
- <xsl:when test="m:subset">
- <xsl:value-of select="'Í'"/>
- </xsl:when>
- <xsl:when test="m:prsubset">
- <xsl:value-of select="'Ì'"/>
- </xsl:when>
- <xsl:when test="m:setdiff">
- <xsl:value-of select="'/'"/>
- </xsl:when>
- </xsl:choose>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$charlength > $framewidth">
- <xsl:text>(</xsl:text>
- <xsl:apply-templates select="*[2]">
- <xsl:with-param name="current_indent" select="$current_indent + 2"/>
- </xsl:apply-templates>
- <BR/>
- <xsl:call-template name="make_indent">
- <xsl:with-param name="current_indent" select="$current_indent + 2"/>
- </xsl:call-template>
- <xsl:choose>
- <xsl:when test="$uri != ''">
- <a href="{$uri}">
- <xsl:call-template name="mksymbol">
- <xsl:with-param name="symbol">
- <xsl:value-of select="local-name(*[1])"/>
- </xsl:with-param>
- </xsl:call-template>
- </a>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="mksymbol">
- <xsl:with-param name="symbol">
- <xsl:value-of select="local-name(*[1])"/>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:apply-templates select="*[3]">
- <xsl:with-param name="current_indent" select="$current_indent + 2"/>
- </xsl:apply-templates>
- <xsl:text>)</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates mode="inline" select="."/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
-
-<!-- SET -->
-
- <xsl:template match="m:set">
- <xsl:param name="current_indent" select="0"/>
- <xsl:param name="width" select="$framewidth"/>
- <xsl:variable name="uri" select="@definitionURL"/>
- <xsl:choose>
- <xsl:when test="count(child::*) = 0">
- <xsl:call-template name="mksymbol">
- <xsl:with-param name="symbol" select="'emptyset'"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="charlength">
- <xsl:apply-templates select="." mode="charcount"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$charlength > $framewidth">
- <xsl:choose>
- <xsl:when test="name(*[1]) = 'm:bvar'">
- <xsl:text>{</xsl:text>
- <xsl:apply-templates select="m:bvar/m:ci"/>
- <xsl:text>:</xsl:text>
- <xsl:apply-templates select="m:bvar/m:type">
- <xsl:with-param name="current_indent"
- select="$current_indent + 2 + string-length(m:bvar/m:ci)"/>
- </xsl:apply-templates><BR/>
- <xsl:call-template name="make_indent">
- <xsl:with-param name="current_indent" select="$current_indent + 2"/>
- </xsl:call-template>
- <xsl:text>|</xsl:text>
- <xsl:apply-templates select="m:condition">
- <xsl:with-param name="current_indent" select="$current_indent + 2"/>
- </xsl:apply-templates>
- <xsl:text>}</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>{</xsl:text>
- <xsl:apply-templates select="*[position()=1]">
- <xsl:with-param name="current_indent" select="$current_indent + 2"/>
- </xsl:apply-templates>
- <xsl:for-each select="*[position()>1]">
- <xsl:text>,</xsl:text>
- <BR/>
- <xsl:call-template name="make_indent">
- <xsl:with-param name="current_indent" select="$current_indent + 2"/>
- </xsl:call-template>
- <xsl:apply-templates select=".">
- <xsl:with-param name="current_indent" select="$current_indent + 2"/>
- </xsl:apply-templates>
- </xsl:for-each>
- <xsl:text>}</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates mode="inline" select="."/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
-<!-- CARD -->
-<xsl:template match="m:apply[m:card]">
- <xsl:param name="current_indent" select="0"/>
- <xsl:param name="width" select="$framewidth"/>
- <xsl:variable name="uri">
- <xsl:value-of select="m:card/@definitionURL"/>
- </xsl:variable>
- <xsl:text>|</xsl:text>
- <xsl:apply-templates select="*[2]">
- <xsl:with-param name="current_indent" select="$current_indent + 2"/>
- </xsl:apply-templates>
- <xsl:text>|</xsl:text>
- </xsl:template>
-
-<!-- COUNTING -->
-
-<xsl:template match="m:in|m:notin|m:intersect|m:union
- |m:subset|m:prsubset|m:setdiff|m:card" mode="charcount">
-<xsl:param name="incurrent_length" select="0"/>
- <xsl:choose>
- <xsl:when test="$framewidth >= ($incurrent_length + string-length())">
- <xsl:variable name="siblength"><xsl:apply-templates select="following-sibling::*[position()=1]" mode="charcount"><xsl:with-param name="incurrent_length" select="$incurrent_length + string-length()"/></xsl:apply-templates></xsl:variable>
- <xsl:choose>
- <xsl:when test="string($siblength) = """>
- <xsl:value-of select="$incurrent_length + string-length()"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="number($siblength)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$incurrent_length + string-length()"/>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-</xsl:stylesheet>
+++ /dev/null
-<?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/. -->
-
-<!--******************************************************************-->
-<!-- XSLT version 0.1 of CIC inductive objects to MathML content: -->
-<!-- Completely revisited: November 2002, Andrea asperti -->
-<!-- First draft: March 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">
-
-<!-- try_inductive essentially checks if the head constant is an
- invocation of an induction principle.
- Si presuppone che il tipo induttivo non sia mutuamente
- induttivo. Bisognerebbe andare a vedere l'utlimo parametro
- del presunto "principio di induzione", tirare fuori il tipo induttivo
- e vedere se il suo nome coincide con il prefisso di _ind.
- Ad esempio nat_double_ind e' definito dall'utente. L'ultimo
- parametro di nat_double_ind e' di tipo nat, e nat e' diverso
- da nat_double. Per ora, verifico solo l'esistenza di nat_double,
- ma questo, benche' non porti ad errore, non copre tutti i
- casi per quelli mutuamente induttivi -->
-
-
-<xsl:template mode="try_inductive" match="APPLY">
- <xsl:variable name="id" select="@id"/>
- <xsl:variable name="uri">
- <xsl:choose>
- <xsl:when test="name(*[1])='CONST'">
- <xsl:value-of select="*[1]/@uri"/>
- </xsl:when>
- <xsl:otherwise>
- <!-- instantiate -->
- <xsl:value-of select="*[1]/CONST[1]/@uri"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="contains($uri,'_ind.con')">
- <xsl:variable name="ind_uri"
- select="concat(substring-before($uri,'_ind.con'),'.ind')"/>
- <xsl:variable name="InductiveTypeUrl"><xsl:call-template name="URLofURI4getter"><xsl:with-param name="uri" select="$ind_uri"/></xsl:call-template></xsl:variable>
- <xsl:variable name="inductive_def"
- select="document($InductiveTypeUrl)/InductiveDefinition"/>
- <xsl:choose>
- <xsl:when test="$inductive_def">
- <xsl:variable name="ind_name">
- <xsl:call-template name="get_name">
- <xsl:with-param name="uri" select="$uri"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:apply-templates mode="inductive" select=".">
- <xsl:with-param name="uri" select="$uri"/>
- <xsl:with-param name="inductive_def_uri"
- select="$ind_uri"/>
- <xsl:with-param name="inductive_def" select="$inductive_def"/>
- <xsl:with-param name="inductive_def_index" select="1"/>
- <xsl:with-param name="inductive_def_name" select="$ind_name"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="." mode="letin"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="." mode="letin"/>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-
-<xsl:template mode="inductive" match="APPLY">
- <xsl:param name="uri" select="''"/>
- <xsl:param name="inductive_def_uri" select="''"/>
- <xsl:param name="inductive_def" select="/.."/>
- <xsl:param name="inductive_def_index" select="1"/>
- <xsl:param name="inductive_def_name" select="''"/>
- <xsl:variable name="InductiveTypeUrl"><xsl:call-template name="URLofURI4getter"><xsl:with-param name="uri" select="$uri"/></xsl:call-template></xsl:variable>
- <!-- expected_args_type contains the types of the arguments expected by
- the induction principle -->
- <xsl:variable name="expected_args_types"
- select="document($InductiveTypeUrl)/ConstantType/PROD/decl/*[1]"/>
- <xsl:variable name="no_expected_args" select="count($expected_args_types)"/>
- <xsl:variable name="actual_arguments" select="*[position()>1]"/>
- <!-- First check that the induction principle is applied to the
- expected number of arguments -->
- <xsl:choose>
- <xsl:when test="$no_expected_args = count($actual_arguments)">
- <!-- Now check that each actual argument starts with the
- expected number of lambda abstractions -->
- <xsl:variable name="argsOK">
- <xsl:call-template name="check_args">
- <xsl:with-param name="arg_types" select="$expected_args_types"/>
- <xsl:with-param name="actual_args" select="$actual_arguments"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:choose>
- <!-- il semplice test $argsOK non funziona -->
- <xsl:when test="string($argsOK) = 'true'">
- <!-- arguments are in the expected form: we create a
- "by_induction" content element -->
- <!-- no_params is the number of parameters in square brackets -->
- <xsl:variable name="no_params"
- select="$inductive_def/@noParams"/>
- <!-- the inductive property is the first argument following
- the parameters -->
- <xsl:variable name="inductive_property"
- select="$actual_arguments[1 + $no_params]"/>
- <xsl:variable name="tail_args"
- select="$actual_arguments[position()> (1 + $no_params)]"/>
- <!-- inductive_type contains the right inductive type in the
- mutual inductive definition -->
- <xsl:variable name="inductive_type"
- select="$inductive_def/InductiveType[position()=$inductive_def_index]"/>
- <xsl:variable name="no_constructors"
- select="count($inductive_type/Constructor)"/>
- <!-- each case has a single argument -->
- <xsl:variable name="args_for_cases"
- select="$tail_args[($no_constructors + 1) > position()]"/>
- <!-- extra_args contains the remaining arguments; the LAST one
- of them is the argument we are inductively arguing on -->
- <xsl:variable name="extra_args"
- select="$tail_args[position()> $no_constructors]"/>
- <m:apply>
- <m:csymbol>by_induction</m:csymbol>
- <!-- the first (i.e. second) argument of by_induction
- is the uri of the inductive definition -->
- <m:ci><xsl:value-of select="$inductive_def_uri"/></m:ci>
- <!-- next, we have the inductive property, currently not
- used for rendering (it could be omitted ??) -->
- <xsl:apply-templates mode="pure" select="$inductive_property"/>
- <!-- each case has its own "inductive_case" element -->
- <!-- the inductive case element is composed by:
- * "case_lhs" element, containing the constructor name applied
- to its arguments. The arguments are abstraction variables
- (with types) got form the initial lambdas of the argument
- for the case.
- * "induction_hypothesis" element, containg the induction
- hypothesis. Again, these are abstraction variables
- (with types) got form the initial lambdas of the argument
- for the case.
- * body of the case, without specific markup.
- -->
- <xsl:for-each select="$inductive_type/Constructor">
- <xsl:variable name="pos" select="position()"/>
- <xsl:variable name="current_arg"
- select="$args_for_cases[position()=$pos]"/>
- <m:apply>
- <m:csymbol>inductive_case</m:csymbol>
- <m:apply>
- <m:csymbol>case_lhs</m:csymbol>
- <m:ci definitionURL="{$inductive_def_uri}">
- <xsl:value-of select="@name"/>
- </m:ci>
- <xsl:call-template name="get_constructor_args">
- <xsl:with-param name="constructor_args"
- select="PROD/decl[position()> $no_params]"/>
- <xsl:with-param name="actual_args"
- select="$current_arg/decl"/>
- <xsl:with-param name="inductive_def_uri"
- select="$inductive_def_uri"/>
- </xsl:call-template>
- </m:apply>
- <m:apply>
- <m:csymbol>induction_hypothesis</m:csymbol>
- <xsl:call-template name="get_induction_hypothesis">
- <xsl:with-param name="constructor_args"
- select="PROD/decl[position()> $no_params]"/>
- <xsl:with-param name="actual_args"
- select="$current_arg/decl"/>
- <xsl:with-param name="inductive_def_uri"
- select="$inductive_def_uri"/>
- </xsl:call-template>
- </m:apply>
- <xsl:choose>
- <xsl:when test="count(PROD/decl) > $no_params">
- <!-- in this case the actual_arg must be a LAMBDA -->
- <xsl:call-template name="get_body">
- <xsl:with-param name="constructor_args"
- select="PROD/decl[position()>$no_params]"/>
- <xsl:with-param name="actual_args" select="$current_arg/decl"/>
- <xsl:with-param name="inductive_def_uri"
- select="$inductive_def_uri"/>
- <xsl:with-param name="target"
- select="$current_arg/target/*[1]"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates mode="noannot" select="$current_arg"/>
- </xsl:otherwise>
- </xsl:choose>
- </m:apply>
- </xsl:for-each>
- <!-- the inductive argument is the last argument of extra-args -->
- <m:apply>
- <m:csymbol>extra_args</m:csymbol>
- <xsl:apply-templates mode="pure" select="$extra_args"/>
- </m:apply>
- </m:apply>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates mode="letin" select="."/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates mode="letin" select="."/>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<!-- check_args checks that the number of lambda abstractions
- of each actual parameter is GREATER OR EQUAL to the number
- or products of the corresponding formal parameter of the
- induction principles. That is, that each argument is
- sufficiently eta-expanded.
- If this is not the case, not good rendering looks possible.
- Check_args returns a boolean.
- -->
-
-
-<xsl:template name="check_args">
- <xsl:param name="arg_types" select="/.."/>
- <xsl:param name="actual_args" select="/.."/>
- <xsl:param name="bool_var" select="true()"/>
- <!-- <xsl:value-of select="false()"/> -->
- <xsl:choose>
- <xsl:when test="count($arg_types) = 0">
- <xsl:value-of select="$bool_var"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="no_expected_arg_of_arg"
- select="count($arg_types[1]/decl)"/>
- <xsl:variable name="no_actual_abst_of_arg"
- select="count($actual_args[1]/decl)"/>
- <xsl:variable name="test_arg"
- select="($no_actual_abst_of_arg >= $no_expected_arg_of_arg)"/>
- <xsl:call-template name="check_args">
- <xsl:with-param name="arg_types" select="$arg_types[position()>1]"/>
- <xsl:with-param name="actual_args" select="$actual_args[position()>1]"/>
- <xsl:with-param name="bool_var" select="($bool_var and $test_arg)"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-
-<!-- The following three functions are essentially identical
- in their recursive structure.
- The problem is that of decomposing an actual argument for
- a case in three parts:
- * constructor variables
- * induction hypothesis
- * body
- To this aim we must proceed in parallel with the type of
- the constructor: if the type contains a prod, then the
- the corresponding lambda of the argument provides the
- constructor variable. Moreover, if the source type of the
- prod contains a reference to the inductive type, it is a
- recursive argument and the NEXT lambda of the argument
- provides an induction hypothesis.
- Unfortunately the three functions cannot be merged into a
- single one without a conversion from document tree fragments
- to node-sets.
--->
-
-<xsl:template name="get_constructor_args">
- <xsl:param name="constructor_args" select="/.."/>
- <xsl:param name="actual_args" select="/.."/>
- <xsl:param name="inductive_def_uri" select="''"/>
- <xsl:if test="$constructor_args">
- <m:bvar>
- <m:ci><xsl:value-of select="$actual_args[1]/@binder"/></m:ci>
- <m:type>
- <xsl:apply-templates mode="pure" select="$actual_args[1]/*"/>
- </m:type>
- </m:bvar>
- <xsl:choose>
- <xsl:when test="$constructor_args[1]//MUTIND[@uri=$inductive_def_uri]">
- <xsl:call-template name="get_constructor_args">
- <xsl:with-param name="constructor_arity"
- select="$constructor_args[position()>1]"/>
- <xsl:with-param name="actual_args"
- select="$actual_args[position()>2]"/>
- <xsl:with-param name="inductive_def_uri"
- select="$inductive_def_uri"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="get_constructor_args">
- <xsl:with-param name="constructor_args"
- select="$constructor_args[position()>1]"/>
- <xsl:with-param name="actual_args"
- select="$actual_args[position()>1]"/>
- <xsl:with-param name="inductive_def_uri"
- select="$inductive_def_uri"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
-</xsl:template>
-
-<xsl:template name="get_induction_hypothesis">
- <xsl:param name="constructor_args" select="/.."/>
- <xsl:param name="actual_args" select="/.."/>
- <xsl:param name="inductive_def_uri" select="''"/>
- <xsl:if test="$constructor_args">
- <xsl:choose>
- <xsl:when test="$constructor_args[1]//MUTIND[@uri=$inductive_def_uri]">
- <m:bvar>
- <m:ci>
- <xsl:value-of select="$actual_args[2]/@binder"/>
- </m:ci>
- <m:type>
- <xsl:apply-templates mode="pure"
- select="$actual_args[2]/*"/>
- </m:type>
- </m:bvar>
- <xsl:call-template name="get_induction_hypothesis">
- <xsl:with-param name="constructor_args"
- select="$constructor_args[position()>1]"/>
- <xsl:with-param name="actual_args"
- select="$actual_args[position()>2]"/>
- <xsl:with-param name="inductive_def_uri"
- select="$inductive_def_uri"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="get_induction_hypothesis">
- <xsl:with-param name="constructor_args"
- select="$constructor_args[position()>1]"/>
- <xsl:with-param name="actual_args"
- select="$actual_args[position()>1]"/>
- <xsl:with-param name="inductive_def_uri"
- select="$inductive_def_uri"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
-</xsl:template>
-
-<xsl:template name="get_body">
- <xsl:param name="constructor_args" select="/.."/>
- <xsl:param name="actual_args" select="/.."/>
- <xsl:param name="inductive_def_uri" select="''"/>
- <xsl:param name="target" select="/.."/>
- <xsl:choose>
- <xsl:when test="$constructor_args">
- <xsl:choose>
- <xsl:when test="$constructor_args[1]//MUTIND[@uri=$inductive_def_uri]">
- <xsl:call-template name="get_body">
- <xsl:with-param name="constructor_args"
- select="$constructor_args[position()> 1]"/>
- <xsl:with-param name="actual_args"
- select="$actual_args[position()> 2]"/>
- <xsl:with-param name="inductive_def_uri"
- select="$inductive_def_uri"/>
- <xsl:with-param name="target"
- select="$target"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="get_body">
- <xsl:with-param name="constructor_args"
- select="$constructor_args[position()> 1]"/>
- <xsl:with-param name="actual_args"
- select="$actual_args[position()> 1]"/>
- <xsl:with-param name="inductive_def_uri"
- select="$inductive_def_uri"/>
- <xsl:with-param name="target"
- select="$target"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="$actual_args">
- <xsl:apply-templates select="$actual_args[1]" mode="lambda_prop"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates mode="noannot" select="$target"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-</xsl:stylesheet>
+++ /dev/null
-<?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/. -->
-
-<!--******************************************************************-->
-<!-- If the else -->
-<!-- (completely) Revisited: november 2002, Andrea Asperti -->
-<!-- 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">
-
-<xsl:template match="MUTCASE[@uriType='cic:/Coq/Init/Datatypes/bool.ind']" mode="pure">
- <m:apply helm:xref="{@id}">
- <m:csymbol>ite</m:csymbol>
- <xsl:apply-templates select="inductiveTerm/*[1]" mode="pure"/>
- <xsl:apply-templates select="pattern/*[1]" mode="noannot"/>
- <xsl:apply-templates select="pattern/*[2]" mode="noannot"/>
- </m:apply>
-</xsl:template>
-
-</xsl:stylesheet>
-
-
+++ /dev/null
-<?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/. -->
-
-<!--******************************************************************-->
-<!-- Lambda Calculus -->
-<!-- First draft: March 20 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">
-
-<!-- ************************** LAMBDA ****************************** -->
-
-<!-- subst -->
-<xsl:template match="APPLY[CONST[(attribute::uri='cic:/Rocq/LAMBDA/Terms/subst_rec.con' or attribute::uri='cic:/Rocq/LAMBDA/Substitution/subst_rec_r.con')] and count(child::*) = 4]" mode="pure">
- <m:apply>
- <m:csymbol definitionURL="{CONST/@uri}">subst</m:csymbol>
- <xsl:apply-templates select="*[3]" mode="pure"/>
- <xsl:apply-templates select="*[2]" mode="pure"/>
- <xsl:apply-templates select="*[4]" mode="pure"/>
- </m:apply>
-</xsl:template>
-
-<xsl:template match="APPLY[CONST[(attribute::uri='cic:/Rocq/LAMBDA/Terms/subst.con' or attribute::uri='cic:/Rocq/LAMBDA/Substitution/subst_r.con')] and count(child::*) = 3]" mode="pure">
- <m:apply>
- <m:csymbol definitionURL="{CONST/@uri}">subst</m:csymbol>
- <xsl:apply-templates select="*[2]" mode="pure"/>
- <xsl:apply-templates select="*[3]" mode="pure"/>
- <m:ci>0</m:ci>
- </m:apply>
-</xsl:template>
-
-<!-- lift -->
-<xsl:template match="APPLY[CONST[(attribute::uri='cic:/Rocq/LAMBDA/Terms/lift_rec.con' or attribute::uri='cic:/Rocq/LAMBDA/Substitution/lift_rec_r.con')] and count(child::*) = 4]" mode="pure">
- <m:apply>
- <m:csymbol definitionURL="{CONST/@uri}">lift_with_base</m:csymbol>
- <xsl:apply-templates select="*[2]" mode="pure"/>
- <xsl:apply-templates select="*[3]" mode="pure"/>
- <xsl:apply-templates select="*[4]" mode="pure"/>
- </m:apply>
-</xsl:template>
-
-<xsl:template match="APPLY[CONST[(attribute::uri='cic:/Rocq/LAMBDA/Terms/lift.con' or attribute::uri='cic:/Rocq/LAMBDA/Substitution/lift_r.con')] and count(child::*) = 3]" mode="pure">
- <m:apply>
- <m:csymbol definitionURL="{CONST/@uri}">lift</m:csymbol>
- <xsl:apply-templates select="*[2]" mode="pure"/>
- <xsl:apply-templates select="*[3]" mode="pure"/>
- </m:apply>
-</xsl:template>
-
-<!-- reduction -->
-<xsl:template match="APPLY[MUTIND[(position()='1' and attribute::uri='cic:/Rocq/LAMBDA/Reduction/red1.ind')] and count(child::*) = 3]" mode="pure">
- <m:apply>
- <m:csymbol definitionURL="{MUTIND/@uri}">beta_red1</m:csymbol>
- <xsl:apply-templates select="*[2]" mode="pure"/>
- <xsl:apply-templates select="*[3]" mode="pure"/>
- </m:apply>
-</xsl:template>
-
-<xsl:template match="APPLY[MUTIND[(position()='1' and attribute::uri='cic:/Rocq/LAMBDA/Reduction/red.ind')] and count(child::*) = 3]" mode="pure">
- <m:apply>
- <m:csymbol definitionURL="{MUTIND/@uri}">beta_red</m:csymbol>
- <xsl:apply-templates select="*[2]" mode="pure"/>
- <xsl:apply-templates select="*[3]" mode="pure"/>
- </m:apply>
-</xsl:template>
-
-<xsl:template match="APPLY[MUTIND[(position()='1' and attribute::uri='cic:/Rocq/LAMBDA/Reduction/par_red1.ind')] and count(child::*) = 3]" mode="pure">
- <m:apply>
- <m:csymbol definitionURL="{MUTIND/@uri}">par_beta_red1</m:csymbol>
- <xsl:apply-templates select="*[2]" mode="pure"/>
- <xsl:apply-templates select="*[3]" mode="pure"/>
- </m:apply>
-</xsl:template>
-
-<xsl:template match="APPLY[MUTIND[(position()='1' and attribute::uri='cic:/Rocq/LAMBDA/Reduction/par_red.ind')] and count(child::*) = 3]" mode="pure">
- <m:apply>
- <m:csymbol definitionURL="{MUTIND/@uri}">par_beta_red</m:csymbol>
- <xsl:apply-templates select="*[2]" mode="pure"/>
- <xsl:apply-templates select="*[3]" mode="pure"/>
- </m:apply>
-</xsl:template>
-
-<!-- unmark -->
-
-<xsl:template match="APPLY[CONST[(position()='1' and attribute::uri='cic:/Rocq/LAMBDA/Marks/unmark.con')] and count(child::*) = 2]" mode="pure">
- <m:apply>
- <m:csymbol definitionURL="{CONST/@uri}">forgetful</m:csymbol>
- <xsl:apply-templates select="*[2]" mode="pure"/>
- </m:apply>
-</xsl:template>
-
-<!-- boolean algebra of redexes -->
-
-<xsl:template match="APPLY[MUTIND[(position()='1' and attribute::uri='cic:/Rocq/LAMBDA/Redexes/sub.ind')] and count(child::*) = 3]" mode="pure">
- <m:apply>
- <m:subset definitionURL="{MUTIND/@uri}"/>
- <xsl:apply-templates select="*[2]" mode="pure"/>
- <xsl:apply-templates select="*[3]" mode="pure"/>
- </m:apply>
-</xsl:template>
-
-<xsl:template match="APPLY[MUTIND[(position()='1' and attribute::uri='cic:/Rocq/LAMBDA/Redexes/union.ind')] and count(child::*) = 4]" mode="pure">
- <m:apply>
- <m:eq definitionURL="{MUTIND/@uri}"/>
- <m:apply>
- <m:union definitionURL="{MUTIND/@uri}"/>
- <xsl:apply-templates select="*[2]" mode="pure"/>
- <xsl:apply-templates select="*[3]" mode="pure"/>
- </m:apply>
- <xsl:apply-templates select="*[4]" mode="pure"/>
- </m:apply>
-</xsl:template>
-
-<xsl:template match="APPLY[MUTIND[(position()='1' and attribute::uri='cic:/Rocq/LAMBDA/Redexes/comp.ind')] and count(child::*) = 3]" mode="pure">
- <m:apply>
- <m:csymbol definitionURL="{MUTIND/@uri}">isomorphic</m:csymbol>
- <xsl:apply-templates select="*[2]" mode="pure"/>
- <xsl:apply-templates select="*[3]" mode="pure"/>
- </m:apply>
-</xsl:template>
-
-<xsl:template match="APPLY[MUTIND[(position()='1' and attribute::uri='cic:/Rocq/LAMBDA/Residuals/residuals.ind')] and count(child::*) = 4]" mode="pure">
- <m:apply>
- <m:eq definitionURL="{MUTIND/@uri}"/>
- <m:apply>
- <m:setdiff definitionURL="{MUTIND/@uri}"/>
- <xsl:apply-templates select="*[2]" mode="pure"/>
- <xsl:apply-templates select="*[3]" mode="pure"/>
- </m:apply>
- <xsl:apply-templates select="*[4]" mode="pure"/>
- </m:apply>
-</xsl:template>
-
-</xsl:stylesheet>
+++ /dev/null
-<?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/. -->
-
-<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:xlink="http://www.w3.org/1999/xlink">
-
-<!--***********************************************************************-->
-<!-- From MathML presentation or HTML to themselves with links -->
-<!-- HELM Group: Asperti, Padovani, Sacerdoti, Schena -->
-<!-- First draft: March 16 2001, Irene Schena -->
-<!--***********************************************************************-->
-
-<xsl:import href="links_library.xsl"/>
-
-<xsl:key name="id" use="@id" match="m:*"/>
-
-<xsl:param name="URLs_or_URIs" select="'URLs'"/>
-
-<xsl:template match = "m:semantics">
- <xsl:apply-templates select="*[1]" mode="semantics"/>
-</xsl:template>
-
-<!-- Discharging content markup mantaining the linking info (helm:xref and
-xlink:href) -->
-<xsl:template match = "*" mode="semantics">
- <xsl:copy>
- <xsl:copy-of select="@*"/>
- <xsl:if test="@xref">
- <xsl:variable name="cnode" select="key('id',@xref)"/>
- <xsl:if test="$cnode/@definitionURL">
- <xsl:attribute name="xlink:href">
- <xsl:choose>
- <xsl:when test="$URLs_or_URIs = 'URLs'">
- <xsl:call-template name="makeURL"><xsl:with-param name="uri" select="$cnode/@definitionURL"/></xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$cnode/@definitionURL"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- <!-- xlink:show='other' requires the exact modality to be -->
- <!-- specified in non-xlink markup. The point is that the -->
- <!-- element is already MathML ==> we can't add other -->
- <!-- markup without introducing another new namespace. -->
- <!-- So, for now no markup is used. -->
- <xsl:attribute name="xlink:show">other</xsl:attribute>
- </xsl:if>
- <xsl:if test="$cnode/@helm:xref">
- <xsl:attribute name="helm:xref">
- <xsl:value-of select="$cnode/@helm:xref"/>
- </xsl:attribute>
- </xsl:if>
- </xsl:if>
- <xsl:apply-templates mode="semantics"/>
- </xsl:copy>
-</xsl:template>
-
-<!-- _top to refresh the whole frameset (avoids the matrioska effect ;-) -->
-<!-- a[@href] doesn't match with every anchor elements!!! -->
-<xsl:template match="*[@href]">
- <xsl:copy>
- <xsl:copy-of select="@*"/>
- <xsl:choose>
- <xsl:when test="starts-with(@href,"cic:")">
- <xsl:attribute name="href">
- <xsl:call-template name="makeURL">
- <xsl:with-param name="uri" select="@href"/>
- </xsl:call-template>
- </xsl:attribute>
- <xsl:attribute name="target">cic</xsl:attribute>
- </xsl:when>
- <xsl:when test="starts-with(@href,"theory:")">
- <xsl:attribute name="href">
- <xsl:call-template name="makeTheoryURL">
- <xsl:with-param name="uri" select="@href"/>
- </xsl:call-template>
- </xsl:attribute>
- <xsl:attribute name="target">theory</xsl:attribute>
- </xsl:when>
- <xsl:when test="starts-with(@href,"#")">
- <xsl:attribute name="href"><xsl:value-of select="@href"/></xsl:attribute>
- <xsl:if test="@target">
- <xsl:attribute name="target"><xsl:value-of select="@target"/></xsl:attribute>
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="href"><xsl:value-of select="@href"/></xsl:attribute>
- <xsl:attribute name="target">_blank</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:apply-templates/>
- </xsl:copy>
-</xsl:template>
-
-<xsl:template match = "/|*">
- <xsl:copy>
- <xsl:copy-of select="@*"/>
- <xsl:apply-templates/>
- </xsl:copy>
-</xsl:template>
-
-</xsl:stylesheet>
+++ /dev/null
-<?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/. -->
-
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:m="http://www.w3.org/1998/Math/MathML">
-
-<!--***********************************************************************-->
-<!-- auxiliary functions -->
-<!-- HELM Group: Asperti, Padovani, Sacerdoti, Schena -->
-<!--***********************************************************************-->
-
-<!-- * is used for objects -->
-<!-- th* is used for theories -->
-<!-- embed* is used for objects embedded in theories -->
-
-<xsl:param name="getterURL" select="'http://localhost:8081/'"/>
-<xsl:param name="processorURL" select="'http://localhost:8080/helm/servlet/uwobo/'"/>
-<xsl:param name="draw_graphURL" select="'http://localhost:8083/'"/>
-<xsl:param name="uri_set_queueURL" select="'http://localhost:8084/'"/>
-<xsl:param name="proofcheckerURL" select="'http://localhost:48084/'"/>
-<!-- URL to the frameset (control + output) -->
-<xsl:param name="topurl" select="''"/>
-<xsl:param name="interfaceURL" select="''"/>
-<xsl:param name="thinterfaceURL" select="''"/>
-
-<xsl:param name="keys" select="'C1,HC2,L'"/>
-<xsl:param name="embedkeys" select="'TC1,HC2,L'"/>
-<xsl:param name="thkeys" select="'T1,T2,L,E'"/>
-
-<xsl:param name="naturalLanguage" select="'yes'"/>
-<xsl:param name="annotations" select="'no'"/>
-<xsl:param name="UNICODEvsSYMBOL" select="'symbol'"/>
-
-<xsl:param name="media-type" select="'text/html'"/>
-<xsl:param name="thmedia-type" select="'text/html'"/>
-<xsl:param name="doctype-public" select="'-//W3C//DTD XHTML 1.0 Transitional//EN'"/>
-<xsl:param name="encoding" select="'iso-8859-1'"/>
-<xsl:param name="thencoding" select="'iso-8859-1'"/>
-
-
-<xsl:template name="quote">
- <xsl:param name="s" select="''"/>
- <xsl:param name="news" select="''"/>
- <xsl:choose>
- <xsl:when test="$s = ''"><xsl:value-of select="$news"/></xsl:when>
- <xsl:otherwise>
- <xsl:variable name="char" select="substring($s,1,1)"/>
- <xsl:choose>
- <xsl:when test="$char = ' '">
- <xsl:call-template name="quote">
- <xsl:with-param name="s" select="substring($s,2)"/>
- <xsl:with-param name="news" select="concat($news,'%20')"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="$char = '&'">
- <xsl:call-template name="quote">
- <xsl:with-param name="s" select="substring($s,2)"/>
- <xsl:with-param name="news" select="concat($news,'%26')"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="$char = '?'">
- <xsl:call-template name="quote">
- <xsl:with-param name="s" select="substring($s,2)"/>
- <xsl:with-param name="news" select="concat($news,'%3F')"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="$char = '='">
- <xsl:call-template name="quote">
- <xsl:with-param name="s" select="substring($s,2)"/>
- <xsl:with-param name="news" select="concat($news,'%3D')"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="$char = '%'">
- <xsl:call-template name="quote">
- <xsl:with-param name="s" select="substring($s,2)"/>
- <xsl:with-param name="news" select="concat($news,'%25')"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="$char = ','">
- <xsl:call-template name="quote">
- <xsl:with-param name="s" select="substring($s,2)"/>
- <xsl:with-param name="news" select="concat($news,'%2C')"/>
- </xsl:call-template>
- </xsl:when>
-<!--CSC: This breaks all the rest ;-)
- <xsl:when test="$char = ':'">
- <xsl:call-template name="quote">
- <xsl:with-param name="s" select="substring($s,2)"/>
- <xsl:with-param name="news" select="concat($news,'%3A')"/>
- </xsl:call-template>
- </xsl:when>
--->
- <xsl:otherwise>
- <xsl:call-template name="quote">
- <xsl:with-param name="s" select="substring($s,2)"/>
- <xsl:with-param name="news" select="concat($news,$char)"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:variable name="absPath">
- <xsl:call-template name="quote">
- <xsl:with-param name="s"><xsl:value-of select="$getterURL"/>getxml?uri=</xsl:with-param>
- </xsl:call-template>
-</xsl:variable>
-
-<xsl:variable name="escaped-doctype-public">
- <xsl:call-template name="quote">
- <xsl:with-param name="s" select="$doctype-public"/>
- </xsl:call-template>
-</xsl:variable>
-
-<xsl:variable name="escaped-processorURL">
- <xsl:call-template name="quote">
- <xsl:with-param name="s" select="$processorURL"/>
- </xsl:call-template>
-</xsl:variable>
-
-<xsl:variable name="escaped-getterURL">
- <xsl:call-template name="quote">
- <xsl:with-param name="s" select="$getterURL"/>
- </xsl:call-template>
-</xsl:variable>
-
-<xsl:variable name="escaped-interfaceURL">
- <xsl:call-template name="quote">
- <xsl:with-param name="s" select="$interfaceURL"/>
- </xsl:call-template>
-</xsl:variable>
-
-<xsl:variable name="escaped-topurl">
- <xsl:call-template name="quote">
- <xsl:with-param name="s" select="$topurl"/>
- </xsl:call-template>
-</xsl:variable>
-
-<xsl:variable name="escaped-thinterfaceURL">
- <xsl:call-template name="quote">
- <xsl:with-param name="s" select="$thinterfaceURL"/>
- </xsl:call-template>
-</xsl:variable>
-
-<xsl:variable name="quotedthkeys">
- <xsl:call-template name="quote">
- <xsl:with-param name="s" select="$thkeys"/>
- </xsl:call-template>
-</xsl:variable>
-
-<xsl:variable name="quotedembedkeys">
- <xsl:call-template name="quote">
- <xsl:with-param name="s" select="$embedkeys"/>
- </xsl:call-template>
-</xsl:variable>
-
-<xsl:variable name="quotedkeys">
- <xsl:call-template name="quote">
- <xsl:with-param name="s" select="$keys"/>
- </xsl:call-template>
-</xsl:variable>
-
-<xsl:variable name="quotedquotedkeys">
- <xsl:call-template name="quote">
- <xsl:with-param name="s" select="$quotedkeys"/>
- </xsl:call-template>
-</xsl:variable>
-
-<xsl:variable name="quotedquotedthkeys">
- <xsl:call-template name="quote">
- <xsl:with-param name="s" select="$quotedthkeys"/>
- </xsl:call-template>
-</xsl:variable>
-
-<xsl:variable name="quotedquotedembedkeys">
- <xsl:call-template name="quote">
- <xsl:with-param name="s" select="$quotedembedkeys"/>
- </xsl:call-template>
-</xsl:variable>
-
-<xsl:variable name="header0"><xsl:value-of select="$interfaceURL"/>?url=</xsl:variable>
-<xsl:variable name="thheader0"><xsl:value-of select="$thinterfaceURL"/>?url=</xsl:variable>
-<xsl:variable name="header1"><xsl:value-of select="$escaped-processorURL"/>apply?keys=</xsl:variable>
-<xsl:variable name="bothheader2">&param.naturalLanguage=<xsl:value-of select="$naturalLanguage"/>&param.proofcheckerURL=<xsl:value-of select="$proofcheckerURL"/>&param.draw_graphURL=<xsl:value-of select="$draw_graphURL"/>&param.uri_set_queueURL=<xsl:value-of select="$uri_set_queueURL"/>&param.UNICODEvsSYMBOL=<xsl:value-of select="$UNICODEvsSYMBOL"/>&param.annotations=<xsl:value-of select="$annotations"/>&prop.doctype-public=<xsl:value-of select="$escaped-doctype-public"/>&param.doctype-public=<xsl:value-of select="$escaped-doctype-public"/>&param.encoding=<xsl:value-of select="$encoding"/>&param.media-type=<xsl:value-of select="$media-type"/>&param.keys=<xsl:value-of select="$quotedkeys"/>&param.getterURL=<xsl:value-of select="$escaped-getterURL"/>&param.processorURL=<xsl:value-of select="$escaped-processorURL"/>&param.interfaceURL=<xsl:value-of select="$escaped-interfaceURL"/>&param.topurl=<xsl:value-of select="$escaped-topurl"/>&xmluri=<xsl:value-of select="$absPath"/></xsl:variable>
-<xsl:variable name="header2">&prop.media-type=<xsl:value-of select="$media-type"/>&prop.encoding=<xsl:value-of select="$encoding"/></xsl:variable>
-<xsl:variable name="thheader2">&prop.media-type=<xsl:value-of select="$thmedia-type"/>&param.thmedia-type=<xsl:value-of select="$thmedia-type"/>&param.thkeys=<xsl:value-of select="$quotedthkeys"/>&param.embedkeys=<xsl:value-of select="$quotedembedkeys"/>&param.thinterfaceURL=<xsl:value-of select="$escaped-thinterfaceURL"/>&param.thencoding=<xsl:value-of select="$thencoding"/>&prop.encoding=<xsl:value-of select="$thencoding"/></xsl:variable>
-
-<xsl:variable name="quotedheader1">
- <xsl:call-template name="quote">
- <xsl:with-param name="s" select="$header1"/>
- </xsl:call-template>
-</xsl:variable>
-
-<xsl:variable name="quotedbothheader2">
- <xsl:call-template name="quote">
- <xsl:with-param name="s" select="$bothheader2"/>
- </xsl:call-template>
-</xsl:variable>
-
-<xsl:variable name="quotedheader2">
- <xsl:call-template name="quote">
- <xsl:with-param name="s" select="$header2"/>
- </xsl:call-template>
-</xsl:variable>
-
-<xsl:variable name="quotedthheader2">
- <xsl:call-template name="quote">
- <xsl:with-param name="s" select="$thheader2"/>
- </xsl:call-template>
-</xsl:variable>
-
-<!-- makeURL() maps URIs into URLs -->
-<!-- The target of the URL is the whole frameset -->
-
-<xsl:variable name="biquotedfixedheader">
- <xsl:value-of select="$header0"/>
- <xsl:value-of select="$quotedheader1"/>
- <xsl:value-of select="$quotedquotedkeys"/>
- <xsl:value-of select="$quotedheader2"/>
- <xsl:value-of select="$quotedbothheader2"/>
-</xsl:variable>
-
-<xsl:variable name="biquotedthfixedheader">
- <xsl:value-of select="$thheader0"/>
- <xsl:value-of select="$quotedheader1"/>
- <xsl:value-of select="$quotedquotedthkeys"/>
- <xsl:value-of select="$quotedthheader2"/>
- <xsl:value-of select="$quotedbothheader2"/>
-</xsl:variable>
-
-<!-- NOTE: embedkeys and thkeys are propagated, but we are sure that -->
-<!-- they won't never be used. -->
-<!--CSC: fixare il punto sopra!!! -->
-<!-- type, instead, is not propagated -->
-<xsl:template name="makeURL">
-<xsl:param name="uri" select="''"/>
- <xsl:variable name="uri_after_sharp" select="substring-after($uri,'#')"/>
- <xsl:variable name="cleanuri">
- <xsl:choose>
- <xsl:when test="$uri_after_sharp">
- <xsl:value-of select="substring-before($uri,'#')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$uri"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="sharpsuffix">
- <xsl:choose>
- <xsl:when test="$uri_after_sharp">%23<xsl:value-of select="$uri_after_sharp"/></xsl:when>
- <xsl:otherwise></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:value-of select="$biquotedfixedheader"/>
- <xsl:value-of select="$cleanuri"/>%26param.CICURI%3D<xsl:value-of select="$cleanuri"/>
- <xsl:value-of select="$sharpsuffix"/>
-</xsl:template>
-
-<xsl:template name="makeTheoryURL">
-<xsl:param name="uri" select="''"/>
- <xsl:variable name="uri_after_sharp" select="substring-after($uri,'#')"/>
- <xsl:variable name="cleanuri">
- <xsl:choose>
- <xsl:when test="$uri_after_sharp">
- <xsl:value-of select="substring-before($uri,'#')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$uri"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="sharpsuffix">
- <xsl:choose>
- <xsl:when test="$uri_after_sharp">%23<xsl:value-of select="$uri_after_sharp"/></xsl:when>
- <xsl:otherwise></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:value-of select="$biquotedthfixedheader"/>
- <xsl:value-of select="$cleanuri"/>%26param.CICURI%3D<xsl:value-of select="$cleanuri"/>
- <xsl:value-of select="$sharpsuffix"/>
-</xsl:template>
-
-<!-- makeURL4embedding() maps URIs into URLs -->
-<!-- The target of the URL is only the processed document -->
-
-<xsl:template name="makeURL4embedding">
-<xsl:param name="uri" select="''"/>
-<xsl:param name="type" select="'standalone'"/>
- <xsl:variable name="uri_after_sharp" select="substring-after($uri,'#')"/>
- <xsl:variable name="cleanuri">
- <xsl:choose>
- <xsl:when test="$uri_after_sharp">
- <xsl:value-of select="substring-before($uri,'#')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$uri"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="sharpsuffix">
- <xsl:choose>
- <xsl:when test="$uri_after_sharp">%23<xsl:value-of select="$uri_after_sharp"/></xsl:when>
- <xsl:otherwise></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:value-of select="$header1"/>
- <xsl:value-of select="$quotedembedkeys"/>
- <xsl:value-of select="$header2"/>
- <xsl:value-of select="$bothheader2"/>
- <xsl:value-of select="$cleanuri"/>&param.CICURI=<xsl:value-of select="$cleanuri"/>&param.type=<xsl:value-of select="$type"/><xsl:value-of select="$sharpsuffix"/>
-</xsl:template>
-
-<!-- makeURL4InnerTypes() maps URIs into URLs -->
-<!-- The target of the URL is only the processed document -->
-
-<xsl:template name="makeURL4InnerTypes">
-<xsl:param name="uri" select="''"/>
- <xsl:variable name="uri_after_sharp" select="substring-after($uri,'#')"/>
- <xsl:variable name="cleanuri">
- <xsl:choose>
- <xsl:when test="$uri_after_sharp">
- <xsl:value-of select="substring-before($uri,'#')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$uri"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="sharpsuffix">
- <xsl:choose>
- <xsl:when test="$uri_after_sharp">%23<xsl:value-of select="$uri_after_sharp"/></xsl:when>
- <xsl:otherwise></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:value-of select="$header1"/>d_c&param.getterURL=<xsl:value-of select="$escaped-getterURL"/>&param.CICURI=<xsl:value-of select="$cleanuri"/>&xmluri=<xsl:value-of select="$absPath"/><xsl:value-of select="$cleanuri"/>
- <xsl:value-of select="$sharpsuffix"/>
-</xsl:template>
-
-</xsl:stylesheet>
+++ /dev/null
-<?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 Logic -->
-<!-- (completely) Revisited: november 2002, Andrea Asperti -->
-<!-- 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">
-
-<xsl:template mode="proof_transform" match="APPLY[CONST[attribute::uri='cic:/Coq/Init/Logic/False_ind.con'] and count(child::*) = 3]">
- <xsl:variable name="id" select="@id"/>
- <m:apply helm:xref="{@id}">
- <m:csymbol>false_ind</m:csymbol>
- <m:ci>cic:/Coq/Init/Logic/False_ind.con</m:ci>
- <xsl:apply-templates mode="noannot" select="*[3]"/>
- </m:apply>
-</xsl:template>
-
-
-<xsl:template mode="proof_transform" match="APPLY[CONST[
- attribute::uri='cic:/Coq/Init/Logic/and_ind.con'] and
- count(child::*) = 6 and name(*[5])='LAMBDA' and
- count(*[5]/decl) >= 2]">
- <xsl:variable name="id" select="@id"/>
- <m:apply helm:xref="{@id}">
- <m:csymbol>and_ind</m:csymbol>
- <xsl:apply-templates mode="noannot" select="*[6]"/>
- <m:ci><xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="*[5]/*[1]/@binder"/></xsl:with-param></xsl:call-template></m:ci>
- <xsl:apply-templates mode="pure" select="*[5]/*[1]/*"/>
- <m:ci><xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="*[5]/*[2]/@binder"/></xsl:with-param></xsl:call-template></m:ci>
- <xsl:apply-templates mode="pure" select="*[5]/*[2]/*"/>
- <xsl:choose>
- <xsl:when test="count(*[5]/decl) = 2">
- <xsl:apply-templates mode="noannot" select="*[5]/target/*"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="*[5]/*[3]" mode="lambda_prop"/>
- </xsl:otherwise>
- </xsl:choose>
- </m:apply>
-</xsl:template>
-
-<xsl:template mode="proof_transform" match="APPLY[CONST[
- attribute::uri='cic:/Coq/Init/Logic/or_ind.con']
- and count(child::*) = 7 and
- name(*[5])='LAMBDA' and count(*[5]/decl) = 1 and
- name(*[6])='LAMBDA' and count(*[6]/decl) = 1 ]">
- <xsl:variable name="id" select="@id"/>
- <xsl:variable name="definition_url"
- select="'cic:/Coq/Init/Logic/Disjunction/or.ind'"/>
- <m:apply helm:xref="{@id}">
- <m:csymbol>full_or_ind</m:csymbol>
- <xsl:apply-templates mode="noannot" select="*[7]"/>
- <xsl:for-each select="$InnerTypes">
- <xsl:apply-templates mode="pure" select="key('typeid',$id)/*[1]"/>
- </xsl:for-each>
- <m:apply>
- <m:csymbol>left_case</m:csymbol>
- <m:bvar>
- <m:ci>
- <xsl:value-of select="*[5]/*[1]/@binder"/>
- </m:ci>
- <m:type>
- <xsl:apply-templates mode="pure" select="*[5]/*[1]/*"/>
- </m:type>
- </m:bvar>
- <xsl:apply-templates mode="noannot" select="*[5]/target/*"/>
- </m:apply>
- <m:apply>
- <m:csymbol>right_case</m:csymbol>
- <m:bvar>
- <m:ci>
- <xsl:apply-templates mode="pure" select="*[6]/*[1]/@binder"/>
- </m:ci>
- <m:type>
- <xsl:apply-templates mode="pure" select="*[6]/*[1]/*"/>
- </m:type>
- </m:bvar>
- <xsl:apply-templates mode="noannot" select="*[6]/target"/>
- </m:apply>
- </m:apply>
-
-<!-- da tertminare
- </xsl:when>
- <xsl:otherwise>
- <m:apply helm:xref="{@id}">
- <m:csymbol>or_ind</m:csymbol>
- <xsl:apply-templates mode="noannot" select="*[7]"/>
- <xsl:for-each select="$InnerTypes">
- <xsl:apply-templates mode="pure" select="key('typeid',$id)/*[1]"/>
- </xsl:for-each>
- <xsl:apply-templates mode="pure" select="*[5]"/>
- <xsl:apply-templates mode="pure" select="*[6]"/>
- </m:apply>
- </xsl:otherwise>
- </xsl:choose>
--->
-</xsl:template>
-
-
-<xsl:template mode="proof_transform" match="APPLY[CONST[
- attribute::uri='cic:/Coq/Init/Logic_Type/exT_ind.con' or
- attribute::uri='cic:/Coq/Init/Logic/First_order_quantifiers/ex_ind.con'] and
- count(child::*) = 6 and
- name(*[5])='LAMBDA' and count(*[5]/decl) >= 2 ]">
- <xsl:variable name="id" select="@id"/>
- <m:apply helm:xref="{@id}">
- <m:csymbol>ex_ind</m:csymbol>
- <xsl:apply-templates mode="noannot" select="*[6]"/>
- <m:ci><xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="*[5]/*[1]/@binder"/></xsl:with-param></xsl:call-template></m:ci>
- <xsl:apply-templates mode="pure" select="*[5]/*[1]/*"/>
- <m:ci><xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="*[5]/*[2]/@binder"/></xsl:with-param></xsl:call-template></m:ci>
- <xsl:apply-templates mode="pure" select="*[5]/*[2]/*"/>
- <xsl:choose>
- <xsl:when test="count(*[5]/decl) > 2">
- <xsl:apply-templates mode="lambda_prop" select="*[5]/decl[3]"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates mode="proof_transform" select="*[5]/target/*"/>
- </xsl:otherwise>
- </xsl:choose>
- </m:apply>
-</xsl:template>
-
-
-</xsl:stylesheet>
-
-
+++ /dev/null
-<?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/. -->
-
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-
- <!-- Note: the param processorURL is not available. It has been -->
- <!-- removed to keep the final URL short enought to make I.E. -->
- <!-- work with it. -->
-
- <xsl:import href="mk_meta_and_dep_graph.xsl"/>
-
- <xsl:variable name="base_RDF_URI" select="'helm:rdf:www.cs.unibo.it/helm/rdf/forward//'"/>
- <xsl:variable name="link_direction" select="''"/>
-
-</xsl:stylesheet>
+++ /dev/null
-<?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/. -->
-
-<xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:h="http://www.cs.unibo.it/helm/schemas/mattone.rdf#">
-
-<xsl:output method="text"/>
-
-<xsl:param name="CICURI" select="''"/>
-<xsl:param name="PID" select="''"/>
-<xsl:param name="getterURL" select="''"/>
-<xsl:param name="uri_set_queueURL" select="''"/>
-<xsl:param name="uri_set_size" select="30"/>
-<xsl:variable name="base_URL_of_URI" select="concat($getterURL,'getxml?uri=')"/>
-
-<!-- CSC: next functions because I don't remember the name of the -->
-<!-- CSC: subst function of xslt and I don't have the specs with me -->
-
-<!-- The next function is used to quote URIs for dotty -->
-<xsl:template name="quote">
- <xsl:param name="s" select="''"/>
- <xsl:param name="news" select="''"/>
- <xsl:choose>
- <xsl:when test="$s = ''"><xsl:value-of select="$news"/></xsl:when>
- <xsl:otherwise>
- <xsl:variable name="char" select="substring($s,1,1)"/>
- <xsl:choose>
- <xsl:when test="$char = '/'">
- <xsl:call-template name="quote">
- <xsl:with-param name="s" select="substring($s,2)"/>
- <xsl:with-param name="news" select="concat($news,'X')"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="$char = ':'">
- <xsl:call-template name="quote">
- <xsl:with-param name="s" select="substring($s,2)"/>
- <xsl:with-param name="news" select="concat($news,'Y')"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="$char = '.'">
- <xsl:call-template name="quote">
- <xsl:with-param name="s" select="substring($s,2)"/>
- <xsl:with-param name="news" select="concat($news,'Z')"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test='$char = "'"'>
- <xsl:call-template name="quote">
- <xsl:with-param name="s" select="substring($s,2)"/>
- <xsl:with-param name="news" select="concat($news,'W')"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="$char = '-'">
- <xsl:call-template name="quote">
- <xsl:with-param name="s" select="substring($s,2)"/>
- <xsl:with-param name="news" select="concat($news,'J')"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="$char = '#'">
- <xsl:call-template name="quote">
- <xsl:with-param name="s" select="substring($s,2)"/>
- <xsl:with-param name="news" select="concat($news,'G')"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="$char = '('">
- <xsl:call-template name="quote">
- <xsl:with-param name="s" select="substring($s,2)"/>
- <xsl:with-param name="news" select="concat($news,'O')"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="$char = ')'">
- <xsl:call-template name="quote">
- <xsl:with-param name="s" select="substring($s,2)"/>
- <xsl:with-param name="news" select="concat($news,'C')"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="quote">
- <xsl:with-param name="s" select="substring($s,2)"/>
- <xsl:with-param name="news" select="concat($news,$char)"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<!-- The next function is used to quote URIs to embed them in an URL -->
-<xsl:template name="quote_url">
- <xsl:param name="s" select="''"/>
- <xsl:param name="news" select="''"/>
- <xsl:choose>
- <xsl:when test="$s = ''"><xsl:value-of select="$news"/></xsl:when>
- <xsl:otherwise>
- <xsl:variable name="char" select="substring($s,1,1)"/>
- <xsl:choose>
- <xsl:when test="$char = '#'">
- <xsl:call-template name="quote_url">
- <xsl:with-param name="s" select="substring($s,2)"/>
- <xsl:with-param name="news" select="concat($news,'%23')"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="quote_url">
- <xsl:with-param name="s" select="substring($s,2)"/>
- <xsl:with-param name="news" select="concat($news,$char)"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template name="RDFURI_of_CICURI">
- <xsl:param name="uri" select="''"/>
- <xsl:variable name="before" select="substring-before($uri,'#xpointer(1/')"/>
- <xsl:value-of select="$base_RDF_URI"/>
- <xsl:choose>
- <xsl:when test="$before=''">
- <xsl:value-of select="$uri"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat($before,',')"/>
- <xsl:variable name="after" select="substring-after($uri,'#xpointer(1/')"/>
- <xsl:value-of select="translate(substring-before($after,')'),'/',',')"/>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match="/">
- <!--
- <xsl:text>strict digraph L0 { size = "83,83"; concentrate=true; node [style=filled, shape = box];
</xsl:text>
- -->
- <xsl:text>strict digraph L0 { size = "83,83"; node [style=filled, shape = box];
</xsl:text>
- <xsl:variable name="quoted_CICURI">
- <xsl:call-template name="quote_url">
- <xsl:with-param name="s" select="$CICURI"/>
- </xsl:call-template>
- </xsl:variable>
- <!-- The nonce is used to force the document reload -->
- <xsl:variable name="dummy0" select="document(concat($uri_set_queueURL,'set_uri_set_size?uri=',$quoted_CICURI,'&nonce=',generate-id(),'&PID=',$PID,'&size=',$uri_set_size))"/>
- <xsl:variable name="dummy1" select="document(concat($uri_set_queueURL,'add_if_not_in?uri=',$quoted_CICURI,'&nonce=',generate-id(),'&PID=',$PID))"/>
- <xsl:apply-templates mode="loop" select="document(concat($uri_set_queueURL,'get_next?uri=',$quoted_CICURI,'&nonce=',generate-id(),'&PID=',$PID))"/>
- <xsl:variable name="dummy2" select="document(concat($uri_set_queueURL,'reset_to_empty?PID=',$PID))"/>
- <xsl:text>}</xsl:text>
-</xsl:template>
-
-<xsl:template mode="loop" match="empty"/>
-
-<xsl:template mode="loop" match="uri|marked_uri">
- <xsl:variable name="rdfuri">
- <xsl:call-template name="RDFURI_of_CICURI">
- <xsl:with-param name="uri" select="@value"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="document" select="document(concat($base_URL_of_URI,$rdfuri))"/>
- <xsl:choose>
- <xsl:when test="$document/*">
- <xsl:apply-templates mode="first_time" select="$document/*">
- <xsl:with-param name="currentCICURI" select="@value"/>
- <xsl:with-param name="quotedCurrentCICURI">
- <xsl:call-template name="quote">
- <xsl:with-param name="s" select="@value"/>
- </xsl:call-template>
- </xsl:with-param>
- <xsl:with-param name="do_not_visit" select="name(.)"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates mode="first_time" select=".">
- <xsl:with-param name="currentCICURI" select="@value"/>
- <xsl:with-param name="quotedCurrentCICURI">
- <xsl:call-template name="quote">
- <xsl:with-param name="s" select="@value"/>
- </xsl:call-template>
- </xsl:with-param>
- <xsl:with-param name="do_not_visit" select="'no_deps'"/>
- </xsl:apply-templates>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:variable name="quoted_value">
- <xsl:call-template name="quote_url">
- <xsl:with-param name="s" select="@value"/>
- </xsl:call-template>
- </xsl:variable>
- <!-- The couple (uri,nonce) is used to force the document reload -->
- <xsl:apply-templates mode="loop" select="document(concat($uri_set_queueURL,'get_next?uri=',$quoted_value,'&nonce=',generate-id(),'&PID=',$PID))"/>
-</xsl:template>
-
-
-<xsl:template mode="first_time" match="*">
- <xsl:param name="currentCICURI" select="''"/>
- <xsl:param name="quotedCurrentCICURI" select="''"/>
- <xsl:param name="do_not_visit" select="'uri'"/>
- <xsl:if test="$do_not_visit='uri'">
- <xsl:apply-templates select=".">
- <xsl:with-param name="currentCICURI" select="$currentCICURI"/>
- <xsl:with-param name="quotedCurrentCICURI" select="$quotedCurrentCICURI"/>
- </xsl:apply-templates>
- </xsl:if>
- <xsl:text> </xsl:text>
- <xsl:value-of select="$quotedCurrentCICURI"/>
-<!-- <xsl:text> [fontname="LucidaSansRegular",color=red,label="</xsl:text> -->
- <xsl:text> [label="</xsl:text>
- <xsl:value-of select="$currentCICURI"/>
- <xsl:text>",URL="</xsl:text>
- <xsl:value-of select="$currentCICURI"/>
- <xsl:text>"</xsl:text>
- <xsl:if test="name(document(concat($uri_set_queueURL,'is_overflowed?uri=',$quotedCurrentCICURI,'&nonce=',generate-id(),'&PID=',$PID))/*)='true'">
- <xsl:text>,color=red</xsl:text>
- </xsl:if>
- <xsl:text>];
</xsl:text>
-</xsl:template>
-
-<xsl:template match="*">
- <xsl:param name="currentCICURI" select="''"/>
- <xsl:param name="quotedCurrentCICURI" select="''"/>
- <xsl:for-each select="*/*/*">
- <xsl:variable name="quotedURI">
- <xsl:call-template name="quote">
- <xsl:with-param name="s" select="h:occurrence"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="quoted_uri">
- <xsl:call-template name="quote_url">
- <xsl:with-param name="s" select="h:occurrence"/>
- </xsl:call-template>
- </xsl:variable>
- <!-- The nonce, quotedCurrentCICURI are used to force the document reload -->
- <xsl:if test="not(name(document(concat($uri_set_queueURL,'add_if_not_in?uri=',$quoted_uri,'&nonce=',generate-id(),'&PID=',$PID,'&quotedCurrentCICURI=',$quotedCurrentCICURI))/*)='not_added_because_already_too_many')">
- <xsl:text> </xsl:text>
- <xsl:value-of select="$quotedCurrentCICURI"/>
- <xsl:text> -> </xsl:text>
- <xsl:value-of select="$quotedURI"/>
- <xsl:value-of select="$link_direction"/>
- <xsl:text>;
</xsl:text>
- </xsl:if>
- </xsl:for-each>
-</xsl:template>
-
-</xsl:stylesheet>
+++ /dev/null
-<?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/. -->
-
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-
- <!-- Note: the param processorURL is not available. It has been -->
- <!-- removed to keep the final URL short enought to make I.E. -->
- <!-- work with it. -->
-
- <xsl:import href="mk_meta_and_dep_graph.xsl"/>
-
- <xsl:variable name="base_RDF_URI" select="'helm:rdf:www.cs.unibo.it/helm/rdf/backward//'"/>
- <xsl:variable name="link_direction" select="' [dir=back]'"/>
-
-</xsl:stylesheet>
+++ /dev/null
-<?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/. -->
-
-<xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:ht="http://www.cs.unibo.it/helm/namespaces/helm-theory"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:h="http://www.cs.unibo.it/helm/schemas/mattone.rdf#">
-
-<xsl:template match="/">
- <html>
- <head>
- <title>Occurrences of <xsl:value-of select="*/*/@rdf:about"/></title>
- <style>
- a { text-decoration: none }
- a.underline {text-decoration: underline }
- </style>
- </head>
- <!-- CSC: method onLoad to be removed once the window -->
- <!-- CSC: becomes a frame -->
- <body bgcolor="white" onLoad="window.focus()">
- <xsl:apply-templates/>
- </body>
- </html>
-</xsl:template>
-
-<xsl:template match="h:Object">
- <xsl:variable name="no_main"
- select="count(*/h:Occurrence/h:position[text()='MainConclusion'])"/>
- <xsl:variable name="no_concl"
- select="count(*/h:Occurrence/h:position[text()='InConclusion'])"/>
- <xsl:variable name="no_main_hyp"
- select="count(*/h:Occurrence/h:position[text()='MainHypothesis'])"/>
- <xsl:variable name="no_in_hyp"
- select="count(*/h:Occurrence/h:position[text()='InHypothesis'])"/>
- <xsl:variable name="no_body"
- select="count(*/h:Occurrence/h:position[text()='InBody'])"/>
- <h1>Occurrences of <xsl:value-of select="@rdf:about"/></h1>
-
- <ul>
- <xsl:if test="$no_main != 0">
- <li><a class="underline" href ="#main">Head position in conclusion
- (<xsl:value-of select="$no_main"/>)</a></li>
- </xsl:if>
- <xsl:if test="$no_concl != 0">
- <li><a class="underline" href ="#concl">In conclusion
- (<xsl:value-of select="$no_concl"/>)</a></li>
- </xsl:if>
- <xsl:if test="$no_main_hyp != 0">
- <li><a class="underline" href ="#main_hyp">Head position in some hypothesis
- (<xsl:value-of select="$no_main_hyp"/>)</a></li>
- </xsl:if>
- <xsl:if test="$no_in_hyp != 0">
- <li><a class="underline" href ="#hyp">In hypotheses
- (<xsl:value-of select="$no_in_hyp"/>)</a></li>
- </xsl:if>
- <xsl:if test="$no_body != 0">
- <li><a class="underline" href ="#body">In the body
- (<xsl:value-of select="$no_body"/>)</a></li>
- </xsl:if>
- </ul>
- <xsl:choose>
- <xsl:when test="$no_main = 0"/>
- <xsl:when test="15 > $no_main">
- <h2><a name="main">Head position inside conclusion:</a></h2>
- <xsl:for-each select="*/h:Occurrence[h:position/text()='MainConclusion']">
- <div style="margin: 0.25cm 0cm 0.25cm 0.75cm">
- <ht:OBJECT uri="{h:occurrence}" mode="typeonly"/>
- </div>
- </xsl:for-each>
- </xsl:when>
- <xsl:when test="$no_main >= 15">
- <h2><a name="main">Head position inside conclusion:</a></h2>
- <xsl:for-each select="*/h:Occurrence[h:position/text()='MainConclusion']">
- <div style="margin: 0cm 0cm 0cm 0.75cm">
- <ht:OBJECT uri="{h:occurrence}" mode="linkonly"/>
- </div>
- </xsl:for-each>
- </xsl:when>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test="$no_concl = 0"/>
- <xsl:when test="15 > $no_concl">
- <h2><a name="concl">Inside conclusion:</a></h2>
- <xsl:for-each select="*/h:Occurrence[h:position/text()='InConclusion']">
- <div style="margin: 0.25cm 0cm 0.25cm 0.75cm">
- <ht:OBJECT uri="{h:occurrence}" mode="typeonly"/>
- </div>
- </xsl:for-each>
- </xsl:when>
- <xsl:when test="$no_concl >= 15">
- <h2><a name="concl">Inside conclusion:</a></h2>
- <xsl:for-each select="*/h:Occurrence[h:position/text()='InConclusion']">
- <div style="margin: 0cm 0cm 0cm 0.75cm">
- <ht:OBJECT uri="{h:occurrence}" mode="linkonly"/>
- </div>
- </xsl:for-each>
- </xsl:when>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test="$no_main_hyp = 0"/>
- <xsl:when test="15 > $no_main_hyp">
- <h2><a name="main_hyp">Head position inside an hypothesis:</a></h2>
- <xsl:for-each select="*/h:Occurrence[h:position/text()='MainHypothesis']">
- <div style="margin: 0.25cm 0cm 0.25cm 0.75cm">
- <ht:OBJECT uri="{h:occurrence}" mode="typeonly"/>
- </div>
- </xsl:for-each>
- </xsl:when>
- <xsl:when test="$no_main_hyp >= 15">
- <h2><a name="main_hyp">Head position inside an hypothesis:</a></h2>
- <xsl:for-each select="*/h:Occurrence[h:position/text()='MainHypothesis']">
- <div style="margin: 0cm 0cm 0cm 0.75cm">
- <ht:OBJECT uri="{h:occurrence}" mode="linkonly"/>
- </div>
- </xsl:for-each>
- </xsl:when>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test="$no_in_hyp = 0"/>
- <xsl:when test="15 > $no_in_hyp">
- <h2><a name="hyp">Inside an hypothesis:</a></h2>
- <xsl:for-each select="*/h:Occurrence[h:position/text()='InHypothesis']">
- <div style="margin: 0.25cm 0cm 0.25cm 0.75cm">
- <ht:OBJECT uri="{h:occurrence}" mode="typeonly"/>
- </div>
- </xsl:for-each>
- </xsl:when>
- <xsl:when test="$no_in_hyp >= 15">
- <h2><a name="hyp">Inside an hypothesis:</a></h2>
- <xsl:for-each select="*/h:Occurrence[h:position/text()='InHypothesis']">
- <div style="margin: 0cm 0cm 0cm 0.75cm">
- <ht:OBJECT uri="{h:occurrence}" mode="linkonly"/>
- </div>
- </xsl:for-each>
- </xsl:when>
- </xsl:choose>
- <xsl:if test="$no_body > 0">
- <h2><a name="body">Inside the body:</a></h2>
- <xsl:for-each select="*/h:Occurrence[h:position/text()='InBody']">
- <div style="margin: 0cm 0cm 0cm 0.75cm">
- <ht:OBJECT uri="{h:occurrence}" mode="linkonly"/>
- </div>
- </xsl:for-each>
- </xsl:if>
-</xsl:template>
-
-</xsl:stylesheet>
+++ /dev/null
-<?xml version="1.0"?>
-
-<!-- ******************************************************** -->
-<!-- XSL Transform of MathML content to MathML presentation -->
-<!-- -->
-<!-- Authors Igor Rodionov <igor@csd.uwo.ca>, -->
-<!-- Stephen Watt <watt@csd.uwo.ca>. -->
-<!-- -->
-<!-- (C) Copyright 2000 Symbolic Computation Laboratory, -->
-<!-- University of Western Ontario, -->
-<!-- London, Canada N6A 5B7. -->
-<!-- -->
-<!-- ******************************************************** -->
-<!-- Updated Nov. 2001 by: -->
-<!-- S. Huerter <huerter@csd.uwo.ca>. -->
-<!-- -->
-<!-- Complies with the W3C MathML 2.0 Recommendation of -->
-<!-- 21 February 2001. -->
-<!-- ******************************************************** -->
-
-<!-- ====================================================== -->
-<!-- April, 10 2002 - HELM group: -->
-<!-- Added the namespace prefix to all the output elements -->
-<!-- (see 7.1.1.2) -->
-<!-- Changed the mml prefix into m (see A.3) -->
-<!-- Added xref to every mo element -->
-<!-- New csymbol template -->
-<!-- reln is not supported -->
-<!-- HELM tag used for changes -->
-<!-- First draft: April 10 2002, Irene Schena -->
-<!-- ====================================================== -->
-
-<xsl:stylesheet id="mmlctop.xsl"
- version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:m="http://www.w3.org/1998/Math/MathML">
-
-<!-- HELM: we don't have a default namespace.
- Removed xmlns="http://www.w3.org/1998/Math/MathML" -->
-
-<!-- HELM: was
-<xsl:output method="xml" indent="yes"/>
- only for HELM!
--->
-<xsl:output method="xml"/>
-
-<xsl:strip-space elements="apply semantics annotation-xml
- csymbol fn cn ci interval matrix matrixrow vector
- lambda bvar condition logbase degree set list
- lowlimit uplimit"/>
-
-
-<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
-<!-- Parameters, variables and constants -->
-<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
-
-<!-- ~~~~~~~~ Semantics related *constants*: ~~~~~~~~ -->
-
-<!-- Strip off semantics -->
-<xsl:variable name="SEM_STRIP" select="-1"/>
-
-<!-- Pass semantics "as is" -->
-<xsl:variable name="SEM_PASS" select="0"/>
-
-<!-- Add semantics at top level only -->
-<xsl:variable name="SEM_TOP" select="1"/>
-
-<!-- Add semantics at all levels -->
-<xsl:variable name="SEM_ALL" select="2"/>
-
-<!-- Semantics at top level only, with id refs -->
-<!-- NOTE: ids have to be already present in the
- input for this feature to work. -->
-<xsl:variable name="SEM_XREF" select="3"/>
-
-<!-- No semantics at top level, with id refs -->
-<!-- NOTE: ids have to be already present in the
- input for this feature to work. -->
-<xsl:variable name="SEM_XREF_EXT" select="4"/>
-
-
-<!-- ~~~~~~~~~~ Stylesheet *parameter*: SEM_SW ~~~~~~~~~~~~~~ -->
-<!-- Assumes one of the above values; SEM_PASS is the default -->
-<!-- The default can be overridden by specifying different -->
-<!-- value on the command line when the stylesheet is invoked -->
-
-<!-- HELM: $SEM_SW was SEM_PASS (error!) -->
-<xsl:param name="SEM_SW" select="$SEM_XREF"/>
-
-
-<!-- ~~~~~~ Operator precedence definitions ~~~~~~ -->
-<xsl:variable name="UNION_OP" select="2"/>
-<xsl:variable name="INTERSECT_OP" select="6"/>
-<xsl:variable name="SETDIFF_OP" select="4"/>
-<xsl:variable name="NO_PREC" select="0"/>
-<xsl:variable name="UNION_PREC" select="1"/>
-<xsl:variable name="SETDIFF_PREC" select="1"/>
-<xsl:variable name="INTERSECT_PREC" select="3"/>
-<xsl:variable name="CARTPROD_PREC" select="3"/>
-<xsl:variable name="OR_PREC" select="5"/>
-<xsl:variable name="XOR_PREC" select="5"/>
-<xsl:variable name="AND_PREC" select="7"/>
-<xsl:variable name="PLUS_PREC" select="9"/>
-<xsl:variable name="MINUS_PREC" select="9"/>
-<xsl:variable name="MUL_PREC" select="11"/>
-<xsl:variable name="DIV_PREC" select="11"/>
-<xsl:variable name="NEG_PREC" select="13"/>
-<xsl:variable name="FUNCTION_PREC" select="99"/>
-
-<!-- ~~~~~ Miscellaneous constant definitions ~~~~~ -->
-
-<xsl:variable name="YES" select="1"/>
-<xsl:variable name="NO" select="0"/>
-<xsl:variable name="NO_PARAM" select="-1"/>
-<xsl:variable name="PAR_SAME" select="-3"/>
-<xsl:variable name="PAR_YES" select="-5"/>
-<xsl:variable name="PAR_NO" select="-7"/>
-<xsl:variable name="DOESNT_MATTER" select="-9"/>
-
-<!-- +++++++++++++++++ INDEX OF TEMPLATES +++++++++++++++++++ -->
-
-<!-- All templates are subdivided into the following categories
- (listed in the order of appearance in the stylesheet):
-
-THE TOPMOST ELEMENT: MATH
- math
-
-SEMANTICS HANDLING
- semantics
-
-BASIC CONTAINER ELEMENTS
- cn, ci, csymbol
-
-BASIC CONTENT ELEMENTS
- fn, interval, inverse, sep, condition, declare, lambda, compose, ident
-
- *NEW: apply, piecewise, domain, codomain, image
-
-ARITHMETIC, ALGEBRA & LOGIC
- quotient, exp, factorial, max, min, minus, plus, power, rem, divide,
- times, root, gcd, and, or, xor, not, forall, exists, abs, conjugate,
- arg, real, imaginary
-
- *NEW: floor, ceiling, lcm
-
-RELATIONS
- neq, approx, tendsto, implies, in, notin, notsubset, notprsubset,
- subset, prsubset, eq, gt, lt, geq, leq, equivalent
-
-CALCULUS
- ln, log, diff, partialdiff, lowlimit, uplimit, bvar, degree,
- logbase, divergence, grad, curl, laplacian
-
-SET THEORY
- set, list, union, intersect, setdiff, card
-
- *NEW: cartesianproduct
-
-SEQUENCES AND SERIES
- sum, product, limit
-
- *NEW: int
-
-TRIGONOMETRY
- sin, cos, tan, sec, csc, cot, sinh, cosh, tanh, sech, csch, coth,
- arcsin, arccos, arctan
-
- *NEW: arcsec, arccsc, arccot, arcsinh, arccosh, arctanh,
- arcsech, arccsch, arccoth,
-
-STATISTICS
- mean, sdev, variance, median, mode, moment
-
-LINEAR ALGEBRA
- vector, matrix, matrixrow, determinant, transpose, selector,
- vectorproduct, scalarproduct, outerproduct
--->
-
-
-<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
-<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~ TEMPLATES ~~~~~~~~~~~~~~~~~~~~~~~~~ -->
-<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
-
-
-<!-- ***************** THE TOPMOST ELEMENT: MATH ***************** -->
-
-<xsl:template match = "m:math">
-<!-- HELM: <m:math> only for HELM! -->
- <xsl:choose>
- <xsl:when test="$SEM_SW=$SEM_TOP or $SEM_SW=$SEM_ALL and *[2] or $SEM_SW=$SEM_XREF"> <m:semantics>
- <m:mrow>
- <xsl:apply-templates mode = "semantics"/>
- </m:mrow>
- <m:annotation-xml encoding="MathML">
- <xsl:copy-of select="*"/>
- </m:annotation-xml>
- </m:semantics>
- </xsl:when>
- <xsl:otherwise>
- <m:mrow>
- <xsl:apply-templates mode = "semantics"/>
- </m:mrow>
- </xsl:otherwise>
- </xsl:choose>
-<!-- HELM: </m:math> -->
-</xsl:template>
-
-
-<!-- ***************** SEMANTICS HANDLING ***************** -->
-
-<!-- This template is called recursively. At each level -->
-<!-- in the source tree it decides whether to strip off, -->
-<!-- pass or add semantics at that level (depending on the -->
-<!-- value of SEM_SW parameter). Then the actual template -->
-<!-- is applied to the node. -->
-
-<xsl:template match = "m:*" mode = "semantics">
- <xsl:param name="IN_OP" select="$DOESNT_MATTER"/>
- <xsl:param name="IN_PREC" select="$NO_PREC"/>
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:choose>
- <xsl:when test="$SEM_SW=$SEM_STRIP and self::m:semantics">
- <xsl:apply-templates select="m:annotation-xml[@encoding='MathML']">
- <xsl:with-param name="IN_OP" select="$IN_OP"/>
- <xsl:with-param name="IN_PREC" select="$IN_PREC"/>
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:when test="($SEM_SW=$SEM_PASS or $SEM_SW=$SEM_TOP) and self::m:semantics">
- <m:semantics>
- <xsl:apply-templates select="*[1]">
- <xsl:with-param name="IN_OP" select="$IN_OP"/>
- <xsl:with-param name="IN_PREC" select="$IN_PREC"/>
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- <xsl:copy-of select="m:annotation-xml"/>
- </m:semantics>
- </xsl:when>
- <xsl:when test="$SEM_SW=$SEM_ALL">
- <m:semantics>
- <xsl:choose>
- <xsl:when test="self::m:semantics">
- <xsl:apply-templates select="*[1]">
- <xsl:with-param name="IN_OP" select="$IN_OP"/>
- <xsl:with-param name="IN_PREC" select="$IN_PREC"/>
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- <xsl:copy-of select="m:annotation-xml"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select=".">
- <xsl:with-param name="IN_OP" select="$IN_OP"/>
- <xsl:with-param name="IN_PREC" select="$IN_PREC"/>
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- <m:annotation-xml encoding="MathML">
- <xsl:copy-of select="."/>
- </m:annotation-xml>
- </xsl:otherwise>
- </xsl:choose>
- </m:semantics>
- </xsl:when>
- <xsl:when test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:choose>
-<!-- HELM: syntax error, was sematics -->
- <xsl:when test="self::m:semantics">
- <xsl:copy>
- <xsl:copy-of select="@*"/>
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- <xsl:copy-of select="*[1]"/>
- <xsl:copy-of select="m:annotation-xml"/>
- </xsl:copy>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select=".">
- <xsl:with-param name="IN_OP" select="$IN_OP"/>
- <xsl:with-param name="IN_PREC" select="$IN_PREC"/>
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="self::m:semantics">
- <xsl:copy-of select="."/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select=".">
- <xsl:with-param name="IN_OP" select="$IN_OP"/>
- <xsl:with-param name="IN_PREC" select="$IN_PREC"/>
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match = "m:semantics">
- <xsl:apply-templates select="." mode = "semantics"/>
-</xsl:template>
-
-
-<!-- ***************** BASIC CONTAINER ELEMENTS ***************** -->
-
-<xsl:template match = "m:cn">
- <xsl:param name="IN_PREC" select="$NO_PREC"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:choose>
- <xsl:when test=". < 0 and $IN_PREC > $NO_PREC and $PAREN=$PAR_NO
- and $PAR_NO_IGNORE=$NO">
- <m:mfenced separators="">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="cn"/>
- </m:mfenced>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:apply-templates select="." mode="cnid"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="." mode="cn"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<!-- HELM: the entity ⁢ is not defined -->
-<xsl:template match = "m:cn" mode="cn">
- <xsl:choose>
- <xsl:when test="@base and (not(@type) or @type='integer' or @type='real')">
- <m:msub>
- <m:mn> <xsl:apply-templates mode = "semantics"/> </m:mn>
- <m:mn> <xsl:value-of select="@base"/> </m:mn>
- </m:msub>
- </xsl:when>
- <xsl:when test="@type='e-notation' and not(@base) and child::m:sep[1]">
- <m:mn> <xsl:apply-templates select="text()[1]" mode = "semantics"/> </m:mn>
- <m:mo> <xsl:text disable-output-escaping='yes'>⁢</xsl:text> </m:mo>
- <m:mo>e</m:mo>
- <m:mo> <xsl:text disable-output-escaping='yes'>⁢</xsl:text> </m:mo>
- <m:mn> <xsl:value-of select="text()[2]"/> </m:mn>
- </xsl:when>
- <xsl:when test="@type='complex' and not(@base) and child::m:sep[1]">
- <m:mfenced separators="">
- <m:mn> <xsl:apply-templates select="text()[1]" mode = "semantics"/> </m:mn>
- <xsl:if test="text()[2] < 0">
- <m:mo>-</m:mo>
- <m:mn> <xsl:value-of select="-text()[2]"/> </m:mn>
- </xsl:if>
- <xsl:if test="not(text()[2] < 0)">
- <m:mo>+</m:mo>
- <m:mn> <xsl:value-of select="text()[2]"/> </m:mn>
- </xsl:if>
- <m:mo><xsl:text disable-output-escaping='yes'>⁢</xsl:text> </m:mo>
- <m:mo>i</m:mo>
- </m:mfenced>
- </xsl:when>
- <xsl:when test="@type='complex' and @base and child::m:sep[1]">
- <m:msub>
- <m:mfenced separators="">
- <m:mn> <xsl:apply-templates select="text()[1]"/> </m:mn>
- <xsl:if test="text()[2] < 0">
- <m:mo>-</m:mo>
- <m:mn> <xsl:value-of select="-text()[2]"/> </m:mn>
- </xsl:if>
- <xsl:if test="not(text()[2] < 0)">
- <m:mo>+</m:mo>
- <m:mn> <xsl:apply-templates select="text()[2]"/> </m:mn>
- </xsl:if>
- <m:mo><xsl:text disable-output-escaping='yes'>⁢</xsl:text></m:mo>
- <m:mo>i</m:mo>
- </m:mfenced>
- <m:mn> <xsl:value-of select="@base"/> </m:mn>
- </m:msub>
- </xsl:when>
- <xsl:when test="@type='rational' and not(@base) and child::m:sep[1]">
- <m:mfrac>
- <m:mn> <xsl:apply-templates select="text()[1]"/> </m:mn>
- <m:mn> <xsl:apply-templates select="text()[2]"/> </m:mn>
- </m:mfrac>
- </xsl:when>
- <xsl:when test="@type='rational' and @base and child::m:sep[1]">
- <m:msub>
- <m:mfenced>
- <m:mfrac>
- <m:mn> <xsl:apply-templates select="text()[1]"/> </m:mn>
- <m:mn> <xsl:apply-templates select="text()[2]"/> </m:mn>
- </m:mfrac>
- </m:mfenced>
- <m:mn> <xsl:value-of select="@base"/> </m:mn>
- </m:msub>
- </xsl:when>
- <xsl:when test="@type='polar' and not(@base) and child::m:sep[1]">
- <m:mrow>
- <m:mo>Polar</m:mo>
- <m:mo><xsl:text disable-output-escaping='yes'>⁢</xsl:text> </m:mo>
- <m:mfenced separators=",">
- <m:mn> <xsl:apply-templates select="text()[1]"/> </m:mn>
- <m:mn> <xsl:apply-templates select="text()[2]"/> </m:mn>
- </m:mfenced>
- </m:mrow>
- </xsl:when>
- <xsl:when test="@type='polar' and @base and child::m:sep[1]">
- <m:msub>
- <m:mrow>
- <m:mo>Polar</m:mo>
- <m:mo><xsl:text disable-output-escaping='yes'>⁢</xsl:text></m:mo>
- <m:mfenced separators=",">
- <m:mn> <xsl:apply-templates select="text()[1]"/> </m:mn>
- <m:mn> <xsl:apply-templates select="text()[2]"/> </m:mn>
- </m:mfenced>
- </m:mrow>
- <m:mn> <xsl:value-of select="@base"/> </m:mn>
- </m:msub>
- </xsl:when>
- <xsl:otherwise>
-<!-- HELM: cn could contain MathML presentation -->
-<!-- HELM: was
- <m:mn> <xsl:apply-templates mode = "semantics"/> </m:mn>
- Now is: -->
- <xsl:choose>
- <xsl:when test="child::text() and not(*[1])">
- <m:mn> <xsl:apply-templates mode = "semantics"/> </m:mn>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="not(*[2])">
- <xsl:copy-of select="*[1]"/>
- </xsl:when>
- <xsl:otherwise>
- <m:mrow>
- <xsl:copy-of select="*|text()"/>
- </m:mrow>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
-<!-- HELM -->
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match = "m:cn" mode="cnid">
- <xsl:choose>
- <xsl:when test="@base and (not(@type) or @type='integer' or @type='real')">
- <m:msub xref="{@id}">
- <m:mn> <xsl:apply-templates mode = "semantics"/> </m:mn>
- <m:mn> <xsl:value-of select="@base"/> </m:mn>
- </m:msub>
- </xsl:when>
- <xsl:when test="@type='complex' and not(@base) and child::m:sep[1]">
- <m:mfenced separators="" xref="{@id}">
- <m:mn> <xsl:apply-templates select="text()[1]" mode = "semantics"/> </m:mn>
- <xsl:if test="text()[2] < 0">
- <m:mo>-</m:mo>
- <m:mn> <xsl:value-of select="-text()[2]"/> </m:mn>
- </xsl:if>
- <xsl:if test="not(text()[2] < 0)">
- <m:mo>+</m:mo>
- <m:mn> <xsl:value-of select="text()[2]"/> </m:mn>
- </xsl:if>
- <m:mo><xsl:text disable-output-escaping='yes'>⁢</xsl:text></m:mo>
- <m:mo>i</m:mo>
- </m:mfenced>
- </xsl:when>
- <xsl:when test="@type='complex' and @base and child::m:sep[1]">
- <m:msub xref="{@id}">
- <m:mfenced separators="">
- <m:mn> <xsl:apply-templates select="text()[1]"/> </m:mn>
- <xsl:if test="text()[2] < 0">
- <m:mo>-</m:mo>
- <m:mn> <xsl:value-of select="-text()[2]"/> </m:mn>
- </xsl:if>
- <xsl:if test="not(text()[2] < 0)">
- <m:mo>+</m:mo>
- <m:mn> <xsl:apply-templates select="text()[2]"/> </m:mn>
- </xsl:if>
- <m:mo><xsl:text disable-output-escaping='yes'>⁢</xsl:text> </m:mo>
- <m:mo>i</m:mo>
- </m:mfenced>
- <m:mn> <xsl:value-of select="@base"/> </m:mn>
- </m:msub>
- </xsl:when>
- <xsl:when test="@type='rational' and not(@base) and child::m:sep[1]">
- <m:mfrac xref="{@id}">
- <m:mn> <xsl:apply-templates select="text()[1]"/> </m:mn>
- <m:mn> <xsl:apply-templates select="text()[2]"/> </m:mn>
- </m:mfrac>
- </xsl:when>
- <xsl:when test="@type='rational' and @base and child::m:sep[1]">
- <m:msub xref="{@id}">
- <m:mfenced>
- <m:mfrac>
- <m:mn> <xsl:apply-templates select="text()[1]"/> </m:mn>
- <m:mn> <xsl:apply-templates select="text()[2]"/> </m:mn>
- </m:mfrac>
- </m:mfenced>
- <m:mn> <xsl:value-of select="@base"/> </m:mn>
- </m:msub>
- </xsl:when>
- <xsl:when test="@type='polar' and not(@base) and child::m:sep[1]">
- <m:mrow xref="{@id}">
- <m:mo>Polar</m:mo>
- <m:mo><xsl:text disable-output-escaping='yes'>⁢</xsl:text> </m:mo>
- <m:mfenced separators=",">
- <m:mn> <xsl:apply-templates select="text()[1]"/> </m:mn>
- <m:mn> <xsl:apply-templates select="text()[2]"/> </m:mn>
- </m:mfenced>
- </m:mrow>
- </xsl:when>
- <xsl:when test="@type='polar' and @base and child::m:sep[1]">
- <m:msub xref="{@id}">
- <m:mrow>
- <m:mo>Polar</m:mo>
- <m:mo><xsl:text disable-output-escaping='yes'>⁢</xsl:text> </m:mo>
- <m:mfenced separators=",">
- <m:mn> <xsl:apply-templates select="text()[1]"/> </m:mn>
- <m:mn> <xsl:apply-templates select="text()[2]"/> </m:mn>
- </m:mfenced>
- </m:mrow>
- <m:mn> <xsl:value-of select="@base"/> </m:mn>
- </m:msub>
- </xsl:when>
- <xsl:otherwise>
-<!-- HELM: cn could contain MathML presentation -->
-<!-- HELM: was
- <m:mn xref="{@id}"> <xsl:apply-templates mode = "semantics"/> </m:mn>
- Now is: -->
- <xsl:choose>
- <xsl:when test="child::text() and not(*[1])">
- <m:mn xref="{@id}"> <xsl:apply-templates mode = "semantics"/> </m:mn>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="id" select="@id"/>
- <xsl:choose>
- <xsl:when test="not(*[2])">
- <xsl:for-each select="*[1]">
- <xsl:copy>
- <xsl:attribute name="xref">
- <xsl:value-of select="$id"/>
- </xsl:attribute>
- <xsl:copy-of select="@*|*"/>
- </xsl:copy>
- </xsl:for-each>
- </xsl:when>
- <xsl:otherwise>
- <m:mrow xref="{$id}">
- <xsl:copy-of select="*|text()"/>
- </m:mrow>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
-<!-- HELM -->
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match = "m:ci">
- <xsl:choose>
- <xsl:when test="@type='vector' or @type=matrix or @type=set">
- <m:mi mathvariant="bold">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates mode = "semantics"/>
- </m:mi>
- </xsl:when>
- <xsl:when test="child::text() and not(child::*[1])">
- <m:mi>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
-<!-- HELM: ERROR, added mode="semantics", it didn't generate identifiers -->
- <xsl:apply-templates mode = "semantics"/>
- </m:mi>
- </xsl:when>
-<!-- HELM: text & markup !!! Not compliant with the specification -->
- <xsl:when test="child::text() and *[1] and not(*[1]=m:sep)">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
-<!-- HELM: added semantics mode -->
- <xsl:apply-templates mode="semantics"/>
- </m:mrow>
- </xsl:when>
-<!-- HELM -->
- <xsl:otherwise>
- <xsl:if test="*[2]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="*"/>
- </m:mrow>
- </xsl:if>
- <xsl:if test="not(*[2])">
-<!-- HELM: ci could contain MathML presentation -->
-<!-- HELM: was
- <xsl:apply-templates select="*[1]"/>
- Now is: -->
- <xsl:variable name="id" select="@id"/>
- <xsl:for-each select="*[1]">
- <xsl:copy>
- <xsl:attribute name="xref">
- <xsl:value-of select="$id"/>
- </xsl:attribute>
- <xsl:copy-of select="@*|*"/>
- </xsl:copy>
- </xsl:for-each>
-<!-- HELM -->
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match = "m:ci/m:*[not(self::m:sep)]">
- <xsl:copy-of select = "."/>
-</xsl:template>
-
-<!-- HELM: revised version previous Version x.xx from Feb. 18, 2000 -->
-<xsl:template match = "m:csymbol">
-<!-- HELM: mrow to maintain csymbol id -->
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:for-each select="* and text()">
- <xsl:choose>
- <xsl:when test="text()">
- <m:mo><xsl:value-of select="."/></m:mo>
- </xsl:when>
- <xsl:otherwise>
- <xsl:copy-of select = "."/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- </m:mrow>
-</xsl:template>
-
-<!-- HELM: csymbol cannot contain ci or cn elements, but only text and/or
-presentation elements. PCDATA should render as if it were wrapped in
-an mo. Mixed content: mrow which contains mo + presentation elements -->
-<!-- <xsl:template match = "m:csymbol/m:*">
- <xsl:choose>
- <xsl:when test="self::m:cn or self::m:ci">
- <xsl:apply-templates mode = "semantics"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:copy-of select = "."/>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match = "m:csymbol/text()">
- <xsl:choose>
- <xsl:when test=". < 0 or . = 0 or . > 0">
- <m:mn> <xsl:copy-of select = "."/> </m:mn>
- </xsl:when>
- <xsl:otherwise>
- <m:mi> <xsl:copy-of select = "."/> </m:mi>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template> -->
-
-
-<!-- ***************** BASIC CONTENT ELEMENTS ***************** -->
-
-<!-- HELM: the entity ⁡ is not defined: -->
-<!-- fn and domainofapplication are rendered as their content -->
-<xsl:template match = "m:apply[m:*[1][self::m:fn]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select = "m:fn[1]" mode = "semantics"/>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:fn/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:fn/@id"/>
- </xsl:attribute>
- </xsl:if><xsl:text disable-output-escaping='yes'>⁡</xsl:text></m:mo>
- <m:mfenced separators=",">
- <xsl:apply-templates select = "*[position()>1]" mode = "semantics"/>
- </m:mfenced>
- </m:mrow>
-</xsl:template>
-
-<!-- fn has been deprecated, so now we use: -->
-<xsl:template match = "m:apply">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="*[2]=m:domainofapplication">
- <m:msub>
- <xsl:apply-templates select = "*[position()=1]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
- </xsl:apply-templates>
- <xsl:apply-templates select = "*[position()=2]" mode = "semantics"/>
- </m:msub>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:domainofapplication/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:domainofapplication/@id"/>
- </xsl:attribute>
- </xsl:if><xsl:text disable-output-escaping='yes'>⁡</xsl:text></m:mo>
- <m:mfenced separators=",">
- <xsl:apply-templates select = "*[position()>2]" mode = "semantics"/>
- </m:mfenced>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select = "*[position()=1]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
- </xsl:apply-templates>
- <m:mo><xsl:text disable-output-escaping='yes'>⁡</xsl:text></m:mo>
- <m:mfenced separators=",">
- <xsl:apply-templates select = "*[position()>1]" mode = "semantics"/>
- </m:mfenced>
- </xsl:otherwise>
- </xsl:choose>
- </m:mrow>
- </xsl:template>
-
- <xsl:template match = "m:domainofapplication">
- <xsl:apply-templates select = "*[1]" mode = "semantics"/>
- </xsl:template>
-
- <xsl:template match = "m:fn">
- <xsl:apply-templates select = "*[1]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
- </xsl:apply-templates>
- </xsl:template>
-
- <xsl:template match = "m:interval">
- <m:mfenced separators=",">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:if test="@closure='closed' or @closure='closed-open'">
- <xsl:attribute name="open">[</xsl:attribute>
- </xsl:if>
- <xsl:if test="@closure='closed' or @closure='open-closed'">
- <xsl:attribute name="close">]</xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="*" mode = "semantics"/>
- </m:mfenced>
- </xsl:template>
-
- <xsl:template match = "m:apply[m:*[1][self::m:apply[m:inverse[1]]]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select = "*[1]" mode = "semantics"/>
- <m:mo><xsl:text disable-output-escaping='yes'>⁡</xsl:text> </m:mo>
- <m:mfenced separators=",">
- <xsl:apply-templates select = "*[position()>1]" mode = "semantics"/>
- </m:mfenced>
- </m:mrow>
-</xsl:template>
-
-<xsl:template match = "m:apply[*[1][self::m:inverse]]">
- <xsl:choose>
- <xsl:when test="*[2]=m:exp or *[2]=m:ln or *[2]=m:sin or *[2]=m:cos or
- *[2]=m:tan or *[2]=m:sec or *[2]=m:csc or *[2]=m:cot or
- *[2]=m:sinh or *[2]=m:cosh or *[2]=m:tanh or *[2]=m:sech or
- *[2]=m:csch or *[2]=m:coth or *[2]=m:arcsin or
- *[2]=m:arccos or *[2]=m:arctan">
- <m:mo>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="*[2]" mode="inverse"/>
- </m:mo>
- </xsl:when>
- <xsl:otherwise>
- <m:msup>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select = "*[2]"/>
- <m:mfenced>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:inverse/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:inverse/@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mn>-1</m:mn>
- </m:mfenced>
- </m:msup>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match = "*" mode="inverse">
- <xsl:choose>
- <xsl:when test="self::m:exp">
- <xsl:value-of select="'ln'"/>
- </xsl:when>
- <xsl:when test="self::m:ln">
- <xsl:value-of select="'exp'"/>
- </xsl:when>
- <xsl:when test="self::m:sin">
- <xsl:value-of select="'arcsin'"/>
- </xsl:when>
- <xsl:when test="self::m:cos">
- <xsl:value-of select="'arccos'"/>
- </xsl:when>
- <xsl:when test="self::m:tan">
- <xsl:value-of select="'arctan'"/>
- </xsl:when>
- <xsl:when test="self::m:sec">
- <xsl:value-of select="'arcsec'"/>
- </xsl:when>
- <xsl:when test="self::m:csc">
- <xsl:value-of select="'arccsc'"/>
- </xsl:when>
- <xsl:when test="self::m:cot">
- <xsl:value-of select="'arccot'"/>
- </xsl:when>
- <xsl:when test="self::m:sinh">
- <xsl:value-of select="'arcsinh'"/>
- </xsl:when>
- <xsl:when test="self::m:cosh">
- <xsl:value-of select="'arccosh'"/>
- </xsl:when>
- <xsl:when test="self::m:tanh">
- <xsl:value-of select="'arctanh'"/>
- </xsl:when>
- <xsl:when test="self::m:sech">
- <xsl:value-of select="'arcsech'"/>
- </xsl:when>
- <xsl:when test="self::m:csch">
- <xsl:value-of select="'arccsch'"/>
- </xsl:when>
- <xsl:when test="self::m:coth">
- <xsl:value-of select="'arccoth'"/>
- </xsl:when>
- <xsl:when test="self::m:arcsin">
- <xsl:value-of select="'sin'"/>
- </xsl:when>
- <xsl:when test="self::m:arccos">
- <xsl:value-of select="'cos'"/>
- </xsl:when>
- <xsl:when test="self::m:arctan">
- <xsl:value-of select="'tan'"/>
- </xsl:when>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match = "m:sep"/>
-
-<xsl:template match = "m:condition">
- <xsl:choose>
- <xsl:when test="parent::m:apply[m:forall[1]]"/>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <m:mrow xref="{@id}">
- <xsl:apply-templates select="*" mode = "semantics"/>
- </m:mrow>
- </xsl:when>
- <xsl:otherwise>
- <xsl:if test="not(*[2])">
- <xsl:apply-templates select="*" mode = "semantics"/>
- </xsl:if>
- <xsl:if test="*[2]">
- <m:mrow>
- <xsl:apply-templates select="*" mode = "semantics"/>
- </m:mrow>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match = "m:declare"/>
-
-<xsl:template match = "m:lambda">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mo><xsl:text disable-output-escaping='yes'>Λ</xsl:text> </m:mo>
- <m:mo><xsl:text disable-output-escaping='yes'>⁡</xsl:text> </m:mo>
- <m:mfenced separators=",">
- <xsl:for-each select = "*">
- <xsl:choose>
- <xsl:when test="self::m:ci or self::m:cn">
- <xsl:apply-templates select = "." mode="semantics"/>
- </xsl:when>
- <xsl:otherwise>
- <m:mrow>
- <xsl:apply-templates select = "." mode="semantics"/>
- </m:mrow>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- </m:mfenced>
- </m:mrow>
-</xsl:template>
-
-<xsl:template match = "m:apply[*[1][self::m:apply[m:compose[1]]]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select = "*[1]" mode = "semantics"/>
- <m:mo><xsl:text disable-output-escaping='yes'>⁡</xsl:text></m:mo>
- <m:mfenced separators=",">
- <xsl:apply-templates select = "*[position()>1]" mode = "semantics"/>
- </m:mfenced>
- </m:mrow>
-</xsl:template>
-
-<xsl:template match = "m:apply[*[1][self::m:compose]]">
- <m:mfenced separators="">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select = "m:*[2][self::m:ci[@type='fn'] |
- self::m:fn]" mode="semantics"/>
- <xsl:for-each select = "m:*[position()>2][self::m:ci[@type='fn'] |
- self::m:fn]">
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and ../m:compose/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="../m:compose/@id"/>
- </xsl:attribute>
- </xsl:if><xsl:text disable-output-escaping='yes'>∘</xsl:text></m:mo>
- <xsl:apply-templates select = "." mode="semantics"/>
- </xsl:for-each>
- </m:mfenced>
-</xsl:template>
-
-<xsl:template match = "m:ident">
- <xsl:choose>
- <xsl:when test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <m:mo xref="{@id}">id</m:mo>
- </xsl:when>
- <xsl:otherwise>
- <m:mo>id</m:mo>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match="m:piecewise">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:element name="m:mfenced">
- <xsl:attribute name="open">{</xsl:attribute>
- <xsl:attribute name="close"></xsl:attribute>
- <m:mtable groupalign="left left left">
- <xsl:for-each select="m:piece">
- <m:mtr columnalign="left">
- <m:mtd>
- <m:mrow>
- <xsl:apply-templates select="*[position()=1]" mode = "semantics"/>
- </m:mrow>
- </m:mtd>
- <m:mtd>
- <m:mrow>
- <m:mtext>if <m:mspace width="5"/></m:mtext>
- <xsl:apply-templates select="*[position()=2]" mode = "semantics"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- </xsl:for-each>
- <xsl:if test="m:otherwise">
- <m:mtr columnalign="left">
- <m:mtd>
- <m:mrow>
- <xsl:apply-templates select="m:otherwise/*" mode = "semantics"/>
- </m:mrow>
- </m:mtd>
- <m:mtd>
- <m:mrow>
- otherwise
- </m:mrow>
- </m:mtd>
- </m:mtr>
- </xsl:if>
- </m:mtable>
-</xsl:element>
-</m:mrow>
-</xsl:template>
-
-<!-- HELM: was (it didn't match with prefixed MathML)
-<xsl:template match="m:apply[child::*[position()=1 and name()='domain']]">
- Now is: -->
-<xsl:template match="m:apply[child::*[position()=1 and self::m:domain]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mi>domain</m:mi>
- <m:mfenced open="(" close=")">
- <xsl:apply-templates select="*[position()!=1]" mode = "semantics"/>
- </m:mfenced>
- </m:mrow>
-</xsl:template>
-
-<!-- HELM: was (it didn't match with prefixed MathML)
-<xsl:template match="m:apply[child::*[position()=1 and name()='codomain']]">
- Now is: -->
-<xsl:template match="m:apply[child::*[position()=1 and self::m:codomain]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mi>codomain</m:mi>
- <m:mfenced open="(" close=")">
- <xsl:apply-templates select="*[position()!=1]" mode = "semantics"/>
- </m:mfenced>
- </m:mrow>
-</xsl:template>
-
-<!-- HELM: was (it didn't match with prefixed MathML)
-<xsl:template match="m:apply[child::*[position()=1 and name()='image']]">
- Now is: -->
-<xsl:template match="m:apply[child::*[position()=1 and self::m:image]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mi>image</m:mi>
- <m:mfenced open="(" close=")">
- <xsl:apply-templates select="*[position()!=1]" mode = "semantics"/>
- </m:mfenced>
- </m:mrow>
-</xsl:template>
-
-
-<!-- ***************** ARITHMETIC, ALGEBRA & LOGIC ***************** -->
-
-<xsl:template match = "m:apply[m:quotient[1]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mo form="prefix" fence="true" stretchy="true" lspace="0em" rspace="0em">
- <xsl:text disable-output-escaping='yes'>⌊</xsl:text>
- </m:mo>
- <m:mfrac>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:quotient/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:quotient/@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mrow>
- <xsl:apply-templates select="*[2]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
- </xsl:apply-templates>
- </m:mrow>
- <m:mrow>
- <xsl:apply-templates select="*[3]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- </m:mrow>
- </m:mfrac>
- <m:mo form="postfix" fence="true" stretchy="true" lspace="0em" rspace="0em">
- <xsl:text disable-output-escaping='yes'>⌊</xsl:text>
- </m:mo>
- </m:mrow>
-</xsl:template>
-
-<xsl:template match = "m:apply[*[1][self::m:exp]]">
- <m:msup>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:exp/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:exp/@id"/>
- </xsl:attribute>
- </xsl:if>e</m:mo>
- <xsl:apply-templates select = "*[2]" mode = "semantics"/>
- </m:msup>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:factorial[1]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select = "*[2]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:factorial/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:factorial/@id"/>
- </xsl:attribute>
- </xsl:if>!</m:mo>
- </m:mrow>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:max[1] | m:min[1]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:if test="*[2]=m:bvar">
- <m:munder>
- <xsl:if test="*[1]=m:max">
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:max/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:max/@id"/>
- </xsl:attribute>
- </xsl:if>max</m:mo>
- </xsl:if>
- <xsl:if test="*[1]=m:min">
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:min/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:min/@id"/>
- </xsl:attribute>
- </xsl:if>min</m:mo>
- </xsl:if>
- <xsl:apply-templates select="*[2]" mode = "semantics"/>
- </m:munder>
- <xsl:if test="*[3]=m:condition">
- <m:mfenced open="{{" close="}}" separators="">
- <m:mfenced open="" close="" separators=",">
- <xsl:for-each select = "*[position()>3]">
- <xsl:apply-templates select = "." mode="semantics"/>
- </xsl:for-each>
- </m:mfenced>
- <m:mo>|</m:mo>
- <xsl:apply-templates select="*[3]" mode = "semantics"/>
- </m:mfenced>
- </xsl:if>
- <xsl:if test="not(*[3]=m:condition)">
- <m:mfenced open="{{" close="}}" separators=",">
- <xsl:for-each select = "*[position()>2]">
- <xsl:apply-templates select = "." mode="semantics"/>
- </xsl:for-each>
- </m:mfenced>
- </xsl:if>
- </xsl:if>
- <xsl:if test="*[2]=m:condition">
- <xsl:if test="*[1]=m:max">
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:max/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:max/@id"/>
- </xsl:attribute>
- </xsl:if>max</m:mo>
- </xsl:if>
- <xsl:if test="*[1]=m:min">
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:min/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:min/@id"/>
- </xsl:attribute>
- </xsl:if>min</m:mo>
- </xsl:if>
- <m:mfenced open="{{" close="}}" separators="">
- <xsl:if test="*[3]">
- <m:mfenced open="" close="" separators=",">
- <xsl:for-each select = "*[position()>2]">
- <xsl:apply-templates select = "." mode="semantics"/>
- </xsl:for-each>
- </m:mfenced>
- <m:mo>|</m:mo>
- </xsl:if>
- <xsl:apply-templates select="*[2]" mode = "semantics"/>
- </m:mfenced>
- </xsl:if>
- <xsl:if test="not(*[2]=m:condition) and not(*[2]=m:bvar)">
- <xsl:if test="*[1]=m:max">
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:max/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:max/@id"/>
- </xsl:attribute>
- </xsl:if>max</m:mo>
- </xsl:if>
- <xsl:if test="*[1]=m:min">
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:min/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:min/@id"/>
- </xsl:attribute>
- </xsl:if>min</m:mo>
- </xsl:if>
- <m:mfenced open="{{" close="}}" separators=",">
- <xsl:for-each select = "*[position()>1]">
- <xsl:apply-templates select = "." mode="semantics"/>
- </xsl:for-each>
- </m:mfenced>
- </xsl:if>
- </m:mrow>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:minus[1]]">
- <xsl:param name="IN_PREC" select="$NO_PREC"/>
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:choose>
- <xsl:when test="$IN_PREC > $MINUS_PREC or $IN_PREC=$MINUS_PREC and
- $PARAM=$PAR_SAME">
- <!-- HELM: m:mrow is now used when the minus operator is unary.
- Igor used m:mfenced instead. -->
- <xsl:choose>
- <xsl:when test="count(*)=2">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="minus">
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAR_YES"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </m:mrow>
- </xsl:when>
- <xsl:otherwise>
- <m:mfenced separators="">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="minus">
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAR_YES"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </m:mfenced>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $FUNCTION_PREC
- and not($SEM_SW=$SEM_ALL) and not($SEM_SW=$SEM_XREF)
- and not($SEM_SW=$SEM_XREF_EXT)">
- <xsl:apply-templates select="." mode="minus">
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="minus">
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </m:mrow>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:minus[1]]" mode="minus">
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:if test="not(*[3])">
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:minus/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:minus/@id"/>
- </xsl:attribute>
- </xsl:if>-</m:mo>
- <xsl:apply-templates select="*[2]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$NEG_PREC"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- </xsl:if>
- <xsl:if test="*[3]">
- <xsl:apply-templates select="*[2]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$MINUS_PREC"/>
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:minus/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:minus/@id"/>
- </xsl:attribute>
- </xsl:if>-</m:mo>
- <xsl:apply-templates select="*[3]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$MINUS_PREC"/>
- <xsl:with-param name="PARAM" select="$PAR_SAME"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- </xsl:if>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:plus[1]]">
- <xsl:param name="IN_PREC" select="$NO_PREC"/>
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:choose>
- <xsl:when test="$IN_PREC > $PLUS_PREC or $IN_PREC=$PLUS_PREC and
- $PARAM=$PAR_SAME">
- <m:mfenced separators="">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="plus">
- <xsl:with-param name="PARAM" select="$IN_PREC"/>
- <xsl:with-param name="PAREN" select="$PAR_YES"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </m:mfenced>
- </xsl:when>
- <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $FUNCTION_PREC
- and not($SEM_SW=$SEM_ALL) and not($SEM_SW=$SEM_XREF)
- and not($SEM_SW=$SEM_XREF_EXT)">
- <xsl:apply-templates select="." mode="plus">
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="plus">
- <xsl:with-param name="PARAM" select="$IN_PREC"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </m:mrow>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:plus[1]]" mode="plus">
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:if test="*[2]">
- <xsl:apply-templates select="*[2]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$PLUS_PREC"/>
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- <xsl:for-each select = "*[position()>2]">
- <xsl:choose>
- <xsl:when test=". < 0">
- <m:mo>-</m:mo>
- <m:mn> <xsl:value-of select="-."/> </m:mn>
- </xsl:when>
- <xsl:when test="self::m:apply[m:minus[1]] and not(*[3])">
- <xsl:apply-templates select="." mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$PLUS_PREC"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and ../m:plus/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="../m:plus/@id"/>
- </xsl:attribute>
- </xsl:if>+</m:mo>
- <xsl:apply-templates select="." mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$PLUS_PREC"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- </xsl:if>
-</xsl:template>
-
-<!-- HELM WARNING: power id is lost! -->
-<!-- msup should maintain the power definitionURL info but also the
- reference to apply -->
-<xsl:template match = "m:apply[m:power[1]]">
- <xsl:choose>
- <xsl:when test="*[2]=m:apply[m:ln[1] | m:log[1] | m:abs[1] |
- m:gcd[1] | m:lcm[1] | m:sin[1] | m:cos[1] | m:tan[1] |
- m:sec[1] | m:csc[1] | m:cot[1] | m:sinh[1] |
- m:cosh[1] | m:tanh[1] | m:sech[1] | m:csch[1] |
- m:coth[1] | m:arcsin[1] | m:arccos[1] |
- m:arctan[1] | m:arcsec[1] | m:arccsc[1] |
- m:arccot[1] | m:arcsinh[1] | m:arccosh[1] |
- m:arctanh[1] | m:arcsech[1] | m:arccsch [1]|
- m:arccoth[1] ]">
- <xsl:apply-templates select="*[2]" mode = "semantics"/>
- </xsl:when>
- <xsl:otherwise>
- <m:msup>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select = "*[2]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- <xsl:apply-templates select = "*[3]" mode = "semantics"/>
- </m:msup>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:rem[1] | m:divide[1]]">
- <xsl:param name="IN_PREC" select="$NO_PREC"/>
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:choose>
- <xsl:when test="$IN_PREC > $DIV_PREC or $IN_PREC=$DIV_PREC and
- $PARAM=$PAR_SAME">
- <m:mfenced separators="">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="remdiv">
- <xsl:with-param name="PARAM" select="$IN_PREC"/>
- <xsl:with-param name="PAREN" select="$PAR_YES"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </m:mfenced>
- </xsl:when>
- <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $FUNCTION_PREC
- and not($SEM_SW=$SEM_ALL) and not($SEM_SW=$SEM_XREF)
- and not($SEM_SW=$SEM_XREF_EXT)">
- <xsl:apply-templates select="." mode="remdiv">
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="remdiv">
- <xsl:with-param name="PARAM" select="$IN_PREC"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </m:mrow>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:rem[1] | m:divide[1]]" mode="remdiv">
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:apply-templates select = "*[2]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$DIV_PREC"/>
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- <m:mo>
- <xsl:if test="m:rem">
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:rem/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:rem/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:value-of select="'%'"/>
- </xsl:if>
- <xsl:if test="m:divide">
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:divide/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:divide/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:value-of select="'/'"/>
- </xsl:if>
- </m:mo>
- <xsl:apply-templates select = "*[3]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$DIV_PREC"/>
- <xsl:with-param name="PARAM" select="$PAR_SAME"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:times[1]]">
- <xsl:param name="IN_PREC" select="$NO_PREC"/>
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:choose>
- <xsl:when test="$IN_PREC > $MUL_PREC or $IN_PREC=$MUL_PREC and
- $PARAM=$PAR_SAME">
- <m:mfenced separators="">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="times">
- <xsl:with-param name="PARAM" select="$IN_PREC"/>
- <xsl:with-param name="PAREN" select="$PAR_YES"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </m:mfenced>
- </xsl:when>
- <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $FUNCTION_PREC
- and not($SEM_SW=$SEM_ALL) and not($SEM_SW=$SEM_XREF)
- and not($SEM_SW=$SEM_XREF_EXT)">
- <xsl:apply-templates select="." mode="times">
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="times">
- <xsl:with-param name="PARAM" select="$IN_PREC"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </m:mrow>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:times[1]]" mode="times">
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:apply-templates select="*[2]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$MUL_PREC"/>
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- <xsl:if test="*[3]">
- <xsl:for-each select = "*[position()>2]">
-<!-- HELM: to distinguish between * and the application -->
-<!-- Was:
- <m:mo><xsl:text disable-output-escaping='yes'>⁢</xsl:text></m:mo>
- Now is: -->
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and ../m:times/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="../m:times/@id"/>
- </xsl:attribute>
- </xsl:if>*</m:mo>
- <xsl:apply-templates select="." mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$MUL_PREC"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- </xsl:for-each>
- </xsl:if>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:root[1]]">
- <m:msqrt>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:if test="*[2]=m:degree">
- <xsl:apply-templates select="*[3]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- <xsl:apply-templates select="*[2]" mode = "semantics"/>
- </xsl:if>
- <xsl:if test="not(*[2]=m:degree)">
- <xsl:apply-templates select="*[2]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- <m:mn>2</m:mn>
- </xsl:if>
- </m:msqrt>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:gcd[1]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:if test="not(parent::m:apply[m:power[1]])">
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:gcd/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:gcd/@id"/>
- </xsl:attribute>
- </xsl:if>gcd</m:mo>
- </xsl:if>
- <xsl:if test="parent::m:apply[m:power[1]]">
- <m:msup>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:gcd/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:gcd/@id"/>
- </xsl:attribute>
- </xsl:if>gcd</m:mo>
- <xsl:apply-templates select = "../*[3]" mode = "semantics"/>
- </m:msup>
- </xsl:if>
- <m:mfenced separators=",">
- <xsl:for-each select = "*[position()>1]">
- <xsl:apply-templates select = "." mode="semantics"/>
- </xsl:for-each>
- </m:mfenced>
- </m:mrow>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:and[1]]">
- <xsl:param name="IN_PREC" select="$NO_PREC"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:choose>
- <xsl:when test="$IN_PREC > $AND_PREC">
- <m:mfenced separators="">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="and">
- <xsl:with-param name="PARAM" select="$IN_PREC"/>
- <xsl:with-param name="PAREN" select="$PAR_YES"/>
- </xsl:apply-templates>
- </m:mfenced>
- </xsl:when>
- <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $FUNCTION_PREC
- and not($SEM_SW=$SEM_ALL) and not($SEM_SW=$SEM_XREF)
- and not($SEM_SW=$SEM_XREF_EXT)">
- <xsl:apply-templates select="." mode="and">
- <xsl:with-param name="PARAM" select="$IN_PREC"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="and">
- <xsl:with-param name="PARAM" select="$IN_PREC"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </m:mrow>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:and[1]]" mode="and">
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:apply-templates select="*[2]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$AND_PREC"/>
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- <xsl:for-each select = "*[position()>2]">
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and ../m:and/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="../m:and/@id"/>
- </xsl:attribute>
- </xsl:if><xsl:text disable-output-escaping='yes'>∧</xsl:text></m:mo>
- <xsl:apply-templates select="." mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$AND_PREC"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- </xsl:for-each>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:or[1]]">
- <xsl:param name="IN_PREC" select="$NO_PREC"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:choose>
- <xsl:when test="$IN_PREC > $OR_PREC">
- <m:mfenced separators="">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="or">
- <xsl:with-param name="PARAM" select="$IN_PREC"/>
- <xsl:with-param name="PAREN" select="$PAR_YES"/>
- </xsl:apply-templates>
- </m:mfenced>
- </xsl:when>
- <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $FUNCTION_PREC
- and not($SEM_SW=$SEM_ALL) and not($SEM_SW=$SEM_XREF)
- and not($SEM_SW=$SEM_XREF_EXT)">
- <xsl:apply-templates select="." mode="or">
- <xsl:with-param name="PARAM" select="$IN_PREC"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="or">
- <xsl:with-param name="PARAM" select="$IN_PREC"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </m:mrow>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:or[1]]" mode="or">
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:apply-templates select="*[2]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$OR_PREC"/>
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- <xsl:for-each select = "*[position()>2]">
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and ../m:or/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="../m:or/@id"/>
- </xsl:attribute>
- </xsl:if><xsl:text disable-output-escaping='yes'>∨</xsl:text></m:mo>
- <xsl:apply-templates select="." mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$OR_PREC"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- </xsl:for-each>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:xor[1]]">
- <xsl:param name="IN_PREC" select="$NO_PREC"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:choose>
- <xsl:when test="$IN_PREC > $XOR_PREC">
- <m:mfenced separators="">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="xor">
- <xsl:with-param name="PARAM" select="$IN_PREC"/>
- <xsl:with-param name="PAREN" select="$PAR_YES"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </m:mfenced>
- </xsl:when>
- <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $FUNCTION_PREC
- and not($SEM_SW=$SEM_ALL)">
- <xsl:apply-templates select="." mode="xor">
- <xsl:with-param name="PARAM" select="$IN_PREC"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="xor">
- <xsl:with-param name="PARAM" select="$IN_PREC"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </m:mrow>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:xor[1]]" mode="xor">
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:apply-templates select="*[2]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$XOR_PREC"/>
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- <xsl:for-each select = "*[position()>2]">
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and ../m:xor/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="../m:xor/@id"/>
- </xsl:attribute>
- </xsl:if><xsl:text disable-output-escaping='yes'>⊻</xsl:text></m:mo>
- <xsl:apply-templates select="." mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$XOR_PREC"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- </xsl:for-each>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:not[1]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
-<!-- HELM: was <m:mo>not</m:mo>
- Now is -->
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:not/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:not/@id"/>
- </xsl:attribute>
- </xsl:if>¬</m:mo>
- <xsl:apply-templates select = "*[2]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
- </xsl:apply-templates>
- </m:mrow>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:forall[1]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:forall/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:forall/@id"/>
- </xsl:attribute>
- </xsl:if>for all</m:mo>
- <xsl:if test="count(m:bvar) > 1">
- <m:mfenced separators=",">
- <xsl:for-each select = "m:bvar">
- <xsl:apply-templates select = "." mode="semantics"/>
- </xsl:for-each>
- </m:mfenced>
- </xsl:if>
- <xsl:if test="count(m:bvar)=1">
- <xsl:apply-templates select = "m:bvar" mode="semantics"/>
- </xsl:if>
- <xsl:if test="m:condition">
- <m:mo>:</m:mo>
- <xsl:apply-templates select = "m:condition/*" mode = "semantics"/>
- <m:mo>,</m:mo>
- </xsl:if>
- <xsl:apply-templates select = "*[position()>1 and not(self::m:bvar) and
- not(self::m:condition)]" mode = "semantics"/>
- </m:mrow>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:exists[1]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:exists/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:exists/@id"/>
- </xsl:attribute>
- </xsl:if><xsl:text disable-output-escaping='yes'>∃</xsl:text> </m:mo>
- <xsl:if test="count(m:bvar) > 1">
- <m:mfenced separators=",">
- <xsl:for-each select = "m:bvar">
- <xsl:apply-templates select = "." mode="semantics"/>
- </xsl:for-each>
- </m:mfenced>
- </xsl:if>
- <xsl:if test="count(m:bvar)=1">
- <xsl:apply-templates select = "m:bvar" mode="semantics"/>
- </xsl:if>
- <xsl:if test="m:condition">
- <m:mo>,</m:mo>
- <xsl:apply-templates select = "m:condition/*" mode = "semantics"/>
- </xsl:if>
- <xsl:if test="*[position()>1 and not(self::m:bvar) and not(self::m:condition)]">
- <m:mo>:</m:mo>
- <xsl:apply-templates select = "*[position()>1 and not(self::m:bvar) and
- not(self::m:condition)]" mode = "semantics"/>
- </xsl:if>
- </m:mrow>
-</xsl:template>
-
-<!-- HELM WARNING: abs id was lost! -->
-<xsl:template match = "m:apply[m:abs[1]]">
- <xsl:if test="not(parent::m:apply[m:power[1]])">
-<!-- HELM: was
- <m:mfenced open="|" close="|" separators="">
- Now is: mrow + mo -->
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:abs/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:abs/@id"/>
- </xsl:attribute>
- </xsl:if>|</m:mo>
- <xsl:apply-templates select = "*[position()>1]" mode = "semantics"/>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:abs/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:abs/@id"/>
- </xsl:attribute>
- </xsl:if>|</m:mo>
-<!-- HELM: </m:mfenced> -->
- </m:mrow>
- </xsl:if>
- <xsl:if test="parent::m:apply[m:power[1]]">
- <m:msup>
-<!-- HELM: was
- <m:mfenced open="|" close="|" separators="">
- Now is: mrow + mo -->
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:abs/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:abs/@id"/>
- </xsl:attribute>
- </xsl:if>|</m:mo>
- <xsl:apply-templates select = "*[position()>1]" mode = "semantics"/>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:abs/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:abs/@id"/>
- </xsl:attribute>
- </xsl:if>|</m:mo>
-<!-- HELM: </m:mfenced> -->
- </m:mrow>
- <xsl:apply-templates select = "../*[3]" mode = "semantics"/>
- </m:msup>
- </xsl:if>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:conjugate[1]]">
- <m:mover>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mrow>
- <xsl:apply-templates select = "*[position()>1]" mode = "semantics"/>
- </m:mrow>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:conjugate/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:conjugate/@id"/>
- </xsl:attribute>
- </xsl:if><xsl:text disable-output-escaping='yes'>̲</xsl:text> </m:mo>
- </m:mover>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:arg[1] | m:real[1] | m:imaginary[1]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mo>
- <xsl:if test="m:arg">
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:arg/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:arg/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:value-of select="'Arg'"/>
- </xsl:if>
- <xsl:if test="m:real">
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:real/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:real/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:value-of select="'Re'"/>
- </xsl:if>
- <xsl:if test="m:imaginary">
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:imaginary/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:imaginary/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:value-of select="'Im'"/>
- </xsl:if>
- </m:mo>
- <m:mfenced separators="">
- <xsl:apply-templates select = "*[2]" mode = "semantics"/>
- </m:mfenced>
- </m:mrow>
-</xsl:template>
-
-<!-- HELM: was (it didn't match with prefixed MathML)
-<xsl:template match="m:apply[child::*[position()=1 and name()='lcm']]">
- Now is: -->
-<xsl:template match="m:apply[child::*[position()=1 and self::m:lcm]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:if test="not(parent::m:apply[m:power[1]])">
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:lcm/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:lcm/@id"/>
- </xsl:attribute>
- </xsl:if>lcm</m:mo>
- </xsl:if>
- <xsl:if test="parent::m:apply[m:power[1]]">
- <m:msup>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:lcm/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:lcm/@id"/>
- </xsl:attribute>
- </xsl:if>lcm</m:mo>
- <xsl:apply-templates select = "../*[3]" mode = "semantics"/>
- </m:msup>
- </xsl:if>
- <m:mfenced separators=",">
- <xsl:for-each select = "*[position()>1]">
- <xsl:apply-templates select = "." mode="semantics"/>
- </xsl:for-each>
- </m:mfenced>
- </m:mrow>
- </xsl:template>
-
-<!-- HELM: was (it didn't match with prefixed MathML)
-<xsl:template match="m:apply[child::*[position()=1 and name()='floor']]">
- Now is: -->
-<xsl:template match="m:apply[child::*[position()=1 and self::m:floor]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:floor/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:floor/@id"/>
- </xsl:attribute>
- </xsl:if>
-<!-- HELM: not rendered correctly <![CDATA[⌊]]> -->
- <xsl:text disable-output-escaping="yes">⌊</xsl:text>
- </m:mo>
- <xsl:apply-templates select="child::*[position()=last()]" mode="semantics"/>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:floor/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:floor/@id"/>
- </xsl:attribute>
- </xsl:if>
-<!-- HELM: not rendered correctly <![CDATA[⌋]]> -->
-<xsl:text disable-output-escaping="yes">⌋</xsl:text>
- </m:mo>
-</m:mrow>
-</xsl:template>
-
-<!-- HELM: was (it didn't match with prefixed MathML)
-<xsl:template match="m:apply[child::*[position()=1 and name()='ceiling']]">
- Now is: -->
-<xsl:template match="m:apply[child::*[position()=1 and self::m:ceiling]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:ceiling/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:ceiling/@id"/>
- </xsl:attribute>
- </xsl:if>
-<!-- HELM: not rendered correctly <![CDATA[⌈]]> -->
- <xsl:text disable-output-escaping="yes">⌈</xsl:text>
- </m:mo>
- <xsl:apply-templates select="child::*[position()=last()]" mode="semantics"/>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:ceiling/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:ceiling/@id"/>
- </xsl:attribute>
- </xsl:if>
-<!-- HELM: not rendered correctly <![CDATA[⌉]]> -->
- <xsl:text disable-output-escaping="yes">⌉</xsl:text>
- </m:mo>
- </m:mrow>
-</xsl:template>
-
-
-<!-- ***************** RELATIONS ***************** -->
-
-<xsl:template match = "m:apply[m:neq | m:approx | m:tendsto | m:implies
- | m:in | m:notin | m:notsubset | m:notprsubset
- | m:subset | m:prsubset | m:eq | m:gt | m:lt
- | m:geq | m:leq | m:equivalent | m:factorof]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:if test="*[1]=m:neq or *[1]=m:approx or *[1]=m:factorof or *[1]=m:tendsto or
- *[1]=m:implies or *[1]=m:in or *[1]=m:notin or
- *[1]=m:notsubset or *[1]=m:notprsubset">
- <xsl:apply-templates select = "*[2]" mode = "semantics"/>
- <m:mo>
- <xsl:if test="*[1]=m:neq">
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:neq/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:neq/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:text disable-output-escaping='yes'>≠</xsl:text>
- </xsl:if>
- <xsl:if test="*[1]=m:approx">
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:approx/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:approx/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:text disable-output-escaping='yes'>≊</xsl:text>
- </xsl:if>
- <xsl:if test="*[1]=m:factorof">
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:factorof/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:factorof/@id"/>
- </xsl:attribute>
- </xsl:if>
- |
- </xsl:if>
- <xsl:if test="*[1]=m:tendsto">
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:tendsto/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:tendsto/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:text disable-output-escaping='yes'>→</xsl:text>
- </xsl:if>
- <xsl:if test="*[1]=m:implies">
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:implies/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:implies/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:text disable-output-escaping='yes'>⇒</xsl:text>
- </xsl:if>
- <xsl:if test="*[1]=m:in">
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:in/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:in/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:text disable-output-escaping='yes'>∈</xsl:text>
- </xsl:if>
- <xsl:if test="*[1]=m:notin">
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:notin/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:notin/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:text disable-output-escaping='yes'>∉</xsl:text>
- </xsl:if>
- <xsl:if test="*[1]=m:notsubset">
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:notsubset/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:notsubset/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:text disable-output-escaping='yes'>⊄</xsl:text>
- </xsl:if>
- <xsl:if test="*[1]=m:notprsubset">
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:notprsubset/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:notprsubset/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:text disable-output-escaping='yes'>⊈</xsl:text>
- </xsl:if>
- </m:mo>
- <xsl:apply-templates select = "*[3]" mode = "semantics"/>
- <xsl:if test="*[1]=m:tendsto and m:tendsto[1][@type='below']">
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:tendsto/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:tendsto/@id"/>
- </xsl:attribute>
- </xsl:if>-</m:mo>
- </xsl:if>
- <xsl:if test="*[1]=m:tendsto and m:tendsto[1][@type='above']">
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:tendsto/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:tendsto/@id"/>
- </xsl:attribute>
- </xsl:if>+</m:mo>
- </xsl:if>
- </xsl:if>
- <xsl:if test="*[1]=m:subset or *[1]=m:prsubset or *[1]=m:eq or *[1]=m:gt
- or *[1]=m:lt or *[1]=m:geq or *[1]=m:leq or *[1]=m:equivalent">
- <xsl:apply-templates select = "*[2]" mode="semantics"/>
- <xsl:for-each select = "*[position()>2]">
- <m:mo>
- <xsl:if test="../*[self::m:subset][1]">
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and ../m:subset/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="../m:subset/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:text disable-output-escaping='yes'>⊆</xsl:text>
- </xsl:if>
- <xsl:if test="../*[self::m:prsubset][1]">
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and ../m:prsubset/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="../m:prsubset/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:text disable-output-escaping='yes'>⊂</xsl:text>
- </xsl:if>
- <xsl:if test="../*[self::m:eq][1]">
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and ../m:eq/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="../m:eq/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:value-of select="'='"/>
- </xsl:if>
- <xsl:if test="../*[self::m:gt][1]">
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and ../m:gt/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="../m:gt/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:value-of select="'>'"/>
- </xsl:if>
- <xsl:if test="../*[self::m:lt][1]">
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and ../m:lt/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="../m:lt/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:value-of select="'<'"/>
- </xsl:if>
- <xsl:if test="../*[self::m:geq][1]">
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and ../m:geq/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="../m:geq/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:text disable-output-escaping='yes'>≥</xsl:text>
- </xsl:if>
- <xsl:if test="../*[self::m:leq][1]">
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and ../m:leq/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="../m:leq/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:text disable-output-escaping='yes'>≤</xsl:text>
- </xsl:if>
- <xsl:if test="../*[self::m:equivalent][1]">
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and ../m:equivalent/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="../m:equivalent/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:text disable-output-escaping='yes'>≡</xsl:text>
- </xsl:if>
- </m:mo>
- <xsl:apply-templates select = "." mode="semantics"/>
- </xsl:for-each>
- </xsl:if>
- </m:mrow>
-</xsl:template>
-
-
-<!-- ***************** CALCULUS ***************** -->
-
-<xsl:template match = "m:apply[*[1][self::m:ln]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="parent::m:apply[m:power[1]]">
- <m:msup>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:ln/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:ln/@id"/>
- </xsl:attribute>
- </xsl:if>ln</m:mo>
- <xsl:apply-templates select = "../*[3]" mode = "semantics"/>
- </m:msup>
- </xsl:when>
- <xsl:otherwise>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:ln/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:ln/@id"/>
- </xsl:attribute>
- </xsl:if>ln</m:mo>
- </xsl:otherwise>
- </xsl:choose>
- <m:mo><xsl:text disable-output-escaping='yes'>⁡</xsl:text></m:mo>
- <xsl:apply-templates select = "*[2]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
- </xsl:apply-templates>
- </m:mrow>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:log[1]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="parent::m:apply[m:power[1]]">
- <xsl:if test="not(*[2]=m:logbase)">
- <m:msup>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:log/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:log/@id"/>
- </xsl:attribute>
- </xsl:if>log</m:mo>
- <xsl:apply-templates select = "../*[3]" mode = "semantics"/>
- </m:msup>
- </xsl:if>
- <xsl:if test="*[2]=m:logbase">
- <m:msubsup>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:log/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:log/@id"/>
- </xsl:attribute>
- </xsl:if>log</m:mo>
- <xsl:apply-templates select = "../*[3]" mode = "semantics"/>
- <xsl:apply-templates select = "m:logbase" mode = "semantics"/>
- </m:msubsup>
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- <xsl:if test="not(*[2]=m:logbase)">
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:log/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:log/@id"/>
- </xsl:attribute>
- </xsl:if>log</m:mo>
- </xsl:if>
- <xsl:if test="*[2]=m:logbase">
- <m:msub>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:log/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:log/@id"/>
- </xsl:attribute>
- </xsl:if>log</m:mo>
- <xsl:apply-templates select = "m:logbase" mode = "semantics"/>
- </m:msub>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- <m:mo><xsl:text disable-output-escaping='yes'>⁡</xsl:text></m:mo>
- <xsl:if test="*[2]=m:logbase">
- <xsl:apply-templates select = "*[3]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
- </xsl:apply-templates>
- </xsl:if>
- <xsl:if test="not(*[2]=m:logbase)">
- <xsl:apply-templates select = "*[2]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
- </xsl:apply-templates>
- </xsl:if>
- </m:mrow>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:diff[1]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:if test="*[2]=m:bvar and m:bvar[*[2]=m:degree]">
- <m:mfrac>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:diff/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:diff/@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:msup>
- <m:mo>d</m:mo>
- <xsl:apply-templates select = "m:bvar/m:degree" mode = "semantics"/>
- </m:msup>
- <m:mrow>
- <m:mo>d</m:mo>
- <m:msup>
- <xsl:apply-templates select = "m:bvar/*[1]" mode = "semantics"/>
- <xsl:apply-templates select = "m:bvar/m:degree" mode = "semantics"/>
- </m:msup>
- </m:mrow>
- </m:mfrac>
- </xsl:if>
- <xsl:if test="*[2]=m:bvar and not(m:bvar[*[2]=m:degree])">
- <m:mfrac>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:diff/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:diff/@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mo>d</m:mo>
- <m:mrow>
- <m:mo>d</m:mo>
- <xsl:apply-templates select = "m:bvar/*[1]" mode = "semantics"/>
- </m:mrow>
- </m:mfrac>
- </xsl:if>
- <xsl:apply-templates select = "*[3]" mode = "semantics"/>
- </m:mrow>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:partialdiff[1]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:for-each select = "m:bvar">
- <xsl:if test="*[last()]=m:degree">
- <m:mfrac>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and ../m:partialdiff/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="../m:partialdiff/@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:msup>
- <m:mo>d</m:mo>
- <xsl:apply-templates select = "m:degree" mode = "semantics"/>
- </m:msup>
- <m:mrow>
- <m:mo>d</m:mo>
- <m:msup>
- <xsl:apply-templates select = "*[1]" mode = "semantics"/>
- <xsl:apply-templates select = "m:degree" mode = "semantics"/>
- </m:msup>
- </m:mrow>
- </m:mfrac>
- </xsl:if>
- <xsl:if test="not(*[last()]=m:degree)">
- <m:mfrac>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and ../m:partialdiff/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="../m:partialdiff/@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mo>d</m:mo>
- <m:mrow>
- <m:mo>d</m:mo>
- <xsl:apply-templates select = "*[1]" mode = "semantics"/>
- </m:mrow>
- </m:mfrac>
- </xsl:if>
- </xsl:for-each>
- <xsl:apply-templates select = "*[last()]" mode = "semantics"/>
- </m:mrow>
-</xsl:template>
-
-<xsl:template match = "m:lowlimit | m:uplimit | m:bvar | m:degree | m:logbase">
- <xsl:apply-templates select="*" mode = "semantics"/>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:divergence[1] | m:grad[1] | m:curl[1]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mo>
- <xsl:if test="*[1]=m:divergence">
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:divergence/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:divergence/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:value-of select="'div'"/>
- </xsl:if>
- <xsl:if test="*[1]=m:grad">
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:grad/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:grad/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:value-of select="'grad'"/>
- </xsl:if>
- <xsl:if test="*[1]=m:curl">
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:curl/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:curl/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:value-of select="'curl'"/>
- </xsl:if>
- </m:mo>
- <xsl:choose>
- <xsl:when test="*[2]=m:ci">
- <xsl:apply-templates select = "*[2]" mode = "semantics"/>
- </xsl:when>
- <xsl:otherwise>
- <m:mfenced separators="">
- <xsl:apply-templates select = "*[2]" mode = "semantics"/>
- </m:mfenced>
- </xsl:otherwise>
- </xsl:choose>
- </m:mrow>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:laplacian[1]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:msup>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:laplacian/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:laplacian/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:text disable-output-escaping='yes'>Δ</xsl:text></m:mo>
- <m:mn>2</m:mn>
- </m:msup>
- <xsl:apply-templates select = "*[2]" mode = "semantics"/>
- </m:mrow>
-</xsl:template>
-
-
-<!-- ***************** SET THEORY ***************** -->
-
-<xsl:template match = "m:set | m:list">
- <m:mfenced open="{{" close="}}" separators="">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:if test="*[1]=m:bvar and *[2]=m:condition">
- <xsl:apply-templates select="m:bvar" mode = "semantics"/>
- <m:mo>|</m:mo>
- <xsl:apply-templates select="m:condition" mode = "semantics"/>
- </xsl:if>
- <xsl:if test="*[1]=m:condition and not(child::m:bvar)">
- <m:mfenced open="" close="" separators=",">
- <xsl:for-each select = "*[not(self::m:condition) and not(self::m:bvar)]">
- <xsl:apply-templates select = "." mode="semantics"/>
- </xsl:for-each>
- </m:mfenced>
- <m:mo>|</m:mo>
- <xsl:apply-templates select="m:condition" mode = "semantics"/>
- </xsl:if>
- <xsl:if test="not(child::m:bvar) and not(child::m:condition)">
- <m:mfenced open="" close="" separators=",">
- <xsl:for-each select = "*">
- <xsl:apply-templates select = "." mode="semantics"/>
- </xsl:for-each>
- </m:mfenced>
- </xsl:if>
- </m:mfenced>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:union[1]]">
- <xsl:param name="IN_OP" select="$DOESNT_MATTER"/>
- <xsl:param name="IN_PREC" select="$NO_PREC"/>
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:choose>
- <xsl:when test="$IN_PREC > $UNION_PREC or $IN_PREC=$UNION_PREC
- and $PARAM=$PAR_SAME and not($IN_OP=$UNION_OP)">
- <m:mfenced separators="">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="union">
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </m:mfenced>
- </xsl:when>
- <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $FUNCTION_PREC
- and not($SEM_SW=$SEM_ALL) and not($SEM_SW=$SEM_XREF)
- and not($SEM_SW=$SEM_XREF_EXT)">
- <xsl:apply-templates select="." mode="union">
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="union">
- <xsl:with-param name="IN_OP" select="$UNION_OP"/>
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </m:mrow>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:union[1]]" mode="union">
- <xsl:param name="IN_OP" select="$DOESNT_MATTER"/>
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:apply-templates select = "*[2]" mode="semantics">
- <xsl:with-param name="IN_PREC" select="$UNION_PREC"/>
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- <xsl:for-each select = "*[position()>2]">
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and ../m:union/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="../m:union/@id"/>
- </xsl:attribute>
- </xsl:if>⋃</m:mo>
-<!-- HELM: not rendered correctly <![CDATA[⋃]]> -->
- <!-- <xsl:text disable-output-escaping="yes">⋃</xsl:text></m:mo>-->
- <xsl:apply-templates select = "." mode="semantics">
- <xsl:with-param name="PARAM" select="$PAR_SAME"/> <!--new-->
- <xsl:with-param name="IN_PREC" select="$UNION_PREC"/>
- <xsl:with-param name="IN_OP" select="$UNION_OP"/> <!--new-->
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- </xsl:for-each>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:intersect[1]]">
- <xsl:param name="IN_OP" select="$DOESNT_MATTER"/>
- <xsl:param name="IN_PREC" select="$NO_PREC"/>
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:choose>
- <xsl:when test="$IN_PREC > $INTERSECT_PREC or $IN_PREC=$INTERSECT_PREC
- and $PARAM=$PAR_SAME and not($IN_OP=$INTERSECT_OP)">
- <m:mfenced separators="">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="intersect">
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </m:mfenced>
- </xsl:when>
- <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $FUNCTION_PREC
- and not($SEM_SW=$SEM_ALL) and not($SEM_SW=$SEM_XREF)
- and not($SEM_SW=$SEM_XREF_EXT)">
- <xsl:apply-templates select="." mode="intersect">
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="intersect">
- <xsl:with-param name="IN_OP" select="$INTERSECT_OP"/>
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </m:mrow>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:intersect[1]]" mode="intersect">
- <xsl:param name="IN_OP" select="$DOESNT_MATTER"/>
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:apply-templates select = "*[2]" mode="semantics">
- <xsl:with-param name="IN_PREC" select="$INTERSECT_PREC"/>
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- <xsl:for-each select = "*[position()>2]">
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and ../m:intersect/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="../m:intersect/@id"/>
- </xsl:attribute>
- </xsl:if>
-<!-- HELM: not rendered correctly <![CDATA[⋂]]> -->
- <xsl:text disable-output-escaping="yes">⋂</xsl:text></m:mo>
- <xsl:apply-templates select = "." mode="semantics">
- <xsl:with-param name="PARAM" select="$PAR_SAME"/> <!--new-->
- <xsl:with-param name="IN_PREC" select="$INTERSECT_PREC"/>
- <xsl:with-param name="IN_OP" select="$UNION_OP"/> <!--new-->
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- </xsl:for-each>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:setdiff[1]]">
- <xsl:param name="IN_PREC" select="$NO_PREC"/>
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:choose>
- <xsl:when test="$IN_PREC > $SETDIFF_PREC or $IN_PREC=$SETDIFF_PREC
- and $PARAM=$PAR_SAME">
- <m:mfenced separators="">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="setdiff">
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </m:mfenced>
- </xsl:when>
- <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $FUNCTION_PREC
- and not($SEM_SW=$SEM_ALL) and not($SEM_SW=$SEM_XREF)
- and not($SEM_SW=$SEM_XREF_EXT)">
- <xsl:apply-templates select="." mode="setdiff">
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="setdiff">
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </m:mrow>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:setdiff[1]]" mode="setdiff">
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:apply-templates select = "*[2]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$SETDIFF_PREC"/>
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:setdiff/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:setdiff/@id"/>
- </xsl:attribute>
- </xsl:if>\</m:mo>
- <xsl:apply-templates select = "*[3]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$SETDIFF_PREC"/>
- <xsl:with-param name="PARAM" select="$PAR_SAME"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:cartesianproduct[1]]">
- <xsl:param name="IN_PREC" select="$NO_PREC"/>
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:choose>
- <xsl:when test="$IN_PREC > $CARTPROD_PREC or $IN_PREC=$CARTPROD_PREC
- and $PARAM=$PAR_SAME">
- <m:mfenced separators="">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="cartprod">
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </m:mfenced>
- </xsl:when>
- <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $FUNCTION_PREC
- and not($SEM_SW=$SEM_ALL) and not($SEM_SW=$SEM_XREF)
- and not($SEM_SW=$SEM_XREF_EXT)">
- <xsl:apply-templates select="." mode="cartprod">
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="cartprod">
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </m:mrow>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:cartesianproduct[1]]" mode="cartprod">
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:apply-templates select = "*[2]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$CARTPROD_PREC"/>
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- <xsl:for-each select = "*[position()>2]">
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and ../m:cartesianproduct/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="../m:cartesianproduct/@id"/>
- </xsl:attribute>
- </xsl:if>
-<!-- HELM: not rendered correctly <![CDATA[×]]> -->
- <xsl:text disable-output-escaping="yes">×</xsl:text></m:mo>
- <xsl:apply-templates select = "." mode="semantics">
- <xsl:with-param name="IN_PREC" select="$CARTPROD_PREC"/>
- <xsl:with-param name="PARAM" select="$PAR_SAME"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- </xsl:for-each>
-</xsl:template>
-
-<!-- HELM WARNING: card id was lost! -->
-<xsl:template match = "m:apply[m:card[1]]">
-<!-- HELM: was
- <m:mfenced open="|" close="|" separators=",">
- Now is: mrow + mo -->
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:card/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:card/@id"/>
- </xsl:attribute>
- </xsl:if>|</mo>
- <xsl:for-each select = "*[position()>1]">
- <xsl:apply-templates select = "." mode="semantics"/>
- </xsl:for-each>
- <mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:setdiff/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:setdiff/@id"/>
- </xsl:attribute>
- </xsl:if>|</mo>
- </m:mrow>
-<!-- HELM: </m:mfenced> -->
-</xsl:template>
-
-
-<!-- ***************** SEQUENCES AND SERIES ***************** -->
-
-<xsl:template match = "m:apply[m:sum[1] | m:product[1]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="*[2]=m:bvar and m:lowlimit and m:uplimit">
- <m:munderover>
- <m:mo>
- <xsl:if test="*[1]=m:sum">
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:sum/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:sum/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:text disable-output-escaping='yes'>∑</xsl:text>
- </xsl:if>
- <xsl:if test="*[1]=m:product">
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:product/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:product/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:text disable-output-escaping='yes'>∏</xsl:text>
- </xsl:if>
- </m:mo>
- <m:mrow>
- <xsl:apply-templates select = "*[2]" mode = "semantics"/>
- <m:mo>=</m:mo>
- <xsl:apply-templates select = "m:lowlimit" mode = "semantics"/>
- </m:mrow>
- <xsl:apply-templates select = "m:uplimit" mode = "semantics"/>
- </m:munderover>
- <xsl:apply-templates select = "*[5]" mode = "semantics"/>
- </xsl:when>
- <xsl:when test="*[2]=m:bvar and *[3]=m:condition">
- <m:munder>
- <m:mo>
- <xsl:if test="*[1]=m:sum">
- <xsl:text disable-output-escaping='yes'>∑</xsl:text>
- </xsl:if>
- <xsl:if test="*[1]=m:product">
- <xsl:text disable-output-escaping='yes'>∏</xsl:text>
- </xsl:if>
- </m:mo>
- <xsl:apply-templates select = "*[3]" mode = "semantics"/>
- </m:munder>
- <xsl:apply-templates select = "*[4]" mode = "semantics"/>
- </xsl:when>
- <xsl:when test="*[2]=m:domainofapplication">
- <m:munder>
- <m:mo>
- <xsl:if test="*[1]=m:sum">
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:sum/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:sum/@id"/>
- </xsl:attribute>
- </xsl:if>
-<!-- HELM: not rendered correctly <![CDATA[∑]]> -->
- <xsl:text disable-output-escaping="yes">∑</xsl:text>
- </xsl:if>
- <xsl:if test="*[1]=m:product">
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:product/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:product/@id"/>
- </xsl:attribute>
- </xsl:if>
-<!-- HELM: not rendered correctly <![CDATA[∏]]> -->
- <xsl:text disable-output-escaping="yes">∏</xsl:text>
- </xsl:if>
- </m:mo>
- <xsl:apply-templates select="m:domainofapplication" mode = "semantics"/>
- </m:munder>
- <m:mrow>
- <xsl:apply-templates select="*[position()=last()]" mode = "semantics"/>
- </m:mrow>
- </xsl:when>
- </xsl:choose>
- </m:mrow>
- </xsl:template>
-
-<!-- HELM: was (it didn't match with prefixed MathML)
-<xsl:template match="m:apply[child::*[position()=1 and name()='int']]">
- Now is: -->
-<xsl:template match="m:apply[child::*[position()=1 and self::m:int]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="m:condition">
- <m:msub>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:int/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:int/@id"/>
- </xsl:attribute>
- </xsl:if>
-<!-- HELM: not rendered correctly <![CDATA[∫]]> -->
- <xsl:text disable-output-escaping="yes">∫</xsl:text></m:mo>
- <xsl:apply-templates select="m:condition" mode="semantics"/>
- </m:msub>
- <m:mrow>
- <xsl:apply-templates select="*[position()=last()]" mode="semantics"/>
- </m:mrow>
- <m:mrow>
- <m:mo>d</m:mo>
- <xsl:apply-templates select="m:bvar" mode="semantics"/>
- </m:mrow>
- </xsl:when>
- <xsl:when test="m:domainofapplication">
- <m:msub>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:int/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:int/@id"/>
- </xsl:attribute>
- </xsl:if>
-<!-- HELM: not rendered correctly <![CDATA[∫]]> -->
- <xsl:text disable-output-escaping="yes">∫</xsl:text></m:mo>
- <xsl:apply-templates select="m:domainofapplication" mode="semantics"/>
- </m:msub>
- <m:mrow>
- <xsl:apply-templates select="*[position()=last()]" mode="semantics" />
- </m:mrow>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="m:interval">
- <m:msubsup>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:int/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:int/@id"/>
- </xsl:attribute>
- </xsl:if>
-<!-- HELM: not rendered correctly <![CDATA[∫]]> -->
- <xsl:text disable-output-escaping="yes">∫</xsl:text></m:mo>
- <xsl:apply-templates select="m:interval/*[position()=1]" mode="semantics" />
- <xsl:apply-templates select="m:interval/*[position()=2]" mode="semantics"/>
- </m:msubsup>
- <xsl:apply-templates select="*[position()=last()]" mode="semantics"/>
- <m:mo>d</m:mo>
- <xsl:apply-templates select="m:bvar" mode="semantics"/>
- </xsl:when>
- <xsl:when test="m:lowlimit">
- <m:msubsup>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:int/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:int/@id"/>
- </xsl:attribute>
- </xsl:if>
-<!-- HELM: not rendered correctly <![CDATA[∫]]> -->
- <xsl:text disable-output-escaping="yes">∫</xsl:text></m:mo>
- <m:mrow><xsl:apply-templates select="m:lowlimit" mode="semantics"/></m:mrow>
- <m:mrow><xsl:apply-templates select="m:uplimit" mode="semantics"/></m:mrow>
- </m:msubsup>
- <xsl:apply-templates select="*[position()=last()]" mode="semantics"/>
- <m:mo>d</m:mo><xsl:apply-templates select="m:bvar" mode="semantics"/>
- </xsl:when>
- <xsl:otherwise>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:int/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:int/@id"/>
- </xsl:attribute>
- </xsl:if>
-<!-- HELM: not rendered correctly <![CDATA[∫]]> -->
- <xsl:text disable-output-escaping="yes">∫</xsl:text></m:mo>
- <xsl:apply-templates select="*[position()=last()]" mode="semantics"/>
- <m:mo>d</m:mo><xsl:apply-templates select="m:bvar" mode="semantics"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </m:mrow>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:limit[1]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:munder>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:lim/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:lim/@id"/>
- </xsl:attribute>
- </xsl:if>lim</m:mo>
- <m:mrow>
- <xsl:if test="*[2]=m:bvar and *[3]=m:lowlimit">
- <xsl:apply-templates select = "*[2]" mode = "semantics"/>
- <m:mo><xsl:text disable-output-escaping='yes'>→</xsl:text></m:mo>
- <xsl:apply-templates select = "*[3]" mode = "semantics"/>
- </xsl:if>
- <xsl:if test="*[2]=m:bvar and *[3]=m:condition">
- <xsl:apply-templates select = "*[3]" mode = "semantics"/>
- </xsl:if>
- </m:mrow>
- </m:munder>
- <xsl:apply-templates select = "*[4]" mode = "semantics"/>
- </m:mrow>
-</xsl:template>
-
-
-<!-- ***************** TRIGONOMETRY ***************** -->
-
-<xsl:template match = "m:apply[*[1][self::m:sin | self::m:cos |
- self::m:tan | self::m:sec | self::m:csc |
- self::m:cot | self::m:sinh | self::m:cosh |
- self::m:tanh | self::m:sech | self::m:csch |
- self::m:coth | self::m:arcsin | self::m:arccos |
- self::m:arctan | self::m:arcsec | self::m:arccsc |
- self::m:arccot | self::m:arcsinh | self::m:arccosh |
- self::m:arctanh | self::m:arcsech | self::m:arccsch |
- self::m:arccoth ] ]">
-
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:if test="not(parent::m:apply[m:power[1]])">
- <xsl:apply-templates select = "*[1]" mode = "trigonometry"/>
- </xsl:if>
- <xsl:if test="parent::m:apply[m:power[1]]">
- <m:msup>
- <xsl:apply-templates select = "*[1]" mode = "trigonometry"/>
- <xsl:apply-templates select = "../*[3]" mode = "semantics"/>
- </m:msup>
- </xsl:if>
- <m:mo><xsl:text disable-output-escaping='yes'>⁡</xsl:text></m:mo>
- <xsl:apply-templates select = "*[2]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- </m:mrow>
-</xsl:template>
-
-<xsl:template match = "*" mode="trigonometry">
- <m:mo>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="self::m:sin">
- <xsl:value-of select="'sin'"/>
- </xsl:when>
- <xsl:when test="self::m:cos">
- <xsl:value-of select="'cos'"/>
- </xsl:when>
- <xsl:when test="self::m:tan">
- <xsl:value-of select="'tan'"/>
- </xsl:when>
- <xsl:when test="self::m:sec">
- <xsl:value-of select="'sec'"/>
- </xsl:when>
- <xsl:when test="self::m:csc">
- <xsl:value-of select="'csc'"/>
- </xsl:when>
- <xsl:when test="self::m:cot">
- <xsl:value-of select="'cot'"/>
- </xsl:when>
- <xsl:when test="self::m:sinh">
- <xsl:value-of select="'sinh'"/>
- </xsl:when>
- <xsl:when test="self::m:cosh">
- <xsl:value-of select="'cosh'"/>
- </xsl:when>
- <xsl:when test="self::m:tanh">
- <xsl:value-of select="'tanh'"/>
- </xsl:when>
- <xsl:when test="self::m:sech">
- <xsl:value-of select="'sech'"/>
- </xsl:when>
- <xsl:when test="self::m:csch">
- <xsl:value-of select="'csch'"/>
- </xsl:when>
- <xsl:when test="self::m:coth">
- <xsl:value-of select="'coth'"/>
- </xsl:when>
- <xsl:when test="self::m:arcsin">
- <xsl:value-of select="'arcsin'"/>
- </xsl:when>
- <xsl:when test="self::m:arccos">
- <xsl:value-of select="'arccos'"/>
- </xsl:when>
- <xsl:when test="self::m:arctan">
- <xsl:value-of select="'arctan'"/>
- </xsl:when>
- <xsl:when test="self::m:arcsec">
- <xsl:value-of select="'arcsec'"/>
- </xsl:when>
- <xsl:when test="self::m:arccsc">
- <xsl:value-of select="'arccsc'"/>
- </xsl:when>
- <xsl:when test="self::m:arccot">
- <xsl:value-of select="'arccot'"/>
- </xsl:when>
- <xsl:when test="self::m:arcsinh">
- <xsl:value-of select="'arcsinh'"/>
- </xsl:when>
- <xsl:when test="self::m:arccosh">
- <xsl:value-of select="'arccosh'"/>
- </xsl:when>
- <xsl:when test="self::m:arctanh">
- <xsl:value-of select="'arctanh'"/>
- </xsl:when>
- <xsl:when test="self::m:arcsech">
- <xsl:value-of select="'arcsech'"/>
- </xsl:when>
- <xsl:when test="self::m:arccsch">
- <xsl:value-of select="'arccsch'"/>
- </xsl:when>
- <xsl:when test="self::m:arccoth">
- <xsl:value-of select="'arccot'"/>
- </xsl:when>
- </xsl:choose>
- </m:mo>
-</xsl:template>
-
-
-<!-- ***************** STATISTICS ***************** -->
-
-<!-- HELM WARNING: mean id was lost! -->
-<xsl:template match = "m:apply[m:mean[1]]">
-<!-- HELM: was
- <m:mfenced open="<" close=">" separators=",">
- Now is: mrow + mo + separator (mo) -->
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:mean/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:mean/@id"/>
- </xsl:attribute>
- </xsl:if><</m:mo>
- <xsl:for-each select = "*[position()>1]">
-<!-- HELM: if added -->
- <xsl:if test="position() != 1">
- <m:mo separator="true">,</m:mo>
- </xsl:if>
- <xsl:apply-templates select = "." mode="semantics"/>
- </xsl:for-each>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:mean/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:mean/@id"/>
- </xsl:attribute>
- </xsl:if>></m:mo>
- </m:mrow>
-<!-- HELM: </m:mfenced> -->
-</xsl:template>
-
-<xsl:template match = "m:apply[m:sdev[1]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:sdev/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:sdev/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:text disable-output-escaping='yes'>σ</xsl:text></m:mo>
- <m:mfenced separators=",">
- <xsl:for-each select = "*[position()>1]">
- <xsl:apply-templates select = "." mode="semantics"/>
- </xsl:for-each>
- </m:mfenced>
- </m:mrow>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:variance[1]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:variance/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:variance/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:text disable-output-escaping='yes'>σ</xsl:text></m:mo>
- <m:msup>
- <m:mfenced separators=",">
- <xsl:for-each select = "*[position()>1]">
- <xsl:apply-templates select = "." mode="semantics"/>
- </xsl:for-each>
- </m:mfenced>
- <m:mn>2</m:mn>
- </m:msup>
- </m:mrow>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:median[1]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:median/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:median/@id"/>
- </xsl:attribute>
- </xsl:if>median</m:mo>
- <m:mfenced separators=",">
- <xsl:for-each select = "*[position()>1]">
- <xsl:apply-templates select = "." mode="semantics"/>
- </xsl:for-each>
- </m:mfenced>
- </m:mrow>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:mode[1]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:mode/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:mode/@id"/>
- </xsl:attribute>
- </xsl:if>mode</m:mo>
- <m:mfenced separators=",">
- <xsl:for-each select = "*[position()>1]">
- <xsl:apply-templates select = "." mode="semantics"/>
- </xsl:for-each>
- </m:mfenced>
- </m:mrow>
-</xsl:template>
-
-<!-- HELM WARNING: mean id was lost! -->
-<xsl:template match = "m:apply[m:moment[1]]">
-<!-- HELM: was
- <m:mfenced open="<" close=">" separators="">
- Now is: mrow + mo -->
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:moment/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:momemt/@id"/>
- </xsl:attribute>
- </xsl:if><</m:mo>
- <xsl:if test="*[2]=m:degree and not(*[3]=m:momentabout)">
- <m:msup>
- <xsl:apply-templates select="*[3]" mode = "semantics"/>
- <xsl:apply-templates select="*[2]" mode = "semantics"/>
- </m:msup>
- </xsl:if>
- <xsl:if test="*[2]=m:degree and *[3]=m:momentabout">
- <m:msup>
- <xsl:apply-templates select="*[4]" mode = "semantics"/>
- <xsl:apply-templates select="*[2]" mode = "semantics"/>
- </m:msup>
- </xsl:if>
- <xsl:if test="not(*[2]=m:degree) and *[2]=m:momentabout">
- <xsl:for-each select = "*[position()>2]">
- <xsl:apply-templates select = "." mode="semantics"/>
- </xsl:for-each>
- </xsl:if>
- <xsl:if test="not(*[2]=m:degree) and not(*[2]=m:momentabout)">
- <xsl:for-each select = "*[position()>1]">
- <xsl:apply-templates select = "." mode="semantics"/>
- </xsl:for-each>
- </xsl:if>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:mean/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:mean/@id"/>
- </xsl:attribute>
- </xsl:if>></m:mo>
- </m:mrow>
-<!-- HELM: </m:mfenced> -->
-</xsl:template>
-
-
-<!-- ***************** LINEAR ALGEBRA ***************** -->
-
-<xsl:template match="m:vector">
- <m:mfenced separators="">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mtable>
- <xsl:for-each select="*">
- <m:mtd>
- <xsl:apply-templates select="." mode = "semantics"/>
- </m:mtd>
- </xsl:for-each>
- </m:mtable>
- </m:mfenced>
-</xsl:template>
-
-<xsl:template match = "m:matrix">
- <m:mfenced separators="">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mtable>
- <xsl:apply-templates select="*" mode = "semantics"/>
- </m:mtable>
- </m:mfenced>
-</xsl:template>
-
-<xsl:template match = "m:matrixrow">
- <m:mtr>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:for-each select="*">
- <m:mtd>
- <xsl:apply-templates select="." mode = "semantics"/>
- </m:mtd>
- </xsl:for-each>
- </m:mtr>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:determinant[1]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:determinant/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:determinant/@id"/>
- </xsl:attribute>
- </xsl:if>det</m:mo>
- <xsl:apply-templates select = "*[2]" mode = "semantics"/>
- </m:mrow>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:transpose[1]]">
- <m:msup>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select = "*[2]" mode = "semantics"/>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:transpose/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:transpose/@id"/>
- </xsl:attribute>
- </xsl:if>T</m:mo>
- </m:msup>
-</xsl:template>
-
-<!-- HELM: ERROR, this template generates the selected content elements
- and doesn't generate the presentation for selector -->
-<!--<xsl:template match = "m:apply[m:selector[1]]">
- <xsl:if test="*[2]=m:matrix and *[3]=m:cn">
- <xsl:variable name="m" select = "*[3]"/>
- <xsl:choose>
- <xsl:when test="*[4]=m:cn">
- <xsl:variable name="n" select = "*[4]"/>
- <xsl:copy-of select = "m:matrix/*[position()=$m]/*[position()=$n]"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:copy-of select = "m:matrix/*[position()=$m]"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- <xsl:if test="(*[2]=m:vector or *[2]=m:list) and *[3]=m:cn">
- <xsl:variable name="m" select = "*[3]"/>
- <xsl:copy-of select = "*[2]/*[position()=$m]"/>
- </xsl:if>
-</xsl:template> -->
-
-<xsl:template match = "m:apply[m:selector[1]]">
- <msub>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select = "*[2]" mode="semantics"/>
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:selector/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:selector/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="*[3]=m:cn">
- <xsl:apply-templates select = "*[3]" mode="semantics"/>
- </xsl:when>
- <xsl:otherwise>
- <m:mi>*</m:mi>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:if test="*[2]=m:matrix and *[4]=m:cn">
- <xsl:apply-templates select = "*[4]" mode="semantics"/>
- </xsl:if>
- </m:mrow>
- </msub>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:vectorproduct[1] |
- m:scalarproduct[1] | m:outerproduct[1]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="*[2]" mode = "semantics"/>
- <m:mo>
- <xsl:if test="m:vectorproduct[1]">
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:vectorproduct/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:vectorproduct/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:text disable-output-escaping='yes'>⨯</xsl:text>
- </xsl:if>
- <xsl:if test="m:scalarproduct[1] | m:outerproduct[1]">
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and *[1]/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="*[1]/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:value-of select="'.'"/>
- </xsl:if>
- </m:mo>
- <xsl:apply-templates select="*[3]" mode = "semantics"/>
- </m:mrow>
-</xsl:template>
-
-
-<!-- ***************** CONSTANT and SYMBOL ELEMENTS ***************** -->
-
-<xsl:template match="m:integers">
- <m:mi>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:integers/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:integers/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:text disable-output-escaping='yes'>ℤ</xsl:text></m:mi>
-</xsl:template>
-
-<xsl:template match="m:reals">
- <m:mi>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:reals/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:reals/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:text disable-output-escaping='yes'>ℝ</xsl:text></m:mi>
-</xsl:template>
-
-<xsl:template match="m:rationals">
- <m:mi>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:rationals/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:rationals/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:text disable-output-escaping='yes'>ℚ</xsl:text></m:mi>
-</xsl:template>
-
-<xsl:template match="m:naturalnumbers">
- <m:mi>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:naturalnumbers/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:naturalnumbers/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:text disable-output-escaping='yes'>ℕ</xsl:text></m:mi>
-</xsl:template>
-
-<xsl:template match="m:complexes">
- <m:mi>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:complexes/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:complexes/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:text disable-output-escaping='yes'>ℂ</xsl:text></m:mi>
-</xsl:template>
-
-<xsl:template match="m:primes">
- <m:mi>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:primes/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:primes/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:text disable-output-escaping='yes'>ℙ</xsl:text></m:mi>
-</xsl:template>
-
-<xsl:template match="m:exponentiale">
- <m:mi>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:exponentiale/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:exponentiale/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:text disable-output-escaping="yes">ⅇ</xsl:text></m:mi>
-</xsl:template>
-
-<xsl:template match="m:imaginaryi">
- <m:mi>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:imaginaryi/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:imaginaryi/@id"/>
- </xsl:attribute>
- </xsl:if>
-<!-- HELM: not rendered correctly <![CDATA[ⅈ]]> -->
- <xsl:text disable-output-escaping="yes"></xsl:text></m:mi>
-</xsl:template>
-
-<xsl:template match="m:notanumber">
- <m:mi>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:notanumber/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:notanumber/@id"/>
- </xsl:attribute>
- </xsl:if>NaN</m:mi>
-</xsl:template>
-
-<xsl:template match="m:true">
- <m:mi>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:true/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:true/@id"/>
- </xsl:attribute>
- </xsl:if>true</m:mi>
-</xsl:template>
-
-<xsl:template match="m:false">
- <m:mi>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:false/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:false/@id"/>
- </xsl:attribute>
- </xsl:if>false</m:mi>
-</xsl:template>
-
-<xsl:template match="m:emptyset">
- <m:mi>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:emptyset/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:emptyset/@id"/>
- </xsl:attribute>
- </xsl:if>
-<!-- HELM: not rendered correctly <![CDATA[∅]]> -->
- <xsl:text disable-output-escaping="yes"></xsl:text></m:mi>
-</xsl:template>
-
-<xsl:template match="m:pi">
- <m:mi>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:pi/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:pi/@id"/>
- </xsl:attribute>
- </xsl:if>
-<!-- HELM: not rendered correctly <![CDATA[π]]> -->
- <xsl:text disable-output-escaping="yes">π</xsl:text></m:mi>
-</xsl:template>
-
-<xsl:template match="m:eulergamma">
- <m:mi>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:eulergamma/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:eulergamma/@id"/>
- </xsl:attribute>
- </xsl:if>
-<!-- HELM: not rendered correctly <![CDATA[γ]]> -->
- <xsl:text disable-output-escaping="yes">γ</xsl:text></m:mi>
-</xsl:template>
-
-<xsl:template match="m:infinity">
- <m:mi>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:infinity/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:infinity/@id"/>
- </xsl:attribute>
- </xsl:if>
-<!-- HELM: not rendered correctly <![CDATA[∞]]> -->
- <xsl:text disable-output-escaping="yes">∞</xsl:text></m:mi>
-</xsl:template>
-
-</xsl:stylesheet>
-
-
+++ /dev/null
-<?xml version="1.0"?>
-
-<!-- ******************************************************
-
- XSL Transform of MathML content to MathML presentation
-
- Version 0.14, Dec. 13, 2000
- Authors Igor Rodionov <igor@csd.uwo.ca>,
- Stephen Watt <watt@csd.uwo.ca>.
-
- (C) Copyright 2000 Symbolic Computation Laboratory,
- University of Western Ontario,
- London, Canada N6A 5B7.
- ****************************************************** -->
-
-
-<!-- ====================================================== -->
-<!-- April,28 2001 - HELM group: -->
-<!-- Added the namespace prefix to all the output elements -->
-<!-- Added the namespace prefix to all the xref attributes -->
-<!-- Changed the mml prefix into m -->
-<!-- Added xref to every mo element -->
-<!-- Changed mchar into the corresponding entity -->
-<!-- First draft: April 27 2001, Irene Schena -->
-<!-- ====================================================== -->
-
-<!-- Mostly complies with the W3C MathML 2.0 Candidate Recommenation
- of November 13, 2000. The main difference is the use of <mchar>
- which was removed from MathML 2.0 in the last working draft.
- -->
-
-<xsl:stylesheet id="mmlctop.xsl"
- version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:m="http://www.w3.org/1998/Math/MathML">
-
-<!-- HELM: we don't have a default namespace.
- Removed xmlns="http://www.w3.org/1998/Math/MathML" -->
-
-<!-- HELM: was
-<xsl:output method="xml" indent="yes"/>
--->
-<xsl:output method="xml"/>
-<!-- HELM -->
-
-<xsl:strip-space elements="apply semantics annotation-xml
- csymbol fn cn ci interval matrix matrixrow vector
- lambda bvar condition logbase degree set list
- lowlimit uplimit"/>
-
-
-<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
-<!-- Parameters, variables and constants -->
-<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
-
-<!-- ~~~~~~~~ Semantics related *constants*: ~~~~~~~~ -->
-
-<!-- Strip off semantics -->
-<xsl:variable name="SEM_STRIP" select="-1"/>
-
-<!-- Pass semantics "as is" -->
-<xsl:variable name="SEM_PASS" select="0"/>
-
-<!-- Add semantics at top level only -->
-<xsl:variable name="SEM_TOP" select="1"/>
-
-<!-- Add semantics at all levels -->
-<xsl:variable name="SEM_ALL" select="2"/>
-
-<!-- Semantics at top level only, with id refs -->
-<!-- NOTE: ids have to be already present in the
- input for this feature to work. -->
-<xsl:variable name="SEM_XREF" select="3"/>
-
-<!-- No semantics at top level, with id refs -->
-<!-- NOTE: ids have to be already present in the
- input for this feature to work. -->
-<xsl:variable name="SEM_XREF_EXT" select="4"/>
-
-
-<!-- ~~~~~~~~~~ Stylesheet *parameter*: SEM_SW ~~~~~~~~~~~~~~ -->
-<!-- Assumes one of the above values; SEM_PASS is the default -->
-<!-- The default can be overridden by specifying different -->
-<!-- value on the command line when the stylesheet is invoked -->
-
-<!-- HELM: $SEM_SW was SEM_PASS (error!) -->
-<xsl:param name="SEM_SW" select="$SEM_XREF"/>
-
-<!-- ~~~~~~ Operator precedence definitions ~~~~~~ -->
-
-<xsl:variable name="NO_PREC" select="0"/>
-<xsl:variable name="UNION_PREC" select="1"/>
-<xsl:variable name="SETDIFF_PREC" select="1"/>
-<xsl:variable name="INTERSECT_PREC" select="3"/>
-<xsl:variable name="OR_PREC" select="5"/>
-<xsl:variable name="XOR_PREC" select="5"/>
-<xsl:variable name="AND_PREC" select="7"/>
-<xsl:variable name="PLUS_PREC" select="9"/>
-<xsl:variable name="MINUS_PREC" select="9"/>
-<xsl:variable name="MUL_PREC" select="11"/>
-<xsl:variable name="DIV_PREC" select="11"/>
-<xsl:variable name="NEG_PREC" select="13"/>
-<xsl:variable name="FUNCTION_PREC" select="99"/>
-
-<!-- ~~~~~ Miscellaneous constant definitions ~~~~~ -->
-
-<xsl:variable name="YES" select="1"/>
-<xsl:variable name="NO" select="0"/>
-<xsl:variable name="NO_PARAM" select="-1"/>
-<xsl:variable name="PAR_SAME" select="-3"/>
-<xsl:variable name="PAR_YES" select="-5"/>
-<xsl:variable name="PAR_NO" select="-7"/>
-
-
-<!-- +++++++++++++++++ INDEX OF TEMPLATES +++++++++++++++++++ -->
-
-<!-- All templates are subdivided into the following categories
- (listed in the order of appearance in the stylesheet):
-
-THE TOPMOST ELEMENT: MATH
- math
-
-SEMANTICS HANDLING
- semantics
-
-BASIC CONTAINER ELEMENTS
- cn, ci, csymbol
-
-BASIC CONTENT ELEMENTS
- fn, interval, inverse, sep, condition, declare, lambda, compose, ident
-
-ARITHMETIC, ALGEBRA & LOGIC
- quotient, exp, factorial, max, min, minus, plus, power, rem, divide,
- times, root, gcd, and, or, xor, not, forall, exists, abs, conjugate,
- arg, real, imaginary
-
-RELATIONS
- neq, approx, tendsto, implies, in, notin, notsubset, notprsubset,
- subset, prsubset, eq, gt, lt, geq, leq, equivalent
-
-CALCULUS
- ln, log, diff, partialdiff, lowlimit, uplimit, bvar, degree,
- logbase, divergence, grad, curl, laplacian
-
-SET THEORY
- set, list, union, intersect, setdiff, card
-
-SEQUENCES AND SERIES
- sum, product, limit
-
-TRIGONOMETRY
- sin, cos, tan, sec, csc, cot, sinh, cosh, tanh, sech, csch, coth,
- arcsin, arccos, arctan
-
-STATISTICS
- mean, sdev, variance, median, mode, moment
-
-LINEAR ALGEBRA
- vector, matrix, matrixrow, determinant, transpose, selector,
- vectorproduct, scalarproduct, outerproduct
--->
-
-
-<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
-<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~ TEMPLATES ~~~~~~~~~~~~~~~~~~~~~~~~~ -->
-<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
-
-
-<!-- ***************** THE TOPMOST ELEMENT: MATH ***************** -->
-
-<xsl:template match = "m:math">
- <xsl:choose>
- <xsl:when test="$SEM_SW=$SEM_TOP or $SEM_SW=$SEM_ALL and *[2] or
- $SEM_SW=$SEM_XREF">
- <m:semantics>
- <m:mrow>
- <xsl:apply-templates mode = "semantics"/>
- </m:mrow>
- <m:annotation-xml encoding="MathML">
- <xsl:copy-of select="*"/>
- </m:annotation-xml>
- </m:semantics>
- </xsl:when>
- <xsl:otherwise>
- <m:mrow>
- <xsl:apply-templates mode = "semantics"/>
- </m:mrow>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-
-<!-- ***************** SEMANTICS HANDLING ***************** -->
-
-<!-- This template is called recursively. At each level -->
-<!-- in the source tree it decides whether to strip off, -->
-<!-- pass or add semantics at that level (depending on the -->
-<!-- value of SEM_SW parameter). Then the actual template -->
-<!-- is applied to the node. -->
-
-<xsl:template match = "m:*" mode = "semantics">
- <xsl:param name="IN_PREC" select="$NO_PREC"/>
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:choose>
- <xsl:when test="$SEM_SW=$SEM_STRIP and self::m:semantics">
- <xsl:apply-templates select="m:annotation-xml[@encoding='MathML']">
- <xsl:with-param name="IN_PREC" select="$IN_PREC"/>
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:when test="($SEM_SW=$SEM_PASS or $SEM_SW=$SEM_TOP) and self::m:semantics">
- <m:semantics>
- <xsl:apply-templates select="*[1]">
- <xsl:with-param name="IN_PREC" select="$IN_PREC"/>
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- <xsl:copy-of select="m:annotation-xml"/>
- </m:semantics>
- </xsl:when>
- <xsl:when test="$SEM_SW=$SEM_ALL">
- <m:semantics>
- <xsl:choose>
- <xsl:when test="self::m:semantics">
- <xsl:apply-templates select="*[1]">
- <xsl:with-param name="IN_PREC" select="$IN_PREC"/>
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- <xsl:copy-of select="m:annotation-xml"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select=".">
- <xsl:with-param name="IN_PREC" select="$IN_PREC"/>
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- <m:annotation-xml encoding="MathML">
- <xsl:copy-of select="."/>
- </m:annotation-xml>
- </xsl:otherwise>
- </xsl:choose>
- </m:semantics>
- </xsl:when>
- <xsl:when test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:choose>
-<!-- HELM: syntax error: sematics -->
- <xsl:when test="self::m:semantics">
- <xsl:copy>
- <xsl:copy-of select="@*"/>
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- <xsl:copy-of select="*[1]"/>
- <xsl:copy-of select="m:annotation-xml"/>
- </xsl:copy>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select=".">
- <xsl:with-param name="IN_PREC" select="$IN_PREC"/>
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="self::m:semantics">
- <xsl:copy-of select="."/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select=".">
- <xsl:with-param name="IN_PREC" select="$IN_PREC"/>
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match = "m:semantics">
- <xsl:apply-templates select="." mode = "semantics"/>
-</xsl:template>
-
-
-<!-- ***************** BASIC CONTAINER ELEMENTS ***************** -->
-
-<!-- HELM: cn could not contain MAthML presentation -->
-<xsl:template match = "m:cn">
- <xsl:param name="IN_PREC" select="$NO_PREC"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
-<!-- HELM: added -->
-<!-- CSC
-<xsl:choose>
- <xsl:when test="child::text()">
--->
-<!-- HELM -->
- <xsl:choose>
- <xsl:when test=". < 0 and $IN_PREC > $NO_PREC and $PAREN=$PAR_NO
- and $PAR_NO_IGNORE=$NO">
- <m:mfenced separators="">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="cn"/>
- </m:mfenced>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:apply-templates select="." mode="cnid"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="." mode="cn"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
-<!-- HELM: added -->
-<!--CSC
- </xsl:when>
- <xsl:otherwise>
- <m:mrow>
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- <xsl:copy-of select="*"/>
- </m:mrow>
- </xsl:otherwise>
- </xsl:choose>
--->
-<!-- HELM -->
-</xsl:template>
-
-<xsl:template match = "m:cn" mode="cn">
- <xsl:choose>
- <xsl:when test="@base and (not(@type) or @type='integer' or @type='real')">
- <m:msub>
- <m:mn> <xsl:apply-templates mode = "semantics"/> </m:mn>
- <m:mn> <xsl:value-of select="@base"/> </m:mn>
- </m:msub>
- </xsl:when>
- <xsl:when test="@type='complex' and not(@base) and child::m:sep[1]">
- <m:mfenced separators="">
- <m:mn> <xsl:apply-templates select="text()[1]" mode = "semantics"/> </m:mn>
- <xsl:if test="text()[2] < 0">
- <m:mo>-</m:mo>
- <m:mn> <xsl:value-of select="-text()[2]"/> </m:mn>
- </xsl:if>
- <xsl:if test="not(text()[2] < 0)">
- <m:mo>+</m:mo>
- <m:mn> <xsl:value-of select="text()[2]"/> </m:mn>
- </xsl:if>
- <m:mo>⁢</m:mo>
- <m:mo>i</m:mo>
- </m:mfenced>
- </xsl:when>
- <xsl:when test="@type='complex' and @base and child::m:sep[1]">
- <m:msub>
- <m:mfenced separators="">
- <m:mn> <xsl:apply-templates select="text()[1]"/> </m:mn>
- <xsl:if test="text()[2] < 0">
- <m:mo>-</m:mo>
- <m:mn> <xsl:value-of select="-text()[2]"/> </m:mn>
- </xsl:if>
- <xsl:if test="not(text()[2] < 0)">
- <m:mo>+</m:mo>
- <m:mn> <xsl:apply-templates select="text()[2]"/> </m:mn>
- </xsl:if>
- <m:mo>⁢</m:mo>
- <m:mo>i</m:mo>
- </m:mfenced>
- <m:mn> <xsl:value-of select="@base"/> </m:mn>
- </m:msub>
- </xsl:when>
- <xsl:when test="@type='rational' and not(@base) and child::m:sep[1]">
- <m:mfrac>
- <m:mn> <xsl:apply-templates select="text()[1]"/> </m:mn>
- <m:mn> <xsl:apply-templates select="text()[2]"/> </m:mn>
- </m:mfrac>
- </xsl:when>
- <xsl:when test="@type='rational' and @base and child::m:sep[1]">
- <m:msub>
- <m:mfenced>
- <m:mfrac>
- <m:mn> <xsl:apply-templates select="text()[1]"/> </m:mn>
- <m:mn> <xsl:apply-templates select="text()[2]"/> </m:mn>
- </m:mfrac>
- </m:mfenced>
- <m:mn> <xsl:value-of select="@base"/> </m:mn>
- </m:msub>
- </xsl:when>
- <xsl:when test="@type='polar' and not(@base) and child::m:sep[1]">
- <m:mrow>
- <m:mo>Polar</m:mo>
- <m:mo>⁢</m:mo>
- <m:mfenced separators=",">
- <m:mn> <xsl:apply-templates select="text()[1]"/> </m:mn>
- <m:mn> <xsl:apply-templates select="text()[2]"/> </m:mn>
- </m:mfenced>
- </m:mrow>
- </xsl:when>
- <xsl:when test="@type='polar' and @base and child::m:sep[1]">
- <m:msub>
- <m:mrow>
- <m:mo>Polar</m:mo>
- <m:mo>⁢</m:mo>
- <m:mfenced separators=",">
- <m:mn> <xsl:apply-templates select="text()[1]"/> </m:mn>
- <m:mn> <xsl:apply-templates select="text()[2]"/> </m:mn>
- </m:mfenced>
- </m:mrow>
- <m:mn> <xsl:value-of select="@base"/> </m:mn>
- </m:msub>
- </xsl:when>
- <xsl:otherwise>
-<!--HELM: Was:
- <m:mn> <xsl:apply-templates mode = "semantics"/> </m:mn>
-HELM: Now is: -->
- <xsl:choose>
- <xsl:when test="child::text() and not(*[1])">
- <m:mn> <xsl:apply-templates mode = "semantics"/> </m:mn>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="not(*[2])">
- <xsl:copy-of select="*[1]"/>
- </xsl:when>
- <xsl:otherwise>
- <m:mrow>
- <xsl:copy-of select="*|text()"/>
- </m:mrow>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
-<!-- HELM -->
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match = "m:cn" mode="cnid">
- <xsl:choose>
- <xsl:when test="@base and (not(@type) or @type='integer' or @type='real')">
- <m:msub xref="{@id}">
- <m:mn> <xsl:apply-templates mode = "semantics"/> </m:mn>
- <m:mn> <xsl:value-of select="@base"/> </m:mn>
- </m:msub>
- </xsl:when>
- <xsl:when test="@type='complex' and not(@base) and child::m:sep[1]">
- <m:mfenced separators="" xref="{@id}">
- <m:mn> <xsl:apply-templates select="text()[1]" mode = "semantics"/> </m:mn>
- <xsl:if test="text()[2] < 0">
- <m:mo>-</m:mo>
- <m:mn> <xsl:value-of select="-text()[2]"/> </m:mn>
- </xsl:if>
- <xsl:if test="not(text()[2] < 0)">
- <m:mo>+</m:mo>
- <m:mn> <xsl:value-of select="text()[2]"/> </m:mn>
- </xsl:if>
- <m:mo>⁢</m:mo>
- <m:mo>i</m:mo>
- </m:mfenced>
- </xsl:when>
- <xsl:when test="@type='complex' and @base and child::m:sep[1]">
- <m:msub xref="{@id}">
- <m:mfenced separators="">
- <m:mn> <xsl:apply-templates select="text()[1]"/> </m:mn>
- <xsl:if test="text()[2] < 0">
- <m:mo>-</m:mo>
- <m:mn> <xsl:value-of select="-text()[2]"/> </m:mn>
- </xsl:if>
- <xsl:if test="not(text()[2] < 0)">
- <m:mo>+</m:mo>
- <m:mn> <xsl:apply-templates select="text()[2]"/> </m:mn>
- </xsl:if>
- <m:mo>⁢</m:mo>
- <m:mo>i</m:mo>
- </m:mfenced>
- <m:mn> <xsl:value-of select="@base"/> </m:mn>
- </m:msub>
- </xsl:when>
- <xsl:when test="@type='rational' and not(@base) and child::m:sep[1]">
- <m:mfrac xref="{@id}">
- <m:mn> <xsl:apply-templates select="text()[1]"/> </m:mn>
- <m:mn> <xsl:apply-templates select="text()[2]"/> </m:mn>
- </m:mfrac>
- </xsl:when>
- <xsl:when test="@type='rational' and @base and child::m:sep[1]">
- <m:msub xref="{@id}">
- <m:mfenced>
- <m:mfrac>
- <m:mn> <xsl:apply-templates select="text()[1]"/> </m:mn>
- <m:mn> <xsl:apply-templates select="text()[2]"/> </m:mn>
- </m:mfrac>
- </m:mfenced>
- <m:mn> <xsl:value-of select="@base"/> </m:mn>
- </m:msub>
- </xsl:when>
- <xsl:when test="@type='polar' and not(@base) and child::m:sep[1]">
- <m:mrow xref="{@id}">
- <m:mo>Polar</m:mo>
- <m:mo>⁢</m:mo>
- <m:mfenced separators=",">
- <m:mn> <xsl:apply-templates select="text()[1]"/> </m:mn>
- <m:mn> <xsl:apply-templates select="text()[2]"/> </m:mn>
- </m:mfenced>
- </m:mrow>
- </xsl:when>
- <xsl:when test="@type='polar' and @base and child::m:sep[1]">
- <m:msub xref="{@id}">
- <m:mrow>
- <m:mo>Polar</m:mo>
- <m:mo>⁢</m:mo>
- <m:mfenced separators=",">
- <m:mn> <xsl:apply-templates select="text()[1]"/> </m:mn>
- <m:mn> <xsl:apply-templates select="text()[2]"/> </m:mn>
- </m:mfenced>
- </m:mrow>
- <m:mn> <xsl:value-of select="@base"/> </m:mn>
- </m:msub>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="child::text() and not(*[1])">
- <m:mn xref="{@id}"> <xsl:apply-templates mode = "semantics"/> </m:mn>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="id" select="@id"/>
- <xsl:choose>
- <xsl:when test="not(*[2])">
- <xsl:for-each select="*[1]">
- <xsl:copy>
- <xsl:attribute name="xref">
- <xsl:value-of select="$id"/>
- </xsl:attribute>
- <xsl:copy-of select="@*|*"/>
- </xsl:copy>
- </xsl:for-each>
- </xsl:when>
- <xsl:otherwise>
- <m:mrow xref="{$id}">
- <xsl:copy-of select="*|text()"/>
- </m:mrow>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<!-- HELM: ci could not contain MAthML presentation -->
-<xsl:template match = "m:ci">
-<!-- HELM -->
- <xsl:choose>
- <xsl:when test="@type='vector' or @type=matrix or @type=set">
- <m:mi fontweight="bold">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates mode = "semantics"/>
- </m:mi>
- </xsl:when>
- <xsl:when test="child::text() and not(child::*[1])">
- <m:mi>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
-<!-- HELM: added mode=semantics -->
- <xsl:apply-templates mode = "semantics"/>
- </m:mi>
- </xsl:when>
- <xsl:when test="child::text() and *[1] and not(*[1]=m:sep)">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
-<!-- HELM: added mode=semantics -->
- <xsl:apply-templates mode = "semantics"/>
- </m:mrow>
- </xsl:when>
- <xsl:otherwise>
- <xsl:if test="*[2]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="*"/>
- </m:mrow>
- </xsl:if>
- <xsl:if test="not(*[2])">
-<!--HELM: Was:
- <xsl:apply-templates select="*[1]"/>
-HELM: Now is: -->
- <xsl:variable name="id" select="@id"/>
- <xsl:for-each select="*[1]">
- <xsl:copy>
- <xsl:attribute name="xref">
- <xsl:value-of select="$id"/>
- </xsl:attribute>
- <xsl:copy-of select="@*|*"/>
- </xsl:copy>
- </xsl:for-each>
-<!-- HELM -->
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
-<!-- HELM -->
-</xsl:template>
-
-<xsl:template match = "m:ci/m:*[not(self::m:sep)]">
- <xsl:copy-of select = "."/>
-</xsl:template>
-
-<!-- HELM: previous Version x.xx from Feb. 18, 2000 -->
-<xsl:template match = "m:csymbol">
-<!-- HELM: added -->
- <m:mrow>
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
-<!-- HELM -->
- <xsl:choose>
- <xsl:when test="*[1]">
- <xsl:copy-of select = "*"/>
- </xsl:when>
- <xsl:otherwise>
- <m:mo>
- <xsl:apply-templates mode = "semantics"/>
- </m:mo>
- </xsl:otherwise>
- </xsl:choose>
- </m:mrow>
-</xsl:template>
-
-
-<!-- HELM: csymbol cannot contain ci or cn elements, but only text or
-presentation elements. PCDATA should render as if it were wrapped in
-an mo. Mixed content: mrow which contains mo + presentation elements -->
-<!--<xsl:template match = "m:csymbol/m:*">
- <xsl:choose>
- <xsl:when test="self::m:cn or self::m:ci">
- <xsl:apply-templates mode = "semantics"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:copy-of select = "."/>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match = "m:csymbol/text()">
- <xsl:choose>
- <xsl:when test=". < 0 or . = 0 or . > 0">
- <mn> <xsl:copy-of select = "."/> </mn>
- </xsl:when>
- <xsl:otherwise>
- <mi> <xsl:copy-of select = "."/> </mi>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>-->
-
-
-<!-- ***************** BASIC CONTENT ELEMENTS ***************** -->
-
-<xsl:template match = "m:apply[m:*[1][self::m:fn]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select = "m:fn[1]" mode = "semantics"/>
- <m:mo>
-<!-- HELM: added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:fn/@id"/>
- </xsl:attribute>
- </xsl:if>⁡</m:mo>
- <m:mfenced separators=",">
- <xsl:apply-templates select = "*[position()>1]" mode = "semantics"/>
- </m:mfenced>
- </m:mrow>
-</xsl:template>
-
-<xsl:template match = "m:fn">
- <xsl:apply-templates select = "*[1]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
- </xsl:apply-templates>
-</xsl:template>
-
-<xsl:template match = "m:interval">
- <m:mfenced separators=",">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:if test="@closure='closed' or @closure='closed-open'">
- <xsl:attribute name="open">[</xsl:attribute>
- </xsl:if>
- <xsl:if test="@closure='closed' or @closure='open-closed'">
- <xsl:attribute name="close">]</xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="*" mode = "semantics"/>
- </m:mfenced>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:*[1][self::m:apply[m:inverse[1]]]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select = "*[1]" mode = "semantics"/>
- <m:mo>⁡</m:mo>
- <m:mfenced separators=",">
- <xsl:apply-templates select = "*[position()>1]" mode = "semantics"/>
- </m:mfenced>
- </m:mrow>
-</xsl:template>
-
-<xsl:template match = "m:apply[*[1][self::m:inverse]]">
- <xsl:choose>
- <xsl:when test="*[2]=m:exp or *[2]=m:ln or *[2]=m:sin or *[2]=m:cos or
- *[2]=m:tan or *[2]=m:sec or *[2]=m:csc or *[2]=m:cot or
- *[2]=m:sinh or *[2]=m:cosh or *[2]=m:tanh or *[2]=m:sech or
- *[2]=m:csch or *[2]=m:coth or *[2]=m:arcsin or
- *[2]=m:arccos or *[2]=m:arctan">
- <m:mo>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="*[2]" mode="inverse"/>
- </m:mo>
- </xsl:when>
- <xsl:otherwise>
- <m:msup>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select = "*[2]"/>
- <m:mfenced>
- <m:mn>-1</m:mn>
- </m:mfenced>
- </m:msup>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match = "*" mode="inverse">
- <xsl:choose>
- <xsl:when test="self::m:exp">
- <xsl:value-of select="'ln'"/>
- </xsl:when>
- <xsl:when test="self::m:ln">
- <xsl:value-of select="'exp'"/>
- </xsl:when>
- <xsl:when test="self::m:sin">
- <xsl:value-of select="'arcsin'"/>
- </xsl:when>
- <xsl:when test="self::m:cos">
- <xsl:value-of select="'arccos'"/>
- </xsl:when>
- <xsl:when test="self::m:tan">
- <xsl:value-of select="'arctan'"/>
- </xsl:when>
- <xsl:when test="self::m:sec">
- <xsl:value-of select="'arcsec'"/>
- </xsl:when>
- <xsl:when test="self::m:csc">
- <xsl:value-of select="'arccsc'"/>
- </xsl:when>
- <xsl:when test="self::m:cot">
- <xsl:value-of select="'arccot'"/>
- </xsl:when>
- <xsl:when test="self::m:sinh">
- <xsl:value-of select="'arcsinh'"/>
- </xsl:when>
- <xsl:when test="self::m:cosh">
- <xsl:value-of select="'arccosh'"/>
- </xsl:when>
- <xsl:when test="self::m:tanh">
- <xsl:value-of select="'arctanh'"/>
- </xsl:when>
- <xsl:when test="self::m:sech">
- <xsl:value-of select="'arcsech'"/>
- </xsl:when>
- <xsl:when test="self::m:csch">
- <xsl:value-of select="'arccsch'"/>
- </xsl:when>
- <xsl:when test="self::m:coth">
- <xsl:value-of select="'arccoth'"/>
- </xsl:when>
- <xsl:when test="self::m:arcsin">
- <xsl:value-of select="'sin'"/>
- </xsl:when>
- <xsl:when test="self::m:arccos">
- <xsl:value-of select="'cos'"/>
- </xsl:when>
- <xsl:when test="self::m:arctan">
- <xsl:value-of select="'tan'"/>
- </xsl:when>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match = "m:sep"/>
-
-<xsl:template match = "m:condition">
- <xsl:choose>
- <xsl:when test="parent::m:apply[m:forall[1]]"/>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <m:mrow xref="{@id}">
- <xsl:apply-templates select="*" mode = "semantics"/>
- </m:mrow>
- </xsl:when>
- <xsl:otherwise>
- <xsl:if test="not(*[2])">
- <xsl:apply-templates select="*" mode = "semantics"/>
- </xsl:if>
- <xsl:if test="*[2]">
- <m:mrow>
- <xsl:apply-templates select="*" mode = "semantics"/>
- </m:mrow>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match = "m:declare"/>
-
-<xsl:template match = "m:lambda">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mo>Λ</m:mo>
- <m:mo>⁡</m:mo>
- <m:mfenced separators=",">
- <xsl:for-each select = "*">
- <xsl:choose>
- <xsl:when test="self::m:ci or self::m:cn">
- <xsl:apply-templates select = "." mode="semantics"/>
- </xsl:when>
- <xsl:otherwise>
- <m:mrow>
- <xsl:apply-templates select = "." mode="semantics"/>
- </m:mrow>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- </m:mfenced>
- </m:mrow>
-</xsl:template>
-
-<xsl:template match = "m:apply[*[1][self::m:apply[m:compose[1]]]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select = "*[1]" mode = "semantics"/>
- <m:mo>⁡</m:mo>
- <m:mfenced separators=",">
- <xsl:apply-templates select = "*[position()>1]" mode = "semantics"/>
- </m:mfenced>
- </m:mrow>
-</xsl:template>
-
-<xsl:template match = "m:apply[*[1][self::m:compose]]">
- <m:mfenced separators="">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select = "m:*[2][self::m:ci[@type='fn'] |
- self::m:fn]" mode="semantics"/>
- <xsl:for-each select = "m:*[position()>2][self::m:ci[@type='fn'] |
- self::m:fn]">
- <m:mo>
- <!-- HELM: added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="../m:compose/@id"/>
- </xsl:attribute>
- </xsl:if>∘</m:mo>
- <xsl:apply-templates select = "." mode="semantics"/>
- </xsl:for-each>
- </m:mfenced>
-</xsl:template>
-
-<xsl:template match = "m:ident">
- <xsl:choose>
- <xsl:when test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <m:mo xref="{@id}">id</m:mo>
- </xsl:when>
- <xsl:otherwise>
- <m:mo>id</m:mo>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-
-<!-- ***************** ARITHMETIC, ALGEBRA & LOGIC ***************** -->
-
-<xsl:template match = "m:apply[m:quotient[1]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mo form="prefix" fence="true" stretchy="true" lspace="0em" rspace="0em">⌊</m:mo>
- <m:mfrac>
-<!-- HELM: added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:quotient/@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mrow>
- <xsl:apply-templates select="*[2]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
- </xsl:apply-templates>
- </m:mrow>
- <m:mrow>
- <xsl:apply-templates select="*[3]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- </m:mrow>
- </m:mfrac>
- <m:mo form="postfix" fence="true" stretchy="true" lspace="0em" rspace="0em">⌊</m:mo>
- </m:mrow>
-</xsl:template>
-
-<xsl:template match = "m:apply[*[1][self::m:exp]]">
- <m:msup>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mo>
- <!-- HELM: added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:exp/@id"/>
- </xsl:attribute>
- </xsl:if>e</m:mo>
- <xsl:apply-templates select = "*[2]" mode = "semantics"/>
- </m:msup>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:factorial[1]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select = "*[2]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- <m:mo>
-<!-- HELM: added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:factorial/@id"/>
- </xsl:attribute>
- </xsl:if>!</m:mo>
- </m:mrow>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:max[1] | m:min[1]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:if test="*[2]=m:bvar">
- <m:munder>
- <xsl:if test="*[1]=m:max">
- <m:mo>
-<!-- HELM: added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:max/@id"/>
- </xsl:attribute>
- </xsl:if>max</m:mo>
- </xsl:if>
- <xsl:if test="*[1]=m:min">
- <m:mo>
-<!-- HELM: added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:min/@id"/>
- </xsl:attribute>
- </xsl:if>min</m:mo>
- </xsl:if>
- <xsl:apply-templates select="*[2]" mode = "semantics"/>
- </m:munder>
- <xsl:if test="*[3]=m:condition">
- <m:mfenced open="{{" close="}}" separators="">
- <m:mfenced open="" close="" separators=",">
- <xsl:for-each select = "*[position()>3]">
- <xsl:apply-templates select = "." mode="semantics"/>
- </xsl:for-each>
- </m:mfenced>
- <m:mo>|</m:mo>
- <xsl:apply-templates select="*[3]" mode = "semantics"/>
- </m:mfenced>
- </xsl:if>
- <xsl:if test="not(*[3]=m:condition)">
- <m:mfenced open="{{" close="}}" separators=",">
- <xsl:for-each select = "*[position()>2]">
- <xsl:apply-templates select = "." mode="semantics"/>
- </xsl:for-each>
- </m:mfenced>
- </xsl:if>
- </xsl:if>
- <xsl:if test="*[2]=m:condition">
- <xsl:if test="*[1]=m:max">
- <m:mo>max</m:mo>
- </xsl:if>
- <xsl:if test="*[1]=m:min">
- <m:mo>min</m:mo>
- </xsl:if>
- <m:mfenced open="{{" close="}}" separators="">
- <xsl:if test="*[3]">
- <m:mfenced open="" close="" separators=",">
- <xsl:for-each select = "*[position()>2]">
- <xsl:apply-templates select = "." mode="semantics"/>
- </xsl:for-each>
- </m:mfenced>
- <m:mo>|</m:mo>
- </xsl:if>
- <xsl:apply-templates select="*[2]" mode = "semantics"/>
- </m:mfenced>
- </xsl:if>
- <xsl:if test="not(*[2]=m:condition) and not(*[2]=m:bvar)">
- <xsl:if test="*[1]=m:max">
- <m:mo>max</m:mo>
- </xsl:if>
- <xsl:if test="*[1]=m:min">
- <m:mo>min</m:mo>
- </xsl:if>
- <m:mfenced open="{{" close="}}" separators=",">
- <xsl:for-each select = "*[position()>1]">
- <xsl:apply-templates select = "." mode="semantics"/>
- </xsl:for-each>
- </m:mfenced>
- </xsl:if>
- </m:mrow>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:minus[1]]">
- <xsl:param name="IN_PREC" select="$NO_PREC"/>
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:choose>
- <xsl:when test="$IN_PREC > $MINUS_PREC or $IN_PREC=$MINUS_PREC and
- $PARAM=$PAR_SAME">
- <m:mfenced separators="">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="minus">
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAR_YES"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </m:mfenced>
- </xsl:when>
- <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $FUNCTION_PREC
- and not($SEM_SW=$SEM_ALL) and not($SEM_SW=$SEM_XREF)
- and not($SEM_SW=$SEM_XREF_EXT)">
- <xsl:apply-templates select="." mode="minus">
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="minus">
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </m:mrow>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:minus[1]]" mode="minus">
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:if test="not(*[3])">
- <m:mo>
-<!-- HELM: added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:minus/@id"/>
- </xsl:attribute>
- </xsl:if>-</m:mo>
- <xsl:apply-templates select="*[2]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$NEG_PREC"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- </xsl:if>
- <xsl:if test="*[3]">
- <xsl:apply-templates select="*[2]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$MINUS_PREC"/>
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- <m:mo>
-<!-- HELM: added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:minus/@id"/>
- </xsl:attribute>
- </xsl:if>-</m:mo>
- <xsl:apply-templates select="*[3]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$MINUS_PREC"/>
- <xsl:with-param name="PARAM" select="$PAR_SAME"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- </xsl:if>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:plus[1]]">
- <xsl:param name="IN_PREC" select="$NO_PREC"/>
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:choose>
- <xsl:when test="$IN_PREC > $PLUS_PREC or $IN_PREC=$PLUS_PREC and
- $PARAM=$PAR_SAME">
- <m:mfenced separators="">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="plus">
- <xsl:with-param name="PARAM" select="$IN_PREC"/>
- <xsl:with-param name="PAREN" select="$PAR_YES"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </m:mfenced>
- </xsl:when>
- <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $FUNCTION_PREC
- and not($SEM_SW=$SEM_ALL) and not($SEM_SW=$SEM_XREF)
- and not($SEM_SW=$SEM_XREF_EXT)">
- <xsl:apply-templates select="." mode="plus">
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="plus">
- <xsl:with-param name="PARAM" select="$IN_PREC"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </m:mrow>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:plus[1]]" mode="plus">
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:if test="*[2]">
- <xsl:apply-templates select="*[2]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$PLUS_PREC"/>
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- <xsl:for-each select = "*[position()>2]">
- <xsl:choose>
- <xsl:when test=". < 0">
- <m:mo>-</m:mo>
- <m:mn> <xsl:value-of select="-."/> </m:mn>
- </xsl:when>
- <xsl:when test="self::m:apply[m:minus[1]] and not(*[3])">
- <xsl:apply-templates select="." mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$PLUS_PREC"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <m:mo>
-<!-- HELM: added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="../m:plus/@id"/>
- </xsl:attribute>
- </xsl:if>+</m:mo>
- <xsl:apply-templates select="." mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$PLUS_PREC"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- </xsl:if>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:power[1]]">
- <xsl:choose>
- <xsl:when test="*[2]=m:apply[m:ln[1] | m:log[1] | m:abs[1] |
- m:gcd[1] | m:sin[1] | m:cos[1] | m:tan[1] |
- m:sec[1] | m:csc[1] | m:cot[1] | m:sinh[1] |
- m:cosh[1] | m:tanh[1] | m:sech[1] | m:csch[1] |
- m:coth[1] | m:arcsin[1] | m:arccos[1] |
- m:arctan[1]]">
- <xsl:apply-templates select="*[2]" mode = "semantics"/>
- </xsl:when>
- <xsl:otherwise>
- <m:msup>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select = "*[2]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- <xsl:apply-templates select = "*[3]" mode = "semantics"/>
- </m:msup>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:rem[1] | m:divide[1]]">
- <xsl:param name="IN_PREC" select="$NO_PREC"/>
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:choose>
- <xsl:when test="$IN_PREC > $DIV_PREC or $IN_PREC=$DIV_PREC and
- $PARAM=$PAR_SAME">
- <m:mfenced separators="">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="remdiv">
- <xsl:with-param name="PARAM" select="$IN_PREC"/>
- <xsl:with-param name="PAREN" select="$PAR_YES"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </m:mfenced>
- </xsl:when>
- <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $FUNCTION_PREC
- and not($SEM_SW=$SEM_ALL) and not($SEM_SW=$SEM_XREF)
- and not($SEM_SW=$SEM_XREF_EXT)">
- <xsl:apply-templates select="." mode="remdiv">
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="remdiv">
- <xsl:with-param name="PARAM" select="$IN_PREC"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </m:mrow>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:rem[1] | m:divide[1]]" mode="remdiv">
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:apply-templates select = "*[2]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$DIV_PREC"/>
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- <m:mo>
- <xsl:if test="m:rem">
-<!-- HELM: added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:rem/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:value-of select="'%'"/>
- </xsl:if>
- <xsl:if test="m:divide">
-<!-- HELM: added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:divide/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:value-of select="'/'"/>
- </xsl:if>
- </m:mo>
- <xsl:apply-templates select = "*[3]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$DIV_PREC"/>
- <xsl:with-param name="PARAM" select="$PAR_SAME"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:times[1]]">
- <xsl:param name="IN_PREC" select="$NO_PREC"/>
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:choose>
- <xsl:when test="$IN_PREC > $MUL_PREC or $IN_PREC=$MUL_PREC and
- $PARAM=$PAR_SAME">
- <m:mfenced separators="">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="times">
- <xsl:with-param name="PARAM" select="$IN_PREC"/>
- <xsl:with-param name="PAREN" select="$PAR_YES"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </m:mfenced>
- </xsl:when>
- <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $FUNCTION_PREC
- and not($SEM_SW=$SEM_ALL) and not($SEM_SW=$SEM_XREF)
- and not($SEM_SW=$SEM_XREF_EXT)">
- <xsl:apply-templates select="." mode="times">
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="times">
- <xsl:with-param name="PARAM" select="$IN_PREC"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </m:mrow>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:times[1]]" mode="times">
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:apply-templates select="*[2]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$MUL_PREC"/>
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- <xsl:if test="*[3]">
- <xsl:for-each select = "*[position()>2]">
-<!-- HELM: to distinguish between * and the application -->
-<!-- <m:mo>⁢</m:mo> -->
- <m:mo>
-<!-- HELM: added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="../m:times/@id"/>
- </xsl:attribute>
- </xsl:if>*</m:mo>
- <xsl:apply-templates select="." mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$MUL_PREC"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- </xsl:for-each>
- </xsl:if>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:root[1]]">
- <m:msqrt>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:if test="*[2]=m:degree">
- <xsl:apply-templates select="*[3]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- <xsl:apply-templates select="*[2]" mode = "semantics"/>
- </xsl:if>
- <xsl:if test="not(*[2]=m:degree)">
- <xsl:apply-templates select="*[2]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- <m:mn>2</m:mn>
- </xsl:if>
- </m:msqrt>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:gcd[1]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:if test="not(parent::m:apply[m:power[1]])">
- <m:mo>
-<!-- HELM: added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:gcd/@id"/>
- </xsl:attribute>
- </xsl:if>gcd</m:mo>
- </xsl:if>
- <xsl:if test="parent::m:apply[m:power[1]]">
- <m:msup>
- <m:mo>
-<!-- HELM: added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:gcd/@id"/>
- </xsl:attribute>
- </xsl:if>gcd</m:mo>
- <xsl:apply-templates select = "../*[3]" mode = "semantics"/>
- </m:msup>
- </xsl:if>
- <m:mfenced separators=",">
- <xsl:for-each select = "*[position()>1]">
- <xsl:apply-templates select = "." mode="semantics"/>
- </xsl:for-each>
- </m:mfenced>
- </m:mrow>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:and[1]]">
- <xsl:param name="IN_PREC" select="$NO_PREC"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:choose>
- <xsl:when test="$IN_PREC > $AND_PREC">
- <m:mfenced separators="">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="and">
- <xsl:with-param name="PARAM" select="$IN_PREC"/>
- <xsl:with-param name="PAREN" select="$PAR_YES"/>
- </xsl:apply-templates>
- </m:mfenced>
- </xsl:when>
- <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $FUNCTION_PREC
- and not($SEM_SW=$SEM_ALL) and not($SEM_SW=$SEM_XREF)
- and not($SEM_SW=$SEM_XREF_EXT)">
- <xsl:apply-templates select="." mode="and">
- <xsl:with-param name="PARAM" select="$IN_PREC"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="and">
- <xsl:with-param name="PARAM" select="$IN_PREC"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </m:mrow>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:and[1]]" mode="and">
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:apply-templates select="*[2]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$AND_PREC"/>
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- <xsl:for-each select = "*[position()>2]">
- <m:mo>
-<!-- HELM: added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="../m:and/@id"/>
- </xsl:attribute>
- </xsl:if>∧</m:mo>
- <xsl:apply-templates select="." mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$AND_PREC"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- </xsl:for-each>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:or[1]]">
- <xsl:param name="IN_PREC" select="$NO_PREC"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:choose>
- <xsl:when test="$IN_PREC > $OR_PREC">
- <m:mfenced separators="">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="or">
- <xsl:with-param name="PARAM" select="$IN_PREC"/>
- <xsl:with-param name="PAREN" select="$PAR_YES"/>
- </xsl:apply-templates>
- </m:mfenced>
- </xsl:when>
- <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $FUNCTION_PREC
- and not($SEM_SW=$SEM_ALL) and not($SEM_SW=$SEM_XREF)
- and not($SEM_SW=$SEM_XREF_EXT)">
- <xsl:apply-templates select="." mode="or">
- <xsl:with-param name="PARAM" select="$IN_PREC"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="or">
- <xsl:with-param name="PARAM" select="$IN_PREC"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </m:mrow>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:or[1]]" mode="or">
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:apply-templates select="*[2]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$OR_PREC"/>
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- <xsl:for-each select = "*[position()>2]">
- <m:mo>
-<!-- HELM: added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="../m:or/@id"/>
- </xsl:attribute>
- </xsl:if>∨</m:mo>
- <xsl:apply-templates select="." mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$OR_PREC"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- </xsl:for-each>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:xor[1]]">
- <xsl:param name="IN_PREC" select="$NO_PREC"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:choose>
- <xsl:when test="$IN_PREC > $XOR_PREC">
- <m:mfenced separators="">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="xor">
- <xsl:with-param name="PARAM" select="$IN_PREC"/>
- <xsl:with-param name="PAREN" select="$PAR_YES"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </m:mfenced>
- </xsl:when>
- <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $FUNCTION_PREC
- and not($SEM_SW=$SEM_ALL)">
- <xsl:apply-templates select="." mode="xor">
- <xsl:with-param name="PARAM" select="$IN_PREC"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="xor">
- <xsl:with-param name="PARAM" select="$IN_PREC"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </m:mrow>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:xor[1]]" mode="xor">
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:apply-templates select="*[2]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$XOR_PREC"/>
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- <xsl:for-each select = "*[position()>2]">
- <m:mo>
- <!-- HELM: added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="../m:xor/@id"/>
- </xsl:attribute>
- </xsl:if>⊻</m:mo>
- <xsl:apply-templates select="." mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$XOR_PREC"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- </xsl:for-each>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:not[1]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
-<!-- HELM: was <m:mo>not</m:mo> -->
- <m:mo>
-<!-- HELM: added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:not/@id"/>
- </xsl:attribute>
- </xsl:if>¬</m:mo>
- <xsl:apply-templates select = "*[2]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
- </xsl:apply-templates>
- </m:mrow>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:forall[1]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mo>
-<!-- HELM: added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:forall/@id"/>
- </xsl:attribute>
- </xsl:if>for all</m:mo>
- <xsl:if test="count(m:bvar) > 1">
- <m:mfenced separators=",">
- <xsl:for-each select = "m:bvar">
- <xsl:apply-templates select = "." mode="semantics"/>
- </xsl:for-each>
- </m:mfenced>
- </xsl:if>
- <xsl:if test="count(m:bvar)=1">
- <xsl:apply-templates select = "m:bvar" mode="semantics"/>
- </xsl:if>
- <xsl:if test="m:condition">
- <m:mo>:</m:mo>
- <xsl:apply-templates select = "m:condition/*" mode = "semantics"/>
- <m:mo>,</m:mo>
- </xsl:if>
- <xsl:apply-templates select = "*[position()>1 and not(self::m:bvar) and
- not(self::m:condition)]" mode = "semantics"/>
- </m:mrow>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:exists[1]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mo>
-<!-- HELM: added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:exists/@id"/>
- </xsl:attribute>
- </xsl:if>∃</m:mo>
- <xsl:if test="count(m:bvar) > 1">
- <m:mfenced separators=",">
- <xsl:for-each select = "m:bvar">
- <xsl:apply-templates select = "." mode="semantics"/>
- </xsl:for-each>
- </m:mfenced>
- </xsl:if>
- <xsl:if test="count(m:bvar)=1">
- <xsl:apply-templates select = "m:bvar" mode="semantics"/>
- </xsl:if>
- <xsl:if test="m:condition">
- <m:mo>,</m:mo>
- <xsl:apply-templates select = "m:condition/*" mode = "semantics"/>
- </xsl:if>
- <xsl:if test="*[position()>1 and not(self::m:bvar) and not(self::m:condition)]">
- <m:mo>:</m:mo>
- <xsl:apply-templates select = "*[position()>1 and not(self::m:bvar) and
- not(self::m:condition)]" mode = "semantics"/>
- </xsl:if>
- </m:mrow>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:abs[1]]">
- <xsl:if test="not(parent::m:apply[m:power[1]])">
- <m:mfenced open="|" close="|" separators="">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select = "*[position()>1]" mode = "semantics"/>
- </m:mfenced>
- </xsl:if>
- <xsl:if test="parent::m:apply[m:power[1]]">
- <m:msup>
- <m:mfenced open="|" close="|" separators="">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select = "*[position()>1]" mode = "semantics"/>
- </m:mfenced>
- <xsl:apply-templates select = "../*[3]" mode = "semantics"/>
- </m:msup>
- </xsl:if>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:conjugate[1]]">
- <m:mover>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mrow>
- <xsl:apply-templates select = "*[position()>1]" mode = "semantics"/>
- </m:mrow>
- <m:mo>
- <!-- HELM: added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:conjugate/@id"/>
- </xsl:attribute>
- </xsl:if>̲</m:mo>
- </m:mover>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:arg[1] | m:real[1] | m:imaginary[1]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mo>
- <xsl:if test="m:arg">
-<!-- HELM: added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:arg/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:value-of select="'Arg'"/>
- </xsl:if>
- <xsl:if test="m:real">
-<!-- HELM: added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:real/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:value-of select="'Re'"/>
- </xsl:if>
- <xsl:if test="m:imaginary">
-<!-- HELM: added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:imaginary/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:value-of select="'Im'"/>
- </xsl:if>
- </m:mo>
- <m:mfenced separators="">
- <xsl:apply-templates select = "*[2]" mode = "semantics"/>
- </m:mfenced>
- </m:mrow>
-</xsl:template>
-
-
-<!-- ***************** RELATIONS ***************** -->
-
-<xsl:template match = "m:apply[m:neq | m:approx | m:tendsto | m:implies
- | m:in | m:notin | m:notsubset | m:notprsubset
- | m:subset | m:prsubset | m:eq | m:gt | m:lt
- | m:geq | m:leq | m:equivalent]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:if test="*[1]=m:neq or *[1]=m:approx or *[1]=m:tendsto or
- *[1]=m:implies or *[1]=m:in or *[1]=m:notin or
- *[1]=m:notsubset or *[1]=m:notprsubset">
- <xsl:apply-templates select = "*[2]" mode = "semantics"/>
- <m:mo>
- <xsl:if test="*[1]=m:neq">
-<!-- HELM: added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:neq/@id"/>
- </xsl:attribute>
- </xsl:if>
- ≠
- </xsl:if>
- <xsl:if test="*[1]=m:approx">
-<!-- HELM: added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:approx/@id"/>
- </xsl:attribute>
- </xsl:if>
- ≊
- </xsl:if>
- <xsl:if test="*[1]=m:tendsto">
-<!-- HELM: added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:tendsto/@id"/>
- </xsl:attribute>
- </xsl:if>
- →
- </xsl:if>
- <xsl:if test="*[1]=m:implies">
-<!-- HELM: added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:implies/@id"/>
- </xsl:attribute>
- </xsl:if>
- ⇒
- </xsl:if>
- <xsl:if test="*[1]=m:in">
-<!-- HELM: added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:in/@id"/>
- </xsl:attribute>
- </xsl:if>
- ∈
- </xsl:if>
- <xsl:if test="*[1]=m:notin">
-<!-- HELM: added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:notin/@id"/>
- </xsl:attribute>
- </xsl:if>
- ∉
- </xsl:if>
- <xsl:if test="*[1]=m:notsubset">
-<!-- HELM: added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:notsubset/@id"/>
- </xsl:attribute>
- </xsl:if>
- ⊄
- </xsl:if>
- <xsl:if test="*[1]=m:notprsubset">
-<!-- HELM: added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:notprsubset/@id"/>
- </xsl:attribute>
- </xsl:if>
- ⊈
- </xsl:if>
- </m:mo>
- <xsl:apply-templates select = "*[3]" mode = "semantics"/>
- <xsl:if test="*[1]=m:tendsto and m:tendsto[1][@type='below']">
- <m:mo>
-<!-- HELM: added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:tendsto/@id"/>
- </xsl:attribute>
- </xsl:if>-</m:mo>
- </xsl:if>
- <xsl:if test="*[1]=m:tendsto and m:tendsto[1][@type='above']">
- <m:mo>
-<!-- HELM: added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:tendsto/@id"/>
- </xsl:attribute>
- </xsl:if>+</m:mo>
- </xsl:if>
- </xsl:if>
- <xsl:if test="*[1]=m:subset or *[1]=m:prsubset or *[1]=m:eq or *[1]=m:gt
- or *[1]=m:lt or *[1]=m:geq or *[1]=m:leq or *[1]=m:equivalent">
- <xsl:apply-templates select = "*[2]" mode="semantics"/>
- <xsl:for-each select = "*[position()>2]">
- <m:mo>
- <xsl:if test="../*[self::m:subset][1]">
-<!-- HELM: added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="../m:subset/@id"/>
- </xsl:attribute>
- </xsl:if>
- ⊆
- </xsl:if>
- <xsl:if test="../*[self::m:prsubset][1]">
-<!-- HELM: added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="../m:prsubset/@id"/>
- </xsl:attribute>
- </xsl:if>
- ⊂
- </xsl:if>
- <xsl:if test="../*[self::m:eq][1]">
-<!-- HELM: added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="../m:eq/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:value-of select="'='"/>
- </xsl:if>
- <xsl:if test="../*[self::m:gt][1]">
-<!-- HELM: added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="../m:gt/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:value-of select="'>'"/>
- </xsl:if>
- <xsl:if test="../*[self::m:lt][1]">
-<!-- HELM: added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="../m:lt/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:value-of select="'<'"/>
- </xsl:if>
- <xsl:if test="../*[self::m:geq][1]">
-<!-- HELM: added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="../m:geq/@id"/>
- </xsl:attribute>
- </xsl:if>
- ≥
- </xsl:if>
- <xsl:if test="../*[self::m:leq][1]">
-<!-- HELM: added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="../m:leq/@id"/>
- </xsl:attribute>
- </xsl:if>
- ≤
- </xsl:if>
- <xsl:if test="../*[self::m:equivalent][1]">
-<!-- HELM: added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="../m:equivalent/@id"/>
- </xsl:attribute>
- </xsl:if>
- ≡
- </xsl:if>
- </m:mo>
- <xsl:apply-templates select = "." mode="semantics"/>
- </xsl:for-each>
- </xsl:if>
- </m:mrow>
-</xsl:template>
-
-
-<!-- ***************** CALCULUS ***************** -->
-
-<xsl:template match = "m:apply[*[1][self::m:ln]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="parent::m:apply[m:power[1]]">
- <m:msup>
- <m:mo>
-<!-- HELM: added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:ln/@id"/>
- </xsl:attribute>
- </xsl:if>ln</m:mo>
- <xsl:apply-templates select = "../*[3]" mode = "semantics"/>
- </m:msup>
- </xsl:when>
- <xsl:otherwise>
- <m:mo>
-<!-- HELM: added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:ln/@id"/>
- </xsl:attribute>
- </xsl:if>ln</m:mo>
- </xsl:otherwise>
- </xsl:choose>
- <m:mo>⁡</m:mo>
- <xsl:apply-templates select = "*[2]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
- </xsl:apply-templates>
- </m:mrow>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:log[1]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="parent::m:apply[m:power[1]]">
- <xsl:if test="not(*[2]=m:logbase)">
- <m:msup>
- <m:mo>
-<!-- HELM: added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:log/@id"/>
- </xsl:attribute>
- </xsl:if>log</m:mo>
- <xsl:apply-templates select = "../*[3]" mode = "semantics"/>
- </m:msup>
- </xsl:if>
- <xsl:if test="*[2]=m:logbase">
- <m:msubsup>
- <m:mo>
-<!-- HELM: added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:log/@id"/>
- </xsl:attribute>
- </xsl:if>log</m:mo>
- <xsl:apply-templates select = "../*[3]" mode = "semantics"/>
- <xsl:apply-templates select = "m:logbase" mode = "semantics"/>
- </m:msubsup>
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- <xsl:if test="not(*[2]=m:logbase)">
- <m:mo>log</m:mo>
- </xsl:if>
- <xsl:if test="*[2]=m:logbase">
- <m:msub>
- <m:mo>
-<!-- HELM: added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:log/@id"/>
- </xsl:attribute>
- </xsl:if>log</m:mo>
- <xsl:apply-templates select = "m:logbase" mode = "semantics"/>
- </m:msub>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- <m:mo>⁡</m:mo>
- <xsl:if test="*[2]=m:logbase">
- <xsl:apply-templates select = "*[3]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
- </xsl:apply-templates>
- </xsl:if>
- <xsl:if test="not(*[2]=m:logbase)">
- <xsl:apply-templates select = "*[2]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
- </xsl:apply-templates>
- </xsl:if>
- </m:mrow>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:diff[1]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:if test="*[2]=m:bvar and m:bvar[*[2]=m:degree]">
- <m:mfrac>
-<!-- HELM: added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:diff/@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:msup>
- <m:mo>d</m:mo>
- <xsl:apply-templates select = "m:bvar/m:degree" mode = "semantics"/>
- </m:msup>
- <m:mrow>
- <m:mo>d</m:mo>
- <m:msup>
- <xsl:apply-templates select = "m:bvar/*[1]" mode = "semantics"/>
- <xsl:apply-templates select = "m:bvar/m:degree" mode = "semantics"/>
- </m:msup>
- </m:mrow>
- </m:mfrac>
- </xsl:if>
- <xsl:if test="*[2]=m:bvar and not(m:bvar[*[2]=m:degree])">
- <m:mfrac>
-<!-- HELM: added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:diff/@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mo>d</m:mo>
- <m:mrow>
- <m:mo>d</m:mo>
- <xsl:apply-templates select = "m:bvar/*[1]" mode = "semantics"/>
- </m:mrow>
- </m:mfrac>
- </xsl:if>
- <xsl:apply-templates select = "*[3]" mode = "semantics"/>
- </m:mrow>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:partialdiff[1]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:for-each select = "m:bvar">
- <xsl:if test="*[last()]=m:degree">
- <m:mfrac>
-<!-- HELM: added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:partialdiff/@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:msup>
- <m:mo>d</m:mo>
- <xsl:apply-templates select = "m:degree" mode = "semantics"/>
- </m:msup>
- <m:mrow>
- <m:mo>d</m:mo>
- <m:msup>
- <xsl:apply-templates select = "*[1]" mode = "semantics"/>
- <xsl:apply-templates select = "m:degree" mode = "semantics"/>
- </m:msup>
- </m:mrow>
- </m:mfrac>
- </xsl:if>
- <xsl:if test="not(*[last()]=m:degree)">
- <m:mfrac>
-<!-- HELM: added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:partialdiff/@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mo>d</m:mo>
- <m:mrow>
- <m:mo>d</m:mo>
- <xsl:apply-templates select = "*[1]" mode = "semantics"/>
- </m:mrow>
- </m:mfrac>
- </xsl:if>
- </xsl:for-each>
- <xsl:apply-templates select = "*[last()]" mode = "semantics"/>
- </m:mrow>
-</xsl:template>
-
-<xsl:template match = "m:lowlimit | m:uplimit | m:bvar | m:degree |
- m:logbase">
- <xsl:apply-templates select="*" mode = "semantics"/>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:divergence[1] | m:grad[1] | m:curl[1]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mo>
- <xsl:if test="*[1]=m:divergence">
-<!-- HELM: added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:divergence/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:value-of select="'div'"/>
- </xsl:if>
- <xsl:if test="*[1]=m:grad">
-<!-- HELM: added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:grad/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:value-of select="'grad'"/>
- </xsl:if>
- <xsl:if test="*[1]=m:curl">
-<!-- HELM: added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:curl/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:value-of select="'curl'"/>
- </xsl:if>
- </m:mo>
- <xsl:choose>
- <xsl:when test="*[2]=m:ci">
- <xsl:apply-templates select = "*[2]" mode = "semantics"/>
- </xsl:when>
- <xsl:otherwise>
- <m:mfenced separators="">
- <xsl:apply-templates select = "*[2]" mode = "semantics"/>
- </m:mfenced>
- </xsl:otherwise>
- </xsl:choose>
- </m:mrow>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:laplacian[1]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:msup>
-<!-- HELM: added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:laplacian/@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mo>Δ</m:mo>
- <m:mn>2</m:mn>
- </m:msup>
- <xsl:apply-templates select = "*[2]" mode = "semantics"/>
- </m:mrow>
-</xsl:template>
-
-
-<!-- ***************** SET THEORY ***************** -->
-
-<xsl:template match = "m:set | m:list">
- <m:mfenced open="{{" close="}}" separators="">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:if test="*[1]=m:bvar and *[2]=m:condition">
- <xsl:apply-templates select="m:bvar" mode = "semantics"/>
- <m:mo>|</m:mo>
- <xsl:apply-templates select="m:condition" mode = "semantics"/>
- </xsl:if>
- <xsl:if test="*[1]=m:condition and not(child::m:bvar)">
- <m:mfenced open="" close="" separators=",">
- <xsl:for-each select = "*[not(self::m:condition) and not(self::m:bvar)]">
- <xsl:apply-templates select = "." mode="semantics"/>
- </xsl:for-each>
- </m:mfenced>
- <m:mo>|</m:mo>
- <xsl:apply-templates select="m:condition" mode = "semantics"/>
- </xsl:if>
- <xsl:if test="not(child::m:bvar) and not(child::m:condition)">
- <m:mfenced open="" close="" separators=",">
- <xsl:for-each select = "*">
- <xsl:apply-templates select = "." mode="semantics"/>
- </xsl:for-each>
- </m:mfenced>
- </xsl:if>
- </m:mfenced>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:union[1]]">
- <xsl:param name="IN_PREC" select="$NO_PREC"/>
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:choose>
- <xsl:when test="$IN_PREC > $UNION_PREC or $IN_PREC=$UNION_PREC
- and $PARAM=$PAR_SAME">
- <m:mfenced separators="">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="union">
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </m:mfenced>
- </xsl:when>
- <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $FUNCTION_PREC
- and not($SEM_SW=$SEM_ALL) and not($SEM_SW=$SEM_XREF)
- and not($SEM_SW=$SEM_XREF_EXT)">
- <xsl:apply-templates select="." mode="union">
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="union">
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </m:mrow>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:union[1]]" mode="union">
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:apply-templates select = "*[2]" mode="semantics">
- <xsl:with-param name="IN_PREC" select="$UNION_PREC"/>
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- <xsl:for-each select = "*[position()>2]">
- <m:mo>
-<!-- HELM: added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="../m:union/@id"/>
- </xsl:attribute>
- </xsl:if>⋃</m:mo>
- <xsl:apply-templates select = "." mode="semantics">
- <xsl:with-param name="IN_PREC" select="$UNION_PREC"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- </xsl:for-each>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:intersect[1]]">
- <xsl:param name="IN_PREC" select="$NO_PREC"/>
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:choose>
- <xsl:when test="$IN_PREC > $INTERSECT_PREC">
- <m:mfenced separators="">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="intersect">
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </m:mfenced>
- </xsl:when>
- <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $FUNCTION_PREC
- and not($SEM_SW=$SEM_ALL) and not($SEM_SW=$SEM_XREF)
- and not($SEM_SW=$SEM_XREF_EXT)">
- <xsl:apply-templates select="." mode="intersect">
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="intersect">
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </m:mrow>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:intersect[1]]" mode="intersect">
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:apply-templates select = "*[2]" mode="semantics">
- <xsl:with-param name="IN_PREC" select="$INTERSECT_PREC"/>
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- <xsl:for-each select = "*[position()>2]">
- <m:mo>
-<!-- HELM: added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="../m:intersect/@id"/>
- </xsl:attribute>
- </xsl:if>⋂</m:mo>
- <xsl:apply-templates select = "." mode="semantics">
- <xsl:with-param name="IN_PREC" select="$INTERSECT_PREC"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- </xsl:for-each>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:setdiff[1]]">
- <xsl:param name="IN_PREC" select="$NO_PREC"/>
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:choose>
- <xsl:when test="$IN_PREC > $SETDIFF_PREC or $IN_PREC=$SETDIFF_PREC
- and $PARAM=$PAR_SAME">
- <m:mfenced separators="">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="setdiff">
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </m:mfenced>
- </xsl:when>
- <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $FUNCTION_PREC
- and not($SEM_SW=$SEM_ALL) and not($SEM_SW=$SEM_XREF)
- and not($SEM_SW=$SEM_XREF_EXT)">
- <xsl:apply-templates select="." mode="setdiff">
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="setdiff">
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </m:mrow>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:setdiff[1]]" mode="setdiff">
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:apply-templates select = "*[2]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$SETDIFF_PREC"/>
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- <m:mo>
-<!-- HELM: added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:setdiff/@id"/>
- </xsl:attribute>
- </xsl:if>\</m:mo>
- <xsl:apply-templates select = "*[3]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$SETDIFF_PREC"/>
- <xsl:with-param name="PARAM" select="$PAR_SAME"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:card[1]]">
- <m:mfenced open="|" close="|" separators=",">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:for-each select = "*[position()>1]">
- <xsl:apply-templates select = "." mode="semantics"/>
- </xsl:for-each>
- </m:mfenced>
-</xsl:template>
-
-
-<!-- ***************** SEQUENCES AND SERIES ***************** -->
-
-<xsl:template match = "m:apply[m:sum[1] | m:product[1]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="*[2]=m:bvar and m:lowlimit and m:uplimit">
- <m:munderover>
- <m:mo>
- <xsl:if test="*[1]=m:sum">
-<!-- HELM: added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:sum/@id"/>
- </xsl:attribute>
- </xsl:if>
- ∑
- </xsl:if>
- <xsl:if test="*[1]=m:product">
-<!-- HELM: added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:product/@id"/>
- </xsl:attribute>
- </xsl:if>
- ∏
- </xsl:if>
- </m:mo>
- <m:mrow>
- <xsl:apply-templates select = "*[2]" mode = "semantics"/>
- <m:mo>=</m:mo>
- <xsl:apply-templates select = "m:lowlimit" mode = "semantics"/>
- </m:mrow>
- <xsl:apply-templates select = "m:uplimit" mode = "semantics"/>
- </m:munderover>
- <xsl:apply-templates select = "*[5]" mode = "semantics"/>
- </xsl:when>
- <xsl:when test="*[2]=m:bvar and *[3]=m:condition">
- <m:munder>
- <m:mo>
- <xsl:if test="*[1]=m:sum">
-<!-- HELM: added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:sum/@id"/>
- </xsl:attribute>
- </xsl:if>
- ∑
- </xsl:if>
- <xsl:if test="*[1]=m:product">
-<!-- HELM: added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:product/@id"/>
- </xsl:attribute>
- </xsl:if>
- ∏
- </xsl:if>
- </m:mo>
- <xsl:apply-templates select = "*[3]" mode = "semantics"/>
- </m:munder>
- <xsl:apply-templates select = "*[4]" mode = "semantics"/>
- </xsl:when>
- </xsl:choose>
- </m:mrow>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:limit[1]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:munder>
- <m:mo>
-<!-- HELM: added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:lim/@id"/>
- </xsl:attribute>
- </xsl:if>lim</m:mo>
- <m:mrow>
- <xsl:if test="*[2]=m:bvar and *[3]=m:lowlimit">
- <xsl:apply-templates select = "*[2]" mode = "semantics"/>
- <m:mo>→</m:mo>
- <xsl:apply-templates select = "*[3]" mode = "semantics"/>
- </xsl:if>
- <xsl:if test="*[2]=m:bvar and *[3]=m:condition">
- <xsl:apply-templates select = "*[3]" mode = "semantics"/>
- </xsl:if>
- </m:mrow>
- </m:munder>
- <xsl:apply-templates select = "*[4]" mode = "semantics"/>
- </m:mrow>
-</xsl:template>
-
-
-<!-- ***************** TRIGONOMETRY ***************** -->
-
-<xsl:template match = "m:apply[*[1][self::m:sin | self::m:cos |
- self::m:tan | self::m:sec | self::m:csc |
- self::m:cot | self::m:sinh | self::m:cosh |
- self::m:tanh | self::m:sech | self::m:csch |
- self::m:coth | self::m:arcsin | self::m:arccos |
- self::m:arctan]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:if test="not(parent::m:apply[m:power[1]])">
- <xsl:apply-templates select = "*[1]" mode = "trigonometry"/>
- </xsl:if>
- <xsl:if test="parent::m:apply[m:power[1]]">
- <m:msup>
- <xsl:apply-templates select = "*[1]" mode = "trigonometry"/>
- <xsl:apply-templates select = "../*[3]" mode = "semantics"/>
- </m:msup>
- </xsl:if>
- <m:mo>⁡</m:mo>
- <xsl:apply-templates select = "*[2]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- </m:mrow>
-</xsl:template>
-
-<xsl:template match = "*" mode="trigonometry">
- <m:mo>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="self::m:sin">
- <xsl:value-of select="'sin'"/>
- </xsl:when>
- <xsl:when test="self::m:cos">
- <xsl:value-of select="'cos'"/>
- </xsl:when>
- <xsl:when test="self::m:tan">
- <xsl:value-of select="'tan'"/>
- </xsl:when>
- <xsl:when test="self::m:sec">
- <xsl:value-of select="'sec'"/>
- </xsl:when>
- <xsl:when test="self::m:csc">
- <xsl:value-of select="'csc'"/>
- </xsl:when>
- <xsl:when test="self::m:cot">
- <xsl:value-of select="'cot'"/>
- </xsl:when>
- <xsl:when test="self::m:sinh">
- <xsl:value-of select="'sinh'"/>
- </xsl:when>
- <xsl:when test="self::m:cosh">
- <xsl:value-of select="'cosh'"/>
- </xsl:when>
- <xsl:when test="self::m:tanh">
- <xsl:value-of select="'tanh'"/>
- </xsl:when>
- <xsl:when test="self::m:sech">
- <xsl:value-of select="'sech'"/>
- </xsl:when>
- <xsl:when test="self::m:csch">
- <xsl:value-of select="'csch'"/>
- </xsl:when>
- <xsl:when test="self::m:coth">
- <xsl:value-of select="'coth'"/>
- </xsl:when>
- <xsl:when test="self::m:arcsin">
- <xsl:value-of select="'arcsin'"/>
- </xsl:when>
- <xsl:when test="self::m:arccos">
- <xsl:value-of select="'arccos'"/>
- </xsl:when>
- <xsl:when test="self::m:arctan">
- <xsl:value-of select="'arctan'"/>
- </xsl:when>
- </xsl:choose>
- </m:mo>
-</xsl:template>
-
-
-<!-- ***************** STATISTICS ***************** -->
-
-<xsl:template match = "m:apply[m:mean[1]]">
- <m:mfenced open="<" close=">" separators=",">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:for-each select = "*[position()>1]">
- <xsl:apply-templates select = "." mode="semantics"/>
- </xsl:for-each>
- </m:mfenced>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:sdev[1]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mo>
-<!-- HELM: added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:sdev/@id"/>
- </xsl:attribute>
- </xsl:if>σ</m:mo>
- <m:mfenced separators=",">
- <xsl:for-each select = "*[position()>1]">
- <xsl:apply-templates select = "." mode="semantics"/>
- </xsl:for-each>
- </m:mfenced>
- </m:mrow>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:variance[1]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mo>
-<!-- HELM: added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:variance/@id"/>
- </xsl:attribute>
- </xsl:if>σ</m:mo>
- <m:msup>
- <m:mfenced separators=",">
- <xsl:for-each select = "*[position()>1]">
- <xsl:apply-templates select = "." mode="semantics"/>
- </xsl:for-each>
- </m:mfenced>
- <m:mn>2</m:mn>
- </m:msup>
- </m:mrow>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:median[1]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mo>
-<!-- HELM: added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:median/@id"/>
- </xsl:attribute>
- </xsl:if>median</m:mo>
- <m:mfenced separators=",">
- <xsl:for-each select = "*[position()>1]">
- <xsl:apply-templates select = "." mode="semantics"/>
- </xsl:for-each>
- </m:mfenced>
- </m:mrow>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:mode[1]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mo>
-<!-- HELM: added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:mode/@id"/>
- </xsl:attribute>
- </xsl:if>mode</m:mo>
- <m:mfenced separators=",">
- <xsl:for-each select = "*[position()>1]">
- <xsl:apply-templates select = "." mode="semantics"/>
- </xsl:for-each>
- </m:mfenced>
- </m:mrow>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:moment[1]]">
- <m:mfenced open="<" close=">" separators="">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:if test="*[2]=m:degree">
- <m:msup>
- <xsl:apply-templates select="*[3]" mode = "semantics"/>
- <xsl:apply-templates select="*[2]" mode = "semantics"/>
- </m:msup>
- </xsl:if>
- <xsl:if test="not(*[2]=m:degree)">
- <xsl:for-each select = "*[position()>1]">
- <xsl:apply-templates select = "." mode="semantics"/>
- </xsl:for-each>
- </xsl:if>
- </m:mfenced>
-</xsl:template>
-
-
-<!-- ***************** LINEAR ALGEBRA ***************** -->
-
-<xsl:template match="m:vector">
- <m:mfenced separators="">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mtable>
- <xsl:for-each select="*">
- <m:mtd>
- <xsl:apply-templates select="." mode = "semantics"/>
- </m:mtd>
- </xsl:for-each>
- </m:mtable>
- </m:mfenced>
-</xsl:template>
-
-<xsl:template match = "m:matrix">
- <m:mfenced separators="">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mtable>
- <xsl:apply-templates select="*" mode = "semantics"/>
- </m:mtable>
- </m:mfenced>
-</xsl:template>
-
-<xsl:template match = "m:matrixrow">
- <m:mtr>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:for-each select="*">
- <m:mtd>
- <xsl:apply-templates select="." mode = "semantics"/>
- </m:mtd>
- </xsl:for-each>
- </m:mtr>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:determinant[1]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mo>
-<!-- HELM: added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:determinant/@id"/>
- </xsl:attribute>
- </xsl:if>det</m:mo>
- <xsl:apply-templates select = "*[2]" mode = "semantics"/>
- </m:mrow>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:transpose[1]]">
- <m:msup>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select = "*[2]" mode = "semantics"/>
- <m:mo>
-<!-- HELM: added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:transpose/@id"/>
- </xsl:attribute>
- </xsl:if>T</m:mo>
- </m:msup>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:selector[1]]">
- <xsl:if test="*[2]=m:matrix and *[3]=m:cn">
- <xsl:variable name="m" select = "*[3]"/>
- <xsl:choose>
- <xsl:when test="*[4]=m:cn">
- <xsl:variable name="n" select = "*[4]"/>
- <xsl:copy-of select = "m:matrix/*[position()=$m]/*[position()=$n]"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:copy-of select = "m:matrix/*[position()=$m]"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- <xsl:if test="(*[2]=m:vector or *[2]=m:list) and *[3]=m:cn">
- <xsl:variable name="m" select = "*[3]"/>
- <xsl:copy-of select = "*[2]/*[position()=$m]"/>
- </xsl:if>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:vectorproduct[1] |
- m:scalarproduct[1] | m:outerproduct[1]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="*[2]" mode = "semantics"/>
- <m:mo>
- <xsl:if test="m:vectorproduct[1]">
-<!-- HELM: added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:vectorproduct/@id"/>
- </xsl:attribute>
- </xsl:if>
- ⨯
- </xsl:if>
- <xsl:if test="m:scalarproduct[1] | m:outerproduct[1]">
-<!-- HELM: added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="*[1]/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:value-of select="'.'"/>
- </xsl:if>
- </m:mo>
- <xsl:apply-templates select="*[3]" mode = "semantics"/>
- </m:mrow>
-</xsl:template>
-
-</xsl:stylesheet>
+++ /dev/null
-<?xml version="1.0"?>
-
-<!-- ******************************************************** -->
-<!-- XSL Transform of MathML content to MathML presentation -->
-<!-- -->
-<!-- Authors Igor Rodionov <igor@csd.uwo.ca>, -->
-<!-- Stephen Watt <watt@csd.uwo.ca>. -->
-<!-- -->
-<!-- (C) Copyright 2000 Symbolic Computation Laboratory, -->
-<!-- University of Western Ontario, -->
-<!-- London, Canada N6A 5B7. -->
-<!-- -->
-<!-- ******************************************************** -->
-<!-- Updated Nov. 2001 by: -->
-<!-- S. Huerter <huerter@csd.uwo.ca>. -->
-<!-- -->
-<!-- Complies with the W3C MathML 2.0 Recommendation of -->
-<!-- 21 February 2001. -->
-<!-- ******************************************************** -->
-
-<!-- ====================================================== -->
-<!-- April, 10 2002 - HELM group: -->
-<!-- Added the namespace prefix to all the output elements -->
-<!-- (see 7.1.1.2) -->
-<!-- Changed the mml prefix into m (see A.3) -->
-<!-- Added xref to every mo element -->
-<!-- New csymbol template -->
-<!-- reln is not supported -->
-<!-- HELM tag used for changes -->
-<!-- First draft: April 10 2002, Irene Schena -->
-<!-- ====================================================== -->
-
-<xsl:stylesheet id="mmlctop.xsl"
- version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:m="http://www.w3.org/1998/Math/MathML">
-
-<!-- HELM: we don't have a default namespace.
- Removed xmlns="http://www.w3.org/1998/Math/MathML" -->
-
-<!-- HELM: was
-<xsl:output method="xml" indent="yes"/>
- only for HELM!
--->
-<xsl:output method="xml"/>
-
-<xsl:strip-space elements="apply semantics annotation-xml
- csymbol fn cn ci interval matrix matrixrow vector
- lambda bvar condition logbase degree set list
- lowlimit uplimit"/>
-
-
-<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
-<!-- Parameters, variables and constants -->
-<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
-
-<!-- ~~~~~~~~ Semantics related *constants*: ~~~~~~~~ -->
-
-<!-- Strip off semantics -->
-<xsl:variable name="SEM_STRIP" select="-1"/>
-
-<!-- Pass semantics "as is" -->
-<xsl:variable name="SEM_PASS" select="0"/>
-
-<!-- Add semantics at top level only -->
-<xsl:variable name="SEM_TOP" select="1"/>
-
-<!-- Add semantics at all levels -->
-<xsl:variable name="SEM_ALL" select="2"/>
-
-<!-- Semantics at top level only, with id refs -->
-<!-- NOTE: ids have to be already present in the
- input for this feature to work. -->
-<xsl:variable name="SEM_XREF" select="3"/>
-
-<!-- No semantics at top level, with id refs -->
-<!-- NOTE: ids have to be already present in the
- input for this feature to work. -->
-<xsl:variable name="SEM_XREF_EXT" select="4"/>
-
-
-<!-- ~~~~~~~~~~ Stylesheet *parameter*: SEM_SW ~~~~~~~~~~~~~~ -->
-<!-- Assumes one of the above values; SEM_PASS is the default -->
-<!-- The default can be overridden by specifying different -->
-<!-- value on the command line when the stylesheet is invoked -->
-
-<!-- HELM: $SEM_SW was SEM_PASS (error!) -->
-<xsl:param name="SEM_SW" select="$SEM_XREF"/>
-
-
-<!-- ~~~~~~ Operator precedence definitions ~~~~~~ -->
-<xsl:variable name="UNION_OP" select="2"/>
-<xsl:variable name="INTERSECT_OP" select="6"/>
-<xsl:variable name="SETDIFF_OP" select="4"/>
-<xsl:variable name="NO_PREC" select="0"/>
-<xsl:variable name="UNION_PREC" select="1"/>
-<xsl:variable name="SETDIFF_PREC" select="1"/>
-<xsl:variable name="INTERSECT_PREC" select="3"/>
-<xsl:variable name="CARTPROD_PREC" select="3"/>
-<xsl:variable name="OR_PREC" select="5"/>
-<xsl:variable name="XOR_PREC" select="5"/>
-<xsl:variable name="AND_PREC" select="7"/>
-<xsl:variable name="PLUS_PREC" select="9"/>
-<xsl:variable name="MINUS_PREC" select="9"/>
-<xsl:variable name="MUL_PREC" select="11"/>
-<xsl:variable name="DIV_PREC" select="11"/>
-<xsl:variable name="NEG_PREC" select="13"/>
-<xsl:variable name="FUNCTION_PREC" select="99"/>
-
-<!-- ~~~~~ Miscellaneous constant definitions ~~~~~ -->
-
-<xsl:variable name="YES" select="1"/>
-<xsl:variable name="NO" select="0"/>
-<xsl:variable name="NO_PARAM" select="-1"/>
-<xsl:variable name="PAR_SAME" select="-3"/>
-<xsl:variable name="PAR_YES" select="-5"/>
-<xsl:variable name="PAR_NO" select="-7"/>
-<xsl:variable name="DOESNT_MATTER" select="-9"/>
-
-<!-- +++++++++++++++++ INDEX OF TEMPLATES +++++++++++++++++++ -->
-
-<!-- All templates are subdivided into the following categories
- (listed in the order of appearance in the stylesheet):
-
-THE TOPMOST ELEMENT: MATH
- math
-
-SEMANTICS HANDLING
- semantics
-
-BASIC CONTAINER ELEMENTS
- cn, ci, csymbol
-
-BASIC CONTENT ELEMENTS
- fn, interval, inverse, sep, condition, declare, lambda, compose, ident
-
- *NEW: apply, piecewise, domain, codomain, image
-
-ARITHMETIC, ALGEBRA & LOGIC
- quotient, exp, factorial, max, min, minus, plus, power, rem, divide,
- times, root, gcd, and, or, xor, not, forall, exists, abs, conjugate,
- arg, real, imaginary
-
- *NEW: floor, ceiling, lcm
-
-RELATIONS
- neq, approx, tendsto, implies, in, notin, notsubset, notprsubset,
- subset, prsubset, eq, gt, lt, geq, leq, equivalent
-
-CALCULUS
- ln, log, diff, partialdiff, lowlimit, uplimit, bvar, degree,
- logbase, divergence, grad, curl, laplacian
-
-SET THEORY
- set, list, union, intersect, setdiff, card
-
- *NEW: cartesianproduct
-
-SEQUENCES AND SERIES
- sum, product, limit
-
- *NEW: int
-
-TRIGONOMETRY
- sin, cos, tan, sec, csc, cot, sinh, cosh, tanh, sech, csch, coth,
- arcsin, arccos, arctan
-
- *NEW: arcsec, arccsc, arccot, arcsinh, arccosh, arctanh,
- arcsech, arccsch, arccoth,
-
-STATISTICS
- mean, sdev, variance, median, mode, moment
-
-LINEAR ALGEBRA
- vector, matrix, matrixrow, determinant, transpose, selector,
- vectorproduct, scalarproduct, outerproduct
--->
-
-
-<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
-<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~ TEMPLATES ~~~~~~~~~~~~~~~~~~~~~~~~~ -->
-<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
-
-
-<!-- ***************** THE TOPMOST ELEMENT: MATH ***************** -->
-
-<xsl:template match = "m:math">
-<!-- HELM: <m:math> only for HELM! -->
- <xsl:choose>
- <xsl:when test="$SEM_SW=$SEM_TOP or $SEM_SW=$SEM_ALL and *[2] or $SEM_SW=$SEM_XREF"> <m:semantics>
- <m:mrow>
- <xsl:apply-templates mode = "semantics"/>
- </m:mrow>
- <m:annotation-xml encoding="MathML">
- <xsl:copy-of select="*"/>
- </m:annotation-xml>
- </m:semantics>
- </xsl:when>
- <xsl:otherwise>
- <m:mrow>
- <xsl:apply-templates mode = "semantics"/>
- </m:mrow>
- </xsl:otherwise>
- </xsl:choose>
-<!-- HELM: </m:math> -->
-</xsl:template>
-
-
-<!-- ***************** SEMANTICS HANDLING ***************** -->
-
-<!-- This template is called recursively. At each level -->
-<!-- in the source tree it decides whether to strip off, -->
-<!-- pass or add semantics at that level (depending on the -->
-<!-- value of SEM_SW parameter). Then the actual template -->
-<!-- is applied to the node. -->
-
-<xsl:template match = "m:*" mode = "semantics">
- <xsl:param name="IN_OP" select="$DOESNT_MATTER"/>
- <xsl:param name="IN_PREC" select="$NO_PREC"/>
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:choose>
- <xsl:when test="$SEM_SW=$SEM_STRIP and self::m:semantics">
- <xsl:apply-templates select="m:annotation-xml[@encoding='MathML']">
- <xsl:with-param name="IN_OP" select="$IN_OP"/>
- <xsl:with-param name="IN_PREC" select="$IN_PREC"/>
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:when test="($SEM_SW=$SEM_PASS or $SEM_SW=$SEM_TOP) and self::m:semantics">
- <m:semantics>
- <xsl:apply-templates select="*[1]">
- <xsl:with-param name="IN_OP" select="$IN_OP"/>
- <xsl:with-param name="IN_PREC" select="$IN_PREC"/>
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- <xsl:copy-of select="m:annotation-xml"/>
- </m:semantics>
- </xsl:when>
- <xsl:when test="$SEM_SW=$SEM_ALL">
- <m:semantics>
- <xsl:choose>
- <xsl:when test="self::m:semantics">
- <xsl:apply-templates select="*[1]">
- <xsl:with-param name="IN_OP" select="$IN_OP"/>
- <xsl:with-param name="IN_PREC" select="$IN_PREC"/>
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- <xsl:copy-of select="m:annotation-xml"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select=".">
- <xsl:with-param name="IN_OP" select="$IN_OP"/>
- <xsl:with-param name="IN_PREC" select="$IN_PREC"/>
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- <m:annotation-xml encoding="MathML">
- <xsl:copy-of select="."/>
- </m:annotation-xml>
- </xsl:otherwise>
- </xsl:choose>
- </m:semantics>
- </xsl:when>
- <xsl:when test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:choose>
-<!-- HELM: syntax error, was sematics -->
- <xsl:when test="self::m:semantics">
- <xsl:copy>
- <xsl:copy-of select="@*"/>
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- <xsl:copy-of select="*[1]"/>
- <xsl:copy-of select="m:annotation-xml"/>
- </xsl:copy>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select=".">
- <xsl:with-param name="IN_OP" select="$IN_OP"/>
- <xsl:with-param name="IN_PREC" select="$IN_PREC"/>
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="self::m:semantics">
- <xsl:copy-of select="."/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select=".">
- <xsl:with-param name="IN_OP" select="$IN_OP"/>
- <xsl:with-param name="IN_PREC" select="$IN_PREC"/>
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match = "m:semantics">
- <xsl:apply-templates select="." mode = "semantics"/>
-</xsl:template>
-
-
-<!-- ***************** BASIC CONTAINER ELEMENTS ***************** -->
-
-<xsl:template match = "m:cn">
- <xsl:param name="IN_PREC" select="$NO_PREC"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:choose>
- <xsl:when test=". < 0 and $IN_PREC > $NO_PREC and $PAREN=$PAR_NO
- and $PAR_NO_IGNORE=$NO">
- <m:mfenced separators="">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="cn"/>
- </m:mfenced>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:apply-templates select="." mode="cnid"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="." mode="cn"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<!-- HELM: the entity ⁢ is not defined -->
-<xsl:template match = "m:cn" mode="cn">
- <xsl:choose>
- <xsl:when test="@base and (not(@type) or @type='integer' or @type='real')">
- <m:msub>
- <m:mn> <xsl:apply-templates mode = "semantics"/> </m:mn>
- <m:mn> <xsl:value-of select="@base"/> </m:mn>
- </m:msub>
- </xsl:when>
- <xsl:when test="@type='e-notation' and not(@base) and child::m:sep[1]">
- <m:mn> <xsl:apply-templates select="text()[1]" mode = "semantics"/> </m:mn>
- <m:mo> <xsl:text disable-output-escaping='yes'>⁢</xsl:text> </m:mo>
- <m:mo>e</m:mo>
- <m:mo> <xsl:text disable-output-escaping='yes'>⁢</xsl:text> </m:mo>
- <m:mn> <xsl:value-of select="text()[2]"/> </m:mn>
- </xsl:when>
- <xsl:when test="@type='complex' and not(@base) and child::m:sep[1]">
- <m:mfenced separators="">
- <m:mn> <xsl:apply-templates select="text()[1]" mode = "semantics"/> </m:mn>
- <xsl:if test="text()[2] < 0">
- <m:mo>-</m:mo>
- <m:mn> <xsl:value-of select="-text()[2]"/> </m:mn>
- </xsl:if>
- <xsl:if test="not(text()[2] < 0)">
- <m:mo>+</m:mo>
- <m:mn> <xsl:value-of select="text()[2]"/> </m:mn>
- </xsl:if>
- <m:mo><xsl:text disable-output-escaping='yes'>⁢</xsl:text> </m:mo>
- <m:mo>i</m:mo>
- </m:mfenced>
- </xsl:when>
- <xsl:when test="@type='complex' and @base and child::m:sep[1]">
- <m:msub>
- <m:mfenced separators="">
- <m:mn> <xsl:apply-templates select="text()[1]"/> </m:mn>
- <xsl:if test="text()[2] < 0">
- <m:mo>-</m:mo>
- <m:mn> <xsl:value-of select="-text()[2]"/> </m:mn>
- </xsl:if>
- <xsl:if test="not(text()[2] < 0)">
- <m:mo>+</m:mo>
- <m:mn> <xsl:apply-templates select="text()[2]"/> </m:mn>
- </xsl:if>
- <m:mo><xsl:text disable-output-escaping='yes'>⁢</xsl:text></m:mo>
- <m:mo>i</m:mo>
- </m:mfenced>
- <m:mn> <xsl:value-of select="@base"/> </m:mn>
- </m:msub>
- </xsl:when>
- <xsl:when test="@type='rational' and not(@base) and child::m:sep[1]">
- <m:mfrac>
- <m:mn> <xsl:apply-templates select="text()[1]"/> </m:mn>
- <m:mn> <xsl:apply-templates select="text()[2]"/> </m:mn>
- </m:mfrac>
- </xsl:when>
- <xsl:when test="@type='rational' and @base and child::m:sep[1]">
- <m:msub>
- <m:mfenced>
- <m:mfrac>
- <m:mn> <xsl:apply-templates select="text()[1]"/> </m:mn>
- <m:mn> <xsl:apply-templates select="text()[2]"/> </m:mn>
- </m:mfrac>
- </m:mfenced>
- <m:mn> <xsl:value-of select="@base"/> </m:mn>
- </m:msub>
- </xsl:when>
- <xsl:when test="@type='polar' and not(@base) and child::m:sep[1]">
- <m:mrow>
- <m:mo>Polar</m:mo>
- <m:mo><xsl:text disable-output-escaping='yes'>⁢</xsl:text> </m:mo>
- <m:mfenced separators=",">
- <m:mn> <xsl:apply-templates select="text()[1]"/> </m:mn>
- <m:mn> <xsl:apply-templates select="text()[2]"/> </m:mn>
- </m:mfenced>
- </m:mrow>
- </xsl:when>
- <xsl:when test="@type='polar' and @base and child::m:sep[1]">
- <m:msub>
- <m:mrow>
- <m:mo>Polar</m:mo>
- <m:mo><xsl:text disable-output-escaping='yes'>⁢</xsl:text></m:mo>
- <m:mfenced separators=",">
- <m:mn> <xsl:apply-templates select="text()[1]"/> </m:mn>
- <m:mn> <xsl:apply-templates select="text()[2]"/> </m:mn>
- </m:mfenced>
- </m:mrow>
- <m:mn> <xsl:value-of select="@base"/> </m:mn>
- </m:msub>
- </xsl:when>
- <xsl:otherwise>
-<!-- HELM: cn could contain MathML presentation -->
-<!-- HELM: was
- <m:mn> <xsl:apply-templates mode = "semantics"/> </m:mn>
- Now is: -->
- <xsl:choose>
- <xsl:when test="child::text() and not(*[1])">
- <m:mn> <xsl:apply-templates mode = "semantics"/> </m:mn>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="not(*[2])">
- <xsl:copy-of select="*[1]"/>
- </xsl:when>
- <xsl:otherwise>
- <m:mrow>
- <xsl:copy-of select="*|text()"/>
- </m:mrow>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
-<!-- HELM -->
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match = "m:cn" mode="cnid">
- <xsl:choose>
- <xsl:when test="@base and (not(@type) or @type='integer' or @type='real')">
- <m:msub xref="{@id}">
- <m:mn> <xsl:apply-templates mode = "semantics"/> </m:mn>
- <m:mn> <xsl:value-of select="@base"/> </m:mn>
- </m:msub>
- </xsl:when>
- <xsl:when test="@type='complex' and not(@base) and child::m:sep[1]">
- <m:mfenced separators="" xref="{@id}">
- <m:mn> <xsl:apply-templates select="text()[1]" mode = "semantics"/> </m:mn>
- <xsl:if test="text()[2] < 0">
- <m:mo>-</m:mo>
- <m:mn> <xsl:value-of select="-text()[2]"/> </m:mn>
- </xsl:if>
- <xsl:if test="not(text()[2] < 0)">
- <m:mo>+</m:mo>
- <m:mn> <xsl:value-of select="text()[2]"/> </m:mn>
- </xsl:if>
- <m:mo><xsl:text disable-output-escaping='yes'>⁢</xsl:text></m:mo>
- <m:mo>i</m:mo>
- </m:mfenced>
- </xsl:when>
- <xsl:when test="@type='complex' and @base and child::m:sep[1]">
- <m:msub xref="{@id}">
- <m:mfenced separators="">
- <m:mn> <xsl:apply-templates select="text()[1]"/> </m:mn>
- <xsl:if test="text()[2] < 0">
- <m:mo>-</m:mo>
- <m:mn> <xsl:value-of select="-text()[2]"/> </m:mn>
- </xsl:if>
- <xsl:if test="not(text()[2] < 0)">
- <m:mo>+</m:mo>
- <m:mn> <xsl:apply-templates select="text()[2]"/> </m:mn>
- </xsl:if>
- <m:mo><xsl:text disable-output-escaping='yes'>⁢</xsl:text> </m:mo>
- <m:mo>i</m:mo>
- </m:mfenced>
- <m:mn> <xsl:value-of select="@base"/> </m:mn>
- </m:msub>
- </xsl:when>
- <xsl:when test="@type='rational' and not(@base) and child::m:sep[1]">
- <m:mfrac xref="{@id}">
- <m:mn> <xsl:apply-templates select="text()[1]"/> </m:mn>
- <m:mn> <xsl:apply-templates select="text()[2]"/> </m:mn>
- </m:mfrac>
- </xsl:when>
- <xsl:when test="@type='rational' and @base and child::m:sep[1]">
- <m:msub xref="{@id}">
- <m:mfenced>
- <m:mfrac>
- <m:mn> <xsl:apply-templates select="text()[1]"/> </m:mn>
- <m:mn> <xsl:apply-templates select="text()[2]"/> </m:mn>
- </m:mfrac>
- </m:mfenced>
- <m:mn> <xsl:value-of select="@base"/> </m:mn>
- </m:msub>
- </xsl:when>
- <xsl:when test="@type='polar' and not(@base) and child::m:sep[1]">
- <m:mrow xref="{@id}">
- <m:mo>Polar</m:mo>
- <m:mo><xsl:text disable-output-escaping='yes'>⁢</xsl:text> </m:mo>
- <m:mfenced separators=",">
- <m:mn> <xsl:apply-templates select="text()[1]"/> </m:mn>
- <m:mn> <xsl:apply-templates select="text()[2]"/> </m:mn>
- </m:mfenced>
- </m:mrow>
- </xsl:when>
- <xsl:when test="@type='polar' and @base and child::m:sep[1]">
- <m:msub xref="{@id}">
- <m:mrow>
- <m:mo>Polar</m:mo>
- <m:mo><xsl:text disable-output-escaping='yes'>⁢</xsl:text> </m:mo>
- <m:mfenced separators=",">
- <m:mn> <xsl:apply-templates select="text()[1]"/> </m:mn>
- <m:mn> <xsl:apply-templates select="text()[2]"/> </m:mn>
- </m:mfenced>
- </m:mrow>
- <m:mn> <xsl:value-of select="@base"/> </m:mn>
- </m:msub>
- </xsl:when>
- <xsl:otherwise>
-<!-- HELM: cn could contain MathML presentation -->
-<!-- HELM: was
- <m:mn xref="{@id}"> <xsl:apply-templates mode = "semantics"/> </m:mn>
- Now is: -->
- <xsl:choose>
- <xsl:when test="child::text() and not(*[1])">
- <m:mn xref="{@id}"> <xsl:apply-templates mode = "semantics"/> </m:mn>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="id" select="@id"/>
- <xsl:choose>
- <xsl:when test="not(*[2])">
- <xsl:for-each select="*[1]">
- <xsl:copy>
- <xsl:attribute name="xref">
- <xsl:value-of select="$id"/>
- </xsl:attribute>
- <xsl:copy-of select="@*|*"/>
- </xsl:copy>
- </xsl:for-each>
- </xsl:when>
- <xsl:otherwise>
- <m:mrow xref="{$id}">
- <xsl:copy-of select="*|text()"/>
- </m:mrow>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
-<!-- HELM -->
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match = "m:ci">
- <xsl:choose>
- <xsl:when test="@type='vector' or @type=matrix or @type=set">
- <m:mi mathvariant="bold">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates mode = "semantics"/>
- </m:mi>
- </xsl:when>
- <xsl:when test="child::text() and not(child::*[1])">
- <m:mi>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
-<!-- HELM: ERROR, added mode="semantics", it didn't generate identifiers -->
- <xsl:apply-templates mode = "semantics"/>
- </m:mi>
- </xsl:when>
-<!-- HELM: text & markup !!! Not compliant with the specification -->
- <xsl:when test="child::text() and *[1] and not(*[1]=m:sep)">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
-<!-- HELM: added semantics mode -->
- <xsl:apply-templates mode="semantics"/>
- </m:mrow>
- </xsl:when>
-<!-- HELM -->
- <xsl:otherwise>
- <xsl:if test="*[2]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="*"/>
- </m:mrow>
- </xsl:if>
- <xsl:if test="not(*[2])">
-<!-- HELM: ci could contain MathML presentation -->
-<!-- HELM: was
- <xsl:apply-templates select="*[1]"/>
- Now is: -->
- <xsl:variable name="id" select="@id"/>
- <xsl:for-each select="*[1]">
- <xsl:copy>
- <xsl:attribute name="xref">
- <xsl:value-of select="$id"/>
- </xsl:attribute>
- <xsl:copy-of select="@*|*"/>
- </xsl:copy>
- </xsl:for-each>
-<!-- HELM -->
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match = "m:ci/m:*[not(self::m:sep)]">
- <xsl:copy-of select = "."/>
-</xsl:template>
-
-<!-- HELM: revised version previous Version x.xx from Feb. 18, 2000 -->
-<xsl:template match = "m:csymbol">
-<!-- HELM: mrow to maintain csymbol id -->
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:for-each select="* and text()">
- <xsl:choose>
- <xsl:when test="text()">
- <m:mo><xsl:value-of select="."/></m:mo>
- </xsl:when>
- <xsl:otherwise>
- <xsl:copy-of select = "."/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- </m:mrow>
-</xsl:template>
-
-<!-- HELM: csymbol cannot contain ci or cn elements, but only text and/or
-presentation elements. PCDATA should render as if it were wrapped in
-an mo. Mixed content: mrow which contains mo + presentation elements -->
-<!-- <xsl:template match = "m:csymbol/m:*">
- <xsl:choose>
- <xsl:when test="self::m:cn or self::m:ci">
- <xsl:apply-templates mode = "semantics"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:copy-of select = "."/>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match = "m:csymbol/text()">
- <xsl:choose>
- <xsl:when test=". < 0 or . = 0 or . > 0">
- <m:mn> <xsl:copy-of select = "."/> </m:mn>
- </xsl:when>
- <xsl:otherwise>
- <m:mi> <xsl:copy-of select = "."/> </m:mi>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template> -->
-
-
-<!-- ***************** BASIC CONTENT ELEMENTS ***************** -->
-
-<!-- HELM: the entity ⁡ is not defined: -->
-<!-- fn and domainofapplication are rendered as their content -->
-<xsl:template match = "m:apply[m:*[1][self::m:fn]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select = "m:fn[1]" mode = "semantics"/>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:fn/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:fn/@id"/>
- </xsl:attribute>
- </xsl:if><xsl:text disable-output-escaping='yes'>⁡</xsl:text></m:mo>
- <m:mfenced separators=",">
- <xsl:apply-templates select = "*[position()>1]" mode = "semantics"/>
- </m:mfenced>
- </m:mrow>
-</xsl:template>
-
-<!-- fn has been deprecated, so now we use: -->
-<xsl:template match = "m:apply">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="*[2]=m:domainofapplication">
- <m:msub>
- <xsl:apply-templates select = "*[position()=1]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
- </xsl:apply-templates>
- <xsl:apply-templates select = "*[position()=2]" mode = "semantics"/>
- </m:msub>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:domainofapplication/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:domainofapplication/@id"/>
- </xsl:attribute>
- </xsl:if><xsl:text disable-output-escaping='yes'>⁡</xsl:text></m:mo>
- <m:mfenced separators=",">
- <xsl:apply-templates select = "*[position()>2]" mode = "semantics"/>
- </m:mfenced>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select = "*[position()=1]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
- </xsl:apply-templates>
- <m:mo><xsl:text disable-output-escaping='yes'>⁡</xsl:text></m:mo>
- <m:mfenced separators=",">
- <xsl:apply-templates select = "*[position()>1]" mode = "semantics"/>
- </m:mfenced>
- </xsl:otherwise>
- </xsl:choose>
- </m:mrow>
- </xsl:template>
-
- <xsl:template match = "m:domainofapplication">
- <xsl:apply-templates select = "*[1]" mode = "semantics"/>
- </xsl:template>
-
- <xsl:template match = "m:fn">
- <xsl:apply-templates select = "*[1]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
- </xsl:apply-templates>
- </xsl:template>
-
- <xsl:template match = "m:interval">
- <m:mfenced separators=",">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:if test="@closure='closed' or @closure='closed-open'">
- <xsl:attribute name="open">[</xsl:attribute>
- </xsl:if>
- <xsl:if test="@closure='closed' or @closure='open-closed'">
- <xsl:attribute name="close">]</xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="*" mode = "semantics"/>
- </m:mfenced>
- </xsl:template>
-
- <xsl:template match = "m:apply[m:*[1][self::m:apply[m:inverse[1]]]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select = "*[1]" mode = "semantics"/>
- <m:mo><xsl:text disable-output-escaping='yes'>⁡</xsl:text> </m:mo>
- <m:mfenced separators=",">
- <xsl:apply-templates select = "*[position()>1]" mode = "semantics"/>
- </m:mfenced>
- </m:mrow>
-</xsl:template>
-
-<xsl:template match = "m:apply[*[1][self::m:inverse]]">
- <xsl:choose>
- <xsl:when test="*[2]=m:exp or *[2]=m:ln or *[2]=m:sin or *[2]=m:cos or
- *[2]=m:tan or *[2]=m:sec or *[2]=m:csc or *[2]=m:cot or
- *[2]=m:sinh or *[2]=m:cosh or *[2]=m:tanh or *[2]=m:sech or
- *[2]=m:csch or *[2]=m:coth or *[2]=m:arcsin or
- *[2]=m:arccos or *[2]=m:arctan">
- <m:mo>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="*[2]" mode="inverse"/>
- </m:mo>
- </xsl:when>
- <xsl:otherwise>
- <m:msup>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select = "*[2]"/>
- <m:mfenced>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:inverse/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:inverse/@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mn>-1</m:mn>
- </m:mfenced>
- </m:msup>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match = "*" mode="inverse">
- <xsl:choose>
- <xsl:when test="self::m:exp">
- <xsl:value-of select="'ln'"/>
- </xsl:when>
- <xsl:when test="self::m:ln">
- <xsl:value-of select="'exp'"/>
- </xsl:when>
- <xsl:when test="self::m:sin">
- <xsl:value-of select="'arcsin'"/>
- </xsl:when>
- <xsl:when test="self::m:cos">
- <xsl:value-of select="'arccos'"/>
- </xsl:when>
- <xsl:when test="self::m:tan">
- <xsl:value-of select="'arctan'"/>
- </xsl:when>
- <xsl:when test="self::m:sec">
- <xsl:value-of select="'arcsec'"/>
- </xsl:when>
- <xsl:when test="self::m:csc">
- <xsl:value-of select="'arccsc'"/>
- </xsl:when>
- <xsl:when test="self::m:cot">
- <xsl:value-of select="'arccot'"/>
- </xsl:when>
- <xsl:when test="self::m:sinh">
- <xsl:value-of select="'arcsinh'"/>
- </xsl:when>
- <xsl:when test="self::m:cosh">
- <xsl:value-of select="'arccosh'"/>
- </xsl:when>
- <xsl:when test="self::m:tanh">
- <xsl:value-of select="'arctanh'"/>
- </xsl:when>
- <xsl:when test="self::m:sech">
- <xsl:value-of select="'arcsech'"/>
- </xsl:when>
- <xsl:when test="self::m:csch">
- <xsl:value-of select="'arccsch'"/>
- </xsl:when>
- <xsl:when test="self::m:coth">
- <xsl:value-of select="'arccoth'"/>
- </xsl:when>
- <xsl:when test="self::m:arcsin">
- <xsl:value-of select="'sin'"/>
- </xsl:when>
- <xsl:when test="self::m:arccos">
- <xsl:value-of select="'cos'"/>
- </xsl:when>
- <xsl:when test="self::m:arctan">
- <xsl:value-of select="'tan'"/>
- </xsl:when>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match = "m:sep"/>
-
-<xsl:template match = "m:condition">
- <xsl:choose>
- <xsl:when test="parent::m:apply[m:forall[1]]"/>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <m:mrow xref="{@id}">
- <xsl:apply-templates select="*" mode = "semantics"/>
- </m:mrow>
- </xsl:when>
- <xsl:otherwise>
- <xsl:if test="not(*[2])">
- <xsl:apply-templates select="*" mode = "semantics"/>
- </xsl:if>
- <xsl:if test="*[2]">
- <m:mrow>
- <xsl:apply-templates select="*" mode = "semantics"/>
- </m:mrow>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match = "m:declare"/>
-
-<xsl:template match = "m:lambda">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mo><xsl:text disable-output-escaping='yes'>Λ</xsl:text> </m:mo>
- <m:mo><xsl:text disable-output-escaping='yes'>⁡</xsl:text> </m:mo>
- <m:mfenced separators=",">
- <xsl:for-each select = "*">
- <xsl:choose>
- <xsl:when test="self::m:ci or self::m:cn">
- <xsl:apply-templates select = "." mode="semantics"/>
- </xsl:when>
- <xsl:otherwise>
- <m:mrow>
- <xsl:apply-templates select = "." mode="semantics"/>
- </m:mrow>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- </m:mfenced>
- </m:mrow>
-</xsl:template>
-
-<xsl:template match = "m:apply[*[1][self::m:apply[m:compose[1]]]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select = "*[1]" mode = "semantics"/>
- <m:mo><xsl:text disable-output-escaping='yes'>⁡</xsl:text></m:mo>
- <m:mfenced separators=",">
- <xsl:apply-templates select = "*[position()>1]" mode = "semantics"/>
- </m:mfenced>
- </m:mrow>
-</xsl:template>
-
-<xsl:template match = "m:apply[*[1][self::m:compose]]">
- <m:mfenced separators="">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select = "m:*[2][self::m:ci[@type='fn'] |
- self::m:fn]" mode="semantics"/>
- <xsl:for-each select = "m:*[position()>2][self::m:ci[@type='fn'] |
- self::m:fn]">
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and ../m:compose/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="../m:compose/@id"/>
- </xsl:attribute>
- </xsl:if><xsl:text disable-output-escaping='yes'>∘</xsl:text></m:mo>
- <xsl:apply-templates select = "." mode="semantics"/>
- </xsl:for-each>
- </m:mfenced>
-</xsl:template>
-
-<xsl:template match = "m:ident">
- <xsl:choose>
- <xsl:when test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <m:mo xref="{@id}">id</m:mo>
- </xsl:when>
- <xsl:otherwise>
- <m:mo>id</m:mo>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match="m:piecewise">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:element name="m:mfenced">
- <xsl:attribute name="open">{</xsl:attribute>
- <xsl:attribute name="close"></xsl:attribute>
- <m:mtable groupalign="left left left">
- <xsl:for-each select="m:piece">
- <m:mtr columnalign="left">
- <m:mtd>
- <m:mrow>
- <xsl:apply-templates select="*[position()=1]" mode = "semantics"/>
- </m:mrow>
- </m:mtd>
- <m:mtd>
- <m:mrow>
- <m:mtext>if <m:mspace width="5"/></m:mtext>
- <xsl:apply-templates select="*[position()=2]" mode = "semantics"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- </xsl:for-each>
- <xsl:if test="m:otherwise">
- <m:mtr columnalign="left">
- <m:mtd>
- <m:mrow>
- <xsl:apply-templates select="m:otherwise/*" mode = "semantics"/>
- </m:mrow>
- </m:mtd>
- <m:mtd>
- <m:mrow>
- otherwise
- </m:mrow>
- </m:mtd>
- </m:mtr>
- </xsl:if>
- </m:mtable>
-</xsl:element>
-</m:mrow>
-</xsl:template>
-
-<!-- HELM: was (it didn't match with prefixed MathML)
-<xsl:template match="m:apply[child::*[position()=1 and name()='domain']]">
- Now is: -->
-<xsl:template match="m:apply[child::*[position()=1 and self::m:domain]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mi>domain</m:mi>
- <m:mfenced open="(" close=")">
- <xsl:apply-templates select="*[position()!=1]" mode = "semantics"/>
- </m:mfenced>
- </m:mrow>
-</xsl:template>
-
-<!-- HELM: was (it didn't match with prefixed MathML)
-<xsl:template match="m:apply[child::*[position()=1 and name()='codomain']]">
- Now is: -->
-<xsl:template match="m:apply[child::*[position()=1 and self::m:codomain]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mi>codomain</m:mi>
- <m:mfenced open="(" close=")">
- <xsl:apply-templates select="*[position()!=1]" mode = "semantics"/>
- </m:mfenced>
- </m:mrow>
-</xsl:template>
-
-<!-- HELM: was (it didn't match with prefixed MathML)
-<xsl:template match="m:apply[child::*[position()=1 and name()='image']]">
- Now is: -->
-<xsl:template match="m:apply[child::*[position()=1 and self::m:image]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mi>image</m:mi>
- <m:mfenced open="(" close=")">
- <xsl:apply-templates select="*[position()!=1]" mode = "semantics"/>
- </m:mfenced>
- </m:mrow>
-</xsl:template>
-
-
-<!-- ***************** ARITHMETIC, ALGEBRA & LOGIC ***************** -->
-
-<xsl:template match = "m:apply[m:quotient[1]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mo form="prefix" fence="true" stretchy="true" lspace="0em" rspace="0em">
- <xsl:text disable-output-escaping='yes'>⌊</xsl:text>
- </m:mo>
- <m:mfrac>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:quotient/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:quotient/@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mrow>
- <xsl:apply-templates select="*[2]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
- </xsl:apply-templates>
- </m:mrow>
- <m:mrow>
- <xsl:apply-templates select="*[3]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- </m:mrow>
- </m:mfrac>
- <m:mo form="postfix" fence="true" stretchy="true" lspace="0em" rspace="0em">
- <xsl:text disable-output-escaping='yes'>⌊</xsl:text>
- </m:mo>
- </m:mrow>
-</xsl:template>
-
-<xsl:template match = "m:apply[*[1][self::m:exp]]">
- <m:msup>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:exp/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:exp/@id"/>
- </xsl:attribute>
- </xsl:if>e</m:mo>
- <xsl:apply-templates select = "*[2]" mode = "semantics"/>
- </m:msup>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:factorial[1]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select = "*[2]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:factorial/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:factorial/@id"/>
- </xsl:attribute>
- </xsl:if>!</m:mo>
- </m:mrow>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:max[1] | m:min[1]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:if test="*[2]=m:bvar">
- <m:munder>
- <xsl:if test="*[1]=m:max">
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:max/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:max/@id"/>
- </xsl:attribute>
- </xsl:if>max</m:mo>
- </xsl:if>
- <xsl:if test="*[1]=m:min">
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:min/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:min/@id"/>
- </xsl:attribute>
- </xsl:if>min</m:mo>
- </xsl:if>
- <xsl:apply-templates select="*[2]" mode = "semantics"/>
- </m:munder>
- <xsl:if test="*[3]=m:condition">
- <m:mfenced open="{{" close="}}" separators="">
- <m:mfenced open="" close="" separators=",">
- <xsl:for-each select = "*[position()>3]">
- <xsl:apply-templates select = "." mode="semantics"/>
- </xsl:for-each>
- </m:mfenced>
- <m:mo>|</m:mo>
- <xsl:apply-templates select="*[3]" mode = "semantics"/>
- </m:mfenced>
- </xsl:if>
- <xsl:if test="not(*[3]=m:condition)">
- <m:mfenced open="{{" close="}}" separators=",">
- <xsl:for-each select = "*[position()>2]">
- <xsl:apply-templates select = "." mode="semantics"/>
- </xsl:for-each>
- </m:mfenced>
- </xsl:if>
- </xsl:if>
- <xsl:if test="*[2]=m:condition">
- <xsl:if test="*[1]=m:max">
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:max/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:max/@id"/>
- </xsl:attribute>
- </xsl:if>max</m:mo>
- </xsl:if>
- <xsl:if test="*[1]=m:min">
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:min/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:min/@id"/>
- </xsl:attribute>
- </xsl:if>min</m:mo>
- </xsl:if>
- <m:mfenced open="{{" close="}}" separators="">
- <xsl:if test="*[3]">
- <m:mfenced open="" close="" separators=",">
- <xsl:for-each select = "*[position()>2]">
- <xsl:apply-templates select = "." mode="semantics"/>
- </xsl:for-each>
- </m:mfenced>
- <m:mo>|</m:mo>
- </xsl:if>
- <xsl:apply-templates select="*[2]" mode = "semantics"/>
- </m:mfenced>
- </xsl:if>
- <xsl:if test="not(*[2]=m:condition) and not(*[2]=m:bvar)">
- <xsl:if test="*[1]=m:max">
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:max/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:max/@id"/>
- </xsl:attribute>
- </xsl:if>max</m:mo>
- </xsl:if>
- <xsl:if test="*[1]=m:min">
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:min/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:min/@id"/>
- </xsl:attribute>
- </xsl:if>min</m:mo>
- </xsl:if>
- <m:mfenced open="{{" close="}}" separators=",">
- <xsl:for-each select = "*[position()>1]">
- <xsl:apply-templates select = "." mode="semantics"/>
- </xsl:for-each>
- </m:mfenced>
- </xsl:if>
- </m:mrow>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:minus[1]]">
- <xsl:param name="IN_PREC" select="$NO_PREC"/>
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:choose>
- <xsl:when test="$IN_PREC > $MINUS_PREC or $IN_PREC=$MINUS_PREC and
- $PARAM=$PAR_SAME">
- <m:mfenced separators="">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="minus">
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAR_YES"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </m:mfenced>
- </xsl:when>
- <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $FUNCTION_PREC
- and not($SEM_SW=$SEM_ALL) and not($SEM_SW=$SEM_XREF)
- and not($SEM_SW=$SEM_XREF_EXT)">
- <xsl:apply-templates select="." mode="minus">
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="minus">
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </m:mrow>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:minus[1]]" mode="minus">
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:if test="not(*[3])">
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:minus/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:minus/@id"/>
- </xsl:attribute>
- </xsl:if>-</m:mo>
- <xsl:apply-templates select="*[2]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$NEG_PREC"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- </xsl:if>
- <xsl:if test="*[3]">
- <xsl:apply-templates select="*[2]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$MINUS_PREC"/>
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:minus/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:minus/@id"/>
- </xsl:attribute>
- </xsl:if>-</m:mo>
- <xsl:apply-templates select="*[3]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$MINUS_PREC"/>
- <xsl:with-param name="PARAM" select="$PAR_SAME"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- </xsl:if>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:plus[1]]">
- <xsl:param name="IN_PREC" select="$NO_PREC"/>
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:choose>
- <xsl:when test="$IN_PREC > $PLUS_PREC or $IN_PREC=$PLUS_PREC and
- $PARAM=$PAR_SAME">
- <m:mfenced separators="">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="plus">
- <xsl:with-param name="PARAM" select="$IN_PREC"/>
- <xsl:with-param name="PAREN" select="$PAR_YES"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </m:mfenced>
- </xsl:when>
- <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $FUNCTION_PREC
- and not($SEM_SW=$SEM_ALL) and not($SEM_SW=$SEM_XREF)
- and not($SEM_SW=$SEM_XREF_EXT)">
- <xsl:apply-templates select="." mode="plus">
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="plus">
- <xsl:with-param name="PARAM" select="$IN_PREC"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </m:mrow>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:plus[1]]" mode="plus">
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:if test="*[2]">
- <xsl:apply-templates select="*[2]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$PLUS_PREC"/>
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- <xsl:for-each select = "*[position()>2]">
- <xsl:choose>
- <xsl:when test=". < 0">
- <m:mo>-</m:mo>
- <m:mn> <xsl:value-of select="-."/> </m:mn>
- </xsl:when>
- <xsl:when test="self::m:apply[m:minus[1]] and not(*[3])">
- <xsl:apply-templates select="." mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$PLUS_PREC"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and ../m:plus/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="../m:plus/@id"/>
- </xsl:attribute>
- </xsl:if>+</m:mo>
- <xsl:apply-templates select="." mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$PLUS_PREC"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- </xsl:if>
-</xsl:template>
-
-<!-- HELM WARNING: power id is lost! -->
-<!-- msup should maintain the power definitionURL info but also the
- reference to apply -->
-<xsl:template match = "m:apply[m:power[1]]">
- <xsl:choose>
- <xsl:when test="*[2]=m:apply[m:ln[1] | m:log[1] | m:abs[1] |
- m:gcd[1] | m:lcm[1] | m:sin[1] | m:cos[1] | m:tan[1] |
- m:sec[1] | m:csc[1] | m:cot[1] | m:sinh[1] |
- m:cosh[1] | m:tanh[1] | m:sech[1] | m:csch[1] |
- m:coth[1] | m:arcsin[1] | m:arccos[1] |
- m:arctan[1] | m:arcsec[1] | m:arccsc[1] |
- m:arccot[1] | m:arcsinh[1] | m:arccosh[1] |
- m:arctanh[1] | m:arcsech[1] | m:arccsch [1]|
- m:arccoth[1] ]">
- <xsl:apply-templates select="*[2]" mode = "semantics"/>
- </xsl:when>
- <xsl:otherwise>
- <m:msup>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select = "*[2]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- <xsl:apply-templates select = "*[3]" mode = "semantics"/>
- </m:msup>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:rem[1] | m:divide[1]]">
- <xsl:param name="IN_PREC" select="$NO_PREC"/>
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:choose>
- <xsl:when test="$IN_PREC > $DIV_PREC or $IN_PREC=$DIV_PREC and
- $PARAM=$PAR_SAME">
- <m:mfenced separators="">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="remdiv">
- <xsl:with-param name="PARAM" select="$IN_PREC"/>
- <xsl:with-param name="PAREN" select="$PAR_YES"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </m:mfenced>
- </xsl:when>
- <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $FUNCTION_PREC
- and not($SEM_SW=$SEM_ALL) and not($SEM_SW=$SEM_XREF)
- and not($SEM_SW=$SEM_XREF_EXT)">
- <xsl:apply-templates select="." mode="remdiv">
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="remdiv">
- <xsl:with-param name="PARAM" select="$IN_PREC"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </m:mrow>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:rem[1] | m:divide[1]]" mode="remdiv">
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:apply-templates select = "*[2]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$DIV_PREC"/>
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- <m:mo>
- <xsl:if test="m:rem">
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:rem/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:rem/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:value-of select="'%'"/>
- </xsl:if>
- <xsl:if test="m:divide">
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:divide/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:divide/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:value-of select="'/'"/>
- </xsl:if>
- </m:mo>
- <xsl:apply-templates select = "*[3]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$DIV_PREC"/>
- <xsl:with-param name="PARAM" select="$PAR_SAME"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:times[1]]">
- <xsl:param name="IN_PREC" select="$NO_PREC"/>
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:choose>
- <xsl:when test="$IN_PREC > $MUL_PREC or $IN_PREC=$MUL_PREC and
- $PARAM=$PAR_SAME">
- <m:mfenced separators="">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="times">
- <xsl:with-param name="PARAM" select="$IN_PREC"/>
- <xsl:with-param name="PAREN" select="$PAR_YES"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </m:mfenced>
- </xsl:when>
- <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $FUNCTION_PREC
- and not($SEM_SW=$SEM_ALL) and not($SEM_SW=$SEM_XREF)
- and not($SEM_SW=$SEM_XREF_EXT)">
- <xsl:apply-templates select="." mode="times">
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="times">
- <xsl:with-param name="PARAM" select="$IN_PREC"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </m:mrow>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:times[1]]" mode="times">
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:apply-templates select="*[2]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$MUL_PREC"/>
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- <xsl:if test="*[3]">
- <xsl:for-each select = "*[position()>2]">
-<!-- HELM: to distinguish between * and the application -->
-<!-- Was:
- <m:mo><xsl:text disable-output-escaping='yes'>⁢</xsl:text></m:mo>
- Now is: -->
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and ../m:times/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="../m:times/@id"/>
- </xsl:attribute>
- </xsl:if>*</m:mo>
- <xsl:apply-templates select="." mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$MUL_PREC"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- </xsl:for-each>
- </xsl:if>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:root[1]]">
- <m:msqrt>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:if test="*[2]=m:degree">
- <xsl:apply-templates select="*[3]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- <xsl:apply-templates select="*[2]" mode = "semantics"/>
- </xsl:if>
- <xsl:if test="not(*[2]=m:degree)">
- <xsl:apply-templates select="*[2]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- <m:mn>2</m:mn>
- </xsl:if>
- </m:msqrt>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:gcd[1]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:if test="not(parent::m:apply[m:power[1]])">
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:gcd/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:gcd/@id"/>
- </xsl:attribute>
- </xsl:if>gcd</m:mo>
- </xsl:if>
- <xsl:if test="parent::m:apply[m:power[1]]">
- <m:msup>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:gcd/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:gcd/@id"/>
- </xsl:attribute>
- </xsl:if>gcd</m:mo>
- <xsl:apply-templates select = "../*[3]" mode = "semantics"/>
- </m:msup>
- </xsl:if>
- <m:mfenced separators=",">
- <xsl:for-each select = "*[position()>1]">
- <xsl:apply-templates select = "." mode="semantics"/>
- </xsl:for-each>
- </m:mfenced>
- </m:mrow>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:and[1]]">
- <xsl:param name="IN_PREC" select="$NO_PREC"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:choose>
- <xsl:when test="$IN_PREC > $AND_PREC">
- <m:mfenced separators="">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="and">
- <xsl:with-param name="PARAM" select="$IN_PREC"/>
- <xsl:with-param name="PAREN" select="$PAR_YES"/>
- </xsl:apply-templates>
- </m:mfenced>
- </xsl:when>
- <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $FUNCTION_PREC
- and not($SEM_SW=$SEM_ALL) and not($SEM_SW=$SEM_XREF)
- and not($SEM_SW=$SEM_XREF_EXT)">
- <xsl:apply-templates select="." mode="and">
- <xsl:with-param name="PARAM" select="$IN_PREC"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="and">
- <xsl:with-param name="PARAM" select="$IN_PREC"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </m:mrow>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:and[1]]" mode="and">
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:apply-templates select="*[2]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$AND_PREC"/>
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- <xsl:for-each select = "*[position()>2]">
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and ../m:and/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="../m:and/@id"/>
- </xsl:attribute>
- </xsl:if><xsl:text disable-output-escaping='yes'>∧</xsl:text></m:mo>
- <xsl:apply-templates select="." mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$AND_PREC"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- </xsl:for-each>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:or[1]]">
- <xsl:param name="IN_PREC" select="$NO_PREC"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:choose>
- <xsl:when test="$IN_PREC > $OR_PREC">
- <m:mfenced separators="">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="or">
- <xsl:with-param name="PARAM" select="$IN_PREC"/>
- <xsl:with-param name="PAREN" select="$PAR_YES"/>
- </xsl:apply-templates>
- </m:mfenced>
- </xsl:when>
- <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $FUNCTION_PREC
- and not($SEM_SW=$SEM_ALL) and not($SEM_SW=$SEM_XREF)
- and not($SEM_SW=$SEM_XREF_EXT)">
- <xsl:apply-templates select="." mode="or">
- <xsl:with-param name="PARAM" select="$IN_PREC"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="or">
- <xsl:with-param name="PARAM" select="$IN_PREC"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </m:mrow>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:or[1]]" mode="or">
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:apply-templates select="*[2]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$OR_PREC"/>
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- <xsl:for-each select = "*[position()>2]">
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and ../m:or/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="../m:or/@id"/>
- </xsl:attribute>
- </xsl:if><xsl:text disable-output-escaping='yes'>∨</xsl:text></m:mo>
- <xsl:apply-templates select="." mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$OR_PREC"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- </xsl:for-each>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:xor[1]]">
- <xsl:param name="IN_PREC" select="$NO_PREC"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:choose>
- <xsl:when test="$IN_PREC > $XOR_PREC">
- <m:mfenced separators="">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="xor">
- <xsl:with-param name="PARAM" select="$IN_PREC"/>
- <xsl:with-param name="PAREN" select="$PAR_YES"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </m:mfenced>
- </xsl:when>
- <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $FUNCTION_PREC
- and not($SEM_SW=$SEM_ALL)">
- <xsl:apply-templates select="." mode="xor">
- <xsl:with-param name="PARAM" select="$IN_PREC"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="xor">
- <xsl:with-param name="PARAM" select="$IN_PREC"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </m:mrow>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:xor[1]]" mode="xor">
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:apply-templates select="*[2]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$XOR_PREC"/>
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- <xsl:for-each select = "*[position()>2]">
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and ../m:xor/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="../m:xor/@id"/>
- </xsl:attribute>
- </xsl:if><xsl:text disable-output-escaping='yes'>⊻</xsl:text></m:mo>
- <xsl:apply-templates select="." mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$XOR_PREC"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- </xsl:for-each>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:not[1]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
-<!-- HELM: was <m:mo>not</m:mo>
- Now is -->
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:not/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:not/@id"/>
- </xsl:attribute>
- </xsl:if>¬</m:mo>
- <xsl:apply-templates select = "*[2]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
- </xsl:apply-templates>
- </m:mrow>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:forall[1]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:forall/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:forall/@id"/>
- </xsl:attribute>
- </xsl:if>for all</m:mo>
- <xsl:if test="count(m:bvar) > 1">
- <m:mfenced separators=",">
- <xsl:for-each select = "m:bvar">
- <xsl:apply-templates select = "." mode="semantics"/>
- </xsl:for-each>
- </m:mfenced>
- </xsl:if>
- <xsl:if test="count(m:bvar)=1">
- <xsl:apply-templates select = "m:bvar" mode="semantics"/>
- </xsl:if>
- <xsl:if test="m:condition">
- <m:mo>:</m:mo>
- <xsl:apply-templates select = "m:condition/*" mode = "semantics"/>
- <m:mo>,</m:mo>
- </xsl:if>
- <xsl:apply-templates select = "*[position()>1 and not(self::m:bvar) and
- not(self::m:condition)]" mode = "semantics"/>
- </m:mrow>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:exists[1]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:exists/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:exists/@id"/>
- </xsl:attribute>
- </xsl:if><xsl:text disable-output-escaping='yes'>∃</xsl:text> </m:mo>
- <xsl:if test="count(m:bvar) > 1">
- <m:mfenced separators=",">
- <xsl:for-each select = "m:bvar">
- <xsl:apply-templates select = "." mode="semantics"/>
- </xsl:for-each>
- </m:mfenced>
- </xsl:if>
- <xsl:if test="count(m:bvar)=1">
- <xsl:apply-templates select = "m:bvar" mode="semantics"/>
- </xsl:if>
- <xsl:if test="m:condition">
- <m:mo>,</m:mo>
- <xsl:apply-templates select = "m:condition/*" mode = "semantics"/>
- </xsl:if>
- <xsl:if test="*[position()>1 and not(self::m:bvar) and not(self::m:condition)]">
- <m:mo>:</m:mo>
- <xsl:apply-templates select = "*[position()>1 and not(self::m:bvar) and
- not(self::m:condition)]" mode = "semantics"/>
- </xsl:if>
- </m:mrow>
-</xsl:template>
-
-<!-- HELM WARNING: abs id was lost! -->
-<xsl:template match = "m:apply[m:abs[1]]">
- <xsl:if test="not(parent::m:apply[m:power[1]])">
-<!-- HELM: was
- <m:mfenced open="|" close="|" separators="">
- Now is: mrow + mo -->
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:abs/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:abs/@id"/>
- </xsl:attribute>
- </xsl:if>|</m:mo>
- <xsl:apply-templates select = "*[position()>1]" mode = "semantics"/>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:abs/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:abs/@id"/>
- </xsl:attribute>
- </xsl:if>|</m:mo>
-<!-- HELM: </m:mfenced> -->
- </m:mrow>
- </xsl:if>
- <xsl:if test="parent::m:apply[m:power[1]]">
- <m:msup>
-<!-- HELM: was
- <m:mfenced open="|" close="|" separators="">
- Now is: mrow + mo -->
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:abs/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:abs/@id"/>
- </xsl:attribute>
- </xsl:if>|</m:mo>
- <xsl:apply-templates select = "*[position()>1]" mode = "semantics"/>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:abs/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:abs/@id"/>
- </xsl:attribute>
- </xsl:if>|</m:mo>
-<!-- HELM: </m:mfenced> -->
- </m:mrow>
- <xsl:apply-templates select = "../*[3]" mode = "semantics"/>
- </m:msup>
- </xsl:if>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:conjugate[1]]">
- <m:mover>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mrow>
- <xsl:apply-templates select = "*[position()>1]" mode = "semantics"/>
- </m:mrow>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:conjugate/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:conjugate/@id"/>
- </xsl:attribute>
- </xsl:if><xsl:text disable-output-escaping='yes'>̲</xsl:text> </m:mo>
- </m:mover>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:arg[1] | m:real[1] | m:imaginary[1]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mo>
- <xsl:if test="m:arg">
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:arg/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:arg/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:value-of select="'Arg'"/>
- </xsl:if>
- <xsl:if test="m:real">
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:real/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:real/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:value-of select="'Re'"/>
- </xsl:if>
- <xsl:if test="m:imaginary">
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:imaginary/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:imaginary/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:value-of select="'Im'"/>
- </xsl:if>
- </m:mo>
- <m:mfenced separators="">
- <xsl:apply-templates select = "*[2]" mode = "semantics"/>
- </m:mfenced>
- </m:mrow>
-</xsl:template>
-
-<!-- HELM: was (it didn't match with prefixed MathML)
-<xsl:template match="m:apply[child::*[position()=1 and name()='lcm']]">
- Now is: -->
-<xsl:template match="m:apply[child::*[position()=1 and self::m:lcm]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:if test="not(parent::m:apply[m:power[1]])">
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:lcm/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:lcm/@id"/>
- </xsl:attribute>
- </xsl:if>lcm</m:mo>
- </xsl:if>
- <xsl:if test="parent::m:apply[m:power[1]]">
- <m:msup>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:lcm/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:lcm/@id"/>
- </xsl:attribute>
- </xsl:if>lcm</m:mo>
- <xsl:apply-templates select = "../*[3]" mode = "semantics"/>
- </m:msup>
- </xsl:if>
- <m:mfenced separators=",">
- <xsl:for-each select = "*[position()>1]">
- <xsl:apply-templates select = "." mode="semantics"/>
- </xsl:for-each>
- </m:mfenced>
- </m:mrow>
- </xsl:template>
-
-<!-- HELM: was (it didn't match with prefixed MathML)
-<xsl:template match="m:apply[child::*[position()=1 and name()='floor']]">
- Now is: -->
-<xsl:template match="m:apply[child::*[position()=1 and self::m:floor]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:floor/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:floor/@id"/>
- </xsl:attribute>
- </xsl:if>
-<!-- HELM: not rendered correctly <![CDATA[⌊]]> -->
- <xsl:text disable-output-escaping="yes">⌊</xsl:text>
- </m:mo>
- <xsl:apply-templates select="child::*[position()=last()]" mode="semantics"/>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:floor/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:floor/@id"/>
- </xsl:attribute>
- </xsl:if>
-<!-- HELM: not rendered correctly <![CDATA[⌋]]> -->
-<xsl:text disable-output-escaping="yes">⌋</xsl:text>
- </m:mo>
-</m:mrow>
-</xsl:template>
-
-<!-- HELM: was (it didn't match with prefixed MathML)
-<xsl:template match="m:apply[child::*[position()=1 and name()='ceiling']]">
- Now is: -->
-<xsl:template match="m:apply[child::*[position()=1 and self::m:ceiling]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:ceiling/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:ceiling/@id"/>
- </xsl:attribute>
- </xsl:if>
-<!-- HELM: not rendered correctly <![CDATA[⌈]]> -->
- <xsl:text disable-output-escaping="yes">⌈</xsl:text>
- </m:mo>
- <xsl:apply-templates select="child::*[position()=last()]" mode="semantics"/>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:ceiling/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:ceiling/@id"/>
- </xsl:attribute>
- </xsl:if>
-<!-- HELM: not rendered correctly <![CDATA[⌉]]> -->
- <xsl:text disable-output-escaping="yes">⌉</xsl:text>
- </m:mo>
- </m:mrow>
-</xsl:template>
-
-
-<!-- ***************** RELATIONS ***************** -->
-
-<xsl:template match = "m:apply[m:neq | m:approx | m:tendsto | m:implies
- | m:in | m:notin | m:notsubset | m:notprsubset
- | m:subset | m:prsubset | m:eq | m:gt | m:lt
- | m:geq | m:leq | m:equivalent | m:factorof]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:if test="*[1]=m:neq or *[1]=m:approx or *[1]=m:factorof or *[1]=m:tendsto or
- *[1]=m:implies or *[1]=m:in or *[1]=m:notin or
- *[1]=m:notsubset or *[1]=m:notprsubset">
- <xsl:apply-templates select = "*[2]" mode = "semantics"/>
- <m:mo>
- <xsl:if test="*[1]=m:neq">
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:neq/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:neq/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:text disable-output-escaping='yes'>≠</xsl:text>
- </xsl:if>
- <xsl:if test="*[1]=m:approx">
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:approx/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:approx/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:text disable-output-escaping='yes'>≊</xsl:text>
- </xsl:if>
- <xsl:if test="*[1]=m:factorof">
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:factorof/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:factorof/@id"/>
- </xsl:attribute>
- </xsl:if>
- |
- </xsl:if>
- <xsl:if test="*[1]=m:tendsto">
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:tendsto/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:tendsto/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:text disable-output-escaping='yes'>→</xsl:text>
- </xsl:if>
- <xsl:if test="*[1]=m:implies">
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:implies/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:implies/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:text disable-output-escaping='yes'>⇒</xsl:text>
- </xsl:if>
- <xsl:if test="*[1]=m:in">
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:in/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:in/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:text disable-output-escaping='yes'>∈</xsl:text>
- </xsl:if>
- <xsl:if test="*[1]=m:notin">
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:notin/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:notin/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:text disable-output-escaping='yes'>∉</xsl:text>
- </xsl:if>
- <xsl:if test="*[1]=m:notsubset">
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:notsubset/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:notsubset/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:text disable-output-escaping='yes'>⊄</xsl:text>
- </xsl:if>
- <xsl:if test="*[1]=m:notprsubset">
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:notprsubset/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:notprsubset/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:text disable-output-escaping='yes'>⊈</xsl:text>
- </xsl:if>
- </m:mo>
- <xsl:apply-templates select = "*[3]" mode = "semantics"/>
- <xsl:if test="*[1]=m:tendsto and m:tendsto[1][@type='below']">
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:tendsto/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:tendsto/@id"/>
- </xsl:attribute>
- </xsl:if>-</m:mo>
- </xsl:if>
- <xsl:if test="*[1]=m:tendsto and m:tendsto[1][@type='above']">
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:tendsto/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:tendsto/@id"/>
- </xsl:attribute>
- </xsl:if>+</m:mo>
- </xsl:if>
- </xsl:if>
- <xsl:if test="*[1]=m:subset or *[1]=m:prsubset or *[1]=m:eq or *[1]=m:gt
- or *[1]=m:lt or *[1]=m:geq or *[1]=m:leq or *[1]=m:equivalent">
- <xsl:apply-templates select = "*[2]" mode="semantics"/>
- <xsl:for-each select = "*[position()>2]">
- <m:mo>
- <xsl:if test="../*[self::m:subset][1]">
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and ../m:subset/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="../m:subset/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:text disable-output-escaping='yes'>⊆</xsl:text>
- </xsl:if>
- <xsl:if test="../*[self::m:prsubset][1]">
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and ../m:prsubset/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="../m:prsubset/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:text disable-output-escaping='yes'>⊂</xsl:text>
- </xsl:if>
- <xsl:if test="../*[self::m:eq][1]">
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and ../m:eq/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="../m:eq/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:value-of select="'='"/>
- </xsl:if>
- <xsl:if test="../*[self::m:gt][1]">
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and ../m:gt/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="../m:gt/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:value-of select="'>'"/>
- </xsl:if>
- <xsl:if test="../*[self::m:lt][1]">
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and ../m:lt/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="../m:lt/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:value-of select="'<'"/>
- </xsl:if>
- <xsl:if test="../*[self::m:geq][1]">
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and ../m:geq/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="../m:geq/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:text disable-output-escaping='yes'>≥</xsl:text>
- </xsl:if>
- <xsl:if test="../*[self::m:leq][1]">
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and ../m:leq/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="../m:leq/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:text disable-output-escaping='yes'>≤</xsl:text>
- </xsl:if>
- <xsl:if test="../*[self::m:equivalent][1]">
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and ../m:equivalent/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="../m:equivalent/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:text disable-output-escaping='yes'>≡</xsl:text>
- </xsl:if>
- </m:mo>
- <xsl:apply-templates select = "." mode="semantics"/>
- </xsl:for-each>
- </xsl:if>
- </m:mrow>
-</xsl:template>
-
-
-<!-- ***************** CALCULUS ***************** -->
-
-<xsl:template match = "m:apply[*[1][self::m:ln]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="parent::m:apply[m:power[1]]">
- <m:msup>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:ln/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:ln/@id"/>
- </xsl:attribute>
- </xsl:if>ln</m:mo>
- <xsl:apply-templates select = "../*[3]" mode = "semantics"/>
- </m:msup>
- </xsl:when>
- <xsl:otherwise>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:ln/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:ln/@id"/>
- </xsl:attribute>
- </xsl:if>ln</m:mo>
- </xsl:otherwise>
- </xsl:choose>
- <m:mo><xsl:text disable-output-escaping='yes'>⁡</xsl:text></m:mo>
- <xsl:apply-templates select = "*[2]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
- </xsl:apply-templates>
- </m:mrow>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:log[1]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="parent::m:apply[m:power[1]]">
- <xsl:if test="not(*[2]=m:logbase)">
- <m:msup>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:log/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:log/@id"/>
- </xsl:attribute>
- </xsl:if>log</m:mo>
- <xsl:apply-templates select = "../*[3]" mode = "semantics"/>
- </m:msup>
- </xsl:if>
- <xsl:if test="*[2]=m:logbase">
- <m:msubsup>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:log/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:log/@id"/>
- </xsl:attribute>
- </xsl:if>log</m:mo>
- <xsl:apply-templates select = "../*[3]" mode = "semantics"/>
- <xsl:apply-templates select = "m:logbase" mode = "semantics"/>
- </m:msubsup>
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- <xsl:if test="not(*[2]=m:logbase)">
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:log/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:log/@id"/>
- </xsl:attribute>
- </xsl:if>log</m:mo>
- </xsl:if>
- <xsl:if test="*[2]=m:logbase">
- <m:msub>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:log/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:log/@id"/>
- </xsl:attribute>
- </xsl:if>log</m:mo>
- <xsl:apply-templates select = "m:logbase" mode = "semantics"/>
- </m:msub>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- <m:mo><xsl:text disable-output-escaping='yes'>⁡</xsl:text></m:mo>
- <xsl:if test="*[2]=m:logbase">
- <xsl:apply-templates select = "*[3]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
- </xsl:apply-templates>
- </xsl:if>
- <xsl:if test="not(*[2]=m:logbase)">
- <xsl:apply-templates select = "*[2]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
- </xsl:apply-templates>
- </xsl:if>
- </m:mrow>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:diff[1]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:if test="*[2]=m:bvar and m:bvar[*[2]=m:degree]">
- <m:mfrac>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:diff/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:diff/@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:msup>
- <m:mo>d</m:mo>
- <xsl:apply-templates select = "m:bvar/m:degree" mode = "semantics"/>
- </m:msup>
- <m:mrow>
- <m:mo>d</m:mo>
- <m:msup>
- <xsl:apply-templates select = "m:bvar/*[1]" mode = "semantics"/>
- <xsl:apply-templates select = "m:bvar/m:degree" mode = "semantics"/>
- </m:msup>
- </m:mrow>
- </m:mfrac>
- </xsl:if>
- <xsl:if test="*[2]=m:bvar and not(m:bvar[*[2]=m:degree])">
- <m:mfrac>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:diff/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:diff/@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mo>d</m:mo>
- <m:mrow>
- <m:mo>d</m:mo>
- <xsl:apply-templates select = "m:bvar/*[1]" mode = "semantics"/>
- </m:mrow>
- </m:mfrac>
- </xsl:if>
- <xsl:apply-templates select = "*[3]" mode = "semantics"/>
- </m:mrow>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:partialdiff[1]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:for-each select = "m:bvar">
- <xsl:if test="*[last()]=m:degree">
- <m:mfrac>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and ../m:partialdiff/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="../m:partialdiff/@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:msup>
- <m:mo>d</m:mo>
- <xsl:apply-templates select = "m:degree" mode = "semantics"/>
- </m:msup>
- <m:mrow>
- <m:mo>d</m:mo>
- <m:msup>
- <xsl:apply-templates select = "*[1]" mode = "semantics"/>
- <xsl:apply-templates select = "m:degree" mode = "semantics"/>
- </m:msup>
- </m:mrow>
- </m:mfrac>
- </xsl:if>
- <xsl:if test="not(*[last()]=m:degree)">
- <m:mfrac>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and ../m:partialdiff/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="../m:partialdiff/@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mo>d</m:mo>
- <m:mrow>
- <m:mo>d</m:mo>
- <xsl:apply-templates select = "*[1]" mode = "semantics"/>
- </m:mrow>
- </m:mfrac>
- </xsl:if>
- </xsl:for-each>
- <xsl:apply-templates select = "*[last()]" mode = "semantics"/>
- </m:mrow>
-</xsl:template>
-
-<xsl:template match = "m:lowlimit | m:uplimit | m:bvar | m:degree | m:logbase">
- <xsl:apply-templates select="*" mode = "semantics"/>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:divergence[1] | m:grad[1] | m:curl[1]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mo>
- <xsl:if test="*[1]=m:divergence">
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:divergence/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:divergence/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:value-of select="'div'"/>
- </xsl:if>
- <xsl:if test="*[1]=m:grad">
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:grad/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:grad/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:value-of select="'grad'"/>
- </xsl:if>
- <xsl:if test="*[1]=m:curl">
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:curl/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:curl/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:value-of select="'curl'"/>
- </xsl:if>
- </m:mo>
- <xsl:choose>
- <xsl:when test="*[2]=m:ci">
- <xsl:apply-templates select = "*[2]" mode = "semantics"/>
- </xsl:when>
- <xsl:otherwise>
- <m:mfenced separators="">
- <xsl:apply-templates select = "*[2]" mode = "semantics"/>
- </m:mfenced>
- </xsl:otherwise>
- </xsl:choose>
- </m:mrow>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:laplacian[1]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:msup>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:laplacian/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:laplacian/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:text disable-output-escaping='yes'>Δ</xsl:text></m:mo>
- <m:mn>2</m:mn>
- </m:msup>
- <xsl:apply-templates select = "*[2]" mode = "semantics"/>
- </m:mrow>
-</xsl:template>
-
-
-<!-- ***************** SET THEORY ***************** -->
-
-<xsl:template match = "m:set | m:list">
- <m:mfenced open="{{" close="}}" separators="">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:if test="*[1]=m:bvar and *[2]=m:condition">
- <xsl:apply-templates select="m:bvar" mode = "semantics"/>
- <m:mo>|</m:mo>
- <xsl:apply-templates select="m:condition" mode = "semantics"/>
- </xsl:if>
- <xsl:if test="*[1]=m:condition and not(child::m:bvar)">
- <m:mfenced open="" close="" separators=",">
- <xsl:for-each select = "*[not(self::m:condition) and not(self::m:bvar)]">
- <xsl:apply-templates select = "." mode="semantics"/>
- </xsl:for-each>
- </m:mfenced>
- <m:mo>|</m:mo>
- <xsl:apply-templates select="m:condition" mode = "semantics"/>
- </xsl:if>
- <xsl:if test="not(child::m:bvar) and not(child::m:condition)">
- <m:mfenced open="" close="" separators=",">
- <xsl:for-each select = "*">
- <xsl:apply-templates select = "." mode="semantics"/>
- </xsl:for-each>
- </m:mfenced>
- </xsl:if>
- </m:mfenced>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:union[1]]">
- <xsl:param name="IN_OP" select="$DOESNT_MATTER"/>
- <xsl:param name="IN_PREC" select="$NO_PREC"/>
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:choose>
- <xsl:when test="$IN_PREC > $UNION_PREC or $IN_PREC=$UNION_PREC
- and $PARAM=$PAR_SAME and not($IN_OP=$UNION_OP)">
- <m:mfenced separators="">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="union">
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </m:mfenced>
- </xsl:when>
- <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $FUNCTION_PREC
- and not($SEM_SW=$SEM_ALL) and not($SEM_SW=$SEM_XREF)
- and not($SEM_SW=$SEM_XREF_EXT)">
- <xsl:apply-templates select="." mode="union">
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="union">
- <xsl:with-param name="IN_OP" select="$UNION_OP"/>
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </m:mrow>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:union[1]]" mode="union">
- <xsl:param name="IN_OP" select="$DOESNT_MATTER"/>
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:apply-templates select = "*[2]" mode="semantics">
- <xsl:with-param name="IN_PREC" select="$UNION_PREC"/>
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- <xsl:for-each select = "*[position()>2]">
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and ../m:union/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="../m:union/@id"/>
- </xsl:attribute>
- </xsl:if>⋃</m:mo>
-<!-- HELM: not rendered correctly <![CDATA[⋃]]> -->
- <!-- <xsl:text disable-output-escaping="yes">⋃</xsl:text></m:mo>-->
- <xsl:apply-templates select = "." mode="semantics">
- <xsl:with-param name="PARAM" select="$PAR_SAME"/> <!--new-->
- <xsl:with-param name="IN_PREC" select="$UNION_PREC"/>
- <xsl:with-param name="IN_OP" select="$UNION_OP"/> <!--new-->
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- </xsl:for-each>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:intersect[1]]">
- <xsl:param name="IN_OP" select="$DOESNT_MATTER"/>
- <xsl:param name="IN_PREC" select="$NO_PREC"/>
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:choose>
- <xsl:when test="$IN_PREC > $INTERSECT_PREC or $IN_PREC=$INTERSECT_PREC
- and $PARAM=$PAR_SAME and not($IN_OP=$INTERSECT_OP)">
- <m:mfenced separators="">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="intersect">
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </m:mfenced>
- </xsl:when>
- <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $FUNCTION_PREC
- and not($SEM_SW=$SEM_ALL) and not($SEM_SW=$SEM_XREF)
- and not($SEM_SW=$SEM_XREF_EXT)">
- <xsl:apply-templates select="." mode="intersect">
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="intersect">
- <xsl:with-param name="IN_OP" select="$INTERSECT_OP"/>
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </m:mrow>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:intersect[1]]" mode="intersect">
- <xsl:param name="IN_OP" select="$DOESNT_MATTER"/>
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:apply-templates select = "*[2]" mode="semantics">
- <xsl:with-param name="IN_PREC" select="$INTERSECT_PREC"/>
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- <xsl:for-each select = "*[position()>2]">
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and ../m:intersect/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="../m:intersect/@id"/>
- </xsl:attribute>
- </xsl:if>
-<!-- HELM: not rendered correctly <![CDATA[⋂]]> -->
- <xsl:text disable-output-escaping="yes">⋂</xsl:text></m:mo>
- <xsl:apply-templates select = "." mode="semantics">
- <xsl:with-param name="PARAM" select="$PAR_SAME"/> <!--new-->
- <xsl:with-param name="IN_PREC" select="$INTERSECT_PREC"/>
- <xsl:with-param name="IN_OP" select="$UNION_OP"/> <!--new-->
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- </xsl:for-each>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:setdiff[1]]">
- <xsl:param name="IN_PREC" select="$NO_PREC"/>
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:choose>
- <xsl:when test="$IN_PREC > $SETDIFF_PREC or $IN_PREC=$SETDIFF_PREC
- and $PARAM=$PAR_SAME">
- <m:mfenced separators="">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="setdiff">
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </m:mfenced>
- </xsl:when>
- <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $FUNCTION_PREC
- and not($SEM_SW=$SEM_ALL) and not($SEM_SW=$SEM_XREF)
- and not($SEM_SW=$SEM_XREF_EXT)">
- <xsl:apply-templates select="." mode="setdiff">
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="setdiff">
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </m:mrow>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:setdiff[1]]" mode="setdiff">
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:apply-templates select = "*[2]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$SETDIFF_PREC"/>
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:setdiff/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:setdiff/@id"/>
- </xsl:attribute>
- </xsl:if>\</m:mo>
- <xsl:apply-templates select = "*[3]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$SETDIFF_PREC"/>
- <xsl:with-param name="PARAM" select="$PAR_SAME"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:cartesianproduct[1]]">
- <xsl:param name="IN_PREC" select="$NO_PREC"/>
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:choose>
- <xsl:when test="$IN_PREC > $CARTPROD_PREC or $IN_PREC=$CARTPROD_PREC
- and $PARAM=$PAR_SAME">
- <m:mfenced separators="">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="cartprod">
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </m:mfenced>
- </xsl:when>
- <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $FUNCTION_PREC
- and not($SEM_SW=$SEM_ALL) and not($SEM_SW=$SEM_XREF)
- and not($SEM_SW=$SEM_XREF_EXT)">
- <xsl:apply-templates select="." mode="cartprod">
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="cartprod">
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </m:mrow>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:cartesianproduct[1]]" mode="cartprod">
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:apply-templates select = "*[2]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$CARTPROD_PREC"/>
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- <xsl:for-each select = "*[position()>2]">
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and ../m:cartesianproduct/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="../m:cartesianproduct/@id"/>
- </xsl:attribute>
- </xsl:if>
-<!-- HELM: not rendered correctly <![CDATA[×]]> -->
- <xsl:text disable-output-escaping="yes">×</xsl:text></m:mo>
- <xsl:apply-templates select = "." mode="semantics">
- <xsl:with-param name="IN_PREC" select="$CARTPROD_PREC"/>
- <xsl:with-param name="PARAM" select="$PAR_SAME"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- </xsl:for-each>
-</xsl:template>
-
-<!-- HELM WARNING: card id was lost! -->
-<xsl:template match = "m:apply[m:card[1]]">
-<!-- HELM: was
- <m:mfenced open="|" close="|" separators=",">
- Now is: mrow + mo -->
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:card/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:card/@id"/>
- </xsl:attribute>
- </xsl:if>|</mo>
- <xsl:for-each select = "*[position()>1]">
- <xsl:apply-templates select = "." mode="semantics"/>
- </xsl:for-each>
- <mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:setdiff/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:setdiff/@id"/>
- </xsl:attribute>
- </xsl:if>|</mo>
- </m:mrow>
-<!-- HELM: </m:mfenced> -->
-</xsl:template>
-
-
-<!-- ***************** SEQUENCES AND SERIES ***************** -->
-
-<xsl:template match = "m:apply[m:sum[1] | m:product[1]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="*[2]=m:bvar and m:lowlimit and m:uplimit">
- <m:munderover>
- <m:mo>
- <xsl:if test="*[1]=m:sum">
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:sum/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:sum/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:text disable-output-escaping='yes'>∑</xsl:text>
- </xsl:if>
- <xsl:if test="*[1]=m:product">
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:product/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:product/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:text disable-output-escaping='yes'>∏</xsl:text>
- </xsl:if>
- </m:mo>
- <m:mrow>
- <xsl:apply-templates select = "*[2]" mode = "semantics"/>
- <m:mo>=</m:mo>
- <xsl:apply-templates select = "m:lowlimit" mode = "semantics"/>
- </m:mrow>
- <xsl:apply-templates select = "m:uplimit" mode = "semantics"/>
- </m:munderover>
- <xsl:apply-templates select = "*[5]" mode = "semantics"/>
- </xsl:when>
- <xsl:when test="*[2]=m:bvar and *[3]=m:condition">
- <m:munder>
- <m:mo>
- <xsl:if test="*[1]=m:sum">
- <xsl:text disable-output-escaping='yes'>∑</xsl:text>
- </xsl:if>
- <xsl:if test="*[1]=m:product">
- <xsl:text disable-output-escaping='yes'>∏</xsl:text>
- </xsl:if>
- </m:mo>
- <xsl:apply-templates select = "*[3]" mode = "semantics"/>
- </m:munder>
- <xsl:apply-templates select = "*[4]" mode = "semantics"/>
- </xsl:when>
- <xsl:when test="*[2]=m:domainofapplication">
- <m:munder>
- <m:mo>
- <xsl:if test="*[1]=m:sum">
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:sum/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:sum/@id"/>
- </xsl:attribute>
- </xsl:if>
-<!-- HELM: not rendered correctly <![CDATA[∑]]> -->
- <xsl:text disable-output-escaping="yes">∑</xsl:text>
- </xsl:if>
- <xsl:if test="*[1]=m:product">
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:product/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:product/@id"/>
- </xsl:attribute>
- </xsl:if>
-<!-- HELM: not rendered correctly <![CDATA[∏]]> -->
- <xsl:text disable-output-escaping="yes">∏</xsl:text>
- </xsl:if>
- </m:mo>
- <xsl:apply-templates select="m:domainofapplication" mode = "semantics"/>
- </m:munder>
- <m:mrow>
- <xsl:apply-templates select="*[position()=last()]" mode = "semantics"/>
- </m:mrow>
- </xsl:when>
- </xsl:choose>
- </m:mrow>
- </xsl:template>
-
-<!-- HELM: was (it didn't match with prefixed MathML)
-<xsl:template match="m:apply[child::*[position()=1 and name()='int']]">
- Now is: -->
-<xsl:template match="m:apply[child::*[position()=1 and self::m:int]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="m:condition">
- <m:msub>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:int/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:int/@id"/>
- </xsl:attribute>
- </xsl:if>
-<!-- HELM: not rendered correctly <![CDATA[∫]]> -->
- <xsl:text disable-output-escaping="yes">∫</xsl:text></m:mo>
- <xsl:apply-templates select="m:condition" mode="semantics"/>
- </m:msub>
- <m:mrow>
- <xsl:apply-templates select="*[position()=last()]" mode="semantics"/>
- </m:mrow>
- <m:mrow>
- <m:mo>d</m:mo>
- <xsl:apply-templates select="m:bvar" mode="semantics"/>
- </m:mrow>
- </xsl:when>
- <xsl:when test="m:domainofapplication">
- <m:msub>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:int/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:int/@id"/>
- </xsl:attribute>
- </xsl:if>
-<!-- HELM: not rendered correctly <![CDATA[∫]]> -->
- <xsl:text disable-output-escaping="yes">∫</xsl:text></m:mo>
- <xsl:apply-templates select="m:domainofapplication" mode="semantics"/>
- </m:msub>
- <m:mrow>
- <xsl:apply-templates select="*[position()=last()]" mode="semantics" />
- </m:mrow>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="m:interval">
- <m:msubsup>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:int/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:int/@id"/>
- </xsl:attribute>
- </xsl:if>
-<!-- HELM: not rendered correctly <![CDATA[∫]]> -->
- <xsl:text disable-output-escaping="yes">∫</xsl:text></m:mo>
- <xsl:apply-templates select="m:interval/*[position()=1]" mode="semantics" />
- <xsl:apply-templates select="m:interval/*[position()=2]" mode="semantics"/>
- </m:msubsup>
- <xsl:apply-templates select="*[position()=last()]" mode="semantics"/>
- <m:mo>d</m:mo>
- <xsl:apply-templates select="m:bvar" mode="semantics"/>
- </xsl:when>
- <xsl:when test="m:lowlimit">
- <m:msubsup>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:int/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:int/@id"/>
- </xsl:attribute>
- </xsl:if>
-<!-- HELM: not rendered correctly <![CDATA[∫]]> -->
- <xsl:text disable-output-escaping="yes">∫</xsl:text></m:mo>
- <m:mrow><xsl:apply-templates select="m:lowlimit" mode="semantics"/></m:mrow>
- <m:mrow><xsl:apply-templates select="m:uplimit" mode="semantics"/></m:mrow>
- </m:msubsup>
- <xsl:apply-templates select="*[position()=last()]" mode="semantics"/>
- <m:mo>d</m:mo><xsl:apply-templates select="m:bvar" mode="semantics"/>
- </xsl:when>
- <xsl:otherwise>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:int/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:int/@id"/>
- </xsl:attribute>
- </xsl:if>
-<!-- HELM: not rendered correctly <![CDATA[∫]]> -->
- <xsl:text disable-output-escaping="yes">∫</xsl:text></m:mo>
- <xsl:apply-templates select="*[position()=last()]" mode="semantics"/>
- <m:mo>d</m:mo><xsl:apply-templates select="m:bvar" mode="semantics"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </m:mrow>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:limit[1]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:munder>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:lim/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:lim/@id"/>
- </xsl:attribute>
- </xsl:if>lim</m:mo>
- <m:mrow>
- <xsl:if test="*[2]=m:bvar and *[3]=m:lowlimit">
- <xsl:apply-templates select = "*[2]" mode = "semantics"/>
- <m:mo><xsl:text disable-output-escaping='yes'>→</xsl:text></m:mo>
- <xsl:apply-templates select = "*[3]" mode = "semantics"/>
- </xsl:if>
- <xsl:if test="*[2]=m:bvar and *[3]=m:condition">
- <xsl:apply-templates select = "*[3]" mode = "semantics"/>
- </xsl:if>
- </m:mrow>
- </m:munder>
- <xsl:apply-templates select = "*[4]" mode = "semantics"/>
- </m:mrow>
-</xsl:template>
-
-
-<!-- ***************** TRIGONOMETRY ***************** -->
-
-<xsl:template match = "m:apply[*[1][self::m:sin | self::m:cos |
- self::m:tan | self::m:sec | self::m:csc |
- self::m:cot | self::m:sinh | self::m:cosh |
- self::m:tanh | self::m:sech | self::m:csch |
- self::m:coth | self::m:arcsin | self::m:arccos |
- self::m:arctan | self::m:arcsec | self::m:arccsc |
- self::m:arccot | self::m:arcsinh | self::m:arccosh |
- self::m:arctanh | self::m:arcsech | self::m:arccsch |
- self::m:arccoth ] ]">
-
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:if test="not(parent::m:apply[m:power[1]])">
- <xsl:apply-templates select = "*[1]" mode = "trigonometry"/>
- </xsl:if>
- <xsl:if test="parent::m:apply[m:power[1]]">
- <m:msup>
- <xsl:apply-templates select = "*[1]" mode = "trigonometry"/>
- <xsl:apply-templates select = "../*[3]" mode = "semantics"/>
- </m:msup>
- </xsl:if>
- <m:mo><xsl:text disable-output-escaping='yes'>⁡</xsl:text></m:mo>
- <xsl:apply-templates select = "*[2]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- </m:mrow>
-</xsl:template>
-
-<xsl:template match = "*" mode="trigonometry">
- <m:mo>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="self::m:sin">
- <xsl:value-of select="'sin'"/>
- </xsl:when>
- <xsl:when test="self::m:cos">
- <xsl:value-of select="'cos'"/>
- </xsl:when>
- <xsl:when test="self::m:tan">
- <xsl:value-of select="'tan'"/>
- </xsl:when>
- <xsl:when test="self::m:sec">
- <xsl:value-of select="'sec'"/>
- </xsl:when>
- <xsl:when test="self::m:csc">
- <xsl:value-of select="'csc'"/>
- </xsl:when>
- <xsl:when test="self::m:cot">
- <xsl:value-of select="'cot'"/>
- </xsl:when>
- <xsl:when test="self::m:sinh">
- <xsl:value-of select="'sinh'"/>
- </xsl:when>
- <xsl:when test="self::m:cosh">
- <xsl:value-of select="'cosh'"/>
- </xsl:when>
- <xsl:when test="self::m:tanh">
- <xsl:value-of select="'tanh'"/>
- </xsl:when>
- <xsl:when test="self::m:sech">
- <xsl:value-of select="'sech'"/>
- </xsl:when>
- <xsl:when test="self::m:csch">
- <xsl:value-of select="'csch'"/>
- </xsl:when>
- <xsl:when test="self::m:coth">
- <xsl:value-of select="'coth'"/>
- </xsl:when>
- <xsl:when test="self::m:arcsin">
- <xsl:value-of select="'arcsin'"/>
- </xsl:when>
- <xsl:when test="self::m:arccos">
- <xsl:value-of select="'arccos'"/>
- </xsl:when>
- <xsl:when test="self::m:arctan">
- <xsl:value-of select="'arctan'"/>
- </xsl:when>
- <xsl:when test="self::m:arcsec">
- <xsl:value-of select="'arcsec'"/>
- </xsl:when>
- <xsl:when test="self::m:arccsc">
- <xsl:value-of select="'arccsc'"/>
- </xsl:when>
- <xsl:when test="self::m:arccot">
- <xsl:value-of select="'arccot'"/>
- </xsl:when>
- <xsl:when test="self::m:arcsinh">
- <xsl:value-of select="'arcsinh'"/>
- </xsl:when>
- <xsl:when test="self::m:arccosh">
- <xsl:value-of select="'arccosh'"/>
- </xsl:when>
- <xsl:when test="self::m:arctanh">
- <xsl:value-of select="'arctanh'"/>
- </xsl:when>
- <xsl:when test="self::m:arcsech">
- <xsl:value-of select="'arcsech'"/>
- </xsl:when>
- <xsl:when test="self::m:arccsch">
- <xsl:value-of select="'arccsch'"/>
- </xsl:when>
- <xsl:when test="self::m:arccoth">
- <xsl:value-of select="'arccot'"/>
- </xsl:when>
- </xsl:choose>
- </m:mo>
-</xsl:template>
-
-
-<!-- ***************** STATISTICS ***************** -->
-
-<!-- HELM WARNING: mean id was lost! -->
-<xsl:template match = "m:apply[m:mean[1]]">
-<!-- HELM: was
- <m:mfenced open="<" close=">" separators=",">
- Now is: mrow + mo + separator (mo) -->
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:mean/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:mean/@id"/>
- </xsl:attribute>
- </xsl:if><</m:mo>
- <xsl:for-each select = "*[position()>1]">
-<!-- HELM: if added -->
- <xsl:if test="position() != 1">
- <m:mo separator="true">,</m:mo>
- </xsl:if>
- <xsl:apply-templates select = "." mode="semantics"/>
- </xsl:for-each>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:mean/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:mean/@id"/>
- </xsl:attribute>
- </xsl:if>></m:mo>
- </m:mrow>
-<!-- HELM: </m:mfenced> -->
-</xsl:template>
-
-<xsl:template match = "m:apply[m:sdev[1]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:sdev/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:sdev/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:text disable-output-escaping='yes'>σ</xsl:text></m:mo>
- <m:mfenced separators=",">
- <xsl:for-each select = "*[position()>1]">
- <xsl:apply-templates select = "." mode="semantics"/>
- </xsl:for-each>
- </m:mfenced>
- </m:mrow>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:variance[1]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:variance/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:variance/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:text disable-output-escaping='yes'>σ</xsl:text></m:mo>
- <m:msup>
- <m:mfenced separators=",">
- <xsl:for-each select = "*[position()>1]">
- <xsl:apply-templates select = "." mode="semantics"/>
- </xsl:for-each>
- </m:mfenced>
- <m:mn>2</m:mn>
- </m:msup>
- </m:mrow>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:median[1]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:median/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:median/@id"/>
- </xsl:attribute>
- </xsl:if>median</m:mo>
- <m:mfenced separators=",">
- <xsl:for-each select = "*[position()>1]">
- <xsl:apply-templates select = "." mode="semantics"/>
- </xsl:for-each>
- </m:mfenced>
- </m:mrow>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:mode[1]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:mode/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:mode/@id"/>
- </xsl:attribute>
- </xsl:if>mode</m:mo>
- <m:mfenced separators=",">
- <xsl:for-each select = "*[position()>1]">
- <xsl:apply-templates select = "." mode="semantics"/>
- </xsl:for-each>
- </m:mfenced>
- </m:mrow>
-</xsl:template>
-
-<!-- HELM WARNING: mean id was lost! -->
-<xsl:template match = "m:apply[m:moment[1]]">
-<!-- HELM: was
- <m:mfenced open="<" close=">" separators="">
- Now is: mrow + mo -->
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:moment/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:momemt/@id"/>
- </xsl:attribute>
- </xsl:if><</m:mo>
- <xsl:if test="*[2]=m:degree and not(*[3]=m:momentabout)">
- <m:msup>
- <xsl:apply-templates select="*[3]" mode = "semantics"/>
- <xsl:apply-templates select="*[2]" mode = "semantics"/>
- </m:msup>
- </xsl:if>
- <xsl:if test="*[2]=m:degree and *[3]=m:momentabout">
- <m:msup>
- <xsl:apply-templates select="*[4]" mode = "semantics"/>
- <xsl:apply-templates select="*[2]" mode = "semantics"/>
- </m:msup>
- </xsl:if>
- <xsl:if test="not(*[2]=m:degree) and *[2]=m:momentabout">
- <xsl:for-each select = "*[position()>2]">
- <xsl:apply-templates select = "." mode="semantics"/>
- </xsl:for-each>
- </xsl:if>
- <xsl:if test="not(*[2]=m:degree) and not(*[2]=m:momentabout)">
- <xsl:for-each select = "*[position()>1]">
- <xsl:apply-templates select = "." mode="semantics"/>
- </xsl:for-each>
- </xsl:if>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:mean/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:mean/@id"/>
- </xsl:attribute>
- </xsl:if>></m:mo>
- </m:mrow>
-<!-- HELM: </m:mfenced> -->
-</xsl:template>
-
-
-<!-- ***************** LINEAR ALGEBRA ***************** -->
-
-<xsl:template match="m:vector">
- <m:mfenced separators="">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mtable>
- <xsl:for-each select="*">
- <m:mtd>
- <xsl:apply-templates select="." mode = "semantics"/>
- </m:mtd>
- </xsl:for-each>
- </m:mtable>
- </m:mfenced>
-</xsl:template>
-
-<xsl:template match = "m:matrix">
- <m:mfenced separators="">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mtable>
- <xsl:apply-templates select="*" mode = "semantics"/>
- </m:mtable>
- </m:mfenced>
-</xsl:template>
-
-<xsl:template match = "m:matrixrow">
- <m:mtr>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:for-each select="*">
- <m:mtd>
- <xsl:apply-templates select="." mode = "semantics"/>
- </m:mtd>
- </xsl:for-each>
- </m:mtr>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:determinant[1]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:determinant/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:determinant/@id"/>
- </xsl:attribute>
- </xsl:if>det</m:mo>
- <xsl:apply-templates select = "*[2]" mode = "semantics"/>
- </m:mrow>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:transpose[1]]">
- <m:msup>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select = "*[2]" mode = "semantics"/>
- <m:mo>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:transpose/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:transpose/@id"/>
- </xsl:attribute>
- </xsl:if>T</m:mo>
- </m:msup>
-</xsl:template>
-
-<!-- HELM: ERROR, this template generates the selected content elements
- and doesn't generate the presentation for selector -->
-<!--<xsl:template match = "m:apply[m:selector[1]]">
- <xsl:if test="*[2]=m:matrix and *[3]=m:cn">
- <xsl:variable name="m" select = "*[3]"/>
- <xsl:choose>
- <xsl:when test="*[4]=m:cn">
- <xsl:variable name="n" select = "*[4]"/>
- <xsl:copy-of select = "m:matrix/*[position()=$m]/*[position()=$n]"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:copy-of select = "m:matrix/*[position()=$m]"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- <xsl:if test="(*[2]=m:vector or *[2]=m:list) and *[3]=m:cn">
- <xsl:variable name="m" select = "*[3]"/>
- <xsl:copy-of select = "*[2]/*[position()=$m]"/>
- </xsl:if>
-</xsl:template> -->
-
-<xsl:template match = "m:apply[m:selector[1]]">
- <msub>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select = "*[2]" mode="semantics"/>
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:selector/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:selector/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="*[3]=m:cn">
- <xsl:apply-templates select = "*[3]" mode="semantics"/>
- </xsl:when>
- <xsl:otherwise>
- <m:mi>*</m:mi>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:if test="*[2]=m:matrix and *[4]=m:cn">
- <xsl:apply-templates select = "*[4]" mode="semantics"/>
- </xsl:if>
- </m:mrow>
- </msub>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:vectorproduct[1] |
- m:scalarproduct[1] | m:outerproduct[1]]">
- <m:mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="*[2]" mode = "semantics"/>
- <m:mo>
- <xsl:if test="m:vectorproduct[1]">
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:vectorproduct/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:vectorproduct/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:text disable-output-escaping='yes'>⨯</xsl:text>
- </xsl:if>
- <xsl:if test="m:scalarproduct[1] | m:outerproduct[1]">
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and *[1]/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="*[1]/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:value-of select="'.'"/>
- </xsl:if>
- </m:mo>
- <xsl:apply-templates select="*[3]" mode = "semantics"/>
- </m:mrow>
-</xsl:template>
-
-
-<!-- ***************** CONSTANT and SYMBOL ELEMENTS ***************** -->
-
-<xsl:template match="m:integers">
- <m:mi>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:integers/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:integers/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:text disable-output-escaping='yes'>ℤ</xsl:text></m:mi>
-</xsl:template>
-
-<xsl:template match="m:reals">
- <m:mi>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:reals/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:reals/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:text disable-output-escaping='yes'>ℝ</xsl:text></m:mi>
-</xsl:template>
-
-<xsl:template match="m:rationals">
- <m:mi>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:rationals/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:rationals/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:text disable-output-escaping='yes'>ℚ</xsl:text></m:mi>
-</xsl:template>
-
-<xsl:template match="m:naturalnumbers">
- <m:mi>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:naturalnumbers/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:naturalnumbers/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:text disable-output-escaping='yes'>ℕ</xsl:text></m:mi>
-</xsl:template>
-
-<xsl:template match="m:complexes">
- <m:mi>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:complexes/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:complexes/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:text disable-output-escaping='yes'>ℂ</xsl:text></m:mi>
-</xsl:template>
-
-<xsl:template match="m:primes">
- <m:mi>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:primes/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:primes/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:text disable-output-escaping='yes'>ℙ</xsl:text></m:mi>
-</xsl:template>
-
-<xsl:template match="m:exponentiale">
- <m:mi>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:exponentiale/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:exponentiale/@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:text disable-output-escaping="yes">ⅇ</xsl:text></m:mi>
-</xsl:template>
-
-<xsl:template match="m:imaginaryi">
- <m:mi>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:imaginaryi/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:imaginaryi/@id"/>
- </xsl:attribute>
- </xsl:if>
-<!-- HELM: not rendered correctly <![CDATA[ⅈ]]> -->
- <xsl:text disable-output-escaping="yes"></xsl:text></m:mi>
-</xsl:template>
-
-<xsl:template match="m:notanumber">
- <m:mi>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:notanumber/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:notanumber/@id"/>
- </xsl:attribute>
- </xsl:if>NaN</m:mi>
-</xsl:template>
-
-<xsl:template match="m:true">
- <m:mi>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:true/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:true/@id"/>
- </xsl:attribute>
- </xsl:if>true</m:mi>
-</xsl:template>
-
-<xsl:template match="m:false">
- <m:mi>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:false/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:false/@id"/>
- </xsl:attribute>
- </xsl:if>false</m:mi>
-</xsl:template>
-
-<xsl:template match="m:emptyset">
- <m:mi>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:emptyset/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:emptyset/@id"/>
- </xsl:attribute>
- </xsl:if>
-<!-- HELM: not rendered correctly <![CDATA[∅]]> -->
- <xsl:text disable-output-escaping="yes"></xsl:text></m:mi>
-</xsl:template>
-
-<xsl:template match="m:pi">
- <m:mi>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:pi/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:pi/@id"/>
- </xsl:attribute>
- </xsl:if>
-<!-- HELM: not rendered correctly <![CDATA[π]]> -->
- <xsl:text disable-output-escaping="yes">π</xsl:text></m:mi>
-</xsl:template>
-
-<xsl:template match="m:eulergamma">
- <m:mi>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:eulergamma/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:eulergamma/@id"/>
- </xsl:attribute>
- </xsl:if>
-<!-- HELM: not rendered correctly <![CDATA[γ]]> -->
- <xsl:text disable-output-escaping="yes">γ</xsl:text></m:mi>
-</xsl:template>
-
-<xsl:template match="m:infinity">
- <m:mi>
-<!-- HELM: xref added -->
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and m:infinity/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:infinity/@id"/>
- </xsl:attribute>
- </xsl:if>
-<!-- HELM: not rendered correctly <![CDATA[∞]]> -->
- <xsl:text disable-output-escaping="yes">∞</xsl:text></m:mi>
-</xsl:template>
-
-</xsl:stylesheet>
-
-
+++ /dev/null
-<?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/. -->
-
-<!--***********************************************************************-->
-<!-- Extension to the XSLT version 0.07 of MathML content to presentation: -->
-<!-- First draft: February 19 2000, Andrea Asperti, Irene Schena -->
-<!-- Revised: March 3 2000, Irene Schena -->
-<!-- Revised: March 15 2000, Claudio Sacerdoti Coen, Irene Schena -->
-<!-- Revised: March 21 2000, Irene Schena -->
-<!--***********************************************************************-->
-
-<!-- NOTE: the namespace declaration has to be done in the stylesheets
-which generates the toplevel element (see for instance xlink) -->
-<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:xlink="http://www.w3.org/1999/xlink">
-
-<!-- OLD: <xsl:import href="mml2mmlv1_0.xsl"/> -->
-
-<xsl:import href="mmlnotation.xsl"/>
-
-<xsl:import href="mmltheoryextension.xsl"/>
-
-
-<xsl:param name="explodeall" select="false()"/>
-
-<!--***********************************************************************-->
-<!-- Parameter affecting line-breaking -->
-<!--***********************************************************************-->
-
-<xsl:variable name="framewidth" select="35"/>
-
-<!--***********************************************************************-->
-<!-- Gli oggetti sono stampati come mtext all'interno di una marca toplevel-->
-<!-- math ma al di fuori di semantics. Ora vi sono tanti semantics quanti -->
-<!-- sono i termini: la presentation per un termine e' generata come primo -->
-<!-- figlio di un semantics e l'originario content viene inserito nel -->
-<!-- nel secondo figlio di semantics, annotation-xml -->
-<!--***********************************************************************-->
-
-<!--**********************-->
-<!-- OBJECTS -->
-<!--**********************-->
-
-<xsl:param name="type" select="'standalone'"/>
-
-<xsl:template match="/">
- <xsl:choose>
- <xsl:when test="$type = 'standalone'">
- <xsl:apply-templates select="*"/>
- </xsl:when>
- <xsl:otherwise>
- <to_be_embedded>
- <xsl:apply-templates select="*"/>
- </to_be_embedded>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<!-- DEFINITION -->
-
-<xsl:template match="Definition">
- <m:math>
- <m:mtable align="baseline 1" equalrows="false" columnalign="left" helm:xref="{@helm:xref}">
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mtext>DEFINITION <xsl:value-of select="@name"/>(<xsl:if test="string(./Params) != """><xsl:value-of select="Params"/></xsl:if>) OF TYPE</m:mtext>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
- <xsl:apply-templates select="type/*[1]"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mtext>AS</m:mtext>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
- <xsl:apply-templates select="body/*[1]"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- </m:mtable>
- </m:math>
-</xsl:template>
-
-<!-- AXIOM -->
-
-<xsl:template match="Axiom">
- <m:math>
- <m:mtable align="baseline 1" equalrows="false" columnalign="left" helm:xref="{@helm:xref}">
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mtext>AXIOM <xsl:value-of select="@name"/>(<xsl:if test="string(./Params) != """><xsl:value-of select="Params"/></xsl:if>) OF TYPE</m:mtext>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
- <xsl:apply-templates select="type/*[1]"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- </m:mtable>
- </m:math>
-</xsl:template>
-
-<!-- UNFINISHED PROOF -->
-
-<xsl:template match="CurrentProof">
- <m:math>
- <m:mtable align="baseline 1" equalrows="false" columnalign="left" helm:xref="{@helm:xref}">
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mtext>UNFINISHED PROOF <xsl:value-of select="@name"/>(<xsl:if test="string(./Params) != """><xsl:value-of select="Params"/></xsl:if>)</m:mtext>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mtext>THESIS:</m:mtext>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
- <xsl:apply-templates select="type/*[1]"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mtext>CONJECTURES:</m:mtext>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <xsl:for-each select="Conjecture">
- <m:mtr>
- <m:mtd>
- <m:mrow helm:xref="{@helm:xref}">
- <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
- <xsl:for-each select="Decl|Def|Hidden">
- <xsl:choose>
- <xsl:when test="name(.)='Decl'">
- <m:mrow helm:xref="{@helm:xref}">
- <xsl:choose>
- <xsl:when test="@name">
- <m:mi><xsl:value-of select="@name"/></m:mi>
- </xsl:when>
- <xsl:otherwise>
- <m:mi>_</m:mi>
- </xsl:otherwise>
- </xsl:choose>
- <m:mo>:</m:mo>
- <xsl:apply-templates select="./*[1]"/>
- </m:mrow>
- </xsl:when>
- <xsl:when test="name(.)='Def'">
- <m:mrow helm:xref="{@helm:xref}">
- <xsl:choose>
- <xsl:when test="@name">
- <m:mi><xsl:value-of select="@name"/></m:mi>
- </xsl:when>
- <xsl:otherwise>
- <m:mi>_</m:mi>
- </xsl:otherwise>
- </xsl:choose>
- <m:mo>:=</m:mo>
- <xsl:apply-templates select="./*[1]"/>
- </m:mrow>
- </xsl:when>
- <xsl:otherwise>
- <m:mrow helm:xref="{@helm:xref}">
- <m:mi>_</m:mi>
- <m:mo>:?</m:mo>
- <m:mi>_</m:mi>
- </m:mrow>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:if test="not (position() = last())">
- <m:mo>;</m:mo>
- </xsl:if>
- </xsl:for-each>
- <m:mo>|-</m:mo>
- <m:msub><m:mi>?</m:mi><m:mn><xsl:value-of select="@no"/></m:mn></m:msub>
- <m:mo>:</m:mo>
- <xsl:apply-templates select="./Goal/*[1]"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- </xsl:for-each>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mtext>PROOF:</m:mtext>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
- <xsl:apply-templates select="body/*[1]"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- </m:mtable>
- </m:math>
-</xsl:template>
-
-<!-- MUTUAL INDUCTIVE DEFINITION -->
-
-<xsl:template match="InductiveDefinition">
- <m:math>
- <m:mtable align="baseline 1" equalrows="false" columnalign="left" helm:xref="{@helm:xref}">
- <xsl:for-each select="InductiveType">
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <xsl:choose>
- <xsl:when test="position() = 1">
- <xsl:choose>
- <xsl:when test="string(./@inductive) = "true"">
- <m:mtext>INDUCTIVE DEFINITION</m:mtext>
- </xsl:when>
- <xsl:otherwise>
- <m:mtext>COINDUCTIVE DEFINITION</m:mtext>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <m:mtext>AND</m:mtext>
- </xsl:otherwise>
- </xsl:choose>
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- <m:mtext><xsl:value-of select="./@name"/>(<xsl:if test="string(../Params) != """><xsl:value-of select="../Params"/></xsl:if>)</m:mtext>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
- <m:mtext>[</m:mtext>
- <xsl:choose>
- <xsl:when test="string(../Param) != """>
- <m:mtable align="baseline 1" equalrows="false" columnalign="left">
- <xsl:for-each select="../Param">
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mi><xsl:value-of select="./@name"/></m:mi>
- <m:mo>:</m:mo>
- <xsl:apply-templates select="*"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- </xsl:for-each>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mtext>]</m:mtext>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- </m:mtable>
- </xsl:when>
- <xsl:otherwise>
- <m:mtext>]</m:mtext>
- </xsl:otherwise>
- </xsl:choose>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mtext>OF ARITY</m:mtext>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
- <xsl:apply-templates select="./arity/*[1]"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mtext>BUILT FROM</m:mtext>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <xsl:for-each select="./Constructor">
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <xsl:choose>
- <xsl:when test="position() = 1">
- <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
- </xsl:when>
- <xsl:otherwise>
- <m:mtext>|</m:mtext>
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- </xsl:otherwise>
- </xsl:choose>
- <m:mtext><xsl:value-of select="./@name"/> OF</m:mtext>
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- <xsl:apply-templates select="./*[1]"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- </xsl:for-each>
- </xsl:for-each>
- </m:mtable>
- </m:math>
-</xsl:template>
-
-<!-- VARIABLE -->
-
-<xsl:template match="Variable">
- <m:math>
- <m:mtable align="baseline 1" equalrows="false" columnalign="left" helm:xref="{@helm:xref}">
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mtext>VARIABLE <xsl:value-of select="@name"/> OF TYPE</m:mtext>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
- <xsl:apply-templates select="type/*[1]"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <xsl:if test="name(*[1])='body'">
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mtext>AS</m:mtext>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
- <xsl:apply-templates select="body/*[1]"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- </xsl:if>
- </m:mtable>
- </m:math>
-</xsl:template>
-
-<!-- SEQUENT -->
-
-<xsl:template match="Sequent">
- <xsl:variable name="rowlines">
- <xsl:for-each select="Decl|Def">
- <xsl:if test="position() != last()">
- <xsl:text>none </xsl:text>
- </xsl:if>
- </xsl:for-each>
- <xsl:text>solid</xsl:text>
- </xsl:variable>
- <xsl:variable name="no" select="@no"/>
- <m:math>
- <m:mi><xsl:text>?</xsl:text><xsl:value-of select="$no"/></m:mi>
- <m:mo>:</m:mo>
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- <m:mtable align="baseline 1" equalrows="false" columnalign="left" helm:xref="{@helm:xref}" rowlines="{$rowlines}">
- <xsl:for-each select="Decl|Def">
- <m:mtr>
- <m:mtd>
- <m:mrow helm:xref="{@helm:xref}">
- <m:mi><xsl:value-of select="@name"/></m:mi>
- <xsl:choose>
- <xsl:when test="name(.) = 'Decl'">
- <m:mo>:</m:mo>
- </xsl:when>
- <xsl:otherwise>
- <m:mo>:=</m:mo>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:apply-templates select="*[1]"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- </xsl:for-each>
- <xsl:if test="not(Decl|Def)">
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- </xsl:if>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <xsl:apply-templates select="Goal/*[1]"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- </m:mtable>
- </m:math>
-</xsl:template>
-
-<!--**********************-->
-<!-- TERMS -->
-<!--**********************-->
-
-<xsl:template match="m:bvar">
- <xsl:choose>
- <xsl:when test="m:type">
- <xsl:variable name="charlength">
- <xsl:apply-templates select="m:ci" mode="charcount"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$charlength >= $framewidth">
- <m:mtable align="baseline 1" equalrows="false" columnalign="left">
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <xsl:apply-templates select="m:ci"/>
- <m:mo>:</m:mo>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <xsl:apply-templates select="m:type"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- </m:mtable>
- </xsl:when>
- <xsl:otherwise>
- <m:mrow>
- <xsl:apply-templates select="m:ci"/>
- <m:mo>:</m:mo>
- <xsl:apply-templates select="m:type"/>
- </m:mrow>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="m:ci"/>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-
-<!-- CSYMBOL -->
-
-<xsl:template match="m:apply[m:csymbol]">
-<xsl:param name="nopar" select="0"/>
- <xsl:variable name="name"><xsl:value-of select="m:csymbol"/></xsl:variable>
- <xsl:variable name="charlength"><xsl:apply-templates select="m:csymbol" mode="charcount"/></xsl:variable>
- <m:mrow>
- <xsl:if test="@id">
- <xsl:attribute name="xref"><xsl:value-of select="@id"/></xsl:attribute>
- </xsl:if>
- <xsl:variable name="id" select="m:csymbol/@id"/>
- <xsl:choose>
- <!-- META -->
- <xsl:when test="$name='meta'">
- <m:mrow>
- <xsl:apply-templates select="*[position()=2]"/>
- <m:mfenced open="[" close="]" separators=";">
- <xsl:apply-templates select="*[position()>2]"/>
- </m:mfenced>
- </m:mrow>
- </xsl:when>
- <!-- FORALL -->
- <xsl:when test="$name='forall'">
- <xsl:choose>
- <xsl:when test="$charlength >= $framewidth">
- <m:mtable align="baseline 1" equalrows="false" columnalign="left">
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mo mathcolor="Blue">∀</m:mo>
- <xsl:apply-templates select="m:bvar"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mo>.</m:mo>
- <xsl:apply-templates select="*[position()=3]"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- </m:mtable>
- </xsl:when>
- <xsl:otherwise>
- <m:mo mathcolor="Blue">∀</m:mo>
- <xsl:apply-templates select="m:bvar/m:ci"/>
- <m:mo>:</m:mo>
- <xsl:apply-templates select="m:bvar/m:type"/>
- <m:mo>.</m:mo>
- <xsl:apply-templates select="*[position()=3]"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <!-- LET-IN -->
- <xsl:when test="$name='let_in'">
- <xsl:choose>
- <xsl:when test="$charlength >= $framewidth">
- <m:mtable align="baseline 1" equalrows="false" columnalign="left">
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mo>LET</m:mo>
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- <xsl:apply-templates select="m:bvar"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mo>=</m:mo>
- <xsl:apply-templates select="*[position()=3]"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mo>IN</m:mo>
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- <xsl:apply-templates select="*[position()=4]"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- </m:mtable>
- </xsl:when>
- <xsl:otherwise>
- <m:mo>LET</m:mo>
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- <xsl:apply-templates select="m:bvar/m:ci"/>
- <m:mo>=</m:mo>
- <xsl:apply-templates select="*[position()=3]"/>
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- <m:mtext>IN</m:mtext>
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- <xsl:apply-templates select="*[position()=4]"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <!-- PROD -->
- <xsl:when test="$name='prod'">
- <xsl:choose>
- <xsl:when test="$charlength >= $framewidth">
- <m:mtable align="baseline 1" equalrows="false" columnalign="left">
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mo mathcolor="Blue">Π</m:mo>
- <xsl:apply-templates select="m:bvar"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mo>.</m:mo>
- <xsl:apply-templates select="*[position()=3]"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- </m:mtable>
- </xsl:when>
- <xsl:otherwise>
- <m:mo mathcolor="Blue">Π</m:mo>
- <xsl:apply-templates select="m:bvar/m:ci"/>
- <m:mo>:</m:mo>
- <xsl:apply-templates select="m:bvar/m:type"/>
- <m:mo>.</m:mo>
- <xsl:apply-templates select="*[position()=3]"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <!-- ARROW -->
- <xsl:when test="$name='arrow'">
- <xsl:choose>
- <xsl:when test="$charlength >= $framewidth">
- <m:mtable align="baseline 1" equalrows="false" columnalign="left">
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <xsl:if test="$nopar=0">
- <m:mo stretchy="false">(</m:mo>
- </xsl:if>
- <xsl:apply-templates select="*[position()=2]"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mo mathmathcolor="Blue">→</m:mo>
- <xsl:choose>
- <xsl:when test="*[position()=3]/m:csymbol">
- <xsl:variable name="nextp"><xsl:value-of select="*[position()=3]/m:csymbol"/></xsl:variable>
- <xsl:choose>
- <xsl:when test="$nextp='arrow'">
- <xsl:apply-templates select="*[position()=3]"><xsl:with-param name="nopar" select="1"/></xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="*[position()=3]"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="*[position()=3]"/>
- </xsl:otherwise>
- </xsl:choose>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <xsl:if test="$nopar=0">
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mo stretchy="false">)</m:mo>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- </xsl:if>
- </m:mtable>
- </xsl:when>
- <xsl:otherwise>
- <xsl:if test="$nopar=0">
- <m:mo stretchy="false">(</m:mo>
- </xsl:if>
- <xsl:apply-templates select="*[position()=2]"/>
- <m:mo mathcolor="Blue">→</m:mo>
- <xsl:choose>
- <xsl:when test="*[position()=3]/m:csymbol">
- <xsl:variable name="nextp"><xsl:value-of select="*[position()=3]/m:csymbol"/></xsl:variable>
- <xsl:choose>
- <xsl:when test="$nextp='arrow'">
- <xsl:apply-templates select="*[position()=3]"><xsl:with-param name="nopar" select="1"/></xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="*[position()=3]"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="*[position()=3]"/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:if test="$nopar=0">
- <m:mo stretchy="false">)</m:mo>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <!-- APP -->
- <xsl:when test="$name='app'">
- <xsl:choose>
- <xsl:when test="$charlength >= $framewidth">
- <m:mtable align="baseline 1" equalrows="false" columnalign="left">
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mo stretchy="false">(</m:mo>
-<!-- added precedence to app = FUNCTION_PREC (99) -->
- <xsl:apply-templates select="*[position()=2]">
- <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
- </xsl:apply-templates>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <xsl:for-each select="*[position()>2]">
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mphantom><m:mtext>(</m:mtext></m:mphantom>
-<!-- added precedence to app = FUNCTION_PREC (99) -->
- <xsl:apply-templates select=".">
- <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
- </xsl:apply-templates>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- </xsl:for-each>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mo stretchy="false">)</m:mo>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- </m:mtable>
- </xsl:when>
- <xsl:otherwise>
- <m:mo stretchy="false">(</m:mo>
-<!-- added precedence to app = FUNCTION_PREC (99) -->
- <xsl:apply-templates select="*[position()=2]">
- <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
- </xsl:apply-templates>
- <xsl:for-each select="*[position()>2]">
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
-<!-- added precedence to app = FUNCTION_PREC (99) -->
- <xsl:apply-templates select=".">
- <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
- </xsl:apply-templates>
- </xsl:for-each>
- <m:mo stretchy="false">)</m:mo>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <!-- CAST -->
- <xsl:when test="$name='cast'">
- <xsl:choose>
- <xsl:when test="$charlength >= $framewidth">
- <m:mtable align="baseline 1" equalrows="false" columnalign="left">
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mo stretchy="false">(</m:mo>
- <xsl:apply-templates select="*[position()=2]"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mo mathcolor="Maroon">:></m:mo>
- <xsl:apply-templates select="*[position()=3]"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mo stretchy="false">)</m:mo>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- </m:mtable>
- </xsl:when>
- <xsl:otherwise>
- <m:mo stretchy="false">(</m:mo>
- <xsl:apply-templates select="*[position()=2]"/>
- <m:mo mathcolor="Maroon">:></m:mo>
- <xsl:apply-templates select="*[position()=3]"/>
- <m:mo stretchy="false">)</m:mo>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <!-- PROP -->
- <xsl:when test="$name='Prop'">
- <m:mo>Prop</m:mo>
- </xsl:when>
- <!-- SET -->
- <xsl:when test="$name='Set'">
- <m:mo>Set</m:mo>
- </xsl:when>
- <!-- TYPE -->
- <xsl:when test="$name='Type'">
- <m:mo>Type</m:mo>
- </xsl:when>
- <!-- MUTCASE -->
- <xsl:when test="$name='mutcase'">
- <xsl:choose>
- <xsl:when test="$charlength >= $framewidth">
- <xsl:variable name="charlength"><xsl:apply-templates select="*[position()=2]" mode="charcount"><xsl:with-param name="nosibling" select="1"/></xsl:apply-templates></xsl:variable>
- <m:mtable align="baseline 1" equalrows="false" columnalign="left">
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mo><</m:mo>
- <xsl:apply-templates select="*[position()=2]"/>
- <xsl:if test="$framewidth > $charlength">
- <m:mo>></m:mo>
- <m:mo>CASES</m:mo>
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- <xsl:apply-templates select="*[position()=3]"/>
- </xsl:if>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <xsl:if test="$charlength >= $framewidth">
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mo>></m:mo>
- <m:mo>CASES</m:mo>
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- <xsl:apply-templates select="*[position()=3]"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- </xsl:if>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mo>OF</m:mo>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <xsl:for-each select="m:piecewise/m:piece">
- <xsl:variable name="charlength"><xsl:apply-templates select="./*[2]" mode="charcount"><xsl:with-param name="nosibling" select="1"/></xsl:apply-templates></xsl:variable>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <xsl:choose>
- <xsl:when test="position() = 1">
- <m:mphantom><m:mtext>|</m:mtext></m:mphantom>
- </xsl:when>
- <xsl:otherwise>
- <m:mo stretchy="false">|</m:mo>
- </xsl:otherwise>
- </xsl:choose>
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- <xsl:apply-templates select="./*[2]"/>
- <xsl:if test="$framewidth > $charlength">
- <m:mo mathcolor="Green">⇒</m:mo>
- <xsl:apply-templates select="./*[1]"/>
- </xsl:if>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <xsl:if test="$charlength >= $framewidth">
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mphantom><m:mtext>|_</m:mtext></m:mphantom>
- <m:mo mathcolor="Green">⇒</m:mo>
- <xsl:apply-templates select="./*[1]"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- </xsl:if>
- </xsl:for-each>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mo>END</m:mo>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- </m:mtable>
- </xsl:when>
- <xsl:otherwise>
- <m:mo><</m:mo><xsl:apply-templates select="*[position()=2]"/><m:mo>></m:mo>
- <m:mo>CASES</m:mo>
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- <xsl:apply-templates select="*[position()=3]"/>
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- <m:mo>OF</m:mo>
- <xsl:for-each select="m:piecewise/m:piece">
- <xsl:choose>
- <xsl:when test="position() != 1">
- <m:mo stretchy="false">|</m:mo>
- </xsl:when>
- </xsl:choose>
- <xsl:apply-templates select="./*[2]"/>
- <m:mo mathcolor="Green">⇒</m:mo>
- <xsl:apply-templates select="./*[1]"/>
- </xsl:for-each>
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- <m:mo>END</m:mo>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <!-- FIX -->
- <xsl:when test="$name='fix'">
- <xsl:choose>
- <xsl:when test="$charlength >= $framewidth">
- <m:mtable align="baseline 1" equalrows="false" columnalign="left">
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mo>FIX</m:mo>
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- <m:mi><xsl:value-of select="m:ci"/></m:mi>
- <m:mo stretchy="false">{</m:mo>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
- <m:mtable align="baseline 1" equalrows="false" columnalign="left">
- <xsl:for-each select="m:bvar">
- <xsl:variable name="charlength"><xsl:apply-templates select="m:type" mode="charcount"><xsl:with-param name="nosibling" select="1"/></xsl:apply-templates></xsl:variable>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mi><xsl:value-of select="m:ci"/></m:mi>
- <m:mo>:</m:mo>
- <xsl:if test="$framewidth > $charlength">
- <xsl:apply-templates select="m:type"/>
- </xsl:if>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <xsl:if test="$charlength >= $framewidth">
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mphantom><m:mtext>:=</m:mtext></m:mphantom>
- <xsl:apply-templates select="m:type"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- </xsl:if>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mo>:=</m:mo>
- <xsl:apply-templates select="following-sibling::*[position()=1]"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- </xsl:for-each>
- </m:mtable>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mo stretchy="false">}</m:mo>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- </m:mtable>
- </xsl:when>
- <xsl:otherwise>
- <m:mo>FIX</m:mo>
- <m:mi><xsl:value-of select="m:ci"/></m:mi>
- <m:mo stretchy="false">{</m:mo>
- <m:mtable align="baseline 1" equalrows="false" columnalign="left">
- <xsl:for-each select="m:bvar">
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mi><xsl:value-of select="m:ci"/></m:mi>
- <m:mo>:</m:mo>
- <xsl:apply-templates select="m:type"/>
- <m:mo>:=</m:mo>
- <xsl:apply-templates select="following-sibling::*[position() = 1]"/>
- <xsl:if test="position()=last()">
- <m:mo stretchy="false">}</m:mo>
- </xsl:if>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- </xsl:for-each>
- </m:mtable>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <!-- COFIX -->
- <xsl:when test="$name='cofix'">
- <xsl:choose>
- <xsl:when test="$charlength >= $framewidth">
- <m:mtable align="baseline 1" equalrows="false" columnalign="left">
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mo>COFIX</m:mo>
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- <m:mi><xsl:value-of select="m:ci"/></m:mi>
- <m:mo stretchy="false">{</m:mo>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
- <m:mtable align="baseline 1" equalrows="false" columnalign="left">
- <xsl:for-each select="m:bvar">
- <xsl:variable name="charlength"><xsl:apply-templates select="m:type" mode="charcount"><xsl:with-param name="nosibling" select="1"/></xsl:apply-templates></xsl:variable>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mi><xsl:value-of select="m:ci"/></m:mi>
- <m:mo>:</m:mo>
- <xsl:if test="$framewidth > $charlength">
- <xsl:apply-templates select="m:type"/>
- </xsl:if>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <xsl:if test="$charlength >= $framewidth">
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mphantom><m:mtext>:=</m:mtext></m:mphantom>
- <xsl:apply-templates select="m:type"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- </xsl:if>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mo>:=</m:mo>
- <xsl:apply-templates select="following-sibling::*[position() = 1]"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- </xsl:for-each>
- </m:mtable>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mo stretchy="false">}</m:mo>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- </m:mtable>
- </xsl:when>
- <xsl:otherwise>
- <m:mo>COFIX</m:mo>
- <m:mi><xsl:value-of select="m:ci"/></m:mi>
- <m:mo stretchy="false">{</m:mo>
- <m:mtable align="baseline 1" equalrows="false" columnalign="left">
- <xsl:for-each select="m:bvar">
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mi><xsl:value-of select="m:ci"/></m:mi>
- <m:mo>:</m:mo>
- <xsl:apply-templates select="m:type"/>
- <m:mo>:=</m:mo>
- <xsl:apply-templates select="following-sibling::*[position() = 1]"/>
- <xsl:if test="position()=last()">
- <m:mo stretchy="false">}</m:mo>
- </xsl:if>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- </xsl:for-each>
- </m:mtable>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <!-- INST -->
- <xsl:when test="$name='inst'">
- <m:mrow>
- <xsl:if test="$id != ''">
- <xsl:attribute name="xref"><xsl:value-of select="$id"/></xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="*[2]"/>
- <m:mo stretchy="false">{</m:mo>
- <xsl:for-each select="*[(position()>2) and (position() mod 2 = 1)]">
- <xsl:apply-templates select="."/>
- <m:mo stretchy="false">:=</m:mo>
- <xsl:apply-templates select="following-sibling::*[position() = 1]"/>
- </xsl:for-each>
- <m:mo stretchy="false">}</m:mo>
- </m:mrow>
- </xsl:when>
- <!-- APPEND -->
- <xsl:when test="$name='append'">
- <xsl:choose>
- <xsl:when test="$charlength >= $framewidth">
- <m:mtable align="baseline 1" equalrows="false" columnalign="left">
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <xsl:apply-templates select="*[2]"/>
- <m:mo>@</m:mo>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <xsl:apply-templates select="*[3]"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- </m:mtable>
- </xsl:when>
- <xsl:otherwise>
- <m:mrow>
- <xsl:apply-templates select="*[2]"/>
- <m:mo>@</m:mo>
- <xsl:apply-templates select="*[3]"/>
- </m:mrow>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <!-- ITE -->
- <xsl:when test="$name='ite'">
- <xsl:choose>
- <xsl:when test="$charlength >= $framewidth">
- <m:mtable align="baseline 1" equalrows="false" columnalign="left">
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mo>if</m:mo>
- <xsl:apply-templates select="*[2]"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mo>then</m:mo>
- <xsl:apply-templates select="*[3]"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mo>else</m:mo>
- <xsl:apply-templates select="*[4]"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- </m:mtable>
- </xsl:when>
- <xsl:otherwise>
- <m:mrow>
- <m:mo>if</m:mo>
- <xsl:apply-templates select="*[2]"/>
- <m:mo>then</m:mo>
- <xsl:apply-templates select="*[3]"/>
- <m:mo>else</m:mo>
- <xsl:apply-templates select="*[4]"/>
- </m:mrow>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <!-- ***************************************** -->
- <!-- *********** PROOF ELEMENTS ************** -->
- <!-- ***************************************** -->
- <!-- PROOF -->
- <xsl:when test="$name='proof'">
- <!-- CSC: $explodeall until the annotationHelper can handle mactions -->
- <xsl:variable name="test" select="(not($explodeall)) and
- (not(preceding-sibling::*[1]/text()='letin1')) and
- (not(preceding-sibling::*[1]/text()='rw_step')) and
- (not(name(..)='m:lambda'))"/>
- <xsl:variable name="hidden_details">
- <xsl:if test="$test">
- <!-- Details hided (default) -->
- <m:mtable align="baseline 1" equalrows="false" columnalign="left">
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mtext mathcolor="Red">We can prove</m:mtext>
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- <!-- the last child is either the expected type, if provided,-->
- <!-- or the synthesized type. -->
- <xsl:apply-templates select="*[position()=last()]"/>
- <m:mrow>
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- <m:mtext mathcolor="Green">(explain)</m:mtext>
- </m:mrow>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- </m:mtable>
- </xsl:if>
- </xsl:variable>
- <xsl:variable name="shown_details">
- <!-- Show details -->
- <m:mtable align="baseline 1" equalrows="false" columnalign="left">
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <xsl:apply-templates select="*[position()=2]"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <xsl:variable name="hidedetails">
- <m:mrow>
- <m:mphantom>
- <m:mtext>_</m:mtext>
- </m:mphantom>
- <xsl:if test="$test">
- <m:mtext mathcolor="Green">(hide details)</m:mtext>
- </xsl:if>
- </m:mrow>
- </xsl:variable>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mtext mathcolor="Red">we proved</m:mtext>
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- <xsl:apply-templates select="*[position()=3]"/>
- <xsl:if test="not(*[4])">
- <xsl:copy-of select="$hidedetails"/>
- </xsl:if>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <xsl:if test="*[4]">
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mtext mathcolor="Red">that is equivalent to</m:mtext>
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- <xsl:apply-templates select="*[position()=4]"/>
- <xsl:copy-of select="$hidedetails"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- </xsl:if>
- </m:mtable>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$test">
- <m:maction actiontype="toggle">
- <xsl:copy-of select="$hidden_details"/>
- <xsl:copy-of select="$shown_details"/>
- </m:maction>
- </xsl:when>
- <xsl:otherwise>
- <xsl:copy-of select="$shown_details"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <!-- SIDE_PROOF -->
- <xsl:when test="$name='side_proof'">
- <xsl:variable name="test" select="(not($explodeall))"/>
- <xsl:variable name="hidden_details">
- <xsl:if test="$test">
- <!-- Details hided (default) -->
- <m:mtable align="baseline 1" equalrows="false" columnalign="left">
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mtext mathcolor="Red">We can prove</m:mtext>
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- <!-- the last child is either the expected type, if provided,-->
- <!-- or the synthesized type. -->
- <xsl:apply-templates select="*[position()=last()]"/>
- <m:mrow>
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- <m:mtext mathcolor="Green">(explain)</m:mtext>
- </m:mrow>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- </m:mtable>
- </xsl:if>
- </xsl:variable>
- <xsl:variable name="shown_details">
- <!-- Show details -->
- <m:mtable align="baseline 1" equalrows="false" columnalign="left">
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <xsl:apply-templates select="*[position()=2]"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <xsl:variable name="hidedetails">
- <m:mrow>
- <m:mphantom>
- <m:mtext>_</m:mtext>
- </m:mphantom>
- <xsl:if test="$test">
- <m:mtext mathcolor="Green">(hide details)</m:mtext>
- </xsl:if>
- </m:mrow>
- </xsl:variable>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mtext mathcolor="Red">we proved</m:mtext>
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- <xsl:apply-templates select="*[position()=3]"/>
- <xsl:if test="not(*[4])">
- <xsl:copy-of select="$hidedetails"/>
- </xsl:if>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <xsl:if test="*[4]">
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mtext mathcolor="Red">that is equivalent to</m:mtext>
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- <xsl:apply-templates select="*[position()=4]"/>
- <xsl:copy-of select="$hidedetails"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- </xsl:if>
- </m:mtable>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$test">
- <m:maction actiontype="toggle">
- <xsl:copy-of select="$hidden_details"/>
- <xsl:copy-of select="$shown_details"/>
- </m:maction>
- </xsl:when>
- <xsl:otherwise>
- <xsl:copy-of select="$shown_details"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <!-- LETIN1 -->
- <xsl:when test="$name='letin1'">
- <m:mtable align="baseline 1" equalrows="false" columnalign="left">
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <xsl:apply-templates select="*[position()=2]"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <xsl:apply-templates select="*[position()=3]"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- </m:mtable>
- </xsl:when>
- <xsl:when test="$name='by_induction'">
- <m:mtable align="baseline 1" equalrows="false" columnalign="left">
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mtext mathcolor="Red">We prove</m:mtext>
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- <xsl:apply-templates select="../*[3]"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mtext mathcolor="Red">by induction on</m:mtext>
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- <xsl:apply-templates
- select="*[position()=last()]/*[position()=last()]"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mtable align="baseline 1" equalrows="false" columnalign="left">
- <xsl:for-each select="*[position()>3 and not(position()=last())]">
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <xsl:apply-templates select="."/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- </xsl:for-each>
- </m:mtable>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- </m:mtable>
- </xsl:when>
- <!-- inductive_case -->
- <xsl:when test="$name='inductive_case'">
- <m:mtable align="baseline 1" equalrows="false" columnalign="left">
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mtext mathcolor="Red">Case</m:mtext>
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- <xsl:apply-templates select="*[2]"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- <m:mtable align="baseline 1" equalrows="false" columnalign="left">
- <xsl:if test="*[3]/*[position()>1]">
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mtext mathcolor="Red">By induction hypothesis, we have:</m:mtext>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- <xsl:for-each select="*[3]/*[position()>1]">
- <m:mo stretchy="false">(</m:mo>
- <xsl:apply-templates select="m:ci"/>
- <m:mo stretchy="false">) </m:mo>
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- <xsl:apply-templates select="m:type"/>
- </xsl:for-each>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- </xsl:if>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <xsl:apply-templates select="*[4]"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- </m:mtable>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- </m:mtable>
- </xsl:when>
- <!-- case_lhs -->
- <xsl:when test="$name='case_lhs'">
- <m:mrow>
- <xsl:choose>
- <xsl:when test="count(*)=2">
- <xsl:apply-templates select="*[2]"/>
- </xsl:when>
- <xsl:otherwise>
- <m:mo stretchy="false">(</m:mo>
- <xsl:apply-templates select="*[2]"/>
- <xsl:for-each select="m:bvar">
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- <xsl:apply-templates select="*[1]"/>
- <m:mtext>:</m:mtext>
- <xsl:apply-templates select="m:type/*[1]"/>
- </xsl:for-each>
- <m:mo stretchy="false">)</m:mo>
- </xsl:otherwise>
- </xsl:choose>
- </m:mrow>
- </xsl:when>
- <!-- false_ind -->
- <xsl:when test="$name='false_ind'">
- <m:mtable align="baseline 1" equalrows="false" columnalign="left">
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <xsl:apply-templates select="*[3]"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mtext mathcolor="Red">Contradiction.</m:mtext>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- </m:mtable>
- </xsl:when>
- <!-- LET-IN -->
- <xsl:when test="$name='letin'">
- <m:mtable align="baseline 1" equalrows="false" columnalign="left">
- <!-- <xsl:for-each select="APPLY[m:csymbol and (string(m:csymbol)='let')]"> -->
- <xsl:for-each select="*[(last() > position()) and (position()>1)]">
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <xsl:apply-templates select="."/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- </xsl:for-each>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <xsl:apply-templates select="*[position()=last()]"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- </m:mtable>
- </xsl:when>
- <!-- LET -->
- <xsl:when test="$name='let'">
- <m:mtext>(</m:mtext>
- <xsl:apply-templates select="m:ci"/>
- <m:mtext>) </m:mtext>
- <xsl:apply-templates select="*[3]"/>
- </xsl:when>
- <!-- RW_STEP -->
- <xsl:when test="$name='rw_step'">
- <m:mtable align="baseline 1" equalrows="false" columnalign="left">
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <xsl:choose>
- <xsl:when test="name(*[2])='m:apply'">
- <xsl:apply-templates select="*[2]"/>
- </xsl:when>
- <xsl:otherwise>
- <m:mtext>Consider</m:mtext>
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- <xsl:apply-templates select="*[2]"/>
- </xsl:otherwise>
- </xsl:choose>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <xsl:variable name="charlength1">
- <xsl:apply-templates select="*[3]" mode="root_charcount"/>
- </xsl:variable>
- <xsl:variable name="charlength2">
- <xsl:apply-templates select="*[4]" mode="root_charcount"/>
- </xsl:variable>
- <xsl:variable name="charlength3">
- <xsl:apply-templates select="*[5]" mode="root_charcount"/>
- </xsl:variable>
- <xsl:variable name="split1"
- select="($charlength1 + $charlength2) >= $framewidth"/>
- <xsl:variable name="split2"
- select="($charlength2 + $charlength3) >= $framewidth"/>
- <xsl:choose>
- <xsl:when test="$split1">
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mtext>Rewrite</m:mtext>
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- <xsl:apply-templates select="*[3]"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <xsl:choose>
- <xsl:when test="$split2">
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mtext>with</m:mtext>
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- <xsl:apply-templates select="*[4]"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mtext>by</m:mtext>
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- <xsl:apply-templates select="*[5]"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- </xsl:when>
- <xsl:otherwise>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mtext>with</m:mtext>
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- <xsl:apply-templates select="*[4]"/>
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- <m:mtext>by</m:mtext>
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- <xsl:apply-templates select="*[5]"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$split2">
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mtext>Rewrite</m:mtext>
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- <xsl:apply-templates select="*[3]"/>
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- <m:mtext>with</m:mtext>
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- <xsl:apply-templates select="*[4]"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mtext>by</m:mtext>
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- <xsl:apply-templates select="*[5]"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- </xsl:when>
- <xsl:otherwise>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mtext>Rewrite</m:mtext>
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- <xsl:apply-templates select="*[3]"/>
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- <m:mtext>with</m:mtext>
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- <xsl:apply-templates select="*[4]"/>
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- <m:mtext>by</m:mtext>
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- <xsl:apply-templates select="*[5]"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- </xsl:otherwise>
- </xsl:choose>
- </m:mtable>
- </xsl:when>
- <!-- not existing any more
- <xsl:when test="$name='thread'">
- <m:mtable align="baseline 1" equalrows="false" columnalign="left">
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <xsl:choose>
- <xsl:when test="name(*[last()])='m:apply'">
- <xsl:apply-templates select="*[last()]"/>
- </xsl:when>
- <xsl:otherwise>
- <m:mtext>Consider</m:mtext>
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- <xsl:apply-templates select="*[last()]"/>
- </xsl:otherwise>
- </xsl:choose>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <xsl:apply-templates mode="thread" select="*[(last()-2)]"/>
- </m:mtable>
- </xsl:when>
- -->
- <!-- REWRITE_AND_APPLY -->
- <xsl:when test="$name='rewrite_and_apply'">
- <m:mtable align="baseline 1" equalrows="false" columnalign="left">
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <xsl:apply-templates select="*[2]"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mtext>Then apply it to</m:mtext>
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- <xsl:apply-templates select="*[position()>2]"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- </m:mtable>
- </xsl:when>
- <!-- AND_IND -->
- <xsl:when test="$name='and_ind'">
- <m:mtable align="baseline 1" equalrows="false" columnalign="left">
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <xsl:choose>
- <xsl:when test="name(*[2])='m:apply'">
- <xsl:apply-templates select="*[2]"/>
- </xsl:when>
- <xsl:otherwise>
- <m:mtext>Consider</m:mtext>
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- <xsl:apply-templates select="*[2]"/>
- </xsl:otherwise>
- </xsl:choose>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mtext>In particular, we have</m:mtext>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mtext>(</m:mtext>
- <xsl:apply-templates select="*[3]"/>
- <m:mtext>)</m:mtext>
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- <xsl:apply-templates select="*[4]"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mtext>(</m:mtext>
- <xsl:apply-templates select="*[5]"/>
- <m:mtext>)</m:mtext>
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- <xsl:apply-templates select="*[6]"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <xsl:apply-templates select="*[7]"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- </m:mtable>
- </xsl:when>
- <!-- full_or_ind -->
- <xsl:when test="$name='full_or_ind'">
- <m:mtable align="baseline 1" equalrows="false" columnalign="left">
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <xsl:choose>
- <xsl:when test="name(*[2])='m:apply'">
- <xsl:apply-templates select="*[2]"/>
- </xsl:when>
- <xsl:otherwise>
- <m:mtext>Consider</m:mtext>
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- <xsl:apply-templates select="*[2]"/>
- </xsl:otherwise>
- </xsl:choose>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mtext>We proceed by cases to prove</m:mtext>
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- <xsl:apply-templates select="*[3]"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mtext>Left: suppose</m:mtext>
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- <m:mo stretchy="false">(</m:mo>
- <xsl:apply-templates select="*[4]/m:bvar/m:ci"/>
- <m:mo stretchy="false">)</m:mo>
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- <xsl:apply-templates select="*[4]/m:bvar/m:type/*[1]"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- <xsl:apply-templates select="*[4]/*[3]"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mtext>Right: suppose</m:mtext>
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- <m:mo stretchy="false">(</m:mo>
- <xsl:apply-templates select="*[5]/m:bvar/m:ci"/>
- <m:mo stretchy="false">)</m:mo>
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- <xsl:apply-templates select="*[5]/m:bvar/m:type/*[1]"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <xsl:apply-templates select="*[5]/*[3]"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- </m:mtable>
- </xsl:when>
- <!-- OR_IND -->
- <xsl:when test="$name='or_ind'">
- <m:mtable align="baseline 1" equalrows="false" columnalign="left">
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <xsl:choose>
- <xsl:when test="name(*[2])='m:apply'">
- <xsl:apply-templates select="*[2]"/>
- </xsl:when>
- <xsl:otherwise>
- <m:mtext>Consider</m:mtext>
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- <xsl:apply-templates select="*[2]"/>
- </xsl:otherwise>
- </xsl:choose>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mtext>We prove</m:mtext>
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- <xsl:apply-templates select="*[3]"/>
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- <m:mtext>by cases:</m:mtext>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mtext>Left</m:mtext>
- <xsl:apply-templates select="*[4]"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mtext>Right</m:mtext>
- <xsl:apply-templates select="*[5]"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- </m:mtable>
- </xsl:when>
- <!-- EX_IND -->
- <xsl:when test="$name='ex_ind'">
- <m:mtable align="baseline 1" equalrows="false" columnalign="left">
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <xsl:choose>
- <xsl:when test="name(*[2])='m:apply'">
- <xsl:apply-templates select="*[2]"/>
- </xsl:when>
- <xsl:otherwise>
- <m:mtext>Consider</m:mtext>
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- <xsl:apply-templates select="*[2]"/>
- </xsl:otherwise>
- </xsl:choose>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mtext>Let</m:mtext>
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- <xsl:apply-templates select="*[3]"/>
- <m:mtext>:</m:mtext>
- <xsl:apply-templates select="*[4]"/>
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- <m:mtext>such that</m:mtext>
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- <m:mtext>(</m:mtext>
- <xsl:apply-templates select="*[5]"/>
- <m:mtext>)</m:mtext>
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- <xsl:apply-templates select="*[6]"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <xsl:apply-templates select="*[7]"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- </m:mtable>
- </xsl:when>
- <!-- EQ_CHAIN -->
- <xsl:when test="$name='eq_chain'">
- <m:mtable align="baseline 1" equalrows="false" columnalign="left">
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mtext mathcolor="Red">We have the following equality chain:</m:mtext>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <xsl:for-each select="*[position() mod 2 = 0]">
- <xsl:variable name="pos" select="position()"/>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <xsl:choose>
- <xsl:when test="$pos = 1">
- <xsl:apply-templates select="."/>
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- <m:mo>=</m:mo>
- </xsl:when>
- <xsl:otherwise>
- <m:mo>=</m:mo>
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- <xsl:apply-templates select="."/>
- </xsl:otherwise>
- </xsl:choose>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <xsl:if test="$pos != last()">
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
- <xsl:apply-templates select="../*[position()=2*$pos +1]"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- </xsl:if>
- </xsl:for-each>
- </m:mtable>
- </xsl:when>
- <!-- DISEQ_CHAIN -->
- <xsl:when test="$name='diseq_chain'">
- <m:mtable align="baseline 1" equalrows="false" columnalign="left">
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mtext mathcolor="Red">We have the following disequality chain:</m:mtext>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <xsl:for-each select="*[position() mod 3 = 2]">
- <xsl:variable name="pos" select="position()"/>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <xsl:choose>
- <xsl:when test="$pos = 1">
- <xsl:apply-templates select="."/>
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- <mo><xsl:apply-templates select="../*[position()=3*$pos]"/></mo>
- </xsl:when>
- <xsl:otherwise>
- <mo><xsl:apply-templates select="../*[position()=3*($pos - 1)]"/></mo>
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- <xsl:apply-templates select="."/>
- </xsl:otherwise>
- </xsl:choose>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <xsl:if test="$pos != last()">
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
- <xsl:apply-templates select="../*[position()=3*$pos +1]"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- </xsl:if>
- </xsl:for-each>
- </m:mtable>
- </xsl:when>
- <!-- ***************************************** -->
- <!-- *********** NOTATIONS ******************* -->
- <!-- ***************************************** -->
- <!-- subst -->
- <xsl:when test="$name='subst'">
- <xsl:apply-templates select="*[3]"/>
-<!-- no font for ApplyFunction: <m:mo></m:mo> -->
- <m:mo stretchy="false">[</m:mo>
- <xsl:apply-templates select="*[4]"/>
- <m:mo mathcolor="Green">
- <xsl:if test="$id != ''">
- <xsl:attribute name="xref"><xsl:value-of select="$id"/></xsl:attribute>
- </xsl:if>←</m:mo>
- <xsl:apply-templates select="*[2]"/>
- <m:mo stretchy="false">]</m:mo>
- </xsl:when>
- <!-- lift -->
- <xsl:when test="$name='lift'">
- <m:msup>
- <m:mo mathcolor="Green">
- <xsl:if test="$id != ''">
- <xsl:attribute name="xref"><xsl:value-of select="$id"/></xsl:attribute>
- </xsl:if>↑</m:mo>
- <xsl:apply-templates select="*[2]"/>
- </m:msup>
- <m:mrow>
- <m:mo stretchy="false">(</m:mo>
- <xsl:apply-templates select="*[3]"/>
- <m:mo stretchy="false">)</m:mo>
- </m:mrow>
- </xsl:when>
- <!-- lift_with_base -->
- <xsl:when test="$name='lift_with_base'">
- <m:msubsup>
- <m:mo mathcolor="Green">
- <xsl:if test="$id != ''">
- <xsl:attribute name="xref"><xsl:value-of select="$id"/></xsl:attribute>
- </xsl:if>↑</m:mo>
- <xsl:apply-templates select="*[3]"/>
- <xsl:apply-templates select="*[4]"/>
- </m:msubsup>
- <m:mrow>
- <m:mo stretchy="false">(</m:mo>
- <xsl:apply-templates select="*[2]"/>
- <m:mo stretchy="false">)</m:mo>
- </m:mrow>
- </xsl:when>
- <!-- beta_red1 -->
- <xsl:when test="$name='beta_red1'">
- <xsl:apply-templates select="*[2]"/>
- <m:munder>
- <m:mo mathcolor="Green">
- <xsl:if test="$id != ''">
- <xsl:attribute name="xref"><xsl:value-of select="$id"/></xsl:attribute>
- </xsl:if>→</m:mo>
- <m:mi mathcolor="Green">β</m:mi>
- </m:munder>
- <xsl:apply-templates select="*[3]"/>
- </xsl:when>
- <!-- beta_red -->
- <xsl:when test="$name='beta_red'">
- <xsl:apply-templates select="*[2]"/>
- <m:munderover>
- <m:mo mathcolor="Green">
- <xsl:if test="$id != ''">
- <xsl:attribute name="xref"><xsl:value-of select="$id"/></xsl:attribute>
- </xsl:if>→</m:mo>
- <m:mi mathcolor="Green">β</m:mi>
- <m:mi mathcolor="Green">*</m:mi>
- </m:munderover>
- <xsl:apply-templates select="*[3]"/>
- </xsl:when>
- <!-- par_beta_red1 -->
- <xsl:when test="$name='par_beta_red1'">
- <xsl:apply-templates select="*[2]"/>
- <m:munder>
- <m:mo mathcolor="Green">
- <xsl:if test="$id != ''">
- <xsl:attribute name="xref"><xsl:value-of select="$id"/></xsl:attribute>
- </xsl:if>⇒</m:mo>
- <m:mi mathcolor="Green">β</m:mi>
- </m:munder>
- <xsl:apply-templates select="*[3]"/>
- </xsl:when>
- <!-- par_beta_red -->
- <xsl:when test="$name='par_beta_red'">
- <xsl:apply-templates select="*[2]"/>
- <m:munderover>
- <m:mo mathcolor="Green">
- <xsl:if test="$id != ''">
- <xsl:attribute name="xref"><xsl:value-of select="$id"/></xsl:attribute>
- </xsl:if>⇒</m:mo>
- <m:mi mathcolor="Green">β</m:mi>
- <m:mi mathcolor="Green">*</m:mi>
- </m:munderover>
- <xsl:apply-templates select="*[3]"/>
- </xsl:when>
- <!-- forgetful -->
- <xsl:when test="$name='forgetful'">
- <m:mfenced open="|" close="|">
- <xsl:if test="$id != ''">
- <xsl:attribute name="xref"><xsl:value-of select="$id"/></xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="*[2]"/>
- </m:mfenced>
- </xsl:when>
- <!-- isomorphic -->
- <xsl:when test="$name='isomorphic'">
- <xsl:apply-templates select="*[2]"/>
- <m:mo mathcolor="Green">
- <xsl:if test="$id != ''">
- <xsl:attribute name="xref"><xsl:value-of select="$id"/></xsl:attribute>
- </xsl:if>≅</m:mo>
- <xsl:apply-templates select="*[3]"/>
- </xsl:when>
- <!-- interp -->
- <xsl:when test="$name='interp'">
- <m:mfenced open="[" close="]">
- <xsl:if test="$id != ''">
- <xsl:attribute name="xref"><xsl:value-of select="$id"/></xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="*[2]"/>
- </m:mfenced>
- </xsl:when>
-
- <!-- ERROR -->
- <xsl:otherwise>
- <m:mi>ERROR("<xsl:value-of select="$name"/>")</m:mi>
- </xsl:otherwise>
- </xsl:choose>
- </m:mrow>
-</xsl:template>
-
-<!-- Il modo Thread non esiste piu'
-<xsl:template match="*" mode="thread">
- <xsl:variable name="name"><xsl:value-of select="following-sibling::*[position()=1]/m:csymbol"/></xsl:variable>
- <xsl:choose>
- <xsl:when test="$name='rw_step'">
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mtext>Rewrite</m:mtext>
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- <xsl:apply-templates select="following-sibling::*[position()=1]/*[2]"/>
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- <m:mtext>with</m:mtext>
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- <xsl:apply-templates select="following-sibling::*[position()=1]/*[3]"/>
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- <m:mtext>by</m:mtext>
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- <xsl:apply-templates select="following-sibling::*[position()=1]/*[4]"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mtext mathcolor="Red">we get</m:mtext>
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- <xsl:apply-templates select="."/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- </xsl:when>
- <xsl:otherwise>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <xsl:apply-templates select="following-sibling::*[position()=1]"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mtext mathcolor="Red">we get</m:mtext>
- <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
- <xsl:apply-templates select="."/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:apply-templates mode="thread" select="preceding-sibling::*[position()=2]"/>
-</xsl:template>
--->
-
-<!-- LAMBDA -->
-
-<xsl:template match="m:lambda">
- <xsl:variable name="charlength"><xsl:apply-templates select="*[position()=1]" mode="charcount"/></xsl:variable>
- <m:mrow>
- <xsl:if test="@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="$charlength >= $framewidth">
- <m:mtable align="baseline 1" equalrows="false" columnalign="left">
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mo mathcolor="Red">λ</m:mo>
- <xsl:apply-templates select="m:bvar"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mo>.</m:mo>
- <xsl:apply-templates select="*[position()=2]"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- </m:mtable>
- </xsl:when>
- <xsl:otherwise>
- <m:mo mathcolor="Red">λ</m:mo>
- <xsl:apply-templates select="m:bvar/m:ci"/>
- <m:mo>:</m:mo>
- <xsl:apply-templates select="m:bvar/m:type"/>
- <m:mo>.</m:mo>
- <xsl:apply-templates select="*[position()=2]"/>
- </xsl:otherwise>
- </xsl:choose>
- </m:mrow>
-</xsl:template>
-
-
-<!--**********************-->
-<!-- COUNTING -->
-<!--**********************-->
-
-<!-- enter this counting mode selecting the root -->
-<xsl:template match="*" mode="root_charcount">
-<xsl:param name="incurrent_length" select="0"/>
- <xsl:choose>
- <xsl:when test="count(*)=0">
- <xsl:value-of select="0"/>
- </xsl:when>
- <xsl:when test="name()='m:ci'">
- <xsl:value-of select="string-length()"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="*[1]" mode="charcount">
- <xsl:with-param name="incurrent_length" select="$incurrent_length"/>
- </xsl:apply-templates>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match="m:cn|m:and|m:or|m:not|m:exists|m:eq|m:lt|m:leq|m:gt|m:geq
- |m:in|m:notin|m:intersect|m:union|m:subset|m:prsubset|m:card|m:setdiff
- |m:plus|m:minus|m:times" mode="charcount">
-<xsl:param name="incurrent_length" select="0"/>
- <xsl:choose>
- <xsl:when test="$framewidth > ($incurrent_length + 3 + string-length())">
- <xsl:variable name="siblength">
- <xsl:apply-templates select="following-sibling::*[position()=1]" mode="charcount">
- <xsl:with-param name="incurrent_length" select="$incurrent_length + string-length()"/>
- </xsl:apply-templates>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="string($siblength) = """>
- <xsl:value-of select="$incurrent_length + 3 + string-length()"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="number($siblength)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$incurrent_length + 3 + string-length()"/>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match="m:ci|m:csymbol" mode="charcount">
- <xsl:param name="incurrent_length" select="0"/>
- <xsl:param name="nosibling" select="0"/>
- <xsl:variable name="mylength">
- <xsl:choose>
- <!-- special notation -->
- <xsl:when test="text()='append'">3</xsl:when>
- <!-- no notation -->
- <xsl:otherwise>
- <xsl:value-of select="string-length()"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$framewidth > ($incurrent_length + $mylength) and ($nosibling = 0)">
- <xsl:variable name="siblength"><xsl:apply-templates select="following-sibling::*[position()=1]" mode="charcount"><xsl:with-param name="incurrent_length" select="$incurrent_length + $mylength"/></xsl:apply-templates></xsl:variable>
- <xsl:choose>
- <xsl:when test="string($siblength) = """>
- <xsl:value-of select="$incurrent_length + $mylength"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="number($siblength)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$incurrent_length + $mylength"/>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match="*" mode="charcount">
-<xsl:param name="incurrent_length" select="0"/>
-<xsl:param name="nosibling" select="0"/>
- <xsl:choose>
- <xsl:when test="count(child::*) = 0">
- <!-- tremendous bug fixed. An empty element can still have siblings!!! -->
- <xsl:variable name="siblength"><xsl:apply-templates select="following-sibling::*[position()=1]" mode="charcount"><xsl:with-param name="incurrent_length" select="$incurrent_length"/></xsl:apply-templates></xsl:variable>
- <xsl:choose>
- <xsl:when test="string($siblength) = """>
- <xsl:value-of select="$incurrent_length"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="number($siblength)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="childlength"><xsl:apply-templates select="*[position()=1]" mode="charcount"><xsl:with-param name="incurrent_length" select="$incurrent_length"/><xsl:with-param name="nosibling" select="0"/></xsl:apply-templates></xsl:variable>
- <xsl:choose>
- <xsl:when test="$framewidth > number($childlength) and ($nosibling = 0)">
- <xsl:variable name="siblength"><xsl:apply-templates select="following-sibling::*[position()=1]" mode="charcount"><xsl:with-param name="incurrent_length" select="$childlength"/></xsl:apply-templates></xsl:variable>
- <xsl:choose>
- <xsl:when test="string($siblength) = """>
- <xsl:value-of select="number($childlength)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="number($siblength)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="number($childlength)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-</xsl:stylesheet>
-
+++ /dev/null
-<?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/. -->
-
-<!--***********************************************************************-->
-<!-- Notational extensions to the XSLT version 0.07 of MathML content -->
-<!-- to presentation: -->
-<!-- First draft: February 19 2000, Andrea Asperti, Irene Schena -->
-<!-- Revised: March 3 2000, Irene Schena -->
-<!-- Revised: March 15 2000, Claudio Sacerdoti Coen, Irene Schena -->
-<!-- Revised: March 21 2000, Irene Schena -->
-<!--***********************************************************************-->
-
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:m="http://www.w3.org/1998/Math/MathML">
-
-<xsl:import href="mmlctop.xsl"/>
-
-
-<!-- *********************************** -->
-<!-- BASE SET OF MATHML CONTENT ELEMENTS -->
-<!-- *********************************** -->
-
-<!-- Logic -->
-
-<xsl:template match = "m:apply[m:eq[1]]">
- <xsl:variable name="charlength">
- <xsl:apply-templates select="*[1]" mode="charcount"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$charlength >= $framewidth">
- <m:mtable align="baseline 1" equalrows="false" columnalign="left">
- <xsl:if test="@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mo stretchy="false">(</m:mo>
- <xsl:apply-templates select="*[position()=2]"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <xsl:for-each select = "*[position()>2]">
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
- <m:mo>
- <xsl:if test="m:in/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="m:in/@id"/>
- </xsl:attribute>
- </xsl:if>=</m:mo>
- <xsl:apply-templates select="."/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- </xsl:for-each>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mo stretchy="false">)</m:mo>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- </m:mtable>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-imports/>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<!-- apply-imports without parenthesis -->
-<xsl:template match = "m:apply[m:geq[1]|m:leq[1]|m:gt[1]|m:lt[1]|m:in[1]|
- m:subset[1]|m:prsubset[1]]">
- <xsl:variable name="symbol">
- <xsl:choose>
- <xsl:when test="m:geq[1]">
- <xsl:value-of select="'≥'"/>
- </xsl:when>
- <xsl:when test="m:leq[1]">
- <xsl:value-of select="'≤'"/>
- </xsl:when>
- <xsl:when test="m:gt[1]">
- <xsl:value-of select="'>'"/>
- </xsl:when>
- <xsl:when test="m:lt[1]">
- <xsl:value-of select="'< '"/>
- </xsl:when>
- <xsl:when test="m:in[1]">
- <xsl:value-of select="'∈'"/>
- </xsl:when>
- <xsl:when test="m:subset[1]">
- <xsl:value-of select="'⊆'"/>
- </xsl:when>
- <xsl:when test="m:prsubset[1]">
- <xsl:value-of select="'⊂'"/>
- </xsl:when>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="charlength">
- <xsl:apply-templates select="*[1]" mode="charcount"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$charlength >= $framewidth">
- <m:mtable align="baseline 1" equalrows="false" columnalign="left">
- <xsl:if test="@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mo stretchy="false">(</m:mo>
- <xsl:apply-templates select="*[2]"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
- <m:mo>
- <xsl:if test="*[1]/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="*[1]/@id"/>
- </xsl:attribute>
- </xsl:if><xsl:value-of select="$symbol"/></m:mo>
- <xsl:apply-templates select="*[3]"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mo stretchy="false">)</m:mo>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- </m:mtable>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-imports/>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<!-- apply-imports with parenthesis -->
-<xsl:template match = "m:apply[m:and[1]|m:or[1]
- |m:intesect[1]|m:union[1]|m:setdiff[1]]">
- <xsl:variable name="symbol">
- <xsl:choose>
- <xsl:when test="m:and[1]">
- <xsl:value-of select="'∧'"/>
- </xsl:when>
- <xsl:when test="m:or[1]">
- <xsl:value-of select="'∨'"/>
- </xsl:when>
- <xsl:when test="m:intersect[1]">
- <xsl:value-of select="'⋂'"/>
- </xsl:when>
- <xsl:when test="m:union[1]">
- <xsl:value-of select="'⋃'"/>
- </xsl:when>
- <xsl:when test="m:setdiff[1]">
- <xsl:value-of select="'∖'"/>
- </xsl:when>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="charlength">
- <xsl:apply-templates select="*[1]" mode="charcount"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$charlength >= $framewidth">
- <m:mtable align="baseline 1" equalrows="false" columnalign="left">
- <xsl:if test="@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mo stretchy="false">(</m:mo>
- <xsl:apply-templates select="*[position()=2]"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <xsl:for-each select = "*[position()>2]">
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
- <m:mo>
- <xsl:if test="*[1]/@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="*[1]/@id"/>
- </xsl:attribute>
- </xsl:if><xsl:value-of select="$symbol"/></m:mo>
- <xsl:apply-templates select="."/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- </xsl:for-each>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mo stretchy="false">)</m:mo>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- </m:mtable>
- </xsl:when>
- <xsl:otherwise>
-<!-- Added mfenced because apply-imports doesn't support with-param for
- precedence (XSLT 2.0) -->
- <m:mfenced separators=" ">
- <xsl:apply-imports/>
- </m:mfenced>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match = "m:set">
- <xsl:choose>
- <xsl:when test="count(child::*) = 0">
- <m:mi>
- <xsl:if test="@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>∅</m:mi>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="charlength">
- <xsl:apply-templates select="*[1]" mode="charcount"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$charlength >= $framewidth">
- <xsl:choose>
- <xsl:when test="name(*[1]) = 'm:bvar'">
- <m:mtable align="baseline 1" equalrows="false" columnalign="left">
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mo stretchy="false">
- <xsl:if test="@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>{</m:mo>
- <xsl:apply-templates select="*[position()=1]"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mphantom><m:mtext>{</m:mtext></m:mphantom>
- <m:mo stretchy="false">|</m:mo>
- <xsl:apply-templates select="m:condition/*[1]"/>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mo stretchy="false">
- <xsl:if test="@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>}</m:mo>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- </m:mtable>
- </xsl:when>
- <xsl:otherwise>
- <m:mtable align="baseline 1" equalrows="false" columnalign="left">
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mo stretchy="false">
- <xsl:if test="@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>{</m:mo>
- <xsl:apply-templates select="*[position()=1]"/>
- <xsl:if test="position() != last()">
- <mo>,</mo>
- </xsl:if>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- <xsl:for-each select = "*[position()>2]">
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mphantom><m:mtext>{</m:mtext></m:mphantom>
- <xsl:apply-templates select="."/>
- <xsl:if test="position() != last()">
- <mo>,</mo>
- </xsl:if>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- </xsl:for-each>
- <m:mtr>
- <m:mtd>
- <m:mrow>
- <m:mo stretchy="false">
- <xsl:if test="@id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>}</m:mo>
- </m:mrow>
- </m:mtd>
- </m:mtr>
- </m:mtable>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-imports/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match = "m:apply[m:card[1]]">
- <m:mfenced open="|" close="|" stretchy="false">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="*[2]"/>
- </m:mfenced>
-</xsl:template>
-
-
-<xsl:template match = "m:eq[((preceding-sibling::*/text()='eq_chain') or (preceding-sibling::*/text()='diseq_chain'))] | m:neq[((preceding-sibling::*/text()='eq_chain') or (preceding-sibling::*/text()='diseq_chain'))] | m:lt[((preceding-sibling::*/text()='eq_chain') or (preceding-sibling::*/text()='diseq_chain'))] | m:gt[((preceding-sibling::*/text()='eq_chain') or (preceding-sibling::*/text()='diseq_chain'))] | m:leq[((preceding-sibling::*/text()='eq_chain') or (preceding-sibling::*/text()='diseq_chain'))] | m:geq[((preceding-sibling::*/text()='eq_chain') or (preceding-sibling::*/text()='diseq_chain'))]">
- <xsl:choose>
- <xsl:when test="local-name(.) = 'neq'">
- <xsl:value-of select="'≠'"/>
- </xsl:when>
- <xsl:when test="local-name(.) = 'lt'">
- <xsl:value-of select="'< '"/>
- </xsl:when>
- <xsl:when test="local-name(.) = 'gt'">
- <xsl:value-of select="'>'"/>
- </xsl:when>
- <xsl:when test="local-name(.) = 'leq'">
- <xsl:value-of select="'≤'"/>
- </xsl:when>
- <xsl:when test="local-name(.) = 'geq'">
- <xsl:value-of select="'≥'"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="'='"/>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-
-</xsl:stylesheet>
+++ /dev/null
-<?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/. -->
-
-<!--***********************************************************************-->
-<!-- Extension to the XSLT version 0.07 of MathML content to presentation: -->
-<!-- First draft: March 22 2001, Irene 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">
-
-<xsl:template match="type">
- <m:math>
- <xsl:apply-templates select="*[1]"/>
- </m:math>
-</xsl:template>
-
-</xsl:stylesheet>
+++ /dev/null
-<?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/. -->
-
-<!--******************************************************************-->
-<!-- XSLT version 0.1 of CIC objects to objects and MathML content: -->
-<!-- First draft: March 21 2000, Irene Schena -->
-<!--******************************************************************-->
-
-<!--******************************************************************-->
-<!-- MANCA: gestione annotation e linking -->
-<!--******************************************************************-->
-
-<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">
-
-<xsl:import href="content.xsl"/>
-
-<!-- ROOT -->
-
-<xsl:template match="cicxml">
- <xsl:variable name="url"><xsl:value-of select="@baseurl"/></xsl:variable>
- <xsl:variable name="stylesheet"><xsl:value-of select="@stylesheet"/></xsl:variable>
- <!--
- <xsl:processing-instruction name="cocoon-format">type="text/xml"</xsl:processing-instruction>
- <xsl:processing-instruction name="xml-stylesheet">href="<xsl:value-of select='concat($url,$stylesheet)'/>" type="text/xsl"</xsl:processing-instruction>
- <xsl:processing-instruction name="cocoon-process">type="xslt"</xsl:processing-instruction>
- -->
- <xsl:apply-templates select="*[1]"/>
-</xsl:template>
-
-
-<!-- FUNZIONI AUSILIARIE -->
-
-<xsl:template name="name_of_uri_bis">
- <xsl:param name="uri" select=""""/>
- <xsl:variable name="suffix" select="substring-after($uri, "/")"/>
- <xsl:choose>
- <xsl:when test="$suffix = """>
- <xsl:value-of select="substring-before($uri,".var")"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="name_of_uri_bis">
- <xsl:with-param name="uri" select="$suffix"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template name="var_name">
- <xsl:param name="uri"/>
- <xsl:param name="string" select=""""/>
- <xsl:variable name="prefix0" select="substring-before($uri, " ")"/>
- <xsl:variable name="suffix" select="substring-after($uri, " ")"/>
- <xsl:variable name="prefix">
- <xsl:call-template name="name_of_uri_bis">
- <xsl:with-param name="uri" select="$prefix0"/>
- </xsl:call-template>
- </xsl:variable>
- <!--xsl:if test="string($prefix) != " " "-->
- <xsl:variable name="string1" select="concat($string,', ', $prefix)"/>
- <!--/xsl:if-->
- <xsl:choose>
- <xsl:when test="$suffix = """>
- <xsl:value-of select="substring-after(concat($string1, ' '),',')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="var_name">
- <xsl:with-param name="uri" select="$suffix"/>
- <xsl:with-param name="string" select="$string1"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-
-<!-- CIC OBJECTS -->
-
-<xsl:template match="Sequent"> <!-- For Sequents there are no annotations -->
- <Sequent helm:xref="{@id}" no="{@no}">
- <xsl:for-each select="Decl|Def|Hidden">
- <xsl:copy>
- <xsl:attribute name="name">
- <xsl:value-of select="@name"/>
- </xsl:attribute>
- <xsl:attribute name="helm:xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- <xsl:apply-templates select="*[1]"/>
- </xsl:copy>
- </xsl:for-each>
- <Goal>
- <xsl:apply-templates select="Goal/*[1]"/>
- </Goal>
- </Sequent>
-</xsl:template>
-
-<xsl:template match="ConstantType" mode="noannot">
- <xsl:variable name="ConstantBodyUrl"
- select="concat($BaseCICURI,'.body')"/>
- <Definition name="{@name}" helm:xref="{@id}">
- <xsl:if test="string(@params) != """>
- <Params>
- <xsl:call-template name="var_name">
- <xsl:with-param name="uri" select="concat(@params, ' ')"/>
- </xsl:call-template>
- </Params>
- </xsl:if>
-<!-- <xsl:choose>
- <xsl:when test="$showproof=0">
- <body>
- <m:mi>Here</m:mi>
- </body>
- </xsl:when>
- <xsl:otherwise>
- <body>
- <xsl:apply-templates select="body"/>
- </body>
- </xsl:otherwise>
- </xsl:choose> -->
- <body>
- <m:ci definitionURL="{$ConstantBodyUrl}">click here</m:ci>
- </body>
- <type>
- <xsl:apply-templates select="./*[1]"/>
- </type>
- </Definition>
-</xsl:template>
-
-<xsl:template match="ConstantBody" mode= "noannot">
- <Definition name="{@for}" helm:xref="{@id}">
- <xsl:if test="string(@params) != """>
- <Params>
- <xsl:call-template name="var_name">
- <xsl:with-param name="uri" select="concat(@params, ' ')"/>
- </xsl:call-template>
- </Params>
- </xsl:if>
- <body>
- <xsl:apply-templates select="./*[1]"/>
- </body>
- <type>
- <xsl:apply-templates select="document($ConstantTypeUrl)/*[1]/*[1]"/>
- </type>
- </Definition>
-</xsl:template>
-
-
-<xsl:template match="CurrentProof" mode="noannot">
- <CurrentProof name="{@of}" helm:xref="{@id}">
- <xsl:for-each select="Conjecture">
- <Conjecture no="{@no}" helm:xref="{@id}">
- <xsl:for-each select="*">
- <xsl:copy>
- <xsl:copy-of select="@name"/>
- <xsl:attribute name="helm:xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- <xsl:apply-templates select="*"/>
- </xsl:copy>
- </xsl:for-each>
- </Conjecture>
- </xsl:for-each>
- <body>
- <xsl:apply-templates select="body/*[1]"/>
- </body>
- <type>
- <xsl:apply-templates select="document($ConstantTypeUrl)/*[1]/*[1]"/>
- </type>
- </CurrentProof>
-</xsl:template>
-
-<xsl:template match="InductiveDefinition" mode="noannot">
- <InductiveDefinition helm:xref="{@id}">
- <xsl:if test="string(@params) != """>
- <Params>
- <xsl:value-of select="@params"/>
- </Params>
- </xsl:if>
- <xsl:if test="string(@noParams) != 0">
- <xsl:apply-templates select="InductiveType/arity/*[1]" mode="abstparams">
- <xsl:with-param name="noparams" select="@noParams"/>
- </xsl:apply-templates>
- </xsl:if>
- <xsl:for-each select="InductiveType">
- <InductiveType name="{./@name}" inductive="{./@inductive}">
- <arity>
- <xsl:apply-templates select="./arity/*[1]" mode="abstparams">
- <xsl:with-param name="noparams" select="../@noParams"/>
- <xsl:with-param name="target" select="1"/>
- </xsl:apply-templates>
- </arity>
- <xsl:for-each select="./Constructor">
- <Constructor name="{./@name}">
- <xsl:apply-templates select="./*[1]" mode="abstparams">
- <xsl:with-param name="noparams" select="../../@noParams"/>
- <xsl:with-param name="target" select="1"/>
- </xsl:apply-templates>
- </Constructor>
- </xsl:for-each>
- </InductiveType>
- </xsl:for-each>
- </InductiveDefinition>
-</xsl:template>
-
-<xsl:template match="Variable" mode="noannot">
- <Variable name="{@name}" helm:xref="{@id}">
- <xsl:if test="name(*[1])='body'">
- <body>
- <xsl:apply-templates select="body/*[1]"/>
- </body>
- </xsl:if>
- <type>
- <xsl:apply-templates select="type/*[1]"/>
- </type>
- </Variable>
-</xsl:template>
-
-</xsl:stylesheet>
+++ /dev/null
-<?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/. -->
-
-<!--******************************************************************-->
-<!-- XSLT version 0.1 of CIC objects to MathML content of types only: -->
-<!-- First draft: March 9 2001, Irene 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">
-
-<xsl:import href="objcontent.xsl"/>
-<xsl:include href="headercontent.xsl"/>
-<xsl:include href="getter.xsl"/>
-
-<xsl:param name="type" select="'standalone'"/>
-<xsl:param name="getterURL" select="'http://localhost:8081/'"/>
-<xsl:param name="CICURI" select="''"/>
-
-<!-- CIC DEFINITION -->
-
-<xsl:template match="ConstantType">
- <xsl:choose>
- <xsl:when test="$type='typeonly'">
- <type>
- <xsl:apply-templates select="./*[1]" mode="noannot"/>
- </type>
- </xsl:when>
- <xsl:otherwise>
- <Definition name="{@name}" helm:xref="{@id}">
- <xsl:if test="string(@params) != """>
- <Params>
- <xsl:call-template name="var_name">
- <xsl:with-param name="uri" select="concat(@params, ' ')"/>
- </xsl:call-template>
- </Params>
- </xsl:if>
- <body/>
- <type>
- <xsl:apply-templates select="./*[1]" mode="noannot"/>
- </type>
- </Definition>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match="Axiom|CurrentProof|InductiveDefinition|Variable">
- <xsl:apply-templates select="." mode="noannot"/>
-</xsl:template>
-
-<xsl:template match="LAMBDA|LETIN|PROD|CAST|REL|SORT|APPLY|VAR|META|CONST|MUTIND|MUTCONSTRUCT|MUTCASE|FIX|COFIX|instantiate">
- <m:math>
- <xsl:apply-templates select="." mode="noannot"/>
- </m:math>
-</xsl:template>
-
-<xsl:template match="LAMBDA|LETIN|PROD|CAST|REL|SORT|APPLY|VAR|META|CONST|MUTIND|MUTCONSTRUCT|MUTCASE|FIX|COFIX|instantiate" mode="noannot">
- <xsl:apply-templates select="." mode="pure"/>
-</xsl:template>
-
-</xsl:stylesheet>
+++ /dev/null
-<?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/. -->
-
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:m="http://www.w3.org/1998/Math/MathML">
-
-<!--***********************************************************************-->
-<!-- auxiliary functions -->
-<!-- HELM Group: Asperti, Padovani, Sacerdoti, Schena -->
-<!--***********************************************************************-->
-
-<!--***********************************************************************-->
-<!-- get the name from a URI -->
-<!--***********************************************************************-->
-
-<!-- CSC: PROBLEMA: URI CHE NON CONTENGONO / ED INIZIANO CON cic: -->
-<xsl:template name="name_of_uri">
- <xsl:param name="uri" select=""""/>
- <xsl:param name="extension" select="'.con'"/>
- <xsl:variable name="suffix" select="substring-after($uri, "/")"/>
- <xsl:choose>
- <xsl:when test="$suffix = """>
- <!-- CSC: PROBLEMA: .con PUO' APPARIRE ALL'INTERNO DELLE URI ===>
- SCRIVERE UNA FUNZIONE RICORSIVA CHE RISOLVA -->
- <xsl:value-of select="substring-before($uri,$extension)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="name_of_uri">
- <xsl:with-param name="uri" select="$suffix"/>
- <xsl:with-param name="extension" select="$extension"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<!--***********************************************************************-->
-<!-- erase common prefix from two uris -->
-<!--***********************************************************************-->
-
-<xsl:template name="common_prefix">
- <xsl:param name="first_uri" select=""""/>
- <xsl:param name="second_uri" select=""""/>
- <xsl:choose>
- <xsl:when test="(substring-before($first_uri,"/") =
- substring-before($second_uri,"/") and
- substring-after($second_uri,"/") != "")">
- <xsl:call-template name="common_prefix">
- <xsl:with-param
- name="first_uri" select="substring-after($first_uri,"/")"/>
- <xsl:with-param
- name="second_uri" select="substring-after($second_uri,"/")"/> </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="slash_counting">
- <xsl:with-param name="uri" select="$second_uri"/>
- <xsl:with-param name="counter" select="0"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template name="slash_counting">
- <xsl:param name="uri" select=""""/>
- <xsl:param name="counter" select="0"/>
- <xsl:choose>
- <xsl:when test="(substring-after($uri,"/") != "")">
- <xsl:call-template name="slash_counting">
- <xsl:with-param
- name="uri" select="substring-after($uri,"/")"/>
- <xsl:with-param
- name="counter" select="$counter +1"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$counter"/>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<!-- path gives the path of a uri, up to the final name -->
-<xsl:template name="path">
- <xsl:param name="uri" select=""""/>
- <xsl:param name="current_path" select=""""/>
- <xsl:choose>
- <xsl:when test="(substring-after($uri,"/") != "")">
- <xsl:call-template name="path">
- <xsl:with-param
- name="uri" select="substring-after($uri,"/")"/>
- <xsl:with-param
- name="current_path" select="concat($current_path,substring-before($uri,"/"),'/')"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$current_path"/>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template name="blank_counting">
- <xsl:param name="string" select=""""/>
- <xsl:param name="counter" select="0"/>
- <xsl:choose>
- <xsl:when test="(substring-after($string," ") != "")">
- <xsl:call-template name="blank_counting">
- <xsl:with-param
- name="string" select="substring-after($string," ")"/>
- <xsl:with-param
- name="counter" select="$counter +1"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$counter + 1"/>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template name="double_point_counting">
- <xsl:param name="string" select=""""/>
- <xsl:param name="counter" select="0"/>
- <xsl:choose>
- <xsl:when test="(substring-after($string,":") != "")">
- <xsl:call-template name="double_point_counting">
- <xsl:with-param
- name="string" select="substring-after($string,":")"/>
- <xsl:with-param
- name="counter" select="$counter +1"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$counter"/>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template name="min">
- <xsl:param name="string" select=""""/>
- <xsl:param name="counter" select="0"/>
- <xsl:choose>
- <xsl:when test="contains($string,concat($counter,":"))
- or (0 > $counter)">
- <xsl:value-of select="$counter"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="min">
- <xsl:with-param
- name="string" select="$string"/>
- <xsl:with-param
- name="counter" select="$counter -1"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template name="get_no_params">
- <xsl:param name="first_uri" select=""""/>
- <xsl:param name="second_uri" select=""""/>
- <xsl:variable name="offset">
- <xsl:call-template name="common_prefix">
- <xsl:with-param name="first_uri" select="$first_uri"/>
- <xsl:with-param name="second_uri" select="$second_uri"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$offset > 0">
- <xsl:variable name="params">
- <xsl:variable name="second_url"><xsl:call-template name="URLofURI4getter"><xsl:with-param name="uri" select="$second_uri"/></xsl:call-template></xsl:variable>
- <xsl:value-of
- select="document($second_url)/*/@params"/>
- </xsl:variable>
- <xsl:variable name="minimum">
- <xsl:call-template name="min">
- <xsl:with-param name="string" select="$params"/>
- <xsl:with-param name="counter" select="$offset - 1"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="0 > $minimum">
- 0
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="relevant_params">
- <!-- the blank after : in the next line is essential -->
- <xsl:value-of
- select="substring-after($params,concat($minimum,": "))"/>
- </xsl:variable>
- <xsl:variable name="tokens">
- <xsl:call-template name="blank_counting">
- <xsl:with-param name="string" select="$relevant_params"/>
- <xsl:with-param name="counter" select="0"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="separators">
- <xsl:call-template name="double_point_counting">
- <xsl:with-param name="string" select="$relevant_params"/>
- <xsl:with-param name="counter" select="0"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:value-of select="$tokens - $separators"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- 0
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-
-<!--***********************************************************************-->
-<!-- Insert a subscript if there is a number at the end of a ci element -->
-<!--***********************************************************************-->
-
-<xsl:template name="insert_subscript">
-<xsl:param name="node_value" select=""""/>
-<xsl:param name="current_pos" select="1"/>
-<xsl:param name="start_pos" select="0"/>
- <xsl:choose>
- <xsl:when test="$current_pos <= string-length(string($node_value))">
- <xsl:variable name="current_char"><xsl:value-of select="substring(string($node_value),$current_pos,1)"/></xsl:variable>
- <xsl:choose>
- <xsl:when test="(string($current_char) != "0") and (string($current_char) != "1") and (string($current_char) != "2") and (string($current_char) != "3") and (string($current_char) != "4") and (string($current_char) != "5") and (string($current_char) != "6") and (string($current_char) != "7") and (string($current_char) != "8") and (string($current_char) != "9")">
- <xsl:choose>
- <xsl:when test="$start_pos != 0">
- <xsl:call-template name="insert_subscript"><xsl:with-param name="node_value" select="$node_value"/><xsl:with-param name="current_pos" select="$current_pos + 1"/><xsl:with-param name="start_pos" select="0"/></xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="insert_subscript"><xsl:with-param name="node_value" select="$node_value"/><xsl:with-param name="current_pos" select="$current_pos + 1"/><xsl:with-param name="start_pos" select="$start_pos"/></xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="$start_pos = 0">
- <xsl:call-template name="insert_subscript"><xsl:with-param name="node_value" select="$node_value"/><xsl:with-param name="current_pos" select="$current_pos + 1"/><xsl:with-param name="start_pos" select="$current_pos"/></xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="insert_subscript"><xsl:with-param name="node_value" select="$node_value"/><xsl:with-param name="current_pos" select="$current_pos + 1"/><xsl:with-param name="start_pos" select="$start_pos"/></xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="$start_pos != 0">
- <m:msub>
- <m:mi><xsl:value-of select="substring(string($node_value),1,$start_pos -1)"/></m:mi>
- <m:mn><xsl:value-of select="substring(string($node_value),$start_pos)"/></m:mn>
- </m:msub>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$node_value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-
-<!--*******************************************-->
-<!-- ABSTRACTING PARAMETERS AND COUNTING -->
-<!--*******************************************-->
-<!-- Si dimentica i CAST dei termini che astrae. Nel caso dell'astrazione -->
-<!-- dei lambda dei pattern del CASE, qualora i lambda non si trovino -->
-<!-- nella forma weak-head, astrae solo i lambda che trova e restituisce -->
-<!-- un corpo depurato da tutti i primi cast che precedono il termine -->
-<!-- restituito. -->
-
-<xsl:template match="*" mode="abstparams">
-<xsl:param name="noparams" select="0"/>
-<xsl:param name="target" select="0"/>
-<xsl:param name="binder">PROD</xsl:param>
- <xsl:choose>
- <xsl:when test="($noparams != 0) and ((name(.)=string($binder)) or (name(.)="CAST"))">
- <xsl:choose>
- <xsl:when test="name(.) = string($binder)">
- <xsl:choose>
- <xsl:when test="$noparams >= count(decl)">
- <xsl:for-each select="decl">
- <xsl:if test="$target = 0">
- <xsl:choose>
- <xsl:when test="string($binder) = "LAMBDA"">
- <m:ci>
- <xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="@binder"/></xsl:with-param></xsl:call-template>
- </m:ci>
- </xsl:when>
- <xsl:otherwise>
- <Param name="{@binder}">
- <xsl:apply-templates select="*[1]"/>
- </Param>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </xsl:for-each>
- <xsl:apply-templates select="target/*[1]" mode="abstparams">
- <xsl:with-param name="noparams" select="$noparams - count(decl)"/>
- <xsl:with-param name="target" select="$target"/>
- <xsl:with-param name="binder" select="$binder"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <xsl:for-each select="decl[$noparams >= position()]">
- <xsl:if test="$target = 0">
- <xsl:choose>
- <xsl:when test="string($binder) = "LAMBDA"">
- <m:ci>
- <xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="@binder"/></xsl:with-param></xsl:call-template>
- </m:ci>
- </xsl:when>
- <xsl:otherwise>
- <Param name="{@binder}">
- <xsl:apply-templates select="*[1]"/>
- </Param>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </xsl:for-each>
- <xsl:if test="$target = 1">
- <xsl:choose>
- <xsl:when test="name(.)="PROD"">
- <xsl:apply-templates select="decl[position()=$noparams+1]" mode="prod"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="decl[position()=$noparams+1]" mode="lambda_prop"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="term/*[1]" mode="abstparams">
- <xsl:with-param name="noparams" select="$noparams"/>
- <xsl:with-param name="target" select="$target"/>
- <xsl:with-param name="binder" select="$binder"/>
- </xsl:apply-templates>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="($target = 1) and ($noparams != 0)">
- <m:apply>
- <m:csymbol>app</m:csymbol>
-<!-- Mancava modalita': sono all'interno di un termine -->
- <xsl:apply-templates select="." mode="pure"/>
- <xsl:call-template name="printparam"><xsl:with-param name="noleft" select="$noparams"/></xsl:call-template>
- </m:apply>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="$noparams != 0">
- <xsl:call-template name="printparam"><xsl:with-param name="noleft" select="$noparams"/></xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:if test="$target = 1">
-<!-- Mancava modalita': con target=1 posso provenire sia da un oggetto che da un termine -->
- <xsl:choose>
- <xsl:when test="string($binder) = "LAMBDA"">
- <!-- CSC: era pure, ma deve essere noannot. Giusto, Irene? -->
- <xsl:apply-templates select="." mode="noannot"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="."/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template name="printparam">
-<xsl:param name="noleft" select="0"/>
-<xsl:param name="number" select="1"/>
- <xsl:if test="$noleft != 0">
- <m:ci><xsl:call-template name="insert_subscript"><xsl:with-param name="node_value">$<xsl:value-of select="$number"/></xsl:with-param></xsl:call-template></m:ci>
- <xsl:call-template name="printparam"><xsl:with-param name="noleft" select="$noleft - 1"/><xsl:with-param name="number" select="$number + 1"/></xsl:call-template>
- </xsl:if>
-</xsl:template>
-
-<xsl:template match="*" mode="counting">
-<xsl:param name="noparams" select="0"/>
-<xsl:param name="count" select="0"/>
- <xsl:choose>
- <xsl:when test="name(.) = "PROD"">
- <xsl:apply-templates select="target/*[1]" mode="counting">
- <xsl:with-param name="noparams" select="$noparams"/>
- <xsl:with-param name="count" select="$count + count(decl)"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:when test="name(.) = "CAST"">
- <xsl:apply-templates select="term/*[1]" mode="counting">
- <xsl:with-param name="noparams" select="$noparams"/>
- <xsl:with-param name="count" select="$count"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$count - $noparams"/>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-</xsl:stylesheet>
+++ /dev/null
-<?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 Logic -->
-<!-- (completely) Revisited: february 2001, Andrea Asperti -->
-<!-- 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">
-
-<xsl:include href="logic.xsl"/>
-<xsl:include href="inductive.xsl"/>
-<xsl:include href="rewrite.xsl"/>
-<xsl:include href="diseq.xsl"/>
-
-<!-- ************************* LOGIC *********************************-->
-
-<!-- Proof objects -->
-
-<xsl:key name="typeid" use="@of" match="TYPE"/>
-
-<!-- These elements do not have inner type -->
-<xsl:template match="PROD|SORT|MUTIND|instantiate" mode="noannot">
- <xsl:apply-templates select="." mode="pure"/>
-</xsl:template>
-
-<!-- Atomic elements that have an inner type iff the expected type -->
-<!-- is different from the synthesized type. -->
-<xsl:template match="REL|VAR|META|CONST|MUTCONSTRUCT" mode="noannot">
- <xsl:variable name="id" select="@id"/>
- <xsl:variable name="innertype_available">
- <xsl:for-each select="$InnerTypes">
- <xsl:if test="key('typeid',$id)/*">
- <xsl:text>yes</xsl:text>
- </xsl:if>
- </xsl:for-each>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$naturalLanguage='yes' and @sort='Prop' and $innertype_available='yes'">
- <!--xsl:when test="@sort='Prop'"-->
- <m:apply helm:xref="{@id}">
- <m:csymbol>proof</m:csymbol>
- <xsl:apply-templates mode="proof_transform" select="."/>
- <xsl:for-each select="$InnerTypes">
- <xsl:apply-templates mode="pure" select="key('typeid',$id)/*"/>
- </xsl:for-each>
- </m:apply>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="." mode="pure"/>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<!-- ALL ELEMENTS WITH A TYPE ARE TRANSLATED AS A PROOF-ELEMENT -->
-
-<xsl:template match="LAMBDA" mode="noannot">
- <xsl:choose>
- <xsl:when test="@sort='Prop'">
- <xsl:apply-templates select="*[1]" mode="lambda_prop"/>
- </xsl:when>
- <xsl:otherwise>
- <!-- mode lambda is defined in content.xsl -->
- <xsl:apply-templates select="*[1]" mode="lambda"/>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match="decl" mode="lambda_prop">
- <xsl:variable name="id" select="@id"/>
- <xsl:variable name="innertype_available">
- <xsl:for-each select="$InnerTypes">
- <xsl:if test="key('typeid',$id)/*">
- <xsl:text>yes</xsl:text>
- </xsl:if>
- </xsl:for-each>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$naturalLanguage='yes' and $innertype_available='yes'">
- <m:apply helm:xref="{@id}">
- <m:csymbol>proof</m:csymbol>
- <m:lambda helm:xref="{@id}">
- <m:bvar>
- <m:ci>
- <xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="@binder"/></xsl:with-param></xsl:call-template>
- </m:ci>
- <m:type>
- <xsl:apply-templates select="*[1]" mode="noannot"/>
- </m:type>
- </m:bvar>
- <xsl:apply-templates select="following-sibling::*[1]" mode="lambda_prop"/>
- </m:lambda>
- <xsl:for-each select="$InnerTypes">
- <xsl:apply-templates mode="pure" select="key('typeid',$id)/*"/>
- </xsl:for-each>
- </m:apply>
- </xsl:when>
- <xsl:otherwise>
- <m:lambda helm:xref="{@id}">
- <m:bvar>
- <m:ci>
- <xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="@binder"/></xsl:with-param></xsl:call-template>
- </m:ci>
- <m:type>
- <xsl:apply-templates select="*[1]" mode="noannot"/>
- </m:type>
- </m:bvar>
- <xsl:apply-templates select="following-sibling::*[1]" mode="lambda_prop"/>
- </m:lambda>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match="target" mode="lambda_prop">
- <xsl:apply-templates select="*[1]" mode="noannot"/>
-</xsl:template>
-
-<!-- LETIN -->
-
-<xsl:template match="LETIN" mode="noannot">
- <xsl:choose>
- <xsl:when test="@sort='Prop'">
- <xsl:apply-templates select="*[1]" mode="letin_prop"/>
- </xsl:when>
- <xsl:otherwise>
- <!-- mode letin is defined in content.xsl -->
- <xsl:apply-templates select="*[1]" mode="letin_pure"/>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match="def" mode="letin_prop">
- <xsl:variable name="id" select="@id"/>
- <xsl:variable name="innertype_available">
- <xsl:for-each select="$InnerTypes">
- <xsl:if test="key('typeid',$id)/*">
- <xsl:text>yes</xsl:text>
- </xsl:if>
- </xsl:for-each>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$naturalLanguage='yes' and $innertype_available='yes'">
- <m:apply helm:xref="{@id}">
- <m:csymbol>proof</m:csymbol>
- <m:apply helm:xref="{@id}">
- <m:csymbol>let_in</m:csymbol>
- <m:bvar>
- <m:ci>
- <xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="@binder"/></xsl:with-param></xsl:call-template>
- </m:ci>
- </m:bvar>
- <xsl:apply-templates select="*[1]" mode="noannot"/>
- <xsl:apply-templates select="following-sibling::*[1]" mode="letin_prop"/>
- </m:apply>
- <xsl:for-each select="$InnerTypes">
- <xsl:apply-templates mode="pure" select="key('typeid',$id)/*"/>
- </xsl:for-each>
- </m:apply>
- </xsl:when>
- <xsl:otherwise>
- <m:apply helm:xref="{@id}">
- <m:csymbol>let_in</m:csymbol>
- <m:bvar>
- <m:ci>
- <xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="@binder"/></xsl:with-param></xsl:call-template>
- </m:ci>
- </m:bvar>
- <xsl:apply-templates select="*[1]" mode="noannot"/>
- <xsl:apply-templates select="following-sibling::*[1]" mode="letin_prop"/>
- </m:apply>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match="target" mode="letin_prop">
- <xsl:apply-templates select="*[1]" mode="noannot"/>
-</xsl:template>
-
-<!-- ALL these elements have inner type -->
-<xsl:template match="CAST|APPLY|MUTCASE|FIX|COFIX" mode="noannot">
- <xsl:variable name="id" select="@id"/>
- <xsl:choose>
- <xsl:when test="$naturalLanguage='yes' and @sort='Prop'">
- <m:apply helm:xref="{@id}">
- <m:csymbol>proof</m:csymbol>
- <xsl:apply-templates mode="proof_transform" select="."/>
- <xsl:for-each select="$InnerTypes">
- <xsl:apply-templates mode="pure" select="key('typeid',$id)/*"/>
- </xsl:for-each>
- </m:apply>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="name()='APPLY'">
- <!-- This is the case of an applicative expression wich is not
- a proof but could contains proofs...
- MODE LETIN OR MODE PURE ??? Big question -->
- <xsl:apply-templates select="." mode="pure"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="." mode="pure"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template mode="proof_transform" match="*">
- <xsl:choose>
- <xsl:when test="name()='APPLY'">
- <xsl:variable name="id" select="@id"/>
- <xsl:choose>
- <xsl:when test="name(*[1])='CONST' or
- (name(*[1])='instantiate' and name(*[1]/*[1])='CONST')">
- <xsl:apply-templates mode="try_inductive" select="."/>
- </xsl:when>
- <!-- patch temporanea per la gestione di redex -->
- <xsl:when test="name(*[1])='LAMBDA' and count(child::*)=2">
- <!-- old
- and *[2]/@sort='Prop'"> -->
- <m:apply helm:xref="{@id}">
- <m:csymbol>let_in</m:csymbol>
- <m:bvar>
- <m:ci>
- <xsl:call-template name="insert_subscript">
- <xsl:with-param name="node_value">
- <xsl:value-of select="*[1]/*[1]/@binder"/>
- </xsl:with-param>
- </xsl:call-template>
- </m:ci>
- </m:bvar>
- <xsl:apply-templates mode="noannot" select="*[2]"/>
- <xsl:apply-templates mode="lambda_prop" select="*[1]/*[2]"/>
- </m:apply>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="." mode="letin"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="." mode="pure"/>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template name="is_simple">
- <xsl:param name="proof" select="/.."/>
- <xsl:value-of select="(count($proof/*)=0) or ((name($proof)='APPLY') and (count($proof/*[@sort='Prop' and (name(.)='LAMBDA' or name(.)='LETIN' or name(.)='APPLY' or name(.)='MUTCASE' or name(.)='FIX' or name(.)='COFIX')]) = 0))"/>
-</xsl:template>
-
-<xsl:template name="generate_side_proof">
- <xsl:param name="proof" select="/.."/>
- <xsl:param name="show_statement" select="1"/>
-<!--
- <xsl:variable name="is_simple">
- <xsl:call-template name="is_simple">
- <xsl:with-param name="proof" select="$proof"/>
- </xsl:call-template>
- </xsl:variable> -->
-<xsl:variable name="is_simple" select="(count($proof/*)=0) or ((name($proof)='APPLY') and (count($proof/*[@sort='Prop' and (name(.)='LAMBDA' or name(.)='LETIN' or name(.)='APPLY' or name(.)='MUTCASE' or name(.)='FIX' or name(.)='COFIX')]) = 0))"/>
- <xsl:choose>
- <xsl:when test="$is_simple">
- <xsl:choose>
- <xsl:when test="name($proof)='APPLY'">
- <xsl:apply-templates select="$proof" mode="letin"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="$proof" mode="pure"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="id" select="@id"/>
- <m:apply helm:xref="{@id}">
- <xsl:choose>
- <xsl:when test="$show_statement = 1">
- <m:csymbol>proof</m:csymbol>
- </xsl:when>
- <xsl:otherwise>
- <m:csymbol>side_proof</m:csymbol>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:apply-templates mode="proof_transform" select="$proof"/>
- <xsl:for-each select="$InnerTypes">
- <xsl:apply-templates mode="pure" select="key('typeid',$proof/@id)/*"/>
- </xsl:for-each>
- </m:apply>
- <!-- <xsl:apply-templates select="$proof" mode="noannot"/> -->
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match="APPLY" mode="letin">
- <xsl:variable name="no_subproofs">
- <xsl:variable name="stars">
- <xsl:for-each select="*[@sort='Prop']">
- <xsl:variable name="id" select="@id"/>
- <xsl:variable name="innertype_available">
- <xsl:for-each select="$InnerTypes">
- <xsl:if test="key('typeid',$id)/*">
- <xsl:text>yes</xsl:text>
- </xsl:if>
- </xsl:for-each>
- </xsl:variable>
- <xsl:if test="name(.)='LAMBDA' or name(.)='LETIN' or name(.)='APPLY' or name(.)='MUTCASE' or name(.)='FIX' or name(.)='COFIX' or ((name(.)='REL' or name(.)='VAR' or name(.)='META' or name(.)='CONST' or name(.)='MUTCONSTRUCT') and $innertype_available='yes')">
- <!-- We generate one star for each subproof -->
- <xsl:text>*</xsl:text>
- </xsl:if>
- </xsl:for-each>
- </xsl:variable>
- <xsl:value-of select="string-length($stars)"/>
- </xsl:variable>
- <!-- <m:cn><xsl:value-of select="$no_subproofs"/></m:cn> -->
- <xsl:choose>
- <xsl:when test="$naturalLanguage='yes' and ($no_subproofs = 1)">
- <m:apply helm:xref="{@id}">
- <m:csymbol>letin1</m:csymbol>
- <xsl:for-each select="*[@sort='Prop']">
- <xsl:variable name="id" select="@id"/>
- <xsl:variable name="innertype_available">
- <xsl:for-each select="$InnerTypes">
- <xsl:if test="key('typeid',$id)/*">
- <xsl:text>yes</xsl:text>
- </xsl:if>
- </xsl:for-each>
- </xsl:variable>
- <xsl:if test="name(.)='LAMBDA' or name(.)='LETIN' or name(.)='APPLY' or name(.)='MUTCASE' or name(.)='FIX' or name(.)='COFIX' or ((name(.)='REL' or name(.)='VAR' or name(.)='META' or name(.)='CONST' or name(.)='MUTCONSTRUCT') and $innertype_available='yes')">
- <xsl:apply-templates mode="noannot" select="."/>
- </xsl:if>
- </xsl:for-each>
- <!-- now re-process the application -->
- <m:apply helm:xref="{@id}">
- <m:csymbol>app</m:csymbol>
- <!-- mode previous looks for siblings:
- call with the first child -->
- <xsl:apply-templates mode="previous" select="*[1]"/>
- </m:apply>
- </m:apply>
- </xsl:when>
- <xsl:when test="$naturalLanguage='yes' and ($no_subproofs > 1)">
- <m:apply helm:xref="{@id}">
- <m:csymbol>letin</m:csymbol>
- <!-- first process all subproofs (let-in) -->
- <xsl:call-template name="gen_let"/>
- <!-- now re-process the application -->
- <m:apply helm:xref="{@id}">
- <m:csymbol>app</m:csymbol>
- <!-- mode flat looks for siblings: call with the first child -->
- <xsl:apply-templates mode="flat" select="*[1]"/>
- </m:apply>
- </m:apply>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="@sort='Prop'">
- <m:apply>
- <m:csymbol>app</m:csymbol>
- <xsl:apply-templates mode="erase" select="*[1]"/>
- </m:apply>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates mode="pure" select="."/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template name="gen_let">
- <xsl:param name="init_pos" select="1"/>
- <xsl:param name="from" select="0"/>
- <xsl:apply-templates mode="gen_let_aux" select="*[position() = ($from+1)]">
- <xsl:with-param name="init_pos" select="$init_pos"/>
- </xsl:apply-templates>
-</xsl:template>
-
-<xsl:template mode="gen_let_aux" match="*">
- <xsl:param name="init_pos" select="1"/>
- <xsl:variable name="id" select="@id"/>
- <xsl:variable name="innertype_available">
- <xsl:for-each select="$InnerTypes">
- <xsl:if test="key('typeid',$id)/*">
- <xsl:text>yes</xsl:text>
- </xsl:if>
- </xsl:for-each>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="@sort='Prop' and (name(.)='LAMBDA' or name(.)='LETIN' or name(.)='APPLY' or name(.)='MUTCASE' or name(.)='FIX' or name(.)='COFIX' or ((name(.)='REL' or name(.)='VAR' or name(.)='META' or name(.)='CONST' or name(.)='MUTCONSTRUCT') and $innertype_available='yes'))">
- <m:apply>
- <m:csymbol>let</m:csymbol>
- <m:ci><xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="concat('h',$init_pos)"/></xsl:with-param></xsl:call-template></m:ci>
- <xsl:apply-templates mode="noannot" select="."/>
- </m:apply>
- <xsl:if test="following-sibling::*[1]">
- <xsl:apply-templates mode="gen_let_aux" select="following-sibling::*[1]">
- <xsl:with-param name="init_pos" select="$init_pos+1"/>
- </xsl:apply-templates>
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- <xsl:if test="following-sibling::*[1]">
- <xsl:apply-templates mode="gen_let_aux" select="following-sibling::*[1]">
- <xsl:with-param name="init_pos" select="$init_pos"/>
- </xsl:apply-templates>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<!-- questa vecchia versione (di Claudio??) sembra bacata come un melone.
-
-<xsl:template name="gen_let">
- <xsl:param name="init_pos" select="0"/>
- <xsl:param name="from" select="0"/>
- <xsl:for-each select="*[position()>$from and @sort='Prop']">
- <xsl:variable name="id" select="@id"/>
- <xsl:variable name="innertype_available">
- <xsl:for-each select="$InnerTypes">
- <xsl:if test="key('typeid',$id)/*">
- <xsl:text>yes</xsl:text>
- </xsl:if>
- </xsl:for-each>
- </xsl:variable>
- <xsl:if test="name(.)='LAMBDA' or name(.)='LETIN' or name(.)='APPLY' or name(.)='MUTCASE' or name(.)='FIX' or name(.)='COFIX' or ((name(.)='REL' or name(.)='VAR' or name(.)='META' or name(.)='CONST' or name(.)='MUTCONSTRUCT') and $innertype_available='yes')">
- <m:apply>
- <m:csymbol>let</m:csymbol>
- <m:ci><xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="concat('h',position()+$init_pos)"/></xsl:with-param></xsl:call-template></m:ci>
- <xsl:apply-templates mode="noannot" select="."/>
- </m:apply>
- </xsl:if>
- </xsl:for-each>
-</xsl:template> -->
-
-<xsl:template match="*" mode="erase">
- <xsl:choose>
- <xsl:when test="@sort='Prop'
- or name()='instantiate' or $naturalLanguage='no'">
- <xsl:apply-templates mode="pure" select="."/>
- </xsl:when>
- <xsl:otherwise>
- <m:ci>.</m:ci>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:apply-templates mode="erase" select="following-sibling::*[1]"/>
-</xsl:template>
-
-<xsl:template match="*" mode="previous">
- <xsl:variable name="innertype_available">
- <xsl:variable name="id" select="@id"/>
- <xsl:for-each select="$InnerTypes">
- <xsl:if test="key('typeid',$id)/*">
- <xsl:text>yes</xsl:text>
- </xsl:if>
- </xsl:for-each>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="@sort='Prop' and (name(.)='LAMBDA' or name(.)='LETIN' or name(.)='APPLY' or name(.)='MUTCASE' or name(.)='FIX' or name(.)='COFIX' or ((name(.)='REL' or name(.)='VAR' or name(.)='META' or name(.)='CONST' or name(.)='MUTCONSTRUCT') and $innertype_available='yes'))">
- <m:ci>previous</m:ci>
- </xsl:when>
- <xsl:otherwise>
- <!-- forse bisognerebbe trattare solo l'elemento di testa -->
- <xsl:choose>
- <xsl:when test="@sort='Prop'
- or name()='instantiate' or $naturalLanguage='no'">
- <xsl:apply-templates mode="pure" select="."/>
- </xsl:when>
- <xsl:otherwise>
- <m:ci>.</m:ci>
- </xsl:otherwise>
- </xsl:choose>
- <!-- <xsl:apply-templates select="." mode="pure"/> -->
- </xsl:otherwise>
- </xsl:choose>
- <xsl:apply-templates mode="previous" select="following-sibling::*[1]"/>
-</xsl:template>
-
-<xsl:template match="*" mode="flat">
- <xsl:param name="n" select="1"/>
- <xsl:variable name="id" select="@id"/>
- <xsl:variable name="innertype_available">
- <xsl:for-each select="$InnerTypes">
- <xsl:if test="key('typeid',$id)/*">
- <xsl:text>yes</xsl:text>
- </xsl:if>
- </xsl:for-each>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$naturalLanguage='yes' and @sort='Prop' and (name(.)='LAMBDA' or name(.)='LETIN' or name(.)='APPLY' or name(.)='MUTCASE' or name(.)='FIX' or name(.)='COFIX' or ((name(.)='REL' or name(.)='VAR' or name(.)='META' or name(.)='CONST' or name(.)='MUTCONSTRUCT') and $innertype_available='yes'))">
- <m:ci>
- <xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="concat('h',$n)"/></xsl:with-param></xsl:call-template>
- </m:ci>
- <xsl:apply-templates mode="flat" select="following-sibling::*[1]">
- <xsl:with-param name="n" select="$n+1"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="name()='REL' or name()='instantiate' or @sort='Prop' or $naturalLanguage='no'">
- <xsl:apply-templates mode="pure" select="."/>
- </xsl:when>
- <xsl:otherwise>
- <m:ci>.</m:ci>
- </xsl:otherwise>
- </xsl:choose>
- <!-- <xsl:apply-templates mode="pure" select="."/> -->
- <xsl:apply-templates mode="flat" select="following-sibling::*[1]">
- <xsl:with-param name="n" select="$n"/>
- </xsl:apply-templates>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<!-- Auxiliary functions -->
-<!-- OMDOC: now we have name_of_uri generalized on the extension that -->
-<!-- can replace the next template -->
-<xsl:template name="get_name">
- <xsl:param name="uri" select="''"/>
- <xsl:variable name="sub_after" select="substring-after($uri,'/')"/>
- <xsl:choose>
- <xsl:when test="contains($sub_after,'/')">
- <xsl:call-template name="get_name">
- <xsl:with-param name="uri" select="$sub_after"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="substring-before($sub_after,'_ind.con')"/>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-
-</xsl:stylesheet>
+++ /dev/null
-<!-- 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 Logic -->
-<!-- (completely) Revisited: february 2001, Andrea Asperti -->
-<!-- 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">
-
-<xsl:template mode="proof_transform" match="APPLY[CONST[
- attribute::uri='cic:/Coq/Init/Logic/eq_ind.con' or
- attribute::uri='cic:/Coq/Init/Logic/eq_ind_r.con' or
- attribute::uri='cic:/Coq/Init/Logic_Type/eqT_ind.con' or
- attribute::uri='cic:/Coq/Init/Logic_Type/eqT_ind_r.con' or
- attribute::uri='cic:/Coq/Zarith/auxiliary/eqT_ind_r.con'] and count(child::*) = 7]">
- <xsl:variable name="id" select="@id"/>
- <m:apply>
- <m:csymbol>rw_step</m:csymbol>
- <xsl:apply-templates mode="noannot" select="*[5]"/>
- <xsl:apply-templates mode="pure" select="*[3]"/>
- <xsl:apply-templates mode="pure" select="*[6]"/>
- <xsl:call-template name="generate_side_proof">
- <xsl:with-param name="proof" select="*[7]"/>
- </xsl:call-template>
- </m:apply>
-</xsl:template>
-
-<xsl:template mode="proof_transform" match="APPLY[CONST[
- attribute::uri='cic:/Coq/Init/Logic/eq_ind.con' or
- attribute::uri='cic:/Coq/Init/Logic/eq_ind_r.con' or
- attribute::uri='cic:/Coq/Init/Logic_Type/eqT_ind.con' or
- attribute::uri='cic:/Coq/Init/Logic_Type/eqT_ind_r.con' or
- attribute::uri='cic:/Coq/Zarith/auxiliary/eqT_ind_r.con'] and count(child::*) > 7]">
- <xsl:variable name="no_extraproofs" select="count(*[position()>7 and @sort='Prop' and (name(.)='LAMBDA' or name(.)='LETIN' or name(.)='APPLY' or name(.)='MUTCASE' or name(.)='FIX' or name(.)='COFIX')])"/>
- <xsl:choose>
- <xsl:when test="$no_extraproofs=0">
- <m:apply>
- <m:csymbol>rewrite_and_apply</m:csymbol>
- <m:apply>
- <m:csymbol>rw_step</m:csymbol>
- <xsl:apply-templates mode="noannot" select="*[5]"/>
- <xsl:apply-templates mode="pure" select="*[3]"/>
- <xsl:apply-templates mode="pure" select="*[6]"/>
- <xsl:call-template name="generate_side_proof">
- <xsl:with-param name="proof" select="*[7]"/>
- </xsl:call-template>
- </m:apply>
- <xsl:apply-templates mode="noannot" select="*[position()>7]"/>
- </m:apply>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="*[5]/@sort='Prop'">
- <m:apply helm:xref="{@id}">
- <m:csymbol>letin</m:csymbol>
- <m:apply>
- <m:csymbol>let</m:csymbol>
- <m:ci>
- <xsl:call-template name="insert_subscript">
- <xsl:with-param name="node_value" select="'h1'"/>
- </xsl:call-template>
- </m:ci>
- <xsl:apply-templates mode="noannot" select="*[5]"/>
- </m:apply>
- <xsl:call-template name="gen_let">
- <xsl:with-param name="init_pos" select="1"/>
- <xsl:with-param name="from" select="7"/>
- </xsl:call-template>
- <m:apply>
- <m:csymbol>rewrite_and_apply</m:csymbol>
- <m:apply>
- <m:csymbol>rw_step</m:csymbol>
- <m:ci>
- <xsl:call-template name="insert_subscript">
- <xsl:with-param name="node_value" select="'h1'"/>
- </xsl:call-template>
- </m:ci>
- <xsl:apply-templates mode="pure" select="*[3]"/>
- <xsl:apply-templates mode="pure" select="*[6]"/>
- <xsl:call-template name="generate_side_proof">
- <xsl:with-param name="proof" select="*[7]"/>
- </xsl:call-template>
- </m:apply>
- <xsl:apply-templates mode="flat" select="*[8]">
- <xsl:with-param name="n">
- <xsl:value-of select="2"/>
- </xsl:with-param>
- </xsl:apply-templates>
- </m:apply>
- </m:apply>
- </xsl:when>
- <xsl:otherwise>
- <m:apply helm:xref="{@id}">
- <m:csymbol>letin</m:csymbol>
- <xsl:call-template name="gen_let">
- <xsl:with-param name="init_pos" select="0"/>
- <xsl:with-param name="form" select="7"/>
- </xsl:call-template>
- <m:apply>
- <m:csymbol>rewrite_and_apply</m:csymbol>
- <m:apply>
- <m:csymbol>rw_step</m:csymbol>
- <xsl:apply-templates mode="pure" select="*[5]"/>
- <xsl:apply-templates mode="pure" select="*[3]"/>
- <xsl:apply-templates mode="pure" select="*[6]"/>
- <xsl:call-template name="generate_side_proof">
- <xsl:with-param name="proof" select="*[7]"/>
- </xsl:call-template>
- </m:apply>
- <xsl:apply-templates mode="flat" select="*[8]">
- <xsl:with-param name="n">
- <xsl:value-of select="1"/>
- </xsl:with-param>
- </xsl:apply-templates>
- </m:apply>
- </m:apply>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-</xsl:stylesheet>
\ No newline at end of file
+++ /dev/null
-<?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/. -->
-
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:th="http://www.cs.unibo.it/helm/namespaces/helm-theory">
-
-<xsl:param name="getterURL" select="'http://localhost:8081/'"/>
-
-<xsl:output method="html"/>
-
-<!-- CSC: absPath is the old way to retrieve a file. The new one is using -->
-<!-- URLofURI4getter, defined in getter.xsl -->
-<xsl:variable name="absPath"><xsl:value-of select="$getterURL"/>getxml?uri=</xsl:variable>
-
-<xsl:template match="/">
- <html>
- <head></head>
- <body>
- <xsl:apply-templates/>
- </body>
- </html>
-</xsl:template>
-
-
-
-
-<!-- AGGIUNGERE cic: alle uri nei file Theory -->
-
-
-<xsl:template match="th:VARIABLE|th:DEFINITION|th:THEOREM|th:AXIOM">
-<xsl:param name="current_uri" select="''"/>
-<xsl:variable name="abs_uri">
- <xsl:call-template name="build_uri">
- <xsl:with-param name="first_uri" select="$current_uri"/>
- <xsl:with-param name="second_uri" select="@uri"/>
- </xsl:call-template>
-</xsl:variable>
-<xsl:variable name="found"
- select="boolean(document(concat($absPath,$abs_uri))//MUTIND[string(@uri)='cic:/Coq/Init/Logic/Equality/eq.ind'])"/>
-<xsl:if test="$found">
- <xsl:value-of select="$abs_uri"/><BR/>
-</xsl:if>
-</xsl:template>
-
-<xsl:template match="th:SECTION">
-<xsl:param name="current_uri" select="''"/>
-<h1><xsl:value-of select="$current_uri"/></h1>
- <xsl:apply-templates>
- <xsl:with-param name="current_uri">
- <xsl:call-template name="build_uri">
- <xsl:with-param name="first_uri" select="$current_uri"/>
- <xsl:with-param name="second_uri" select="@uri"/>
- </xsl:call-template>
- </xsl:with-param>
- </xsl:apply-templates>
-</xsl:template>
-
-<xsl:template match="*">
-<xsl:param name="current_uri" select="''"/>
- <xsl:apply-templates>
- <xsl:with-param name="current_uri" select="$current_uri"/>
- </xsl:apply-templates>
-</xsl:template>
-
-<xsl:template match="text()">
-</xsl:template>
-
-<xsl:template name="build_uri">
- <xsl:param name="first_uri" select="''"/>
- <xsl:param name="second_uri" select="''"/>
- <xsl:choose>
- <xsl:when test="starts-with($second_uri,'cic:')">
- <xsl:value-of select="$second_uri"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat($first_uri,'/',$second_uri)"/>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-</xsl:stylesheet>
+++ /dev/null
-<?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">
-
-<xsl:template match="APPLY[CONST[@uri='cic:/Coq/ring/Ring_abstract/apolynomial_normalize_ok.con']] | APPLY[instantiate/CONST[@uri='cic:/Coq/ring/Ring_abstract/apolynomial_normalize_ok.con']]" mode="proof_transform">
- <xsl:choose>
- <xsl:when test="count(child::*) = 2">
- <m:apply helm:xref="{@id}">
- <m:csymbol>app</m:csymbol>
- <xsl:apply-templates mode="noannot" select="*[1]/*[1]"/>
- <m:ci>...</m:ci>
- </m:apply>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-imports/>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match="APPLY[instantiate/CONST[@uri='cic:/Coq/ring/Ring_abstract/interp_ap.con']] | APPLY[CONST/@uri='cic:/Coq/ring/Ring_abstract/interp_ap.con']" mode="pure">
- <xsl:choose>
- <xsl:when test="count(child::*) = 2">
- <xsl:call-template name="start-interp">
- <xsl:with-param name="rtree" select="*[2]"/>
- <xsl:with-param name="atree" select="instantiate/*[position() = last()]"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-imports/>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match="APPLY[instantiate/CONST/@uri='cic:/Coq/ring/Ring_abstract/interp_sacs.con'] | APPLY[CONST/@uri='cic:/Coq/ring/Ring_abstract/interp_sacs.con']" mode="pure">
- <xsl:choose>
- <xsl:when test="count(child::*) = 2 and *[APPLY and position()=2][CONST/@uri='cic:/Coq/ring/Ring_abstract/apolynomial_normalize.con']">
- <m:apply helm:xref="{@id}">
- <m:csymbol>app</m:csymbol>
- <xsl:apply-templates mode="noannot" select="*[2]/*[1]"/>
- <xsl:call-template name="start-interp">
- <xsl:with-param name="rtree" select="*[2]/*[2]"/>
- <xsl:with-param name="atree" select="instantiate/*[position() = last()]"/>
- </xsl:call-template>
- </m:apply>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-imports/>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<!-- ************************** abstract polinomials rendering ************************ -->
-
-<xsl:template match="*" mode="interp">
- <m:apply>
- <m:ci>ERROR INTERP:</m:ci>
- <xsl:apply-templates select="." mode="noannot"/>
- </m:apply>
-</xsl:template>
-
-<!-- APVar -->
-<!-- CSC: ??????????? -->
-<xsl:template match="APPLY[MUTCONSTRUCT[@uri='cic:/Coq/ring/Ring_abstract/apolynomial.ind' and @noConstr='1']]" mode="interp">
- <xsl:param name="atree"/>
- <xsl:apply-templates select="*[2]" mode="interp">
- <xsl:with-param name="atree" select="$atree"/>
- </xsl:apply-templates>
-</xsl:template>
-
-<!-- AP0 -->
-<xsl:template match="MUTCONSTRUCT[@uri='cic:/Coq/ring/Ring_abstract/apolynomial.ind' and @noConstr='2']" mode="interp">
- <m:cn definitionURL="{@uri}" helm:xref="{@id}">0</m:cn>
-</xsl:template>
-
-<!-- AP1 -->
-<xsl:template match="MUTCONSTRUCT[@uri='cic:/Coq/ring/Ring_abstract/apolynomial.ind' and @noConstr='3']" mode="interp">
- <m:cn definitionURL="{@uri}" helm:xref="{@id}">1</m:cn>
-</xsl:template>
-
-<!-- APplus -->
-<xsl:template match="APPLY[MUTCONSTRUCT[@uri='cic:/Coq/ring/Ring_abstract/apolynomial.ind' and @noConstr='4']]" mode="interp">
- <xsl:param name="atree"/>
- <xsl:call-template name="mk-mml-op-interp">
- <xsl:with-param name="arity" select="2"/>
- <xsl:with-param name="c-tag" select="MUTCONSTRUCT"/>
- <xsl:with-param name="m-tag" select="'plus'"/>
- <xsl:with-param name="atree" select="$atree"/>
- </xsl:call-template>
-</xsl:template>
-
-<!-- APmult -->
-<xsl:template match="APPLY[MUTCONSTRUCT[@uri='cic:/Coq/ring/Ring_abstract/apolynomial.ind' and @noConstr='5']]" mode="interp">
- <xsl:param name="atree"/>
- <xsl:call-template name="mk-mml-op-interp">
- <xsl:with-param name="arity" select="2"/>
- <xsl:with-param name="c-tag" select="MUTCONSTRUCT"/>
- <xsl:with-param name="m-tag" select="'times'"/>
- <xsl:with-param name="atree" select="$atree"/>
- </xsl:call-template>
-</xsl:template>
-
-<!-- APopp -->
-<xsl:template match="APPLY[MUTCONSTRUCT[@uri='cic:/Coq/ring/Ring_abstract/apolynomial.ind' and @noConstr='6']]" mode="interp">
- <xsl:param name="atree"/>
- <xsl:call-template name="mk-mml-op-interp">
- <xsl:with-param name="arity" select="1"/>
- <xsl:with-param name="c-tag" select="MUTCONSTRUCT"/>
- <xsl:with-param name="m-tag" select="'minus'"/>
- <xsl:with-param name="atree" select="$atree"/>
- </xsl:call-template>
-</xsl:template>
-
-<xsl:template match="APPLY[MUTCONSTRUCT[@uri='cic:/Coq/ring/Quote/index.ind' and @noConstr='1']]" mode="interp">
- <xsl:param name="atree"/>
- <xsl:apply-templates select="*[2]" mode="interp">
- <xsl:with-param name="atree" select="$atree/*[4]"/>
- </xsl:apply-templates>
-</xsl:template>
-
-<xsl:template match="APPLY[MUTCONSTRUCT[@uri='cic:/Coq/ring/Quote/index.ind' and @noConstr='2']]" mode="interp">
- <xsl:param name="atree"/>
- <xsl:apply-templates select="*[2]" mode="interp">
- <xsl:with-param name="atree" select="$atree/*[5]"/>
- </xsl:apply-templates>
-</xsl:template>
-
-<xsl:template match="MUTCONSTRUCT[@uri='cic:/Coq/ring/Quote/index.ind' and @noConstr='3']" mode="interp">
- <xsl:param name="atree"/>
- <xsl:apply-templates select="$atree/*[3]" mode="noannot"/>
-</xsl:template>
-
-</xsl:stylesheet>
+++ /dev/null
-<?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/. -->
-
-<!--***********************************************************************-->
-<!-- XSLT version 0.1 of the stylesheet to accomplish the right inclusion -->
-<!-- of the content stylesheets: -->
-<!-- First draft: May 26 2000, C.Sacerdoti Coen, I.Schena, F.Guidi -->
-<!--***********************************************************************-->
-
-<!-- Schema of stylesheet precedences (from highest to lowest): -->
-<!-- proofs.xsl-> reals.xsl-> set -> basic -> annotatedcont -->
-<!-- because annotatedcont is imported and has lower precendence than -->
-<!-- the templates of rootcontent (i.e. the templates of set and basic). -->
-<!-- annotatedcont -> objcontent -> content -->
-<!-- because annotatedcont generates an import precedence tree. -->
-
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-
-<!--******************************************************************-->
-<!-- Variablie containing the absolute path of the CIC file -->
-<!--******************************************************************-->
-
-<xsl:import href="annotatedcont.xsl"/>
-<xsl:import href="links_library.xsl"/>
-<xsl:import href="getter.xsl"/>
-
-<xsl:param name="getterURL" select="'http://localhost:8081/'"/>
-<xsl:param name="processorURL" select="'http://localhost:8080/helm/servlet/uwobo/'"/>
-<xsl:param name="naturalLanguage" select="'yes'"/>
-<xsl:param name="annotations" select="'no'"/>
-<xsl:param name="CICURI" select="''"/>
-
-<!-- CSC: Wrong: we assume that no '.body' can appear in the middle of the URI -->
-<xsl:variable name="BaseCICURI">
- <xsl:variable name="res" select="substring-before($CICURI,'.body')"/>
- <xsl:choose>
- <xsl:when test="$res = ''">
- <xsl:value-of select="$CICURI"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$res"/>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:variable>
-
-<xsl:variable name="InnerTypesUri"><xsl:value-of select="concat($BaseCICURI,'.types')"/></xsl:variable>
-<!-- CSC: ?????????????????? -->
-<xsl:variable name="AnnotationsUri"><xsl:value-of select="concat($BaseCICURI,'.ann')"/></xsl:variable>
-
-<xsl:variable name="InnerTypesUrl"><xsl:call-template name="makeURL4InnerTypes"><xsl:with-param name="uri" select="$InnerTypesUri"/></xsl:call-template></xsl:variable>
-<xsl:variable name="ConstantTypeUrl"><xsl:call-template name="makeURL4InnerTypes"><xsl:with-param name="uri" select="$BaseCICURI"/></xsl:call-template></xsl:variable>
-<xsl:variable name="AnnotationsUrl"><xsl:call-template name="URLofURI4getter"><xsl:with-param name="uri" select="$AnnotationsUri"/></xsl:call-template></xsl:variable>
-
-
-<!-- WARNING: Using lazy evaluation: $CICURI.* may not exist, but -->
-<!-- document() is called only by need!!! -->
-<xsl:variable name="InnerTypes" select="document($InnerTypesUrl)"/>
-<xsl:variable name="CICAnnotations" select="document($AnnotationsUrl)"/>
-
-<xsl:include href="headercontent.xsl"/>
-<xsl:include href="proofs.xsl"/>
-<xsl:variable name="showproof" select="0"/>
-</xsl:stylesheet>
-
-
-
-
-
-
-
-
+++ /dev/null
-<?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/. -->
-
-<!--***********************************************************************-->
-<!-- XSLT version 0.1 of the stylesheet to accomplish the right inclusion -->
-<!-- of the theory content stylesheets: -->
-<!-- First draft: May 26 2000, Claudio Sacerdoti Coen, Irene Schena -->
-<!-- November 15 2000, Irene Schena -->
-<!--***********************************************************************-->
-
-<!-- Schema of stylesheet precedences (from highest to lowest): -->
-<!-- theory_content -> rootcontent.xsl -->
-<!-- because theory_content is included and has higher precendence than -->
-<!-- the templates of rootcontent which are imported. -->
-
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-
-<xsl:import href="rootcontent.xsl"/>
-<xsl:include href="theory_content.xsl"/>
-
-</xsl:stylesheet>
+++ /dev/null
-<?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/. -->
-
-<xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
- xmlns:dc="http://purl.org/metadata/dublin_core#"
- xmlns:dcq="http://purl.org/metadata/dublin_core_qualifiers#"
- xmlns:h="http:/www.cs.unibo.it/helm/schemas/schema-h.rdf#"
- xmlns:hth="http://www.cs.unibo.it/helm/schemas/schema-hth.rdf#">
-
-<xsl:output
- method="xml"
- encoding="iso-8859-1"
- media-type="text/html"
- doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
- doctype-system="DTD/xhtml1-transitional.dtd" />
-
-<xsl:template name="loop_show_dc">
- <xsl:param name="CICURI" select="''"/>
- <xsl:param name="first_time" select="true()"/>
- <xsl:variable name="document" select="document(concat($BaseRDFURLDC,$CICURI))"/>
- <xsl:choose>
- <xsl:when test="$document/rdf:RDF/*/*">
- <h1>Dublin Core Metadata for <xsl:value-of select="$CICURI"/>:</h1>
- <xsl:apply-templates mode="show_dc" select="$document">
- <xsl:with-param name="CICURI" select="$CICURI"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <xsl:if test="$first_time">
- <h1>No Dublin Core Metadata available for <xsl:value-of select="$CICURI"/>.</h1>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:variable name="basename">
- <xsl:call-template name="get_basename">
- <xsl:with-param name="CICURI" select="$CICURI"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="parentURI" select="substring-before($CICURI,concat('/',$basename))"/>
- <xsl:if test="not($parentURI = 'cic:')">
- <xsl:call-template name="loop_show_dc">
- <xsl:with-param name="CICURI" select="$parentURI"/>
- <xsl:with-param name="first_time" select="false()"/>
- </xsl:call-template>
- </xsl:if>
-</xsl:template>
-
-<xsl:template name="get_basename">
- <xsl:param name="CICURI"/>
- <xsl:variable name="suffix" select="substring-after($CICURI,'/')"/>
- <xsl:choose>
- <xsl:when test="$suffix = ''">
- <xsl:value-of select="$CICURI"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="get_basename">
- <xsl:with-param name="CICURI" select="$suffix"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template mode="show_dc" match="/">
- <table>
- <xsl:apply-templates mode="show_dc" select="rdf:RDF/*/*"/>
- </table>
-</xsl:template>
-
-<xsl:template mode="show_dc" match="dc:title">
- <tr>
- <td>Title:</td>
- <td><xsl:apply-templates mode="show_dc"/></td>
- </tr>
-</xsl:template>
-
-<xsl:template mode="show_dc" match="dc:creator">
- <tr>
- <td>Creator:</td>
- <td><xsl:apply-templates mode="show_dc"/></td>
- </tr>
-</xsl:template>
-
-<xsl:template mode="show_dc" match="dc:contributor">
- <tr>
- <td>Contributor:</td>
- <td><xsl:apply-templates mode="show_dc"/></td>
- </tr>
-</xsl:template>
-
-<xsl:template mode="show_dc" match="dc:subject">
- <tr>
- <td>Subject:</td>
- <td><xsl:apply-templates mode="show_dc"/></td>
- </tr>
-</xsl:template>
-
-<xsl:template mode="show_dc" match="dc:description">
- <tr>
- <td>Description:</td>
- <td><xsl:apply-templates mode="show_dc"/></td>
- </tr>
-</xsl:template>
-
-<xsl:template mode="show_dc" match="dc:publisher">
- <tr>
- <td>Publisher:</td>
- <td><xsl:apply-templates mode="show_dc"/></td>
- </tr>
-</xsl:template>
-
-<xsl:template mode="show_dc" match="dc:date">
- <tr>
- <td>Date:</td>
- <td><xsl:apply-templates mode="show_dc"/></td>
- </tr>
-</xsl:template>
-
-<xsl:template mode="show_dc" match="dc:coverage">
- <tr>
- <td>Coverage:</td>
- <td><xsl:apply-templates mode="show_dc"/></td>
- </tr>
-</xsl:template>
-
-<xsl:template mode="show_dc" match="dc:type">
- <tr>
- <td>Type:</td>
- <td><xsl:apply-templates mode="show_dc"/></td>
- </tr>
-</xsl:template>
-
-<xsl:template mode="show_dc" match="hth:ResourceType">
- <xsl:value-of select="substring-after(@rdf:about,'#')"/>
-</xsl:template>
-
-<xsl:template mode="show_dc" match="dc:format">
- <tr>
- <td>Format:</td>
- <td><xsl:apply-templates mode="show_dc"/></td>
- </tr>
-</xsl:template>
-
-<xsl:template mode="show_dc" match="hth:ResourceFormat">
- <xsl:value-of select="substring-after(@rdf:about,'#')"/>
-</xsl:template>
-
-<xsl:template mode="show_dc" match="dc:identifier">
- <tr>
- <td>Identifier:</td>
- <td><xsl:apply-templates mode="show_dc"/></td>
- </tr>
-</xsl:template>
-
-<xsl:template mode="show_dc" match="dc:source">
- <tr>
- <td>Source:</td>
- <td><xsl:apply-templates mode="show_dc"/></td>
- </tr>
-</xsl:template>
-
-<xsl:template mode="show_dc" match="dc:language">
- <tr>
- <td>Language:</td>
- <td><xsl:apply-templates mode="show_dc"/></td>
- </tr>
-</xsl:template>
-
-<xsl:template mode="show_dc" match="dc:relation">
- <tr>
- <td>Relation:</td>
- <td><xsl:apply-templates mode="show_dc"/></td>
- </tr>
-</xsl:template>
-
-<xsl:template mode="show_dc" match="dcq:RelationType">
- <xsl:value-of select="substring-after(@rdf:about,'#')"/>
- <xsl:text> </xsl:text>
- <xsl:value-of select="@rdf:value"/>
-</xsl:template>
-
-<xsl:template mode="show_dc" match="dc:rights">
- <tr>
- <td>Rights:</td>
- <td><xsl:apply-templates mode="show_dc"/></td>
- </tr>
-</xsl:template>
-
-<xsl:template mode="show_dc" match="hth:institution">
- <tr>
- <td>Institution:</td>
- <td><xsl:apply-templates mode="show_dc"/></td>
- </tr>
-</xsl:template>
-
-<xsl:template mode="show_dc" match="hth:contact">
- <tr>
- <td>Contact:</td>
- <td><xsl:apply-templates mode="show_dc"/></td>
- </tr>
-</xsl:template>
-
-<xsl:template mode="show_dc" match="hth:firstVersion">
- <tr>
- <td>First Version:</td>
- <td><xsl:apply-templates mode="show_dc"/></td>
- </tr>
-</xsl:template>
-
-<xsl:template mode="show_dc" match="hth:modified">
- <tr>
- <td>Modified:</td>
- <td><xsl:apply-templates mode="show_dc"/></td>
- </tr>
-</xsl:template>
-
-<xsl:template mode="show_dc" match="*">
- <tr>
- <td>ERROR!</td>
- <td><xsl:value-of select="name(.)"/></td>
- </tr>
-</xsl:template>
-
-</xsl:stylesheet>
+++ /dev/null
-<?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/. -->
-
-<!--***********************************************************************-->
-<!-- XSLT version 0.1 of theory objects to theory sections: -->
-<!-- First draft: May 08 2000, Claudio Sacerdoti Coen, Irene Schena -->
-<!--***********************************************************************-->
-
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:ht="http://www.cs.unibo.it/helm/namespaces/helm-theory">
-
-
-<!-- THEORY and SUBTHEORIES -->
-
-<xsl:template match="ht:SECTION">
-<xsl:param name="current_uri" select="''"/>
-<xsl:param name="delim" select="''"/>
- <ht:SECTION name="{@uri}">
- <xsl:apply-templates><xsl:with-param name="current_uri" select="concat($current_uri,$delim,string(@uri))"/><xsl:with-param name="delim" select=""/""/></xsl:apply-templates>
- </ht:SECTION>
-</xsl:template>
-
-<!-- MUTUAL -->
-
-<xsl:template match="ht:MUTUAL">
-<xsl:param name="current_uri" select="''"/>
-<xsl:param name="delim" select="''"/>
- <ht:MUTUAL>
- <xsl:apply-templates><xsl:with-param name="current_uri" select="$current_uri"/><xsl:with-param name="delim" select="$delim"/></xsl:apply-templates>
- </ht:MUTUAL>
-</xsl:template>
-
-
-<!-- THEORY ELEMENTS -->
-
-<xsl:template match="ht:AXIOM|ht:DEFINITION|ht:THEOREM|ht:VARIABLE">
-<xsl:param name="current_uri" select="''"/>
-<xsl:param name="delim" select="''"/>
-<xsl:variable name="uri" select="concat(string($current_uri),$delim,string(@uri))"/>
- <xsl:copy>
- <xsl:copy-of select="@as"/>
- <xsl:attribute name="uri"><xsl:value-of select="$uri"/></xsl:attribute>
- </xsl:copy>
-</xsl:template>
-
-<xsl:template match="ht:OBJECT">
-<xsl:param name="current_uri" select="''"/>
-<xsl:param name="delim" select="''"/>
-<xsl:variable name="uri" select="concat(string($current_uri),$delim,string(@uri))"/>
- <xsl:copy>
- <xsl:copy-of select="@mode"/>
- <xsl:attribute name="uri"><xsl:value-of select="$uri"/></xsl:attribute>
- </xsl:copy>
-</xsl:template>
-
-<!-- Root and XHTML -->
-
-<xsl:template match = "/|*">
-<xsl:param name="current_uri" select="''"/>
-<xsl:param name="delim" select="''"/>
- <xsl:copy>
- <xsl:copy-of select="@*"/>
- <xsl:apply-templates><xsl:with-param name="current_uri" select="$current_uri"/><xsl:with-param name="delim" select="$delim"/></xsl:apply-templates>
- </xsl:copy>
-</xsl:template>
-
-</xsl:stylesheet>
+++ /dev/null
-<?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/. -->
-
-<!--***********************************************************************-->
-<!-- XSLT version 0.1 of theory sections to HTML: -->
-<!-- First draft: May 10 2000, Irene Schena -->
-<!-- November 15 2000, Irene Schena -->
-<!--***********************************************************************-->
-
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:ht="http://www.cs.unibo.it/helm/namespaces/helm-theory">
-
-<!--<xsl:output method="html" encoding="iso-8859-1"/>-->
-<xsl:output
- method="xml"
- encoding="iso-8859-1"
- media-type="text/html"
- doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
- doctype-system="DTD/xhtml1-transitional.dtd" />
-
-<xsl:template match="ht:SECTION">
- <xsl:apply-templates select="*"/>
-</xsl:template>
-
-<xsl:template match="ht:MUTUAL">
- <h4>BEGIN MUTUAL DEFINITIONS</h4>
- <xsl:apply-templates select="*"/>
- <h4>END MUTUAL DEFINITIONS</h4>
-</xsl:template>
-
-<xsl:template match="ht:OBJECT">
- <xsl:variable name="delimiter">
- <xsl:if test="@mode != 'linkonly'">
- <xsl:text>:</xsl:text>
- </xsl:if>
- </xsl:variable>
- <table>
- <tr>
- <td colspan="2">
- <b>Object<xsl:text> </xsl:text><a href="{@uri}"><xsl:value-of select="@uri"/></a><xsl:value-of select="$delimiter"/></b>
- </td>
- </tr>
- <xsl:if test="@mode != 'linkonly'">
- <tr>
- <td>   </td>
- <td><ENTITY uri="{@uri}" type="{@mode}"/></td>
- </tr>
- </xsl:if>
- </table>
-</xsl:template>
-
-<xsl:template match="ht:THEOREM">
- <table>
- <tr>
- <td colspan="2">
- <b><xsl:value-of select="@as"/><xsl:text> </xsl:text><a href="{@uri}"><xsl:value-of select="@uri"/></a>:</b>
- </td>
- </tr>
- <tr>
- <td>   </td>
- <td><ENTITY uri="{@uri}" type="typeonly"/></td>
- </tr>
- </table>
-</xsl:template>
-
-<xsl:template match="ht:AXIOM|ht:VARIABLE">
- <table>
- <tr>
- <td colspan="2">
- <b><xsl:value-of select="substring-after(string(name(.)), "ht:")"/><xsl:text> </xsl:text><a href="{@uri}"><xsl:value-of select="@uri"/></a>:</b>
- </td>
- </tr>
- <tr>
- <td>   </td>
- <td><ENTITY uri="{@uri}" type="embed"/></td>
- </tr>
- </table>
-</xsl:template>
-
-<xsl:template match="ht:DEFINITION">
-<xsl:variable name="name"><xsl:choose><xsl:when test="@as='Inductive'">Inductive Definition</xsl:when><xsl:when test="@as='CoInductive'">CoInductive Definition</xsl:when><xsl:when test="@as='Record'">Record Definition</xsl:when><xsl:otherwise>Definition</xsl:otherwise></xsl:choose></xsl:variable>
- <table>
- <tr>
- <td colspan="2">
- <b><xsl:value-of select="string($name)"/><xsl:text> </xsl:text><a href="{@uri}"><xsl:value-of select="@uri"/></a>:</b>
- </td>
- </tr>
- <tr>
- <td>   </td>
- <td><ENTITY uri="{@uri}" type="embed"/></td>
- </tr>
- </table>
-</xsl:template>
-
-<!-- Root and XHTML -->
-
-<xsl:template match = "/|*">
- <xsl:copy>
- <xsl:copy-of select="@*"/>
- <xsl:apply-templates/>
- </xsl:copy>
-</xsl:template>
-
-</xsl:stylesheet>
+++ /dev/null
-annotatedcont.xsl
-annotatedpres.xsl
-content.xsl
-content_to_html.xsl
-contentlib.xsl
-diseq.xsl
-drop_coercions.xsl
-expandobj.xsl
-genmmlid.xsl
-getter.xsl
-headercontent.xsl
-html_init.xsl
-html_reals.xsl
-html_set.xsl
-inductive.xsl
-ite.xsl
-lambda.xsl
-link.xsl
-links_library.xsl
-logic.xsl
-mk_dep_graph.xsl
-mk_meta_and_dep_graph.xsl
-mk_meta_graph.xsl
-mk_meta_theory.xsl
-mmlctop.xsl
-mmlextension.xsl
-mmlnotation.xsl
-mmltheoryextension.xsl
-objcontent.xsl
-objtheorycontent.xsl
-params.xsl
-proofs.xsl
-rewrite.xsl
-ricerca.xsl
-ring.xsl
-rootcontent.xsl
-roottheory.xsl
-show_dc.xsl
-theory_content.xsl
-theory_pres.xsl