3 <!-- Copyright (C) 2000, HELM Team -->
5 <!-- This file is part of HELM, an Hypertextual, Electronic -->
6 <!-- Library of Mathematics, developed at the Computer Science -->
7 <!-- Department, University of Bologna, Italy. -->
9 <!-- HELM is free software; you can redistribute it and/or -->
10 <!-- modify it under the terms of the GNU General Public License -->
11 <!-- as published by the Free Software Foundation; either version 2 -->
12 <!-- of the License, or (at your option) any later version. -->
14 <!-- HELM is distributed in the hope that it will be useful, -->
15 <!-- but WITHOUT ANY WARRANTY; without even the implied warranty of -->
16 <!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -->
17 <!-- GNU General Public License for more details. -->
19 <!-- You should have received a copy of the GNU General Public License -->
20 <!-- along with HELM; if not, write to the Free Software -->
21 <!-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, -->
22 <!-- MA 02111-1307, USA. -->
24 <!-- For details, see the HELM World-Wide-Web page, -->
25 <!-- http://cs.unibo.it/helm/. -->
27 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
28 xmlns:m="http://www.w3.org/1998/Math/MathML">
30 <!--***********************************************************************-->
31 <!-- From MathML content to HTML -->
32 <!-- HELM Group: Asperti, Padovani, Sacerdoti, Schena, Guidi -->
33 <!--***********************************************************************-->
35 <xsl:param name="CICURI" select="''"/>
36 <xsl:param name="type" select="'standalone'"/>
37 <xsl:param name="UNICODEvsSYMBOL" select="'symbol'"/>
39 <xsl:include href="html_init.xsl"/>
40 <xsl:include href="html_set.xsl"/>
41 <xsl:include href="html_reals.xsl"/>
43 <xsl:variable name="showcast" select="0"/>
45 <!--***********************************************************************-->
46 <!-- HTML Head and Body -->
47 <!--***********************************************************************-->
49 <!-- <xsl:output method="html" encoding="iso-8859-1"/> -->
51 <!-- document needs method="xml" and searches locally for the dtd if -->
52 <!-- doctype-system is specified (the dtd must exist locally for parsing). -->
53 <!-- For having output html must be media-type="html" and for having the -->
54 <!-- correct <br /> you must specify at least the remote dtd by means of -->
55 <!-- doctype-public -->
59 media-type="text/html"
60 doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" />
62 <xsl:variable name="framewidth" select="55"/>
64 <xsl:template name="mksymbol-1">
65 <xsl:param name="symbol" select="''"/>
66 <xsl:param name="color" select="''"/>
67 <xsl:param name="size" select="''"/>
69 <xsl:when test="$UNICODEvsSYMBOL = 'symbol'">
70 <xsl:variable name="fontsymbol">
72 <xsl:when test="$symbol = '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 <xsl:text disable-output-escaping="yes">
173 function Hide(which){
174 if (!document.getElementById)
176 which.style.display="none"
179 function Show(which){
180 if (!document.getElementById)
182 which.style.display=""
185 document.to_be_deleted = new Array();
190 <body bgcolor="white">
191 <xsl:attribute name="onLoad">
192 if(document.getElementById)
193 for(var i=0;i<document.to_be_deleted.length;i++)
194 Hide(document.getElementById(document.to_be_deleted[i]));
196 <xsl:apply-templates>
197 <xsl:with-param name="current_indent" select="0"/>
198 </xsl:apply-templates>
204 <xsl:apply-templates>
205 <xsl:with-param name="current_indent" select="0"/>
206 </xsl:apply-templates>
212 <!--***********************************************************************-->
214 <!--***********************************************************************-->
216 <xsl:template name="make_indent">
217 <xsl:param name="current_indent" select="0"/>
218 <xsl:if test="$current_indent > 0">
219 <xsl:text> </xsl:text>
220 <xsl:call-template name="make_indent">
221 <xsl:with-param name="current_indent" select="$current_indent - 1"/>
226 <!-- Syntactic Sugar -->
227 <xsl:template match="m:type">
228 <xsl:param name="current_indent" select="0"/>
229 <xsl:apply-templates>
230 <xsl:with-param name="current_indent"
231 select="$current_indent"/>
232 </xsl:apply-templates>
235 <xsl:template match="m:condition">
236 <xsl:param name="current_indent" select="0"/>
237 <xsl:apply-templates>
238 <xsl:with-param name="current_indent"
239 select="$current_indent"/>
240 </xsl:apply-templates>
243 <xsl:template match="m:math">
244 <xsl:param name="current_indent" select="0"/>
245 <xsl:apply-templates>
246 <xsl:with-param name="current_indent"
247 select="$current_indent"/>
248 </xsl:apply-templates>
251 <!--*********************************************************************-->
253 <!--*********************************************************************-->
256 <xsl:template mode="inline" match="m:ci">
258 <xsl:when test="boolean(@definitionURL)">
259 <a href="{@definitionURL}">
260 <xsl:apply-templates/>
264 <xsl:value-of select="."/>
271 <xsl:template match="m:apply[m:csymbol]" mode="inline">
272 <xsl:variable name="name">
273 <xsl:value-of select="m:csymbol"/>
275 <xsl:variable name="uri"><xsl:value-of select="*[1]/@definitionURL"/></xsl:variable>
278 <xsl:when test="$name='forall'">
279 <xsl:call-template name="mksymbol-1">
280 <xsl:with-param name="symbol" select="$name"/>
281 <xsl:with-param name="color" select="'blue'"/>
282 <xsl:with-param name="size" select="'+2'"/>
284 <xsl:apply-templates select="m:bvar/m:ci"/>
285 <xsl:text>:</xsl:text>
286 <xsl:apply-templates mode="inline" select="m:bvar/m:type"/>
287 <xsl:text>.</xsl:text>
288 <xsl:apply-templates mode="inline" select="*[position()=3]"/>
290 <xsl:when test="$name='prod'">
291 <xsl:call-template name="mksymbol-1">
292 <xsl:with-param name="symbol" select="$name"/>
293 <xsl:with-param name="color" select="'blue'"/>
294 <xsl:with-param name="size" select="'+2'"/>
296 <xsl:apply-templates mode="inline" select="m:bvar/m:ci"/>
297 <xsl:text>:</xsl:text>
298 <xsl:apply-templates mode="inline" select="m:bvar/m:type"/>
299 <xsl:text>.</xsl:text>
300 <xsl:apply-templates mode="inline" select="*[position()=3]"/>
303 <xsl:when test="$name='arrow'">
304 <xsl:text>(</xsl:text>
305 <xsl:apply-templates mode="inline" select="*[position()=2]"/>
306 <xsl:call-template name="mksymbol-1">
307 <xsl:with-param name="symbol" select="$name"/>
308 <xsl:with-param name="color" select="'blue'"/>
309 <xsl:with-param name="size" select="'+0'"/>
311 <xsl:apply-templates mode="inline" select="*[position()=3]"/>
312 <xsl:text>)</xsl:text>
315 <xsl:when test="$name='app'">
316 <xsl:text>(</xsl:text>
317 <xsl:apply-templates mode="inline" select="*[position()=2]"/>
318 <xsl:for-each select="*[position()>2]">
319 <xsl:text> </xsl:text>
320 <xsl:apply-templates mode="inline" select="."/>
322 <xsl:text>)</xsl:text>
325 <xsl:when test="$name='cast'">
326 <xsl:text>(</xsl:text>
327 <xsl:apply-templates mode="inline" select="*[position()=2]"/>
328 <xsl:text>:></xsl:text>
329 <xsl:apply-templates mode="inline" select="*[position()=3]"/>
330 <xsl:text>)</xsl:text>
332 <xsl:when test="$name='Prop'">
333 <FONT color="violet">Prop</FONT>
335 <xsl:when test="$name='Set'">
336 <FONT color="violet">Set</FONT>
338 <xsl:when test="$name='Type'">
339 <FONT color="violet">Type</FONT>
342 <xsl:when test="$name='mutcase'">
343 <xsl:text><</xsl:text>
344 <xsl:apply-templates mode="inline" select="*[position()=2]"/>
345 <xsl:text>> </xsl:text>
346 <FONT color="red">CASE </FONT>
347 <xsl:apply-templates mode="inline" select="*[position()=3]"/>
348 <FONT color="red"> OF </FONT>
349 <xsl:for-each select="piecewise/piece">
350 <!--<xsl:for-each select="*[position() mod 2 = 0 and position()>3]">-->
352 <xsl:when test="not(position() = 1)">
353 <xsl:text> | </xsl:text>
356 <xsl:apply-templates mode="inline" select="./*[2]"/>
357 <xsl:call-template name="mksymbol-1">
358 <xsl:with-param name="symbol" select="'RightArrow'"/>
359 <xsl:with-param name="color" select="'green'"/>
360 <xsl:with-param name="size" select="'+0'"/>
362 <xsl:apply-templates mode="inline"
367 <xsl:when test="$name='fix'">
368 <FONT color="red">FIX</FONT>
369 <xsl:value-of select="m:ci"/>
370 <xsl:text>{</xsl:text>
371 <xsl:for-each select="m:bvar">
372 <xsl:value-of select="m:ci"/>
373 <xsl:text>:</xsl:text>
374 <xsl:apply-templates mode="inline" select="m:type"/>
375 <xsl:text>:=</xsl:text>
376 <xsl:apply-templates mode="inline"
377 select="following-sibling::*[position() = 1]"/>
379 <xsl:when test="position()=last()">
380 <xsl:text>}</xsl:text>
383 <xsl:text>;</xsl:text>
389 <xsl:when test="$name='cofix'">
390 <xsl:text>COFIX</xsl:text>
391 <xsl:value-of select="m:ci"/>
392 <xsl:text>{</xsl:text>
393 <xsl:for-each select="m:bvar">
394 <xsl:value-of select="m:ci"/>
395 <xsl:text>:</xsl:text>
396 <xsl:apply-templates mode="inline" select="m:type"/>
397 <xsl:text>:=</xsl:text>
398 <xsl:apply-templates mode="inline"
399 select="following-sibling::*[position() = 1]"/>
401 <xsl:when test="position()=last()">
402 <xsl:text>}</xsl:text>
405 <xsl:text>;</xsl:text>
410 <!-- proof and side_proof -->
411 <xsl:when test="$name='proof' or $name='side_proof'">
412 <xsl:apply-templates mode="inline" select="*[position()=2]"/>
413 <FONT color="red"> proves </FONT>
414 <xsl:apply-templates mode="inline" select="*[position()=3]"/>
417 <xsl:when test="$name='letin1'">
418 <xsl:text>letin1 (inline error)</xsl:text>
421 <xsl:when test="$name='false_ind'">
422 <xsl:apply-templates mode="inline" select="*[3]"/>
423 <FONT color="red">Contradiction.</FONT>
426 <xsl:when test="$name='and_ind'">
427 <FONT color="red">From </FONT>
428 <xsl:apply-templates select="*[2]"/>
429 <FONT color="red"> we get</FONT>
431 <xsl:apply-templates select="*[3]"/>
433 <xsl:apply-templates mode="inline" select="*[4]"/>
434 <FONT color="red"> and </FONT>
436 <xsl:apply-templates select="*[5]"/>
438 <xsl:apply-templates mode="inline" select="*[6]"/>
440 <FONT color="red"> hence </FONT>
441 <xsl:apply-templates mode="inline" select="*[7]"/>
444 <xsl:when test="$name='subst'">
445 <xsl:apply-templates select="*[3]" mode="inline"/>
446 <xsl:text>[</xsl:text>
447 <xsl:apply-templates select="*[4]" mode="inline"/>
449 <xsl:when test="$uri != ''">
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'"/>
459 <xsl:call-template name="mksymbol-1">
460 <xsl:with-param name="symbol" select="$name"/>
461 <xsl:with-param name="color" select="'green'"/>
462 <xsl:with-param name="size" select="'+0'"/>
466 <xsl:apply-templates select="*[2]" mode="inline"/>
467 <xsl:text>]</xsl:text>
470 <xsl:when test="$name='lift_with_base'">
472 <xsl:apply-templates select="*[3]" mode="inline"/>
475 <xsl:when test="$uri != ''">
477 <xsl:call-template name="mksymbol-1">
478 <xsl:with-param name="symbol" select="$name"/>
479 <xsl:with-param name="color" select="'green'"/>
480 <xsl:with-param name="size" select="'+0'"/>
485 <xsl:call-template name="mksymbol-1">
486 <xsl:with-param name="symbol" select="$name"/>
487 <xsl:with-param name="color" select="'green'"/>
488 <xsl:with-param name="size" select="'+0'"/>
493 <xsl:apply-templates select="*[4]" mode="inline"/>
495 <xsl:text>(</xsl:text>
496 <xsl:apply-templates select="*[2]" mode="inline"/>
497 <xsl:text>)</xsl:text>
500 <xsl:when test="$name='lift'">
502 <xsl:when test="$uri != ''">
504 <xsl:call-template name="mksymbol-1">
505 <xsl:with-param name="symbol" select="$name"/>
506 <xsl:with-param name="color" select="'green'"/>
507 <xsl:with-param name="size" select="'+0'"/>
512 <xsl:call-template name="mksymbol-1">
513 <xsl:with-param name="symbol" select="$name"/>
514 <xsl:with-param name="color" select="'green'"/>
515 <xsl:with-param name="size" select="'+0'"/>
520 <xsl:apply-templates select="*[2]" mode="inline"/>
522 <xsl:text>(</xsl:text>
523 <xsl:apply-templates select="*[3]" mode="inline"/>
524 <xsl:text>)</xsl:text>
528 <xsl:when test="$name='beta_red1'">
529 <xsl:apply-templates select="*[2]" mode="inline"/>
531 <xsl:when test="$uri != ''">
533 <xsl:call-template name="mksymbol-1">
534 <xsl:with-param name="symbol" select="$name"/>
535 <xsl:with-param name="color" select="'green'"/>
536 <xsl:with-param name="size" select="'+0'"/>
539 <xsl:call-template name="mksymbol-1">
540 <xsl:with-param name="symbol" select="'beta'"/>
541 <xsl:with-param name="color" select="'green'"/>
542 <xsl:with-param name="size" select="'+0'"/>
548 <xsl:call-template name="mksymbol-1">
549 <xsl:with-param name="symbol" select="$name"/>
550 <xsl:with-param name="color" select="'green'"/>
551 <xsl:with-param name="size" select="'+0'"/>
554 <xsl:call-template name="mksymbol-1">
555 <xsl:with-param name="symbol" select="'beta'"/>
556 <xsl:with-param name="color" select="'green'"/>
557 <xsl:with-param name="size" select="'+0'"/>
562 <xsl:apply-templates select="*[3]" mode="inline"/>
565 <xsl:when test="$name='beta_red'">
566 <xsl:apply-templates select="*[2]" mode="inline"/>
568 <xsl:when test="$uri != ''">
570 <xsl:call-template name="mksymbol-1">
571 <xsl:with-param name="symbol" select="$name"/>
572 <xsl:with-param name="color" select="'green'"/>
573 <xsl:with-param name="size" select="'+0'"/>
576 <xsl:call-template name="mksymbol-1">
577 <xsl:with-param name="symbol" select="'beta'"/>
578 <xsl:with-param name="color" select="'green'"/>
579 <xsl:with-param name="size" select="'+0'"/>
581 <xsl:text>*</xsl:text>
586 <xsl:call-template name="mksymbol-1">
587 <xsl:with-param name="symbol" select="$name"/>
588 <xsl:with-param name="color" select="'green'"/>
589 <xsl:with-param name="size" select="'+0'"/>
592 <xsl:call-template name="mksymbol-1">
593 <xsl:with-param name="symbol" select="'beta'"/>
594 <xsl:with-param name="color" select="'green'"/>
595 <xsl:with-param name="size" select="'+0'"/>
597 <xsl:text>*</xsl:text>
601 <xsl:apply-templates select="*[3]" mode="inline"/>
604 <xsl:when test="$name='par_beta_red1'">
605 <xsl:apply-templates select="*[2]" mode="inline"/>
607 <xsl:when test="$uri != ''">
609 <xsl:call-template name="mksymbol-1">
610 <xsl:with-param name="symbol" select="$name"/>
611 <xsl:with-param name="color" select="'green'"/>
612 <xsl:with-param name="size" select="'+0'"/>
615 <xsl:call-template name="mksymbol-1">
616 <xsl:with-param name="symbol" select="'beta'"/>
617 <xsl:with-param name="color" select="'green'"/>
618 <xsl:with-param name="size" select="'+0'"/>
624 <xsl:call-template name="mksymbol-1">
625 <xsl:with-param name="symbol" select="$name"/>
626 <xsl:with-param name="color" select="'green'"/>
627 <xsl:with-param name="size" select="'+0'"/>
630 <xsl:call-template name="mksymbol-1">
631 <xsl:with-param name="symbol" select="'beta'"/>
632 <xsl:with-param name="color" select="'green'"/>
633 <xsl:with-param name="size" select="'+0'"/>
638 <xsl:apply-templates select="*[3]" mode="inline"/>
641 <xsl:when test="$name='par_beta_red'">
642 <xsl:apply-templates select="*[2]" mode="inline"/>
644 <xsl:when test="$uri != ''">
646 <xsl:call-template name="mksymbol-1">
647 <xsl:with-param name="symbol" select="$name"/>
648 <xsl:with-param name="color" select="'green'"/>
649 <xsl:with-param name="size" select="'+0'"/>
652 <xsl:call-template name="mksymbol-1">
653 <xsl:with-param name="symbol" select="'beta'"/>
654 <xsl:with-param name="color" select="'green'"/>
655 <xsl:with-param name="size" select="'+0'"/>
657 <xsl:text>*</xsl:text>
662 <xsl:call-template name="mksymbol-1">
663 <xsl:with-param name="symbol" select="$name"/>
664 <xsl:with-param name="color" select="'green'"/>
665 <xsl:with-param name="size" select="'+0'"/>
668 <xsl:call-template name="mksymbol-1">
669 <xsl:with-param name="symbol" select="'beta'"/>
670 <xsl:with-param name="color" select="'green'"/>
671 <xsl:with-param name="size" select="'+0'"/>
673 <xsl:text>*</xsl:text>
677 <xsl:apply-templates select="*[3]" mode="inline"/>
681 <xsl:when test="$name='forgetful'">
683 <xsl:when test="$uri != ''">
684 <a href="{$uri}">|</a>
690 <xsl:apply-templates select="*[2]" mode="inline"/>
692 <xsl:when test="$uri != ''">
693 <a href="{$uri}">|</a>
701 <!-- boolean algebra of redexes -->
704 <xsl:when test="$name='isomorphic'">
705 <xsl:apply-templates select="*[2]" mode="inline"/>
707 <xsl:when test="$uri != ''">
709 <xsl:call-template name="mksymbol-1">
710 <xsl:with-param name="symbol" select="$name"/>
711 <xsl:with-param name="color" select="'green'"/>
712 <xsl:with-param name="size" select="'+0'"/>
717 <xsl:call-template name="mksymbol-1">
718 <xsl:with-param name="symbol" select="$name"/>
719 <xsl:with-param name="color" select="'green'"/>
720 <xsl:with-param name="size" select="'+0'"/>
724 <xsl:apply-templates select="*[3]" mode="inline"/>
728 <xsl:when test="$name='interp'">
729 <font color="green">[</font>
730 <xsl:apply-templates select="*[2]"/>
731 <font color="green">]</font>
737 <xsl:template mode="inline" match="m:lambda">
738 <xsl:call-template name="mksymbol-1">
739 <xsl:with-param name="symbol" select="'lambda'"/>
740 <xsl:with-param name="color" select="'red'"/>
741 <xsl:with-param name="size" select="'+2'"/>
743 <xsl:apply-templates select="m:bvar/m:ci"/>
744 <xsl:text>:</xsl:text>
745 <xsl:apply-templates mode="inline" select="m:bvar/m:type"/>
746 <xsl:text>.</xsl:text>
747 <xsl:apply-templates mode="inline" select="*[position()=2]"/>
750 <!--*********************************************************************-->
751 <!-- COUNTING MODE -->
752 <!--*********************************************************************-->
754 <xsl:template match="m:apply[m:csymbol]">
755 <xsl:param name="current_indent" select="0"/>
756 <xsl:param name="width" select="$framewidth"/>
757 <xsl:variable name="name">
758 <xsl:value-of select="m:csymbol"/>
760 <xsl:variable name="charlength">
761 <xsl:apply-templates select="m:csymbol" mode="charcount"/>
763 <!-- <xsl:value-of select="$current_indent"/> -->
764 <!-- <xsl:value-of select="$charlength"/> -->
765 <xsl:variable name="uri"><xsl:value-of select="*[1]/@definitionURL"/></xsl:variable>
768 <xsl:when test="$name='forall'">
770 <xsl:when test="$charlength > $framewidth">
772 <xsl:call-template name="mksymbol-1">
773 <xsl:with-param name="symbol" select="$name"/>
774 <xsl:with-param name="color" select="'blue'"/>
775 <xsl:with-param name="size" select="'+2'"/>
777 <xsl:apply-templates select="m:bvar/m:ci"/>
778 <xsl:text>:</xsl:text>
779 <xsl:apply-templates select="m:bvar/m:type">
780 <xsl:with-param name="current_indent"
781 select="$current_indent + 5 + 2*string-length(m:bvar/m:ci)"/>
782 </xsl:apply-templates>
784 <xsl:call-template name="make_indent">
785 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
787 <xsl:text>.</xsl:text>
788 <xsl:apply-templates select="*[position()=3]">
789 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
790 </xsl:apply-templates>
793 <xsl:apply-templates mode="inline" select="."/>
798 <xsl:when test="$name='prod'">
800 <xsl:when test="$charlength > $framewidth">
801 <xsl:call-template name="mksymbol-1">
802 <xsl:with-param name="symbol" select="$name"/>
803 <xsl:with-param name="color" select="'blue'"/>
804 <xsl:with-param name="size" select="'+2'"/>
806 <xsl:apply-templates select="m:bvar/m:ci"/>
807 <xsl:text>:</xsl:text>
808 <xsl:apply-templates select="m:bvar/m:type">
809 <xsl:with-param name="current_indent"
810 select="$current_indent + 5 + 2*string-length(m:bvar/m:ci)"/>
811 </xsl:apply-templates><br/>
812 <xsl:call-template name="make_indent">
813 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
815 <xsl:text>.</xsl:text>
816 <xsl:apply-templates select="*[position()=3]">
817 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
818 </xsl:apply-templates>
821 <xsl:apply-templates mode="inline" select="."/>
826 <xsl:when test="$name='arrow'">
828 <xsl:when test="$charlength > $framewidth">
829 <xsl:text>(</xsl:text>
830 <xsl:apply-templates select="*[position()=2]">
831 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
832 </xsl:apply-templates>
834 <xsl:call-template name="make_indent">
835 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
838 <xsl:call-template name="mksymbol-1">
839 <xsl:with-param name="symbol" select="$name"/>
840 <xsl:with-param name="color" select="'blue'"/>
841 <xsl:with-param name="size" select="'+0'"/>
843 <xsl:apply-templates select="*[position()=3]">
844 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
845 </xsl:apply-templates>
846 <xsl:text>)</xsl:text>
849 <xsl:apply-templates mode="inline" select="."/>
854 <xsl:when test="$name='app'">
856 <xsl:when test="$charlength > $framewidth">
857 <xsl:text>(</xsl:text>
858 <xsl:apply-templates select="*[position()=2]">
859 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
860 </xsl:apply-templates>
861 <xsl:for-each select="*[position()>2]">
863 <xsl:call-template name="make_indent">
864 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
866 <xsl:apply-templates select=".">
867 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
868 </xsl:apply-templates>
870 <xsl:text>)</xsl:text>
873 <xsl:apply-templates mode="inline" select="."/>
877 <xsl:when test="$name='cast'">
879 <xsl:when test="$showcast = 1">
881 <xsl:when test="$charlength > $framewidth">
882 <xsl:text>(</xsl:text>
883 <xsl:apply-templates select="*[position()=2]">
884 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
885 </xsl:apply-templates><br/>
886 <xsl:call-template name="make_indent">
887 <xsl:with-param name="current_indent" select="$current_indent + 2"/> </xsl:call-template>
888 <xsl:text>:></xsl:text>
889 <xsl:apply-templates select="*[position()=3]">
890 <xsl:with-param name="current_indent" select="$current_indent + 3"/>
891 </xsl:apply-templates>
892 <xsl:text>)</xsl:text>
895 <xsl:apply-templates mode="inline" select="."/>
900 <xsl:apply-templates select="*[position()=2]">
901 <xsl:with-param name="current_indent" select="$current_indent"/>
902 </xsl:apply-templates>
906 <xsl:when test="$name='Prop'">
907 <xsl:text>Prop</xsl:text>
909 <xsl:when test="$name='Set'">
910 <xsl:text>Set</xsl:text>
912 <xsl:when test="$name='Type'">
913 <xsl:text>Type</xsl:text>
915 <xsl:when test="$name='mutcase'">
917 <xsl:when test="$charlength > $framewidth">
918 <xsl:text><</xsl:text>
919 <xsl:apply-templates select="*[position()=2]">
920 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
921 </xsl:apply-templates>
922 <xsl:text>> </xsl:text>
924 <xsl:call-template name="make_indent">
925 <xsl:with-param name="current_indent" select="$current_indent + 2"/> </xsl:call-template>
926 <xsl:text>CASE </xsl:text>
927 <xsl:apply-templates select="*[position()=3]">
928 <xsl:with-param name="current_indent" select="$current_indent + 8"/>
929 </xsl:apply-templates>
930 <xsl:text> OF </xsl:text>
931 <xsl:for-each select="piecewise/piece">
932 <!-- <xsl:for-each select="*[position() mod 2 = 0 and position()>3]">-->
934 <xsl:call-template name="make_indent">
935 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
938 <xsl:when test="position() = 1">
939 <xsl:text>  </xsl:text>
942 <xsl:text>| </xsl:text>
945 <xsl:apply-templates select="./*[2]"/>
946 <xsl:call-template name="mksymbol-1">
947 <xsl:with-param name="symbol" select="'RightArrow'"/>
948 <xsl:with-param name="color" select="'green'"/>
949 <xsl:with-param name="size" select="'+0'"/>
951 <xsl:variable name="body_size">
953 select="./*[1]/*[1]" mode="charcount"/>
956 <xsl:when test="$body_size > $framewidth">
958 <xsl:call-template name="make_indent">
959 <xsl:with-param name="current_indent"
960 select="$current_indent + 8"/>
964 <xsl:with-param name="current_indent"
965 select="$current_indent + 8"/>
966 </xsl:apply-templates>
969 <xsl:apply-templates select="./*[1]"
976 <xsl:apply-templates mode="inline" select="."/>
981 <xsl:when test="$name='fix'">
983 <xsl:when test="$charlength > $framewidth">
984 <xsl:text>FIX</xsl:text>
985 <xsl:value-of select="m:ci"/>
986 <xsl:text>{</xsl:text>
987 <xsl:for-each select="m:bvar">
989 <xsl:call-template name="make_indent">
990 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
992 <xsl:value-of select="m:ci"/>
993 <xsl:text>:</xsl:text>
994 <xsl:apply-templates select="m:type">
995 <xsl:with-param name="current_indent"
996 select="$current_indent + 5 + string-length(m:ci)"/>
997 </xsl:apply-templates>
999 <xsl:call-template name="make_indent">
1000 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1001 </xsl:call-template>
1002 <xsl:text>:=</xsl:text>
1003 <xsl:apply-templates select="following-sibling::*[position() = 1]">
1004 <xsl:with-param name="current_indent" select="$current_indent +2"/>
1005 </xsl:apply-templates>
1008 <xsl:call-template name="make_indent">
1009 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1010 </xsl:call-template>
1011 <xsl:text>}</xsl:text>
1014 <xsl:apply-templates mode="inline" select="."/>
1019 <xsl:when test="$name='cofix'">
1021 <xsl:when test="($charlength + 10) > $framewidth">
1022 <xsl:text>COFIX</xsl:text>
1023 <xsl:value-of select="m:ci"/>
1024 <xsl:text>{</xsl:text>
1026 <xsl:call-template name="make_indent">
1027 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1028 </xsl:call-template>
1029 <xsl:for-each select="m:bvar">
1030 <xsl:value-of select="m:ci"/>
1031 <xsl:text>:</xsl:text>
1032 <xsl:apply-templates select="m:type">
1033 <xsl:with-param name="current_indent"
1034 select="$current_indent + 5 + string-length(m:ci)"/>
1035 </xsl:apply-templates>
1037 <xsl:call-template name="make_indent">
1038 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1039 </xsl:call-template>
1040 <xsl:text>:=</xsl:text>
1041 <xsl:apply-templates select="following-sibling::*[position() = 1]">
1042 <xsl:with-param name="current_indent" select="$current_indent + 3"/>
1043 </xsl:apply-templates>
1047 <xsl:call-template name="make_indent">
1048 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1049 </xsl:call-template>
1050 <xsl:text>}</xsl:text>
1053 <xsl:apply-templates mode="inline" select="m:type"/>
1057 <xsl:when test="$name='let_in'">
1058 <xsl:text>let </xsl:text>
1059 <xsl:apply-templates select="m:bvar/m:ci"/>
1060 <xsl:text> := </xsl:text>
1061 <xsl:apply-templates select="*[3]">
1062 <xsl:with-param name="current_indent" select="$current_indent+14"/>
1063 </xsl:apply-templates>
1065 <xsl:call-template name="make_indent">
1066 <xsl:with-param name="current_indent" select="$current_indent"/>
1067 </xsl:call-template>
1068 <xsl:text>in </xsl:text>
1069 <xsl:apply-templates select="*[4]">
1070 <xsl:with-param name="current_indent" select="$current_indent+5"/>
1071 </xsl:apply-templates>
1074 <!-- ***************************************** -->
1075 <!-- *********** PROOF ELEMENTS ************** -->
1076 <!-- ***************************************** -->
1078 <xsl:when test="$name='proof'">
1079 <xsl:variable name="nonce" select="generate-id()"/>
1080 <xsl:variable name="freshid1" select="concat('a',$nonce)"/>
1081 <xsl:variable name="freshid2" select="concat('b',$nonce)"/>
1082 <xsl:variable name="freshid3" select="concat('c',$nonce)"/>
1083 <span ID="{$freshid1}">
1084 <xsl:apply-templates select="*[position()=2]">
1085 <xsl:with-param name="current_indent" select="$current_indent"/>
1086 </xsl:apply-templates>
1090 <xsl:when test="(preceding-sibling::*[1]/text()='letin1') or
1091 (preceding-sibling::*[1]/text()='rw_step') or
1092 (name(..)='m:lambda')">
1094 <xsl:call-template name="make_indent">
1095 <xsl:with-param name="current_indent" select="$current_indent"/>
1096 </xsl:call-template>
1097 <FONT color="red">we proved </FONT>
1101 if(document.getElementById) {
1103 <span ID="{$freshid2}">\
1104 <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>\
1106 <span ID="{$freshid3}">\
1108 <xsl:call-template name="make_indent">
1109 <xsl:with-param name="current_indent" select="$current_indent"/>
1110 </xsl:call-template>\
1111 <a style="text-decoration:underline ; color:red" href="" onClick="Hide(document.getElementById(\'{$freshid1}\')); Show(document.getElementById(\'{$freshid2}\'));Hide(document.getElementById(\'{$freshid3}\'));return (0==1);">we proved</a>\
1114 document.to_be_deleted.push('<xsl:value-of select="$freshid1"/>');
1115 document.to_be_deleted.push('<xsl:value-of select="$freshid3"/>');
1116 document.write(' ');
1120 <xsl:call-template name="make_indent">
1121 <xsl:with-param name="current_indent" select="$current_indent"/>
1122 </xsl:call-template>\
1123 <FONT color="red">we proved </FONT>\
1129 <xsl:apply-templates select="*[position()=3]">
1130 <xsl:with-param name="current_indent" select="$current_indent + 16"/>
1131 </xsl:apply-templates>
1134 <xsl:when test="$name='side_proof'">
1135 <xsl:variable name="nonce" select="generate-id()"/>
1136 <xsl:variable name="freshid1" select="concat('a',$nonce)"/>
1137 <xsl:variable name="freshid2" select="concat('b',$nonce)"/>
1138 <xsl:variable name="freshid3" select="concat('c',$nonce)"/>
1139 <xsl:variable name="freshid4" select="concat('d',$nonce)"/>
1140 <span ID="{$freshid1}">
1141 <xsl:apply-templates select="*[position()=2]">
1142 <xsl:with-param name="current_indent" select="$current_indent"/>
1143 </xsl:apply-templates>
1147 if(document.getElementById) {
1149 <span ID="{$freshid2}">\
1150 <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>\
1152 <span ID="{$freshid3}">\
1154 <xsl:call-template name="make_indent">
1155 <xsl:with-param name="current_indent" select="$current_indent"/>
1156 </xsl:call-template>\
1157 <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>\
1160 document.to_be_deleted.push('<xsl:value-of select="$freshid1"/>');
1161 document.to_be_deleted.push('<xsl:value-of select="$freshid3"/>');
1162 document.to_be_deleted.push('<xsl:value-of select="$freshid4"/>');
1163 document.write(' ');
1167 <xsl:call-template name="make_indent">
1168 <xsl:with-param name="current_indent" select="$current_indent"/>
1169 </xsl:call-template>\
1170 <FONT color="red">we proved </FONT>\
1174 <span ID="{$freshid4}">
1175 <xsl:apply-templates select="*[position()=3]">
1176 <xsl:with-param name="current_indent" select="$current_indent + 16"/>
1177 </xsl:apply-templates>
1181 <xsl:when test="$name='eq_chain'">
1182 <FONT color="red">We have the following equality chain:</FONT>
1183 <xsl:for-each select="*[position() mod 2 = 0]">
1184 <xsl:variable name="pos" select="position()"/>
1186 <xsl:call-template name="make_indent">
1187 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
1188 </xsl:call-template>
1190 <xsl:when test="$pos=1">
1191 <xsl:apply-templates select=".">
1192 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
1193 </xsl:apply-templates>
1194 <xsl:text> =</xsl:text>
1197 <xsl:text>= </xsl:text>
1198 <xsl:apply-templates select=".">
1199 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
1200 </xsl:apply-templates>
1203 <xsl:if test="$pos != last()">
1205 <xsl:call-template name="make_indent">
1206 <xsl:with-param name="current_indent" select="$current_indent + 15"/>
1207 </xsl:call-template>
1208 <xsl:apply-templates select="../*[position()=2*$pos +1]">
1209 <xsl:with-param name="current_indent" select="$current_indent + 15"/>
1210 </xsl:apply-templates>
1214 <!-- diseq_chain -->
1215 <xsl:when test="$name='diseq_chain'">
1216 <FONT color="red">We have the following chain of disequalities:</FONT>
1217 <xsl:for-each select="*[position() mod 3 = 2]">
1218 <xsl:variable name="pos" select="position()"/>
1220 <xsl:call-template name="make_indent">
1221 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
1222 </xsl:call-template>
1224 <xsl:when test="$pos=1">
1225 <xsl:apply-templates select=".">
1226 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
1227 </xsl:apply-templates>
1228 <xsl:text> </xsl:text>
1229 <xsl:apply-templates mode="inline" select="../*[position()=3*$pos]"/>
1232 <xsl:apply-templates mode="inline" select="../*[position()=3*($pos - 1)]"/>
1233 <xsl:text> </xsl:text>
1234 <xsl:apply-templates select=".">
1235 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
1236 </xsl:apply-templates>
1239 <xsl:if test="$pos != last()">
1241 <xsl:call-template name="make_indent">
1242 <xsl:with-param name="current_indent" select="$current_indent + 15"/>
1243 </xsl:call-template>
1244 <xsl:apply-templates select="../*[position()=3*$pos +1]">
1245 <xsl:with-param name="current_indent" select="$current_indent + 15"/>
1246 </xsl:apply-templates>
1251 <xsl:when test="$name='letin1'">
1252 <xsl:apply-templates select="*[position()=2]">
1253 <xsl:with-param name="current_indent" select="$current_indent"/>
1254 </xsl:apply-templates>
1256 <xsl:call-template name="make_indent">
1257 <xsl:with-param name="current_indent" select="$current_indent"/>
1258 </xsl:call-template>
1259 <xsl:apply-templates select="*[position()=3]">
1260 <xsl:with-param name="current_indent" select="$current_indent"/>
1261 </xsl:apply-templates>
1264 <xsl:when test="$name='letin'">
1265 <xsl:for-each select="*[position()>1 and last()>position()]">
1266 <xsl:apply-templates select=".">
1267 <xsl:with-param name="current_indent" select="$current_indent"/>
1268 </xsl:apply-templates>
1270 <xsl:call-template name="make_indent">
1271 <xsl:with-param name="current_indent" select="$current_indent"/>
1272 </xsl:call-template>
1274 <xsl:apply-templates select="*[position()=last()]">
1275 <xsl:with-param name="current_indent" select="$current_indent"/>
1276 </xsl:apply-templates>
1279 <xsl:when test="$name='let'">
1281 <xsl:apply-templates select="m:ci"/>
1283 <xsl:apply-templates select="*[3]">
1284 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
1285 </xsl:apply-templates>
1288 <xsl:when test="$name='rw_step'">
1290 <xsl:when test="name(*[2])='m:apply'">
1291 <xsl:apply-templates select="*[2]">
1292 <xsl:with-param name="current_indent" select="$current_indent"/>
1293 </xsl:apply-templates>
1296 <FONT color="red">Consider </FONT>
1297 <xsl:apply-templates select="*[2]"/>
1300 <xsl:variable name="charlength_first">
1301 <xsl:apply-templates select="*[3]" mode="root_charcount"/>
1303 <xsl:variable name="charlength_second">
1304 <xsl:apply-templates select="*[4]" mode="root_charcount"/>
1306 <xsl:variable name="charlength_side_proof">
1307 <xsl:apply-templates select="*[5]" mode="root_charcount"/>
1309 <xsl:variable name="split1"
1310 select="($charlength_first + $charlength_second) > $framewidth"/>
1311 <xsl:variable name="split2"
1312 select="($charlength_second + $charlength_side_proof) > $framewidth"/>
1313 <!-- <xsl:value-of select="$current_indent"/> -->
1314 <!-- <xsl:value-of select="string($charlength_second)"/> -->
1315 <!-- <xsl:value-of select="$charlength_side_proof"/> -->
1316 <!-- <xsl:value-of select="$split2"/> -->
1318 <xsl:call-template name="make_indent">
1319 <xsl:with-param name="current_indent" select="$current_indent"/>
1320 </xsl:call-template>
1321 <FONT color="red">Rewrite </FONT>
1322 <xsl:apply-templates mode="inline" select="*[3]"/>
1323 <xsl:text> </xsl:text>
1324 <xsl:if test="$split1">
1326 <xsl:call-template name="make_indent">
1327 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1328 </xsl:call-template>
1330 <FONT color="red">with </FONT>
1331 <xsl:apply-templates mode="inline" select="*[4]"/>
1332 <xsl:text> </xsl:text>
1333 <xsl:if test="$split2">
1335 <xsl:call-template name="make_indent">
1336 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1337 </xsl:call-template>
1339 <FONT color="red">by </FONT>
1340 <xsl:apply-templates select="*[5]">
1341 <xsl:with-param name="current_indent" select="$current_indent+7"/>
1342 </xsl:apply-templates>
1344 <!-- rewrite and apply -->
1345 <xsl:when test="$name='rewrite_and_apply'">
1346 <xsl:apply-templates select="*[2]">
1347 <xsl:with-param name="current_indent" select="$current_indent"/>
1348 </xsl:apply-templates>
1350 <xsl:call-template name="make_indent">
1351 <xsl:with-param name="current_indent" select="$current_indent"/>
1352 </xsl:call-template>
1353 <FONT color="red">Then apply it to </FONT>
1354 <xsl:apply-templates select="*[position()>2]"/>
1356 <!-- by_induction -->
1357 <xsl:when test="$name='by_induction'">
1358 <FONT color="red">We prove </FONT>
1359 <xsl:apply-templates select="../*[3]">
1360 <xsl:with-param name="current_indent" select="$current_indent+18"/>
1361 </xsl:apply-templates>
1363 <xsl:call-template name="make_indent">
1364 <xsl:with-param name="current_indent" select="$current_indent"/>
1365 </xsl:call-template>
1366 <FONT color="red">by induction on </FONT>
1367 <xsl:apply-templates select="*[position()=last()]/*[position()=last()]">
1368 <xsl:with-param name="current_indent" select="$current_indent+30"/>
1369 </xsl:apply-templates>
1372 <xsl:call-template name="make_indent">
1373 <xsl:with-param name="current_indent" select="$current_indent"/>
1374 </xsl:call-template>
1375 <xsl:text>The induction property is</xsl:text>
1377 <xsl:call-template name="make_indent">
1378 <xsl:with-param name="current_indent" select="$current_indent"/>
1379 </xsl:call-template>
1380 <xsl:apply-templates select="*[3]">
1381 <xsl:with-param name="current_indent" select="$current_indent"/>
1382 </xsl:apply-templates>
1384 <xsl:apply-templates
1385 select="*[position()>3 and not(position()=last())]">
1386 <xsl:with-param name="current_indent" select="$current_indent+4"/>
1387 </xsl:apply-templates>
1389 <xsl:call-template name="make_indent">
1390 <xsl:with-param name="current_indent" select="$current_indent"/>
1391 </xsl:call-template>
1392 <xsl:text>End induction</xsl:text> -->
1394 <!-- inductive_case -->
1395 <xsl:when test="$name='inductive_case'">
1397 <xsl:call-template name="make_indent">
1398 <xsl:with-param name="current_indent" select="$current_indent"/>
1399 </xsl:call-template>
1400 <FONT color="red">Case </FONT>
1401 <xsl:apply-templates select="*[2]">
1402 <xsl:with-param name="current_indent" select="$current_indent +10"/>
1403 </xsl:apply-templates>
1404 <xsl:if test="*[3]/*[position()>1]">
1406 <xsl:call-template name="make_indent">
1407 <xsl:with-param name="current_indent" select="$current_indent+4"/>
1408 </xsl:call-template>
1409 <FONT color="red">By induction hypothesis, we have:</FONT>
1410 <xsl:for-each select="*[3]/*[position()>1]">
1412 <xsl:call-template name="make_indent">
1413 <xsl:with-param name="current_indent" select="$current_indent + 4"/>
1414 </xsl:call-template>
1415 <xsl:text>(</xsl:text>
1416 <xsl:apply-templates select="m:ci"/>
1417 <xsl:text>) </xsl:text>
1418 <xsl:apply-templates select="m:type">
1419 <xsl:with-param name="current_indent" select="$current_indent + 8"/>
1420 </xsl:apply-templates>
1424 <xsl:call-template name="make_indent">
1425 <xsl:with-param name="current_indent" select="$current_indent + 4"/>
1426 </xsl:call-template>
1427 <xsl:apply-templates select="*[4]">
1428 <xsl:with-param name="current_indent" select="$current_indent +4"/>
1429 </xsl:apply-templates>
1431 <xsl:call-template name="make_indent">
1432 <xsl:with-param name="current_indent" select="$current_indent"/>
1433 </xsl:call-template>
1434 <xsl:text>End Case</xsl:text> -->
1437 <xsl:when test="$name='case_lhs'">
1439 <xsl:when test="count(*)=2">
1440 <xsl:apply-templates mode="inline" select="*[2]"/>
1443 <xsl:text>(</xsl:text>
1444 <xsl:apply-templates mode="inline" select="*[2]"/>
1445 <xsl:for-each select="m:bvar">
1446 <xsl:text> </xsl:text>
1447 <xsl:apply-templates mode="inline" select="*[1]"/>
1448 <xsl:text>:</xsl:text>
1449 <xsl:apply-templates mode="inline" select="m:type/*[1]"/>
1451 <xsl:text>)</xsl:text>
1456 <xsl:when test="$name='false_ind'">
1457 <xsl:apply-templates select="*[3]">
1458 <xsl:with-param name="current_indent" select="$current_indent"/>
1459 </xsl:apply-templates>
1461 <xsl:call-template name="make_indent">
1462 <xsl:with-param name="current_indent" select="$current_indent"/>
1463 </xsl:call-template>
1464 <FONT color="red">Contradiction.</FONT>
1467 <xsl:when test="$name='and_ind'">
1469 <xsl:when test="name(*[2])='m:apply'">
1470 <xsl:apply-templates select="*[2]">
1471 <xsl:with-param name="current_indent" select="$current_indent"/>
1472 </xsl:apply-templates>
1475 <FONT color="red">Consider </FONT>
1476 <xsl:apply-templates select="*[2]"/>
1480 <xsl:call-template name="make_indent">
1481 <xsl:with-param name="current_indent" select="$current_indent"/>
1482 </xsl:call-template>
1483 <FONT color="red">In particular, we have</FONT>
1485 <xsl:call-template name="make_indent">
1486 <xsl:with-param name="current_indent" select="$current_indent"/>
1487 </xsl:call-template>
1489 <xsl:apply-templates select="*[3]"/>
1491 <xsl:apply-templates select="*[4]">
1492 <xsl:with-param name="current_indent" select="$current_indent + 9"/>
1493 </xsl:apply-templates>
1495 <xsl:call-template name="make_indent">
1496 <xsl:with-param name="current_indent" select="$current_indent"/>
1497 </xsl:call-template>
1499 <xsl:apply-templates select="*[5]"/>
1501 <xsl:apply-templates select="*[6]">
1502 <xsl:with-param name="current_indent" select="$current_indent + 9"/>
1503 </xsl:apply-templates>
1505 <xsl:call-template name="make_indent">
1506 <xsl:with-param name="current_indent" select="$current_indent"/>
1507 </xsl:call-template>
1508 <xsl:apply-templates select="*[7]">
1509 <xsl:with-param name="current_indent" select="$current_indent"/>
1510 </xsl:apply-templates>
1512 <!-- full_or_ind -->
1513 <xsl:when test="$name='full_or_ind'">
1515 <xsl:when test="name(*[2])='m:apply'">
1516 <xsl:apply-templates select="*[2]">
1517 <xsl:with-param name="current_indent" select="$current_indent"/>
1518 </xsl:apply-templates>
1521 <FONT color="red">Consider </FONT>
1522 <xsl:apply-templates select="*[2]"/>
1526 <xsl:call-template name="make_indent">
1527 <xsl:with-param name="current_indent" select="$current_indent"/>
1528 </xsl:call-template>
1529 <FONT color="red">We proceed by cases to prove </FONT>
1530 <xsl:apply-templates select="*[3]"/>
1532 <xsl:call-template name="make_indent">
1533 <xsl:with-param name="current_indent" select="$current_indent+4"/>
1534 </xsl:call-template>
1535 <FONT color="red">Left: suppose </FONT>
1536 <xsl:text>(</xsl:text>
1537 <xsl:value-of select="*[4]/m:bvar/m:ci"/>
1538 <xsl:text>) </xsl:text>
1539 <xsl:apply-templates
1540 select="*[4]/m:bvar/m:type/*[1]"/>
1542 <xsl:call-template name="make_indent">
1543 <xsl:with-param name="current_indent" select="$current_indent+15"/>
1544 </xsl:call-template>
1545 <xsl:apply-templates
1547 <xsl:with-param name="current_indent" select="$current_indent+15"/>
1548 </xsl:apply-templates>
1550 <xsl:call-template name="make_indent">
1551 <xsl:with-param name="current_indent" select="$current_indent+4"/>
1552 </xsl:call-template>
1553 <FONT color="red">Right: suppose </FONT>
1554 <xsl:text>(</xsl:text>
1555 <xsl:value-of select="*[5]/m:bvar/m:ci"/>
1556 <xsl:text>) </xsl:text>
1557 <xsl:apply-templates
1558 select="*[5]/m:bvar/m:type/*[1]"/>
1560 <xsl:call-template name="make_indent">
1561 <xsl:with-param name="current_indent" select="$current_indent+16"/>
1562 </xsl:call-template>
1563 <xsl:apply-templates
1565 <xsl:with-param name="current_indent" select="$current_indent+16"/>
1566 </xsl:apply-templates>
1569 <xsl:when test="$name='or_ind'">
1571 <xsl:when test="name(*[2])='m:apply'">
1572 <xsl:apply-templates select="*[2]">
1573 <xsl:with-param name="current_indent" select="$current_indent"/>
1574 </xsl:apply-templates>
1577 <FONT color="red">Consider </FONT>
1578 <xsl:apply-templates select="*[2]"/>
1582 <xsl:call-template name="make_indent">
1583 <xsl:with-param name="current_indent" select="$current_indent"/>
1584 </xsl:call-template>
1585 <FONT color="red">We prove </FONT>
1586 <xsl:apply-templates select="*[3]"/>
1587 <FONT color="red"> by cases:</FONT>
1589 <xsl:call-template name="make_indent">
1590 <xsl:with-param name="current_indent" select="$current_indent"/>
1591 </xsl:call-template>
1593 <xsl:apply-templates select="*[4]">
1594 <xsl:with-param name="current_indent" select="$current_indent"/>
1595 </xsl:apply-templates>
1597 <xsl:call-template name="make_indent">
1598 <xsl:with-param name="current_indent" select="$current_indent"/>
1599 </xsl:call-template>
1601 <xsl:apply-templates select="*[5]">
1602 <xsl:with-param name="current_indent" select="$current_indent"/>
1603 </xsl:apply-templates>
1606 <xsl:when test="$name='ex_ind'">
1608 <xsl:when test="name(*[2])='m:apply'">
1609 <xsl:apply-templates select="*[2]">
1610 <xsl:with-param name="current_indent" select="$current_indent"/>
1611 </xsl:apply-templates>
1614 <FONT color="red">Consider </FONT>
1615 <xsl:apply-templates select="*[2]">
1616 <xsl:with-param name="current_indent" select="$current_indent"/>
1617 </xsl:apply-templates>
1621 <xsl:call-template name="make_indent">
1622 <xsl:with-param name="current_indent" select="$current_indent"/>
1623 </xsl:call-template>
1624 <FONT color="red">Let </FONT>
1625 <xsl:apply-templates mode="inline" select="*[3]"/>
1627 <xsl:apply-templates mode="inline" select="*[4]"/>
1628 <FONT color="red"> such that</FONT>
1630 <xsl:call-template name="make_indent">
1631 <xsl:with-param name="current_indent" select="$current_indent"/>
1632 </xsl:call-template>
1634 <xsl:apply-templates mode="inline" select="*[5]"/>
1636 <xsl:apply-templates select="*[6]">
1637 <xsl:with-param name="current_indent" select="$current_indent +7"/>
1638 </xsl:apply-templates>
1640 <xsl:call-template name="make_indent">
1641 <xsl:with-param name="current_indent" select="$current_indent"/>
1642 </xsl:call-template>
1643 <xsl:apply-templates select="*[7]">
1644 <xsl:with-param name="current_indent" select="$current_indent"/>
1645 </xsl:apply-templates>
1647 <!-- ***************************************** -->
1648 <!-- *********** LAMBDA ELEMENTS ************** -->
1649 <!-- ***************************************** -->
1650 <xsl:when test="$name='subst'">
1651 <xsl:apply-templates select="*[3]"/>
1652 <xsl:text>[</xsl:text>
1653 <xsl:apply-templates select="*[4]"/>
1655 <xsl:when test="$uri != ''">
1657 <xsl:call-template name="mksymbol-1">
1658 <xsl:with-param name="symbol" select="$name"/>
1659 <xsl:with-param name="color" select="'blue'"/>
1660 <xsl:with-param name="size" select="'+0'"/>
1661 </xsl:call-template>
1665 <xsl:call-template name="mksymbol-1">
1666 <xsl:with-param name="symbol" select="$name"/>
1667 <xsl:with-param name="color" select="'blue'"/>
1668 <xsl:with-param name="size" select="'+0'"/>
1669 </xsl:call-template>
1672 <xsl:apply-templates select="*[2]"/>
1673 <xsl:text>]</xsl:text>
1676 <xsl:when test="$name='lift_with_base'">
1678 <xsl:apply-templates select="*[3]" mode="inline"/>
1681 <xsl:when test="$uri != ''">
1683 <xsl:call-template name="mksymbol-1">
1684 <xsl:with-param name="symbol" select="$name"/>
1685 <xsl:with-param name="color" select="'green'"/>
1686 <xsl:with-param name="size" select="'+0'"/>
1687 </xsl:call-template>
1691 <xsl:call-template name="mksymbol-1">
1692 <xsl:with-param name="symbol" select="$name"/>
1693 <xsl:with-param name="color" select="'green'"/>
1694 <xsl:with-param name="size" select="'+0'"/>
1695 </xsl:call-template>
1699 <xsl:apply-templates select="*[4]" mode="inline"/>
1701 <xsl:text>(</xsl:text>
1702 <xsl:apply-templates select="*[2]" mode="inline"/>
1703 <xsl:text>)</xsl:text>
1706 <xsl:when test="$name='lift'">
1708 <xsl:when test="$uri != ''">
1710 <xsl:call-template name="mksymbol-1">
1711 <xsl:with-param name="symbol" select="$name"/>
1712 <xsl:with-param name="color" select="'green'"/>
1713 <xsl:with-param name="size" select="'+0'"/>
1714 </xsl:call-template>
1718 <xsl:call-template name="mksymbol-1">
1719 <xsl:with-param name="symbol" select="$name"/>
1720 <xsl:with-param name="color" select="'green'"/>
1721 <xsl:with-param name="size" select="'+0'"/>
1722 </xsl:call-template>
1726 <xsl:apply-templates select="*[2]" mode="inline"/>
1728 <xsl:text>(</xsl:text>
1729 <xsl:apply-templates select="*[3]" mode="inline"/>
1730 <xsl:text>)</xsl:text>
1734 <xsl:when test="$name='beta_red1'">
1735 <xsl:apply-templates select="*[2]" mode="inline"/>
1737 <xsl:when test="$uri != ''">
1739 <xsl:call-template name="mksymbol-1">
1740 <xsl:with-param name="symbol" select="$name"/>
1741 <xsl:with-param name="color" select="'green'"/>
1742 <xsl:with-param name="size" select="'+0'"/>
1743 </xsl:call-template>
1745 <xsl:call-template name="mksymbol-1">
1746 <xsl:with-param name="symbol" select="'beta'"/>
1747 <xsl:with-param name="color" select="'green'"/>
1748 <xsl:with-param name="size" select="'+0'"/>
1749 </xsl:call-template>
1754 <xsl:call-template name="mksymbol-1">
1755 <xsl:with-param name="symbol" select="$name"/>
1756 <xsl:with-param name="color" select="'green'"/>
1757 <xsl:with-param name="size" select="'+0'"/>
1758 </xsl:call-template>
1760 <xsl:call-template name="mksymbol-1">
1761 <xsl:with-param name="symbol" select="'beta'"/>
1762 <xsl:with-param name="color" select="'green'"/>
1763 <xsl:with-param name="size" select="'+0'"/>
1764 </xsl:call-template>
1768 <xsl:apply-templates select="*[3]" mode="inline"/>
1771 <xsl:when test="$name='beta_red'">
1772 <xsl:apply-templates select="*[2]" mode="inline"/>
1774 <xsl:when test="$uri != ''">
1776 <xsl:call-template name="mksymbol-1">
1777 <xsl:with-param name="symbol" select="$name"/>
1778 <xsl:with-param name="color" select="'green'"/>
1779 <xsl:with-param name="size" select="'+0'"/>
1780 </xsl:call-template>
1782 <xsl:call-template name="mksymbol-1">
1783 <xsl:with-param name="symbol" select="'beta'"/>
1784 <xsl:with-param name="color" select="'green'"/>
1785 <xsl:with-param name="size" select="'+0'"/>
1786 </xsl:call-template>
1787 <xsl:text>*</xsl:text>
1792 <xsl:call-template name="mksymbol-1">
1793 <xsl:with-param name="symbol" select="$name"/>
1794 <xsl:with-param name="color" select="'green'"/>
1795 <xsl:with-param name="size" select="'+0'"/>
1796 </xsl:call-template>
1798 <xsl:call-template name="mksymbol-1">
1799 <xsl:with-param name="symbol" select="'beta'"/>
1800 <xsl:with-param name="color" select="'green'"/>
1801 <xsl:with-param name="size" select="'+0'"/>
1802 </xsl:call-template>
1803 <xsl:text>*</xsl:text>
1807 <xsl:apply-templates select="*[3]" mode="inline"/>
1810 <xsl:when test="$name='par_beta_red1'">
1811 <xsl:apply-templates select="*[2]" mode="inline"/>
1813 <xsl:when test="$uri != ''">
1815 <xsl:call-template name="mksymbol-1">
1816 <xsl:with-param name="symbol" select="$name"/>
1817 <xsl:with-param name="color" select="'green'"/>
1818 <xsl:with-param name="size" select="'+0'"/>
1819 </xsl:call-template>
1821 <xsl:call-template name="mksymbol-1">
1822 <xsl:with-param name="symbol" select="'beta'"/>
1823 <xsl:with-param name="color" select="'green'"/>
1824 <xsl:with-param name="size" select="'+0'"/>
1825 </xsl:call-template>
1830 <xsl:call-template name="mksymbol-1">
1831 <xsl:with-param name="symbol" select="$name"/>
1832 <xsl:with-param name="color" select="'green'"/>
1833 <xsl:with-param name="size" select="'+0'"/>
1834 </xsl:call-template>
1836 <xsl:call-template name="mksymbol-1">
1837 <xsl:with-param name="symbol" select="'beta'"/>
1838 <xsl:with-param name="color" select="'green'"/>
1839 <xsl:with-param name="size" select="'+0'"/>
1840 </xsl:call-template>
1844 <xsl:apply-templates select="*[3]" mode="inline"/>
1847 <xsl:when test="$name='par_beta_red'">
1848 <xsl:apply-templates select="*[2]" mode="inline"/>
1850 <xsl:when test="$uri != ''">
1852 <xsl:call-template name="mksymbol-1">
1853 <xsl:with-param name="symbol" select="$name"/>
1854 <xsl:with-param name="color" select="'green'"/>
1855 <xsl:with-param name="size" select="'+0'"/>
1856 </xsl:call-template>
1858 <xsl:call-template name="mksymbol-1">
1859 <xsl:with-param name="symbol" select="'beta'"/>
1860 <xsl:with-param name="color" select="'green'"/>
1861 <xsl:with-param name="size" select="'+0'"/>
1862 </xsl:call-template>
1863 <xsl:text>*</xsl:text>
1868 <xsl:call-template name="mksymbol-1">
1869 <xsl:with-param name="symbol" select="$name"/>
1870 <xsl:with-param name="color" select="'green'"/>
1871 <xsl:with-param name="size" select="'+0'"/>
1872 </xsl:call-template>
1874 <xsl:call-template name="mksymbol-1">
1875 <xsl:with-param name="symbol" select="'beta'"/>
1876 <xsl:with-param name="color" select="'green'"/>
1877 <xsl:with-param name="size" select="'+0'"/>
1878 </xsl:call-template>
1879 <xsl:text>*</xsl:text>
1883 <xsl:apply-templates select="*[3]" mode="inline"/>
1887 <xsl:when test="$name='forgetful'">
1889 <xsl:when test="$uri != ''">
1890 <a href="{$uri}">|</a>
1896 <xsl:apply-templates select="*[2]" mode="inline"/>
1898 <xsl:when test="$uri != ''">
1899 <a href="{$uri}">|</a>
1907 <!-- boolean algebra of redexes -->
1910 <xsl:when test="$name='isomorphic'">
1911 <xsl:apply-templates select="*[2]" mode="inline"/>
1913 <xsl:when test="$uri != ''">
1915 <xsl:call-template name="mksymbol-1">
1916 <xsl:with-param name="symbol" select="$name"/>
1917 <xsl:with-param name="color" select="'green'"/>
1918 <xsl:with-param name="size" select="'+0'"/>
1919 </xsl:call-template>
1923 <xsl:call-template name="mksymbol-1">
1924 <xsl:with-param name="symbol" select="$name"/>
1925 <xsl:with-param name="color" select="'green'"/>
1926 <xsl:with-param name="size" select="'+0'"/>
1927 </xsl:call-template>
1930 <xsl:apply-templates select="*[3]" mode="inline"/>
1934 <xsl:when test="$name='interp'">
1935 <font color="green">[</font>
1936 <xsl:apply-templates select="*[2]"/>
1937 <font color="green">]</font>
1945 <xsl:template match="m:lambda">
1946 <xsl:param name="current_indent" select="0"/>
1947 <xsl:variable name="charlength">
1948 <xsl:apply-templates select="*[position()=1]" mode="charcount"/>
1949 <!-- <xsl:apply-templates select="." mode="charcount"/> -->
1951 <!-- <xsl:value-of select="$charlength"/> -->
1952 <!-- <xsl:value-of select="$current_indent"/> -->
1954 <xsl:when test="$charlength > $framewidth">
1956 <xsl:call-template name="mksymbol-1">
1957 <xsl:with-param name="symbol" select="'lambda'"/>
1958 <xsl:with-param name="color" select="'red'"/>
1959 <xsl:with-param name="size" select="'+2'"/>
1960 </xsl:call-template>
1961 <xsl:apply-templates select="m:bvar/m:ci"/>
1962 <xsl:text>:</xsl:text>
1963 <xsl:apply-templates select="m:bvar/m:type">
1964 <xsl:with-param name="current_indent"
1965 select="$current_indent + 4 + 2*string-length(m:bvar/m:ci)"/>
1966 </xsl:apply-templates><br/>
1967 <xsl:call-template name="make_indent">
1968 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1969 </xsl:call-template>
1970 <xsl:text>.</xsl:text>
1971 <xsl:apply-templates select="*[position()=2]">
1972 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1973 </xsl:apply-templates>
1976 <xsl:apply-templates mode="inline" select="."/>
1982 <xsl:template match="m:ci">
1984 <xsl:when test="boolean(@definitionURL)">
1985 <a href="{@definitionURL}">
1986 <xsl:apply-templates/>
1990 <xsl:value-of select="."/>
1995 <!-- CHAR COUNTING -->
1997 <!-- enter this counting mode selecting the root -->
1998 <xsl:template match="*" mode="root_charcount">
1999 <xsl:param name="incurrent_length" select="0"/>
2001 <xsl:when test="count(*)=0">
2002 <xsl:value-of select="0"/>
2004 <xsl:when test="name()='m:ci'">
2005 <xsl:value-of select="string-length()"/>
2008 <xsl:apply-templates select="*[1]" mode="charcount">
2009 <xsl:with-param name="incurrent_length" select="$incurrent_length"/>
2010 </xsl:apply-templates>
2015 <!-- enter this mode selecting the first child -->
2017 <xsl:template match="m:ci|m:csymbol" mode="charcount">
2018 <xsl:param name="incurrent_length" select="0"/>
2020 <xsl:when test="$framewidth >= ($incurrent_length + string-length())">
2021 <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>
2023 <xsl:when test="string($siblength) = """>
2024 <xsl:value-of select="$incurrent_length + string-length()"/>
2027 <xsl:value-of select="number($siblength)"/>
2032 <xsl:value-of select="$incurrent_length + string-length()"/>
2037 <xsl:template match="*" mode="charcount">
2038 <xsl:param name="incurrent_length" select="0"/>
2040 <xsl:when test="count(child::*) = 0">
2041 <xsl:value-of select="$incurrent_length"/>
2044 <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>
2046 <xsl:when test="$framewidth >= number($childlength)">
2047 <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>
2049 <xsl:when test="string($siblength) = """>
2050 <xsl:value-of select="number($childlength)"/>
2053 <xsl:value-of select="number($siblength)"/>
2058 <xsl:value-of select="number($childlength)"/>
2066 <!--***********************************************************************-->
2068 <!--***********************************************************************-->
2072 <xsl:template match="Definition">
2073 <xsl:param name="current_indent" select="0"/>
2075 DEFINITION <xsl:value-of select="@name"/>(<xsl:if test="string(./Params) != """><xsl:value-of select="Params"/></xsl:if>)<br/>
2077 <xsl:call-template name="make_indent">
2078 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
2079 </xsl:call-template>
2080 <xsl:apply-templates select="type/*[1]">
2081 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
2082 </xsl:apply-templates><br/>
2084 <xsl:call-template name="make_indent">
2085 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
2086 </xsl:call-template>
2087 <xsl:apply-templates select="body/*[1]">
2088 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
2089 </xsl:apply-templates>
2095 <xsl:template match="Axiom">
2096 <xsl:param name="current_indent" select="0"/>
2098 AXIOM <xsl:value-of select="@name"/>(<xsl:if test="string(./Params) != """><xsl:value-of select="Params"/></xsl:if>)<br/>
2100 <xsl:call-template name="make_indent">
2101 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
2102 </xsl:call-template>
2103 <xsl:apply-templates select="type/*[1]">
2104 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
2105 </xsl:apply-templates>
2109 <!-- UNFINISHED PROOF -->
2111 <xsl:template match="CurrentProof">
2112 <xsl:param name="current_indent" select="0"/>
2114 UNFINISHED PROOF <xsl:value-of select="@name"/>(<xsl:if test="string(./Params) != """><xsl:value-of select="Params"/></xsl:if>)<br/>
2115 THESIS: <xsl:apply-templates select="type/*[1]">
2116 <xsl:with-param name="current_indent" select="$current_indent + 8"/>
2117 </xsl:apply-templates><br/>
2119 <xsl:for-each select="Conjecture">
2121 <xsl:call-template name="make_indent">
2122 <xsl:with-param name="current_indent" select="$current_indent + 8"/>
2123 </xsl:call-template>
2124 <xsl:for-each select="Decl|Def|Hidden">
2126 <xsl:when test="name(.)='Decl'">
2128 <xsl:when test="@name">
2129 <xsl:value-of select="@name"/>
2132 <xsl:text>_</xsl:text>
2135 <xsl:text> : </xsl:text>
2136 <xsl:apply-templates select="./*[1]">
2137 <xsl:with-param name="current_indent" select="$current_indent"/>
2138 </xsl:apply-templates>
2140 <xsl:when test="name(.)='Def'">
2142 <xsl:when test="@name">
2143 <xsl:value-of select="@name"/>
2146 <xsl:text>_</xsl:text>
2149 <xsl:text> := </xsl:text>
2150 <xsl:apply-templates select="./*[1]">
2151 <xsl:with-param name="current_indent" select="$current_indent"/>
2152 </xsl:apply-templates>
2155 <xsl:text> _ :? _ </xsl:text>
2159 |- <xsl:value-of select="./@no"/> :
2160 <xsl:apply-templates select="./Goal/*[1]">
2161 <xsl:with-param name="current_indent" select="$current_indent + 11"/>
2162 </xsl:apply-templates>
2166 <xsl:apply-templates select="body/*[1]">
2167 <xsl:with-param name="current_indent" select="$current_indent + 8"/>
2168 </xsl:apply-templates>
2172 <!-- MUTUAL INDUCTIVE DEFINITION -->
2174 <xsl:template match="InductiveDefinition">
2175 <xsl:param name="current_indent" select="0"/>
2177 <xsl:for-each select="InductiveType">
2179 <xsl:when test="position() = 1">
2181 <xsl:when test="string(./@inductive) = "true"">
2182 INDUCTIVE DEFINITION
2185 COINDUCTIVE DEFINITION
2193 <xsl:value-of select="./@name"/>(<xsl:if test="string(../Params) != """><xsl:value-of select="../Params"/></xsl:if>)
2195 <xsl:if test="string(../Param) != """>
2196 <xsl:for-each select="../Param">
2197 <xsl:value-of select="./@name"/>
2199 <xsl:apply-templates select="*"/>
2204 <xsl:apply-templates select="./arity/*[1]">
2205 <xsl:with-param name="current_indent" select="$current_indent + 9"/>
2206 </xsl:apply-templates> <br/>
2208 <xsl:for-each select="./Constructor">
2210 <xsl:call-template name="make_indent">
2211 <xsl:with-param name="current_indent" select="$current_indent + 3"/>
2212 </xsl:call-template>
2214 <xsl:when test="position() = 1">
2215 <xsl:text>  </xsl:text>
2218 <xsl:text>| </xsl:text>
2221 <xsl:value-of select="./@name"/>
2222 <xsl:text>: </xsl:text>
2223 <xsl:apply-templates select="./*[1]">
2224 <xsl:with-param name="current_indent" select="$current_indent + 2*string-length(./@name) + 5"/>
2225 </xsl:apply-templates>
2233 <xsl:template match="Variable">
2234 <xsl:param name="current_indent" select="0"/>
2236 VARIABLE <xsl:value-of select="@name"/><br/>
2237 TYPE = <xsl:apply-templates select="type/*[1]">
2238 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
2239 </xsl:apply-templates>
2240 <xsl:if test="body">
2242 BODY = <xsl:apply-templates select="body/*[1]">
2243 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
2244 </xsl:apply-templates>
2249 <!--***********************************************************************-->
2251 <!--***********************************************************************-->
2255 <xsl:template match="SECTION">
2256 <xsl:param name="current_indent" select="0"/>
2257 <h1>BEGIN OF SECTION</h1>
2258 <xsl:apply-templates/>
2259 <h1>END OF SECTION</h1>