<!-- ************************** ARITHMETICS ****************************** -->
<xsl:template match="APPLY[MUTIND/@uri='cic:/Coq/Init/Peano/le.ind']" mode="pure">
- <xsl:call-template name="mk-mml-infix">
+ <xsl:call-template name="mkmml-op-noannot">
+ <xsl:with-param name="arity" select="2"/>
<xsl:with-param name="c-tag" select="MUTIND"/>
<xsl:with-param name="m-tag" select="'leq'"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="APPLY[CONST/@uri='cic:/Coq/Init/Peano/lt.con']" mode="pure">
- <xsl:call-template name="mk-mml-infix">
+ <xsl:call-template name="mkmml-op-noannot">
+ <xsl:with-param name="arity" select="2"/>
<xsl:with-param name="c-tag" select="CONST"/>
<xsl:with-param name="m-tag" select="'lt'"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="APPLY[CONST/@uri='cic:/Coq/Init/Peano/ge.con']" mode="pure">
- <xsl:call-template name="mk-mml-infix">
+ <xsl:call-template name="mkmml-op-noannot">
+ <xsl:with-param name="arity" select="2"/>
<xsl:with-param name="c-tag" select="CONST"/>
<xsl:with-param name="m-tag" select="'geq'"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="APPLY[CONST/@uri='cic:/Coq/Init/Peano/gt.con']" mode="pure">
- <xsl:call-template name="mk-mml-infix">
+ <xsl:call-template name="mkmml-op-noannot">
+ <xsl:with-param name="arity" select="2"/>
<xsl:with-param name="c-tag" select="CONST"/>
<xsl:with-param name="m-tag" select="'gt'"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="APPLY[CONST/@uri='cic:/Coq/Init/Peano/plus.con']" mode="pure">
- <xsl:call-template name="mk-mml-infix">
+ <xsl:call-template name="mkmml-op-noannot">
+ <xsl:with-param name="arity" select="2"/>
<xsl:with-param name="c-tag" select="CONST"/>
<xsl:with-param name="m-tag" select="'plus'"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="APPLY[CONST/@uri='cic:/Coq/Arith/Minus/minus.con']" mode="pure">
- <xsl:call-template name="mk-mml-infix">
+ <xsl:call-template name="mkmml-op-noannot">
+ <xsl:with-param name="arity" select="2"/>
<xsl:with-param name="c-tag" select="CONST"/>
<xsl:with-param name="m-tag" select="'minus'"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="APPLY[CONST/@uri='cic:/Coq/Init/Peano/mult.con']" mode="pure">
- <xsl:call-template name="mk-mml-infix">
+ <xsl:call-template name="mkmml-op-noannot">
+ <xsl:with-param name="arity" select="2"/>
<xsl:with-param name="c-tag" select="CONST"/>
<xsl:with-param name="m-tag" select="'times'"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="APPLY[CONST/@uri='cic:/Coq/Arith/Min/min.con']" mode="pure">
- <xsl:call-template name="mk-mml-infix">
+ <xsl:call-template name="mkmml-op-noannot">
+ <xsl:with-param name="arity" select="2"/>
<xsl:with-param name="c-tag" select="CONST"/>
<xsl:with-param name="m-tag" select="'min'"/>
</xsl:call-template>
</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>
- <!-- <xsl:value-of select="document(concat(string($absPath),@uri))/*/@name"/> -->
- </m:ci>
+ <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>
+ <!-- <xsl:value-of select="document(concat(string($absPath),@uri))/*/@name"/> -->
+ </m:ci>
</xsl:template>
<xsl:template match="MUTIND" mode="pure">
<!--***********************************************************************-->
<!-- From MathML content to HTML -->
-<!-- HELM Group: Asperti, Padovani, Sacerdoti, Schena -->
+<!-- HELM Group: Asperti, Padovani, Sacerdoti, Schena, Guidi -->
<!--***********************************************************************-->
+<xsl:param name="CICURI" select="''"/>
+
<xsl:include href="html_init.xsl"/>
<xsl:include href="html_set.xsl"/>
<xsl:include href="html_reals.xsl"/>
<xsl:variable name="framewidth" select="45"/>
<xsl:template match="/">
- <xsl:param name="current_indent" select="0"/>
- <html>
- <head>
- <style>
- A { text-decoration: none }
- </style>
- </head>
- <body bgcolor="white">
- <xsl:apply-templates>
- <xsl:with-param name="current_indent" select="0"/>
- </xsl:apply-templates>
- </body>
- </html>
+ <xsl:param name="current_indent" select="0"/>
+ <html>
+ <head>
+ <title> <xsl:value-of select="$CICURI"/> </title> <!-- FG -->
+ <style> A { text-decoration: none } </style>
+ </head>
+ <body bgcolor="white">
+ <xsl:apply-templates>
+ <xsl:with-param name="current_indent" select="0"/>
+ </xsl:apply-templates>
+ </body>
+ </html>
</xsl:template>
<!--***********************************************************************-->
<xsl:when test="$name='arrow'">
<xsl:text>(</xsl:text>
<xsl:apply-templates mode="inline" select="*[position()=2]"/>
- <FONT color="blue" FACE="symbol">
+ <FONT color="blue" SIZE="+2" FACE="symbol">
<xsl:text>®</xsl:text>
</FONT>
<xsl:apply-templates mode="inline" select="*[position()=3]"/>
<FONT color="red"> hence </FONT>
<xsl:apply-templates mode="inline" select="*[7]"/>
</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:with-param name="current_indent" select="$current_indent + 2"/>
</xsl:call-template>
<!-- -> -->
- <FONT color="blue" FACE="symbol">
+ <FONT color="blue" SIZE="+2" FACE="symbol">
<xsl:text>®</xsl:text>
</FONT>
<xsl:apply-templates select="*[position()=3]">
<xsl:with-param name="current_indent" select="$current_indent"/>
</xsl:apply-templates>
</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>
xmlns:helm="http://www.cs.unibo.it/helm"
xmlns:xlink="http://www.w3.org/1999/xlink">
-<xsl:template name="mk-mml-infix"> <!-- make MML node for infix operator -->
- <xsl:param name="c-tag"/> <!-- CIC tag -->
- <xsl:param name="m-tag"/> <!-- MathML tag -->
+<xsl:template name="mkmml-op-noannot"> <!-- make MML node for operators (noannot mode) -->
+ <xsl:param name="arity"/> <!-- operator arity -->
+ <xsl:param name="c-tag"/> <!-- CIC tag -->
+ <xsl:param name="m-tag"/> <!-- MathML tag -->
<xsl:choose>
- <xsl:when test="count(child::*) = 3">
+ <xsl:when test="count(child::*) = $arity + 1">
<m:apply helm:xref="{@id}">
<xsl:element name="{concat('m:',$m-tag)}">
<xsl:attribute name="definitionURL">
<xsl:value-of select="$c-tag/@id"/>
</xsl:attribute>
</xsl:element>
- <xsl:apply-templates select="*[2]" mode="noannot"/>
- <xsl:apply-templates select="*[3]" mode="noannot"/>
+ <xsl:apply-templates select="*[position() > 1]" mode="noannot"/>
+ </m:apply>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-imports/>
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+<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="mkmml-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:choose>
+ <xsl:when test="count(child::*) = $arity + 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:apply-templates select="*[position() > 1]" mode="interp">
+ <xsl:with-param name="atree" select="$atree"/>
+ </xsl:apply-templates>
</m:apply>
</xsl:when>
<xsl:otherwise>
<xsl:include href="arith.xsl"/> <!-- FG -->
<xsl:include href="set.xsl"/>
<xsl:include href="reals.xsl"/>
+<xsl:include href="ring.xsl"/> <!-- FG -->
</xsl:stylesheet>
<xsl:text>(</xsl:text>
<xsl:apply-templates mode="inline" select="*[2]"/>
<a href="{$uri}">
- <FONT FACE="symbol" mathcolor="blue">
+ <FONT FACE="symbol" SIZE="+2" mathcolor="blue">
<xsl:value-of select="$symbol"/>
</FONT>
</a>
<xsl:choose>
<xsl:when test="count(child::*)=2">
<a href="{$uri}">
- <xsl:text>-</xsl:text>
+ <FONT FACE="symbol" SIZE="+2" mathcolor="blue">-</FONT>
</a>
<xsl:apply-templates mode="inline" select="*[2]"/>
</xsl:when>
<xsl:text>(</xsl:text>
<xsl:apply-templates mode="inline" select="*[2]"/>
<a href="{$uri}">
- <xsl:text>-</xsl:text>
+ <FONT FACE="symbol" SIZE="+2" mathcolor="blue">-</FONT>
</a>
<xsl:apply-templates mode="inline" select="*[3]"/>
<xsl:text>)</xsl:text>
<xsl:value-of select="m:not/@definitionURL"/>
</xsl:variable>
<a href="{$uri}">
- <FONT FACE="symbol" mathcolor="blue">Ø</FONT>
+ <FONT FACE="symbol" SIZE="+2" mathcolor="blue">Ø</FONT>
</a>
<xsl:apply-templates mode="inline" select="*[2]"/>
</xsl:template>
<xsl:value-of select="m:exists/@definitionURL"/>
</xsl:variable>
<a href="{$uri}">
- <FONT FACE="symbol" mathcolor="blue">$</FONT>
+ <FONT FACE="symbol" SIZE="+2" mathcolor="blue">$</FONT>
</a>
<xsl:apply-templates select="m:bvar/m:ci"/>
<xsl:text>:</xsl:text>
<xsl:with-param name="current_indent" select="$current_indent + 2"/>
</xsl:call-template>
<a href="{$uri}">
- <FONT FACE="symbol" mathcolor="blue">
+ <FONT FACE="symbol" SIZE="+2" mathcolor="blue">
<xsl:value-of select="$symbol"/>
</FONT>
</a>
<xsl:choose>
<xsl:when test="count(child::*)=2">
<a href="{$uri}">
- <xsl:text>-</xsl:text>
+ <FONT FACE="symbol" SIZE="+2" mathcolor="blue">-</FONT>
</a>
<xsl:apply-templates select="*[2]">
<xsl:with-param name="current_indent" select="$current_indent + 1"/>
<xsl:with-param name="current_indent" select="$current_indent + 2"/>
</xsl:call-template>
<a href="{$uri}">
- <xsl:text>-</xsl:text>
+ <FONT FACE="symbol" SIZE="+2" mathcolor="blue">-</FONT>
</a>
<xsl:apply-templates select="*[3]">
<xsl:with-param name="current_indent" select="$current_indent + 2"/>
<xsl:value-of select="m:not/@definitionURL"/>
</xsl:variable>
<a href="{$uri}">
- <FONT FACE="symbol" mathcolor="blue">Ø</FONT>
+ <FONT FACE="symbol" SIZE="+2" mathcolor="blue">Ø</FONT>
</a>
<xsl:apply-templates select="*[2]"/>
</xsl:template>
<xsl:choose>
<xsl:when test="$charlength > $framewidth">
<a href="{$uri}">
- <FONT FACE="symbol" mathcolor="blue">$</FONT>
+ <FONT FACE="symbol" SIZE="+2" mathcolor="blue">$</FONT>
</a>
<xsl:apply-templates select="m:bvar/m:ci"/>
<xsl:text>:</xsl:text>
</xsl:variable>-->
<xsl:choose>
<xsl:when test="count(child::*) = 0">
- <FONT FACE="symbol" mathcolor="blue">Æ</FONT>
+ <FONT FACE="symbol" SIZE="+2" mathcolor="blue">Æ</FONT>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:text>(</xsl:text>
<xsl:apply-templates mode="inline" select="*[2]"/>
<a href="{$uri}">
- <FONT FACE="symbol" mathcolor="blue">
+ <FONT FACE="symbol" SIZE="+2" mathcolor="blue">
<xsl:value-of select="$symbol"/>
</FONT>
</a>
<xsl:with-param name="current_indent" select="$current_indent + 2"/>
</xsl:call-template>
<a href="{$uri}">
- <FONT FACE="symbol" mathcolor="blue">
+ <FONT FACE="symbol" SIZE="+2" mathcolor="blue">
<xsl:value-of select="$symbol"/>
</FONT>
</a>
</xsl:variable>-->
<xsl:choose>
<xsl:when test="count(child::*) = 0">
- <FONT FACE="symbol" mathcolor="blue">Æ</FONT>
+ <FONT FACE="symbol" SIZE="+2" mathcolor="blue">Æ</FONT>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="charlength">
<!-- Binary Operations and Relations -->
<xsl:template match="APPLY[CONST/@uri='cic:/Coq/Reals/Rdefinitions/Rle.con']" mode="pure">
- <xsl:call-template name="mk-mml-infix">
+ <xsl:call-template name="mkmml-op-noannot">
+ <xsl:with-param name="arity" select="2"/>
<xsl:with-param name="c-tag" select="CONST"/>
<xsl:with-param name="m-tag" select="'leq'"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="APPLY[CONST/@uri='cic:/Coq/Reals/Rdefinitions/Rlt.con']" mode="pure">
- <xsl:call-template name="mk-mml-infix">
+ <xsl:call-template name="mkmml-op-noannot">
+ <xsl:with-param name="arity" select="2"/>
<xsl:with-param name="c-tag" select="CONST"/>
<xsl:with-param name="m-tag" select="'lt'"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="APPLY[CONST/@uri='cic:/Coq/Reals/Rdefinitions/Rge.con']" mode="pure">
- <xsl:call-template name="mk-mml-infix">
+ <xsl:call-template name="mkmml-op-noannot">
+ <xsl:with-param name="arity" select="2"/>
<xsl:with-param name="c-tag" select="CONST"/>
<xsl:with-param name="m-tag" select="'geq'"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="APPLY[CONST/@uri='cic:/Coq/Reals/Rdefinitions/Rgt.con']" mode="pure">
- <xsl:call-template name="mk-mml-infix">
+ <xsl:call-template name="mkmml-op-noannot">
+ <xsl:with-param name="arity" select="2"/>
<xsl:with-param name="c-tag" select="CONST"/>
<xsl:with-param name="m-tag" select="'gt'"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="APPLY[CONST/@uri='cic:/Coq/Reals/Rdefinitions/Rplus.con']" mode="pure">
- <xsl:call-template name="mk-mml-infix">
+ <xsl:call-template name="mkmml-op-noannot">
+ <xsl:with-param name="arity" select="2"/>
<xsl:with-param name="c-tag" select="CONST"/>
<xsl:with-param name="m-tag" select="'plus'"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="APPLY[CONST/@uri='cic:/Coq/Reals/Rdefinitions/Rminus.con']" mode="pure">
- <xsl:call-template name="mk-mml-infix">
+ <xsl:call-template name="mkmml-op-noannot">
+ <xsl:with-param name="arity" select="2"/>
<xsl:with-param name="c-tag" select="CONST"/>
<xsl:with-param name="m-tag" select="'minus'"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="APPLY[CONST/@uri='cic:/Coq/Reals/Rdefinitions/Rmult.con']" mode="pure">
- <xsl:call-template name="mk-mml-infix">
+ <xsl:call-template name="mkmml-op-noannot">
+ <xsl:with-param name="arity" select="2"/>
<xsl:with-param name="c-tag" select="CONST"/>
<xsl:with-param name="m-tag" select="'times'"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="APPLY[CONST/@uri='cic:/Coq/Reals/Rdefinitions/Rdiv.con']" mode="pure">
- <xsl:call-template name="mk-mml-infix">
+ <xsl:call-template name="mkmml-op-noannot">
+ <xsl:with-param name="arity" select="2"/>
<xsl:with-param name="c-tag" select="CONST"/>
<xsl:with-param name="m-tag" select="'divide'"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="APPLY[CONST/@uri='cic:/Coq/Reals/Rbasic_fun/Rmin.con']" mode="pure">
- <xsl:call-template name="mk-mml-infix">
+ <xsl:call-template name="mkmml-op-noannot">
+ <xsl:with-param name="arity" select="2"/>
<xsl:with-param name="c-tag" select="CONST"/>
<xsl:with-param name="m-tag" select="'min'"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="APPLY[CONST/@uri='cic:/Coq/Reals/Rbasic_fun/Rmax.con']" mode="pure">
- <xsl:call-template name="mk-mml-infix">
+ <xsl:call-template name="mkmml-op-noannot">
+ <xsl:with-param name="arity" select="2"/>
<xsl:with-param name="c-tag" select="CONST"/>
<xsl:with-param name="m-tag" select="'max'"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="APPLY[CONST/@uri='cic:/Coq/Reals/Rfunctions/pow.con']" mode="pure">
- <xsl:call-template name="mk-mml-infix">
+ <xsl:call-template name="mkmml-op-noannot">
+ <xsl:with-param name="arity" select="2"/>
<xsl:with-param name="c-tag" select="CONST"/>
<xsl:with-param name="m-tag" select="'power'"/>
</xsl:call-template>