<xsl:import href="objcontent.xsl"/>
-<xsl:key name="id" use="@id" match="LAMBDA|PROD|CAST|REL|SORT|APPLY|VAR|META|CONST|MUTIND|MUTCONSTRUCT|MUTCASE|FIX|COFIX|Definition|Axiom|CurrentProof|InductiveDefinition|Variable"/>
+<xsl:key name="id" use="@id" match="LAMBDA|LETIN|PROD|CAST|REL|SORT|APPLY|VAR|META|CONST|MUTIND|MUTCONSTRUCT|MUTCASE|FIX|COFIX|Definition|Axiom|CurrentProof|InductiveDefinition|Variable"/>
<xsl:key name="annid" use="@of" match="Annotation"/>
</xsl:choose>
</xsl:template>
-<xsl:template match="LAMBDA|PROD|CAST|REL|SORT|APPLY|VAR|META|CONST|MUTIND|MUTCONSTRUCT|MUTCASE|FIX|COFIX">
+<xsl:template match="LAMBDA|LETIN|PROD|CAST|REL|SORT|APPLY|VAR|META|CONST|MUTIND|MUTCONSTRUCT|MUTCASE|FIX|COFIX">
<xsl:choose>
<xsl:when test="key('annid',@id)">
<annotation helm:xref="{@id}">
</m:lambda>
</xsl:template>
+<xsl:template match="LETIN" mode="pure">
+ <m:apply helm:xref="{@id}">
+ <m:csymbol>letin</m:csymbol>
+ <m:bvar>
+ <m:ci>
+ <xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="letintarget/@binder"/></xsl:with-param></xsl:call-template>
+ </m:ci>
+ </m:bvar>
+ <xsl:apply-templates select="*[1]" mode="noannot"/>
+ <xsl:apply-templates select="letintarget/*[1]" mode="noannot"/>
+ </m:apply>
+</xsl:template>
+
<xsl:template match="PROD" mode="pure">
<m:apply helm:xref="{@id}">
<xsl:choose>
<xsl:choose>
<xsl:when test="$charlength > $framewidth">
<!-- Π -->
- <FONT FACE="symbol" SIZE="+2" color="blue">P</FONT>
+ <FONT FACE="symbol" SIZE="+2" mathcolor="blue">P</FONT>
<xsl:apply-templates select="m:bvar/m:ci"/>
<xsl:text>:</xsl:text>
<xsl:apply-templates select="m:bvar/m:type">
</xsl:when>
<xsl:otherwise>
<!-- Π -->
- <FONT FACE="symbol" SIZE="+2" color="blue">P</FONT>
+ <FONT FACE="symbol" SIZE="+2" mathcolor="blue">P</FONT>
<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"/>
</xsl:call-template>
<!-- -> -->
- <FONT FACE="symbol" SIZE="+2" color="blue">®</FONT>
+ <FONT FACE="symbol" SIZE="+2" mathcolor="blue">®</FONT>
<xsl:apply-templates select="*[position()=3]">
<xsl:with-param name="current_indent" select="$current_indent + 5"/>
</xsl:apply-templates>
<xsl:text>(</xsl:text>
<xsl:apply-templates select="*[position()=2]"/>
<!-- -> -->
- <FONT FACE="symbol" SIZE="+2" color="blue">®</FONT>
+ <FONT FACE="symbol" SIZE="+2" mathcolor="blue">®</FONT>
<xsl:apply-templates select="*[position()=3]"/>
<xsl:text>)</xsl:text>
</xsl:otherwise>
</xsl:otherwise>
</xsl:choose>
<xsl:apply-templates select="."/>
- <FONT FACE="symbol" SIZE="+2" color="green">Þ</FONT>
+ <FONT FACE="symbol" SIZE="+2" mathcolor="green">Þ</FONT>
<xsl:apply-templates select="following-sibling::*[position()= 1]">
<xsl:with-param name="current_indent" select="$current_indent + 4 + string-length()"/>
</xsl:apply-templates>
</xsl:when>
</xsl:choose>
<xsl:apply-templates select="."/>
- <FONT FACE="symbol" SIZE="+2" color="green">Þ</FONT>
+ <FONT FACE="symbol" SIZE="+2" mathcolor="green">Þ</FONT>
<xsl:apply-templates select="following-sibling::*[position()= 1]">
<xsl:with-param name="current_indent" select="$current_indent + 2 + string-length()"/>
</xsl:apply-templates>
<xsl:choose>
<xsl:when test="$charlength > $framewidth">
<!-- λ -->
- <FONT FACE="symbol" SIZE="+2" color="red">l</FONT>
+ <FONT FACE="symbol" SIZE="+2" mathcolor="red">l</FONT>
<xsl:apply-templates select="m:bvar/m:ci"/>
<xsl:text>:</xsl:text>
<xsl:apply-templates select="m:bvar/m:type">
</xsl:when>
<xsl:otherwise>
<!-- λ -->
- <FONT FACE="symbol" SIZE="+2" color="red">l</FONT>
+ <FONT FACE="symbol" SIZE="+2" mathcolor="red">l</FONT>
<xsl:apply-templates select="m:bvar/m:ci"/>
<xsl:text>:</xsl:text>
<xsl:apply-templates select="m:bvar/m:type"/>
<xsl:attribute name="href">
<xsl:value-of select="concat(string($header),string($uri))"/>
</xsl:attribute>
- <FONT FACE="symbol" color="blue">
+ <FONT FACE="symbol" mathcolor="blue">
<xsl:value-of select="$symbol"/>
</FONT>
</a>
<xsl:attribute name="href">
<xsl:value-of select="concat(string($header),string($uri))"/>
</xsl:attribute>
- <FONT FACE="symbol" color="blue">
+ <FONT FACE="symbol" mathcolor="blue">
<xsl:value-of select="$symbol"/>
</FONT>
</a>
<xsl:attribute name="href">
<xsl:value-of select="concat(string($header),string($uri))"/>
</xsl:attribute>
- <FONT FACE="symbol" color="blue">Ø</FONT>
+ <FONT FACE="symbol" mathcolor="blue">Ø</FONT>
</a>
<xsl:apply-templates select="*[2]"/>
</xsl:template>
<xsl:attribute name="href">
<xsl:value-of select="concat(string($header),string($uri))"/>
</xsl:attribute>
- <FONT FACE="symbol" color="blue">$</FONT>
+ <FONT FACE="symbol" mathcolor="blue">$</FONT>
</a>
<xsl:apply-templates select="m:bvar/m:ci"/>
<xsl:text>:</xsl:text>
<xsl:attribute name="href">
<xsl:value-of select="concat(string($header),string($uri))"/>
</xsl:attribute>
- <FONT FACE="symbol" color="blue">$</FONT>
+ <FONT FACE="symbol" mathcolor="blue">$</FONT>
</a>
<xsl:apply-templates select="m:bvar/m:ci"/>
<xsl:text>:</xsl:text>
</a>
<SUB>
<xsl:apply-templates select="m:bvar/m:ci"/>
- <FONT FACE="symbol" color="blue">®</FONT>
+ <FONT FACE="symbol" mathcolor="blue">®</FONT>
<xsl:apply-templates select="m:lowlimit"/>
</SUB>
<BR/>
</a>
<SUB>
<xsl:apply-templates select="m:bvar/m:ci"/>
- <FONT FACE="symbol" color="blue">®</FONT>
+ <FONT FACE="symbol" mathcolor="blue">®</FONT>
<xsl:apply-templates select="m:lowlimit"/>
</SUB>
<xsl:apply-templates select="*[4]">
<xsl:attribute name="href">
<xsl:value-of select="concat(string($header),string($uri))"/>
</xsl:attribute>
- <FONT FACE="symbol" SIZE="+2" color="blue">Î</FONT>
+ <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:attribute name="href">
<xsl:value-of select="concat(string($header),string($uri))"/>
</xsl:attribute>
- <FONT FACE="symbol" SIZE="+2" color="blue">Î</FONT>
+ <FONT FACE="symbol" SIZE="+2" mathcolor="blue">Î</FONT>
</a>
<xsl:apply-templates select="*[3]"/>
<xsl:text>)</xsl:text>
<xsl:call-template name="make_indent">
<xsl:with-param name="current_indent" select="$current_indent + 2"/>
</xsl:call-template>
- <FONT FACE="symbol" SIZE="+2" color="blue">Ï</FONT>
+ <FONT FACE="symbol" SIZE="+2" mathcolor="blue">Ï</FONT>
<xsl:apply-templates select="*[3]">
<xsl:with-param name="current_indent" select="$current_indent + 2"/>
</xsl:apply-templates>
<xsl:otherwise>
<xsl:text>(</xsl:text>
<xsl:apply-templates select="*[2]"/>
- <FONT FACE="symbol" SIZE="+2" color="blue">Ï</FONT>
+ <FONT FACE="symbol" SIZE="+2" mathcolor="blue">Ï</FONT>
<xsl:apply-templates select="*[3]"/>
<xsl:text>)</xsl:text>
</xsl:otherwise>
</xsl:variable>
<xsl:choose>
<xsl:when test="count(child::*) = 0">
- <FONT FACE="symbol" color="blue">Æ</FONT>
+ <FONT FACE="symbol" mathcolor="blue">Æ</FONT>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="charlength">
<xsl:attribute name="href">
<xsl:value-of select="concat(string($header),string($uri))"/>
</xsl:attribute>
- <FONT FACE="symbol" SIZE="+2" color="blue">Ç</FONT>
+ <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:attribute name="href">
<xsl:value-of select="concat(string($header),string($uri))"/>
</xsl:attribute>
- <FONT FACE="symbol" SIZE="+2" color="blue">Ç</FONT>
+ <FONT FACE="symbol" SIZE="+2" mathcolor="blue">Ç</FONT>
</a>
<xsl:apply-templates select="*[3]"/>
<xsl:text>)</xsl:text>
<xsl:attribute name="href">
<xsl:value-of select="concat(string($header),string($uri))"/>
</xsl:attribute>
- <FONT FACE="symbol" SIZE="+2" color="blue">È</FONT>
+ <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:attribute name="href">
<xsl:value-of select="concat(string($header),string($uri))"/>
</xsl:attribute>
- <FONT FACE="symbol" SIZE="+2" color="blue">È</FONT>
+ <FONT FACE="symbol" SIZE="+2" mathcolor="blue">È</FONT>
</a>
<xsl:apply-templates select="*[3]"/>
<xsl:text>)</xsl:text>
<xsl:attribute name="href">
<xsl:value-of select="concat(string($header),string($uri))"/>
</xsl:attribute>
- <FONT FACE="symbol" SIZE="+2" color="blue">Í</FONT>
+ <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:attribute name="href">
<xsl:value-of select="concat(string($header),string($uri))"/>
</xsl:attribute>
- <FONT FACE="symbol" SIZE="+2" color="blue">Í</FONT>
+ <FONT FACE="symbol" SIZE="+2" mathcolor="blue">Í</FONT>
</a>
<xsl:apply-templates select="*[3]"/>
<xsl:text>)</xsl:text>
<xsl:attribute name="href">
<xsl:value-of select="concat(string($header),string($uri))"/>
</xsl:attribute>
- <FONT FACE="symbol" SIZE="+2" color="blue">Ì</FONT>
+ <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:attribute name="href">
<xsl:value-of select="concat(string($header),string($uri))"/>
</xsl:attribute>
- <FONT FACE="symbol" SIZE="+2" color="blue">Ì</FONT>
+ <FONT FACE="symbol" SIZE="+2" mathcolor="blue">Ì</FONT>
</a>
<xsl:apply-templates select="*[3]"/>
<xsl:text>)</xsl:text>
</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>
<m:mtable align="baseline 1" equalrows="false" columnalign="left">
<m:mtr>
<m:mtd>
- <m:mo color="Blue"><m:mchar name="ForAll"/></m:mo>
+ <m:mo mathcolor="Blue"><m:mchar name="ForAll"/></m:mo>
<xsl:apply-templates select="m:bvar"/>
</m:mtd>
</m:mtr>
</m:mtable>
</xsl:when>
<xsl:otherwise>
- <m:mo color="Blue"><m:mchar name="ForAll"/></m:mo>
+ <m:mo mathcolor="Blue"><m:mchar name="ForAll"/></m:mo>
<xsl:apply-templates select="m:bvar/m:ci"/>
<m:mo>:</m:mo>
<xsl:apply-templates select="m:bvar/m:type"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
+ <xsl:when test="$name='letin'">
+ <xsl:choose>
+ <xsl:when test="$charlength >= $framewidth">
+ <m:mtable align="baseline 1" equalrows="false" columnalign="left">
+ <m:mtr>
+ <m:mtd>
+ <m:mo>LET</m:mo>
+ <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
+ <xsl:apply-templates select="m:bvar"/>
+ </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>
<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:mo color="Blue">Π</m:mo>
+ <m:mo mathcolor="Blue">Π</m:mo>
<xsl:apply-templates select="m:bvar"/>
</m:mtd>
</m:mtr>
</m:mtable>
</xsl:when>
<xsl:otherwise>
- <m:mo color="Blue">Π</m:mo>
+ <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:mtr>
<m:mtd>
<m:mrow>
- <m:mo color="Blue">→</m:mo>
+ <m:mo mathmathcolor="Blue">→</m:mo>
<xsl:apply-templates select="*[position()=3]"/>
</m:mrow>
</m:mtd>
<xsl:otherwise>
<m:mo stretchy="false">(</m:mo>
<xsl:apply-templates select="*[position()=2]"/>
- <m:mo color="Blue">→</m:mo>
+ <m:mo mathcolor="Blue">→</m:mo>
<xsl:apply-templates select="*[position()=3]"/>
<m:mo stretchy="false">)</m:mo>
</xsl:otherwise>
<m:mtr>
<m:mtd>
<m:mrow>
- <m:mo color="Maroon">:></m:mo>
+ <m:mo mathcolor="Maroon">:></m:mo>
<xsl:apply-templates select="*[position()=3]"/>
</m:mrow>
</m:mtd>
<xsl:otherwise>
<m:mo stretchy="false">(</m:mo>
<xsl:apply-templates select="*[position()=2]"/>
- <m:mo color="Maroon">:></m:mo>
+ <m:mo mathcolor="Maroon">:></m:mo>
<xsl:apply-templates select="*[position()=3]"/>
<m:mo stretchy="false">)</m:mo>
</xsl:otherwise>
<m:mphantom><m:mtext>_</m:mtext></m:mphantom>
<xsl:apply-templates select="."/>
<xsl:if test="$framewidth > $charlength">
- <m:mo color="Green">⇒</m:mo>
+ <m:mo mathcolor="Green">⇒</m:mo>
<xsl:apply-templates select="following-sibling::*[position()= 1]"/>
</xsl:if>
</m:mrow>
<m:mtd>
<m:mrow>
<m:mphantom><m:mtext>|_</m:mtext></m:mphantom>
- <m:mo color="Green">⇒</m:mo>
+ <m:mo mathcolor="Green">⇒</m:mo>
<xsl:apply-templates select="following-sibling::*[position()= 1]"/>
</m:mrow>
</m:mtd>
</xsl:when>
</xsl:choose>
<xsl:apply-templates select="."/>
- <m:mo color="Green">⇒</m:mo>
+ <m:mo mathcolor="Green">⇒</m:mo>
<xsl:apply-templates select="following-sibling::*[position()= 1]"/>
</xsl:for-each>
<m:mphantom><m:mtext>_</m:mtext></m:mphantom>
<m:mtr>
<m:mtd>
<m:mrow>
- <m:mtext color="Maroon">we proved </m:mtext>
+ <m:mtext mathcolor="Maroon">we proved </m:mtext>
<m:mphantom><m:mtext>_</m:mtext></m:mphantom>
<xsl:apply-templates select="*[position()=3]"/>
</m:mrow>
<m:mtr>
<m:mtd>
<m:mrow>
- <m:mtext color="Maroon">we get</m:mtext>
+ <m:mtext mathcolor="Maroon">we get</m:mtext>
<m:mphantom><m:mtext>_</m:mtext></m:mphantom>
<xsl:apply-templates select="."/>
</m:mrow>
<m:mtr>
<m:mtd>
<m:mrow>
- <m:mtext color="Maroon">we get</m:mtext>
+ <m:mtext mathcolor="Maroon">we get</m:mtext>
<m:mphantom><m:mtext>_</m:mtext></m:mphantom>
<xsl:apply-templates select="."/>
</m:mrow>
<m:mtable align="baseline 1" equalrows="false" columnalign="left">
<m:mtr>
<m:mtd>
- <m:mo color="Red">λ</m:mo>
+ <m:mo mathcolor="Red">λ</m:mo>
<xsl:apply-templates select="m:bvar"/>
</m:mtd>
</m:mtr>
</m:mtable>
</xsl:when>
<xsl:otherwise>
- <m:mo color="Red">λ</m:mo>
+ <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"/>
</xsl:stylesheet>
+
<xsl:template match="Variable" mode="noannot">
<Variable name="{@name}" helm:xref="{@id}">
+ <xsl:if test="name(*[1])='body'">
+ <body>
+ <xsl:apply-templates select="body/*"/>
+ </body>
+ </xsl:if>
<type>
<xsl:apply-templates select="type/*"/>
</type>
<!-- <xsl:key name="typeid" use="@of" match="TYPE"/> -->
<!-- ALL this elements does not have inner type -->
-<xsl:template match="PROD|REL|SORT|VAR|META|CONST|MUTIND|MUTCONSTRUCT" mode="noannot">
+<xsl:template match="LETIN|PROD|REL|SORT|VAR|META|CONST|MUTIND|MUTCONSTRUCT" mode="noannot">
<xsl:apply-templates select="." mode="pure"/>
</xsl:template>
-<!-- Unary Operations -->
+<!-- Unary Operations and power -->
<xsl:template match="APPLY[CONST[
attribute::uri='cic:/Coq/Reals/Rdefinitions/Ropp.con' or
<xsl:value-of select="'factorial'"/>
</xsl:when>
<xsl:when test="CONST/@uri='cic:/Coq/Reals/Rbase/Rsqr.con'">
- <xsl:value-of select="'root'"/>
+ <xsl:value-of select="'power'"/>
</xsl:when>
</xsl:choose>
</xsl:variable>
</xsl:attribute>
</xsl:element>
<xsl:apply-templates select="*[2]" mode="noannot"/>
+ <xsl:if test="string($elem)='power'">
+ <m:cn><xsl:value-of select="*[2]/@value"/></m:cn>
+ </xsl:if>
</m:apply>
</xsl:when>
<xsl:otherwise>
</xsl:attribute>
</m:limit>
<m:bvar>
- <m:ci><xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="LAMBDA/target/@binder"/></xsl:with-param></xsl:call-template></m:ci>
+ <m:ci>
+ <xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="LAMBDA/target/@binder"/></xsl:with-param></xsl:call-template>
+ </m:ci>
</m:bvar>
<m:lowlimit>
<xsl:apply-templates select="*[5]" mode="noannot"/>
<xsl:import href="annotatedcont.xsl"/>
-<xsl:key name="id" use="@id" match="LAMBDA|PROD|CAST|REL|SORT|APPLY|VAR|META|CONST|MUTIND|MUTCONSTRUCT|MUTCASE|FIX|COFIX|Definition|Axiom|CurrentProof|InductiveDefinition|Variable"/>
+<xsl:key name="id" use="@id" match="LAMBDA|LETIN|PROD|CAST|REL|SORT|APPLY|VAR|META|CONST|MUTIND|MUTCONSTRUCT|MUTCASE|FIX|COFIX|Definition|Axiom|CurrentProof|InductiveDefinition|Variable"/>
<xsl:include href="basic.xsl"/>
<xsl:include href="set.xsl"/>
<xsl:include href="reals.xsl"/>