<!-- HELM Group: Asperti, Padovani, Sacerdoti, Schena -->
<!--***********************************************************************-->
-<xsl:param name="getterURL" select="'http://localhost:8081/'"/>
-<xsl:param name="processorURL" select="'http://localhost:8080/helm/servlet/uwobo/'"/>
-<xsl:param name="keys" select="'C1,HC2'"/>
-<xsl:param name="naturalLanguage" select="'yes'"/>
-<xsl:param name="annotations" select="'no'"/>
-
-<xsl:variable name="absPath"><xsl:value-of select="$getterURL"/>getciconly?uri=</xsl:variable>
-
-<xsl:variable name="header"><xsl:value-of select="$processorURL"/>apply?keys=<xsl:value-of select="$keys"/>&param.naturalLanguage=<xsl:value-of select="$naturalLanguage"/>&param.annotations=<xsl:value-of select="$annotations"/>&param.keys=<xsl:value-of select="$keys"/>&param.getterURL=<xsl:value-of select="$getterURL"/>&param.processorURL=<xsl:value-of select="$processorURL"/>&xmluri=<xsl:value-of select="$absPath"/></xsl:variable>
-
<xsl:include href="html_init.xsl"/>
<xsl:include href="html_set.xsl"/>
<xsl:include href="html_reals.xsl"/>
<xsl:variable name="showcast" select="0"/>
-<xsl:template name="makeURL">
- <xsl:param name="url" select="''"/>
- <xsl:value-of select="concat(string($header),string($url),'&param.CICURI=',string($url))"/>
-</xsl:template>
-
<!--***********************************************************************-->
<!-- HTML Head and Body -->
<!--***********************************************************************-->
media-type="text/html"
doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" />
-<xsl:variable name="framewidth" select="36"/>
+<xsl:variable name="framewidth" select="45"/>
<xsl:template match="/">
<xsl:param name="current_indent" select="0"/>
<xsl:template mode="inline" match="m:ci">
<xsl:choose>
<xsl:when test="boolean(@definitionURL)">
- <a>
- <xsl:attribute name="href">
- <xsl:call-template name="makeURL">
- <xsl:with-param name="url" select="@definitionURL"/>
- </xsl:call-template>
- </xsl:attribute>
+ <a href="{@definitionURL}">
<xsl:apply-templates/>
</a>
</xsl:when>
<FONT color="red"> proves </FONT>
<xsl:apply-templates mode="inline" select="*[position()=3]"/>
</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]"/>
</xsl:otherwise>
</xsl:choose>
+ <xsl:variable name="charlength_first">
+ <xsl:apply-templates select="*[3]" mode="charcount"/>
+ </xsl:variable>
+ <xsl:variable name="charlength_second">
+ <xsl:apply-templates select="*[4]" mode="charcount"/>
+ </xsl:variable>
+ <xsl:variable name="charlength_side_proof">
+ <xsl:apply-templates select="*[5]" mode="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="$charlength"/> -->
<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 select="*[3]"/>
- <FONT color="red"> with </FONT>
- <xsl:apply-templates select="*[4]"/>
- <FONT color="red"> by </FONT>
- <xsl:apply-templates select="*[5]"/>
+ <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"/>
+ </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"/>
+ </xsl:call-template>
+ </xsl:if>
+ <FONT color="red">by </FONT>
+ <xsl:apply-templates select="*[5]">
+ <xsl:with-param name="current_indent" select="$current_indent+5"/>
+ </xsl:apply-templates>
</xsl:when>
<!-- rewrite and apply -->
<xsl:when test="$name='rewrite_and_apply'">
<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>
+ <!-- nat_ind -->
+ <xsl:when test="$name='nat_ind_complete'">
+ <FONT color="red">By induction on </FONT>
+ <xsl:apply-templates select="*[2]"/>:
+ <br/>
+ <xsl:call-template name="make_indent">
+ <xsl:with-param name="current_indent" select="$current_indent"/>
+ </xsl:call-template>
+ <xsl:text>0 </xsl:text>
+ <FONT FACE="Symbol" mathcolor="green">Þ</FONT>
+ <xsl:apply-templates select="*[3]">
+ <xsl:with-param name="current_indent" select="$current_indent + 8"/>
+ </xsl:apply-templates>
+ <br/>
+ <xsl:call-template name="make_indent">
+ <xsl:with-param name="current_indent" select="$current_indent"/>
+ </xsl:call-template>
+ <xsl:text>S(</xsl:text>
+ <xsl:apply-templates select="*[4]"/>
+ <xsl:text>) </xsl:text>
+ <FONT FACE="Symbol" mathcolor="green">Þ</FONT>
+ <FONT color="red">Assume by induction</FONT>
+ <br/>
+ <xsl:call-template name="make_indent">
+ <xsl:with-param name="current_indent" select="$current_indent +10"/>
+ </xsl:call-template>
+ <xsl:text>(</xsl:text>
+ <xsl:apply-templates select="*[5]"/>
+ <xsl:text>)</xsl:text>
+ <xsl:apply-templates select="*[6]">
+ <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 +10"/>
+ </xsl:call-template>
+ <xsl:apply-templates select="*[7]">
+ <xsl:with-param name="current_indent" select="$current_indent + 10"/>
+ </xsl:apply-templates>
+ </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: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:template match="m:ci">
<xsl:choose>
<xsl:when test="boolean(@definitionURL)">
- <a>
- <xsl:attribute name="href">
- <xsl:call-template name="makeURL">
- <xsl:with-param name="url" select="@definitionURL"/>
- </xsl:call-template>
- </xsl:attribute>
+ <a href="{@definitionURL}">
<xsl:apply-templates/>
</a>
</xsl:when>