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="45"/>
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 = 'forall'">
73 <xsl:value-of select="'"'"/>
75 <xsl:when test="$symbol = 'lambda'">
76 <xsl:value-of select="'l'"/>
78 <xsl:when test="$symbol = 'prod'">
79 <xsl:value-of select="'Õ'"/>
81 <xsl:when test="$symbol = 'arrow'">
82 <xsl:value-of select="'®'"/>
84 <xsl:when test="$symbol = 'RightArrow'">
85 <xsl:value-of select="'Þ'"/>
87 <xsl:when test="$symbol = 'subst'">
88 <xsl:value-of select="'¬'"/>
90 <xsl:when test="$symbol = 'lift' or $symbol = 'lift_with_base'">
91 <xsl:value-of select="'­'"/>
93 <xsl:when test="$symbol = 'beta_red' or $symbol = 'beta_red1'">
94 <xsl:value-of select="'®'"/>
96 <xsl:when test="$symbol = 'beta'">
97 <xsl:value-of select="'b'"/>
99 <xsl:when test="$symbol = 'par_beta_red' or $symbol = 'par_beta_red1'">
100 <xsl:value-of select="'Þ'"/>
102 <xsl:when test="$symbol = 'isomorphic'">
103 <xsl:value-of select="'@'"/>
106 <xsl:text>???</xsl:text>
110 <FONT FACE="symbol" SIZE="{$size}" color="{$color}">
111 <xsl:value-of select="$fontsymbol"/>
115 <xsl:variable name="unicodesymbol">
117 <xsl:when test="$symbol = 'forall'">
118 <xsl:value-of select="'∀'"/>
120 <xsl:when test="$symbol = 'lambda'">
121 <xsl:value-of select="'λ'"/>
123 <xsl:when test="$symbol = 'prod'">
124 <xsl:value-of select="'Π'"/>
126 <xsl:when test="$symbol = 'arrow'">
127 <xsl:value-of select="'→'"/>
129 <xsl:when test="$symbol = 'RightArrow'">
130 <xsl:value-of select="'⇒'"/>
132 <xsl:when test="$symbol = 'subst'">
133 <xsl:value-of select="'←'"/>
135 <xsl:when test="$symbol = 'lift' or $symbol = 'lift_with_base'">
136 <xsl:value-of select="'↑'"/>
138 <xsl:when test="$symbol = 'beta_red' or $symbol = 'beta_red1'">
139 <xsl:value-of select="'→'"/>
141 <xsl:when test="$symbol = 'beta'">
142 <xsl:value-of select="'β'"/>
144 <xsl:when test="$symbol = 'par_beta_red' or $symbol = 'par_beta_red1'">
145 <xsl:value-of select="'⇒'"/>
147 <xsl:when test="$symbol = 'isomorphic'">
148 <xsl:value-of select="'≅'"/>
151 <xsl:text>???</xsl:text>
155 <FONT color="{$color}">
156 <xsl:value-of select="$unicodesymbol"/>
162 <xsl:template match="/">
163 <xsl:param name="current_indent" select="0"/>
165 <xsl:when test="$type = 'standalone'">
168 <title> <xsl:value-of select="$CICURI"/> </title> <!-- FG -->
169 <style> A { text-decoration: none } </style>
171 <body bgcolor="white">
172 <xsl:apply-templates>
173 <xsl:with-param name="current_indent" select="0"/>
174 </xsl:apply-templates>
180 <xsl:apply-templates>
181 <xsl:with-param name="current_indent" select="0"/>
182 </xsl:apply-templates>
188 <!--***********************************************************************-->
190 <!--***********************************************************************-->
192 <xsl:template name="make_indent">
193 <xsl:param name="current_indent" select="0"/>
194 <xsl:if test="$current_indent > 0">
195 <xsl:text> </xsl:text>
196 <xsl:call-template name="make_indent">
197 <xsl:with-param name="current_indent" select="$current_indent - 1"/>
202 <!-- Syntactic Sugar -->
203 <xsl:template match="m:type">
204 <xsl:param name="current_indent" select="0"/>
205 <xsl:apply-templates>
206 <xsl:with-param name="current_indent"
207 select="$current_indent"/>
208 </xsl:apply-templates>
211 <xsl:template match="m:condition">
212 <xsl:param name="current_indent" select="0"/>
213 <xsl:apply-templates>
214 <xsl:with-param name="current_indent"
215 select="$current_indent"/>
216 </xsl:apply-templates>
219 <xsl:template match="m:math">
220 <xsl:param name="current_indent" select="0"/>
221 <xsl:apply-templates>
222 <xsl:with-param name="current_indent"
223 select="$current_indent"/>
224 </xsl:apply-templates>
227 <!--*********************************************************************-->
229 <!--*********************************************************************-->
232 <xsl:template mode="inline" match="m:ci">
234 <xsl:when test="boolean(@definitionURL)">
235 <a href="{@definitionURL}">
236 <xsl:apply-templates/>
240 <xsl:value-of select="."/>
247 <xsl:template match="m:apply[m:csymbol]" mode="inline">
248 <xsl:variable name="name">
249 <xsl:value-of select="m:csymbol"/>
253 <xsl:when test="$name='forall'">
254 <xsl:call-template name="mksymbol-1">
255 <xsl:with-param name="symbol" select="$name"/>
256 <xsl:with-param name="color" select="'blue'"/>
257 <xsl:with-param name="size" select="'+2'"/>
259 <xsl:apply-templates select="m:bvar/m:ci"/>
260 <xsl:text>:</xsl:text>
261 <xsl:apply-templates mode="inline" select="m:bvar/m:type"/>
262 <xsl:text>.</xsl:text>
263 <xsl:apply-templates mode="inline" select="*[position()=3]"/>
265 <xsl:when test="$name='prod'">
266 <xsl:call-template name="mksymbol-1">
267 <xsl:with-param name="symbol" select="$name"/>
268 <xsl:with-param name="color" select="'blue'"/>
269 <xsl:with-param name="size" select="'+2'"/>
271 <xsl:apply-templates mode="inline" select="m:bvar/m:ci"/>
272 <xsl:text>:</xsl:text>
273 <xsl:apply-templates mode="inline" select="m:bvar/m:type"/>
274 <xsl:text>.</xsl:text>
275 <xsl:apply-templates mode="inline" select="*[position()=3]"/>
278 <xsl:when test="$name='arrow'">
279 <xsl:text>(</xsl:text>
280 <xsl:apply-templates mode="inline" select="*[position()=2]"/>
281 <xsl:call-template name="mksymbol-1">
282 <xsl:with-param name="symbol" select="$name"/>
283 <xsl:with-param name="color" select="'blue'"/>
284 <xsl:with-param name="size" select="'+0'"/>
286 <xsl:apply-templates mode="inline" select="*[position()=3]"/>
287 <xsl:text>)</xsl:text>
290 <xsl:when test="$name='app'">
291 <xsl:text>(</xsl:text>
292 <xsl:apply-templates mode="inline" select="*[position()=2]"/>
293 <xsl:for-each select="*[position()>2]">
294 <xsl:text> </xsl:text>
295 <xsl:apply-templates mode="inline" select="."/>
297 <xsl:text>)</xsl:text>
300 <xsl:when test="$name='cast'">
301 <xsl:text>(</xsl:text>
302 <xsl:apply-templates mode="inline" select="*[position()=2]"/>
303 <xsl:text>:></xsl:text>
304 <xsl:apply-templates mode="inline" select="*[position()=3]"/>
305 <xsl:text>)</xsl:text>
307 <xsl:when test="$name='Prop'">
308 <FONT color="violet">Prop</FONT>
310 <xsl:when test="$name='Set'">
311 <FONT color="violet">Set</FONT>
313 <xsl:when test="$name='Type'">
314 <FONT color="violet">Type</FONT>
317 <xsl:when test="$name='mutcase'">
318 <xsl:text><</xsl:text>
319 <xsl:apply-templates mode="inline" select="*[position()=2]"/>
320 <xsl:text>> </xsl:text>
321 <FONT color="red">CASE </FONT>
322 <xsl:apply-templates mode="inline" select="*[position()=3]"/>
323 <FONT color="red"> OF </FONT>
324 <xsl:for-each select="piecewise/piece">
325 <!--<xsl:for-each select="*[position() mod 2 = 0 and position()>3]">-->
327 <xsl:when test="not(position() = 1)">
328 <xsl:text> | </xsl:text>
331 <xsl:apply-templates mode="inline" select="./*[2]"/>
332 <xsl:call-template name="mksymbol-1">
333 <xsl:with-param name="symbol" select="'RightArrow'"/>
334 <xsl:with-param name="color" select="'green'"/>
335 <xsl:with-param name="size" select="'+0'"/>
337 <xsl:apply-templates mode="inline"
342 <xsl:when test="$name='fix'">
343 <FONT color="red">FIX</FONT>
344 <xsl:value-of select="m:ci"/>
345 <xsl:text>{</xsl:text>
346 <xsl:for-each select="m:bvar">
347 <xsl:value-of select="m:ci"/>
348 <xsl:text>:</xsl:text>
349 <xsl:apply-templates mode="inline" select="m:type"/>
350 <xsl:text>:=</xsl:text>
351 <xsl:apply-templates mode="inline"
352 select="following-sibling::*[position() = 1]"/>
354 <xsl:when test="position()=last()">
355 <xsl:text>}</xsl:text>
358 <xsl:text>;</xsl:text>
364 <xsl:when test="$name='cofix'">
365 <xsl:text>COFIX</xsl:text>
366 <xsl:value-of select="m:ci"/>
367 <xsl:text>{</xsl:text>
368 <xsl:for-each select="m:bvar">
369 <xsl:value-of select="m:ci"/>
370 <xsl:text>:</xsl:text>
371 <xsl:apply-templates mode="inline" select="m:type"/>
372 <xsl:text>:=</xsl:text>
373 <xsl:apply-templates mode="inline"
374 select="following-sibling::*[position() = 1]"/>
376 <xsl:when test="position()=last()">
377 <xsl:text>}</xsl:text>
380 <xsl:text>;</xsl:text>
386 <xsl:when test="$name='proof'">
387 <xsl:apply-templates mode="inline" select="*[position()=2]"/>
388 <FONT color="red"> proves </FONT>
389 <xsl:apply-templates mode="inline" select="*[position()=3]"/>
392 <xsl:when test="$name='false_ind'">
393 <xsl:apply-templates mode="inline" select="*[3]"/>
394 <FONT color="red">Contradiction.</FONT>
397 <xsl:when test="$name='and_ind'">
398 <FONT color="red">From </FONT>
399 <xsl:apply-templates select="*[2]"/>
400 <FONT color="red"> we get</FONT>
402 <xsl:apply-templates select="*[3]"/>
404 <xsl:apply-templates mode="inline" select="*[4]"/>
405 <FONT color="red"> and </FONT>
407 <xsl:apply-templates select="*[5]"/>
409 <xsl:apply-templates mode="inline" select="*[6]"/>
411 <FONT color="red"> hence </FONT>
412 <xsl:apply-templates mode="inline" select="*[7]"/>
415 <xsl:when test="$name='subst'">
416 <xsl:apply-templates select="*[3]" mode="inline"/>
417 <xsl:text>[</xsl:text>
418 <xsl:apply-templates select="*[4]" mode="inline"/>
419 <a href="{*[1]/@definitionURL}">
420 <xsl:call-template name="mksymbol-1">
421 <xsl:with-param name="symbol" select="$name"/>
422 <xsl:with-param name="color" select="'green'"/>
423 <xsl:with-param name="size" select="'+0'"/>
426 <xsl:apply-templates select="*[2]" mode="inline"/>
427 <xsl:text>]</xsl:text>
430 <xsl:when test="$name='lift_with_base'">
432 <xsl:apply-templates select="*[3]" mode="inline"/>
434 <a href="{*[1]/@definitionURL}">
435 <xsl:call-template name="mksymbol-1">
436 <xsl:with-param name="symbol" select="$name"/>
437 <xsl:with-param name="color" select="'green'"/>
438 <xsl:with-param name="size" select="'+0'"/>
442 <xsl:apply-templates select="*[4]" mode="inline"/>
444 <xsl:text>(</xsl:text>
445 <xsl:apply-templates select="*[2]" mode="inline"/>
446 <xsl:text>)</xsl:text>
449 <xsl:when test="$name='lift'">
450 <a href="{*[1]/@definitionURL}">
451 <xsl:call-template name="mksymbol-1">
452 <xsl:with-param name="symbol" select="$name"/>
453 <xsl:with-param name="color" select="'green'"/>
454 <xsl:with-param name="size" select="'+0'"/>
458 <xsl:apply-templates select="*[2]" mode="inline"/>
460 <xsl:text>(</xsl:text>
461 <xsl:apply-templates select="*[3]" mode="inline"/>
462 <xsl:text>)</xsl:text>
466 <xsl:when test="$name='beta_red1'">
467 <xsl:apply-templates select="*[2]" mode="inline"/>
468 <a href="{*[1]/@definitionURL}">
469 <xsl:call-template name="mksymbol-1">
470 <xsl:with-param name="symbol" select="$name"/>
471 <xsl:with-param name="color" select="'green'"/>
472 <xsl:with-param name="size" select="'+0'"/>
475 <xsl:call-template name="mksymbol-1">
476 <xsl:with-param name="symbol" select="'beta'"/>
477 <xsl:with-param name="color" select="'green'"/>
478 <xsl:with-param name="size" select="'+0'"/>
482 <xsl:apply-templates select="*[3]" mode="inline"/>
485 <xsl:when test="$name='beta_red'">
486 <xsl:apply-templates select="*[2]" mode="inline"/>
487 <a href="{*[1]/@definitionURL}">
488 <xsl:call-template name="mksymbol-1">
489 <xsl:with-param name="symbol" select="$name"/>
490 <xsl:with-param name="color" select="'green'"/>
491 <xsl:with-param name="size" select="'+0'"/>
494 <xsl:call-template name="mksymbol-1">
495 <xsl:with-param name="symbol" select="'beta'"/>
496 <xsl:with-param name="color" select="'green'"/>
497 <xsl:with-param name="size" select="'+0'"/>
499 <xsl:text>*</xsl:text>
502 <xsl:apply-templates select="*[3]" mode="inline"/>
505 <xsl:when test="$name='par_beta_red1'">
506 <xsl:apply-templates select="*[2]" mode="inline"/>
507 <a href="{*[1]/@definitionURL}">
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'"/>
514 <xsl:call-template name="mksymbol-1">
515 <xsl:with-param name="symbol" select="'beta'"/>
516 <xsl:with-param name="color" select="'green'"/>
517 <xsl:with-param name="size" select="'+0'"/>
521 <xsl:apply-templates select="*[3]" mode="inline"/>
524 <xsl:when test="$name='par_beta_red'">
525 <xsl:apply-templates select="*[2]" mode="inline"/>
526 <a href="{*[1]/@definitionURL}">
527 <xsl:call-template name="mksymbol-1">
528 <xsl:with-param name="symbol" select="$name"/>
529 <xsl:with-param name="color" select="'green'"/>
530 <xsl:with-param name="size" select="'+0'"/>
533 <xsl:call-template name="mksymbol-1">
534 <xsl:with-param name="symbol" select="'beta'"/>
535 <xsl:with-param name="color" select="'green'"/>
536 <xsl:with-param name="size" select="'+0'"/>
538 <xsl:text>*</xsl:text>
541 <xsl:apply-templates select="*[3]" mode="inline"/>
545 <xsl:when test="$name='forgetful'">
546 <a href="{*[1]/@definitionURL}">|</a>
547 <xsl:apply-templates select="*[2]" mode="inline"/>
548 <a href="{*[1]/@definitionURL}">|</a>
551 <!-- boolean algebra of redexes -->
554 <xsl:when test="$name='isomorphic'">
555 <xsl:apply-templates select="*[2]" mode="inline"/>
556 <a href="{*[1]/@definitionURL}">
557 <xsl:call-template name="mksymbol-1">
558 <xsl:with-param name="symbol" select="$name"/>
559 <xsl:with-param name="color" select="'green'"/>
560 <xsl:with-param name="size" select="'+0'"/>
563 <xsl:apply-templates select="*[3]" mode="inline"/>
567 <xsl:when test="$name='interp'">
568 <font color="green">[</font>
569 <xsl:apply-templates select="*[2]"/>
570 <font color="green">]</font>
576 <xsl:template mode="inline" match="m:lambda">
577 <xsl:call-template name="mksymbol-1">
578 <xsl:with-param name="symbol" select="'lambda'"/>
579 <xsl:with-param name="color" select="'red'"/>
580 <xsl:with-param name="size" select="'+2'"/>
582 <xsl:apply-templates select="m:bvar/m:ci"/>
583 <xsl:text>:</xsl:text>
584 <xsl:apply-templates mode="inline" select="m:bvar/m:type"/>
585 <xsl:text>.</xsl:text>
586 <xsl:apply-templates mode="inline" select="*[position()=2]"/>
589 <!--*********************************************************************-->
590 <!-- COUNTING MODE -->
591 <!--*********************************************************************-->
593 <xsl:template match="m:apply[m:csymbol]">
594 <xsl:param name="current_indent" select="0"/>
595 <xsl:param name="width" select="$framewidth"/>
596 <xsl:variable name="name">
597 <xsl:value-of select="m:csymbol"/>
599 <xsl:variable name="charlength">
600 <xsl:apply-templates select="m:csymbol" mode="charcount"/>
602 <!-- <xsl:value-of select="$current_indent"/> -->
603 <!-- <xsl:value-of select="$charlength"/> -->
606 <xsl:when test="$name='forall'">
608 <xsl:when test="$charlength > $framewidth">
610 <xsl:call-template name="mksymbol-1">
611 <xsl:with-param name="symbol" select="$name"/>
612 <xsl:with-param name="color" select="'blue'"/>
613 <xsl:with-param name="size" select="'+2'"/>
615 <xsl:apply-templates select="m:bvar/m:ci"/>
616 <xsl:text>:</xsl:text>
617 <xsl:apply-templates select="m:bvar/m:type">
618 <xsl:with-param name="current_indent"
619 select="$current_indent + 5 + 2*string-length(m:bvar/m:ci)"/>
620 </xsl:apply-templates>
622 <xsl:call-template name="make_indent">
623 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
625 <xsl:text>.</xsl:text>
626 <xsl:apply-templates select="*[position()=3]">
627 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
628 </xsl:apply-templates>
631 <xsl:apply-templates mode="inline" select="."/>
636 <xsl:when test="$name='prod'">
638 <xsl:when test="$charlength > $framewidth">
639 <xsl:call-template name="mksymbol-1">
640 <xsl:with-param name="symbol" select="$name"/>
641 <xsl:with-param name="color" select="'blue'"/>
642 <xsl:with-param name="size" select="'+2'"/>
644 <xsl:apply-templates select="m:bvar/m:ci"/>
645 <xsl:text>:</xsl:text>
646 <xsl:apply-templates select="m:bvar/m:type">
647 <xsl:with-param name="current_indent"
648 select="$current_indent + 5 + 2*string-length(m:bvar/m:ci)"/>
649 </xsl:apply-templates><br/>
650 <xsl:call-template name="make_indent">
651 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
653 <xsl:text>.</xsl:text>
654 <xsl:apply-templates select="*[position()=3]">
655 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
656 </xsl:apply-templates>
659 <xsl:apply-templates mode="inline" select="."/>
664 <xsl:when test="$name='arrow'">
666 <xsl:when test="$charlength > $framewidth">
667 <xsl:text>(</xsl:text>
668 <xsl:apply-templates select="*[position()=2]">
669 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
670 </xsl:apply-templates>
672 <xsl:call-template name="make_indent">
673 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
676 <xsl:call-template name="mksymbol-1">
677 <xsl:with-param name="symbol" select="$name"/>
678 <xsl:with-param name="color" select="'blue'"/>
679 <xsl:with-param name="size" select="'+0'"/>
681 <xsl:apply-templates select="*[position()=3]">
682 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
683 </xsl:apply-templates>
684 <xsl:text>)</xsl:text>
687 <xsl:apply-templates mode="inline" select="."/>
692 <xsl:when test="$name='app'">
694 <xsl:when test="$charlength > $framewidth">
695 <xsl:text>(</xsl:text>
696 <xsl:apply-templates select="*[position()=2]">
697 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
698 </xsl:apply-templates>
699 <xsl:for-each select="*[position()>2]">
701 <xsl:call-template name="make_indent">
702 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
704 <xsl:apply-templates select=".">
705 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
706 </xsl:apply-templates>
708 <xsl:text>)</xsl:text>
711 <xsl:apply-templates mode="inline" select="."/>
715 <xsl:when test="$name='cast'">
717 <xsl:when test="$showcast = 1">
719 <xsl:when test="$charlength > $framewidth">
720 <xsl:text>(</xsl:text>
721 <xsl:apply-templates select="*[position()=2]">
722 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
723 </xsl:apply-templates><br/>
724 <xsl:call-template name="make_indent">
725 <xsl:with-param name="current_indent" select="$current_indent + 2"/> </xsl:call-template>
726 <xsl:text>:></xsl:text>
727 <xsl:apply-templates select="*[position()=3]">
728 <xsl:with-param name="current_indent" select="$current_indent + 3"/>
729 </xsl:apply-templates>
730 <xsl:text>)</xsl:text>
733 <xsl:apply-templates mode="inline" select="."/>
738 <xsl:apply-templates select="*[position()=2]">
739 <xsl:with-param name="current_indent" select="$current_indent"/>
740 </xsl:apply-templates>
744 <xsl:when test="$name='Prop'">
745 <xsl:text>Prop</xsl:text>
747 <xsl:when test="$name='Set'">
748 <xsl:text>Set</xsl:text>
750 <xsl:when test="$name='Type'">
751 <xsl:text>Type</xsl:text>
753 <xsl:when test="$name='mutcase'">
755 <xsl:when test="$charlength > $framewidth">
756 <xsl:text><</xsl:text>
757 <xsl:apply-templates select="*[position()=2]">
758 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
759 </xsl:apply-templates>
760 <xsl:text>> </xsl:text>
762 <xsl:call-template name="make_indent">
763 <xsl:with-param name="current_indent" select="$current_indent + 2"/> </xsl:call-template>
764 <xsl:text>CASE </xsl:text>
765 <xsl:apply-templates select="*[position()=3]">
766 <xsl:with-param name="current_indent" select="$current_indent + 8"/>
767 </xsl:apply-templates>
768 <xsl:text> OF </xsl:text>
769 <xsl:for-each select="piecewise/piece">
770 <!-- <xsl:for-each select="*[position() mod 2 = 0 and position()>3]">-->
772 <xsl:call-template name="make_indent">
773 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
776 <xsl:when test="position() = 1">
777 <xsl:text>  </xsl:text>
780 <xsl:text>| </xsl:text>
783 <xsl:apply-templates select="./*[2]"/>
784 <xsl:call-template name="mksymbol-1">
785 <xsl:with-param name="symbol" select="'RightArrow'"/>
786 <xsl:with-param name="color" select="'green'"/>
787 <xsl:with-param name="size" select="'+0'"/>
789 <xsl:variable name="body_size">
791 select="./*[1]/*[1]" mode="charcount"/>
794 <xsl:when test="$body_size > $framewidth">
796 <xsl:call-template name="make_indent">
797 <xsl:with-param name="current_indent"
798 select="$current_indent + 8"/>
802 <xsl:with-param name="current_indent"
803 select="$current_indent + 8"/>
804 </xsl:apply-templates>
807 <xsl:apply-templates select="./*[1]"
814 <xsl:apply-templates mode="inline" select="."/>
819 <xsl:when test="$name='fix'">
821 <xsl:when test="$charlength > $framewidth">
822 <xsl:text>FIX</xsl:text>
823 <xsl:value-of select="m:ci"/>
824 <xsl:text>{</xsl:text>
825 <xsl:for-each select="m:bvar">
827 <xsl:call-template name="make_indent">
828 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
830 <xsl:value-of select="m:ci"/>
831 <xsl:text>:</xsl:text>
832 <xsl:apply-templates select="m:type">
833 <xsl:with-param name="current_indent"
834 select="$current_indent + 5 + string-length(m:ci)"/>
835 </xsl:apply-templates>
837 <xsl:call-template name="make_indent">
838 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
840 <xsl:text>:=</xsl:text>
841 <xsl:apply-templates select="following-sibling::*[position() = 1]">
842 <xsl:with-param name="current_indent" select="$current_indent +2"/>
843 </xsl:apply-templates>
846 <xsl:call-template name="make_indent">
847 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
849 <xsl:text>}</xsl:text>
852 <xsl:apply-templates mode="inline" select="."/>
857 <xsl:when test="$name='cofix'">
859 <xsl:when test="($charlength + 10) > $framewidth">
860 <xsl:text>COFIX</xsl:text>
861 <xsl:value-of select="m:ci"/>
862 <xsl:text>{</xsl:text>
864 <xsl:call-template name="make_indent">
865 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
867 <xsl:for-each select="m:bvar">
868 <xsl:value-of select="m:ci"/>
869 <xsl:text>:</xsl:text>
870 <xsl:apply-templates select="m:type">
871 <xsl:with-param name="current_indent"
872 select="$current_indent + 5 + string-length(m:ci)"/>
873 </xsl:apply-templates>
875 <xsl:call-template name="make_indent">
876 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
878 <xsl:text>:=</xsl:text>
879 <xsl:apply-templates select="following-sibling::*[position() = 1]">
880 <xsl:with-param name="current_indent" select="$current_indent + 3"/>
881 </xsl:apply-templates>
885 <xsl:call-template name="make_indent">
886 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
888 <xsl:text>}</xsl:text>
891 <xsl:apply-templates mode="inline" select="m:type"/>
895 <xsl:when test="$name='let_in'">
896 <xsl:text>let </xsl:text>
897 <xsl:apply-templates select="m:bvar/m:ci"/>
898 <xsl:text> := </xsl:text>
899 <xsl:apply-templates select="*[3]">
900 <xsl:with-param name="current_indent" select="$current_indent+14"/>
901 </xsl:apply-templates>
903 <xsl:call-template name="make_indent">
904 <xsl:with-param name="current_indent" select="$current_indent"/>
906 <xsl:text>in </xsl:text>
907 <xsl:apply-templates select="*[4]">
908 <xsl:with-param name="current_indent" select="$current_indent+5"/>
909 </xsl:apply-templates>
912 <!-- ***************************************** -->
913 <!-- *********** PROOF ELEMENTS ************** -->
914 <!-- ***************************************** -->
916 <xsl:when test="$name='proof'">
917 <xsl:apply-templates select="*[position()=2]">
918 <xsl:with-param name="current_indent" select="$current_indent"/>
919 </xsl:apply-templates>
921 <!-- <xsl:element name="br"/> -->
922 <xsl:call-template name="make_indent">
923 <xsl:with-param name="current_indent" select="$current_indent"/>
925 <FONT color="red">we proved </FONT>
926 <xsl:apply-templates select="*[position()=3]">
927 <xsl:with-param name="current_indent" select="$current_indent + 16"/>
928 </xsl:apply-templates>
931 <xsl:when test="$name='letin1'">
932 <xsl:apply-templates select="*[position()=2]">
933 <xsl:with-param name="current_indent" select="$current_indent"/>
934 </xsl:apply-templates>
936 <xsl:call-template name="make_indent">
937 <xsl:with-param name="current_indent" select="$current_indent"/>
939 <xsl:apply-templates select="*[position()=3]">
940 <xsl:with-param name="current_indent" select="$current_indent"/>
941 </xsl:apply-templates>
944 <xsl:when test="$name='letin'">
945 <xsl:for-each select="*[position()>1 and last()>position()]">
946 <xsl:apply-templates select=".">
947 <xsl:with-param name="current_indent" select="$current_indent"/>
948 </xsl:apply-templates>
950 <xsl:call-template name="make_indent">
951 <xsl:with-param name="current_indent" select="$current_indent"/>
954 <xsl:apply-templates select="*[position()=last()]">
955 <xsl:with-param name="current_indent" select="$current_indent"/>
956 </xsl:apply-templates>
959 <xsl:when test="$name='let'">
961 <xsl:apply-templates select="m:ci"/>
963 <xsl:apply-templates select="*[3]">
964 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
965 </xsl:apply-templates>
968 <xsl:when test="$name='rw_step'">
970 <xsl:when test="name(*[2])='m:apply'">
971 <xsl:apply-templates select="*[2]">
972 <xsl:with-param name="current_indent" select="$current_indent"/>
973 </xsl:apply-templates>
976 <FONT color="red">Consider </FONT>
977 <xsl:apply-templates select="*[2]"/>
980 <xsl:variable name="charlength_first">
981 <xsl:apply-templates select="*[3]/*[1]" mode="charcount"/>
983 <xsl:variable name="charlength_second">
984 <xsl:apply-templates select="*[4]/*[1]" mode="charcount"/>
986 <xsl:variable name="charlength_side_proof">
987 <xsl:apply-templates select="*[5]/*[1]" mode="charcount"/>
989 <xsl:variable name="split1"
990 select="$charlength_first + $charlength_second > $framewidth"/>
991 <xsl:variable name="split2"
992 select="$charlength_second + $charlength_side_proof > $framewidth"/>
993 <!-- <xsl:value-of select="$current_indent"/> -->
994 <!-- <xsl:value-of select="$charlength"/> -->
996 <xsl:call-template name="make_indent">
997 <xsl:with-param name="current_indent" select="$current_indent"/>
999 <FONT color="red">Rewrite </FONT>
1000 <xsl:apply-templates mode="inline" select="*[3]"/>
1001 <xsl:text> </xsl:text>
1002 <xsl:if test="$split1">
1004 <xsl:call-template name="make_indent">
1005 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1006 </xsl:call-template>
1008 <FONT color="red">with </FONT>
1009 <xsl:apply-templates mode="inline" select="*[4]"/>
1010 <xsl:text> </xsl:text>
1011 <xsl:if test="$split2">
1013 <xsl:call-template name="make_indent">
1014 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1015 </xsl:call-template>
1017 <FONT color="red">by </FONT>
1018 <xsl:apply-templates select="*[5]">
1019 <xsl:with-param name="current_indent" select="$current_indent+7"/>
1020 </xsl:apply-templates>
1022 <!-- rewrite and apply -->
1023 <xsl:when test="$name='rewrite_and_apply'">
1024 <xsl:apply-templates select="*[2]">
1025 <xsl:with-param name="current_indent" select="$current_indent"/>
1026 </xsl:apply-templates>
1028 <xsl:call-template name="make_indent">
1029 <xsl:with-param name="current_indent" select="$current_indent"/>
1030 </xsl:call-template>
1031 <FONT color="red">Then apply it to </FONT>
1032 <xsl:apply-templates select="*[position()>2]"/>
1034 <!-- by_induction -->
1035 <xsl:when test="$name='by_induction'">
1036 <FONT color="red">We prove </FONT>
1037 <xsl:apply-templates select="../*[3]">
1038 <xsl:with-param name="current_indent" select="$current_indent+18"/>
1039 </xsl:apply-templates>
1041 <xsl:call-template name="make_indent">
1042 <xsl:with-param name="current_indent" select="$current_indent"/>
1043 </xsl:call-template>
1044 <FONT color="red">by induction on </FONT>
1045 <xsl:apply-templates select="*[position()=last()]/*[position()=last()]">
1046 <xsl:with-param name="current_indent" select="$current_indent+30"/>
1047 </xsl:apply-templates>
1050 <xsl:call-template name="make_indent">
1051 <xsl:with-param name="current_indent" select="$current_indent"/>
1052 </xsl:call-template>
1053 <xsl:text>The induction property is</xsl:text>
1055 <xsl:call-template name="make_indent">
1056 <xsl:with-param name="current_indent" select="$current_indent"/>
1057 </xsl:call-template>
1058 <xsl:apply-templates select="*[3]">
1059 <xsl:with-param name="current_indent" select="$current_indent"/>
1060 </xsl:apply-templates>
1062 <xsl:apply-templates
1063 select="*[position()>3 and not(position()=last())]">
1064 <xsl:with-param name="current_indent" select="$current_indent+4"/>
1065 </xsl:apply-templates>
1067 <xsl:call-template name="make_indent">
1068 <xsl:with-param name="current_indent" select="$current_indent"/>
1069 </xsl:call-template>
1070 <xsl:text>End induction</xsl:text> -->
1072 <!-- inductive_case -->
1073 <xsl:when test="$name='inductive_case'">
1075 <xsl:call-template name="make_indent">
1076 <xsl:with-param name="current_indent" select="$current_indent"/>
1077 </xsl:call-template>
1078 <FONT color="red">Case </FONT>
1079 <xsl:apply-templates select="*[2]">
1080 <xsl:with-param name="current_indent" select="$current_indent +10"/>
1081 </xsl:apply-templates>
1082 <xsl:if test="*[3]/*[position()>1]">
1084 <xsl:call-template name="make_indent">
1085 <xsl:with-param name="current_indent" select="$current_indent+4"/>
1086 </xsl:call-template>
1087 <FONT color="red">By induction hypothesis, we have:</FONT>
1088 <xsl:for-each select="*[3]/*[position()>1]">
1090 <xsl:call-template name="make_indent">
1091 <xsl:with-param name="current_indent" select="$current_indent + 4"/>
1092 </xsl:call-template>
1093 <xsl:text>(</xsl:text>
1094 <xsl:apply-templates select="m:ci"/>
1095 <xsl:text>) </xsl:text>
1096 <xsl:apply-templates select="m:type">
1097 <xsl:with-param name="current_indent" select="$current_indent + 8"/>
1098 </xsl:apply-templates>
1102 <xsl:call-template name="make_indent">
1103 <xsl:with-param name="current_indent" select="$current_indent + 4"/>
1104 </xsl:call-template>
1105 <xsl:apply-templates select="*[4]">
1106 <xsl:with-param name="current_indent" select="$current_indent +4"/>
1107 </xsl:apply-templates>
1109 <xsl:call-template name="make_indent">
1110 <xsl:with-param name="current_indent" select="$current_indent"/>
1111 </xsl:call-template>
1112 <xsl:text>End Case</xsl:text> -->
1115 <xsl:when test="$name='case_lhs'">
1117 <xsl:when test="count(*)=2">
1118 <xsl:apply-templates mode="inline" select="*[2]"/>
1121 <xsl:text>(</xsl:text>
1122 <xsl:apply-templates mode="inline" select="*[2]"/>
1123 <xsl:for-each select="m:bvar">
1124 <xsl:text> </xsl:text>
1125 <xsl:apply-templates mode="inline" select="*[1]"/>
1126 <xsl:text>:</xsl:text>
1127 <xsl:apply-templates mode="inline" select="m:type/*[1]"/>
1129 <xsl:text>)</xsl:text>
1134 <xsl:when test="$name='false_ind'">
1135 <xsl:apply-templates select="*[3]">
1136 <xsl:with-param name="current_indent" select="$current_indent"/>
1137 </xsl:apply-templates>
1139 <xsl:call-template name="make_indent">
1140 <xsl:with-param name="current_indent" select="$current_indent"/>
1141 </xsl:call-template>
1142 <FONT color="red">Contradiction.</FONT>
1145 <xsl:when test="$name='and_ind'">
1147 <xsl:when test="name(*[2])='m:apply'">
1148 <xsl:apply-templates select="*[2]">
1149 <xsl:with-param name="current_indent" select="$current_indent"/>
1150 </xsl:apply-templates>
1153 <FONT color="red">Consider </FONT>
1154 <xsl:apply-templates select="*[2]"/>
1158 <xsl:call-template name="make_indent">
1159 <xsl:with-param name="current_indent" select="$current_indent"/>
1160 </xsl:call-template>
1161 <FONT color="red">In particular, we have</FONT>
1163 <xsl:call-template name="make_indent">
1164 <xsl:with-param name="current_indent" select="$current_indent"/>
1165 </xsl:call-template>
1167 <xsl:apply-templates select="*[3]"/>
1169 <xsl:apply-templates select="*[4]">
1170 <xsl:with-param name="current_indent" select="$current_indent + 9"/>
1171 </xsl:apply-templates>
1173 <xsl:call-template name="make_indent">
1174 <xsl:with-param name="current_indent" select="$current_indent"/>
1175 </xsl:call-template>
1177 <xsl:apply-templates select="*[5]"/>
1179 <xsl:apply-templates select="*[6]">
1180 <xsl:with-param name="current_indent" select="$current_indent + 9"/>
1181 </xsl:apply-templates>
1183 <xsl:call-template name="make_indent">
1184 <xsl:with-param name="current_indent" select="$current_indent"/>
1185 </xsl:call-template>
1186 <xsl:apply-templates select="*[7]">
1187 <xsl:with-param name="current_indent" select="$current_indent"/>
1188 </xsl:apply-templates>
1190 <!-- full_or_ind -->
1191 <xsl:when test="$name='full_or_ind'">
1193 <xsl:when test="name(*[2])='m:apply'">
1194 <xsl:apply-templates select="*[2]">
1195 <xsl:with-param name="current_indent" select="$current_indent"/>
1196 </xsl:apply-templates>
1199 <FONT color="red">Consider </FONT>
1200 <xsl:apply-templates select="*[2]"/>
1204 <xsl:call-template name="make_indent">
1205 <xsl:with-param name="current_indent" select="$current_indent"/>
1206 </xsl:call-template>
1207 <FONT color="red">We proceed by cases to prove </FONT>
1208 <xsl:apply-templates select="*[3]"/>
1210 <xsl:call-template name="make_indent">
1211 <xsl:with-param name="current_indent" select="$current_indent+4"/>
1212 </xsl:call-template>
1213 <FONT color="red">Left: suppose </FONT>
1214 <xsl:text>(</xsl:text>
1215 <xsl:value-of select="*[4]/m:bvar/m:ci"/>
1216 <xsl:text>) </xsl:text>
1217 <xsl:apply-templates
1218 select="*[4]/m:bvar/m:type/*[1]"/>
1220 <xsl:call-template name="make_indent">
1221 <xsl:with-param name="current_indent" select="$current_indent+15"/>
1222 </xsl:call-template>
1223 <xsl:apply-templates
1225 <xsl:with-param name="current_indent" select="$current_indent+15"/>
1226 </xsl:apply-templates>
1228 <xsl:call-template name="make_indent">
1229 <xsl:with-param name="current_indent" select="$current_indent+4"/>
1230 </xsl:call-template>
1231 <FONT color="red">Right: suppose </FONT>
1232 <xsl:text>(</xsl:text>
1233 <xsl:value-of select="*[5]/m:bvar/m:ci"/>
1234 <xsl:text>) </xsl:text>
1235 <xsl:apply-templates
1236 select="*[5]/m:bvar/m:type/*[1]"/>
1238 <xsl:call-template name="make_indent">
1239 <xsl:with-param name="current_indent" select="$current_indent+16"/>
1240 </xsl:call-template>
1241 <xsl:apply-templates
1243 <xsl:with-param name="current_indent" select="$current_indent+16"/>
1244 </xsl:apply-templates>
1247 <xsl:when test="$name='or_ind'">
1249 <xsl:when test="name(*[2])='m:apply'">
1250 <xsl:apply-templates select="*[2]">
1251 <xsl:with-param name="current_indent" select="$current_indent"/>
1252 </xsl:apply-templates>
1255 <FONT color="red">Consider </FONT>
1256 <xsl:apply-templates select="*[2]"/>
1260 <xsl:call-template name="make_indent">
1261 <xsl:with-param name="current_indent" select="$current_indent"/>
1262 </xsl:call-template>
1263 <FONT color="red">We prove </FONT>
1264 <xsl:apply-templates select="*[3]"/>
1265 <FONT color="red"> by cases:</FONT>
1267 <xsl:call-template name="make_indent">
1268 <xsl:with-param name="current_indent" select="$current_indent"/>
1269 </xsl:call-template>
1271 <xsl:apply-templates select="*[4]">
1272 <xsl:with-param name="current_indent" select="$current_indent"/>
1273 </xsl:apply-templates>
1275 <xsl:call-template name="make_indent">
1276 <xsl:with-param name="current_indent" select="$current_indent"/>
1277 </xsl:call-template>
1279 <xsl:apply-templates select="*[5]">
1280 <xsl:with-param name="current_indent" select="$current_indent"/>
1281 </xsl:apply-templates>
1284 <xsl:when test="$name='ex_ind'">
1286 <xsl:when test="name(*[2])='m:apply'">
1287 <xsl:apply-templates select="*[2]">
1288 <xsl:with-param name="current_indent" select="$current_indent"/>
1289 </xsl:apply-templates>
1292 <FONT color="red">Consider </FONT>
1293 <xsl:apply-templates select="*[2]">
1294 <xsl:with-param name="current_indent" select="$current_indent"/>
1295 </xsl:apply-templates>
1299 <xsl:call-template name="make_indent">
1300 <xsl:with-param name="current_indent" select="$current_indent"/>
1301 </xsl:call-template>
1302 <FONT color="red">Let </FONT>
1303 <xsl:apply-templates mode="inline" select="*[3]"/>
1305 <xsl:apply-templates mode="inline" select="*[4]"/>
1306 <FONT color="red"> such that</FONT>
1308 <xsl:call-template name="make_indent">
1309 <xsl:with-param name="current_indent" select="$current_indent"/>
1310 </xsl:call-template>
1312 <xsl:apply-templates mode="inline" select="*[5]"/>
1314 <xsl:apply-templates select="*[6]">
1315 <xsl:with-param name="current_indent" select="$current_indent +7"/>
1316 </xsl:apply-templates>
1318 <xsl:call-template name="make_indent">
1319 <xsl:with-param name="current_indent" select="$current_indent"/>
1320 </xsl:call-template>
1321 <xsl:apply-templates select="*[7]">
1322 <xsl:with-param name="current_indent" select="$current_indent"/>
1323 </xsl:apply-templates>
1325 <!-- ***************************************** -->
1326 <!-- *********** LAMBDA ELEMENTS ************** -->
1327 <!-- ***************************************** -->
1328 <xsl:when test="$name='subst'">
1329 <xsl:apply-templates select="*[3]"/>
1330 <xsl:text>[</xsl:text>
1331 <xsl:apply-templates select="*[4]"/>
1332 <a href="{*[1]/@definitionURL}">
1333 <xsl:call-template name="mksymbol-1">
1334 <xsl:with-param name="symbol" select="$name"/>
1335 <xsl:with-param name="color" select="'blue'"/>
1336 <xsl:with-param name="size" select="'+0'"/>
1337 </xsl:call-template>
1339 <xsl:apply-templates select="*[2]"/>
1340 <xsl:text>]</xsl:text>
1343 <xsl:when test="$name='lift_with_base'">
1345 <xsl:apply-templates select="*[3]" mode="inline"/>
1347 <a href="{*[1]/@definitionURL}">
1348 <xsl:call-template name="mksymbol-1">
1349 <xsl:with-param name="symbol" select="$name"/>
1350 <xsl:with-param name="color" select="'green'"/>
1351 <xsl:with-param name="size" select="'+0'"/>
1352 </xsl:call-template>
1355 <xsl:apply-templates select="*[4]" mode="inline"/>
1357 <xsl:text>(</xsl:text>
1358 <xsl:apply-templates select="*[2]" mode="inline"/>
1359 <xsl:text>)</xsl:text>
1362 <xsl:when test="$name='lift'">
1363 <a href="{*[1]/@definitionURL}">
1364 <xsl:call-template name="mksymbol-1">
1365 <xsl:with-param name="symbol" select="$name"/>
1366 <xsl:with-param name="color" select="'green'"/>
1367 <xsl:with-param name="size" select="'+0'"/>
1368 </xsl:call-template>
1371 <xsl:apply-templates select="*[2]" mode="inline"/>
1373 <xsl:text>(</xsl:text>
1374 <xsl:apply-templates select="*[3]" mode="inline"/>
1375 <xsl:text>)</xsl:text>
1379 <xsl:when test="$name='beta_red1'">
1380 <xsl:apply-templates select="*[2]" mode="inline"/>
1381 <a href="{*[1]/@definitionURL}">
1382 <xsl:call-template name="mksymbol-1">
1383 <xsl:with-param name="symbol" select="$name"/>
1384 <xsl:with-param name="color" select="'green'"/>
1385 <xsl:with-param name="size" select="'+0'"/>
1386 </xsl:call-template>
1388 <xsl:call-template name="mksymbol-1">
1389 <xsl:with-param name="symbol" select="'beta'"/>
1390 <xsl:with-param name="color" select="'green'"/>
1391 <xsl:with-param name="size" select="'+0'"/>
1392 </xsl:call-template>
1395 <xsl:apply-templates select="*[3]" mode="inline"/>
1398 <xsl:when test="$name='beta_red'">
1399 <xsl:apply-templates select="*[2]" mode="inline"/>
1400 <a href="{*[1]/@definitionURL}">
1401 <xsl:call-template name="mksymbol-1">
1402 <xsl:with-param name="symbol" select="$name"/>
1403 <xsl:with-param name="color" select="'green'"/>
1404 <xsl:with-param name="size" select="'+0'"/>
1405 </xsl:call-template>
1407 <xsl:call-template name="mksymbol-1">
1408 <xsl:with-param name="symbol" select="'beta'"/>
1409 <xsl:with-param name="color" select="'green'"/>
1410 <xsl:with-param name="size" select="'+0'"/>
1411 </xsl:call-template>
1412 <xsl:text>*</xsl:text>
1415 <xsl:apply-templates select="*[3]" mode="inline"/>
1418 <xsl:when test="$name='par_beta_red1'">
1419 <xsl:apply-templates select="*[2]" mode="inline"/>
1420 <a href="{*[1]/@definitionURL}">
1421 <xsl:call-template name="mksymbol-1">
1422 <xsl:with-param name="symbol" select="$name"/>
1423 <xsl:with-param name="color" select="'green'"/>
1424 <xsl:with-param name="size" select="'+0'"/>
1425 </xsl:call-template>
1427 <xsl:call-template name="mksymbol-1">
1428 <xsl:with-param name="symbol" select="'beta'"/>
1429 <xsl:with-param name="color" select="'green'"/>
1430 <xsl:with-param name="size" select="'+0'"/>
1431 </xsl:call-template>
1434 <xsl:apply-templates select="*[3]" mode="inline"/>
1437 <xsl:when test="$name='par_beta_red'">
1438 <xsl:apply-templates select="*[2]" mode="inline"/>
1439 <a href="{*[1]/@definitionURL}">
1440 <xsl:call-template name="mksymbol-1">
1441 <xsl:with-param name="symbol" select="$name"/>
1442 <xsl:with-param name="color" select="'green'"/>
1443 <xsl:with-param name="size" select="'+0'"/>
1444 </xsl:call-template>
1446 <xsl:call-template name="mksymbol-1">
1447 <xsl:with-param name="symbol" select="'beta'"/>
1448 <xsl:with-param name="color" select="'green'"/>
1449 <xsl:with-param name="size" select="'+0'"/>
1450 </xsl:call-template>
1451 <xsl:text>*</xsl:text>
1454 <xsl:apply-templates select="*[3]" mode="inline"/>
1458 <xsl:when test="$name='forgetful'">
1459 <a href="{*[1]/@definitionURL}">|</a>
1460 <xsl:apply-templates select="*[2]" mode="inline"/>
1461 <a href="{*[1]/@definitionURL}">|</a>
1464 <!-- boolean algebra of redexes -->
1467 <xsl:when test="$name='isomorphic'">
1468 <xsl:apply-templates select="*[2]" mode="inline"/>
1469 <a href="{*[1]/@definitionURL}">
1470 <xsl:call-template name="mksymbol-1">
1471 <xsl:with-param name="symbol" select="$name"/>
1472 <xsl:with-param name="color" select="'green'"/>
1473 <xsl:with-param name="size" select="'+0'"/>
1474 </xsl:call-template>
1476 <xsl:apply-templates select="*[3]" mode="inline"/>
1480 <xsl:when test="$name='interp'">
1481 <font color="green">[</font>
1482 <xsl:apply-templates select="*[2]"/>
1483 <font color="green">]</font>
1491 <xsl:template match="m:lambda">
1492 <xsl:param name="current_indent" select="0"/>
1493 <xsl:variable name="charlength">
1494 <xsl:apply-templates select="*[position()=1]" mode="charcount"/>
1495 <!-- <xsl:apply-templates select="." mode="charcount"/> -->
1497 <!-- <xsl:value-of select="$charlength"/> -->
1498 <!-- <xsl:value-of select="$current_indent"/> -->
1500 <xsl:when test="$charlength > $framewidth">
1502 <xsl:call-template name="mksymbol-1">
1503 <xsl:with-param name="symbol" select="'lambda'"/>
1504 <xsl:with-param name="color" select="'red'"/>
1505 <xsl:with-param name="size" select="'+2'"/>
1506 </xsl:call-template>
1507 <xsl:apply-templates select="m:bvar/m:ci"/>
1508 <xsl:text>:</xsl:text>
1509 <xsl:apply-templates select="m:bvar/m:type">
1510 <xsl:with-param name="current_indent"
1511 select="$current_indent + 4 + 2*string-length(m:bvar/m:ci)"/>
1512 </xsl:apply-templates><br/>
1513 <xsl:call-template name="make_indent">
1514 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1515 </xsl:call-template>
1516 <xsl:text>.</xsl:text>
1517 <xsl:apply-templates select="*[position()=2]">
1518 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1519 </xsl:apply-templates>
1522 <xsl:apply-templates mode="inline" select="."/>
1528 <xsl:template match="m:ci">
1530 <xsl:when test="boolean(@definitionURL)">
1531 <a href="{@definitionURL}">
1532 <xsl:apply-templates/>
1536 <xsl:value-of select="."/>
1543 <xsl:template match="m:ci|m:csymbol" mode="charcount">
1544 <xsl:param name="incurrent_length" select="0"/>
1546 <xsl:when test="$framewidth >= ($incurrent_length + string-length())">
1547 <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>
1549 <xsl:when test="string($siblength) = """>
1550 <xsl:value-of select="$incurrent_length + string-length()"/>
1553 <xsl:value-of select="number($siblength)"/>
1558 <xsl:value-of select="$incurrent_length + string-length()"/>
1563 <xsl:template match="*" mode="charcount">
1564 <xsl:param name="incurrent_length" select="0"/>
1566 <xsl:when test="count(child::*) = 0">
1567 <xsl:value-of select="$incurrent_length"/>
1570 <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>
1572 <xsl:when test="$framewidth >= number($childlength)">
1573 <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>
1575 <xsl:when test="string($siblength) = """>
1576 <xsl:value-of select="number($childlength)"/>
1579 <xsl:value-of select="number($siblength)"/>
1584 <xsl:value-of select="number($childlength)"/>
1592 <!--***********************************************************************-->
1594 <!--***********************************************************************-->
1598 <xsl:template match="Definition">
1599 <xsl:param name="current_indent" select="0"/>
1601 DEFINITION <xsl:value-of select="@name"/>(<xsl:if test="string(./Params) != """><xsl:value-of select="Params"/></xsl:if>)<br/>
1603 <xsl:call-template name="make_indent">
1604 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
1605 </xsl:call-template>
1606 <xsl:apply-templates select="type/*[1]">
1607 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
1608 </xsl:apply-templates><br/>
1610 <xsl:call-template name="make_indent">
1611 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
1612 </xsl:call-template>
1613 <xsl:apply-templates select="body/*[1]">
1614 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
1615 </xsl:apply-templates>
1621 <xsl:template match="Axiom">
1622 <xsl:param name="current_indent" select="0"/>
1624 AXIOM <xsl:value-of select="@name"/>(<xsl:if test="string(./Params) != """><xsl:value-of select="Params"/></xsl:if>)<br/>
1626 <xsl:call-template name="make_indent">
1627 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
1628 </xsl:call-template>
1629 <xsl:apply-templates select="type/*[1]">
1630 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
1631 </xsl:apply-templates>
1635 <!-- UNFINISHED PROOF -->
1637 <xsl:template match="CurrentProof">
1638 <xsl:param name="current_indent" select="0"/>
1640 UNFINISHED PROOF <xsl:value-of select="@name"/>(<xsl:if test="string(./Params) != """><xsl:value-of select="Params"/></xsl:if>)<br/>
1641 THESIS: <xsl:apply-templates select="type/*[1]">
1642 <xsl:with-param name="current_indent" select="$current_indent + 8"/>
1643 </xsl:apply-templates><br/>
1645 <xsl:for-each select="Conjecture">
1647 <xsl:call-template name="make_indent">
1648 <xsl:with-param name="current_indent" select="$current_indent + 8"/>
1649 </xsl:call-template>
1650 <xsl:value-of select="./@no"/> :
1651 <xsl:apply-templates select="./*[1]">
1652 <xsl:with-param name="current_indent" select="$current_indent + 11"/>
1653 </xsl:apply-templates>
1657 <xsl:apply-templates select="body/*[1]">
1658 <xsl:with-param name="current_indent" select="$current_indent + 8"/>
1659 </xsl:apply-templates>
1663 <!-- MUTUAL INDUCTIVE DEFINITION -->
1665 <xsl:template match="InductiveDefinition">
1666 <xsl:param name="current_indent" select="0"/>
1668 <xsl:for-each select="InductiveType">
1670 <xsl:when test="position() = 1">
1672 <xsl:when test="string(./@inductive) = "true"">
1673 INDUCTIVE DEFINITION
1676 COINDUCTIVE DEFINITION
1684 <xsl:value-of select="./@name"/>(<xsl:if test="string(../Params) != """><xsl:value-of select="../Params"/></xsl:if>)
1686 <xsl:if test="string(../Param) != """>
1687 <xsl:for-each select="../Param">
1688 <xsl:value-of select="./@name"/>
1690 <xsl:apply-templates select="*"/>
1695 <xsl:apply-templates select="./arity/*[1]">
1696 <xsl:with-param name="current_indent" select="$current_indent + 9"/>
1697 </xsl:apply-templates> <br/>
1699 <xsl:for-each select="./Constructor">
1701 <xsl:call-template name="make_indent">
1702 <xsl:with-param name="current_indent" select="$current_indent + 3"/>
1703 </xsl:call-template>
1705 <xsl:when test="position() = 1">
1706 <xsl:text>  </xsl:text>
1709 <xsl:text>| </xsl:text>
1712 <xsl:value-of select="./@name"/>
1713 <xsl:text>: </xsl:text>
1714 <xsl:apply-templates select="./*[1]">
1715 <xsl:with-param name="current_indent" select="$current_indent + 2*string-length(./@name) + 5"/>
1716 </xsl:apply-templates>
1724 <xsl:template match="Variable">
1725 <xsl:param name="current_indent" select="0"/>
1727 VARIABLE <xsl:value-of select="@name"/><br/>
1728 TYPE = <xsl:apply-templates select="type/*[1]">
1729 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
1730 </xsl:apply-templates>
1734 <!--***********************************************************************-->
1736 <!--***********************************************************************-->
1740 <xsl:template match="SECTION">
1741 <xsl:param name="current_indent" select="0"/>
1742 <h1>BEGIN OF SECTION</h1>
1743 <xsl:apply-templates/>
1744 <h1>END OF SECTION</h1>