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"/>
42 <xsl:include href="html_ccorns.xsl"/>
44 <xsl:variable name="showcast" select="0"/>
46 <!--***********************************************************************-->
47 <!-- HTML Head and Body -->
48 <!--***********************************************************************-->
50 <!-- <xsl:output method="html" encoding="iso-8859-1"/> -->
52 <!-- document needs method="xml" and searches locally for the dtd if -->
53 <!-- doctype-system is specified (the dtd must exist locally for parsing). -->
54 <!-- For having output html must be media-type="html" and for having the -->
55 <!-- correct <br /> you must specify at least the remote dtd by means of -->
56 <!-- doctype-public -->
60 media-type="text/html"
61 doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" />
63 <xsl:variable name="framewidth" select="55"/>
65 <xsl:template name="mksymbol-1">
66 <xsl:param name="symbol" select="''"/>
67 <xsl:param name="color" select="''"/>
68 <xsl:param name="size" select="''"/>
70 <xsl:when test="$UNICODEvsSYMBOL = 'symbol'">
71 <xsl:variable name="fontsymbol">
73 <xsl:when test="$symbol = 'append'">
74 <xsl:value-of select="'@'"/>
76 <xsl:when test="$symbol = 'iff'">
77 <xsl:value-of select="'«'"/>
79 <xsl:when test="$symbol = 'forall'">
80 <xsl:value-of select="'"'"/>
82 <xsl:when test="$symbol = 'lambda'">
83 <xsl:value-of select="'l'"/>
85 <xsl:when test="$symbol = 'prod'">
86 <xsl:value-of select="'Õ'"/>
88 <xsl:when test="$symbol = 'arrow'">
89 <xsl:value-of select="'®'"/>
91 <xsl:when test="$symbol = 'RightArrow'">
92 <xsl:value-of select="'Þ'"/>
94 <xsl:when test="$symbol = 'subst'">
95 <xsl:value-of select="'¬'"/>
97 <xsl:when test="$symbol = 'lift' or $symbol = 'lift_with_base'">
98 <xsl:value-of select="'­'"/>
100 <xsl:when test="$symbol = 'beta_red' or $symbol = 'beta_red1'">
101 <xsl:value-of select="'®'"/>
103 <xsl:when test="$symbol = 'beta'">
104 <xsl:value-of select="'b'"/>
106 <xsl:when test="$symbol = 'par_beta_red' or $symbol = 'par_beta_red1'">
107 <xsl:value-of select="'Þ'"/>
109 <xsl:when test="$symbol = 'isomorphic'">
110 <xsl:value-of select="'@'"/>
113 <xsl:text>???</xsl:text>
117 <FONT FACE="symbol" SIZE="{$size}" color="{$color}">
118 <xsl:value-of select="$fontsymbol"/>
122 <xsl:variable name="unicodesymbol">
124 <xsl:when test="$symbol = 'append'">
125 <xsl:value-of select="'@'"/>
127 <xsl:when test="$symbol = 'iff'">
128 <xsl:value-of select="'↔'"/>
130 <xsl:when test="$symbol = 'forall'">
131 <xsl:value-of select="'∀'"/>
133 <xsl:when test="$symbol = 'lambda'">
134 <xsl:value-of select="'λ'"/>
136 <xsl:when test="$symbol = 'prod'">
137 <xsl:value-of select="'Π'"/>
139 <xsl:when test="$symbol = 'arrow'">
140 <xsl:value-of select="'→'"/>
142 <xsl:when test="$symbol = 'RightArrow'">
143 <xsl:value-of select="'⇒'"/>
145 <xsl:when test="$symbol = 'subst'">
146 <xsl:value-of select="'←'"/>
148 <xsl:when test="$symbol = 'lift' or $symbol = 'lift_with_base'">
149 <xsl:value-of select="'↑'"/>
151 <xsl:when test="$symbol = 'beta_red' or $symbol = 'beta_red1'">
152 <xsl:value-of select="'→'"/>
154 <xsl:when test="$symbol = 'beta'">
155 <xsl:value-of select="'β'"/>
157 <xsl:when test="$symbol = 'par_beta_red' or $symbol = 'par_beta_red1'">
158 <xsl:value-of select="'⇒'"/>
160 <xsl:when test="$symbol = 'isomorphic'">
161 <xsl:value-of select="'≅'"/>
164 <xsl:text>???</xsl:text>
168 <FONT color="{$color}">
169 <xsl:value-of select="$unicodesymbol"/>
175 <xsl:template match="/">
176 <xsl:param name="current_indent" select="0"/>
178 <xsl:when test="$type = 'standalone'">
181 <title> <xsl:value-of select="$CICURI"/> </title> <!-- FG -->
182 <style> A { text-decoration: none } </style>
184 <xsl:text disable-output-escaping="yes">
186 function Hide(which){
187 if (!document.getElementById)
189 which.style.display="none"
192 function Show(which){
193 if (!document.getElementById)
195 which.style.display=""
198 document.to_be_deleted = new Array();
203 <body bgcolor="white">
204 <xsl:attribute name="onLoad">
205 if(document.getElementById)
206 for(var i=0;i<document.to_be_deleted.length;i++)
207 Hide(document.getElementById(document.to_be_deleted[i]));
209 <xsl:apply-templates>
210 <xsl:with-param name="current_indent" select="0"/>
211 </xsl:apply-templates>
217 <xsl:apply-templates>
218 <xsl:with-param name="current_indent" select="0"/>
219 </xsl:apply-templates>
225 <!--***********************************************************************-->
227 <!--***********************************************************************-->
229 <xsl:template name="make_indent">
230 <xsl:param name="current_indent" select="0"/>
231 <!-- non funziona bene con netscape !!!
233 <xsl:attribute name="style">
234 <xsl:value-of select="concat('margin-left:',string($current_indent div 3), 'em')"/>
237 <xsl:if test="$current_indent > 0">
238 <xsl:text> </xsl:text>
239 <xsl:call-template name="make_indent">
240 <xsl:with-param name="current_indent" select="$current_indent - 1"/>
245 <!-- Syntactic Sugar -->
246 <xsl:template match="m:type">
247 <xsl:param name="current_indent" select="0"/>
248 <xsl:apply-templates>
249 <xsl:with-param name="current_indent"
250 select="$current_indent"/>
251 </xsl:apply-templates>
254 <xsl:template match="m:condition">
255 <xsl:param name="current_indent" select="0"/>
256 <xsl:apply-templates>
257 <xsl:with-param name="current_indent"
258 select="$current_indent"/>
259 </xsl:apply-templates>
262 <xsl:template match="m:math">
263 <xsl:param name="current_indent" select="0"/>
264 <xsl:apply-templates>
265 <xsl:with-param name="current_indent"
266 select="$current_indent"/>
267 </xsl:apply-templates>
270 <!--*********************************************************************-->
272 <!--*********************************************************************-->
275 <xsl:template mode="inline" match="m:ci">
277 <xsl:when test="boolean(@definitionURL)">
278 <a href="{@definitionURL}">
279 <xsl:apply-templates/>
283 <xsl:value-of select="."/>
290 <xsl:template match="m:apply[m:csymbol]" mode="inline">
291 <xsl:variable name="name">
292 <xsl:value-of select="m:csymbol"/>
294 <xsl:variable name="uri"><xsl:value-of select="*[1]/@definitionURL"/></xsl:variable>
297 <xsl:when test="$name='forall'">
298 <xsl:call-template name="mksymbol-1">
299 <xsl:with-param name="symbol" select="$name"/>
300 <xsl:with-param name="color" select="'blue'"/>
301 <xsl:with-param name="size" select="'+2'"/>
303 <xsl:apply-templates select="m:bvar/m:ci"/>
304 <xsl:text>:</xsl:text>
305 <xsl:apply-templates mode="inline" select="m:bvar/m:type"/>
306 <xsl:text>.</xsl:text>
307 <xsl:apply-templates mode="inline" select="*[position()=3]"/>
309 <xsl:when test="$name='prod'">
310 <xsl:call-template name="mksymbol-1">
311 <xsl:with-param name="symbol" select="$name"/>
312 <xsl:with-param name="color" select="'blue'"/>
313 <xsl:with-param name="size" select="'+2'"/>
315 <xsl:apply-templates mode="inline" select="m:bvar/m:ci"/>
316 <xsl:text>:</xsl:text>
317 <xsl:apply-templates mode="inline" select="m:bvar/m:type"/>
318 <xsl:text>.</xsl:text>
319 <xsl:apply-templates mode="inline" select="*[position()=3]"/>
322 <xsl:when test="$name='arrow'">
323 <xsl:text>(</xsl:text>
324 <xsl:apply-templates mode="inline" select="*[position()=2]"/>
325 <xsl:call-template name="mksymbol-1">
326 <xsl:with-param name="symbol" select="$name"/>
327 <xsl:with-param name="color" select="'blue'"/>
328 <xsl:with-param name="size" select="'+0'"/>
330 <xsl:apply-templates mode="inline" select="*[position()=3]"/>
331 <xsl:text>)</xsl:text>
334 <xsl:when test="$name='iff'">
335 <xsl:text>(</xsl:text>
336 <xsl:apply-templates mode="inline" select="*[position()=2]"/>
337 <xsl:call-template name="mksymbol-1">
338 <xsl:with-param name="symbol" select="$name"/>
339 <xsl:with-param name="color" select="'blue'"/>
340 <xsl:with-param name="size" select="'+0'"/>
342 <xsl:apply-templates mode="inline" select="*[position()=3]"/>
343 <xsl:text>)</xsl:text>
346 <xsl:when test="$name='append'">
347 <xsl:text>(</xsl:text>
348 <xsl:apply-templates mode="inline" select="*[position()=2]"/>
349 <xsl:call-template name="mksymbol-1">
350 <xsl:with-param name="symbol" select="$name"/>
351 <xsl:with-param name="color" select="'blue'"/>
352 <xsl:with-param name="size" select="'+0'"/>
354 <xsl:apply-templates mode="inline" select="*[position()=3]"/>
355 <xsl:text>)</xsl:text>
358 <xsl:when test="$name='app'">
359 <xsl:text>(</xsl:text>
360 <xsl:apply-templates mode="inline" select="*[position()=2]"/>
361 <xsl:for-each select="*[position()>2]">
362 <xsl:text> </xsl:text>
363 <xsl:apply-templates mode="inline" select="."/>
365 <xsl:text>)</xsl:text>
368 <xsl:when test="$name='cast'">
369 <xsl:text>(</xsl:text>
370 <xsl:apply-templates mode="inline" select="*[position()=2]"/>
371 <xsl:text>:</xsl:text>
372 <xsl:apply-templates mode="inline" select="*[position()=3]"/>
373 <xsl:text>)</xsl:text>
375 <xsl:when test="$name='Prop'">
376 <FONT color="violet">Prop</FONT>
378 <xsl:when test="$name='Set'">
379 <FONT color="violet">Set</FONT>
381 <xsl:when test="$name='Type'">
382 <FONT color="violet">Type</FONT>
385 <xsl:when test="$name='mutcase'">
386 <xsl:text><</xsl:text>
387 <xsl:apply-templates mode="inline" select="*[position()=2]"/>
388 <xsl:text>> </xsl:text>
389 <FONT color="red">CASE </FONT>
390 <xsl:apply-templates mode="inline" select="*[position()=3]"/>
391 <FONT color="red"> OF </FONT>
392 <xsl:for-each select="m:piecewise/m:piece">
393 <!--<xsl:for-each select="*[position() mod 2 = 0 and position()>3]">-->
395 <xsl:when test="not(position() = 1)">
396 <xsl:text> | </xsl:text>
399 <xsl:apply-templates mode="inline" select="./*[2]"/>
400 <xsl:call-template name="mksymbol-1">
401 <xsl:with-param name="symbol" select="'RightArrow'"/>
402 <xsl:with-param name="color" select="'green'"/>
403 <xsl:with-param name="size" select="'+0'"/>
405 <xsl:apply-templates mode="inline"
410 <xsl:when test="$name='inst'">
411 <xsl:apply-templates select="*[2]" mode="inline"/>
412 <FONT color="blue">{</FONT>
413 <xsl:for-each select="*[(position()>2) and (position() mod 2 = 1)]">
414 <xsl:apply-templates select="following-sibling::*[position() = 1]" mode="inline"/>
415 <FONT color="blue">/</FONT>
416 <xsl:if test="name()='m:ci'">
417 <a href="{@definitionURL}">
418 <xsl:apply-templates/>
421 <!-- <xsl:apply-templates select="." mode="inline"/> -->
423 <FONT color="blue">}</FONT>
427 <xsl:when test="$name='fix'">
428 <FONT color="red">FIX</FONT>
429 <xsl:value-of select="m:ci"/>
430 <xsl:text>{</xsl:text>
431 <xsl:for-each select="m:bvar">
432 <xsl:value-of select="m:ci"/>
433 <xsl:text>:</xsl:text>
434 <xsl:apply-templates mode="inline" select="m:type"/>
435 <xsl:text>:=</xsl:text>
436 <xsl:apply-templates mode="inline"
437 select="following-sibling::*[position() = 1]"/>
439 <xsl:when test="position()=last()">
440 <xsl:text>}</xsl:text>
443 <xsl:text>;</xsl:text>
449 <xsl:when test="$name='cofix'">
450 <xsl:text>COFIX</xsl:text>
451 <xsl:value-of select="m:ci"/>
452 <xsl:text>{</xsl:text>
453 <xsl:for-each select="m:bvar">
454 <xsl:value-of select="m:ci"/>
455 <xsl:text>:</xsl:text>
456 <xsl:apply-templates mode="inline" select="m:type"/>
457 <xsl:text>:=</xsl:text>
458 <xsl:apply-templates mode="inline"
459 select="following-sibling::*[position() = 1]"/>
461 <xsl:when test="position()=last()">
462 <xsl:text>}</xsl:text>
465 <xsl:text>;</xsl:text>
470 <!-- if then else -->
471 <xsl:when test="$name='ite'">
472 <xsl:text>if </xsl:text>
473 <xsl:apply-templates select="*[2]"/>
474 <xsl:text> then </xsl:text>
475 <xsl:apply-templates select="*[3]"/>
476 <xsl:text> else </xsl:text>
477 <xsl:apply-templates select="*[4]"/>
479 <!-- proof and side_proof -->
480 <xsl:when test="$name='proof' or $name='side_proof'">
481 <xsl:apply-templates mode="inline" select="*[position()=2]"/>
482 <FONT color="red"> proves </FONT>
483 <xsl:apply-templates mode="inline" select="*[position()=3]"/>
485 <FONT color="red"> which is equivalent to </FONT>
486 <xsl:apply-templates mode="inline" select="*[position()=4]"/>
490 <xsl:when test="$name='letin1'">
491 <xsl:text>letin1 (inline error)</xsl:text>
494 <xsl:when test="$name='false_ind'">
495 <xsl:apply-templates mode="inline" select="*[3]"/>
496 <FONT color="red">Contradiction.</FONT>
499 <xsl:when test="$name='and_ind'">
500 <FONT color="red">From </FONT>
501 <xsl:apply-templates select="*[2]"/>
502 <FONT color="red"> we get</FONT>
504 <xsl:apply-templates select="*[3]"/>
506 <xsl:apply-templates mode="inline" select="*[4]"/>
507 <FONT color="red"> and </FONT>
509 <xsl:apply-templates select="*[5]"/>
511 <xsl:apply-templates mode="inline" select="*[6]"/>
513 <FONT color="red"> hence </FONT>
514 <xsl:apply-templates mode="inline" select="*[7]"/>
517 <xsl:when test="$name='subst'">
518 <xsl:apply-templates select="*[3]" mode="inline"/>
519 <xsl:text>[</xsl:text>
520 <xsl:apply-templates select="*[4]" mode="inline"/>
522 <xsl:when test="$uri != ''">
524 <xsl:call-template name="mksymbol-1">
525 <xsl:with-param name="symbol" select="$name"/>
526 <xsl:with-param name="color" select="'green'"/>
527 <xsl:with-param name="size" select="'+0'"/>
532 <xsl:call-template name="mksymbol-1">
533 <xsl:with-param name="symbol" select="$name"/>
534 <xsl:with-param name="color" select="'green'"/>
535 <xsl:with-param name="size" select="'+0'"/>
539 <xsl:apply-templates select="*[2]" mode="inline"/>
540 <xsl:text>]</xsl:text>
543 <xsl:when test="$name='lift_with_base'">
545 <xsl:apply-templates select="*[3]" mode="inline"/>
548 <xsl:when test="$uri != ''">
550 <xsl:call-template name="mksymbol-1">
551 <xsl:with-param name="symbol" select="$name"/>
552 <xsl:with-param name="color" select="'green'"/>
553 <xsl:with-param name="size" select="'+0'"/>
558 <xsl:call-template name="mksymbol-1">
559 <xsl:with-param name="symbol" select="$name"/>
560 <xsl:with-param name="color" select="'green'"/>
561 <xsl:with-param name="size" select="'+0'"/>
566 <xsl:apply-templates select="*[4]" mode="inline"/>
568 <xsl:text>(</xsl:text>
569 <xsl:apply-templates select="*[2]" mode="inline"/>
570 <xsl:text>)</xsl:text>
573 <xsl:when test="$name='lift'">
575 <xsl:when test="$uri != ''">
577 <xsl:call-template name="mksymbol-1">
578 <xsl:with-param name="symbol" select="$name"/>
579 <xsl:with-param name="color" select="'green'"/>
580 <xsl:with-param name="size" select="'+0'"/>
585 <xsl:call-template name="mksymbol-1">
586 <xsl:with-param name="symbol" select="$name"/>
587 <xsl:with-param name="color" select="'green'"/>
588 <xsl:with-param name="size" select="'+0'"/>
593 <xsl:apply-templates select="*[2]" mode="inline"/>
595 <xsl:text>(</xsl:text>
596 <xsl:apply-templates select="*[3]" mode="inline"/>
597 <xsl:text>)</xsl:text>
601 <xsl:when test="$name='beta_red1'">
602 <xsl:apply-templates select="*[2]" mode="inline"/>
604 <xsl:when test="$uri != ''">
606 <xsl:call-template name="mksymbol-1">
607 <xsl:with-param name="symbol" select="$name"/>
608 <xsl:with-param name="color" select="'green'"/>
609 <xsl:with-param name="size" select="'+0'"/>
612 <xsl:call-template name="mksymbol-1">
613 <xsl:with-param name="symbol" select="'beta'"/>
614 <xsl:with-param name="color" select="'green'"/>
615 <xsl:with-param name="size" select="'+0'"/>
621 <xsl:call-template name="mksymbol-1">
622 <xsl:with-param name="symbol" select="$name"/>
623 <xsl:with-param name="color" select="'green'"/>
624 <xsl:with-param name="size" select="'+0'"/>
627 <xsl:call-template name="mksymbol-1">
628 <xsl:with-param name="symbol" select="'beta'"/>
629 <xsl:with-param name="color" select="'green'"/>
630 <xsl:with-param name="size" select="'+0'"/>
635 <xsl:apply-templates select="*[3]" mode="inline"/>
638 <xsl:when test="$name='beta_red'">
639 <xsl:apply-templates select="*[2]" mode="inline"/>
641 <xsl:when test="$uri != ''">
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>
659 <xsl:call-template name="mksymbol-1">
660 <xsl:with-param name="symbol" select="$name"/>
661 <xsl:with-param name="color" select="'green'"/>
662 <xsl:with-param name="size" select="'+0'"/>
665 <xsl:call-template name="mksymbol-1">
666 <xsl:with-param name="symbol" select="'beta'"/>
667 <xsl:with-param name="color" select="'green'"/>
668 <xsl:with-param name="size" select="'+0'"/>
670 <xsl:text>*</xsl:text>
674 <xsl:apply-templates select="*[3]" mode="inline"/>
677 <xsl:when test="$name='par_beta_red1'">
678 <xsl:apply-templates select="*[2]" mode="inline"/>
680 <xsl:when test="$uri != ''">
682 <xsl:call-template name="mksymbol-1">
683 <xsl:with-param name="symbol" select="$name"/>
684 <xsl:with-param name="color" select="'green'"/>
685 <xsl:with-param name="size" select="'+0'"/>
688 <xsl:call-template name="mksymbol-1">
689 <xsl:with-param name="symbol" select="'beta'"/>
690 <xsl:with-param name="color" select="'green'"/>
691 <xsl:with-param name="size" select="'+0'"/>
697 <xsl:call-template name="mksymbol-1">
698 <xsl:with-param name="symbol" select="$name"/>
699 <xsl:with-param name="color" select="'green'"/>
700 <xsl:with-param name="size" select="'+0'"/>
703 <xsl:call-template name="mksymbol-1">
704 <xsl:with-param name="symbol" select="'beta'"/>
705 <xsl:with-param name="color" select="'green'"/>
706 <xsl:with-param name="size" select="'+0'"/>
711 <xsl:apply-templates select="*[3]" mode="inline"/>
714 <xsl:when test="$name='par_beta_red'">
715 <xsl:apply-templates select="*[2]" mode="inline"/>
717 <xsl:when test="$uri != ''">
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>
735 <xsl:call-template name="mksymbol-1">
736 <xsl:with-param name="symbol" select="$name"/>
737 <xsl:with-param name="color" select="'green'"/>
738 <xsl:with-param name="size" select="'+0'"/>
741 <xsl:call-template name="mksymbol-1">
742 <xsl:with-param name="symbol" select="'beta'"/>
743 <xsl:with-param name="color" select="'green'"/>
744 <xsl:with-param name="size" select="'+0'"/>
746 <xsl:text>*</xsl:text>
750 <xsl:apply-templates select="*[3]" mode="inline"/>
754 <xsl:when test="$name='forgetful'">
756 <xsl:when test="$uri != ''">
757 <a href="{$uri}">|</a>
763 <xsl:apply-templates select="*[2]" mode="inline"/>
765 <xsl:when test="$uri != ''">
766 <a href="{$uri}">|</a>
774 <!-- boolean algebra of redexes -->
777 <xsl:when test="$name='isomorphic'">
778 <xsl:apply-templates select="*[2]" mode="inline"/>
780 <xsl:when test="$uri != ''">
782 <xsl:call-template name="mksymbol-1">
783 <xsl:with-param name="symbol" select="$name"/>
784 <xsl:with-param name="color" select="'green'"/>
785 <xsl:with-param name="size" select="'+0'"/>
790 <xsl:call-template name="mksymbol-1">
791 <xsl:with-param name="symbol" select="$name"/>
792 <xsl:with-param name="color" select="'green'"/>
793 <xsl:with-param name="size" select="'+0'"/>
797 <xsl:apply-templates select="*[3]" mode="inline"/>
801 <xsl:when test="$name='interp'">
802 <font color="green">[</font>
803 <xsl:apply-templates select="*[2]"/>
804 <font color="green">]</font>
810 <xsl:template mode="inline" match="m:lambda">
811 <xsl:call-template name="mksymbol-1">
812 <xsl:with-param name="symbol" select="'lambda'"/>
813 <xsl:with-param name="color" select="'red'"/>
814 <xsl:with-param name="size" select="'+2'"/>
816 <xsl:apply-templates select="m:bvar/m:ci"/>
817 <xsl:text>:</xsl:text>
818 <xsl:apply-templates mode="inline" select="m:bvar/m:type"/>
819 <xsl:text>.</xsl:text>
820 <xsl:apply-templates mode="inline" select="*[position()=2]"/>
823 <!--*********************************************************************-->
824 <!-- COUNTING MODE -->
825 <!--*********************************************************************-->
827 <xsl:template match="m:apply[m:csymbol]">
828 <xsl:param name="current_indent" select="0"/>
829 <xsl:param name="width" select="$framewidth"/>
830 <xsl:variable name="name">
831 <xsl:value-of select="m:csymbol"/>
833 <xsl:variable name="charlength">
834 <xsl:apply-templates select="m:csymbol" mode="charcount"/>
836 <!-- <xsl:value-of select="$current_indent"/> -->
837 <!-- <xsl:value-of select="$charlength"/> -->
838 <xsl:variable name="uri"><xsl:value-of select="*[1]/@definitionURL"/></xsl:variable>
841 <xsl:when test="$name='inst'">
842 <xsl:apply-templates select="." mode="inline"/>
845 <xsl:when test="$name='forall'">
847 <xsl:when test="$charlength > $framewidth">
849 <xsl:call-template name="mksymbol-1">
850 <xsl:with-param name="symbol" select="$name"/>
851 <xsl:with-param name="color" select="'blue'"/>
852 <xsl:with-param name="size" select="'+2'"/>
854 <xsl:apply-templates select="m:bvar/m:ci"/>
855 <xsl:text>:</xsl:text>
856 <xsl:apply-templates select="m:bvar/m:type">
857 <xsl:with-param name="current_indent"
858 select="$current_indent + 5 + 2*string-length(m:bvar/m:ci)"/>
859 </xsl:apply-templates>
861 <xsl:call-template name="make_indent">
862 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
864 <xsl:text>.</xsl:text>
865 <xsl:apply-templates select="*[position()=3]">
866 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
867 </xsl:apply-templates>
870 <xsl:apply-templates mode="inline" select="."/>
875 <xsl:when test="$name='prod'">
877 <xsl:when test="$charlength > $framewidth">
878 <xsl:call-template name="mksymbol-1">
879 <xsl:with-param name="symbol" select="$name"/>
880 <xsl:with-param name="color" select="'blue'"/>
881 <xsl:with-param name="size" select="'+2'"/>
883 <xsl:apply-templates select="m:bvar/m:ci"/>
884 <xsl:text>:</xsl:text>
885 <xsl:apply-templates select="m:bvar/m:type">
886 <xsl:with-param name="current_indent"
887 select="$current_indent + 5 + 2*string-length(m:bvar/m:ci)"/>
888 </xsl:apply-templates><br/>
889 <xsl:call-template name="make_indent">
890 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
892 <xsl:text>.</xsl:text>
893 <xsl:apply-templates select="*[position()=3]">
894 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
895 </xsl:apply-templates>
898 <xsl:apply-templates mode="inline" select="."/>
903 <xsl:when test="$name='arrow'">
905 <xsl:when test="$charlength > $framewidth">
906 <xsl:text>(</xsl:text>
907 <xsl:apply-templates select="*[position()=2]">
908 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
909 </xsl:apply-templates>
911 <xsl:call-template name="make_indent">
912 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
915 <xsl:call-template name="mksymbol-1">
916 <xsl:with-param name="symbol" select="$name"/>
917 <xsl:with-param name="color" select="'blue'"/>
918 <xsl:with-param name="size" select="'+0'"/>
920 <xsl:apply-templates select="*[position()=3]">
921 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
922 </xsl:apply-templates>
923 <xsl:text>)</xsl:text>
926 <xsl:apply-templates mode="inline" select="."/>
931 <xsl:when test="$name='iff'">
933 <xsl:when test="$charlength > $framewidth">
934 <xsl:text>(</xsl:text>
935 <xsl:apply-templates select="*[position()=2]">
936 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
937 </xsl:apply-templates>
939 <xsl:call-template name="make_indent">
940 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
943 <xsl:call-template name="mksymbol-1">
944 <xsl:with-param name="symbol" select="$name"/>
945 <xsl:with-param name="color" select="'blue'"/>
946 <xsl:with-param name="size" select="'+0'"/>
948 <xsl:apply-templates select="*[position()=3]">
949 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
950 </xsl:apply-templates>
951 <xsl:text>)</xsl:text>
954 <xsl:apply-templates mode="inline" select="."/>
959 <xsl:when test="$name='append'">
961 <xsl:when test="$charlength > $framewidth">
962 <xsl:text>(</xsl:text>
963 <xsl:apply-templates select="*[position()=2]">
964 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
965 </xsl:apply-templates>
967 <xsl:call-template name="make_indent">
968 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
971 <xsl:call-template name="mksymbol-1">
972 <xsl:with-param name="symbol" select="$name"/>
973 <xsl:with-param name="color" select="'blue'"/>
974 <xsl:with-param name="size" select="'+0'"/>
976 <xsl:apply-templates select="*[position()=3]">
977 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
978 </xsl:apply-templates>
979 <xsl:text>)</xsl:text>
982 <xsl:apply-templates mode="inline" select="."/>
987 <xsl:when test="$name='app'">
989 <xsl:when test="$charlength > $framewidth">
990 <xsl:text>(</xsl:text>
991 <xsl:apply-templates select="*[position()=2]">
992 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
993 </xsl:apply-templates>
994 <xsl:for-each select="*[position()>2]">
996 <xsl:call-template name="make_indent">
997 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
999 <xsl:apply-templates select=".">
1000 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1001 </xsl:apply-templates>
1003 <xsl:text>)</xsl:text>
1006 <xsl:apply-templates mode="inline" select="."/>
1010 <xsl:when test="$name='cast'">
1012 <xsl:when test="$showcast = 1">
1014 <xsl:when test="$charlength > $framewidth">
1015 <xsl:text>(</xsl:text>
1016 <xsl:apply-templates select="*[position()=2]">
1017 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1018 </xsl:apply-templates><br/>
1019 <xsl:call-template name="make_indent">
1020 <xsl:with-param name="current_indent" select="$current_indent + 2"/> </xsl:call-template>
1021 <xsl:text>:></xsl:text>
1022 <xsl:apply-templates select="*[position()=3]">
1023 <xsl:with-param name="current_indent" select="$current_indent + 3"/>
1024 </xsl:apply-templates>
1025 <xsl:text>)</xsl:text>
1028 <xsl:apply-templates mode="inline" select="."/>
1033 <xsl:apply-templates select="*[position()=2]">
1034 <xsl:with-param name="current_indent" select="$current_indent"/>
1035 </xsl:apply-templates>
1039 <xsl:when test="$name='Prop'">
1040 <xsl:text>Prop</xsl:text>
1042 <xsl:when test="$name='Set'">
1043 <xsl:text>Set</xsl:text>
1045 <xsl:when test="$name='Type'">
1046 <xsl:text>Type</xsl:text>
1048 <xsl:when test="$name='mutcase'">
1050 <xsl:when test="$charlength > $framewidth">
1051 <xsl:text><</xsl:text>
1052 <xsl:apply-templates select="*[position()=2]">
1053 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1054 </xsl:apply-templates>
1055 <xsl:text>> </xsl:text>
1057 <xsl:call-template name="make_indent">
1058 <xsl:with-param name="current_indent" select="$current_indent + 2"/> </xsl:call-template>
1059 <xsl:text>CASE </xsl:text>
1060 <xsl:apply-templates select="*[position()=3]">
1061 <xsl:with-param name="current_indent" select="$current_indent + 8"/>
1062 </xsl:apply-templates>
1063 <xsl:text> OF </xsl:text>
1064 <xsl:for-each select="m:piecewise/m:piece">
1065 <!-- <xsl:for-each select="*[position() mod 2 = 0 and position()>3]">-->
1067 <xsl:call-template name="make_indent">
1068 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1069 </xsl:call-template>
1071 <xsl:when test="position() = 1">
1072 <xsl:text>  </xsl:text>
1075 <xsl:text>| </xsl:text>
1078 <xsl:apply-templates select="./*[2]"/>
1079 <xsl:call-template name="mksymbol-1">
1080 <xsl:with-param name="symbol" select="'RightArrow'"/>
1081 <xsl:with-param name="color" select="'green'"/>
1082 <xsl:with-param name="size" select="'+0'"/>
1083 </xsl:call-template>
1084 <xsl:variable name="body_size">
1085 <xsl:apply-templates
1086 select="./*[1]/*[1]" mode="charcount"/>
1089 <xsl:when test="$body_size > $framewidth">
1091 <xsl:call-template name="make_indent">
1092 <xsl:with-param name="current_indent"
1093 select="$current_indent + 8"/>
1094 </xsl:call-template>
1095 <xsl:apply-templates
1097 <xsl:with-param name="current_indent"
1098 select="$current_indent + 8"/>
1099 </xsl:apply-templates>
1102 <xsl:apply-templates select="./*[1]"
1109 <xsl:apply-templates mode="inline" select="."/>
1114 <xsl:when test="$name='fix'">
1116 <xsl:when test="$charlength > $framewidth">
1117 <xsl:text>FIX</xsl:text>
1118 <xsl:value-of select="m:ci"/>
1119 <xsl:text>{</xsl:text>
1120 <xsl:for-each select="m:bvar">
1122 <xsl:call-template name="make_indent">
1123 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1124 </xsl:call-template>
1125 <xsl:value-of select="m:ci"/>
1126 <xsl:text>:</xsl:text>
1127 <xsl:apply-templates select="m:type">
1128 <xsl:with-param name="current_indent"
1129 select="$current_indent + 5 + string-length(m:ci)"/>
1130 </xsl:apply-templates>
1132 <xsl:call-template name="make_indent">
1133 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1134 </xsl:call-template>
1135 <xsl:text>:=</xsl:text>
1136 <xsl:apply-templates select="following-sibling::*[position() = 1]">
1137 <xsl:with-param name="current_indent" select="$current_indent +2"/>
1138 </xsl:apply-templates>
1141 <xsl:call-template name="make_indent">
1142 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1143 </xsl:call-template>
1144 <xsl:text>}</xsl:text>
1147 <xsl:apply-templates mode="inline" select="."/>
1152 <xsl:when test="$name='cofix'">
1154 <xsl:when test="($charlength + 10) > $framewidth">
1155 <xsl:text>COFIX</xsl:text>
1156 <xsl:value-of select="m:ci"/>
1157 <xsl:text>{</xsl:text>
1159 <xsl:call-template name="make_indent">
1160 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1161 </xsl:call-template>
1162 <xsl:for-each select="m:bvar">
1163 <xsl:value-of select="m:ci"/>
1164 <xsl:text>:</xsl:text>
1165 <xsl:apply-templates select="m:type">
1166 <xsl:with-param name="current_indent"
1167 select="$current_indent + 5 + string-length(m:ci)"/>
1168 </xsl:apply-templates>
1170 <xsl:call-template name="make_indent">
1171 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1172 </xsl:call-template>
1173 <xsl:text>:=</xsl:text>
1174 <xsl:apply-templates select="following-sibling::*[position() = 1]">
1175 <xsl:with-param name="current_indent" select="$current_indent + 3"/>
1176 </xsl:apply-templates>
1180 <xsl:call-template name="make_indent">
1181 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1182 </xsl:call-template>
1183 <xsl:text>}</xsl:text>
1186 <xsl:apply-templates mode="inline" select="m:type"/>
1190 <xsl:when test="$name='let_in'">
1191 <xsl:text>let </xsl:text>
1192 <xsl:apply-templates select="m:bvar/m:ci"/>
1193 <xsl:text> := </xsl:text>
1194 <xsl:apply-templates select="*[3]">
1195 <xsl:with-param name="current_indent" select="$current_indent+14"/>
1196 </xsl:apply-templates>
1198 <xsl:call-template name="make_indent">
1199 <xsl:with-param name="current_indent" select="$current_indent"/>
1200 </xsl:call-template>
1201 <xsl:text>in </xsl:text>
1202 <xsl:apply-templates select="*[4]">
1203 <xsl:with-param name="current_indent" select="$current_indent+5"/>
1204 </xsl:apply-templates>
1206 <!-- it then else -->
1207 <xsl:when test="$name='ite'">
1208 <xsl:text>if </xsl:text>
1209 <xsl:apply-templates select="*[2]">
1210 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
1211 </xsl:apply-templates>
1213 <xsl:call-template name="make_indent">
1214 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1215 </xsl:call-template>
1216 <xsl:text> then </xsl:text>
1217 <xsl:apply-templates select="*[3]">
1218 <xsl:with-param name="current_indent" select="$current_indent + 12"/>
1219 </xsl:apply-templates>
1221 <xsl:call-template name="make_indent">
1222 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1223 </xsl:call-template>
1224 <xsl:text> else </xsl:text>
1225 <xsl:apply-templates select="*[4]">
1226 <xsl:with-param name="current_indent" select="$current_indent + 12"/>
1227 </xsl:apply-templates>
1230 <!-- ***************************************** -->
1231 <!-- *********** PROOF ELEMENTS ************** -->
1232 <!-- ***************************************** -->
1234 <xsl:when test="$name='proof'">
1235 <xsl:variable name="nonce" select="generate-id()"/>
1236 <xsl:variable name="freshid1" select="concat('a',$nonce)"/>
1237 <xsl:variable name="freshid2" select="concat('b',$nonce)"/>
1238 <xsl:variable name="freshid3" select="concat('c',$nonce)"/>
1239 <span ID="{$freshid1}">
1240 <xsl:apply-templates select="*[position()=2]">
1241 <xsl:with-param name="current_indent" select="$current_indent"/>
1242 </xsl:apply-templates>
1244 <xsl:if test="*[4]">
1246 <xsl:call-template name="make_indent">
1247 <xsl:with-param name="current_indent" select="$current_indent"/>
1248 </xsl:call-template>
1249 <FONT color="red">we proved </FONT>
1250 <xsl:apply-templates select="*[position()=3]">
1251 <xsl:with-param name="current_indent" select="$current_indent+16"/>
1252 </xsl:apply-templates>
1254 <xsl:call-template name="make_indent">
1255 <xsl:with-param name="current_indent" select="$current_indent"/>
1256 </xsl:call-template>
1257 <FONT color="red">and by delta equivalence</FONT>
1258 <xsl:apply-templates select="*[position()=5]">
1259 <xsl:with-param name="current_indent" select="$current_indent+16"/>
1260 </xsl:apply-templates>
1264 <xsl:when test="(preceding-sibling::*[1]/text()='letin1') or
1265 (preceding-sibling::*[1]/text()='rw_step') or
1266 (name(..)='m:lambda')">
1268 <xsl:call-template name="make_indent">
1269 <xsl:with-param name="current_indent" select="$current_indent"/>
1270 </xsl:call-template>
1271 <FONT color="red">we proved </FONT>
1275 if(document.getElementById) {
1277 <span ID="{$freshid2}">\
1278 <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>\
1280 <span ID="{$freshid3}">\
1282 <xsl:call-template name="make_indent">
1283 <xsl:with-param name="current_indent" select="$current_indent"/>
1284 </xsl:call-template>\
1285 <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>\
1288 document.to_be_deleted.push('<xsl:value-of select="$freshid1"/>');
1289 document.to_be_deleted.push('<xsl:value-of select="$freshid3"/>');
1290 document.write(' ');
1294 <xsl:call-template name="make_indent">
1295 <xsl:with-param name="current_indent" select="$current_indent"/>
1296 </xsl:call-template>\
1297 <FONT color="red">we proved </FONT>\
1303 <xsl:apply-templates select="*[position()=last()]">
1304 <xsl:with-param name="current_indent" select="$current_indent + 16"/>
1305 </xsl:apply-templates>
1308 <xsl:when test="$name='side_proof'">
1309 <xsl:variable name="nonce" select="generate-id()"/>
1310 <xsl:variable name="freshid1" select="concat('a',$nonce)"/>
1311 <xsl:variable name="freshid2" select="concat('b',$nonce)"/>
1312 <xsl:variable name="freshid3" select="concat('c',$nonce)"/>
1313 <xsl:variable name="freshid4" select="concat('d',$nonce)"/>
1314 <span ID="{$freshid1}">
1315 <xsl:apply-templates select="*[position()=2]">
1316 <xsl:with-param name="current_indent" select="$current_indent"/>
1317 </xsl:apply-templates>
1321 if(document.getElementById) {
1323 <span ID="{$freshid2}">\
1324 <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>\
1326 <span ID="{$freshid3}">\
1328 <xsl:call-template name="make_indent">
1329 <xsl:with-param name="current_indent" select="$current_indent"/>
1330 </xsl:call-template>\
1331 <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>\
1334 document.to_be_deleted.push('<xsl:value-of select="$freshid1"/>');
1335 document.to_be_deleted.push('<xsl:value-of select="$freshid3"/>');
1336 document.to_be_deleted.push('<xsl:value-of select="$freshid4"/>');
1337 document.write(' ');
1341 <xsl:call-template name="make_indent">
1342 <xsl:with-param name="current_indent" select="$current_indent"/>
1343 </xsl:call-template>\
1344 <FONT color="red">we proved </FONT>\
1348 <span ID="{$freshid4}">
1349 <xsl:apply-templates select="*[position()=3]">
1350 <xsl:with-param name="current_indent" select="$current_indent + 16"/>
1351 </xsl:apply-templates>
1355 <xsl:when test="$name='eq_chain'">
1356 <FONT color="red">We have the following equality chain:</FONT>
1357 <xsl:for-each select="*[position() mod 2 = 0]">
1358 <xsl:variable name="pos" select="position()"/>
1360 <xsl:call-template name="make_indent">
1361 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
1362 </xsl:call-template>
1364 <xsl:when test="$pos=1">
1365 <xsl:apply-templates select=".">
1366 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
1367 </xsl:apply-templates>
1368 <xsl:text> =</xsl:text>
1371 <xsl:text>= </xsl:text>
1372 <xsl:apply-templates select=".">
1373 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
1374 </xsl:apply-templates>
1377 <xsl:if test="$pos != last()">
1379 <xsl:call-template name="make_indent">
1380 <xsl:with-param name="current_indent" select="$current_indent + 15"/>
1381 </xsl:call-template>
1382 <xsl:apply-templates select="../*[position()=2*$pos +1]">
1383 <xsl:with-param name="current_indent" select="$current_indent + 15"/>
1384 </xsl:apply-templates>
1388 <!-- diseq_chain -->
1389 <xsl:when test="$name='diseq_chain'">
1390 <FONT color="red">We have the following chain of disequalities:</FONT>
1391 <xsl:for-each select="*[position() mod 3 = 2]">
1392 <xsl:variable name="pos" select="position()"/>
1394 <xsl:call-template name="make_indent">
1395 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
1396 </xsl:call-template>
1398 <xsl:when test="$pos=1">
1399 <xsl:apply-templates select=".">
1400 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
1401 </xsl:apply-templates>
1402 <xsl:text> </xsl:text>
1403 <xsl:apply-templates mode="inline" select="../*[position()=3*$pos]"/>
1406 <xsl:apply-templates mode="inline" select="../*[position()=3*($pos - 1)]"/>
1407 <xsl:text> </xsl:text>
1408 <xsl:apply-templates select=".">
1409 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
1410 </xsl:apply-templates>
1413 <xsl:if test="$pos != last()">
1415 <xsl:call-template name="make_indent">
1416 <xsl:with-param name="current_indent" select="$current_indent + 15"/>
1417 </xsl:call-template>
1418 <xsl:apply-templates select="../*[position()=3*$pos +1]">
1419 <xsl:with-param name="current_indent" select="$current_indent + 15"/>
1420 </xsl:apply-templates>
1425 <xsl:when test="$name='letin1'">
1426 <xsl:apply-templates select="*[position()=2]">
1427 <xsl:with-param name="current_indent" select="$current_indent"/>
1428 </xsl:apply-templates>
1430 <xsl:call-template name="make_indent">
1431 <xsl:with-param name="current_indent" select="$current_indent"/>
1432 </xsl:call-template>
1433 <xsl:apply-templates select="*[position()=3]">
1434 <xsl:with-param name="current_indent" select="$current_indent"/>
1435 </xsl:apply-templates>
1438 <xsl:when test="$name='letin'">
1439 <xsl:for-each select="*[position()>1 and last()>position()]">
1440 <xsl:apply-templates select=".">
1441 <xsl:with-param name="current_indent" select="$current_indent"/>
1442 </xsl:apply-templates>
1444 <xsl:call-template name="make_indent">
1445 <xsl:with-param name="current_indent" select="$current_indent"/>
1446 </xsl:call-template>
1448 <xsl:apply-templates select="*[position()=last()]">
1449 <xsl:with-param name="current_indent" select="$current_indent"/>
1450 </xsl:apply-templates>
1453 <xsl:when test="$name='let'">
1455 <xsl:apply-templates select="m:ci"/>
1457 <xsl:apply-templates select="*[3]">
1458 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
1459 </xsl:apply-templates>
1462 <xsl:when test="$name='rw_step'">
1464 <xsl:when test="name(*[2])='m:apply'">
1465 <xsl:apply-templates select="*[2]">
1466 <xsl:with-param name="current_indent" select="$current_indent"/>
1467 </xsl:apply-templates>
1470 <FONT color="red">Consider </FONT>
1471 <xsl:apply-templates select="*[2]"/>
1474 <xsl:variable name="charlength_first">
1475 <xsl:apply-templates select="*[3]" mode="root_charcount"/>
1477 <xsl:variable name="charlength_second">
1478 <xsl:apply-templates select="*[4]" mode="root_charcount"/>
1480 <xsl:variable name="charlength_side_proof">
1481 <xsl:apply-templates select="*[5]" mode="root_charcount"/>
1483 <xsl:variable name="split1"
1484 select="($charlength_first + $charlength_second) > $framewidth"/>
1485 <xsl:variable name="split2"
1486 select="($charlength_second + $charlength_side_proof) > $framewidth"/>
1487 <!-- <xsl:value-of select="$current_indent"/> -->
1488 <!-- <xsl:value-of select="string($charlength_second)"/> -->
1489 <!-- <xsl:value-of select="$charlength_side_proof"/> -->
1490 <!-- <xsl:value-of select="$split2"/> -->
1492 <xsl:call-template name="make_indent">
1493 <xsl:with-param name="current_indent" select="$current_indent"/>
1494 </xsl:call-template>
1495 <FONT color="red">Rewrite </FONT>
1496 <xsl:apply-templates mode="inline" select="*[3]"/>
1497 <xsl:text> </xsl:text>
1498 <xsl:if test="$split1">
1500 <xsl:call-template name="make_indent">
1501 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1502 </xsl:call-template>
1504 <FONT color="red">with </FONT>
1505 <xsl:apply-templates mode="inline" select="*[4]"/>
1506 <xsl:text> </xsl:text>
1507 <xsl:if test="$split2">
1509 <xsl:call-template name="make_indent">
1510 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1511 </xsl:call-template>
1513 <FONT color="red">by </FONT>
1514 <xsl:apply-templates select="*[5]">
1515 <xsl:with-param name="current_indent" select="$current_indent+7"/>
1516 </xsl:apply-templates>
1518 <!-- rewrite and apply -->
1519 <xsl:when test="$name='rewrite_and_apply'">
1520 <xsl:apply-templates select="*[2]">
1521 <xsl:with-param name="current_indent" select="$current_indent"/>
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 <FONT color="red">Then apply it to </FONT>
1528 <xsl:apply-templates select="*[position()>2]"/>
1530 <!-- by_induction -->
1531 <xsl:when test="$name='by_induction'">
1532 <FONT color="red">We prove </FONT>
1533 <xsl:apply-templates select="../*[3]">
1534 <xsl:with-param name="current_indent" select="$current_indent+18"/>
1535 </xsl:apply-templates>
1537 <xsl:call-template name="make_indent">
1538 <xsl:with-param name="current_indent" select="$current_indent"/>
1539 </xsl:call-template>
1540 <FONT color="red">by induction on </FONT>
1541 <xsl:apply-templates select="*[position()=last()]/*[position()=last()]">
1542 <xsl:with-param name="current_indent" select="$current_indent+30"/>
1543 </xsl:apply-templates>
1546 <xsl:call-template name="make_indent">
1547 <xsl:with-param name="current_indent" select="$current_indent"/>
1548 </xsl:call-template>
1549 <xsl:text>The induction property is</xsl:text>
1551 <xsl:call-template name="make_indent">
1552 <xsl:with-param name="current_indent" select="$current_indent"/>
1553 </xsl:call-template>
1554 <xsl:apply-templates select="*[3]">
1555 <xsl:with-param name="current_indent" select="$current_indent"/>
1556 </xsl:apply-templates>
1558 <xsl:apply-templates
1559 select="*[position()>3 and not(position()=last())]">
1560 <xsl:with-param name="current_indent" select="$current_indent+4"/>
1561 </xsl:apply-templates>
1563 <xsl:call-template name="make_indent">
1564 <xsl:with-param name="current_indent" select="$current_indent"/>
1565 </xsl:call-template>
1566 <xsl:text>End induction</xsl:text> -->
1568 <!-- inductive_case -->
1569 <xsl:when test="$name='inductive_case'">
1571 <xsl:call-template name="make_indent">
1572 <xsl:with-param name="current_indent" select="$current_indent"/>
1573 </xsl:call-template>
1574 <FONT color="red">Case </FONT>
1575 <xsl:apply-templates select="*[2]">
1576 <xsl:with-param name="current_indent" select="$current_indent +10"/>
1577 </xsl:apply-templates>
1578 <xsl:if test="*[3]/*[position()>1]">
1580 <xsl:call-template name="make_indent">
1581 <xsl:with-param name="current_indent" select="$current_indent+4"/>
1582 </xsl:call-template>
1583 <FONT color="red">By induction hypothesis, we have:</FONT>
1584 <xsl:for-each select="*[3]/*[position()>1]">
1586 <xsl:call-template name="make_indent">
1587 <xsl:with-param name="current_indent" select="$current_indent + 4"/>
1588 </xsl:call-template>
1589 <xsl:text>(</xsl:text>
1590 <xsl:apply-templates select="m:ci"/>
1591 <xsl:text>) </xsl:text>
1592 <xsl:apply-templates select="m:type">
1593 <xsl:with-param name="current_indent" select="$current_indent + 8"/>
1594 </xsl:apply-templates>
1598 <xsl:call-template name="make_indent">
1599 <xsl:with-param name="current_indent" select="$current_indent + 4"/>
1600 </xsl:call-template>
1601 <xsl:apply-templates select="*[4]">
1602 <xsl:with-param name="current_indent" select="$current_indent +4"/>
1603 </xsl:apply-templates>
1605 <xsl:call-template name="make_indent">
1606 <xsl:with-param name="current_indent" select="$current_indent"/>
1607 </xsl:call-template>
1608 <xsl:text>End Case</xsl:text> -->
1611 <xsl:when test="$name='case_lhs'">
1613 <xsl:when test="count(*)=2">
1614 <xsl:apply-templates mode="inline" select="*[2]"/>
1617 <xsl:text>(</xsl:text>
1618 <xsl:apply-templates mode="inline" select="*[2]"/>
1619 <xsl:for-each select="m:bvar">
1620 <xsl:text> </xsl:text>
1621 <xsl:apply-templates mode="inline" select="*[1]"/>
1622 <xsl:text>:</xsl:text>
1623 <xsl:apply-templates mode="inline" select="m:type/*[1]"/>
1625 <xsl:text>)</xsl:text>
1630 <xsl:when test="$name='false_ind'">
1631 <xsl:apply-templates select="*[3]">
1632 <xsl:with-param name="current_indent" select="$current_indent"/>
1633 </xsl:apply-templates>
1635 <xsl:call-template name="make_indent">
1636 <xsl:with-param name="current_indent" select="$current_indent"/>
1637 </xsl:call-template>
1638 <FONT color="red">Contradiction.</FONT>
1641 <xsl:when test="$name='and_ind'">
1643 <xsl:when test="name(*[2])='m:apply'">
1644 <xsl:apply-templates select="*[2]">
1645 <xsl:with-param name="current_indent" select="$current_indent"/>
1646 </xsl:apply-templates>
1649 <FONT color="red">Consider </FONT>
1650 <xsl:apply-templates select="*[2]"/>
1654 <xsl:call-template name="make_indent">
1655 <xsl:with-param name="current_indent" select="$current_indent"/>
1656 </xsl:call-template>
1657 <FONT color="red">In particular, we have</FONT>
1659 <xsl:call-template name="make_indent">
1660 <xsl:with-param name="current_indent" select="$current_indent"/>
1661 </xsl:call-template>
1663 <xsl:apply-templates select="*[3]"/>
1665 <xsl:apply-templates select="*[4]">
1666 <xsl:with-param name="current_indent" select="$current_indent + 9"/>
1667 </xsl:apply-templates>
1669 <xsl:call-template name="make_indent">
1670 <xsl:with-param name="current_indent" select="$current_indent"/>
1671 </xsl:call-template>
1673 <xsl:apply-templates select="*[5]"/>
1675 <xsl:apply-templates select="*[6]">
1676 <xsl:with-param name="current_indent" select="$current_indent + 9"/>
1677 </xsl:apply-templates>
1679 <xsl:call-template name="make_indent">
1680 <xsl:with-param name="current_indent" select="$current_indent"/>
1681 </xsl:call-template>
1682 <xsl:apply-templates select="*[7]">
1683 <xsl:with-param name="current_indent" select="$current_indent"/>
1684 </xsl:apply-templates>
1686 <!-- full_or_ind -->
1687 <xsl:when test="$name='full_or_ind'">
1689 <xsl:when test="name(*[2])='m:apply'">
1690 <xsl:apply-templates select="*[2]">
1691 <xsl:with-param name="current_indent" select="$current_indent"/>
1692 </xsl:apply-templates>
1695 <FONT color="red">Consider </FONT>
1696 <xsl:apply-templates select="*[2]"/>
1700 <xsl:call-template name="make_indent">
1701 <xsl:with-param name="current_indent" select="$current_indent"/>
1702 </xsl:call-template>
1703 <FONT color="red">We proceed by cases to prove </FONT>
1704 <xsl:apply-templates select="*[3]"/>
1706 <xsl:call-template name="make_indent">
1707 <xsl:with-param name="current_indent" select="$current_indent+4"/>
1708 </xsl:call-template>
1709 <FONT color="red">Left: suppose </FONT>
1710 <xsl:text>(</xsl:text>
1711 <xsl:value-of select="*[4]/m:bvar/m:ci"/>
1712 <xsl:text>) </xsl:text>
1713 <xsl:apply-templates
1714 select="*[4]/m:bvar/m:type/*[1]"/>
1716 <xsl:call-template name="make_indent">
1717 <xsl:with-param name="current_indent" select="$current_indent+15"/>
1718 </xsl:call-template>
1719 <xsl:apply-templates
1721 <xsl:with-param name="current_indent" select="$current_indent+15"/>
1722 </xsl:apply-templates>
1724 <xsl:call-template name="make_indent">
1725 <xsl:with-param name="current_indent" select="$current_indent+4"/>
1726 </xsl:call-template>
1727 <FONT color="red">Right: suppose </FONT>
1728 <xsl:text>(</xsl:text>
1729 <xsl:value-of select="*[5]/m:bvar/m:ci"/>
1730 <xsl:text>) </xsl:text>
1731 <xsl:apply-templates
1732 select="*[5]/m:bvar/m:type/*[1]"/>
1734 <xsl:call-template name="make_indent">
1735 <xsl:with-param name="current_indent" select="$current_indent+16"/>
1736 </xsl:call-template>
1737 <xsl:apply-templates
1739 <xsl:with-param name="current_indent" select="$current_indent+16"/>
1740 </xsl:apply-templates>
1743 <xsl:when test="$name='or_ind'">
1745 <xsl:when test="name(*[2])='m:apply'">
1746 <xsl:apply-templates select="*[2]">
1747 <xsl:with-param name="current_indent" select="$current_indent"/>
1748 </xsl:apply-templates>
1751 <FONT color="red">Consider </FONT>
1752 <xsl:apply-templates select="*[2]"/>
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">We prove </FONT>
1760 <xsl:apply-templates select="*[3]"/>
1761 <FONT color="red"> by cases:</FONT>
1763 <xsl:call-template name="make_indent">
1764 <xsl:with-param name="current_indent" select="$current_indent"/>
1765 </xsl:call-template>
1767 <xsl:apply-templates select="*[4]">
1768 <xsl:with-param name="current_indent" select="$current_indent"/>
1769 </xsl:apply-templates>
1771 <xsl:call-template name="make_indent">
1772 <xsl:with-param name="current_indent" select="$current_indent"/>
1773 </xsl:call-template>
1775 <xsl:apply-templates select="*[5]">
1776 <xsl:with-param name="current_indent" select="$current_indent"/>
1777 </xsl:apply-templates>
1780 <xsl:when test="$name='ex_ind'">
1782 <xsl:when test="name(*[2])='m:apply'">
1783 <xsl:apply-templates select="*[2]">
1784 <xsl:with-param name="current_indent" select="$current_indent"/>
1785 </xsl:apply-templates>
1788 <FONT color="red">Consider </FONT>
1789 <xsl:apply-templates select="*[2]">
1790 <xsl:with-param name="current_indent" select="$current_indent"/>
1791 </xsl:apply-templates>
1795 <xsl:call-template name="make_indent">
1796 <xsl:with-param name="current_indent" select="$current_indent"/>
1797 </xsl:call-template>
1798 <FONT color="red">Let </FONT>
1799 <xsl:apply-templates mode="inline" select="*[3]"/>
1801 <xsl:apply-templates mode="inline" select="*[4]"/>
1802 <FONT color="red"> such that</FONT>
1804 <xsl:call-template name="make_indent">
1805 <xsl:with-param name="current_indent" select="$current_indent"/>
1806 </xsl:call-template>
1808 <xsl:apply-templates mode="inline" select="*[5]"/>
1810 <xsl:apply-templates select="*[6]">
1811 <xsl:with-param name="current_indent" select="$current_indent +7"/>
1812 </xsl:apply-templates>
1814 <xsl:call-template name="make_indent">
1815 <xsl:with-param name="current_indent" select="$current_indent"/>
1816 </xsl:call-template>
1817 <xsl:apply-templates select="*[7]">
1818 <xsl:with-param name="current_indent" select="$current_indent"/>
1819 </xsl:apply-templates>
1821 <!-- ***************************************** -->
1822 <!-- *********** LAMBDA ELEMENTS ************** -->
1823 <!-- ***************************************** -->
1824 <xsl:when test="$name='subst'">
1825 <xsl:apply-templates select="*[3]"/>
1826 <xsl:text>[</xsl:text>
1827 <xsl:apply-templates select="*[4]"/>
1829 <xsl:when test="$uri != ''">
1831 <xsl:call-template name="mksymbol-1">
1832 <xsl:with-param name="symbol" select="$name"/>
1833 <xsl:with-param name="color" select="'blue'"/>
1834 <xsl:with-param name="size" select="'+0'"/>
1835 </xsl:call-template>
1839 <xsl:call-template name="mksymbol-1">
1840 <xsl:with-param name="symbol" select="$name"/>
1841 <xsl:with-param name="color" select="'blue'"/>
1842 <xsl:with-param name="size" select="'+0'"/>
1843 </xsl:call-template>
1846 <xsl:apply-templates select="*[2]"/>
1847 <xsl:text>]</xsl:text>
1850 <xsl:when test="$name='lift_with_base'">
1852 <xsl:apply-templates select="*[3]" mode="inline"/>
1855 <xsl:when test="$uri != ''">
1857 <xsl:call-template name="mksymbol-1">
1858 <xsl:with-param name="symbol" select="$name"/>
1859 <xsl:with-param name="color" select="'green'"/>
1860 <xsl:with-param name="size" select="'+0'"/>
1861 </xsl:call-template>
1865 <xsl:call-template name="mksymbol-1">
1866 <xsl:with-param name="symbol" select="$name"/>
1867 <xsl:with-param name="color" select="'green'"/>
1868 <xsl:with-param name="size" select="'+0'"/>
1869 </xsl:call-template>
1873 <xsl:apply-templates select="*[4]" mode="inline"/>
1875 <xsl:text>(</xsl:text>
1876 <xsl:apply-templates select="*[2]" mode="inline"/>
1877 <xsl:text>)</xsl:text>
1880 <xsl:when test="$name='lift'">
1882 <xsl:when test="$uri != ''">
1884 <xsl:call-template name="mksymbol-1">
1885 <xsl:with-param name="symbol" select="$name"/>
1886 <xsl:with-param name="color" select="'green'"/>
1887 <xsl:with-param name="size" select="'+0'"/>
1888 </xsl:call-template>
1892 <xsl:call-template name="mksymbol-1">
1893 <xsl:with-param name="symbol" select="$name"/>
1894 <xsl:with-param name="color" select="'green'"/>
1895 <xsl:with-param name="size" select="'+0'"/>
1896 </xsl:call-template>
1900 <xsl:apply-templates select="*[2]" mode="inline"/>
1902 <xsl:text>(</xsl:text>
1903 <xsl:apply-templates select="*[3]" mode="inline"/>
1904 <xsl:text>)</xsl:text>
1908 <xsl:when test="$name='beta_red1'">
1909 <xsl:apply-templates select="*[2]" mode="inline"/>
1911 <xsl:when test="$uri != ''">
1913 <xsl:call-template name="mksymbol-1">
1914 <xsl:with-param name="symbol" select="$name"/>
1915 <xsl:with-param name="color" select="'green'"/>
1916 <xsl:with-param name="size" select="'+0'"/>
1917 </xsl:call-template>
1919 <xsl:call-template name="mksymbol-1">
1920 <xsl:with-param name="symbol" select="'beta'"/>
1921 <xsl:with-param name="color" select="'green'"/>
1922 <xsl:with-param name="size" select="'+0'"/>
1923 </xsl:call-template>
1928 <xsl:call-template name="mksymbol-1">
1929 <xsl:with-param name="symbol" select="$name"/>
1930 <xsl:with-param name="color" select="'green'"/>
1931 <xsl:with-param name="size" select="'+0'"/>
1932 </xsl:call-template>
1934 <xsl:call-template name="mksymbol-1">
1935 <xsl:with-param name="symbol" select="'beta'"/>
1936 <xsl:with-param name="color" select="'green'"/>
1937 <xsl:with-param name="size" select="'+0'"/>
1938 </xsl:call-template>
1942 <xsl:apply-templates select="*[3]" mode="inline"/>
1945 <xsl:when test="$name='beta_red'">
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>
1961 <xsl:text>*</xsl:text>
1966 <xsl:call-template name="mksymbol-1">
1967 <xsl:with-param name="symbol" select="$name"/>
1968 <xsl:with-param name="color" select="'green'"/>
1969 <xsl:with-param name="size" select="'+0'"/>
1970 </xsl:call-template>
1972 <xsl:call-template name="mksymbol-1">
1973 <xsl:with-param name="symbol" select="'beta'"/>
1974 <xsl:with-param name="color" select="'green'"/>
1975 <xsl:with-param name="size" select="'+0'"/>
1976 </xsl:call-template>
1977 <xsl:text>*</xsl:text>
1981 <xsl:apply-templates select="*[3]" mode="inline"/>
1984 <xsl:when test="$name='par_beta_red1'">
1985 <xsl:apply-templates select="*[2]" mode="inline"/>
1987 <xsl:when test="$uri != ''">
1989 <xsl:call-template name="mksymbol-1">
1990 <xsl:with-param name="symbol" select="$name"/>
1991 <xsl:with-param name="color" select="'green'"/>
1992 <xsl:with-param name="size" select="'+0'"/>
1993 </xsl:call-template>
1995 <xsl:call-template name="mksymbol-1">
1996 <xsl:with-param name="symbol" select="'beta'"/>
1997 <xsl:with-param name="color" select="'green'"/>
1998 <xsl:with-param name="size" select="'+0'"/>
1999 </xsl:call-template>
2004 <xsl:call-template name="mksymbol-1">
2005 <xsl:with-param name="symbol" select="$name"/>
2006 <xsl:with-param name="color" select="'green'"/>
2007 <xsl:with-param name="size" select="'+0'"/>
2008 </xsl:call-template>
2010 <xsl:call-template name="mksymbol-1">
2011 <xsl:with-param name="symbol" select="'beta'"/>
2012 <xsl:with-param name="color" select="'green'"/>
2013 <xsl:with-param name="size" select="'+0'"/>
2014 </xsl:call-template>
2018 <xsl:apply-templates select="*[3]" mode="inline"/>
2021 <xsl:when test="$name='par_beta_red'">
2022 <xsl:apply-templates select="*[2]" mode="inline"/>
2024 <xsl:when test="$uri != ''">
2026 <xsl:call-template name="mksymbol-1">
2027 <xsl:with-param name="symbol" select="$name"/>
2028 <xsl:with-param name="color" select="'green'"/>
2029 <xsl:with-param name="size" select="'+0'"/>
2030 </xsl:call-template>
2032 <xsl:call-template name="mksymbol-1">
2033 <xsl:with-param name="symbol" select="'beta'"/>
2034 <xsl:with-param name="color" select="'green'"/>
2035 <xsl:with-param name="size" select="'+0'"/>
2036 </xsl:call-template>
2037 <xsl:text>*</xsl:text>
2042 <xsl:call-template name="mksymbol-1">
2043 <xsl:with-param name="symbol" select="$name"/>
2044 <xsl:with-param name="color" select="'green'"/>
2045 <xsl:with-param name="size" select="'+0'"/>
2046 </xsl:call-template>
2048 <xsl:call-template name="mksymbol-1">
2049 <xsl:with-param name="symbol" select="'beta'"/>
2050 <xsl:with-param name="color" select="'green'"/>
2051 <xsl:with-param name="size" select="'+0'"/>
2052 </xsl:call-template>
2053 <xsl:text>*</xsl:text>
2057 <xsl:apply-templates select="*[3]" mode="inline"/>
2061 <xsl:when test="$name='forgetful'">
2063 <xsl:when test="$uri != ''">
2064 <a href="{$uri}">|</a>
2070 <xsl:apply-templates select="*[2]" mode="inline"/>
2072 <xsl:when test="$uri != ''">
2073 <a href="{$uri}">|</a>
2081 <!-- boolean algebra of redexes -->
2084 <xsl:when test="$name='isomorphic'">
2085 <xsl:apply-templates select="*[2]" mode="inline"/>
2087 <xsl:when test="$uri != ''">
2089 <xsl:call-template name="mksymbol-1">
2090 <xsl:with-param name="symbol" select="$name"/>
2091 <xsl:with-param name="color" select="'green'"/>
2092 <xsl:with-param name="size" select="'+0'"/>
2093 </xsl:call-template>
2097 <xsl:call-template name="mksymbol-1">
2098 <xsl:with-param name="symbol" select="$name"/>
2099 <xsl:with-param name="color" select="'green'"/>
2100 <xsl:with-param name="size" select="'+0'"/>
2101 </xsl:call-template>
2104 <xsl:apply-templates select="*[3]" mode="inline"/>
2108 <xsl:when test="$name='interp'">
2109 <font color="green">[</font>
2110 <xsl:apply-templates select="*[2]"/>
2111 <font color="green">]</font>
2119 <xsl:template match="m:lambda">
2120 <xsl:param name="current_indent" select="0"/>
2121 <xsl:variable name="charlength">
2122 <xsl:apply-templates select="*[position()=1]" mode="charcount"/>
2123 <!-- <xsl:apply-templates select="." mode="charcount"/> -->
2125 <!-- <xsl:value-of select="$charlength"/> -->
2126 <!-- <xsl:value-of select="$current_indent"/> -->
2128 <xsl:when test="$charlength > $framewidth">
2130 <xsl:call-template name="mksymbol-1">
2131 <xsl:with-param name="symbol" select="'lambda'"/>
2132 <xsl:with-param name="color" select="'red'"/>
2133 <xsl:with-param name="size" select="'+2'"/>
2134 </xsl:call-template>
2135 <xsl:apply-templates select="m:bvar/m:ci"/>
2136 <xsl:text>:</xsl:text>
2137 <xsl:apply-templates select="m:bvar/m:type">
2138 <xsl:with-param name="current_indent"
2139 select="$current_indent + 4 + 2*string-length(m:bvar/m:ci)"/>
2140 </xsl:apply-templates><br/>
2141 <xsl:call-template name="make_indent">
2142 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
2143 </xsl:call-template>
2144 <xsl:text>.</xsl:text>
2145 <xsl:apply-templates select="*[position()=2]">
2146 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
2147 </xsl:apply-templates>
2150 <xsl:apply-templates mode="inline" select="."/>
2156 <xsl:template match="m:ci">
2158 <xsl:when test="boolean(@definitionURL)">
2159 <a href="{@definitionURL}">
2160 <xsl:apply-templates/>
2164 <xsl:value-of select="."/>
2169 <!-- CHAR COUNTING -->
2171 <!-- enter this counting mode selecting the root -->
2172 <xsl:template match="*" mode="root_charcount">
2173 <xsl:param name="incurrent_length" select="0"/>
2175 <xsl:when test="count(*)=0">
2176 <xsl:value-of select="0"/>
2178 <xsl:when test="name()='m:ci'">
2179 <xsl:value-of select="string-length()"/>
2182 <xsl:apply-templates select="*[1]" mode="charcount">
2183 <xsl:with-param name="incurrent_length" select="$incurrent_length"/>
2184 </xsl:apply-templates>
2189 <!-- enter this mode selecting the first child -->
2191 <xsl:template match="m:ci|m:csymbol" mode="charcount">
2192 <xsl:param name="incurrent_length" select="0"/>
2194 <xsl:when test="$framewidth >= ($incurrent_length + string-length())">
2195 <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>
2197 <xsl:when test="string($siblength) = """>
2198 <xsl:value-of select="$incurrent_length + string-length()"/>
2201 <xsl:value-of select="number($siblength)"/>
2206 <xsl:value-of select="$incurrent_length + string-length()"/>
2211 <xsl:template match="*" mode="charcount">
2212 <xsl:param name="incurrent_length" select="0"/>
2214 <xsl:when test="count(child::*) = 0">
2215 <xsl:value-of select="$incurrent_length"/>
2218 <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>
2220 <xsl:when test="$framewidth >= number($childlength)">
2221 <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>
2223 <xsl:when test="string($siblength) = """>
2224 <xsl:value-of select="number($childlength)"/>
2227 <xsl:value-of select="number($siblength)"/>
2232 <xsl:value-of select="number($childlength)"/>
2240 <!--***********************************************************************-->
2242 <!--***********************************************************************-->
2246 <xsl:template match="Definition">
2247 <xsl:param name="current_indent" select="0"/>
2249 DEFINITION <xsl:value-of select="@name"/>(<xsl:if test="string(./Params) != """><xsl:value-of select="Params"/></xsl:if>)<br/>
2251 <xsl:call-template name="make_indent">
2252 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
2253 </xsl:call-template>
2254 <xsl:apply-templates select="type/*[1]">
2255 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
2256 </xsl:apply-templates><br/>
2258 <xsl:call-template name="make_indent">
2259 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
2260 </xsl:call-template>
2261 <xsl:apply-templates select="body/*[1]">
2262 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
2263 </xsl:apply-templates>
2269 <xsl:template match="Axiom">
2270 <xsl:param name="current_indent" select="0"/>
2272 AXIOM <xsl:value-of select="@name"/>(<xsl:if test="string(./Params) != """><xsl:value-of select="Params"/></xsl:if>)<br/>
2274 <xsl:call-template name="make_indent">
2275 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
2276 </xsl:call-template>
2277 <xsl:apply-templates select="type/*[1]">
2278 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
2279 </xsl:apply-templates>
2283 <!-- UNFINISHED PROOF -->
2285 <xsl:template match="CurrentProof">
2286 <xsl:param name="current_indent" select="0"/>
2288 UNFINISHED PROOF <xsl:value-of select="@name"/>(<xsl:if test="string(./Params) != """><xsl:value-of select="Params"/></xsl:if>)<br/>
2289 THESIS: <xsl:apply-templates select="type/*[1]">
2290 <xsl:with-param name="current_indent" select="$current_indent + 8"/>
2291 </xsl:apply-templates><br/>
2293 <xsl:for-each select="Conjecture">
2295 <xsl:call-template name="make_indent">
2296 <xsl:with-param name="current_indent" select="$current_indent + 8"/>
2297 </xsl:call-template>
2298 <xsl:for-each select="Decl|Def|Hidden">
2300 <xsl:when test="name(.)='Decl'">
2302 <xsl:when test="@name">
2303 <xsl:value-of select="@name"/>
2306 <xsl:text>_</xsl:text>
2309 <xsl:text> : </xsl:text>
2310 <xsl:apply-templates select="./*[1]">
2311 <xsl:with-param name="current_indent" select="$current_indent"/>
2312 </xsl:apply-templates>
2314 <xsl:when test="name(.)='Def'">
2316 <xsl:when test="@name">
2317 <xsl:value-of select="@name"/>
2320 <xsl:text>_</xsl:text>
2323 <xsl:text> := </xsl:text>
2324 <xsl:apply-templates select="./*[1]">
2325 <xsl:with-param name="current_indent" select="$current_indent"/>
2326 </xsl:apply-templates>
2329 <xsl:text> _ :? _ </xsl:text>
2333 |- <xsl:value-of select="./@no"/> :
2334 <xsl:apply-templates select="./Goal/*[1]">
2335 <xsl:with-param name="current_indent" select="$current_indent + 11"/>
2336 </xsl:apply-templates>
2340 <xsl:apply-templates select="body/*[1]">
2341 <xsl:with-param name="current_indent" select="$current_indent + 8"/>
2342 </xsl:apply-templates>
2346 <!-- MUTUAL INDUCTIVE DEFINITION -->
2348 <xsl:template match="InductiveDefinition">
2349 <xsl:param name="current_indent" select="0"/>
2351 <xsl:for-each select="InductiveType">
2353 <xsl:when test="position() = 1">
2355 <xsl:when test="string(./@inductive) = "true"">
2356 INDUCTIVE DEFINITION
2359 COINDUCTIVE DEFINITION
2367 <xsl:value-of select="./@name"/>(<xsl:if test="string(../Params) != """><xsl:value-of select="../Params"/></xsl:if>)
2369 <xsl:if test="string(../Param) != """>
2370 <xsl:for-each select="../Param">
2371 <xsl:value-of select="./@name"/>
2373 <xsl:apply-templates select="*"/>
2378 <xsl:apply-templates select="./arity/*[1]">
2379 <xsl:with-param name="current_indent" select="$current_indent + 9"/>
2380 </xsl:apply-templates> <br/>
2382 <xsl:for-each select="./Constructor">
2384 <xsl:call-template name="make_indent">
2385 <xsl:with-param name="current_indent" select="$current_indent + 3"/>
2386 </xsl:call-template>
2388 <xsl:when test="position() = 1">
2389 <xsl:text>  </xsl:text>
2392 <xsl:text>| </xsl:text>
2395 <xsl:value-of select="./@name"/>
2396 <xsl:text>: </xsl:text>
2397 <xsl:apply-templates select="./*[1]">
2398 <xsl:with-param name="current_indent" select="$current_indent + 2*string-length(./@name) + 5"/>
2399 </xsl:apply-templates>
2407 <xsl:template match="Variable">
2408 <xsl:param name="current_indent" select="0"/>
2410 VARIABLE <xsl:value-of select="@name"/><br/>
2411 TYPE = <xsl:apply-templates select="type/*[1]">
2412 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
2413 </xsl:apply-templates>
2414 <xsl:if test="body">
2416 BODY = <xsl:apply-templates select="body/*[1]">
2417 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
2418 </xsl:apply-templates>
2423 <!--***********************************************************************-->
2425 <!--***********************************************************************-->
2429 <xsl:template match="SECTION">
2430 <xsl:param name="current_indent" select="0"/>
2431 <h1>BEGIN OF SECTION</h1>
2432 <xsl:apply-templates/>
2433 <h1>END OF SECTION</h1>