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="html_init.xsl"/>
40 <xsl:include href="html_set.xsl"/>
41 <xsl:include href="html_reals.xsl"/>
43 <xsl:variable name="showcast" select="0"/>
45 <!--***********************************************************************-->
46 <!-- HTML Head and Body -->
47 <!--***********************************************************************-->
49 <!-- <xsl:output method="html" encoding="iso-8859-1"/> -->
51 <!-- document needs method="xml" and searches locally for the dtd if -->
52 <!-- doctype-system is specified (the dtd must exist locally for parsing). -->
53 <!-- For having output html must be media-type="html" and for having the -->
54 <!-- correct <br /> you must specify at least the remote dtd by means of -->
55 <!-- doctype-public -->
59 media-type="text/html"
60 doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" />
62 <xsl:variable name="framewidth" select="55"/>
64 <xsl:template name="mksymbol-1">
65 <xsl:param name="symbol" select="''"/>
66 <xsl:param name="color" select="''"/>
67 <xsl:param name="size" select="''"/>
69 <xsl:when test="$UNICODEvsSYMBOL = 'symbol'">
70 <xsl:variable name="fontsymbol">
72 <xsl:when test="$symbol = 'append'">
73 <xsl:value-of select="'@'"/>
75 <xsl:when test="$symbol = 'iff'">
76 <xsl:value-of select="'«'"/>
78 <xsl:when test="$symbol = 'forall'">
79 <xsl:value-of select="'"'"/>
81 <xsl:when test="$symbol = 'lambda'">
82 <xsl:value-of select="'l'"/>
84 <xsl:when test="$symbol = 'prod'">
85 <xsl:value-of select="'Õ'"/>
87 <xsl:when test="$symbol = 'arrow'">
88 <xsl:value-of select="'®'"/>
90 <xsl:when test="$symbol = 'RightArrow'">
91 <xsl:value-of select="'Þ'"/>
93 <xsl:when test="$symbol = 'subst'">
94 <xsl:value-of select="'¬'"/>
96 <xsl:when test="$symbol = 'lift' or $symbol = 'lift_with_base'">
97 <xsl:value-of select="'­'"/>
99 <xsl:when test="$symbol = 'beta_red' or $symbol = 'beta_red1'">
100 <xsl:value-of select="'®'"/>
102 <xsl:when test="$symbol = 'beta'">
103 <xsl:value-of select="'b'"/>
105 <xsl:when test="$symbol = 'par_beta_red' or $symbol = 'par_beta_red1'">
106 <xsl:value-of select="'Þ'"/>
108 <xsl:when test="$symbol = 'isomorphic'">
109 <xsl:value-of select="'@'"/>
112 <xsl:text>???</xsl:text>
116 <FONT FACE="symbol" SIZE="{$size}" color="{$color}">
117 <xsl:value-of select="$fontsymbol"/>
121 <xsl:variable name="unicodesymbol">
123 <xsl:when test="$symbol = 'append'">
124 <xsl:value-of select="'@'"/>
126 <xsl:when test="$symbol = 'iff'">
127 <xsl:value-of select="'↔'"/>
129 <xsl:when test="$symbol = 'forall'">
130 <xsl:value-of select="'∀'"/>
132 <xsl:when test="$symbol = 'lambda'">
133 <xsl:value-of select="'λ'"/>
135 <xsl:when test="$symbol = 'prod'">
136 <xsl:value-of select="'Π'"/>
138 <xsl:when test="$symbol = 'arrow'">
139 <xsl:value-of select="'→'"/>
141 <xsl:when test="$symbol = 'RightArrow'">
142 <xsl:value-of select="'⇒'"/>
144 <xsl:when test="$symbol = 'subst'">
145 <xsl:value-of select="'←'"/>
147 <xsl:when test="$symbol = 'lift' or $symbol = 'lift_with_base'">
148 <xsl:value-of select="'↑'"/>
150 <xsl:when test="$symbol = 'beta_red' or $symbol = 'beta_red1'">
151 <xsl:value-of select="'→'"/>
153 <xsl:when test="$symbol = 'beta'">
154 <xsl:value-of select="'β'"/>
156 <xsl:when test="$symbol = 'par_beta_red' or $symbol = 'par_beta_red1'">
157 <xsl:value-of select="'⇒'"/>
159 <xsl:when test="$symbol = 'isomorphic'">
160 <xsl:value-of select="'≅'"/>
163 <xsl:text>???</xsl:text>
167 <FONT color="{$color}">
168 <xsl:value-of select="$unicodesymbol"/>
174 <xsl:template match="/">
175 <xsl:param name="current_indent" select="0"/>
177 <xsl:when test="$type = 'standalone'">
180 <title> <xsl:value-of select="$CICURI"/> </title> <!-- FG -->
181 <style> A { text-decoration: none } </style>
183 <xsl:text disable-output-escaping="yes">
185 function Hide(which){
186 if (!document.getElementById)
188 which.style.display="none"
191 function Show(which){
192 if (!document.getElementById)
194 which.style.display=""
197 document.to_be_deleted = new Array();
202 <body bgcolor="white">
203 <xsl:attribute name="onLoad">
204 if(document.getElementById)
205 for(var i=0;i<document.to_be_deleted.length;i++)
206 Hide(document.getElementById(document.to_be_deleted[i]));
208 <xsl:apply-templates>
209 <xsl:with-param name="current_indent" select="0"/>
210 </xsl:apply-templates>
216 <xsl:apply-templates>
217 <xsl:with-param name="current_indent" select="0"/>
218 </xsl:apply-templates>
224 <!--***********************************************************************-->
226 <!--***********************************************************************-->
228 <xsl:template name="make_indent">
229 <xsl:param name="current_indent" select="0"/>
230 <xsl:if test="$current_indent > 0">
231 <xsl:text> </xsl:text>
232 <xsl:call-template name="make_indent">
233 <xsl:with-param name="current_indent" select="$current_indent - 1"/>
238 <!-- Syntactic Sugar -->
239 <xsl:template match="m:type">
240 <xsl:param name="current_indent" select="0"/>
241 <xsl:apply-templates>
242 <xsl:with-param name="current_indent"
243 select="$current_indent"/>
244 </xsl:apply-templates>
247 <xsl:template match="m:condition">
248 <xsl:param name="current_indent" select="0"/>
249 <xsl:apply-templates>
250 <xsl:with-param name="current_indent"
251 select="$current_indent"/>
252 </xsl:apply-templates>
255 <xsl:template match="m:math">
256 <xsl:param name="current_indent" select="0"/>
257 <xsl:apply-templates>
258 <xsl:with-param name="current_indent"
259 select="$current_indent"/>
260 </xsl:apply-templates>
263 <!--*********************************************************************-->
265 <!--*********************************************************************-->
268 <xsl:template mode="inline" match="m:ci">
270 <xsl:when test="boolean(@definitionURL)">
271 <a href="{@definitionURL}">
272 <xsl:apply-templates/>
276 <xsl:value-of select="."/>
283 <xsl:template match="m:apply[m:csymbol]" mode="inline">
284 <xsl:variable name="name">
285 <xsl:value-of select="m:csymbol"/>
287 <xsl:variable name="uri"><xsl:value-of select="*[1]/@definitionURL"/></xsl:variable>
290 <xsl:when test="$name='forall'">
291 <xsl:call-template name="mksymbol-1">
292 <xsl:with-param name="symbol" select="$name"/>
293 <xsl:with-param name="color" select="'blue'"/>
294 <xsl:with-param name="size" select="'+2'"/>
296 <xsl:apply-templates select="m:bvar/m:ci"/>
297 <xsl:text>:</xsl:text>
298 <xsl:apply-templates mode="inline" select="m:bvar/m:type"/>
299 <xsl:text>.</xsl:text>
300 <xsl:apply-templates mode="inline" select="*[position()=3]"/>
302 <xsl:when test="$name='prod'">
303 <xsl:call-template name="mksymbol-1">
304 <xsl:with-param name="symbol" select="$name"/>
305 <xsl:with-param name="color" select="'blue'"/>
306 <xsl:with-param name="size" select="'+2'"/>
308 <xsl:apply-templates mode="inline" select="m:bvar/m:ci"/>
309 <xsl:text>:</xsl:text>
310 <xsl:apply-templates mode="inline" select="m:bvar/m:type"/>
311 <xsl:text>.</xsl:text>
312 <xsl:apply-templates mode="inline" select="*[position()=3]"/>
315 <xsl:when test="$name='arrow'">
316 <xsl:text>(</xsl:text>
317 <xsl:apply-templates mode="inline" select="*[position()=2]"/>
318 <xsl:call-template name="mksymbol-1">
319 <xsl:with-param name="symbol" select="$name"/>
320 <xsl:with-param name="color" select="'blue'"/>
321 <xsl:with-param name="size" select="'+0'"/>
323 <xsl:apply-templates mode="inline" select="*[position()=3]"/>
324 <xsl:text>)</xsl:text>
327 <xsl:when test="$name='iff'">
328 <xsl:text>(</xsl:text>
329 <xsl:apply-templates mode="inline" select="*[position()=2]"/>
330 <xsl:call-template name="mksymbol-1">
331 <xsl:with-param name="symbol" select="$name"/>
332 <xsl:with-param name="color" select="'blue'"/>
333 <xsl:with-param name="size" select="'+0'"/>
335 <xsl:apply-templates mode="inline" select="*[position()=3]"/>
336 <xsl:text>)</xsl:text>
339 <xsl:when test="$name='append'">
340 <xsl:text>(</xsl:text>
341 <xsl:apply-templates mode="inline" select="*[position()=2]"/>
342 <xsl:call-template name="mksymbol-1">
343 <xsl:with-param name="symbol" select="$name"/>
344 <xsl:with-param name="color" select="'blue'"/>
345 <xsl:with-param name="size" select="'+0'"/>
347 <xsl:apply-templates mode="inline" select="*[position()=3]"/>
348 <xsl:text>)</xsl:text>
351 <xsl:when test="$name='app'">
352 <xsl:text>(</xsl:text>
353 <xsl:apply-templates mode="inline" select="*[position()=2]"/>
354 <xsl:for-each select="*[position()>2]">
355 <xsl:text> </xsl:text>
356 <xsl:apply-templates mode="inline" select="."/>
358 <xsl:text>)</xsl:text>
361 <xsl:when test="$name='cast'">
362 <xsl:text>(</xsl:text>
363 <xsl:apply-templates mode="inline" select="*[position()=2]"/>
364 <xsl:text>:</xsl:text>
365 <xsl:apply-templates mode="inline" select="*[position()=3]"/>
366 <xsl:text>)</xsl:text>
368 <xsl:when test="$name='Prop'">
369 <FONT color="violet">Prop</FONT>
371 <xsl:when test="$name='Set'">
372 <FONT color="violet">Set</FONT>
374 <xsl:when test="$name='Type'">
375 <FONT color="violet">Type</FONT>
378 <xsl:when test="$name='mutcase'">
379 <xsl:text><</xsl:text>
380 <xsl:apply-templates mode="inline" select="*[position()=2]"/>
381 <xsl:text>> </xsl:text>
382 <FONT color="red">CASE </FONT>
383 <xsl:apply-templates mode="inline" select="*[position()=3]"/>
384 <FONT color="red"> OF </FONT>
385 <xsl:for-each select="m:piecewise/m:piece">
386 <!--<xsl:for-each select="*[position() mod 2 = 0 and position()>3]">-->
388 <xsl:when test="not(position() = 1)">
389 <xsl:text> | </xsl:text>
392 <xsl:apply-templates mode="inline" select="./*[2]"/>
393 <xsl:call-template name="mksymbol-1">
394 <xsl:with-param name="symbol" select="'RightArrow'"/>
395 <xsl:with-param name="color" select="'green'"/>
396 <xsl:with-param name="size" select="'+0'"/>
398 <xsl:apply-templates mode="inline"
403 <xsl:when test="$name='inst'">
404 <xsl:apply-templates select="*[2]" mode="inline"/>
405 <FONT color="blue">{</FONT>
406 <xsl:for-each select="*[(position()>2) and (position() mod 2 = 1)]">
407 <xsl:apply-templates select="following-sibling::*[position() = 1]" mode="inline"/>
408 <FONT color="blue">/</FONT>
409 <xsl:if test="name()='m:ci'">
410 <a href="{@definitionURL}">
411 <xsl:apply-templates/>
414 <!-- <xsl:apply-templates select="." mode="inline"/> -->
416 <FONT color="blue">}</FONT>
420 <xsl:when test="$name='fix'">
421 <FONT color="red">FIX</FONT>
422 <xsl:value-of select="m:ci"/>
423 <xsl:text>{</xsl:text>
424 <xsl:for-each select="m:bvar">
425 <xsl:value-of select="m:ci"/>
426 <xsl:text>:</xsl:text>
427 <xsl:apply-templates mode="inline" select="m:type"/>
428 <xsl:text>:=</xsl:text>
429 <xsl:apply-templates mode="inline"
430 select="following-sibling::*[position() = 1]"/>
432 <xsl:when test="position()=last()">
433 <xsl:text>}</xsl:text>
436 <xsl:text>;</xsl:text>
442 <xsl:when test="$name='cofix'">
443 <xsl:text>COFIX</xsl:text>
444 <xsl:value-of select="m:ci"/>
445 <xsl:text>{</xsl:text>
446 <xsl:for-each select="m:bvar">
447 <xsl:value-of select="m:ci"/>
448 <xsl:text>:</xsl:text>
449 <xsl:apply-templates mode="inline" select="m:type"/>
450 <xsl:text>:=</xsl:text>
451 <xsl:apply-templates mode="inline"
452 select="following-sibling::*[position() = 1]"/>
454 <xsl:when test="position()=last()">
455 <xsl:text>}</xsl:text>
458 <xsl:text>;</xsl:text>
463 <!-- proof and side_proof -->
464 <xsl:when test="$name='proof' or $name='side_proof'">
465 <xsl:apply-templates mode="inline" select="*[position()=2]"/>
466 <FONT color="red"> proves </FONT>
467 <xsl:apply-templates mode="inline" select="*[position()=3]"/>
469 <FONT color="red"> which is equivalent to </FONT>
470 <xsl:apply-templates mode="inline" select="*[position()=4]"/>
474 <xsl:when test="$name='letin1'">
475 <xsl:text>letin1 (inline error)</xsl:text>
478 <xsl:when test="$name='false_ind'">
479 <xsl:apply-templates mode="inline" select="*[3]"/>
480 <FONT color="red">Contradiction.</FONT>
483 <xsl:when test="$name='and_ind'">
484 <FONT color="red">From </FONT>
485 <xsl:apply-templates select="*[2]"/>
486 <FONT color="red"> we get</FONT>
488 <xsl:apply-templates select="*[3]"/>
490 <xsl:apply-templates mode="inline" select="*[4]"/>
491 <FONT color="red"> and </FONT>
493 <xsl:apply-templates select="*[5]"/>
495 <xsl:apply-templates mode="inline" select="*[6]"/>
497 <FONT color="red"> hence </FONT>
498 <xsl:apply-templates mode="inline" select="*[7]"/>
501 <xsl:when test="$name='subst'">
502 <xsl:apply-templates select="*[3]" mode="inline"/>
503 <xsl:text>[</xsl:text>
504 <xsl:apply-templates select="*[4]" mode="inline"/>
506 <xsl:when test="$uri != ''">
508 <xsl:call-template name="mksymbol-1">
509 <xsl:with-param name="symbol" select="$name"/>
510 <xsl:with-param name="color" select="'green'"/>
511 <xsl:with-param name="size" select="'+0'"/>
516 <xsl:call-template name="mksymbol-1">
517 <xsl:with-param name="symbol" select="$name"/>
518 <xsl:with-param name="color" select="'green'"/>
519 <xsl:with-param name="size" select="'+0'"/>
523 <xsl:apply-templates select="*[2]" mode="inline"/>
524 <xsl:text>]</xsl:text>
527 <xsl:when test="$name='lift_with_base'">
529 <xsl:apply-templates select="*[3]" mode="inline"/>
532 <xsl:when test="$uri != ''">
534 <xsl:call-template name="mksymbol-1">
535 <xsl:with-param name="symbol" select="$name"/>
536 <xsl:with-param name="color" select="'green'"/>
537 <xsl:with-param name="size" select="'+0'"/>
542 <xsl:call-template name="mksymbol-1">
543 <xsl:with-param name="symbol" select="$name"/>
544 <xsl:with-param name="color" select="'green'"/>
545 <xsl:with-param name="size" select="'+0'"/>
550 <xsl:apply-templates select="*[4]" mode="inline"/>
552 <xsl:text>(</xsl:text>
553 <xsl:apply-templates select="*[2]" mode="inline"/>
554 <xsl:text>)</xsl:text>
557 <xsl:when test="$name='lift'">
559 <xsl:when test="$uri != ''">
561 <xsl:call-template name="mksymbol-1">
562 <xsl:with-param name="symbol" select="$name"/>
563 <xsl:with-param name="color" select="'green'"/>
564 <xsl:with-param name="size" select="'+0'"/>
569 <xsl:call-template name="mksymbol-1">
570 <xsl:with-param name="symbol" select="$name"/>
571 <xsl:with-param name="color" select="'green'"/>
572 <xsl:with-param name="size" select="'+0'"/>
577 <xsl:apply-templates select="*[2]" mode="inline"/>
579 <xsl:text>(</xsl:text>
580 <xsl:apply-templates select="*[3]" mode="inline"/>
581 <xsl:text>)</xsl:text>
585 <xsl:when test="$name='beta_red1'">
586 <xsl:apply-templates select="*[2]" mode="inline"/>
588 <xsl:when test="$uri != ''">
590 <xsl:call-template name="mksymbol-1">
591 <xsl:with-param name="symbol" select="$name"/>
592 <xsl:with-param name="color" select="'green'"/>
593 <xsl:with-param name="size" select="'+0'"/>
596 <xsl:call-template name="mksymbol-1">
597 <xsl:with-param name="symbol" select="'beta'"/>
598 <xsl:with-param name="color" select="'green'"/>
599 <xsl:with-param name="size" select="'+0'"/>
605 <xsl:call-template name="mksymbol-1">
606 <xsl:with-param name="symbol" select="$name"/>
607 <xsl:with-param name="color" select="'green'"/>
608 <xsl:with-param name="size" select="'+0'"/>
611 <xsl:call-template name="mksymbol-1">
612 <xsl:with-param name="symbol" select="'beta'"/>
613 <xsl:with-param name="color" select="'green'"/>
614 <xsl:with-param name="size" select="'+0'"/>
619 <xsl:apply-templates select="*[3]" mode="inline"/>
622 <xsl:when test="$name='beta_red'">
623 <xsl:apply-templates select="*[2]" mode="inline"/>
625 <xsl:when test="$uri != ''">
627 <xsl:call-template name="mksymbol-1">
628 <xsl:with-param name="symbol" select="$name"/>
629 <xsl:with-param name="color" select="'green'"/>
630 <xsl:with-param name="size" select="'+0'"/>
633 <xsl:call-template name="mksymbol-1">
634 <xsl:with-param name="symbol" select="'beta'"/>
635 <xsl:with-param name="color" select="'green'"/>
636 <xsl:with-param name="size" select="'+0'"/>
638 <xsl:text>*</xsl:text>
643 <xsl:call-template name="mksymbol-1">
644 <xsl:with-param name="symbol" select="$name"/>
645 <xsl:with-param name="color" select="'green'"/>
646 <xsl:with-param name="size" select="'+0'"/>
649 <xsl:call-template name="mksymbol-1">
650 <xsl:with-param name="symbol" select="'beta'"/>
651 <xsl:with-param name="color" select="'green'"/>
652 <xsl:with-param name="size" select="'+0'"/>
654 <xsl:text>*</xsl:text>
658 <xsl:apply-templates select="*[3]" mode="inline"/>
661 <xsl:when test="$name='par_beta_red1'">
662 <xsl:apply-templates select="*[2]" mode="inline"/>
664 <xsl:when test="$uri != ''">
666 <xsl:call-template name="mksymbol-1">
667 <xsl:with-param name="symbol" select="$name"/>
668 <xsl:with-param name="color" select="'green'"/>
669 <xsl:with-param name="size" select="'+0'"/>
672 <xsl:call-template name="mksymbol-1">
673 <xsl:with-param name="symbol" select="'beta'"/>
674 <xsl:with-param name="color" select="'green'"/>
675 <xsl:with-param name="size" select="'+0'"/>
681 <xsl:call-template name="mksymbol-1">
682 <xsl:with-param name="symbol" select="$name"/>
683 <xsl:with-param name="color" select="'green'"/>
684 <xsl:with-param name="size" select="'+0'"/>
687 <xsl:call-template name="mksymbol-1">
688 <xsl:with-param name="symbol" select="'beta'"/>
689 <xsl:with-param name="color" select="'green'"/>
690 <xsl:with-param name="size" select="'+0'"/>
695 <xsl:apply-templates select="*[3]" mode="inline"/>
698 <xsl:when test="$name='par_beta_red'">
699 <xsl:apply-templates select="*[2]" mode="inline"/>
701 <xsl:when test="$uri != ''">
703 <xsl:call-template name="mksymbol-1">
704 <xsl:with-param name="symbol" select="$name"/>
705 <xsl:with-param name="color" select="'green'"/>
706 <xsl:with-param name="size" select="'+0'"/>
709 <xsl:call-template name="mksymbol-1">
710 <xsl:with-param name="symbol" select="'beta'"/>
711 <xsl:with-param name="color" select="'green'"/>
712 <xsl:with-param name="size" select="'+0'"/>
714 <xsl:text>*</xsl:text>
719 <xsl:call-template name="mksymbol-1">
720 <xsl:with-param name="symbol" select="$name"/>
721 <xsl:with-param name="color" select="'green'"/>
722 <xsl:with-param name="size" select="'+0'"/>
725 <xsl:call-template name="mksymbol-1">
726 <xsl:with-param name="symbol" select="'beta'"/>
727 <xsl:with-param name="color" select="'green'"/>
728 <xsl:with-param name="size" select="'+0'"/>
730 <xsl:text>*</xsl:text>
734 <xsl:apply-templates select="*[3]" mode="inline"/>
738 <xsl:when test="$name='forgetful'">
740 <xsl:when test="$uri != ''">
741 <a href="{$uri}">|</a>
747 <xsl:apply-templates select="*[2]" mode="inline"/>
749 <xsl:when test="$uri != ''">
750 <a href="{$uri}">|</a>
758 <!-- boolean algebra of redexes -->
761 <xsl:when test="$name='isomorphic'">
762 <xsl:apply-templates select="*[2]" mode="inline"/>
764 <xsl:when test="$uri != ''">
766 <xsl:call-template name="mksymbol-1">
767 <xsl:with-param name="symbol" select="$name"/>
768 <xsl:with-param name="color" select="'green'"/>
769 <xsl:with-param name="size" select="'+0'"/>
774 <xsl:call-template name="mksymbol-1">
775 <xsl:with-param name="symbol" select="$name"/>
776 <xsl:with-param name="color" select="'green'"/>
777 <xsl:with-param name="size" select="'+0'"/>
781 <xsl:apply-templates select="*[3]" mode="inline"/>
785 <xsl:when test="$name='interp'">
786 <font color="green">[</font>
787 <xsl:apply-templates select="*[2]"/>
788 <font color="green">]</font>
794 <xsl:template mode="inline" match="m:lambda">
795 <xsl:call-template name="mksymbol-1">
796 <xsl:with-param name="symbol" select="'lambda'"/>
797 <xsl:with-param name="color" select="'red'"/>
798 <xsl:with-param name="size" select="'+2'"/>
800 <xsl:apply-templates select="m:bvar/m:ci"/>
801 <xsl:text>:</xsl:text>
802 <xsl:apply-templates mode="inline" select="m:bvar/m:type"/>
803 <xsl:text>.</xsl:text>
804 <xsl:apply-templates mode="inline" select="*[position()=2]"/>
807 <!--*********************************************************************-->
808 <!-- COUNTING MODE -->
809 <!--*********************************************************************-->
811 <xsl:template match="m:apply[m:csymbol]">
812 <xsl:param name="current_indent" select="0"/>
813 <xsl:param name="width" select="$framewidth"/>
814 <xsl:variable name="name">
815 <xsl:value-of select="m:csymbol"/>
817 <xsl:variable name="charlength">
818 <xsl:apply-templates select="m:csymbol" mode="charcount"/>
820 <!-- <xsl:value-of select="$current_indent"/> -->
821 <!-- <xsl:value-of select="$charlength"/> -->
822 <xsl:variable name="uri"><xsl:value-of select="*[1]/@definitionURL"/></xsl:variable>
825 <xsl:when test="$name='inst'">
826 <xsl:apply-templates select="." mode="inline"/>
829 <xsl:when test="$name='forall'">
831 <xsl:when test="$charlength > $framewidth">
833 <xsl:call-template name="mksymbol-1">
834 <xsl:with-param name="symbol" select="$name"/>
835 <xsl:with-param name="color" select="'blue'"/>
836 <xsl:with-param name="size" select="'+2'"/>
838 <xsl:apply-templates select="m:bvar/m:ci"/>
839 <xsl:text>:</xsl:text>
840 <xsl:apply-templates select="m:bvar/m:type">
841 <xsl:with-param name="current_indent"
842 select="$current_indent + 5 + 2*string-length(m:bvar/m:ci)"/>
843 </xsl:apply-templates>
845 <xsl:call-template name="make_indent">
846 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
848 <xsl:text>.</xsl:text>
849 <xsl:apply-templates select="*[position()=3]">
850 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
851 </xsl:apply-templates>
854 <xsl:apply-templates mode="inline" select="."/>
859 <xsl:when test="$name='prod'">
861 <xsl:when test="$charlength > $framewidth">
862 <xsl:call-template name="mksymbol-1">
863 <xsl:with-param name="symbol" select="$name"/>
864 <xsl:with-param name="color" select="'blue'"/>
865 <xsl:with-param name="size" select="'+2'"/>
867 <xsl:apply-templates select="m:bvar/m:ci"/>
868 <xsl:text>:</xsl:text>
869 <xsl:apply-templates select="m:bvar/m:type">
870 <xsl:with-param name="current_indent"
871 select="$current_indent + 5 + 2*string-length(m:bvar/m:ci)"/>
872 </xsl:apply-templates><br/>
873 <xsl:call-template name="make_indent">
874 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
876 <xsl:text>.</xsl:text>
877 <xsl:apply-templates select="*[position()=3]">
878 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
879 </xsl:apply-templates>
882 <xsl:apply-templates mode="inline" select="."/>
887 <xsl:when test="$name='arrow'">
889 <xsl:when test="$charlength > $framewidth">
890 <xsl:text>(</xsl:text>
891 <xsl:apply-templates select="*[position()=2]">
892 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
893 </xsl:apply-templates>
895 <xsl:call-template name="make_indent">
896 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
899 <xsl:call-template name="mksymbol-1">
900 <xsl:with-param name="symbol" select="$name"/>
901 <xsl:with-param name="color" select="'blue'"/>
902 <xsl:with-param name="size" select="'+0'"/>
904 <xsl:apply-templates select="*[position()=3]">
905 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
906 </xsl:apply-templates>
907 <xsl:text>)</xsl:text>
910 <xsl:apply-templates mode="inline" select="."/>
915 <xsl:when test="$name='iff'">
917 <xsl:when test="$charlength > $framewidth">
918 <xsl:text>(</xsl:text>
919 <xsl:apply-templates select="*[position()=2]">
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-1">
928 <xsl:with-param name="symbol" select="$name"/>
929 <xsl:with-param name="color" select="'blue'"/>
930 <xsl:with-param name="size" select="'+0'"/>
932 <xsl:apply-templates select="*[position()=3]">
933 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
934 </xsl:apply-templates>
935 <xsl:text>)</xsl:text>
938 <xsl:apply-templates mode="inline" select="."/>
943 <xsl:when test="$name='append'">
945 <xsl:when test="$charlength > $framewidth">
946 <xsl:text>(</xsl:text>
947 <xsl:apply-templates select="*[position()=2]">
948 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
949 </xsl:apply-templates>
951 <xsl:call-template name="make_indent">
952 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
955 <xsl:call-template name="mksymbol-1">
956 <xsl:with-param name="symbol" select="$name"/>
957 <xsl:with-param name="color" select="'blue'"/>
958 <xsl:with-param name="size" select="'+0'"/>
960 <xsl:apply-templates select="*[position()=3]">
961 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
962 </xsl:apply-templates>
963 <xsl:text>)</xsl:text>
966 <xsl:apply-templates mode="inline" select="."/>
971 <xsl:when test="$name='app'">
973 <xsl:when test="$charlength > $framewidth">
974 <xsl:text>(</xsl:text>
975 <xsl:apply-templates select="*[position()=2]">
976 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
977 </xsl:apply-templates>
978 <xsl:for-each select="*[position()>2]">
980 <xsl:call-template name="make_indent">
981 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
983 <xsl:apply-templates select=".">
984 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
985 </xsl:apply-templates>
987 <xsl:text>)</xsl:text>
990 <xsl:apply-templates mode="inline" select="."/>
994 <xsl:when test="$name='cast'">
996 <xsl:when test="$showcast = 1">
998 <xsl:when test="$charlength > $framewidth">
999 <xsl:text>(</xsl:text>
1000 <xsl:apply-templates select="*[position()=2]">
1001 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1002 </xsl:apply-templates><br/>
1003 <xsl:call-template name="make_indent">
1004 <xsl:with-param name="current_indent" select="$current_indent + 2"/> </xsl:call-template>
1005 <xsl:text>:></xsl:text>
1006 <xsl:apply-templates select="*[position()=3]">
1007 <xsl:with-param name="current_indent" select="$current_indent + 3"/>
1008 </xsl:apply-templates>
1009 <xsl:text>)</xsl:text>
1012 <xsl:apply-templates mode="inline" select="."/>
1017 <xsl:apply-templates select="*[position()=2]">
1018 <xsl:with-param name="current_indent" select="$current_indent"/>
1019 </xsl:apply-templates>
1023 <xsl:when test="$name='Prop'">
1024 <xsl:text>Prop</xsl:text>
1026 <xsl:when test="$name='Set'">
1027 <xsl:text>Set</xsl:text>
1029 <xsl:when test="$name='Type'">
1030 <xsl:text>Type</xsl:text>
1032 <xsl:when test="$name='mutcase'">
1034 <xsl:when test="$charlength > $framewidth">
1035 <xsl:text><</xsl:text>
1036 <xsl:apply-templates select="*[position()=2]">
1037 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1038 </xsl:apply-templates>
1039 <xsl:text>> </xsl:text>
1041 <xsl:call-template name="make_indent">
1042 <xsl:with-param name="current_indent" select="$current_indent + 2"/> </xsl:call-template>
1043 <xsl:text>CASE </xsl:text>
1044 <xsl:apply-templates select="*[position()=3]">
1045 <xsl:with-param name="current_indent" select="$current_indent + 8"/>
1046 </xsl:apply-templates>
1047 <xsl:text> OF </xsl:text>
1048 <xsl:for-each select="m:piecewise/m:piece">
1049 <!-- <xsl:for-each select="*[position() mod 2 = 0 and position()>3]">-->
1051 <xsl:call-template name="make_indent">
1052 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1053 </xsl:call-template>
1055 <xsl:when test="position() = 1">
1056 <xsl:text>  </xsl:text>
1059 <xsl:text>| </xsl:text>
1062 <xsl:apply-templates select="./*[2]"/>
1063 <xsl:call-template name="mksymbol-1">
1064 <xsl:with-param name="symbol" select="'RightArrow'"/>
1065 <xsl:with-param name="color" select="'green'"/>
1066 <xsl:with-param name="size" select="'+0'"/>
1067 </xsl:call-template>
1068 <xsl:variable name="body_size">
1069 <xsl:apply-templates
1070 select="./*[1]/*[1]" mode="charcount"/>
1073 <xsl:when test="$body_size > $framewidth">
1075 <xsl:call-template name="make_indent">
1076 <xsl:with-param name="current_indent"
1077 select="$current_indent + 8"/>
1078 </xsl:call-template>
1079 <xsl:apply-templates
1081 <xsl:with-param name="current_indent"
1082 select="$current_indent + 8"/>
1083 </xsl:apply-templates>
1086 <xsl:apply-templates select="./*[1]"
1093 <xsl:apply-templates mode="inline" select="."/>
1098 <xsl:when test="$name='fix'">
1100 <xsl:when test="$charlength > $framewidth">
1101 <xsl:text>FIX</xsl:text>
1102 <xsl:value-of select="m:ci"/>
1103 <xsl:text>{</xsl:text>
1104 <xsl:for-each select="m:bvar">
1106 <xsl:call-template name="make_indent">
1107 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1108 </xsl:call-template>
1109 <xsl:value-of select="m:ci"/>
1110 <xsl:text>:</xsl:text>
1111 <xsl:apply-templates select="m:type">
1112 <xsl:with-param name="current_indent"
1113 select="$current_indent + 5 + string-length(m:ci)"/>
1114 </xsl:apply-templates>
1116 <xsl:call-template name="make_indent">
1117 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1118 </xsl:call-template>
1119 <xsl:text>:=</xsl:text>
1120 <xsl:apply-templates select="following-sibling::*[position() = 1]">
1121 <xsl:with-param name="current_indent" select="$current_indent +2"/>
1122 </xsl:apply-templates>
1125 <xsl:call-template name="make_indent">
1126 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1127 </xsl:call-template>
1128 <xsl:text>}</xsl:text>
1131 <xsl:apply-templates mode="inline" select="."/>
1136 <xsl:when test="$name='cofix'">
1138 <xsl:when test="($charlength + 10) > $framewidth">
1139 <xsl:text>COFIX</xsl:text>
1140 <xsl:value-of select="m:ci"/>
1141 <xsl:text>{</xsl:text>
1143 <xsl:call-template name="make_indent">
1144 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1145 </xsl:call-template>
1146 <xsl:for-each select="m:bvar">
1147 <xsl:value-of select="m:ci"/>
1148 <xsl:text>:</xsl:text>
1149 <xsl:apply-templates select="m:type">
1150 <xsl:with-param name="current_indent"
1151 select="$current_indent + 5 + string-length(m:ci)"/>
1152 </xsl:apply-templates>
1154 <xsl:call-template name="make_indent">
1155 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1156 </xsl:call-template>
1157 <xsl:text>:=</xsl:text>
1158 <xsl:apply-templates select="following-sibling::*[position() = 1]">
1159 <xsl:with-param name="current_indent" select="$current_indent + 3"/>
1160 </xsl:apply-templates>
1164 <xsl:call-template name="make_indent">
1165 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1166 </xsl:call-template>
1167 <xsl:text>}</xsl:text>
1170 <xsl:apply-templates mode="inline" select="m:type"/>
1174 <xsl:when test="$name='let_in'">
1175 <xsl:text>let </xsl:text>
1176 <xsl:apply-templates select="m:bvar/m:ci"/>
1177 <xsl:text> := </xsl:text>
1178 <xsl:apply-templates select="*[3]">
1179 <xsl:with-param name="current_indent" select="$current_indent+14"/>
1180 </xsl:apply-templates>
1182 <xsl:call-template name="make_indent">
1183 <xsl:with-param name="current_indent" select="$current_indent"/>
1184 </xsl:call-template>
1185 <xsl:text>in </xsl:text>
1186 <xsl:apply-templates select="*[4]">
1187 <xsl:with-param name="current_indent" select="$current_indent+5"/>
1188 </xsl:apply-templates>
1191 <!-- ***************************************** -->
1192 <!-- *********** PROOF ELEMENTS ************** -->
1193 <!-- ***************************************** -->
1195 <xsl:when test="$name='proof'">
1196 <xsl:variable name="nonce" select="generate-id()"/>
1197 <xsl:variable name="freshid1" select="concat('a',$nonce)"/>
1198 <xsl:variable name="freshid2" select="concat('b',$nonce)"/>
1199 <xsl:variable name="freshid3" select="concat('c',$nonce)"/>
1200 <span ID="{$freshid1}">
1201 <xsl:apply-templates select="*[position()=2]">
1202 <xsl:with-param name="current_indent" select="$current_indent"/>
1203 </xsl:apply-templates>
1205 <xsl:if test="*[4]">
1207 <xsl:call-template name="make_indent">
1208 <xsl:with-param name="current_indent" select="$current_indent"/>
1209 </xsl:call-template>
1210 <FONT color="red">we proved </FONT>
1211 <xsl:apply-templates select="*[position()=3]">
1212 <xsl:with-param name="current_indent" select="$current_indent+16"/>
1213 </xsl:apply-templates>
1215 <xsl:call-template name="make_indent">
1216 <xsl:with-param name="current_indent" select="$current_indent"/>
1217 </xsl:call-template>
1218 <FONT color="red">and by delta equivalence</FONT>
1219 <xsl:apply-templates select="*[position()=5]">
1220 <xsl:with-param name="current_indent" select="$current_indent+16"/>
1221 </xsl:apply-templates>
1225 <xsl:when test="(preceding-sibling::*[1]/text()='letin1') or
1226 (preceding-sibling::*[1]/text()='rw_step') or
1227 (name(..)='m:lambda')">
1229 <xsl:call-template name="make_indent">
1230 <xsl:with-param name="current_indent" select="$current_indent"/>
1231 </xsl:call-template>
1232 <FONT color="red">we proved </FONT>
1236 if(document.getElementById) {
1238 <span ID="{$freshid2}">\
1239 <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>\
1241 <span ID="{$freshid3}">\
1243 <xsl:call-template name="make_indent">
1244 <xsl:with-param name="current_indent" select="$current_indent"/>
1245 </xsl:call-template>\
1246 <a style="text-decoration:underline ; color:red" href="" onClick="Hide(document.getElementById(\'{$freshid1}\')); Show(document.getElementById(\'{$freshid2}\'));Hide(document.getElementById(\'{$freshid3}\'));return (0==1);">we obtain</a>\
1249 document.to_be_deleted.push('<xsl:value-of select="$freshid1"/>');
1250 document.to_be_deleted.push('<xsl:value-of select="$freshid3"/>');
1251 document.write(' ');
1255 <xsl:call-template name="make_indent">
1256 <xsl:with-param name="current_indent" select="$current_indent"/>
1257 </xsl:call-template>\
1258 <FONT color="red">we proved </FONT>\
1264 <xsl:apply-templates select="*[position()=last()]">
1265 <xsl:with-param name="current_indent" select="$current_indent + 16"/>
1266 </xsl:apply-templates>
1269 <xsl:when test="$name='side_proof'">
1270 <xsl:variable name="nonce" select="generate-id()"/>
1271 <xsl:variable name="freshid1" select="concat('a',$nonce)"/>
1272 <xsl:variable name="freshid2" select="concat('b',$nonce)"/>
1273 <xsl:variable name="freshid3" select="concat('c',$nonce)"/>
1274 <xsl:variable name="freshid4" select="concat('d',$nonce)"/>
1275 <span ID="{$freshid1}">
1276 <xsl:apply-templates select="*[position()=2]">
1277 <xsl:with-param name="current_indent" select="$current_indent"/>
1278 </xsl:apply-templates>
1282 if(document.getElementById) {
1284 <span ID="{$freshid2}">\
1285 <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>\
1287 <span ID="{$freshid3}">\
1289 <xsl:call-template name="make_indent">
1290 <xsl:with-param name="current_indent" select="$current_indent"/>
1291 </xsl:call-template>\
1292 <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>\
1295 document.to_be_deleted.push('<xsl:value-of select="$freshid1"/>');
1296 document.to_be_deleted.push('<xsl:value-of select="$freshid3"/>');
1297 document.to_be_deleted.push('<xsl:value-of select="$freshid4"/>');
1298 document.write(' ');
1302 <xsl:call-template name="make_indent">
1303 <xsl:with-param name="current_indent" select="$current_indent"/>
1304 </xsl:call-template>\
1305 <FONT color="red">we proved </FONT>\
1309 <span ID="{$freshid4}">
1310 <xsl:apply-templates select="*[position()=3]">
1311 <xsl:with-param name="current_indent" select="$current_indent + 16"/>
1312 </xsl:apply-templates>
1316 <xsl:when test="$name='eq_chain'">
1317 <FONT color="red">We have the following equality chain:</FONT>
1318 <xsl:for-each select="*[position() mod 2 = 0]">
1319 <xsl:variable name="pos" select="position()"/>
1321 <xsl:call-template name="make_indent">
1322 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
1323 </xsl:call-template>
1325 <xsl:when test="$pos=1">
1326 <xsl:apply-templates select=".">
1327 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
1328 </xsl:apply-templates>
1329 <xsl:text> =</xsl:text>
1332 <xsl:text>= </xsl:text>
1333 <xsl:apply-templates select=".">
1334 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
1335 </xsl:apply-templates>
1338 <xsl:if test="$pos != last()">
1340 <xsl:call-template name="make_indent">
1341 <xsl:with-param name="current_indent" select="$current_indent + 15"/>
1342 </xsl:call-template>
1343 <xsl:apply-templates select="../*[position()=2*$pos +1]">
1344 <xsl:with-param name="current_indent" select="$current_indent + 15"/>
1345 </xsl:apply-templates>
1349 <!-- diseq_chain -->
1350 <xsl:when test="$name='diseq_chain'">
1351 <FONT color="red">We have the following chain of disequalities:</FONT>
1352 <xsl:for-each select="*[position() mod 3 = 2]">
1353 <xsl:variable name="pos" select="position()"/>
1355 <xsl:call-template name="make_indent">
1356 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
1357 </xsl:call-template>
1359 <xsl:when test="$pos=1">
1360 <xsl:apply-templates select=".">
1361 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
1362 </xsl:apply-templates>
1363 <xsl:text> </xsl:text>
1364 <xsl:apply-templates mode="inline" select="../*[position()=3*$pos]"/>
1367 <xsl:apply-templates mode="inline" select="../*[position()=3*($pos - 1)]"/>
1368 <xsl:text> </xsl:text>
1369 <xsl:apply-templates select=".">
1370 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
1371 </xsl:apply-templates>
1374 <xsl:if test="$pos != last()">
1376 <xsl:call-template name="make_indent">
1377 <xsl:with-param name="current_indent" select="$current_indent + 15"/>
1378 </xsl:call-template>
1379 <xsl:apply-templates select="../*[position()=3*$pos +1]">
1380 <xsl:with-param name="current_indent" select="$current_indent + 15"/>
1381 </xsl:apply-templates>
1386 <xsl:when test="$name='letin1'">
1387 <xsl:apply-templates select="*[position()=2]">
1388 <xsl:with-param name="current_indent" select="$current_indent"/>
1389 </xsl:apply-templates>
1391 <xsl:call-template name="make_indent">
1392 <xsl:with-param name="current_indent" select="$current_indent"/>
1393 </xsl:call-template>
1394 <xsl:apply-templates select="*[position()=3]">
1395 <xsl:with-param name="current_indent" select="$current_indent"/>
1396 </xsl:apply-templates>
1399 <xsl:when test="$name='letin'">
1400 <xsl:for-each select="*[position()>1 and last()>position()]">
1401 <xsl:apply-templates select=".">
1402 <xsl:with-param name="current_indent" select="$current_indent"/>
1403 </xsl:apply-templates>
1405 <xsl:call-template name="make_indent">
1406 <xsl:with-param name="current_indent" select="$current_indent"/>
1407 </xsl:call-template>
1409 <xsl:apply-templates select="*[position()=last()]">
1410 <xsl:with-param name="current_indent" select="$current_indent"/>
1411 </xsl:apply-templates>
1414 <xsl:when test="$name='let'">
1416 <xsl:apply-templates select="m:ci"/>
1418 <xsl:apply-templates select="*[3]">
1419 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
1420 </xsl:apply-templates>
1423 <xsl:when test="$name='rw_step'">
1425 <xsl:when test="name(*[2])='m:apply'">
1426 <xsl:apply-templates select="*[2]">
1427 <xsl:with-param name="current_indent" select="$current_indent"/>
1428 </xsl:apply-templates>
1431 <FONT color="red">Consider </FONT>
1432 <xsl:apply-templates select="*[2]"/>
1435 <xsl:variable name="charlength_first">
1436 <xsl:apply-templates select="*[3]" mode="root_charcount"/>
1438 <xsl:variable name="charlength_second">
1439 <xsl:apply-templates select="*[4]" mode="root_charcount"/>
1441 <xsl:variable name="charlength_side_proof">
1442 <xsl:apply-templates select="*[5]" mode="root_charcount"/>
1444 <xsl:variable name="split1"
1445 select="($charlength_first + $charlength_second) > $framewidth"/>
1446 <xsl:variable name="split2"
1447 select="($charlength_second + $charlength_side_proof) > $framewidth"/>
1448 <!-- <xsl:value-of select="$current_indent"/> -->
1449 <!-- <xsl:value-of select="string($charlength_second)"/> -->
1450 <!-- <xsl:value-of select="$charlength_side_proof"/> -->
1451 <!-- <xsl:value-of select="$split2"/> -->
1453 <xsl:call-template name="make_indent">
1454 <xsl:with-param name="current_indent" select="$current_indent"/>
1455 </xsl:call-template>
1456 <FONT color="red">Rewrite </FONT>
1457 <xsl:apply-templates mode="inline" select="*[3]"/>
1458 <xsl:text> </xsl:text>
1459 <xsl:if test="$split1">
1461 <xsl:call-template name="make_indent">
1462 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1463 </xsl:call-template>
1465 <FONT color="red">with </FONT>
1466 <xsl:apply-templates mode="inline" select="*[4]"/>
1467 <xsl:text> </xsl:text>
1468 <xsl:if test="$split2">
1470 <xsl:call-template name="make_indent">
1471 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1472 </xsl:call-template>
1474 <FONT color="red">by </FONT>
1475 <xsl:apply-templates select="*[5]">
1476 <xsl:with-param name="current_indent" select="$current_indent+7"/>
1477 </xsl:apply-templates>
1479 <!-- rewrite and apply -->
1480 <xsl:when test="$name='rewrite_and_apply'">
1481 <xsl:apply-templates select="*[2]">
1482 <xsl:with-param name="current_indent" select="$current_indent"/>
1483 </xsl:apply-templates>
1485 <xsl:call-template name="make_indent">
1486 <xsl:with-param name="current_indent" select="$current_indent"/>
1487 </xsl:call-template>
1488 <FONT color="red">Then apply it to </FONT>
1489 <xsl:apply-templates select="*[position()>2]"/>
1491 <!-- by_induction -->
1492 <xsl:when test="$name='by_induction'">
1493 <FONT color="red">We prove </FONT>
1494 <xsl:apply-templates select="../*[3]">
1495 <xsl:with-param name="current_indent" select="$current_indent+18"/>
1496 </xsl:apply-templates>
1498 <xsl:call-template name="make_indent">
1499 <xsl:with-param name="current_indent" select="$current_indent"/>
1500 </xsl:call-template>
1501 <FONT color="red">by induction on </FONT>
1502 <xsl:apply-templates select="*[position()=last()]/*[position()=last()]">
1503 <xsl:with-param name="current_indent" select="$current_indent+30"/>
1504 </xsl:apply-templates>
1507 <xsl:call-template name="make_indent">
1508 <xsl:with-param name="current_indent" select="$current_indent"/>
1509 </xsl:call-template>
1510 <xsl:text>The induction property is</xsl:text>
1512 <xsl:call-template name="make_indent">
1513 <xsl:with-param name="current_indent" select="$current_indent"/>
1514 </xsl:call-template>
1515 <xsl:apply-templates select="*[3]">
1516 <xsl:with-param name="current_indent" select="$current_indent"/>
1517 </xsl:apply-templates>
1519 <xsl:apply-templates
1520 select="*[position()>3 and not(position()=last())]">
1521 <xsl:with-param name="current_indent" select="$current_indent+4"/>
1522 </xsl:apply-templates>
1524 <xsl:call-template name="make_indent">
1525 <xsl:with-param name="current_indent" select="$current_indent"/>
1526 </xsl:call-template>
1527 <xsl:text>End induction</xsl:text> -->
1529 <!-- inductive_case -->
1530 <xsl:when test="$name='inductive_case'">
1532 <xsl:call-template name="make_indent">
1533 <xsl:with-param name="current_indent" select="$current_indent"/>
1534 </xsl:call-template>
1535 <FONT color="red">Case </FONT>
1536 <xsl:apply-templates select="*[2]">
1537 <xsl:with-param name="current_indent" select="$current_indent +10"/>
1538 </xsl:apply-templates>
1539 <xsl:if test="*[3]/*[position()>1]">
1541 <xsl:call-template name="make_indent">
1542 <xsl:with-param name="current_indent" select="$current_indent+4"/>
1543 </xsl:call-template>
1544 <FONT color="red">By induction hypothesis, we have:</FONT>
1545 <xsl:for-each select="*[3]/*[position()>1]">
1547 <xsl:call-template name="make_indent">
1548 <xsl:with-param name="current_indent" select="$current_indent + 4"/>
1549 </xsl:call-template>
1550 <xsl:text>(</xsl:text>
1551 <xsl:apply-templates select="m:ci"/>
1552 <xsl:text>) </xsl:text>
1553 <xsl:apply-templates select="m:type">
1554 <xsl:with-param name="current_indent" select="$current_indent + 8"/>
1555 </xsl:apply-templates>
1559 <xsl:call-template name="make_indent">
1560 <xsl:with-param name="current_indent" select="$current_indent + 4"/>
1561 </xsl:call-template>
1562 <xsl:apply-templates select="*[4]">
1563 <xsl:with-param name="current_indent" select="$current_indent +4"/>
1564 </xsl:apply-templates>
1566 <xsl:call-template name="make_indent">
1567 <xsl:with-param name="current_indent" select="$current_indent"/>
1568 </xsl:call-template>
1569 <xsl:text>End Case</xsl:text> -->
1572 <xsl:when test="$name='case_lhs'">
1574 <xsl:when test="count(*)=2">
1575 <xsl:apply-templates mode="inline" select="*[2]"/>
1578 <xsl:text>(</xsl:text>
1579 <xsl:apply-templates mode="inline" select="*[2]"/>
1580 <xsl:for-each select="m:bvar">
1581 <xsl:text> </xsl:text>
1582 <xsl:apply-templates mode="inline" select="*[1]"/>
1583 <xsl:text>:</xsl:text>
1584 <xsl:apply-templates mode="inline" select="m:type/*[1]"/>
1586 <xsl:text>)</xsl:text>
1591 <xsl:when test="$name='false_ind'">
1592 <xsl:apply-templates select="*[3]">
1593 <xsl:with-param name="current_indent" select="$current_indent"/>
1594 </xsl:apply-templates>
1596 <xsl:call-template name="make_indent">
1597 <xsl:with-param name="current_indent" select="$current_indent"/>
1598 </xsl:call-template>
1599 <FONT color="red">Contradiction.</FONT>
1602 <xsl:when test="$name='and_ind'">
1604 <xsl:when test="name(*[2])='m:apply'">
1605 <xsl:apply-templates select="*[2]">
1606 <xsl:with-param name="current_indent" select="$current_indent"/>
1607 </xsl:apply-templates>
1610 <FONT color="red">Consider </FONT>
1611 <xsl:apply-templates select="*[2]"/>
1615 <xsl:call-template name="make_indent">
1616 <xsl:with-param name="current_indent" select="$current_indent"/>
1617 </xsl:call-template>
1618 <FONT color="red">In particular, we have</FONT>
1620 <xsl:call-template name="make_indent">
1621 <xsl:with-param name="current_indent" select="$current_indent"/>
1622 </xsl:call-template>
1624 <xsl:apply-templates select="*[3]"/>
1626 <xsl:apply-templates select="*[4]">
1627 <xsl:with-param name="current_indent" select="$current_indent + 9"/>
1628 </xsl:apply-templates>
1630 <xsl:call-template name="make_indent">
1631 <xsl:with-param name="current_indent" select="$current_indent"/>
1632 </xsl:call-template>
1634 <xsl:apply-templates select="*[5]"/>
1636 <xsl:apply-templates select="*[6]">
1637 <xsl:with-param name="current_indent" select="$current_indent + 9"/>
1638 </xsl:apply-templates>
1640 <xsl:call-template name="make_indent">
1641 <xsl:with-param name="current_indent" select="$current_indent"/>
1642 </xsl:call-template>
1643 <xsl:apply-templates select="*[7]">
1644 <xsl:with-param name="current_indent" select="$current_indent"/>
1645 </xsl:apply-templates>
1647 <!-- full_or_ind -->
1648 <xsl:when test="$name='full_or_ind'">
1650 <xsl:when test="name(*[2])='m:apply'">
1651 <xsl:apply-templates select="*[2]">
1652 <xsl:with-param name="current_indent" select="$current_indent"/>
1653 </xsl:apply-templates>
1656 <FONT color="red">Consider </FONT>
1657 <xsl:apply-templates select="*[2]"/>
1661 <xsl:call-template name="make_indent">
1662 <xsl:with-param name="current_indent" select="$current_indent"/>
1663 </xsl:call-template>
1664 <FONT color="red">We proceed by cases to prove </FONT>
1665 <xsl:apply-templates select="*[3]"/>
1667 <xsl:call-template name="make_indent">
1668 <xsl:with-param name="current_indent" select="$current_indent+4"/>
1669 </xsl:call-template>
1670 <FONT color="red">Left: suppose </FONT>
1671 <xsl:text>(</xsl:text>
1672 <xsl:value-of select="*[4]/m:bvar/m:ci"/>
1673 <xsl:text>) </xsl:text>
1674 <xsl:apply-templates
1675 select="*[4]/m:bvar/m:type/*[1]"/>
1677 <xsl:call-template name="make_indent">
1678 <xsl:with-param name="current_indent" select="$current_indent+15"/>
1679 </xsl:call-template>
1680 <xsl:apply-templates
1682 <xsl:with-param name="current_indent" select="$current_indent+15"/>
1683 </xsl:apply-templates>
1685 <xsl:call-template name="make_indent">
1686 <xsl:with-param name="current_indent" select="$current_indent+4"/>
1687 </xsl:call-template>
1688 <FONT color="red">Right: suppose </FONT>
1689 <xsl:text>(</xsl:text>
1690 <xsl:value-of select="*[5]/m:bvar/m:ci"/>
1691 <xsl:text>) </xsl:text>
1692 <xsl:apply-templates
1693 select="*[5]/m:bvar/m:type/*[1]"/>
1695 <xsl:call-template name="make_indent">
1696 <xsl:with-param name="current_indent" select="$current_indent+16"/>
1697 </xsl:call-template>
1698 <xsl:apply-templates
1700 <xsl:with-param name="current_indent" select="$current_indent+16"/>
1701 </xsl:apply-templates>
1704 <xsl:when test="$name='or_ind'">
1706 <xsl:when test="name(*[2])='m:apply'">
1707 <xsl:apply-templates select="*[2]">
1708 <xsl:with-param name="current_indent" select="$current_indent"/>
1709 </xsl:apply-templates>
1712 <FONT color="red">Consider </FONT>
1713 <xsl:apply-templates select="*[2]"/>
1717 <xsl:call-template name="make_indent">
1718 <xsl:with-param name="current_indent" select="$current_indent"/>
1719 </xsl:call-template>
1720 <FONT color="red">We prove </FONT>
1721 <xsl:apply-templates select="*[3]"/>
1722 <FONT color="red"> by cases:</FONT>
1724 <xsl:call-template name="make_indent">
1725 <xsl:with-param name="current_indent" select="$current_indent"/>
1726 </xsl:call-template>
1728 <xsl:apply-templates select="*[4]">
1729 <xsl:with-param name="current_indent" select="$current_indent"/>
1730 </xsl:apply-templates>
1732 <xsl:call-template name="make_indent">
1733 <xsl:with-param name="current_indent" select="$current_indent"/>
1734 </xsl:call-template>
1736 <xsl:apply-templates select="*[5]">
1737 <xsl:with-param name="current_indent" select="$current_indent"/>
1738 </xsl:apply-templates>
1741 <xsl:when test="$name='ex_ind'">
1743 <xsl:when test="name(*[2])='m:apply'">
1744 <xsl:apply-templates select="*[2]">
1745 <xsl:with-param name="current_indent" select="$current_indent"/>
1746 </xsl:apply-templates>
1749 <FONT color="red">Consider </FONT>
1750 <xsl:apply-templates select="*[2]">
1751 <xsl:with-param name="current_indent" select="$current_indent"/>
1752 </xsl:apply-templates>
1756 <xsl:call-template name="make_indent">
1757 <xsl:with-param name="current_indent" select="$current_indent"/>
1758 </xsl:call-template>
1759 <FONT color="red">Let </FONT>
1760 <xsl:apply-templates mode="inline" select="*[3]"/>
1762 <xsl:apply-templates mode="inline" select="*[4]"/>
1763 <FONT color="red"> such that</FONT>
1765 <xsl:call-template name="make_indent">
1766 <xsl:with-param name="current_indent" select="$current_indent"/>
1767 </xsl:call-template>
1769 <xsl:apply-templates mode="inline" select="*[5]"/>
1771 <xsl:apply-templates select="*[6]">
1772 <xsl:with-param name="current_indent" select="$current_indent +7"/>
1773 </xsl:apply-templates>
1775 <xsl:call-template name="make_indent">
1776 <xsl:with-param name="current_indent" select="$current_indent"/>
1777 </xsl:call-template>
1778 <xsl:apply-templates select="*[7]">
1779 <xsl:with-param name="current_indent" select="$current_indent"/>
1780 </xsl:apply-templates>
1782 <!-- ***************************************** -->
1783 <!-- *********** LAMBDA ELEMENTS ************** -->
1784 <!-- ***************************************** -->
1785 <xsl:when test="$name='subst'">
1786 <xsl:apply-templates select="*[3]"/>
1787 <xsl:text>[</xsl:text>
1788 <xsl:apply-templates select="*[4]"/>
1790 <xsl:when test="$uri != ''">
1792 <xsl:call-template name="mksymbol-1">
1793 <xsl:with-param name="symbol" select="$name"/>
1794 <xsl:with-param name="color" select="'blue'"/>
1795 <xsl:with-param name="size" select="'+0'"/>
1796 </xsl:call-template>
1800 <xsl:call-template name="mksymbol-1">
1801 <xsl:with-param name="symbol" select="$name"/>
1802 <xsl:with-param name="color" select="'blue'"/>
1803 <xsl:with-param name="size" select="'+0'"/>
1804 </xsl:call-template>
1807 <xsl:apply-templates select="*[2]"/>
1808 <xsl:text>]</xsl:text>
1811 <xsl:when test="$name='lift_with_base'">
1813 <xsl:apply-templates select="*[3]" mode="inline"/>
1816 <xsl:when test="$uri != ''">
1818 <xsl:call-template name="mksymbol-1">
1819 <xsl:with-param name="symbol" select="$name"/>
1820 <xsl:with-param name="color" select="'green'"/>
1821 <xsl:with-param name="size" select="'+0'"/>
1822 </xsl:call-template>
1826 <xsl:call-template name="mksymbol-1">
1827 <xsl:with-param name="symbol" select="$name"/>
1828 <xsl:with-param name="color" select="'green'"/>
1829 <xsl:with-param name="size" select="'+0'"/>
1830 </xsl:call-template>
1834 <xsl:apply-templates select="*[4]" mode="inline"/>
1836 <xsl:text>(</xsl:text>
1837 <xsl:apply-templates select="*[2]" mode="inline"/>
1838 <xsl:text>)</xsl:text>
1841 <xsl:when test="$name='lift'">
1843 <xsl:when test="$uri != ''">
1845 <xsl:call-template name="mksymbol-1">
1846 <xsl:with-param name="symbol" select="$name"/>
1847 <xsl:with-param name="color" select="'green'"/>
1848 <xsl:with-param name="size" select="'+0'"/>
1849 </xsl:call-template>
1853 <xsl:call-template name="mksymbol-1">
1854 <xsl:with-param name="symbol" select="$name"/>
1855 <xsl:with-param name="color" select="'green'"/>
1856 <xsl:with-param name="size" select="'+0'"/>
1857 </xsl:call-template>
1861 <xsl:apply-templates select="*[2]" mode="inline"/>
1863 <xsl:text>(</xsl:text>
1864 <xsl:apply-templates select="*[3]" mode="inline"/>
1865 <xsl:text>)</xsl:text>
1869 <xsl:when test="$name='beta_red1'">
1870 <xsl:apply-templates select="*[2]" mode="inline"/>
1872 <xsl:when test="$uri != ''">
1874 <xsl:call-template name="mksymbol-1">
1875 <xsl:with-param name="symbol" select="$name"/>
1876 <xsl:with-param name="color" select="'green'"/>
1877 <xsl:with-param name="size" select="'+0'"/>
1878 </xsl:call-template>
1880 <xsl:call-template name="mksymbol-1">
1881 <xsl:with-param name="symbol" select="'beta'"/>
1882 <xsl:with-param name="color" select="'green'"/>
1883 <xsl:with-param name="size" select="'+0'"/>
1884 </xsl:call-template>
1889 <xsl:call-template name="mksymbol-1">
1890 <xsl:with-param name="symbol" select="$name"/>
1891 <xsl:with-param name="color" select="'green'"/>
1892 <xsl:with-param name="size" select="'+0'"/>
1893 </xsl:call-template>
1895 <xsl:call-template name="mksymbol-1">
1896 <xsl:with-param name="symbol" select="'beta'"/>
1897 <xsl:with-param name="color" select="'green'"/>
1898 <xsl:with-param name="size" select="'+0'"/>
1899 </xsl:call-template>
1903 <xsl:apply-templates select="*[3]" mode="inline"/>
1906 <xsl:when test="$name='beta_red'">
1907 <xsl:apply-templates select="*[2]" mode="inline"/>
1909 <xsl:when test="$uri != ''">
1911 <xsl:call-template name="mksymbol-1">
1912 <xsl:with-param name="symbol" select="$name"/>
1913 <xsl:with-param name="color" select="'green'"/>
1914 <xsl:with-param name="size" select="'+0'"/>
1915 </xsl:call-template>
1917 <xsl:call-template name="mksymbol-1">
1918 <xsl:with-param name="symbol" select="'beta'"/>
1919 <xsl:with-param name="color" select="'green'"/>
1920 <xsl:with-param name="size" select="'+0'"/>
1921 </xsl:call-template>
1922 <xsl:text>*</xsl:text>
1927 <xsl:call-template name="mksymbol-1">
1928 <xsl:with-param name="symbol" select="$name"/>
1929 <xsl:with-param name="color" select="'green'"/>
1930 <xsl:with-param name="size" select="'+0'"/>
1931 </xsl:call-template>
1933 <xsl:call-template name="mksymbol-1">
1934 <xsl:with-param name="symbol" select="'beta'"/>
1935 <xsl:with-param name="color" select="'green'"/>
1936 <xsl:with-param name="size" select="'+0'"/>
1937 </xsl:call-template>
1938 <xsl:text>*</xsl:text>
1942 <xsl:apply-templates select="*[3]" mode="inline"/>
1945 <xsl:when test="$name='par_beta_red1'">
1946 <xsl:apply-templates select="*[2]" mode="inline"/>
1948 <xsl:when test="$uri != ''">
1950 <xsl:call-template name="mksymbol-1">
1951 <xsl:with-param name="symbol" select="$name"/>
1952 <xsl:with-param name="color" select="'green'"/>
1953 <xsl:with-param name="size" select="'+0'"/>
1954 </xsl:call-template>
1956 <xsl:call-template name="mksymbol-1">
1957 <xsl:with-param name="symbol" select="'beta'"/>
1958 <xsl:with-param name="color" select="'green'"/>
1959 <xsl:with-param name="size" select="'+0'"/>
1960 </xsl:call-template>
1965 <xsl:call-template name="mksymbol-1">
1966 <xsl:with-param name="symbol" select="$name"/>
1967 <xsl:with-param name="color" select="'green'"/>
1968 <xsl:with-param name="size" select="'+0'"/>
1969 </xsl:call-template>
1971 <xsl:call-template name="mksymbol-1">
1972 <xsl:with-param name="symbol" select="'beta'"/>
1973 <xsl:with-param name="color" select="'green'"/>
1974 <xsl:with-param name="size" select="'+0'"/>
1975 </xsl:call-template>
1979 <xsl:apply-templates select="*[3]" mode="inline"/>
1982 <xsl:when test="$name='par_beta_red'">
1983 <xsl:apply-templates select="*[2]" mode="inline"/>
1985 <xsl:when test="$uri != ''">
1987 <xsl:call-template name="mksymbol-1">
1988 <xsl:with-param name="symbol" select="$name"/>
1989 <xsl:with-param name="color" select="'green'"/>
1990 <xsl:with-param name="size" select="'+0'"/>
1991 </xsl:call-template>
1993 <xsl:call-template name="mksymbol-1">
1994 <xsl:with-param name="symbol" select="'beta'"/>
1995 <xsl:with-param name="color" select="'green'"/>
1996 <xsl:with-param name="size" select="'+0'"/>
1997 </xsl:call-template>
1998 <xsl:text>*</xsl:text>
2003 <xsl:call-template name="mksymbol-1">
2004 <xsl:with-param name="symbol" select="$name"/>
2005 <xsl:with-param name="color" select="'green'"/>
2006 <xsl:with-param name="size" select="'+0'"/>
2007 </xsl:call-template>
2009 <xsl:call-template name="mksymbol-1">
2010 <xsl:with-param name="symbol" select="'beta'"/>
2011 <xsl:with-param name="color" select="'green'"/>
2012 <xsl:with-param name="size" select="'+0'"/>
2013 </xsl:call-template>
2014 <xsl:text>*</xsl:text>
2018 <xsl:apply-templates select="*[3]" mode="inline"/>
2022 <xsl:when test="$name='forgetful'">
2024 <xsl:when test="$uri != ''">
2025 <a href="{$uri}">|</a>
2031 <xsl:apply-templates select="*[2]" mode="inline"/>
2033 <xsl:when test="$uri != ''">
2034 <a href="{$uri}">|</a>
2042 <!-- boolean algebra of redexes -->
2045 <xsl:when test="$name='isomorphic'">
2046 <xsl:apply-templates select="*[2]" mode="inline"/>
2048 <xsl:when test="$uri != ''">
2050 <xsl:call-template name="mksymbol-1">
2051 <xsl:with-param name="symbol" select="$name"/>
2052 <xsl:with-param name="color" select="'green'"/>
2053 <xsl:with-param name="size" select="'+0'"/>
2054 </xsl:call-template>
2058 <xsl:call-template name="mksymbol-1">
2059 <xsl:with-param name="symbol" select="$name"/>
2060 <xsl:with-param name="color" select="'green'"/>
2061 <xsl:with-param name="size" select="'+0'"/>
2062 </xsl:call-template>
2065 <xsl:apply-templates select="*[3]" mode="inline"/>
2069 <xsl:when test="$name='interp'">
2070 <font color="green">[</font>
2071 <xsl:apply-templates select="*[2]"/>
2072 <font color="green">]</font>
2080 <xsl:template match="m:lambda">
2081 <xsl:param name="current_indent" select="0"/>
2082 <xsl:variable name="charlength">
2083 <xsl:apply-templates select="*[position()=1]" mode="charcount"/>
2084 <!-- <xsl:apply-templates select="." mode="charcount"/> -->
2086 <!-- <xsl:value-of select="$charlength"/> -->
2087 <!-- <xsl:value-of select="$current_indent"/> -->
2089 <xsl:when test="$charlength > $framewidth">
2091 <xsl:call-template name="mksymbol-1">
2092 <xsl:with-param name="symbol" select="'lambda'"/>
2093 <xsl:with-param name="color" select="'red'"/>
2094 <xsl:with-param name="size" select="'+2'"/>
2095 </xsl:call-template>
2096 <xsl:apply-templates select="m:bvar/m:ci"/>
2097 <xsl:text>:</xsl:text>
2098 <xsl:apply-templates select="m:bvar/m:type">
2099 <xsl:with-param name="current_indent"
2100 select="$current_indent + 4 + 2*string-length(m:bvar/m:ci)"/>
2101 </xsl:apply-templates><br/>
2102 <xsl:call-template name="make_indent">
2103 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
2104 </xsl:call-template>
2105 <xsl:text>.</xsl:text>
2106 <xsl:apply-templates select="*[position()=2]">
2107 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
2108 </xsl:apply-templates>
2111 <xsl:apply-templates mode="inline" select="."/>
2117 <xsl:template match="m:ci">
2119 <xsl:when test="boolean(@definitionURL)">
2120 <a href="{@definitionURL}">
2121 <xsl:apply-templates/>
2125 <xsl:value-of select="."/>
2130 <!-- CHAR COUNTING -->
2132 <!-- enter this counting mode selecting the root -->
2133 <xsl:template match="*" mode="root_charcount">
2134 <xsl:param name="incurrent_length" select="0"/>
2136 <xsl:when test="count(*)=0">
2137 <xsl:value-of select="0"/>
2139 <xsl:when test="name()='m:ci'">
2140 <xsl:value-of select="string-length()"/>
2143 <xsl:apply-templates select="*[1]" mode="charcount">
2144 <xsl:with-param name="incurrent_length" select="$incurrent_length"/>
2145 </xsl:apply-templates>
2150 <!-- enter this mode selecting the first child -->
2152 <xsl:template match="m:ci|m:csymbol" mode="charcount">
2153 <xsl:param name="incurrent_length" select="0"/>
2155 <xsl:when test="$framewidth >= ($incurrent_length + string-length())">
2156 <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>
2158 <xsl:when test="string($siblength) = """>
2159 <xsl:value-of select="$incurrent_length + string-length()"/>
2162 <xsl:value-of select="number($siblength)"/>
2167 <xsl:value-of select="$incurrent_length + string-length()"/>
2172 <xsl:template match="*" mode="charcount">
2173 <xsl:param name="incurrent_length" select="0"/>
2175 <xsl:when test="count(child::*) = 0">
2176 <xsl:value-of select="$incurrent_length"/>
2179 <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>
2181 <xsl:when test="$framewidth >= number($childlength)">
2182 <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>
2184 <xsl:when test="string($siblength) = """>
2185 <xsl:value-of select="number($childlength)"/>
2188 <xsl:value-of select="number($siblength)"/>
2193 <xsl:value-of select="number($childlength)"/>
2201 <!--***********************************************************************-->
2203 <!--***********************************************************************-->
2207 <xsl:template match="Definition">
2208 <xsl:param name="current_indent" select="0"/>
2210 DEFINITION <xsl:value-of select="@name"/>(<xsl:if test="string(./Params) != """><xsl:value-of select="Params"/></xsl:if>)<br/>
2212 <xsl:call-template name="make_indent">
2213 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
2214 </xsl:call-template>
2215 <xsl:apply-templates select="type/*[1]">
2216 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
2217 </xsl:apply-templates><br/>
2219 <xsl:call-template name="make_indent">
2220 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
2221 </xsl:call-template>
2222 <xsl:apply-templates select="body/*[1]">
2223 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
2224 </xsl:apply-templates>
2230 <xsl:template match="Axiom">
2231 <xsl:param name="current_indent" select="0"/>
2233 AXIOM <xsl:value-of select="@name"/>(<xsl:if test="string(./Params) != """><xsl:value-of select="Params"/></xsl:if>)<br/>
2235 <xsl:call-template name="make_indent">
2236 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
2237 </xsl:call-template>
2238 <xsl:apply-templates select="type/*[1]">
2239 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
2240 </xsl:apply-templates>
2244 <!-- UNFINISHED PROOF -->
2246 <xsl:template match="CurrentProof">
2247 <xsl:param name="current_indent" select="0"/>
2249 UNFINISHED PROOF <xsl:value-of select="@name"/>(<xsl:if test="string(./Params) != """><xsl:value-of select="Params"/></xsl:if>)<br/>
2250 THESIS: <xsl:apply-templates select="type/*[1]">
2251 <xsl:with-param name="current_indent" select="$current_indent + 8"/>
2252 </xsl:apply-templates><br/>
2254 <xsl:for-each select="Conjecture">
2256 <xsl:call-template name="make_indent">
2257 <xsl:with-param name="current_indent" select="$current_indent + 8"/>
2258 </xsl:call-template>
2259 <xsl:for-each select="Decl|Def|Hidden">
2261 <xsl:when test="name(.)='Decl'">
2263 <xsl:when test="@name">
2264 <xsl:value-of select="@name"/>
2267 <xsl:text>_</xsl:text>
2270 <xsl:text> : </xsl:text>
2271 <xsl:apply-templates select="./*[1]">
2272 <xsl:with-param name="current_indent" select="$current_indent"/>
2273 </xsl:apply-templates>
2275 <xsl:when test="name(.)='Def'">
2277 <xsl:when test="@name">
2278 <xsl:value-of select="@name"/>
2281 <xsl:text>_</xsl:text>
2284 <xsl:text> := </xsl:text>
2285 <xsl:apply-templates select="./*[1]">
2286 <xsl:with-param name="current_indent" select="$current_indent"/>
2287 </xsl:apply-templates>
2290 <xsl:text> _ :? _ </xsl:text>
2294 |- <xsl:value-of select="./@no"/> :
2295 <xsl:apply-templates select="./Goal/*[1]">
2296 <xsl:with-param name="current_indent" select="$current_indent + 11"/>
2297 </xsl:apply-templates>
2301 <xsl:apply-templates select="body/*[1]">
2302 <xsl:with-param name="current_indent" select="$current_indent + 8"/>
2303 </xsl:apply-templates>
2307 <!-- MUTUAL INDUCTIVE DEFINITION -->
2309 <xsl:template match="InductiveDefinition">
2310 <xsl:param name="current_indent" select="0"/>
2312 <xsl:for-each select="InductiveType">
2314 <xsl:when test="position() = 1">
2316 <xsl:when test="string(./@inductive) = "true"">
2317 INDUCTIVE DEFINITION
2320 COINDUCTIVE DEFINITION
2328 <xsl:value-of select="./@name"/>(<xsl:if test="string(../Params) != """><xsl:value-of select="../Params"/></xsl:if>)
2330 <xsl:if test="string(../Param) != """>
2331 <xsl:for-each select="../Param">
2332 <xsl:value-of select="./@name"/>
2334 <xsl:apply-templates select="*"/>
2339 <xsl:apply-templates select="./arity/*[1]">
2340 <xsl:with-param name="current_indent" select="$current_indent + 9"/>
2341 </xsl:apply-templates> <br/>
2343 <xsl:for-each select="./Constructor">
2345 <xsl:call-template name="make_indent">
2346 <xsl:with-param name="current_indent" select="$current_indent + 3"/>
2347 </xsl:call-template>
2349 <xsl:when test="position() = 1">
2350 <xsl:text>  </xsl:text>
2353 <xsl:text>| </xsl:text>
2356 <xsl:value-of select="./@name"/>
2357 <xsl:text>: </xsl:text>
2358 <xsl:apply-templates select="./*[1]">
2359 <xsl:with-param name="current_indent" select="$current_indent + 2*string-length(./@name) + 5"/>
2360 </xsl:apply-templates>
2368 <xsl:template match="Variable">
2369 <xsl:param name="current_indent" select="0"/>
2371 VARIABLE <xsl:value-of select="@name"/><br/>
2372 TYPE = <xsl:apply-templates select="type/*[1]">
2373 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
2374 </xsl:apply-templates>
2375 <xsl:if test="body">
2377 BODY = <xsl:apply-templates select="body/*[1]">
2378 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
2379 </xsl:apply-templates>
2384 <!--***********************************************************************-->
2386 <!--***********************************************************************-->
2390 <xsl:template match="SECTION">
2391 <xsl:param name="current_indent" select="0"/>
2392 <h1>BEGIN OF SECTION</h1>
2393 <xsl:apply-templates/>
2394 <h1>END OF SECTION</h1>