3 <!-- Copyright (C) 2000, HELM Team -->
5 <!-- This file is part of HELM, an Hypertextual, Electronic -->
6 <!-- Library of Mathematics, developed at the Computer Science -->
7 <!-- Department, University of Bologna, Italy. -->
9 <!-- HELM is free software; you can redistribute it and/or -->
10 <!-- modify it under the terms of the GNU General Public License -->
11 <!-- as published by the Free Software Foundation; either version 2 -->
12 <!-- of the License, or (at your option) any later version. -->
14 <!-- HELM is distributed in the hope that it will be useful, -->
15 <!-- but WITHOUT ANY WARRANTY; without even the implied warranty of -->
16 <!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -->
17 <!-- GNU General Public License for more details. -->
19 <!-- You should have received a copy of the GNU General Public License -->
20 <!-- along with HELM; if not, write to the Free Software -->
21 <!-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, -->
22 <!-- MA 02111-1307, USA. -->
24 <!-- For details, see the HELM World-Wide-Web page, -->
25 <!-- http://cs.unibo.it/helm/. -->
27 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
28 xmlns:m="http://www.w3.org/1998/Math/MathML">
30 <!--***********************************************************************-->
31 <!-- From MathML content to HTML -->
32 <!-- HELM Group: Asperti, Padovani, Sacerdoti, Schena, Guidi -->
33 <!--***********************************************************************-->
35 <xsl:param name="CICURI" select="''"/>
36 <xsl:param name="type" select="'standalone'"/>
37 <xsl:param name="UNICODEvsSYMBOL" select="'symbol'"/>
39 <xsl:include href="nuprl_html_arith.xsl"/>
40 <xsl:include href="nuprl_html_basic.xsl"/>
42 <xsl:variable name="showcast" select="0"/>
44 <!--***********************************************************************-->
45 <!-- HTML Head and Body -->
46 <!--***********************************************************************-->
48 <!-- <xsl:output method="html" encoding="iso-8859-1"/> -->
50 <!-- document needs method="xml" and searches locally for the dtd if -->
51 <!-- doctype-system is specified (the dtd must exist locally for parsing). -->
52 <!-- For having output html must be media-type="html" and for having the -->
53 <!-- correct <br /> you must specify at least the remote dtd by means of -->
54 <!-- doctype-public -->
58 media-type="text/html"
59 doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" />
61 <xsl:variable name="framewidth" select="55"/>
63 <xsl:template match="m:ci">
64 <xsl:if test="m:ci=Ax">
65 <FONT color="blue" size="+1">
66 <xsl:text>Ax</xsl:text>
69 <xsl:if test="m:ci=void">
70 <FONT color="blue" size="+1">
71 <xsl:text>Void</xsl:text>
77 <xsl:variable name="forall">
79 <xsl:when test="$UNICODEvsSYMBOL = 'symbol'">"</xsl:when>
80 <xsl:when test="$UNICODEvsSYMBOL = 'unicode'">∀</xsl:when>
81 <xsl:otherwise>???</xsl:otherwise>
85 <xsl:variable name="lambda">
87 <xsl:when test="$UNICODEvsSYMBOL = 'symbol'">l</xsl:when>
88 <xsl:when test="$UNICODEvsSYMBOL = 'unicode'">λ</xsl:when>
89 <xsl:otherwise>???</xsl:otherwise>
93 <xsl:variable name="prod">
95 <xsl:when test="$UNICODEvsSYMBOL = 'symbol'">Õ</xsl:when>
96 <xsl:when test="$UNICODEvsSYMBOL = 'unicode'">Π</xsl:when>
97 <xsl:otherwise>???</xsl:otherwise>
101 <xsl:variable name="arrow">
103 <xsl:when test="$UNICODEvsSYMBOL = 'symbol'">®</xsl:when>
104 <xsl:when test="$UNICODEvsSYMBOL = 'unicode'">→</xsl:when>
105 <xsl:otherwise>???</xsl:otherwise>
109 <xsl:variable name="RightArrow">
111 <xsl:when test="$UNICODEvsSYMBOL = 'symbol'">Þ</xsl:when>
112 <xsl:when test="$UNICODEvsSYMBOL = 'unicode'">⇒</xsl:when>
113 <xsl:otherwise>???</xsl:otherwise>
118 <xsl:template name="mksymbol">
119 <xsl:param name="symbol" select="'???'"/>
120 <xsl:param name="color" select="'blue'"/>
121 <xsl:param name="size" select="''"/>
124 <xsl:when test="$UNICODEvsSYMBOL = 'symbol'">
125 <FONT FACE="symbol" SIZE="{$size}" COLOR="{$color}">
126 <xsl:value-of select="$symbol"/>
130 <FONT COLOR="{$color}">
131 <xsl:value-of select="$symbol"/>
137 <xsl:template match="/">
138 <xsl:param name="current_indent" select="0"/>
140 <xsl:when test="$type = 'standalone'">
143 <title> <xsl:value-of select="$CICURI"/> </title> <!-- FG -->
144 <style> A { text-decoration: none } </style>
146 <xsl:text disable-output-escaping="yes">
148 function Hide(which){
149 if (!document.getElementById)
151 which.style.display="none"
154 function Show(which){
155 if (!document.getElementById)
157 which.style.display=""
160 document.to_be_deleted = new Array();
165 <body bgcolor="white">
166 <xsl:attribute name="onLoad">
167 if(document.getElementById)
168 for(var i=0;i<document.to_be_deleted.length;i++)
169 Hide(document.getElementById(document.to_be_deleted[i]));
171 <xsl:apply-templates>
172 <xsl:with-param name="current_indent" select="0"/>
173 </xsl:apply-templates>
179 <xsl:apply-templates>
180 <xsl:with-param name="current_indent" select="0"/>
181 </xsl:apply-templates>
187 <!--***********************************************************************-->
189 <!--***********************************************************************-->
191 <xsl:template name="make_indent">
192 <xsl:param name="current_indent" select="0"/>
193 <xsl:if test="$current_indent > 0">
194 <xsl:text> </xsl:text>
195 <xsl:call-template name="make_indent">
196 <xsl:with-param name="current_indent" select="$current_indent - 1"/>
201 <!-- Syntactic Sugar -->
202 <xsl:template match="m:type">
203 <xsl:param name="current_indent" select="0"/>
204 <xsl:apply-templates>
205 <xsl:with-param name="current_indent"
206 select="$current_indent"/>
207 </xsl:apply-templates>
210 <xsl:template match="m:condition">
211 <xsl:param name="current_indent" select="0"/>
212 <xsl:apply-templates>
213 <xsl:with-param name="current_indent"
214 select="$current_indent"/>
215 </xsl:apply-templates>
218 <xsl:template match="m:math">
219 <xsl:param name="current_indent" select="0"/>
220 <xsl:apply-templates>
221 <xsl:with-param name="current_indent"
222 select="$current_indent"/>
223 </xsl:apply-templates>
228 <!--*********************************************************************-->
230 <!--*********************************************************************-->
233 <xsl:template mode="inline" match="m:ci">
235 <xsl:when test="boolean(@definitionURL)">
236 <a href="{@definitionURL}">
237 <xsl:apply-templates/>
241 <xsl:value-of select="."/>
248 <xsl:template match="m:apply[m:csymbol]" mode="inline">
249 <xsl:variable name="name">
250 <xsl:value-of select="m:csymbol"/>
252 <xsl:variable name="uri"><xsl:value-of select="*[1]/@definitionURL"/></xsl:variable>
255 <!-- FUNCTION (PROD) -->
256 <xsl:when test="$name='prod'">
257 <xsl:if test="m:bvar[m:ci]">
258 <xsl:if test="m:bvar/m:ci=""">
259 <xsl:text>""</xsl:text>
261 <xsl:value-of select="m:bvar/m:ci"/>
262 <xsl:text>:</xsl:text>
264 <xsl:if test="m:bvar/m:type/*[*]">
265 <xsl:text>( </xsl:text>
267 <xsl:apply-templates select="m:bvar/m:type"/>
268 <xsl:if test="m:bvar/m:type/*[*]">
269 <xsl:text> )</xsl:text>
271 <xsl:call-template name="mksymbol">
272 <xsl:with-param name="symbol" select="$arrow"/>
273 <xsl:with-param name="color" select="'blue'"/>
274 <xsl:with-param name="size" select="'+2'"/>
276 <xsl:apply-templates select="*[3]"/>
280 <xsl:when test="$name='forall'">
281 <xsl:call-template name="mksymbol">
282 <xsl:with-param name="symbol" select="$forall"/>
283 <xsl:with-param name="color" select="'blue'"/>
284 <xsl:with-param name="size" select="'+2'"/>
286 <xsl:apply-templates select="m:bvar/m:ci"/>
287 <xsl:text>:</xsl:text>
288 <xsl:if test="count(m:bvar/m:type/m:apply/*) > 1">
289 <xsl:text>(</xsl:text>
291 <xsl:apply-templates select="m:bvar/m:type"/>
292 <xsl:if test="count(m:bvar/m:type/m:apply/*) > 1">
293 <xsl:text>)</xsl:text>
295 <xsl:text>.</xsl:text>
296 <xsl:apply-templates select="*[position()=3]"/>
297 <xsl:if test="count(m:bvar/m:type/m:apply/*) > 1">
298 <xsl:text>)</xsl:text>
304 <xsl:when test="$name='product'">
305 <xsl:apply-templates mode="inline" select="m:bvar/m:ci"/>
306 <xsl:text>:</xsl:text>
307 <xsl:apply-templates mode="inline" select="m:bvar/m:type"/>
309 <xsl:text>x</xsl:text>
311 <xsl:apply-templates mode="inline" select="*[position()=3]"/>
315 <xsl:when test="$name='product_ind'">
316 <xsl:apply-templates mode="inline" select="m:type"/>
318 <xsl:text>x</xsl:text>
320 <xsl:apply-templates mode="inline" select="*[position()=3]"/>
324 <xsl:when test="$name='pair'">
325 <FONT color="blue" size="+1">
326 <xsl:text><</xsl:text>
328 <xsl:apply-templates select="*[2]"/>
329 <xsl:text>, </xsl:text>
330 <xsl:apply-templates select="*[3]"/>
331 <FONT color="blue" size="+1">
332 <xsl:text>></xsl:text>
337 <xsl:when test="$name='union'">
338 <xsl:apply-templates select="*[2]"/>
339 <FONT color="blue" size="+1">
340 <xsl:text>+</xsl:text>
342 <xsl:apply-templates select="*[3]"/>
346 <xsl:when test="$name='inl'">
348 <xsl:text>inl (</xsl:text>
350 <xsl:apply-templates select="*[2]"/>
352 <xsl:text> )</xsl:text>
357 <xsl:when test="$name='inr'">
358 <FONT color="blue" size="+1">
359 <xsl:text>inr (</xsl:text>
361 <xsl:apply-templates select="*[2]"/>
362 <FONT color="blue" size="+1">
363 <xsl:text> )</xsl:text>
368 <xsl:when test="$name='equal'">
369 <xsl:apply-templates select="*[position()=3]"/>
370 <FONT color="blue" size="+1">
371 <xsl:text> = </xsl:text>
373 <xsl:apply-templates select="*[position()=4]"/>
375 <xsl:text> </xsl:text>
376 <xsl:call-template name="mksymbol">
377 <xsl:with-param name="symbol" select="$member"/>
378 <xsl:with-param name="color" select="'blue'"/>
379 <xsl:with-param name="size" select="'+0'"/>
381 <xsl:text> </xsl:text>
382 <xsl:apply-templates select="*[position()=2]">
383 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
384 </xsl:apply-templates>
388 <xsl:when test="$name='cons'">
389 <xsl:apply-templates select="*[2]"/>
391 <xsl:text>::</xsl:text>
393 <xsl:apply-templates select="*[3]"/>
398 <xsl:when test="$name='rec'">
400 <xsl:text>rectype</xsl:text>
402 <xsl:apply-templates select="*[2]"/>
404 <xsl:text>=</xsl:text>
406 <xsl:apply-templates select="*[3]"/>
412 <xsl:when test="$name='t_set'">
414 <xsl:text>{</xsl:text>
417 <xsl:when test="m:bvar/m:ci">
418 <xsl:apply-templates select="m:bvar/m:ci"/>
420 <xsl:text>:</xsl:text>
422 <xsl:apply-templates select="m:bvar/m:type"/>
425 <xsl:apply-templates select="m:bvar/m:type"/>
429 <xsl:text>|</xsl:text>
431 <xsl:apply-templates select="*[3]"/>
436 <xsl:when test="$name='isect'">
437 <xsl:call-template name="mksymbol">
438 <xsl:with-param name="symbol" select="$intersection"/>
439 <xsl:with-param name="color" select="'blue'"/>
440 <xsl:with-param name="size" select="'+0'"/>
442 <xsl:apply-templates select="m:bvar/m:ci"/>
444 <xsl:text>:</xsl:text>
446 <xsl:apply-templates select="m:bvar/m:type"/>
448 <xsl:text>.</xsl:text>
450 <xsl:apply-templates select="*[3]"/>
455 <xsl:when test="$name='quotient'">
456 <xsl:apply-templates select="m:bvar[1]"/>
457 <xsl:text>,</xsl:text>
458 <xsl:apply-templates select="m:bvar[2]"/>
460 <xsl:text>:</xsl:text>
462 <xsl:apply-templates select="*[2]"/>
464 <xsl:text>//</xsl:text>
466 <xsl:apply-templates select="*[5]"/>
469 <!-- ARROW --> <!-- FUNCTION (IND) -->
470 <xsl:when test="$name='arrow'">
471 <xsl:text>(</xsl:text>
472 <xsl:apply-templates mode="inline" select="*[position()=2]"/>
473 <xsl:call-template name="mksymbol">
474 <xsl:with-param name="symbol" select="$arrow"/>
475 <xsl:with-param name="color" select="'blue'"/>
476 <xsl:with-param name="size" select="'+0'"/>
478 <xsl:apply-templates mode="inline" select="*[position()=3]"/>
479 <xsl:text>)</xsl:text>
483 <xsl:when test="$name='app'">
484 <xsl:text>(</xsl:text>
485 <xsl:apply-templates mode="inline" select="*[position()=2]"/>
486 <xsl:for-each select="*[position()>2]">
487 <xsl:text> </xsl:text>
488 <xsl:apply-templates mode="inline" select="."/>
490 <xsl:text>)</xsl:text>
493 <xsl:when test="$name='cast'">
494 <xsl:text>(</xsl:text>
495 <xsl:apply-templates mode="inline" select="*[position()=2]"/>
496 <xsl:text>:></xsl:text>
497 <xsl:apply-templates mode="inline" select="*[position()=3]"/>
498 <xsl:text>)</xsl:text>
500 <xsl:when test="$name='Prop'">
501 <FONT color="violet">Prop</FONT>
503 <xsl:when test="$name='Set'">
504 <FONT color="violet">Set</FONT>
506 <xsl:when test="$name='Type'">
507 <FONT color="violet">Type</FONT>
511 <xsl:when test="$name='mutcase'">
512 <xsl:text><</xsl:text>
513 <xsl:apply-templates mode="inline" select="*[position()=2]"/>
514 <xsl:text>> </xsl:text>
515 <FONT color="red">CASE </FONT>
516 <xsl:apply-templates mode="inline" select="*[position()=3]"/>
517 <FONT color="red"> OF </FONT>
518 <xsl:for-each select="piecewise/piece">
519 <!--<xsl:for-each select="*[position() mod 2 = 0 and position()>3]">-->
521 <xsl:when test="not(position() = 1)">
522 <xsl:text> | </xsl:text>
525 <xsl:apply-templates mode="inline" select="./*[2]"/>
526 <xsl:call-template name="mksymbol">
527 <xsl:with-param name="symbol" select="$RightArrow"/>
528 <xsl:with-param name="color" select="'green'"/>
529 <xsl:with-param name="size" select="'+0'"/>
531 <xsl:apply-templates mode="inline"
537 <xsl:when test="$name='fix'">
538 <FONT color="red">FIX</FONT>
539 <xsl:value-of select="m:ci"/>
540 <xsl:text>{</xsl:text>
541 <xsl:for-each select="m:bvar">
542 <xsl:value-of select="m:ci"/>
543 <xsl:text>:</xsl:text>
544 <xsl:apply-templates mode="inline" select="m:type"/>
545 <xsl:text>:=</xsl:text>
546 <xsl:apply-templates mode="inline"
547 select="following-sibling::*[position() = 1]"/>
549 <xsl:when test="position()=last()">
550 <xsl:text>}</xsl:text>
553 <xsl:text>;</xsl:text>
560 <xsl:when test="$name='cofix'">
561 <xsl:text>COFIX</xsl:text>
562 <xsl:value-of select="m:ci"/>
563 <xsl:text>{</xsl:text>
564 <xsl:for-each select="m:bvar">
565 <xsl:value-of select="m:ci"/>
566 <xsl:text>:</xsl:text>
567 <xsl:apply-templates mode="inline" select="m:type"/>
568 <xsl:text>:=</xsl:text>
569 <xsl:apply-templates mode="inline"
570 select="following-sibling::*[position() = 1]"/>
572 <xsl:when test="position()=last()">
573 <xsl:text>}</xsl:text>
576 <xsl:text>;</xsl:text>
583 <xsl:when test="$name='proof' or $name='side_proof'">
584 <xsl:apply-templates mode="inline" select="*[position()=2]"/>
585 <FONT color="red"> proves </FONT>
586 <xsl:apply-templates mode="inline" select="*[position()=3]"/>
588 <xsl:when test="$name='letin1'">
589 <xsl:text>letin1 (inline error)</xsl:text>
592 <xsl:when test="$name='false_ind'">
593 <xsl:apply-templates mode="inline" select="*[3]"/>
594 <FONT color="red">Contradiction.</FONT>
597 <xsl:when test="$name='and_ind'">
598 <FONT color="red">From </FONT>
599 <xsl:apply-templates select="*[2]"/>
600 <FONT color="red"> we get</FONT>
602 <xsl:apply-templates select="*[3]"/>
604 <xsl:apply-templates mode="inline" select="*[4]"/>
605 <FONT color="red"> and </FONT>
607 <xsl:apply-templates select="*[5]"/>
609 <xsl:apply-templates mode="inline" select="*[6]"/>
611 <FONT color="red"> hence </FONT>
612 <xsl:apply-templates mode="inline" select="*[7]"/>
618 <xsl:template mode="inline" match="m:lambda">
619 <xsl:call-template name="mksymbol">
620 <xsl:with-param name="symbol" select="'lambda'"/>
621 <xsl:with-param name="color" select="'red'"/>
622 <xsl:with-param name="size" select="'+2'"/>
625 <!-- IN NuPrl non e' specificato il tipo -->
626 <xsl:apply-templates select="m:bvar/m:ci"/>
627 <xsl:if test="m:bvar[m:mtype]">
628 <xsl:text>:</xsl:text>
629 <xsl:apply-templates mode="inline" select="m:bvar/m:type"/>
631 <xsl:text>.</xsl:text>
632 <xsl:apply-templates mode="inline" select="*[position()=2]"/>
635 <!--*********************************************************************-->
636 <!-- COUNTING MODE -->
637 <!--*********************************************************************-->
639 <xsl:template match="m:apply[m:csymbol]">
640 <xsl:param name="current_indent" select="0"/>
641 <xsl:param name="width" select="$framewidth"/>
642 <xsl:variable name="name">
643 <xsl:value-of select="m:csymbol"/>
645 <xsl:variable name="charlength">
646 <xsl:apply-templates select="m:csymbol" mode="charcount"/>
648 <!-- <xsl:value-of select="$current_indent"/> -->
649 <!-- <xsl:value-of select="$charlength"/> -->
650 <xsl:variable name="uri"><xsl:value-of select="*[1]/@definitionURL"/></xsl:variable>
653 <!-- FUNCTION (PROD) -->
654 <xsl:when test="$name='prod'">
656 <xsl:when test="$charlength > $framewidth">
657 <xsl:apply-templates select="m:bvar/m:ci"/>
658 <xsl:text>:</xsl:text>
659 <xsl:if test="m:bvar/m:type/*[*]">
660 <xsl:text>( </xsl:text>
662 <xsl:apply-templates select="m:bvar/m:type">
663 <xsl:with-param name="current_indent"
664 select="$current_indent + 5 + 2*string-length(m:bvar/m:ci)"/>
665 </xsl:apply-templates>
667 <xsl:call-template name="make_indent">
668 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
670 <xsl:call-template name="mksymbol">
671 <xsl:with-param name="symbol" select="'arrow'"/>
672 <xsl:with-param name="color" select="'blue'"/>
673 <xsl:with-param name="size" select="'+2'"/>
675 <xsl:apply-templates select="*[position()=3]">
676 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
677 </xsl:apply-templates>
678 <xsl:if test="m:bvar/m:type/*[*]">
679 <xsl:text>( </xsl:text>
683 <xsl:apply-templates mode="inline" select="."/>
689 <xsl:when test="$name='type_of'">
690 <xsl:value-of select="*[2]"/>
691 <xsl:text>:</xsl:text>
693 <!--<xsl:value-of select="*[3]"/>-->
694 <xsl:if test="count(*[3]/*) > 1">
695 <xsl:text>(</xsl:text>
697 <xsl:apply-templates select="*[3]"/>
698 <xsl:if test="count(*[3]/*) > 1">
699 <xsl:text>)</xsl:text>
703 <xsl:call-template name="make_indent">
704 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
709 <xsl:when test="$name='forall'">
711 <xsl:when test="$charlength > $framewidth">
713 <xsl:call-template name="mksymbol">
714 <xsl:with-param name="symbol" select="$forall"/>
715 <xsl:with-param name="color" select="'blue'"/>
716 <xsl:with-param name="size" select="'+2'"/>
718 <xsl:apply-templates select="m:bvar/m:ci"/>
719 <xsl:text>:</xsl:text>
720 <xsl:apply-templates select="m:bvar/m:type">
721 <xsl:with-param name="current_indent"
722 select="$current_indent + 5 + 2*string-length(m:bvar/m:ci)"/>
723 </xsl:apply-templates>
725 <xsl:call-template name="make_indent">
726 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
728 <xsl:text>.</xsl:text>
729 <xsl:apply-templates select="*[position()=3]">
730 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
731 </xsl:apply-templates>
734 <xsl:apply-templates mode="inline" select="."/>
740 <xsl:when test="$name='prod'">
742 <xsl:when test="$charlength > $framewidth">
743 <xsl:call-template name="mksymbol">
744 <xsl:with-param name="symbol" select="$name"/>
745 <xsl:with-param name="color" select="'blue'"/>
746 <xsl:with-param name="size" select="'+2'"/>
748 <xsl:apply-templates select="m:bvar/m:ci"/>
749 <xsl:text>:</xsl:text>
750 <xsl:apply-templates select="m:bvar/m:type">
751 <xsl:with-param name="current_indent"
752 select="$current_indent + 5 + 2*string-length(m:bvar/m:ci)"/>
753 </xsl:apply-templates><br/>
754 <xsl:call-template name="make_indent">
755 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
757 <xsl:text>.</xsl:text>
758 <xsl:apply-templates select="*[position()=3]">
759 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
760 </xsl:apply-templates>
763 <xsl:apply-templates mode="inline" select="."/>
769 <xsl:when test="$name='prod_ind'">
771 <xsl:when test="$charlength > $framewidth">
772 <xsl:call-template name="mksymbol">
773 <xsl:with-param name="symbol" select="$name"/>
774 <xsl:with-param name="color" select="'blue'"/>
775 <xsl:with-param name="size" select="'+2'"/>
777 <xsl:apply-templates select="m:type">
778 <xsl:with-param name="current_indent"
779 select="$current_indent + 5 + 2*string-length(m:bvar/m:ci)"/>
780 </xsl:apply-templates><br/>
781 <xsl:call-template name="make_indent">
782 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
784 <xsl:text>.</xsl:text>
785 <xsl:apply-templates select="*[position()=3]">
786 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
787 </xsl:apply-templates>
790 <xsl:apply-templates mode="inline" select="."/>
796 <xsl:when test="$name='pair'">
798 <xsl:when test="$charlength > $framewidth">
799 <FONT color="blue" size="+1">
800 <xsl:text><</xsl:text>
802 <xsl:apply-templates select="*[position()=2]">
803 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
804 </xsl:apply-templates>
805 <xsl:text>, </xsl:text>
807 <xsl:call-template name="make_indent">
808 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
810 <xsl:apply-templates select="*[position()=3]"/>
811 <FONT color="blue" size="+1">
812 <xsl:text>></xsl:text>
816 <xsl:apply-templates mode="inline" select="."/>
822 <xsl:when test="$name='union'">
824 <xsl:when test="$charlength > $framewidth">
825 <xsl:apply-templates select="*[position()=2]">
826 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
827 </xsl:apply-templates>
829 <xsl:call-template name="make_indent">
830 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
832 <FONT color="blue" size="+1">
833 <xsl:text>+</xsl:text>
835 <xsl:apply-templates select="*[position()=3]"/>
838 <xsl:apply-templates mode="inline" select="."/>
844 <xsl:when test="$name='inl'">
846 <xsl:when test="$charlength > $framewidth">
848 <xsl:text>inl (</xsl:text>
850 <xsl:apply-templates select="*[position()=2]">
851 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
852 </xsl:apply-templates>
854 <xsl:call-template name="make_indent">
855 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
858 <xsl:text> )</xsl:text>
862 <xsl:apply-templates mode="inline" select="."/>
868 <xsl:when test="$name='inr'">
870 <xsl:when test="$charlength > $framewidth">
871 <FONT color="blue" size="+1">
872 <xsl:text>inr (</xsl:text>
874 <xsl:apply-templates select="*[position()=2]">
875 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
876 </xsl:apply-templates>
878 <xsl:call-template name="make_indent">
879 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
881 <FONT color="blue" size="+1">
882 <xsl:text> )</xsl:text>
886 <xsl:apply-templates mode="inline" select="."/>
892 <xsl:when test="$name='prop'">
893 <FONT color="blue" size="+1">
894 <xsl:text>P</xsl:text>
896 <FONT color="blue" size="2">
897 <xsl:apply-templates select="m:cn"/>
902 <xsl:when test="$name='universe'">
903 <FONT color="blue" size="+1">
904 <xsl:text>U</xsl:text>
906 <FONT color="blue" size="2">
907 <xsl:apply-templates select="m:cn"/>
912 <xsl:when test="$name='equal'">
914 <xsl:when test="$charlength > $framewidth">
915 <xsl:apply-templates select="*[position()=3]"/>
916 <FONT color="blue" size="+1">
917 <xsl:text>=</xsl:text>
919 <xsl:apply-templates select="*[position()=4]">
920 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
921 </xsl:apply-templates>
923 <xsl:call-template name="make_indent">
924 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
927 <xsl:call-template name="mksymbol">
928 <xsl:with-param name="symbol" select="'member'"/>
929 <xsl:with-param name="color" select="'blue'"/>
930 <xsl:with-param name="size" select="'+0'"/>
932 <xsl:apply-templates select="*[position()=2]">
933 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
934 </xsl:apply-templates>
937 <xsl:apply-templates mode="inline" select="."/>
944 <xsl:when test="$name='token'">
946 <xsl:text>"</xsl:text>
948 <xsl:apply-templates select="m:ci"/>
950 <xsl:text>"</xsl:text>
956 <xsl:when test="$name='nil'">
958 <xsl:text>[]</xsl:text>
963 <xsl:when test="$name='cons'">
964 <xsl:apply-templates select="*[2]">
965 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
966 </xsl:apply-templates>
968 <xsl:call-template name="make_indent">
969 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
972 <xsl:text>::</xsl:text>
974 <xsl:apply-templates select="*[3]"/>
980 <xsl:when test="$name='rec'">
982 <xsl:text>rectype</xsl:text>
984 <xsl:apply-templates select="*[2]">
985 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
986 </xsl:apply-templates>
988 <xsl:call-template name="make_indent">
989 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
992 <xsl:text>=</xsl:text>
994 <xsl:apply-templates select="*[3]"/>
999 <xsl:when test="$name='t_set'">
1001 <xsl:text>{</xsl:text>
1004 <xsl:when test="m:bvar/m:ci">
1005 <xsl:apply-templates select="m:bvar/m:ci"/>
1007 <xsl:text>:</xsl:text>
1009 <xsl:apply-templates select="m:bvar/m:type">
1010 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1011 </xsl:apply-templates>
1013 <xsl:call-template name="make_indent">
1014 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1015 </xsl:call-template>
1019 <xsl:apply-templates select="m:bvar/m:type">
1020 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1021 </xsl:apply-templates>
1023 <xsl:call-template name="make_indent">
1024 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1025 </xsl:call-template>
1029 <xsl:text>|</xsl:text>
1031 <xsl:apply-templates select="*[3]"/>
1036 <xsl:when test="$name='isect'">
1037 <xsl:call-template name="mksymbol">
1038 <xsl:with-param name="symbol" select="'intersection'"/>
1039 <xsl:with-param name="color" select="'blue'"/>
1040 <xsl:with-param name="size" select="'+0'"/>
1041 </xsl:call-template>
1042 <xsl:apply-templates select="m:bvar/m:ci"/>
1044 <xsl:text>:</xsl:text>
1046 <xsl:apply-templates select="m:bvar/m:type">
1047 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1048 </xsl:apply-templates>
1050 <xsl:call-template name="make_indent">
1051 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1052 </xsl:call-template>
1054 <xsl:text>.</xsl:text>
1056 <xsl:apply-templates select="*[3]"/>
1061 <xsl:when test="$name='quotient'">
1062 <xsl:apply-templates select="m:bvar[1]"/>
1063 <xsl:text>,</xsl:text>
1064 <xsl:apply-templates select="m:bvar[2]"/>
1066 <xsl:text>:</xsl:text>
1068 <xsl:apply-templates select="*[2]">
1069 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1070 </xsl:apply-templates>
1072 <xsl:call-template name="make_indent">
1073 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1074 </xsl:call-template>
1076 <xsl:text>//</xsl:text>
1078 <xsl:apply-templates select="*[5]"/>
1081 <!-- IF_THEN_ELSE -->
1083 <xsl:when test="$name='if_then_else'">
1085 <xsl:when test="m:where = 'atom_eq'">
1087 <xsl:text>atom_eq (</xsl:text>
1090 <xsl:when test="m:where = 'int_eq'">
1092 <xsl:text>int_eq (</xsl:text>
1095 <xsl:when test="m:where = 'less'">
1097 <xsl:text>less (</xsl:text>
1101 <xsl:apply-templates select="*[3]"/>
1102 <xsl:text>; </xsl:text>
1103 <xsl:apply-templates select="*[4]"/>
1104 <xsl:text>; </xsl:text>
1105 <xsl:apply-templates select="*[5]"/>
1106 <xsl:text>; </xsl:text>
1107 <xsl:apply-templates select="*[6]"/>
1109 <xsl:text>)</xsl:text>
1115 <xsl:when test="$name='mutcase'">
1118 <xsl:when test="*[4]/*[1]/m:csymbol = 'pair'">
1120 <xsl:text>spread (</xsl:text>
1122 <xsl:apply-templates select="*[3]"/>
1123 <xsl:text>; </xsl:text>
1124 <xsl:apply-templates select="*[4]/*[1]/*[2]"/>
1125 <xsl:text>, </xsl:text>
1126 <xsl:apply-templates select="*[4]/*[1]/*[3]"/>
1127 <xsl:text>. </xsl:text>
1128 <xsl:apply-templates select="*[4]/*[2]"/>
1130 <xsl:text>)</xsl:text>
1134 <xsl:when test="*[4]/*[1]/m:csymbol = 'inl'">
1136 <xsl:text>decide (</xsl:text>
1138 <xsl:apply-templates select="*[3]"/>
1139 <xsl:text>; </xsl:text>
1140 <xsl:apply-templates select="*[4]/*[1]/*[2]"/>
1141 <xsl:text>.</xsl:text>
1142 <xsl:apply-templates select="*[4]/*[2]"/>
1143 <xsl:text>; </xsl:text>
1144 <xsl:apply-templates select="*[5]/*[1]/*[2]"/>
1145 <xsl:text>.</xsl:text>
1146 <xsl:apply-templates select="*[5]/*[2]"/>
1148 <xsl:text>)</xsl:text>
1153 <xsl:text>any (</xsl:text>
1155 <xsl:apply-templates select="*[3]"/>
1157 <xsl:text>)</xsl:text>
1164 <xsl:when test="$name='so_lambda'">
1165 <FONT color="green">
1166 <xsl:text>so_</xsl:text>
1168 <xsl:call-template name="mksymbol">
1169 <xsl:with-param name="symbol" select="'lambda'"/>
1170 <xsl:with-param name="color" select="'green'"/>
1171 <xsl:with-param name="size" select="'+2'"/>
1172 </xsl:call-template>
1174 <xsl:when test="*[2]/*[1]='so_variable'">
1175 <FONT color="green">
1176 <xsl:text>(</xsl:text>
1178 <xsl:apply-templates select="*[2]/*[2]"/>
1179 <xsl:text>, </xsl:text>
1180 <xsl:apply-templates select="*[3]"/>
1181 <FONT color="green">
1182 <xsl:text>)</xsl:text>
1185 <xsl:otherwise> <xsl:apply-templates select="*[2]"/>
1186 <xsl:text>.</xsl:text>
1187 <xsl:apply-templates select="*[3]"/>
1194 <xsl:when test="$name='so_apply'">
1195 <FONT color="green">
1196 <xsl:text>so_apply</xsl:text>
1197 <xsl:text> (</xsl:text>
1199 <xsl:apply-templates select="*[2]"/>
1200 <xsl:text> </xsl:text>
1201 <xsl:apply-templates select="*[3]"/>
1202 <FONT color="green">
1203 <xsl:text> )</xsl:text>
1206 <xsl:when test="*[2]/*[1]=so_variable">
1208 <xsl:text>(</xsl:text>
1209 <xsl:apply-templates select="*[2]/*[2]"/>
1210 <xsl:text>)</xsl:text>
1212 <xsl:text> (</xsl:text>
1213 <xsl:apply-templates select="*[3]"/>
1214 <xsl:text> </xsl:text>
1215 <xsl:apply-templates select="*[4]"/>
1216 <xsl:text> )</xsl:text>
1219 <xsl:text> (</xsl:text>
1220 <xsl:apply-templates select="*[2]"/>
1221 <xsl:text> </xsl:text>
1222 <xsl:apply-templates select="*[3]"/>
1223 <xsl:text> )</xsl:text>
1230 <!-- ARROW --> <!-- FUNCTION IND -->
1231 <xsl:when test="$name='arrow'">
1233 <xsl:when test="$charlength > $framewidth">
1234 <xsl:text>(</xsl:text>
1235 <xsl:apply-templates select="*[position()=2]">
1236 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1237 </xsl:apply-templates>
1239 <xsl:call-template name="make_indent">
1240 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1241 </xsl:call-template>
1243 <xsl:call-template name="mksymbol">
1244 <xsl:with-param name="symbol" select="$name"/>
1245 <xsl:with-param name="color" select="'blue'"/>
1246 <xsl:with-param name="size" select="'+0'"/>
1247 </xsl:call-template>
1248 <xsl:apply-templates select="*[position()=3]">
1249 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
1250 </xsl:apply-templates>
1251 <xsl:text>)</xsl:text>
1254 <xsl:apply-templates mode="inline" select="."/>
1260 <xsl:when test="$name='app'">
1262 <xsl:when test="$charlength > $framewidth">
1263 <xsl:text>(</xsl:text>
1264 <xsl:apply-templates select="*[position()=2]">
1265 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1266 </xsl:apply-templates>
1267 <xsl:for-each select="*[position()>2]">
1269 <xsl:call-template name="make_indent">
1270 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1271 </xsl:call-template>
1272 <xsl:apply-templates select=".">
1273 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1274 </xsl:apply-templates>
1276 <xsl:text>)</xsl:text>
1279 <xsl:apply-templates mode="inline" select="."/>
1284 <xsl:when test="$name='cast'">
1286 <xsl:when test="$showcast = 1">
1288 <xsl:when test="$charlength > $framewidth">
1289 <xsl:text>(</xsl:text>
1290 <xsl:apply-templates select="*[position()=2]">
1291 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1292 </xsl:apply-templates><br/>
1293 <xsl:call-template name="make_indent">
1294 <xsl:with-param name="current_indent" select="$current_indent + 2"/> </xsl:call-template>
1295 <xsl:text>:></xsl:text>
1296 <xsl:apply-templates select="*[position()=3]">
1297 <xsl:with-param name="current_indent" select="$current_indent + 3"/>
1298 </xsl:apply-templates>
1299 <xsl:text>)</xsl:text>
1302 <xsl:apply-templates mode="inline" select="."/>
1307 <xsl:apply-templates select="*[position()=2]">
1308 <xsl:with-param name="current_indent" select="$current_indent"/>
1309 </xsl:apply-templates>
1313 <xsl:when test="$name='Prop'">
1314 <xsl:text>Prop</xsl:text>
1316 <xsl:when test="$name='Set'">
1317 <xsl:text>Set</xsl:text>
1319 <xsl:when test="$name='Type'">
1320 <xsl:text>Type</xsl:text>
1322 <xsl:when test="$name='mutcase'">
1324 <xsl:when test="$charlength > $framewidth">
1325 <xsl:text><</xsl:text>
1326 <xsl:apply-templates select="*[position()=2]">
1327 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1328 </xsl:apply-templates>
1329 <xsl:text>> </xsl:text>
1331 <xsl:call-template name="make_indent">
1332 <xsl:with-param name="current_indent" select="$current_indent + 2"/> </xsl:call-template>
1333 <xsl:text>CASE </xsl:text>
1334 <xsl:apply-templates select="*[position()=3]">
1335 <xsl:with-param name="current_indent" select="$current_indent + 8"/>
1336 </xsl:apply-templates>
1337 <xsl:text> OF </xsl:text>
1338 <xsl:for-each select="piecewise/piece">
1339 <!-- <xsl:for-each select="*[position() mod 2 = 0 and position()>3]">-->
1341 <xsl:call-template name="make_indent">
1342 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1343 </xsl:call-template>
1345 <xsl:when test="position() = 1">
1346 <xsl:text>  </xsl:text>
1349 <xsl:text>| </xsl:text>
1352 <xsl:apply-templates select="./*[2]"/>
1353 <xsl:call-template name="mksymbol">
1354 <xsl:with-param name="symbol" select="'RightArrow'"/>
1355 <xsl:with-param name="color" select="'green'"/>
1356 <xsl:with-param name="size" select="'+0'"/>
1357 </xsl:call-template>
1358 <xsl:variable name="body_size">
1359 <xsl:apply-templates
1360 select="./*[1]/*[1]" mode="charcount"/>
1363 <xsl:when test="$body_size > $framewidth">
1365 <xsl:call-template name="make_indent">
1366 <xsl:with-param name="current_indent"
1367 select="$current_indent + 8"/>
1368 </xsl:call-template>
1369 <xsl:apply-templates
1371 <xsl:with-param name="current_indent"
1372 select="$current_indent + 8"/>
1373 </xsl:apply-templates>
1376 <xsl:apply-templates select="./*[1]"
1383 <xsl:apply-templates mode="inline" select="."/>
1388 <xsl:when test="$name='fix'">
1390 <xsl:when test="$charlength > $framewidth">
1391 <xsl:text>FIX</xsl:text>
1392 <xsl:value-of select="m:ci"/>
1393 <xsl:text>{</xsl:text>
1394 <xsl:for-each select="m:bvar">
1396 <xsl:call-template name="make_indent">
1397 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1398 </xsl:call-template>
1399 <xsl:value-of select="m:ci"/>
1400 <xsl:text>:</xsl:text>
1401 <xsl:apply-templates select="m:type">
1402 <xsl:with-param name="current_indent"
1403 select="$current_indent + 5 + string-length(m:ci)"/>
1404 </xsl:apply-templates>
1406 <xsl:call-template name="make_indent">
1407 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1408 </xsl:call-template>
1409 <xsl:text>:=</xsl:text>
1410 <xsl:apply-templates select="following-sibling::*[position() = 1]">
1411 <xsl:with-param name="current_indent" select="$current_indent +2"/>
1412 </xsl:apply-templates>
1415 <xsl:call-template name="make_indent">
1416 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1417 </xsl:call-template>
1418 <xsl:text>}</xsl:text>
1421 <xsl:apply-templates mode="inline" select="."/>
1426 <xsl:when test="$name='cofix'">
1428 <xsl:when test="($charlength + 10) > $framewidth">
1429 <xsl:text>COFIX</xsl:text>
1430 <xsl:value-of select="m:ci"/>
1431 <xsl:text>{</xsl:text>
1433 <xsl:call-template name="make_indent">
1434 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1435 </xsl:call-template>
1436 <xsl:for-each select="m:bvar">
1437 <xsl:value-of select="m:ci"/>
1438 <xsl:text>:</xsl:text>
1439 <xsl:apply-templates select="m:type">
1440 <xsl:with-param name="current_indent"
1441 select="$current_indent + 5 + string-length(m:ci)"/>
1442 </xsl:apply-templates>
1444 <xsl:call-template name="make_indent">
1445 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1446 </xsl:call-template>
1447 <xsl:text>:=</xsl:text>
1448 <xsl:apply-templates select="following-sibling::*[position() = 1]">
1449 <xsl:with-param name="current_indent" select="$current_indent + 3"/>
1450 </xsl:apply-templates>
1454 <xsl:call-template name="make_indent">
1455 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1456 </xsl:call-template>
1457 <xsl:text>}</xsl:text>
1460 <xsl:apply-templates mode="inline" select="m:type"/>
1464 <xsl:when test="$name='let_in'">
1465 <xsl:text>let </xsl:text>
1466 <xsl:apply-templates select="m:bvar/m:ci"/>
1467 <xsl:text> := </xsl:text>
1468 <xsl:apply-templates select="*[3]">
1469 <xsl:with-param name="current_indent" select="$current_indent+14"/>
1470 </xsl:apply-templates>
1472 <xsl:call-template name="make_indent">
1473 <xsl:with-param name="current_indent" select="$current_indent"/>
1474 </xsl:call-template>
1475 <xsl:text>in </xsl:text>
1476 <xsl:apply-templates select="*[4]">
1477 <xsl:with-param name="current_indent" select="$current_indent+5"/>
1478 </xsl:apply-templates>
1481 <!-- ***************************************** -->
1482 <!-- *********** PROOF ELEMENTS ************** -->
1483 <!-- ***************************************** -->
1485 <xsl:when test="$name='proof'">
1486 <xsl:variable name="nonce" select="generate-id()"/>
1487 <xsl:variable name="freshid1" select="concat('a',$nonce)"/>
1488 <xsl:variable name="freshid2" select="concat('b',$nonce)"/>
1489 <xsl:variable name="freshid3" select="concat('c',$nonce)"/>
1490 <span ID="{$freshid1}">
1491 <xsl:apply-templates select="*[position()=2]">
1492 <xsl:with-param name="current_indent" select="$current_indent"/>
1493 </xsl:apply-templates>
1497 <xsl:when test="(preceding-sibling::*[1]/text()='letin1') or
1498 (preceding-sibling::*[1]/text()='rw_step') or
1499 (name(..)='m:lambda')">
1501 <xsl:call-template name="make_indent">
1502 <xsl:with-param name="current_indent" select="$current_indent"/>
1503 </xsl:call-template>
1504 <FONT color="red">we proved </FONT>
1508 if(document.getElementById) {
1510 <span ID="{$freshid2}">\
1511 <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>\
1513 <span ID="{$freshid3}">\
1515 <xsl:call-template name="make_indent">
1516 <xsl:with-param name="current_indent" select="$current_indent"/>
1517 </xsl:call-template>\
1518 <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 proved</a>\
1521 document.to_be_deleted.push('<xsl:value-of select="$freshid1"/>');
1522 document.to_be_deleted.push('<xsl:value-of select="$freshid3"/>');
1523 document.write(' ');
1527 <xsl:call-template name="make_indent">
1528 <xsl:with-param name="current_indent" select="$current_indent"/>
1529 </xsl:call-template>\
1530 <FONT color="red">we proved </FONT>\
1536 <xsl:apply-templates select="*[position()=3]">
1537 <xsl:with-param name="current_indent" select="$current_indent + 16"/>
1538 </xsl:apply-templates>
1541 <xsl:when test="$name='side_proof'">
1542 <xsl:variable name="nonce" select="generate-id()"/>
1543 <xsl:variable name="freshid1" select="concat('a',$nonce)"/>
1544 <xsl:variable name="freshid2" select="concat('b',$nonce)"/>
1545 <xsl:variable name="freshid3" select="concat('c',$nonce)"/>
1546 <xsl:variable name="freshid4" select="concat('d',$nonce)"/>
1547 <span ID="{$freshid1}">
1548 <xsl:apply-templates select="*[position()=2]">
1549 <xsl:with-param name="current_indent" select="$current_indent"/>
1550 </xsl:apply-templates>
1554 if(document.getElementById) {
1556 <span ID="{$freshid2}">\
1557 <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>\
1559 <span ID="{$freshid3}">\
1561 <xsl:call-template name="make_indent">
1562 <xsl:with-param name="current_indent" select="$current_indent"/>
1563 </xsl:call-template>\
1564 <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>\
1567 document.to_be_deleted.push('<xsl:value-of select="$freshid1"/>');
1568 document.to_be_deleted.push('<xsl:value-of select="$freshid3"/>');
1569 document.to_be_deleted.push('<xsl:value-of select="$freshid4"/>');
1570 document.write(' ');
1574 <xsl:call-template name="make_indent">
1575 <xsl:with-param name="current_indent" select="$current_indent"/>
1576 </xsl:call-template>\
1577 <FONT color="red">we proved </FONT>\
1581 <span ID="{$freshid4}">
1582 <xsl:apply-templates select="*[position()=3]">
1583 <xsl:with-param name="current_indent" select="$current_indent + 16"/>
1584 </xsl:apply-templates>
1588 <xsl:when test="$name='eq_chain'">
1589 <FONT color="red">We have the following equality chain:</FONT>
1590 <xsl:for-each select="*[position() mod 2 = 0]">
1591 <xsl:variable name="pos" select="position()"/>
1593 <xsl:call-template name="make_indent">
1594 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
1595 </xsl:call-template>
1597 <xsl:when test="$pos=1">
1598 <xsl:apply-templates select=".">
1599 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
1600 </xsl:apply-templates>
1601 <xsl:text> =</xsl:text>
1604 <xsl:text>= </xsl:text>
1605 <xsl:apply-templates select=".">
1606 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
1607 </xsl:apply-templates>
1610 <xsl:if test="$pos != last()">
1612 <xsl:call-template name="make_indent">
1613 <xsl:with-param name="current_indent" select="$current_indent + 15"/>
1614 </xsl:call-template>
1615 <xsl:apply-templates select="../*[position()=2*$pos +1]">
1616 <xsl:with-param name="current_indent" select="$current_indent + 15"/>
1617 </xsl:apply-templates>
1621 <!-- diseq_chain -->
1622 <xsl:when test="$name='diseq_chain'">
1623 <FONT color="red">We have the following chain of disequalities:</FONT>
1624 <xsl:for-each select="*[position() mod 3 = 2]">
1625 <xsl:variable name="pos" select="position()"/>
1627 <xsl:call-template name="make_indent">
1628 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
1629 </xsl:call-template>
1631 <xsl:when test="$pos=1">
1632 <xsl:apply-templates select=".">
1633 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
1634 </xsl:apply-templates>
1635 <xsl:text> </xsl:text>
1636 <xsl:apply-templates mode="inline" select="../*[position()=3*$pos]"/>
1639 <xsl:apply-templates mode="inline" select="../*[position()=3*($pos - 1)]"/>
1640 <xsl:text> </xsl:text>
1641 <xsl:apply-templates select=".">
1642 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
1643 </xsl:apply-templates>
1646 <xsl:if test="$pos != last()">
1648 <xsl:call-template name="make_indent">
1649 <xsl:with-param name="current_indent" select="$current_indent + 15"/>
1650 </xsl:call-template>
1651 <xsl:apply-templates select="../*[position()=3*$pos +1]">
1652 <xsl:with-param name="current_indent" select="$current_indent + 15"/>
1653 </xsl:apply-templates>
1658 <xsl:when test="$name='letin1'">
1659 <xsl:apply-templates select="*[position()=2]">
1660 <xsl:with-param name="current_indent" select="$current_indent"/>
1661 </xsl:apply-templates>
1663 <xsl:call-template name="make_indent">
1664 <xsl:with-param name="current_indent" select="$current_indent"/>
1665 </xsl:call-template>
1666 <xsl:apply-templates select="*[position()=3]">
1667 <xsl:with-param name="current_indent" select="$current_indent"/>
1668 </xsl:apply-templates>
1671 <xsl:when test="$name='letin'">
1672 <xsl:for-each select="*[position()>1 and last()>position()]">
1673 <xsl:apply-templates select=".">
1674 <xsl:with-param name="current_indent" select="$current_indent"/>
1675 </xsl:apply-templates>
1677 <xsl:call-template name="make_indent">
1678 <xsl:with-param name="current_indent" select="$current_indent"/>
1679 </xsl:call-template>
1681 <xsl:apply-templates select="*[position()=last()]">
1682 <xsl:with-param name="current_indent" select="$current_indent"/>
1683 </xsl:apply-templates>
1686 <xsl:when test="$name='let'">
1688 <xsl:apply-templates select="m:ci"/>
1690 <xsl:apply-templates select="*[3]">
1691 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
1692 </xsl:apply-templates>
1695 <xsl:when test="$name='rw_step'">
1697 <xsl:when test="name(*[2])='m:apply'">
1698 <xsl:apply-templates select="*[2]">
1699 <xsl:with-param name="current_indent" select="$current_indent"/>
1700 </xsl:apply-templates>
1703 <FONT color="red">Consider </FONT>
1704 <xsl:apply-templates select="*[2]"/>
1707 <xsl:variable name="charlength_first">
1708 <xsl:apply-templates select="*[3]" mode="root_charcount"/>
1710 <xsl:variable name="charlength_second">
1711 <xsl:apply-templates select="*[4]" mode="root_charcount"/>
1713 <xsl:variable name="charlength_side_proof">
1714 <xsl:apply-templates select="*[5]" mode="root_charcount"/>
1716 <xsl:variable name="split1"
1717 select="($charlength_first + $charlength_second) > $framewidth"/>
1718 <xsl:variable name="split2"
1719 select="($charlength_second + $charlength_side_proof) > $framewidth"/>
1720 <!-- <xsl:value-of select="$current_indent"/> -->
1721 <!-- <xsl:value-of select="string($charlength_second)"/> -->
1722 <!-- <xsl:value-of select="$charlength_side_proof"/> -->
1723 <!-- <xsl:value-of select="$split2"/> -->
1725 <xsl:call-template name="make_indent">
1726 <xsl:with-param name="current_indent" select="$current_indent"/>
1727 </xsl:call-template>
1728 <FONT color="red">Rewrite </FONT>
1729 <xsl:apply-templates mode="inline" select="*[3]"/>
1730 <xsl:text> </xsl:text>
1731 <xsl:if test="$split1">
1733 <xsl:call-template name="make_indent">
1734 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1735 </xsl:call-template>
1737 <FONT color="red">with </FONT>
1738 <xsl:apply-templates mode="inline" select="*[4]"/>
1739 <xsl:text> </xsl:text>
1740 <xsl:if test="$split2">
1742 <xsl:call-template name="make_indent">
1743 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1744 </xsl:call-template>
1746 <FONT color="red">by </FONT>
1747 <xsl:apply-templates select="*[5]">
1748 <xsl:with-param name="current_indent" select="$current_indent+7"/>
1749 </xsl:apply-templates>
1751 <!-- rewrite and apply -->
1752 <xsl:when test="$name='rewrite_and_apply'">
1753 <xsl:apply-templates select="*[2]">
1754 <xsl:with-param name="current_indent" select="$current_indent"/>
1755 </xsl:apply-templates>
1757 <xsl:call-template name="make_indent">
1758 <xsl:with-param name="current_indent" select="$current_indent"/>
1759 </xsl:call-template>
1760 <FONT color="red">Then apply it to </FONT>
1761 <xsl:apply-templates select="*[position()>2]"/>
1763 <!-- by_induction -->
1764 <xsl:when test="$name='by_induction'">
1765 <FONT color="red">We prove </FONT>
1766 <xsl:apply-templates select="../*[3]">
1767 <xsl:with-param name="current_indent" select="$current_indent+18"/>
1768 </xsl:apply-templates>
1770 <xsl:call-template name="make_indent">
1771 <xsl:with-param name="current_indent" select="$current_indent"/>
1772 </xsl:call-template>
1773 <FONT color="red">by induction on </FONT>
1774 <xsl:apply-templates select="*[position()=last()]/*[position()=last()]">
1775 <xsl:with-param name="current_indent" select="$current_indent+30"/>
1776 </xsl:apply-templates>
1779 <xsl:call-template name="make_indent">
1780 <xsl:with-param name="current_indent" select="$current_indent"/>
1781 </xsl:call-template>
1782 <xsl:text>The induction property is</xsl:text>
1784 <xsl:call-template name="make_indent">
1785 <xsl:with-param name="current_indent" select="$current_indent"/>
1786 </xsl:call-template>
1787 <xsl:apply-templates select="*[3]">
1788 <xsl:with-param name="current_indent" select="$current_indent"/>
1789 </xsl:apply-templates>
1791 <xsl:apply-templates
1792 select="*[position()>3 and not(position()=last())]">
1793 <xsl:with-param name="current_indent" select="$current_indent+4"/>
1794 </xsl:apply-templates>
1796 <xsl:call-template name="make_indent">
1797 <xsl:with-param name="current_indent" select="$current_indent"/>
1798 </xsl:call-template>
1799 <xsl:text>End induction</xsl:text> -->
1801 <!-- inductive_case -->
1802 <xsl:when test="$name='inductive_case'">
1804 <xsl:call-template name="make_indent">
1805 <xsl:with-param name="current_indent" select="$current_indent"/>
1806 </xsl:call-template>
1807 <FONT color="red">Case </FONT>
1808 <xsl:apply-templates select="*[2]">
1809 <xsl:with-param name="current_indent" select="$current_indent +10"/>
1810 </xsl:apply-templates>
1811 <xsl:if test="*[3]/*[position()>1]">
1813 <xsl:call-template name="make_indent">
1814 <xsl:with-param name="current_indent" select="$current_indent+4"/>
1815 </xsl:call-template>
1816 <FONT color="red">By induction hypothesis, we have:</FONT>
1817 <xsl:for-each select="*[3]/*[position()>1]">
1819 <xsl:call-template name="make_indent">
1820 <xsl:with-param name="current_indent" select="$current_indent + 4"/>
1821 </xsl:call-template>
1822 <xsl:text>(</xsl:text>
1823 <xsl:apply-templates select="m:ci"/>
1824 <xsl:text>) </xsl:text>
1825 <xsl:apply-templates select="m:type">
1826 <xsl:with-param name="current_indent" select="$current_indent + 8"/>
1827 </xsl:apply-templates>
1831 <xsl:call-template name="make_indent">
1832 <xsl:with-param name="current_indent" select="$current_indent + 4"/>
1833 </xsl:call-template>
1834 <xsl:apply-templates select="*[4]">
1835 <xsl:with-param name="current_indent" select="$current_indent +4"/>
1836 </xsl:apply-templates>
1838 <xsl:call-template name="make_indent">
1839 <xsl:with-param name="current_indent" select="$current_indent"/>
1840 </xsl:call-template>
1841 <xsl:text>End Case</xsl:text> -->
1844 <xsl:when test="$name='case_lhs'">
1846 <xsl:when test="count(*)=2">
1847 <xsl:apply-templates mode="inline" select="*[2]"/>
1850 <xsl:text>(</xsl:text>
1851 <xsl:apply-templates mode="inline" select="*[2]"/>
1852 <xsl:for-each select="m:bvar">
1853 <xsl:text> </xsl:text>
1854 <xsl:apply-templates mode="inline" select="*[1]"/>
1855 <xsl:text>:</xsl:text>
1856 <xsl:apply-templates mode="inline" select="m:type/*[1]"/>
1858 <xsl:text>)</xsl:text>
1863 <xsl:when test="$name='false_ind'">
1864 <xsl:apply-templates select="*[3]">
1865 <xsl:with-param name="current_indent" select="$current_indent"/>
1866 </xsl:apply-templates>
1868 <xsl:call-template name="make_indent">
1869 <xsl:with-param name="current_indent" select="$current_indent"/>
1870 </xsl:call-template>
1871 <FONT color="red">Contradiction.</FONT>
1874 <xsl:when test="$name='and_ind'">
1876 <xsl:when test="name(*[2])='m:apply'">
1877 <xsl:apply-templates select="*[2]">
1878 <xsl:with-param name="current_indent" select="$current_indent"/>
1879 </xsl:apply-templates>
1882 <FONT color="red">Consider </FONT>
1883 <xsl:apply-templates select="*[2]"/>
1887 <xsl:call-template name="make_indent">
1888 <xsl:with-param name="current_indent" select="$current_indent"/>
1889 </xsl:call-template>
1890 <FONT color="red">In particular, we have</FONT>
1892 <xsl:call-template name="make_indent">
1893 <xsl:with-param name="current_indent" select="$current_indent"/>
1894 </xsl:call-template>
1896 <xsl:apply-templates select="*[3]"/>
1898 <xsl:apply-templates select="*[4]">
1899 <xsl:with-param name="current_indent" select="$current_indent + 9"/>
1900 </xsl:apply-templates>
1902 <xsl:call-template name="make_indent">
1903 <xsl:with-param name="current_indent" select="$current_indent"/>
1904 </xsl:call-template>
1906 <xsl:apply-templates select="*[5]"/>
1908 <xsl:apply-templates select="*[6]">
1909 <xsl:with-param name="current_indent" select="$current_indent + 9"/>
1910 </xsl:apply-templates>
1912 <xsl:call-template name="make_indent">
1913 <xsl:with-param name="current_indent" select="$current_indent"/>
1914 </xsl:call-template>
1915 <xsl:apply-templates select="*[7]">
1916 <xsl:with-param name="current_indent" select="$current_indent"/>
1917 </xsl:apply-templates>
1919 <!-- full_or_ind -->
1920 <xsl:when test="$name='full_or_ind'">
1922 <xsl:when test="name(*[2])='m:apply'">
1923 <xsl:apply-templates select="*[2]">
1924 <xsl:with-param name="current_indent" select="$current_indent"/>
1925 </xsl:apply-templates>
1928 <FONT color="red">Consider </FONT>
1929 <xsl:apply-templates select="*[2]"/>
1933 <xsl:call-template name="make_indent">
1934 <xsl:with-param name="current_indent" select="$current_indent"/>
1935 </xsl:call-template>
1936 <FONT color="red">We proceed by cases to prove </FONT>
1937 <xsl:apply-templates select="*[3]"/>
1939 <xsl:call-template name="make_indent">
1940 <xsl:with-param name="current_indent" select="$current_indent+4"/>
1941 </xsl:call-template>
1942 <FONT color="red">Left: suppose </FONT>
1943 <xsl:text>(</xsl:text>
1944 <xsl:value-of select="*[4]/m:bvar/m:ci"/>
1945 <xsl:text>) </xsl:text>
1946 <xsl:apply-templates
1947 select="*[4]/m:bvar/m:type/*[1]"/>
1949 <xsl:call-template name="make_indent">
1950 <xsl:with-param name="current_indent" select="$current_indent+15"/>
1951 </xsl:call-template>
1952 <xsl:apply-templates
1954 <xsl:with-param name="current_indent" select="$current_indent+15"/>
1955 </xsl:apply-templates>
1957 <xsl:call-template name="make_indent">
1958 <xsl:with-param name="current_indent" select="$current_indent+4"/>
1959 </xsl:call-template>
1960 <FONT color="red">Right: suppose </FONT>
1961 <xsl:text>(</xsl:text>
1962 <xsl:value-of select="*[5]/m:bvar/m:ci"/>
1963 <xsl:text>) </xsl:text>
1964 <xsl:apply-templates
1965 select="*[5]/m:bvar/m:type/*[1]"/>
1967 <xsl:call-template name="make_indent">
1968 <xsl:with-param name="current_indent" select="$current_indent+16"/>
1969 </xsl:call-template>
1970 <xsl:apply-templates
1972 <xsl:with-param name="current_indent" select="$current_indent+16"/>
1973 </xsl:apply-templates>
1976 <xsl:when test="$name='or_ind'">
1978 <xsl:when test="name(*[2])='m:apply'">
1979 <xsl:apply-templates select="*[2]">
1980 <xsl:with-param name="current_indent" select="$current_indent"/>
1981 </xsl:apply-templates>
1984 <FONT color="red">Consider </FONT>
1985 <xsl:apply-templates select="*[2]"/>
1989 <xsl:call-template name="make_indent">
1990 <xsl:with-param name="current_indent" select="$current_indent"/>
1991 </xsl:call-template>
1992 <FONT color="red">We prove </FONT>
1993 <xsl:apply-templates select="*[3]"/>
1994 <FONT color="red"> by cases:</FONT>
1996 <xsl:call-template name="make_indent">
1997 <xsl:with-param name="current_indent" select="$current_indent"/>
1998 </xsl:call-template>
2000 <xsl:apply-templates select="*[4]">
2001 <xsl:with-param name="current_indent" select="$current_indent"/>
2002 </xsl:apply-templates>
2004 <xsl:call-template name="make_indent">
2005 <xsl:with-param name="current_indent" select="$current_indent"/>
2006 </xsl:call-template>
2008 <xsl:apply-templates select="*[5]">
2009 <xsl:with-param name="current_indent" select="$current_indent"/>
2010 </xsl:apply-templates>
2013 <xsl:when test="$name='ex_ind'">
2015 <xsl:when test="name(*[2])='m:apply'">
2016 <xsl:apply-templates select="*[2]">
2017 <xsl:with-param name="current_indent" select="$current_indent"/>
2018 </xsl:apply-templates>
2021 <FONT color="red">Consider </FONT>
2022 <xsl:apply-templates select="*[2]">
2023 <xsl:with-param name="current_indent" select="$current_indent"/>
2024 </xsl:apply-templates>
2028 <xsl:call-template name="make_indent">
2029 <xsl:with-param name="current_indent" select="$current_indent"/>
2030 </xsl:call-template>
2031 <FONT color="red">Let </FONT>
2032 <xsl:apply-templates mode="inline" select="*[3]"/>
2034 <xsl:apply-templates mode="inline" select="*[4]"/>
2035 <FONT color="red"> such that</FONT>
2037 <xsl:call-template name="make_indent">
2038 <xsl:with-param name="current_indent" select="$current_indent"/>
2039 </xsl:call-template>
2041 <xsl:apply-templates mode="inline" select="*[5]"/>
2043 <xsl:apply-templates select="*[6]">
2044 <xsl:with-param name="current_indent" select="$current_indent +7"/>
2045 </xsl:apply-templates>
2047 <xsl:call-template name="make_indent">
2048 <xsl:with-param name="current_indent" select="$current_indent"/>
2049 </xsl:call-template>
2050 <xsl:apply-templates select="*[7]">
2051 <xsl:with-param name="current_indent" select="$current_indent"/>
2052 </xsl:apply-templates>
2054 <!-- ***************************************** -->
2055 <!-- *********** LAMBDA ELEMENTS ************** -->
2056 <!-- ***************************************** -->
2057 <xsl:when test="$name='subst'">
2058 <xsl:apply-templates select="*[3]"/>
2059 <xsl:text>[</xsl:text>
2060 <xsl:apply-templates select="*[4]"/>
2062 <xsl:when test="$uri != ''">
2064 <xsl:call-template name="mksymbol">
2065 <xsl:with-param name="symbol" select="$name"/>
2066 <xsl:with-param name="color" select="'blue'"/>
2067 <xsl:with-param name="size" select="'+0'"/>
2068 </xsl:call-template>
2072 <xsl:call-template name="mksymbol">
2073 <xsl:with-param name="symbol" select="$name"/>
2074 <xsl:with-param name="color" select="'blue'"/>
2075 <xsl:with-param name="size" select="'+0'"/>
2076 </xsl:call-template>
2079 <xsl:apply-templates select="*[2]"/>
2080 <xsl:text>]</xsl:text>
2083 <xsl:when test="$name='lift_with_base'">
2085 <xsl:apply-templates select="*[3]" mode="inline"/>
2088 <xsl:when test="$uri != ''">
2090 <xsl:call-template name="mksymbol">
2091 <xsl:with-param name="symbol" select="$name"/>
2092 <xsl:with-param name="color" select="'green'"/>
2093 <xsl:with-param name="size" select="'+0'"/>
2094 </xsl:call-template>
2098 <xsl:call-template name="mksymbol">
2099 <xsl:with-param name="symbol" select="$name"/>
2100 <xsl:with-param name="color" select="'green'"/>
2101 <xsl:with-param name="size" select="'+0'"/>
2102 </xsl:call-template>
2106 <xsl:apply-templates select="*[4]" mode="inline"/>
2108 <xsl:text>(</xsl:text>
2109 <xsl:apply-templates select="*[2]" mode="inline"/>
2110 <xsl:text>)</xsl:text>
2113 <xsl:when test="$name='lift'">
2115 <xsl:when test="$uri != ''">
2117 <xsl:call-template name="mksymbol">
2118 <xsl:with-param name="symbol" select="$name"/>
2119 <xsl:with-param name="color" select="'green'"/>
2120 <xsl:with-param name="size" select="'+0'"/>
2121 </xsl:call-template>
2125 <xsl:call-template name="mksymbol">
2126 <xsl:with-param name="symbol" select="$name"/>
2127 <xsl:with-param name="color" select="'green'"/>
2128 <xsl:with-param name="size" select="'+0'"/>
2129 </xsl:call-template>
2133 <xsl:apply-templates select="*[2]" mode="inline"/>
2135 <xsl:text>(</xsl:text>
2136 <xsl:apply-templates select="*[3]" mode="inline"/>
2137 <xsl:text>)</xsl:text>
2141 <xsl:when test="$name='beta_red1'">
2142 <xsl:apply-templates select="*[2]" mode="inline"/>
2144 <xsl:when test="$uri != ''">
2146 <xsl:call-template name="mksymbol">
2147 <xsl:with-param name="symbol" select="$name"/>
2148 <xsl:with-param name="color" select="'green'"/>
2149 <xsl:with-param name="size" select="'+0'"/>
2150 </xsl:call-template>
2152 <xsl:call-template name="mksymbol">
2153 <xsl:with-param name="symbol" select="'beta'"/>
2154 <xsl:with-param name="color" select="'green'"/>
2155 <xsl:with-param name="size" select="'+0'"/>
2156 </xsl:call-template>
2161 <xsl:call-template name="mksymbol">
2162 <xsl:with-param name="symbol" select="$name"/>
2163 <xsl:with-param name="color" select="'green'"/>
2164 <xsl:with-param name="size" select="'+0'"/>
2165 </xsl:call-template>
2167 <xsl:call-template name="mksymbol">
2168 <xsl:with-param name="symbol" select="'beta'"/>
2169 <xsl:with-param name="color" select="'green'"/>
2170 <xsl:with-param name="size" select="'+0'"/>
2171 </xsl:call-template>
2175 <xsl:apply-templates select="*[3]" mode="inline"/>
2178 <xsl:when test="$name='beta_red'">
2179 <xsl:apply-templates select="*[2]" mode="inline"/>
2181 <xsl:when test="$uri != ''">
2183 <xsl:call-template name="mksymbol">
2184 <xsl:with-param name="symbol" select="$name"/>
2185 <xsl:with-param name="color" select="'green'"/>
2186 <xsl:with-param name="size" select="'+0'"/>
2187 </xsl:call-template>
2189 <xsl:call-template name="mksymbol">
2190 <xsl:with-param name="symbol" select="'beta'"/>
2191 <xsl:with-param name="color" select="'green'"/>
2192 <xsl:with-param name="size" select="'+0'"/>
2193 </xsl:call-template>
2194 <xsl:text>*</xsl:text>
2199 <xsl:call-template name="mksymbol">
2200 <xsl:with-param name="symbol" select="$name"/>
2201 <xsl:with-param name="color" select="'green'"/>
2202 <xsl:with-param name="size" select="'+0'"/>
2203 </xsl:call-template>
2205 <xsl:call-template name="mksymbol">
2206 <xsl:with-param name="symbol" select="'beta'"/>
2207 <xsl:with-param name="color" select="'green'"/>
2208 <xsl:with-param name="size" select="'+0'"/>
2209 </xsl:call-template>
2210 <xsl:text>*</xsl:text>
2214 <xsl:apply-templates select="*[3]" mode="inline"/>
2217 <xsl:when test="$name='par_beta_red1'">
2218 <xsl:apply-templates select="*[2]" mode="inline"/>
2220 <xsl:when test="$uri != ''">
2222 <xsl:call-template name="mksymbol">
2223 <xsl:with-param name="symbol" select="$name"/>
2224 <xsl:with-param name="color" select="'green'"/>
2225 <xsl:with-param name="size" select="'+0'"/>
2226 </xsl:call-template>
2228 <xsl:call-template name="mksymbol">
2229 <xsl:with-param name="symbol" select="'beta'"/>
2230 <xsl:with-param name="color" select="'green'"/>
2231 <xsl:with-param name="size" select="'+0'"/>
2232 </xsl:call-template>
2237 <xsl:call-template name="mksymbol">
2238 <xsl:with-param name="symbol" select="$name"/>
2239 <xsl:with-param name="color" select="'green'"/>
2240 <xsl:with-param name="size" select="'+0'"/>
2241 </xsl:call-template>
2243 <xsl:call-template name="mksymbol">
2244 <xsl:with-param name="symbol" select="'beta'"/>
2245 <xsl:with-param name="color" select="'green'"/>
2246 <xsl:with-param name="size" select="'+0'"/>
2247 </xsl:call-template>
2251 <xsl:apply-templates select="*[3]" mode="inline"/>
2254 <xsl:when test="$name='par_beta_red'">
2255 <xsl:apply-templates select="*[2]" mode="inline"/>
2257 <xsl:when test="$uri != ''">
2259 <xsl:call-template name="mksymbol">
2260 <xsl:with-param name="symbol" select="$name"/>
2261 <xsl:with-param name="color" select="'green'"/>
2262 <xsl:with-param name="size" select="'+0'"/>
2263 </xsl:call-template>
2265 <xsl:call-template name="mksymbol">
2266 <xsl:with-param name="symbol" select="'beta'"/>
2267 <xsl:with-param name="color" select="'green'"/>
2268 <xsl:with-param name="size" select="'+0'"/>
2269 </xsl:call-template>
2270 <xsl:text>*</xsl:text>
2275 <xsl:call-template name="mksymbol">
2276 <xsl:with-param name="symbol" select="$name"/>
2277 <xsl:with-param name="color" select="'green'"/>
2278 <xsl:with-param name="size" select="'+0'"/>
2279 </xsl:call-template>
2281 <xsl:call-template name="mksymbol">
2282 <xsl:with-param name="symbol" select="'beta'"/>
2283 <xsl:with-param name="color" select="'green'"/>
2284 <xsl:with-param name="size" select="'+0'"/>
2285 </xsl:call-template>
2286 <xsl:text>*</xsl:text>
2290 <xsl:apply-templates select="*[3]" mode="inline"/>
2294 <xsl:when test="$name='forgetful'">
2296 <xsl:when test="$uri != ''">
2297 <a href="{$uri}">|</a>
2303 <xsl:apply-templates select="*[2]" mode="inline"/>
2305 <xsl:when test="$uri != ''">
2306 <a href="{$uri}">|</a>
2314 <!-- boolean algebra of redexes -->
2317 <xsl:when test="$name='isomorphic'">
2318 <xsl:apply-templates select="*[2]" mode="inline"/>
2320 <xsl:when test="$uri != ''">
2322 <xsl:call-template name="mksymbol">
2323 <xsl:with-param name="symbol" select="$name"/>
2324 <xsl:with-param name="color" select="'green'"/>
2325 <xsl:with-param name="size" select="'+0'"/>
2326 </xsl:call-template>
2330 <xsl:call-template name="mksymbol">
2331 <xsl:with-param name="symbol" select="$name"/>
2332 <xsl:with-param name="color" select="'green'"/>
2333 <xsl:with-param name="size" select="'+0'"/>
2334 </xsl:call-template>
2337 <xsl:apply-templates select="*[3]" mode="inline"/>
2341 <xsl:when test="$name='interp'">
2342 <font color="green">[</font>
2343 <xsl:apply-templates select="*[2]"/>
2344 <font color="green">]</font>
2352 <xsl:template match="m:lambda">
2353 <xsl:param name="current_indent" select="0"/>
2354 <xsl:variable name="charlength">
2355 <xsl:apply-templates select="*[position()=1]" mode="charcount"/>
2356 <!-- <xsl:apply-templates select="." mode="charcount"/> -->
2358 <!-- <xsl:value-of select="$charlength"/> -->
2359 <!-- <xsl:value-of select="$current_indent"/> -->
2361 <xsl:when test="$charlength > $framewidth">
2363 <xsl:call-template name="mksymbol">
2364 <xsl:with-param name="symbol" select="'lambda'"/>
2365 <xsl:with-param name="color" select="'red'"/>
2366 <xsl:with-param name="size" select="'+2'"/>
2367 </xsl:call-template>
2368 <xsl:apply-templates select="m:bvar/m:ci"/>
2369 <xsl:text>:</xsl:text>
2370 <xsl:apply-templates select="m:bvar/m:type">
2371 <xsl:with-param name="current_indent"
2372 select="$current_indent + 4 + 2*string-length(m:bvar/m:ci)"/>
2373 </xsl:apply-templates><br/>
2374 <xsl:call-template name="make_indent">
2375 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
2376 </xsl:call-template>
2377 <xsl:text>.</xsl:text>
2378 <xsl:apply-templates select="*[position()=2]">
2379 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
2380 </xsl:apply-templates>
2383 <xsl:apply-templates mode="inline" select="."/>
2389 <xsl:template match="m:ci">
2391 <xsl:when test="boolean(@definitionURL)">
2392 <a href="{@definitionURL}">
2393 <xsl:apply-templates/>
2397 <xsl:value-of select="."/>
2402 <!-- CHAR COUNTING -->
2404 <!-- enter this counting mode selecting the root -->
2405 <xsl:template match="*" mode="root_charcount">
2406 <xsl:param name="incurrent_length" select="0"/>
2408 <xsl:when test="count(*)=0">
2409 <xsl:value-of select="0"/>
2411 <xsl:when test="name()='m:ci'">
2412 <xsl:value-of select="string-length()"/>
2415 <xsl:apply-templates select="*[1]" mode="charcount">
2416 <xsl:with-param name="incurrent_length" select="$incurrent_length"/>
2417 </xsl:apply-templates>
2422 <!-- CASI PARTICOLARI -->
2424 <xsl:template match="m:apply[m:in]">
2425 <xsl:apply-templates select="*[2]"/>
2426 <xsl:text> </xsl:text>
2427 <xsl:call-template name="mksymbol">
2428 <xsl:with-param name="symbol" select="'member'"/>
2429 <xsl:with-param name="color" select="'blue'"/>
2430 <xsl:with-param name="size" select="'+0'"/>
2431 </xsl:call-template>
2432 <xsl:text> </xsl:text>
2433 <xsl:apply-templates select="*[3]"/>
2436 <xsl:template match="m:apply[m:implies]">
2437 <xsl:text>(</xsl:text>
2438 <xsl:apply-templates select="*[2]"/>
2439 <xsl:text> </xsl:text>
2440 <xsl:call-template name="mksymbol">
2441 <xsl:with-param name="symbol" select="'implies'"/>
2442 <xsl:with-param name="color" select="'blue'"/>
2443 <xsl:with-param name="size" select="'+0'"/>
2444 </xsl:call-template>
2445 <xsl:text> </xsl:text>
2446 <xsl:apply-templates select="*[3]"/>
2447 <xsl:text>)</xsl:text>
2450 <!-- enter this mode selecting the first child -->
2452 <xsl:template match="m:ci|m:csymbol" mode="charcount">
2453 <xsl:param name="incurrent_length" select="0"/>
2455 <xsl:when test="$framewidth >= ($incurrent_length + string-length())">
2456 <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>
2458 <xsl:when test="string($siblength) = """>
2459 <xsl:value-of select="$incurrent_length + string-length()"/>
2462 <xsl:value-of select="number($siblength)"/>
2467 <xsl:value-of select="$incurrent_length + string-length()"/>
2472 <xsl:template match="*" mode="charcount">
2473 <xsl:param name="incurrent_length" select="0"/>
2475 <xsl:when test="count(child::*) = 0">
2476 <xsl:value-of select="$incurrent_length"/>
2479 <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>
2481 <xsl:when test="$framewidth >= number($childlength)">
2482 <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>
2484 <xsl:when test="string($siblength) = """>
2485 <xsl:value-of select="number($childlength)"/>
2488 <xsl:value-of select="number($siblength)"/>
2493 <xsl:value-of select="number($childlength)"/>
2501 <!--***********************************************************************-->
2503 <!--***********************************************************************-->
2507 <xsl:template match="Rule">
2508 <xsl:param name="current_indent" select="0"/>
2513 <xsl:when test="m:ci">
2515 <xsl:apply-templates/>
2520 <xsl:apply-templates select="m:apply/*[1]"/>
2521 <xsl:text> ( </xsl:text>
2523 <xsl:for-each select="m:apply/*[position()!=1]">
2525 <xsl:when test="*[1]='level-exp'">
2526 <xsl:text>level-exp(</xsl:text>
2527 <xsl:apply-templates select="*[2]"/>
2528 <xsl:text>)</xsl:text>
2530 <xsl:when test="m:apply">
2531 <xsl:apply-templates select="."/>
2534 <xsl:apply-templates/>
2537 <xsl:if test="position()!=last()">
2538 <xsl:text>, </xsl:text>
2542 <xsl:text> )</xsl:text>
2551 <xsl:template match="Sequent">
2552 <xsl:param name="current_indent" select="0"/>
2554 Sequent (<xsl:value-of select="@id"/>) :
2556 <xsl:for-each select="Decl">
2558 <xsl:when test="position()=1"/>
2559 <xsl:call-template name="make_indent">
2560 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
2561 </xsl:call-template>
2564 <xsl:call-template name="make_indent">
2565 <xsl:with-param name="current_indent" select="$current_indent"/>
2566 </xsl:call-template>
2569 <xsl:variable name="num" select="position()"/>
2570 <xsl:value-of select="$num"/>
2571 <xsl:text>) </xsl:text>
2572 <FONT color="yellow">
2573 <xsl:value-of select="@name"/><xsl:text>(</xsl:text>
2576 <xsl:when test="m:apply">
2577 <xsl:apply-templates select="."/>
2580 <xsl:apply-templates/>
2583 <FONT color="yellow">
2584 <xsl:text> )</xsl:text>
2590 =====================================
2592 <xsl:call-template name="make_indent">
2593 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
2594 </xsl:call-template>
2595 <xsl:apply-templates select="Goal"/>
2601 <xsl:template match="Node">
2602 <xsl:param name="current_indent" select="0"/>
2606 <xsl:call-template name="make_indent">
2607 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
2608 </xsl:call-template>
2609 <xsl:apply-templates select="Sequent"/>
2610 <xsl:apply-templates select="Rule"/>
2617 <xsl:template match="Definition">
2618 <xsl:param name="current_indent" select="0"/>
2620 DEFINITION <xsl:value-of select="@name"/>(<xsl:if test="string(./Params) != """><xsl:value-of select="Params"/></xsl:if>)<br/>
2622 <xsl:call-template name="make_indent">
2623 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
2624 </xsl:call-template>
2625 <xsl:apply-templates select="type/*[1]">
2626 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
2627 </xsl:apply-templates><br/>
2629 <xsl:call-template name="make_indent">
2630 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
2631 </xsl:call-template>
2632 <xsl:apply-templates select="body/*">
2633 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
2634 </xsl:apply-templates>
2640 <xsl:template match="Axiom">
2641 <xsl:param name="current_indent" select="0"/>
2643 AXIOM <xsl:value-of select="@name"/>(<xsl:if test="string(./Params) != """><xsl:value-of select="Params"/></xsl:if>)<br/>
2645 <xsl:call-template name="make_indent">
2646 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
2647 </xsl:call-template>
2648 <xsl:apply-templates select="type/*[1]">
2649 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
2650 </xsl:apply-templates>
2654 <!-- UNFINISHED PROOF -->
2656 <xsl:template match="CurrentProof">
2657 <xsl:param name="current_indent" select="0"/>
2659 UNFINISHED PROOF <xsl:value-of select="@name"/>(<xsl:if test="string(./Params) != """><xsl:value-of select="Params"/></xsl:if>)<br/>
2660 THESIS: <xsl:apply-templates select="type/*[1]">
2661 <xsl:with-param name="current_indent" select="$current_indent + 8"/>
2662 </xsl:apply-templates><br/>
2664 <xsl:for-each select="Conjecture">
2666 <xsl:call-template name="make_indent">
2667 <xsl:with-param name="current_indent" select="$current_indent + 8"/>
2668 </xsl:call-template>
2669 <xsl:for-each select="Decl|Def|Hidden">
2671 <xsl:when test="name(.)='Decl'">
2673 <xsl:when test="@name">
2674 <xsl:value-of select="@name"/>
2677 <xsl:text>_</xsl:text>
2680 <xsl:text> : </xsl:text>
2681 <xsl:apply-templates select="./*[1]">
2682 <xsl:with-param name="current_indent" select="$current_indent"/>
2683 </xsl:apply-templates>
2685 <xsl:when test="name(.)='Def'">
2687 <xsl:when test="@name">
2688 <xsl:value-of select="@name"/>
2691 <xsl:text>_</xsl:text>
2694 <xsl:text> := </xsl:text>
2695 <xsl:apply-templates select="./*[1]">
2696 <xsl:with-param name="current_indent" select="$current_indent"/>
2697 </xsl:apply-templates>
2700 <xsl:text> _ :? _ </xsl:text>
2704 |- <xsl:value-of select="./@no"/> :
2705 <xsl:apply-templates select="./Goal/*[1]">
2706 <xsl:with-param name="current_indent" select="$current_indent + 11"/>
2707 </xsl:apply-templates>
2711 <xsl:apply-templates select="body/*[1]">
2712 <xsl:with-param name="current_indent" select="$current_indent + 8"/>
2713 </xsl:apply-templates>
2717 <!-- MUTUAL INDUCTIVE DEFINITION -->
2719 <xsl:template match="InductiveDefinition">
2720 <xsl:param name="current_indent" select="0"/>
2722 <xsl:for-each select="InductiveType">
2724 <xsl:when test="position() = 1">
2726 <xsl:when test="string(./@inductive) = "true"">
2727 INDUCTIVE DEFINITION
2730 COINDUCTIVE DEFINITION
2738 <xsl:value-of select="./@name"/>(<xsl:if test="string(../Params) != """><xsl:value-of select="../Params"/></xsl:if>)
2740 <xsl:if test="string(../Param) != """>
2741 <xsl:for-each select="../Param">
2742 <xsl:value-of select="./@name"/>
2744 <xsl:apply-templates select="*"/>
2749 <xsl:apply-templates select="./arity/*[1]">
2750 <xsl:with-param name="current_indent" select="$current_indent + 9"/>
2751 </xsl:apply-templates> <br/>
2753 <xsl:for-each select="./Constructor">
2755 <xsl:call-template name="make_indent">
2756 <xsl:with-param name="current_indent" select="$current_indent + 3"/>
2757 </xsl:call-template>
2759 <xsl:when test="position() = 1">
2760 <xsl:text>  </xsl:text>
2763 <xsl:text>| </xsl:text>
2766 <xsl:value-of select="./@name"/>
2767 <xsl:text>: </xsl:text>
2768 <xsl:apply-templates select="./*[1]">
2769 <xsl:with-param name="current_indent" select="$current_indent + 2*string-length(./@name) + 5"/>
2770 </xsl:apply-templates>
2778 <xsl:template match="Variable">
2779 <xsl:param name="current_indent" select="0"/>
2781 VARIABLE <xsl:value-of select="@name"/><br/>
2782 TYPE = <xsl:apply-templates select="type/*[1]">
2783 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
2784 </xsl:apply-templates>
2785 <xsl:if test="body">
2787 BODY = <xsl:apply-templates select="body/*[1]">
2788 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
2789 </xsl:apply-templates>
2794 <!--***********************************************************************-->
2796 <!--***********************************************************************-->
2800 <xsl:template match="SECTION">
2801 <xsl:param name="current_indent" select="0"/>
2802 <h1>BEGIN OF SECTION</h1>
2803 <xsl:apply-templates/>
2804 <h1>END OF SECTION</h1>