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="m:piecewise/m: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]"/>
416 <FONT color="red"> which is equivalent to </FONT>
417 <xsl:apply-templates mode="inline" select="*[position()=4]"/>
421 <xsl:when test="$name='letin1'">
422 <xsl:text>letin1 (inline error)</xsl:text>
425 <xsl:when test="$name='false_ind'">
426 <xsl:apply-templates mode="inline" select="*[3]"/>
427 <FONT color="red">Contradiction.</FONT>
430 <xsl:when test="$name='and_ind'">
431 <FONT color="red">From </FONT>
432 <xsl:apply-templates select="*[2]"/>
433 <FONT color="red"> we get</FONT>
435 <xsl:apply-templates select="*[3]"/>
437 <xsl:apply-templates mode="inline" select="*[4]"/>
438 <FONT color="red"> and </FONT>
440 <xsl:apply-templates select="*[5]"/>
442 <xsl:apply-templates mode="inline" select="*[6]"/>
444 <FONT color="red"> hence </FONT>
445 <xsl:apply-templates mode="inline" select="*[7]"/>
448 <xsl:when test="$name='subst'">
449 <xsl:apply-templates select="*[3]" mode="inline"/>
450 <xsl:text>[</xsl:text>
451 <xsl:apply-templates select="*[4]" mode="inline"/>
453 <xsl:when test="$uri != ''">
455 <xsl:call-template name="mksymbol-1">
456 <xsl:with-param name="symbol" select="$name"/>
457 <xsl:with-param name="color" select="'green'"/>
458 <xsl:with-param name="size" select="'+0'"/>
463 <xsl:call-template name="mksymbol-1">
464 <xsl:with-param name="symbol" select="$name"/>
465 <xsl:with-param name="color" select="'green'"/>
466 <xsl:with-param name="size" select="'+0'"/>
470 <xsl:apply-templates select="*[2]" mode="inline"/>
471 <xsl:text>]</xsl:text>
474 <xsl:when test="$name='lift_with_base'">
476 <xsl:apply-templates select="*[3]" mode="inline"/>
479 <xsl:when test="$uri != ''">
481 <xsl:call-template name="mksymbol-1">
482 <xsl:with-param name="symbol" select="$name"/>
483 <xsl:with-param name="color" select="'green'"/>
484 <xsl:with-param name="size" select="'+0'"/>
489 <xsl:call-template name="mksymbol-1">
490 <xsl:with-param name="symbol" select="$name"/>
491 <xsl:with-param name="color" select="'green'"/>
492 <xsl:with-param name="size" select="'+0'"/>
497 <xsl:apply-templates select="*[4]" mode="inline"/>
499 <xsl:text>(</xsl:text>
500 <xsl:apply-templates select="*[2]" mode="inline"/>
501 <xsl:text>)</xsl:text>
504 <xsl:when test="$name='lift'">
506 <xsl:when test="$uri != ''">
508 <xsl:call-template name="mksymbol-1">
509 <xsl:with-param name="symbol" select="$name"/>
510 <xsl:with-param name="color" select="'green'"/>
511 <xsl:with-param name="size" select="'+0'"/>
516 <xsl:call-template name="mksymbol-1">
517 <xsl:with-param name="symbol" select="$name"/>
518 <xsl:with-param name="color" select="'green'"/>
519 <xsl:with-param name="size" select="'+0'"/>
524 <xsl:apply-templates select="*[2]" mode="inline"/>
526 <xsl:text>(</xsl:text>
527 <xsl:apply-templates select="*[3]" mode="inline"/>
528 <xsl:text>)</xsl:text>
532 <xsl:when test="$name='beta_red1'">
533 <xsl:apply-templates select="*[2]" mode="inline"/>
535 <xsl:when test="$uri != ''">
537 <xsl:call-template name="mksymbol-1">
538 <xsl:with-param name="symbol" select="$name"/>
539 <xsl:with-param name="color" select="'green'"/>
540 <xsl:with-param name="size" select="'+0'"/>
543 <xsl:call-template name="mksymbol-1">
544 <xsl:with-param name="symbol" select="'beta'"/>
545 <xsl:with-param name="color" select="'green'"/>
546 <xsl:with-param name="size" select="'+0'"/>
552 <xsl:call-template name="mksymbol-1">
553 <xsl:with-param name="symbol" select="$name"/>
554 <xsl:with-param name="color" select="'green'"/>
555 <xsl:with-param name="size" select="'+0'"/>
558 <xsl:call-template name="mksymbol-1">
559 <xsl:with-param name="symbol" select="'beta'"/>
560 <xsl:with-param name="color" select="'green'"/>
561 <xsl:with-param name="size" select="'+0'"/>
566 <xsl:apply-templates select="*[3]" mode="inline"/>
569 <xsl:when test="$name='beta_red'">
570 <xsl:apply-templates select="*[2]" mode="inline"/>
572 <xsl:when test="$uri != ''">
574 <xsl:call-template name="mksymbol-1">
575 <xsl:with-param name="symbol" select="$name"/>
576 <xsl:with-param name="color" select="'green'"/>
577 <xsl:with-param name="size" select="'+0'"/>
580 <xsl:call-template name="mksymbol-1">
581 <xsl:with-param name="symbol" select="'beta'"/>
582 <xsl:with-param name="color" select="'green'"/>
583 <xsl:with-param name="size" select="'+0'"/>
585 <xsl:text>*</xsl:text>
590 <xsl:call-template name="mksymbol-1">
591 <xsl:with-param name="symbol" select="$name"/>
592 <xsl:with-param name="color" select="'green'"/>
593 <xsl:with-param name="size" select="'+0'"/>
596 <xsl:call-template name="mksymbol-1">
597 <xsl:with-param name="symbol" select="'beta'"/>
598 <xsl:with-param name="color" select="'green'"/>
599 <xsl:with-param name="size" select="'+0'"/>
601 <xsl:text>*</xsl:text>
605 <xsl:apply-templates select="*[3]" mode="inline"/>
608 <xsl:when test="$name='par_beta_red1'">
609 <xsl:apply-templates select="*[2]" mode="inline"/>
611 <xsl:when test="$uri != ''">
613 <xsl:call-template name="mksymbol-1">
614 <xsl:with-param name="symbol" select="$name"/>
615 <xsl:with-param name="color" select="'green'"/>
616 <xsl:with-param name="size" select="'+0'"/>
619 <xsl:call-template name="mksymbol-1">
620 <xsl:with-param name="symbol" select="'beta'"/>
621 <xsl:with-param name="color" select="'green'"/>
622 <xsl:with-param name="size" select="'+0'"/>
628 <xsl:call-template name="mksymbol-1">
629 <xsl:with-param name="symbol" select="$name"/>
630 <xsl:with-param name="color" select="'green'"/>
631 <xsl:with-param name="size" select="'+0'"/>
634 <xsl:call-template name="mksymbol-1">
635 <xsl:with-param name="symbol" select="'beta'"/>
636 <xsl:with-param name="color" select="'green'"/>
637 <xsl:with-param name="size" select="'+0'"/>
642 <xsl:apply-templates select="*[3]" mode="inline"/>
645 <xsl:when test="$name='par_beta_red'">
646 <xsl:apply-templates select="*[2]" mode="inline"/>
648 <xsl:when test="$uri != ''">
650 <xsl:call-template name="mksymbol-1">
651 <xsl:with-param name="symbol" select="$name"/>
652 <xsl:with-param name="color" select="'green'"/>
653 <xsl:with-param name="size" select="'+0'"/>
656 <xsl:call-template name="mksymbol-1">
657 <xsl:with-param name="symbol" select="'beta'"/>
658 <xsl:with-param name="color" select="'green'"/>
659 <xsl:with-param name="size" select="'+0'"/>
661 <xsl:text>*</xsl:text>
666 <xsl:call-template name="mksymbol-1">
667 <xsl:with-param name="symbol" select="$name"/>
668 <xsl:with-param name="color" select="'green'"/>
669 <xsl:with-param name="size" select="'+0'"/>
672 <xsl:call-template name="mksymbol-1">
673 <xsl:with-param name="symbol" select="'beta'"/>
674 <xsl:with-param name="color" select="'green'"/>
675 <xsl:with-param name="size" select="'+0'"/>
677 <xsl:text>*</xsl:text>
681 <xsl:apply-templates select="*[3]" mode="inline"/>
685 <xsl:when test="$name='forgetful'">
687 <xsl:when test="$uri != ''">
688 <a href="{$uri}">|</a>
694 <xsl:apply-templates select="*[2]" mode="inline"/>
696 <xsl:when test="$uri != ''">
697 <a href="{$uri}">|</a>
705 <!-- boolean algebra of redexes -->
708 <xsl:when test="$name='isomorphic'">
709 <xsl:apply-templates select="*[2]" mode="inline"/>
711 <xsl:when test="$uri != ''">
713 <xsl:call-template name="mksymbol-1">
714 <xsl:with-param name="symbol" select="$name"/>
715 <xsl:with-param name="color" select="'green'"/>
716 <xsl:with-param name="size" select="'+0'"/>
721 <xsl:call-template name="mksymbol-1">
722 <xsl:with-param name="symbol" select="$name"/>
723 <xsl:with-param name="color" select="'green'"/>
724 <xsl:with-param name="size" select="'+0'"/>
728 <xsl:apply-templates select="*[3]" mode="inline"/>
732 <xsl:when test="$name='interp'">
733 <font color="green">[</font>
734 <xsl:apply-templates select="*[2]"/>
735 <font color="green">]</font>
741 <xsl:template mode="inline" match="m:lambda">
742 <xsl:call-template name="mksymbol-1">
743 <xsl:with-param name="symbol" select="'lambda'"/>
744 <xsl:with-param name="color" select="'red'"/>
745 <xsl:with-param name="size" select="'+2'"/>
747 <xsl:apply-templates select="m:bvar/m:ci"/>
748 <xsl:text>:</xsl:text>
749 <xsl:apply-templates mode="inline" select="m:bvar/m:type"/>
750 <xsl:text>.</xsl:text>
751 <xsl:apply-templates mode="inline" select="*[position()=2]"/>
754 <!--*********************************************************************-->
755 <!-- COUNTING MODE -->
756 <!--*********************************************************************-->
758 <xsl:template match="m:apply[m:csymbol]">
759 <xsl:param name="current_indent" select="0"/>
760 <xsl:param name="width" select="$framewidth"/>
761 <xsl:variable name="name">
762 <xsl:value-of select="m:csymbol"/>
764 <xsl:variable name="charlength">
765 <xsl:apply-templates select="m:csymbol" mode="charcount"/>
767 <!-- <xsl:value-of select="$current_indent"/> -->
768 <!-- <xsl:value-of select="$charlength"/> -->
769 <xsl:variable name="uri"><xsl:value-of select="*[1]/@definitionURL"/></xsl:variable>
772 <xsl:when test="$name='forall'">
774 <xsl:when test="$charlength > $framewidth">
776 <xsl:call-template name="mksymbol-1">
777 <xsl:with-param name="symbol" select="$name"/>
778 <xsl:with-param name="color" select="'blue'"/>
779 <xsl:with-param name="size" select="'+2'"/>
781 <xsl:apply-templates select="m:bvar/m:ci"/>
782 <xsl:text>:</xsl:text>
783 <xsl:apply-templates select="m:bvar/m:type">
784 <xsl:with-param name="current_indent"
785 select="$current_indent + 5 + 2*string-length(m:bvar/m:ci)"/>
786 </xsl:apply-templates>
788 <xsl:call-template name="make_indent">
789 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
791 <xsl:text>.</xsl:text>
792 <xsl:apply-templates select="*[position()=3]">
793 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
794 </xsl:apply-templates>
797 <xsl:apply-templates mode="inline" select="."/>
802 <xsl:when test="$name='prod'">
804 <xsl:when test="$charlength > $framewidth">
805 <xsl:call-template name="mksymbol-1">
806 <xsl:with-param name="symbol" select="$name"/>
807 <xsl:with-param name="color" select="'blue'"/>
808 <xsl:with-param name="size" select="'+2'"/>
810 <xsl:apply-templates select="m:bvar/m:ci"/>
811 <xsl:text>:</xsl:text>
812 <xsl:apply-templates select="m:bvar/m:type">
813 <xsl:with-param name="current_indent"
814 select="$current_indent + 5 + 2*string-length(m:bvar/m:ci)"/>
815 </xsl:apply-templates><br/>
816 <xsl:call-template name="make_indent">
817 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
819 <xsl:text>.</xsl:text>
820 <xsl:apply-templates select="*[position()=3]">
821 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
822 </xsl:apply-templates>
825 <xsl:apply-templates mode="inline" select="."/>
830 <xsl:when test="$name='arrow'">
832 <xsl:when test="$charlength > $framewidth">
833 <xsl:text>(</xsl:text>
834 <xsl:apply-templates select="*[position()=2]">
835 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
836 </xsl:apply-templates>
838 <xsl:call-template name="make_indent">
839 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
842 <xsl:call-template name="mksymbol-1">
843 <xsl:with-param name="symbol" select="$name"/>
844 <xsl:with-param name="color" select="'blue'"/>
845 <xsl:with-param name="size" select="'+0'"/>
847 <xsl:apply-templates select="*[position()=3]">
848 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
849 </xsl:apply-templates>
850 <xsl:text>)</xsl:text>
853 <xsl:apply-templates mode="inline" select="."/>
858 <xsl:when test="$name='app'">
860 <xsl:when test="$charlength > $framewidth">
861 <xsl:text>(</xsl:text>
862 <xsl:apply-templates select="*[position()=2]">
863 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
864 </xsl:apply-templates>
865 <xsl:for-each select="*[position()>2]">
867 <xsl:call-template name="make_indent">
868 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
870 <xsl:apply-templates select=".">
871 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
872 </xsl:apply-templates>
874 <xsl:text>)</xsl:text>
877 <xsl:apply-templates mode="inline" select="."/>
881 <xsl:when test="$name='cast'">
883 <xsl:when test="$showcast = 1">
885 <xsl:when test="$charlength > $framewidth">
886 <xsl:text>(</xsl:text>
887 <xsl:apply-templates select="*[position()=2]">
888 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
889 </xsl:apply-templates><br/>
890 <xsl:call-template name="make_indent">
891 <xsl:with-param name="current_indent" select="$current_indent + 2"/> </xsl:call-template>
892 <xsl:text>:></xsl:text>
893 <xsl:apply-templates select="*[position()=3]">
894 <xsl:with-param name="current_indent" select="$current_indent + 3"/>
895 </xsl:apply-templates>
896 <xsl:text>)</xsl:text>
899 <xsl:apply-templates mode="inline" select="."/>
904 <xsl:apply-templates select="*[position()=2]">
905 <xsl:with-param name="current_indent" select="$current_indent"/>
906 </xsl:apply-templates>
910 <xsl:when test="$name='Prop'">
911 <xsl:text>Prop</xsl:text>
913 <xsl:when test="$name='Set'">
914 <xsl:text>Set</xsl:text>
916 <xsl:when test="$name='Type'">
917 <xsl:text>Type</xsl:text>
919 <xsl:when test="$name='mutcase'">
921 <xsl:when test="$charlength > $framewidth">
922 <xsl:text><</xsl:text>
923 <xsl:apply-templates select="*[position()=2]">
924 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
925 </xsl:apply-templates>
926 <xsl:text>> </xsl:text>
928 <xsl:call-template name="make_indent">
929 <xsl:with-param name="current_indent" select="$current_indent + 2"/> </xsl:call-template>
930 <xsl:text>CASE </xsl:text>
931 <xsl:apply-templates select="*[position()=3]">
932 <xsl:with-param name="current_indent" select="$current_indent + 8"/>
933 </xsl:apply-templates>
934 <xsl:text> OF </xsl:text>
935 <xsl:for-each select="m:piecewise/m:piece">
936 <!-- <xsl:for-each select="*[position() mod 2 = 0 and position()>3]">-->
938 <xsl:call-template name="make_indent">
939 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
942 <xsl:when test="position() = 1">
943 <xsl:text>  </xsl:text>
946 <xsl:text>| </xsl:text>
949 <xsl:apply-templates select="./*[2]"/>
950 <xsl:call-template name="mksymbol-1">
951 <xsl:with-param name="symbol" select="'RightArrow'"/>
952 <xsl:with-param name="color" select="'green'"/>
953 <xsl:with-param name="size" select="'+0'"/>
955 <xsl:variable name="body_size">
957 select="./*[1]/*[1]" mode="charcount"/>
960 <xsl:when test="$body_size > $framewidth">
962 <xsl:call-template name="make_indent">
963 <xsl:with-param name="current_indent"
964 select="$current_indent + 8"/>
968 <xsl:with-param name="current_indent"
969 select="$current_indent + 8"/>
970 </xsl:apply-templates>
973 <xsl:apply-templates select="./*[1]"
980 <xsl:apply-templates mode="inline" select="."/>
985 <xsl:when test="$name='fix'">
987 <xsl:when test="$charlength > $framewidth">
988 <xsl:text>FIX</xsl:text>
989 <xsl:value-of select="m:ci"/>
990 <xsl:text>{</xsl:text>
991 <xsl:for-each select="m:bvar">
993 <xsl:call-template name="make_indent">
994 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
996 <xsl:value-of select="m:ci"/>
997 <xsl:text>:</xsl:text>
998 <xsl:apply-templates select="m:type">
999 <xsl:with-param name="current_indent"
1000 select="$current_indent + 5 + string-length(m:ci)"/>
1001 </xsl:apply-templates>
1003 <xsl:call-template name="make_indent">
1004 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1005 </xsl:call-template>
1006 <xsl:text>:=</xsl:text>
1007 <xsl:apply-templates select="following-sibling::*[position() = 1]">
1008 <xsl:with-param name="current_indent" select="$current_indent +2"/>
1009 </xsl:apply-templates>
1012 <xsl:call-template name="make_indent">
1013 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1014 </xsl:call-template>
1015 <xsl:text>}</xsl:text>
1018 <xsl:apply-templates mode="inline" select="."/>
1023 <xsl:when test="$name='cofix'">
1025 <xsl:when test="($charlength + 10) > $framewidth">
1026 <xsl:text>COFIX</xsl:text>
1027 <xsl:value-of select="m:ci"/>
1028 <xsl:text>{</xsl:text>
1030 <xsl:call-template name="make_indent">
1031 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1032 </xsl:call-template>
1033 <xsl:for-each select="m:bvar">
1034 <xsl:value-of select="m:ci"/>
1035 <xsl:text>:</xsl:text>
1036 <xsl:apply-templates select="m:type">
1037 <xsl:with-param name="current_indent"
1038 select="$current_indent + 5 + string-length(m:ci)"/>
1039 </xsl:apply-templates>
1041 <xsl:call-template name="make_indent">
1042 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1043 </xsl:call-template>
1044 <xsl:text>:=</xsl:text>
1045 <xsl:apply-templates select="following-sibling::*[position() = 1]">
1046 <xsl:with-param name="current_indent" select="$current_indent + 3"/>
1047 </xsl:apply-templates>
1051 <xsl:call-template name="make_indent">
1052 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1053 </xsl:call-template>
1054 <xsl:text>}</xsl:text>
1057 <xsl:apply-templates mode="inline" select="m:type"/>
1061 <xsl:when test="$name='let_in'">
1062 <xsl:text>let </xsl:text>
1063 <xsl:apply-templates select="m:bvar/m:ci"/>
1064 <xsl:text> := </xsl:text>
1065 <xsl:apply-templates select="*[3]">
1066 <xsl:with-param name="current_indent" select="$current_indent+14"/>
1067 </xsl:apply-templates>
1069 <xsl:call-template name="make_indent">
1070 <xsl:with-param name="current_indent" select="$current_indent"/>
1071 </xsl:call-template>
1072 <xsl:text>in </xsl:text>
1073 <xsl:apply-templates select="*[4]">
1074 <xsl:with-param name="current_indent" select="$current_indent+5"/>
1075 </xsl:apply-templates>
1078 <!-- ***************************************** -->
1079 <!-- *********** PROOF ELEMENTS ************** -->
1080 <!-- ***************************************** -->
1082 <xsl:when test="$name='proof'">
1083 <xsl:variable name="nonce" select="generate-id()"/>
1084 <xsl:variable name="freshid1" select="concat('a',$nonce)"/>
1085 <xsl:variable name="freshid2" select="concat('b',$nonce)"/>
1086 <xsl:variable name="freshid3" select="concat('c',$nonce)"/>
1087 <span ID="{$freshid1}">
1088 <xsl:apply-templates select="*[position()=2]">
1089 <xsl:with-param name="current_indent" select="$current_indent"/>
1090 </xsl:apply-templates>
1094 <xsl:when test="(preceding-sibling::*[1]/text()='letin1') or
1095 (preceding-sibling::*[1]/text()='rw_step') or
1096 (name(..)='m:lambda')">
1098 <xsl:call-template name="make_indent">
1099 <xsl:with-param name="current_indent" select="$current_indent"/>
1100 </xsl:call-template>
1101 <FONT color="red">we proved </FONT>
1105 if(document.getElementById) {
1107 <span ID="{$freshid2}">\
1108 <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>\
1110 <span ID="{$freshid3}">\
1112 <xsl:call-template name="make_indent">
1113 <xsl:with-param name="current_indent" select="$current_indent"/>
1114 </xsl:call-template>\
1115 <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>\
1118 document.to_be_deleted.push('<xsl:value-of select="$freshid1"/>');
1119 document.to_be_deleted.push('<xsl:value-of select="$freshid3"/>');
1120 document.write(' ');
1124 <xsl:call-template name="make_indent">
1125 <xsl:with-param name="current_indent" select="$current_indent"/>
1126 </xsl:call-template>\
1127 <FONT color="red">we proved </FONT>\
1133 <xsl:apply-templates select="*[position()=3]">
1134 <xsl:with-param name="current_indent" select="$current_indent + 16"/>
1135 </xsl:apply-templates>
1138 <xsl:when test="$name='side_proof'">
1139 <xsl:variable name="nonce" select="generate-id()"/>
1140 <xsl:variable name="freshid1" select="concat('a',$nonce)"/>
1141 <xsl:variable name="freshid2" select="concat('b',$nonce)"/>
1142 <xsl:variable name="freshid3" select="concat('c',$nonce)"/>
1143 <xsl:variable name="freshid4" select="concat('d',$nonce)"/>
1144 <span ID="{$freshid1}">
1145 <xsl:apply-templates select="*[position()=2]">
1146 <xsl:with-param name="current_indent" select="$current_indent"/>
1147 </xsl:apply-templates>
1151 if(document.getElementById) {
1153 <span ID="{$freshid2}">\
1154 <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>\
1156 <span ID="{$freshid3}">\
1158 <xsl:call-template name="make_indent">
1159 <xsl:with-param name="current_indent" select="$current_indent"/>
1160 </xsl:call-template>\
1161 <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>\
1164 document.to_be_deleted.push('<xsl:value-of select="$freshid1"/>');
1165 document.to_be_deleted.push('<xsl:value-of select="$freshid3"/>');
1166 document.to_be_deleted.push('<xsl:value-of select="$freshid4"/>');
1167 document.write(' ');
1171 <xsl:call-template name="make_indent">
1172 <xsl:with-param name="current_indent" select="$current_indent"/>
1173 </xsl:call-template>\
1174 <FONT color="red">we proved </FONT>\
1178 <span ID="{$freshid4}">
1179 <xsl:apply-templates select="*[position()=3]">
1180 <xsl:with-param name="current_indent" select="$current_indent + 16"/>
1181 </xsl:apply-templates>
1185 <xsl:when test="$name='eq_chain'">
1186 <FONT color="red">We have the following equality chain:</FONT>
1187 <xsl:for-each select="*[position() mod 2 = 0]">
1188 <xsl:variable name="pos" select="position()"/>
1190 <xsl:call-template name="make_indent">
1191 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
1192 </xsl:call-template>
1194 <xsl:when test="$pos=1">
1195 <xsl:apply-templates select=".">
1196 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
1197 </xsl:apply-templates>
1198 <xsl:text> =</xsl:text>
1201 <xsl:text>= </xsl:text>
1202 <xsl:apply-templates select=".">
1203 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
1204 </xsl:apply-templates>
1207 <xsl:if test="$pos != last()">
1209 <xsl:call-template name="make_indent">
1210 <xsl:with-param name="current_indent" select="$current_indent + 15"/>
1211 </xsl:call-template>
1212 <xsl:apply-templates select="../*[position()=2*$pos +1]">
1213 <xsl:with-param name="current_indent" select="$current_indent + 15"/>
1214 </xsl:apply-templates>
1218 <!-- diseq_chain -->
1219 <xsl:when test="$name='diseq_chain'">
1220 <FONT color="red">We have the following chain of disequalities:</FONT>
1221 <xsl:for-each select="*[position() mod 3 = 2]">
1222 <xsl:variable name="pos" select="position()"/>
1224 <xsl:call-template name="make_indent">
1225 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
1226 </xsl:call-template>
1228 <xsl:when test="$pos=1">
1229 <xsl:apply-templates select=".">
1230 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
1231 </xsl:apply-templates>
1232 <xsl:text> </xsl:text>
1233 <xsl:apply-templates mode="inline" select="../*[position()=3*$pos]"/>
1236 <xsl:apply-templates mode="inline" select="../*[position()=3*($pos - 1)]"/>
1237 <xsl:text> </xsl:text>
1238 <xsl:apply-templates select=".">
1239 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
1240 </xsl:apply-templates>
1243 <xsl:if test="$pos != last()">
1245 <xsl:call-template name="make_indent">
1246 <xsl:with-param name="current_indent" select="$current_indent + 15"/>
1247 </xsl:call-template>
1248 <xsl:apply-templates select="../*[position()=3*$pos +1]">
1249 <xsl:with-param name="current_indent" select="$current_indent + 15"/>
1250 </xsl:apply-templates>
1255 <xsl:when test="$name='letin1'">
1256 <xsl:apply-templates select="*[position()=2]">
1257 <xsl:with-param name="current_indent" select="$current_indent"/>
1258 </xsl:apply-templates>
1260 <xsl:call-template name="make_indent">
1261 <xsl:with-param name="current_indent" select="$current_indent"/>
1262 </xsl:call-template>
1263 <xsl:apply-templates select="*[position()=3]">
1264 <xsl:with-param name="current_indent" select="$current_indent"/>
1265 </xsl:apply-templates>
1268 <xsl:when test="$name='letin'">
1269 <xsl:for-each select="*[position()>1 and last()>position()]">
1270 <xsl:apply-templates select=".">
1271 <xsl:with-param name="current_indent" select="$current_indent"/>
1272 </xsl:apply-templates>
1274 <xsl:call-template name="make_indent">
1275 <xsl:with-param name="current_indent" select="$current_indent"/>
1276 </xsl:call-template>
1278 <xsl:apply-templates select="*[position()=last()]">
1279 <xsl:with-param name="current_indent" select="$current_indent"/>
1280 </xsl:apply-templates>
1283 <xsl:when test="$name='let'">
1285 <xsl:apply-templates select="m:ci"/>
1287 <xsl:apply-templates select="*[3]">
1288 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
1289 </xsl:apply-templates>
1292 <xsl:when test="$name='rw_step'">
1294 <xsl:when test="name(*[2])='m:apply'">
1295 <xsl:apply-templates select="*[2]">
1296 <xsl:with-param name="current_indent" select="$current_indent"/>
1297 </xsl:apply-templates>
1300 <FONT color="red">Consider </FONT>
1301 <xsl:apply-templates select="*[2]"/>
1304 <xsl:variable name="charlength_first">
1305 <xsl:apply-templates select="*[3]" mode="root_charcount"/>
1307 <xsl:variable name="charlength_second">
1308 <xsl:apply-templates select="*[4]" mode="root_charcount"/>
1310 <xsl:variable name="charlength_side_proof">
1311 <xsl:apply-templates select="*[5]" mode="root_charcount"/>
1313 <xsl:variable name="split1"
1314 select="($charlength_first + $charlength_second) > $framewidth"/>
1315 <xsl:variable name="split2"
1316 select="($charlength_second + $charlength_side_proof) > $framewidth"/>
1317 <!-- <xsl:value-of select="$current_indent"/> -->
1318 <!-- <xsl:value-of select="string($charlength_second)"/> -->
1319 <!-- <xsl:value-of select="$charlength_side_proof"/> -->
1320 <!-- <xsl:value-of select="$split2"/> -->
1322 <xsl:call-template name="make_indent">
1323 <xsl:with-param name="current_indent" select="$current_indent"/>
1324 </xsl:call-template>
1325 <FONT color="red">Rewrite </FONT>
1326 <xsl:apply-templates mode="inline" select="*[3]"/>
1327 <xsl:text> </xsl:text>
1328 <xsl:if test="$split1">
1330 <xsl:call-template name="make_indent">
1331 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1332 </xsl:call-template>
1334 <FONT color="red">with </FONT>
1335 <xsl:apply-templates mode="inline" select="*[4]"/>
1336 <xsl:text> </xsl:text>
1337 <xsl:if test="$split2">
1339 <xsl:call-template name="make_indent">
1340 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1341 </xsl:call-template>
1343 <FONT color="red">by </FONT>
1344 <xsl:apply-templates select="*[5]">
1345 <xsl:with-param name="current_indent" select="$current_indent+7"/>
1346 </xsl:apply-templates>
1348 <!-- rewrite and apply -->
1349 <xsl:when test="$name='rewrite_and_apply'">
1350 <xsl:apply-templates select="*[2]">
1351 <xsl:with-param name="current_indent" select="$current_indent"/>
1352 </xsl:apply-templates>
1354 <xsl:call-template name="make_indent">
1355 <xsl:with-param name="current_indent" select="$current_indent"/>
1356 </xsl:call-template>
1357 <FONT color="red">Then apply it to </FONT>
1358 <xsl:apply-templates select="*[position()>2]"/>
1360 <!-- by_induction -->
1361 <xsl:when test="$name='by_induction'">
1362 <FONT color="red">We prove </FONT>
1363 <xsl:apply-templates select="../*[3]">
1364 <xsl:with-param name="current_indent" select="$current_indent+18"/>
1365 </xsl:apply-templates>
1367 <xsl:call-template name="make_indent">
1368 <xsl:with-param name="current_indent" select="$current_indent"/>
1369 </xsl:call-template>
1370 <FONT color="red">by induction on </FONT>
1371 <xsl:apply-templates select="*[position()=last()]/*[position()=last()]">
1372 <xsl:with-param name="current_indent" select="$current_indent+30"/>
1373 </xsl:apply-templates>
1376 <xsl:call-template name="make_indent">
1377 <xsl:with-param name="current_indent" select="$current_indent"/>
1378 </xsl:call-template>
1379 <xsl:text>The induction property is</xsl:text>
1381 <xsl:call-template name="make_indent">
1382 <xsl:with-param name="current_indent" select="$current_indent"/>
1383 </xsl:call-template>
1384 <xsl:apply-templates select="*[3]">
1385 <xsl:with-param name="current_indent" select="$current_indent"/>
1386 </xsl:apply-templates>
1388 <xsl:apply-templates
1389 select="*[position()>3 and not(position()=last())]">
1390 <xsl:with-param name="current_indent" select="$current_indent+4"/>
1391 </xsl:apply-templates>
1393 <xsl:call-template name="make_indent">
1394 <xsl:with-param name="current_indent" select="$current_indent"/>
1395 </xsl:call-template>
1396 <xsl:text>End induction</xsl:text> -->
1398 <!-- inductive_case -->
1399 <xsl:when test="$name='inductive_case'">
1401 <xsl:call-template name="make_indent">
1402 <xsl:with-param name="current_indent" select="$current_indent"/>
1403 </xsl:call-template>
1404 <FONT color="red">Case </FONT>
1405 <xsl:apply-templates select="*[2]">
1406 <xsl:with-param name="current_indent" select="$current_indent +10"/>
1407 </xsl:apply-templates>
1408 <xsl:if test="*[3]/*[position()>1]">
1410 <xsl:call-template name="make_indent">
1411 <xsl:with-param name="current_indent" select="$current_indent+4"/>
1412 </xsl:call-template>
1413 <FONT color="red">By induction hypothesis, we have:</FONT>
1414 <xsl:for-each select="*[3]/*[position()>1]">
1416 <xsl:call-template name="make_indent">
1417 <xsl:with-param name="current_indent" select="$current_indent + 4"/>
1418 </xsl:call-template>
1419 <xsl:text>(</xsl:text>
1420 <xsl:apply-templates select="m:ci"/>
1421 <xsl:text>) </xsl:text>
1422 <xsl:apply-templates select="m:type">
1423 <xsl:with-param name="current_indent" select="$current_indent + 8"/>
1424 </xsl:apply-templates>
1428 <xsl:call-template name="make_indent">
1429 <xsl:with-param name="current_indent" select="$current_indent + 4"/>
1430 </xsl:call-template>
1431 <xsl:apply-templates select="*[4]">
1432 <xsl:with-param name="current_indent" select="$current_indent +4"/>
1433 </xsl:apply-templates>
1435 <xsl:call-template name="make_indent">
1436 <xsl:with-param name="current_indent" select="$current_indent"/>
1437 </xsl:call-template>
1438 <xsl:text>End Case</xsl:text> -->
1441 <xsl:when test="$name='case_lhs'">
1443 <xsl:when test="count(*)=2">
1444 <xsl:apply-templates mode="inline" select="*[2]"/>
1447 <xsl:text>(</xsl:text>
1448 <xsl:apply-templates mode="inline" select="*[2]"/>
1449 <xsl:for-each select="m:bvar">
1450 <xsl:text> </xsl:text>
1451 <xsl:apply-templates mode="inline" select="*[1]"/>
1452 <xsl:text>:</xsl:text>
1453 <xsl:apply-templates mode="inline" select="m:type/*[1]"/>
1455 <xsl:text>)</xsl:text>
1460 <xsl:when test="$name='false_ind'">
1461 <xsl:apply-templates select="*[3]">
1462 <xsl:with-param name="current_indent" select="$current_indent"/>
1463 </xsl:apply-templates>
1465 <xsl:call-template name="make_indent">
1466 <xsl:with-param name="current_indent" select="$current_indent"/>
1467 </xsl:call-template>
1468 <FONT color="red">Contradiction.</FONT>
1471 <xsl:when test="$name='and_ind'">
1473 <xsl:when test="name(*[2])='m:apply'">
1474 <xsl:apply-templates select="*[2]">
1475 <xsl:with-param name="current_indent" select="$current_indent"/>
1476 </xsl:apply-templates>
1479 <FONT color="red">Consider </FONT>
1480 <xsl:apply-templates select="*[2]"/>
1484 <xsl:call-template name="make_indent">
1485 <xsl:with-param name="current_indent" select="$current_indent"/>
1486 </xsl:call-template>
1487 <FONT color="red">In particular, we have</FONT>
1489 <xsl:call-template name="make_indent">
1490 <xsl:with-param name="current_indent" select="$current_indent"/>
1491 </xsl:call-template>
1493 <xsl:apply-templates select="*[3]"/>
1495 <xsl:apply-templates select="*[4]">
1496 <xsl:with-param name="current_indent" select="$current_indent + 9"/>
1497 </xsl:apply-templates>
1499 <xsl:call-template name="make_indent">
1500 <xsl:with-param name="current_indent" select="$current_indent"/>
1501 </xsl:call-template>
1503 <xsl:apply-templates select="*[5]"/>
1505 <xsl:apply-templates select="*[6]">
1506 <xsl:with-param name="current_indent" select="$current_indent + 9"/>
1507 </xsl:apply-templates>
1509 <xsl:call-template name="make_indent">
1510 <xsl:with-param name="current_indent" select="$current_indent"/>
1511 </xsl:call-template>
1512 <xsl:apply-templates select="*[7]">
1513 <xsl:with-param name="current_indent" select="$current_indent"/>
1514 </xsl:apply-templates>
1516 <!-- full_or_ind -->
1517 <xsl:when test="$name='full_or_ind'">
1519 <xsl:when test="name(*[2])='m:apply'">
1520 <xsl:apply-templates select="*[2]">
1521 <xsl:with-param name="current_indent" select="$current_indent"/>
1522 </xsl:apply-templates>
1525 <FONT color="red">Consider </FONT>
1526 <xsl:apply-templates select="*[2]"/>
1530 <xsl:call-template name="make_indent">
1531 <xsl:with-param name="current_indent" select="$current_indent"/>
1532 </xsl:call-template>
1533 <FONT color="red">We proceed by cases to prove </FONT>
1534 <xsl:apply-templates select="*[3]"/>
1536 <xsl:call-template name="make_indent">
1537 <xsl:with-param name="current_indent" select="$current_indent+4"/>
1538 </xsl:call-template>
1539 <FONT color="red">Left: suppose </FONT>
1540 <xsl:text>(</xsl:text>
1541 <xsl:value-of select="*[4]/m:bvar/m:ci"/>
1542 <xsl:text>) </xsl:text>
1543 <xsl:apply-templates
1544 select="*[4]/m:bvar/m:type/*[1]"/>
1546 <xsl:call-template name="make_indent">
1547 <xsl:with-param name="current_indent" select="$current_indent+15"/>
1548 </xsl:call-template>
1549 <xsl:apply-templates
1551 <xsl:with-param name="current_indent" select="$current_indent+15"/>
1552 </xsl:apply-templates>
1554 <xsl:call-template name="make_indent">
1555 <xsl:with-param name="current_indent" select="$current_indent+4"/>
1556 </xsl:call-template>
1557 <FONT color="red">Right: suppose </FONT>
1558 <xsl:text>(</xsl:text>
1559 <xsl:value-of select="*[5]/m:bvar/m:ci"/>
1560 <xsl:text>) </xsl:text>
1561 <xsl:apply-templates
1562 select="*[5]/m:bvar/m:type/*[1]"/>
1564 <xsl:call-template name="make_indent">
1565 <xsl:with-param name="current_indent" select="$current_indent+16"/>
1566 </xsl:call-template>
1567 <xsl:apply-templates
1569 <xsl:with-param name="current_indent" select="$current_indent+16"/>
1570 </xsl:apply-templates>
1573 <xsl:when test="$name='or_ind'">
1575 <xsl:when test="name(*[2])='m:apply'">
1576 <xsl:apply-templates select="*[2]">
1577 <xsl:with-param name="current_indent" select="$current_indent"/>
1578 </xsl:apply-templates>
1581 <FONT color="red">Consider </FONT>
1582 <xsl:apply-templates select="*[2]"/>
1586 <xsl:call-template name="make_indent">
1587 <xsl:with-param name="current_indent" select="$current_indent"/>
1588 </xsl:call-template>
1589 <FONT color="red">We prove </FONT>
1590 <xsl:apply-templates select="*[3]"/>
1591 <FONT color="red"> by cases:</FONT>
1593 <xsl:call-template name="make_indent">
1594 <xsl:with-param name="current_indent" select="$current_indent"/>
1595 </xsl:call-template>
1597 <xsl:apply-templates select="*[4]">
1598 <xsl:with-param name="current_indent" select="$current_indent"/>
1599 </xsl:apply-templates>
1601 <xsl:call-template name="make_indent">
1602 <xsl:with-param name="current_indent" select="$current_indent"/>
1603 </xsl:call-template>
1605 <xsl:apply-templates select="*[5]">
1606 <xsl:with-param name="current_indent" select="$current_indent"/>
1607 </xsl:apply-templates>
1610 <xsl:when test="$name='ex_ind'">
1612 <xsl:when test="name(*[2])='m:apply'">
1613 <xsl:apply-templates select="*[2]">
1614 <xsl:with-param name="current_indent" select="$current_indent"/>
1615 </xsl:apply-templates>
1618 <FONT color="red">Consider </FONT>
1619 <xsl:apply-templates select="*[2]">
1620 <xsl:with-param name="current_indent" select="$current_indent"/>
1621 </xsl:apply-templates>
1625 <xsl:call-template name="make_indent">
1626 <xsl:with-param name="current_indent" select="$current_indent"/>
1627 </xsl:call-template>
1628 <FONT color="red">Let </FONT>
1629 <xsl:apply-templates mode="inline" select="*[3]"/>
1631 <xsl:apply-templates mode="inline" select="*[4]"/>
1632 <FONT color="red"> such that</FONT>
1634 <xsl:call-template name="make_indent">
1635 <xsl:with-param name="current_indent" select="$current_indent"/>
1636 </xsl:call-template>
1638 <xsl:apply-templates mode="inline" select="*[5]"/>
1640 <xsl:apply-templates select="*[6]">
1641 <xsl:with-param name="current_indent" select="$current_indent +7"/>
1642 </xsl:apply-templates>
1644 <xsl:call-template name="make_indent">
1645 <xsl:with-param name="current_indent" select="$current_indent"/>
1646 </xsl:call-template>
1647 <xsl:apply-templates select="*[7]">
1648 <xsl:with-param name="current_indent" select="$current_indent"/>
1649 </xsl:apply-templates>
1651 <!-- ***************************************** -->
1652 <!-- *********** LAMBDA ELEMENTS ************** -->
1653 <!-- ***************************************** -->
1654 <xsl:when test="$name='subst'">
1655 <xsl:apply-templates select="*[3]"/>
1656 <xsl:text>[</xsl:text>
1657 <xsl:apply-templates select="*[4]"/>
1659 <xsl:when test="$uri != ''">
1661 <xsl:call-template name="mksymbol-1">
1662 <xsl:with-param name="symbol" select="$name"/>
1663 <xsl:with-param name="color" select="'blue'"/>
1664 <xsl:with-param name="size" select="'+0'"/>
1665 </xsl:call-template>
1669 <xsl:call-template name="mksymbol-1">
1670 <xsl:with-param name="symbol" select="$name"/>
1671 <xsl:with-param name="color" select="'blue'"/>
1672 <xsl:with-param name="size" select="'+0'"/>
1673 </xsl:call-template>
1676 <xsl:apply-templates select="*[2]"/>
1677 <xsl:text>]</xsl:text>
1680 <xsl:when test="$name='lift_with_base'">
1682 <xsl:apply-templates select="*[3]" mode="inline"/>
1685 <xsl:when test="$uri != ''">
1687 <xsl:call-template name="mksymbol-1">
1688 <xsl:with-param name="symbol" select="$name"/>
1689 <xsl:with-param name="color" select="'green'"/>
1690 <xsl:with-param name="size" select="'+0'"/>
1691 </xsl:call-template>
1695 <xsl:call-template name="mksymbol-1">
1696 <xsl:with-param name="symbol" select="$name"/>
1697 <xsl:with-param name="color" select="'green'"/>
1698 <xsl:with-param name="size" select="'+0'"/>
1699 </xsl:call-template>
1703 <xsl:apply-templates select="*[4]" mode="inline"/>
1705 <xsl:text>(</xsl:text>
1706 <xsl:apply-templates select="*[2]" mode="inline"/>
1707 <xsl:text>)</xsl:text>
1710 <xsl:when test="$name='lift'">
1712 <xsl:when test="$uri != ''">
1714 <xsl:call-template name="mksymbol-1">
1715 <xsl:with-param name="symbol" select="$name"/>
1716 <xsl:with-param name="color" select="'green'"/>
1717 <xsl:with-param name="size" select="'+0'"/>
1718 </xsl:call-template>
1722 <xsl:call-template name="mksymbol-1">
1723 <xsl:with-param name="symbol" select="$name"/>
1724 <xsl:with-param name="color" select="'green'"/>
1725 <xsl:with-param name="size" select="'+0'"/>
1726 </xsl:call-template>
1730 <xsl:apply-templates select="*[2]" mode="inline"/>
1732 <xsl:text>(</xsl:text>
1733 <xsl:apply-templates select="*[3]" mode="inline"/>
1734 <xsl:text>)</xsl:text>
1738 <xsl:when test="$name='beta_red1'">
1739 <xsl:apply-templates select="*[2]" mode="inline"/>
1741 <xsl:when test="$uri != ''">
1743 <xsl:call-template name="mksymbol-1">
1744 <xsl:with-param name="symbol" select="$name"/>
1745 <xsl:with-param name="color" select="'green'"/>
1746 <xsl:with-param name="size" select="'+0'"/>
1747 </xsl:call-template>
1749 <xsl:call-template name="mksymbol-1">
1750 <xsl:with-param name="symbol" select="'beta'"/>
1751 <xsl:with-param name="color" select="'green'"/>
1752 <xsl:with-param name="size" select="'+0'"/>
1753 </xsl:call-template>
1758 <xsl:call-template name="mksymbol-1">
1759 <xsl:with-param name="symbol" select="$name"/>
1760 <xsl:with-param name="color" select="'green'"/>
1761 <xsl:with-param name="size" select="'+0'"/>
1762 </xsl:call-template>
1764 <xsl:call-template name="mksymbol-1">
1765 <xsl:with-param name="symbol" select="'beta'"/>
1766 <xsl:with-param name="color" select="'green'"/>
1767 <xsl:with-param name="size" select="'+0'"/>
1768 </xsl:call-template>
1772 <xsl:apply-templates select="*[3]" mode="inline"/>
1775 <xsl:when test="$name='beta_red'">
1776 <xsl:apply-templates select="*[2]" mode="inline"/>
1778 <xsl:when test="$uri != ''">
1780 <xsl:call-template name="mksymbol-1">
1781 <xsl:with-param name="symbol" select="$name"/>
1782 <xsl:with-param name="color" select="'green'"/>
1783 <xsl:with-param name="size" select="'+0'"/>
1784 </xsl:call-template>
1786 <xsl:call-template name="mksymbol-1">
1787 <xsl:with-param name="symbol" select="'beta'"/>
1788 <xsl:with-param name="color" select="'green'"/>
1789 <xsl:with-param name="size" select="'+0'"/>
1790 </xsl:call-template>
1791 <xsl:text>*</xsl:text>
1796 <xsl:call-template name="mksymbol-1">
1797 <xsl:with-param name="symbol" select="$name"/>
1798 <xsl:with-param name="color" select="'green'"/>
1799 <xsl:with-param name="size" select="'+0'"/>
1800 </xsl:call-template>
1802 <xsl:call-template name="mksymbol-1">
1803 <xsl:with-param name="symbol" select="'beta'"/>
1804 <xsl:with-param name="color" select="'green'"/>
1805 <xsl:with-param name="size" select="'+0'"/>
1806 </xsl:call-template>
1807 <xsl:text>*</xsl:text>
1811 <xsl:apply-templates select="*[3]" mode="inline"/>
1814 <xsl:when test="$name='par_beta_red1'">
1815 <xsl:apply-templates select="*[2]" mode="inline"/>
1817 <xsl:when test="$uri != ''">
1819 <xsl:call-template name="mksymbol-1">
1820 <xsl:with-param name="symbol" select="$name"/>
1821 <xsl:with-param name="color" select="'green'"/>
1822 <xsl:with-param name="size" select="'+0'"/>
1823 </xsl:call-template>
1825 <xsl:call-template name="mksymbol-1">
1826 <xsl:with-param name="symbol" select="'beta'"/>
1827 <xsl:with-param name="color" select="'green'"/>
1828 <xsl:with-param name="size" select="'+0'"/>
1829 </xsl:call-template>
1834 <xsl:call-template name="mksymbol-1">
1835 <xsl:with-param name="symbol" select="$name"/>
1836 <xsl:with-param name="color" select="'green'"/>
1837 <xsl:with-param name="size" select="'+0'"/>
1838 </xsl:call-template>
1840 <xsl:call-template name="mksymbol-1">
1841 <xsl:with-param name="symbol" select="'beta'"/>
1842 <xsl:with-param name="color" select="'green'"/>
1843 <xsl:with-param name="size" select="'+0'"/>
1844 </xsl:call-template>
1848 <xsl:apply-templates select="*[3]" mode="inline"/>
1851 <xsl:when test="$name='par_beta_red'">
1852 <xsl:apply-templates select="*[2]" mode="inline"/>
1854 <xsl:when test="$uri != ''">
1856 <xsl:call-template name="mksymbol-1">
1857 <xsl:with-param name="symbol" select="$name"/>
1858 <xsl:with-param name="color" select="'green'"/>
1859 <xsl:with-param name="size" select="'+0'"/>
1860 </xsl:call-template>
1862 <xsl:call-template name="mksymbol-1">
1863 <xsl:with-param name="symbol" select="'beta'"/>
1864 <xsl:with-param name="color" select="'green'"/>
1865 <xsl:with-param name="size" select="'+0'"/>
1866 </xsl:call-template>
1867 <xsl:text>*</xsl:text>
1872 <xsl:call-template name="mksymbol-1">
1873 <xsl:with-param name="symbol" select="$name"/>
1874 <xsl:with-param name="color" select="'green'"/>
1875 <xsl:with-param name="size" select="'+0'"/>
1876 </xsl:call-template>
1878 <xsl:call-template name="mksymbol-1">
1879 <xsl:with-param name="symbol" select="'beta'"/>
1880 <xsl:with-param name="color" select="'green'"/>
1881 <xsl:with-param name="size" select="'+0'"/>
1882 </xsl:call-template>
1883 <xsl:text>*</xsl:text>
1887 <xsl:apply-templates select="*[3]" mode="inline"/>
1891 <xsl:when test="$name='forgetful'">
1893 <xsl:when test="$uri != ''">
1894 <a href="{$uri}">|</a>
1900 <xsl:apply-templates select="*[2]" mode="inline"/>
1902 <xsl:when test="$uri != ''">
1903 <a href="{$uri}">|</a>
1911 <!-- boolean algebra of redexes -->
1914 <xsl:when test="$name='isomorphic'">
1915 <xsl:apply-templates select="*[2]" mode="inline"/>
1917 <xsl:when test="$uri != ''">
1919 <xsl:call-template name="mksymbol-1">
1920 <xsl:with-param name="symbol" select="$name"/>
1921 <xsl:with-param name="color" select="'green'"/>
1922 <xsl:with-param name="size" select="'+0'"/>
1923 </xsl:call-template>
1927 <xsl:call-template name="mksymbol-1">
1928 <xsl:with-param name="symbol" select="$name"/>
1929 <xsl:with-param name="color" select="'green'"/>
1930 <xsl:with-param name="size" select="'+0'"/>
1931 </xsl:call-template>
1934 <xsl:apply-templates select="*[3]" mode="inline"/>
1938 <xsl:when test="$name='interp'">
1939 <font color="green">[</font>
1940 <xsl:apply-templates select="*[2]"/>
1941 <font color="green">]</font>
1949 <xsl:template match="m:lambda">
1950 <xsl:param name="current_indent" select="0"/>
1951 <xsl:variable name="charlength">
1952 <xsl:apply-templates select="*[position()=1]" mode="charcount"/>
1953 <!-- <xsl:apply-templates select="." mode="charcount"/> -->
1955 <!-- <xsl:value-of select="$charlength"/> -->
1956 <!-- <xsl:value-of select="$current_indent"/> -->
1958 <xsl:when test="$charlength > $framewidth">
1960 <xsl:call-template name="mksymbol-1">
1961 <xsl:with-param name="symbol" select="'lambda'"/>
1962 <xsl:with-param name="color" select="'red'"/>
1963 <xsl:with-param name="size" select="'+2'"/>
1964 </xsl:call-template>
1965 <xsl:apply-templates select="m:bvar/m:ci"/>
1966 <xsl:text>:</xsl:text>
1967 <xsl:apply-templates select="m:bvar/m:type">
1968 <xsl:with-param name="current_indent"
1969 select="$current_indent + 4 + 2*string-length(m:bvar/m:ci)"/>
1970 </xsl:apply-templates><br/>
1971 <xsl:call-template name="make_indent">
1972 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1973 </xsl:call-template>
1974 <xsl:text>.</xsl:text>
1975 <xsl:apply-templates select="*[position()=2]">
1976 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1977 </xsl:apply-templates>
1980 <xsl:apply-templates mode="inline" select="."/>
1986 <xsl:template match="m:ci">
1988 <xsl:when test="boolean(@definitionURL)">
1989 <a href="{@definitionURL}">
1990 <xsl:apply-templates/>
1994 <xsl:value-of select="."/>
1999 <!-- CHAR COUNTING -->
2001 <!-- enter this counting mode selecting the root -->
2002 <xsl:template match="*" mode="root_charcount">
2003 <xsl:param name="incurrent_length" select="0"/>
2005 <xsl:when test="count(*)=0">
2006 <xsl:value-of select="0"/>
2008 <xsl:when test="name()='m:ci'">
2009 <xsl:value-of select="string-length()"/>
2012 <xsl:apply-templates select="*[1]" mode="charcount">
2013 <xsl:with-param name="incurrent_length" select="$incurrent_length"/>
2014 </xsl:apply-templates>
2019 <!-- enter this mode selecting the first child -->
2021 <xsl:template match="m:ci|m:csymbol" mode="charcount">
2022 <xsl:param name="incurrent_length" select="0"/>
2024 <xsl:when test="$framewidth >= ($incurrent_length + string-length())">
2025 <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>
2027 <xsl:when test="string($siblength) = """>
2028 <xsl:value-of select="$incurrent_length + string-length()"/>
2031 <xsl:value-of select="number($siblength)"/>
2036 <xsl:value-of select="$incurrent_length + string-length()"/>
2041 <xsl:template match="*" mode="charcount">
2042 <xsl:param name="incurrent_length" select="0"/>
2044 <xsl:when test="count(child::*) = 0">
2045 <xsl:value-of select="$incurrent_length"/>
2048 <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>
2050 <xsl:when test="$framewidth >= number($childlength)">
2051 <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>
2053 <xsl:when test="string($siblength) = """>
2054 <xsl:value-of select="number($childlength)"/>
2057 <xsl:value-of select="number($siblength)"/>
2062 <xsl:value-of select="number($childlength)"/>
2070 <!--***********************************************************************-->
2072 <!--***********************************************************************-->
2076 <xsl:template match="Definition">
2077 <xsl:param name="current_indent" select="0"/>
2079 DEFINITION <xsl:value-of select="@name"/>(<xsl:if test="string(./Params) != """><xsl:value-of select="Params"/></xsl:if>)<br/>
2081 <xsl:call-template name="make_indent">
2082 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
2083 </xsl:call-template>
2084 <xsl:apply-templates select="type/*[1]">
2085 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
2086 </xsl:apply-templates><br/>
2088 <xsl:call-template name="make_indent">
2089 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
2090 </xsl:call-template>
2091 <xsl:apply-templates select="body/*[1]">
2092 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
2093 </xsl:apply-templates>
2099 <xsl:template match="Axiom">
2100 <xsl:param name="current_indent" select="0"/>
2102 AXIOM <xsl:value-of select="@name"/>(<xsl:if test="string(./Params) != """><xsl:value-of select="Params"/></xsl:if>)<br/>
2104 <xsl:call-template name="make_indent">
2105 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
2106 </xsl:call-template>
2107 <xsl:apply-templates select="type/*[1]">
2108 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
2109 </xsl:apply-templates>
2113 <!-- UNFINISHED PROOF -->
2115 <xsl:template match="CurrentProof">
2116 <xsl:param name="current_indent" select="0"/>
2118 UNFINISHED PROOF <xsl:value-of select="@name"/>(<xsl:if test="string(./Params) != """><xsl:value-of select="Params"/></xsl:if>)<br/>
2119 THESIS: <xsl:apply-templates select="type/*[1]">
2120 <xsl:with-param name="current_indent" select="$current_indent + 8"/>
2121 </xsl:apply-templates><br/>
2123 <xsl:for-each select="Conjecture">
2125 <xsl:call-template name="make_indent">
2126 <xsl:with-param name="current_indent" select="$current_indent + 8"/>
2127 </xsl:call-template>
2128 <xsl:for-each select="Decl|Def|Hidden">
2130 <xsl:when test="name(.)='Decl'">
2132 <xsl:when test="@name">
2133 <xsl:value-of select="@name"/>
2136 <xsl:text>_</xsl:text>
2139 <xsl:text> : </xsl:text>
2140 <xsl:apply-templates select="./*[1]">
2141 <xsl:with-param name="current_indent" select="$current_indent"/>
2142 </xsl:apply-templates>
2144 <xsl:when test="name(.)='Def'">
2146 <xsl:when test="@name">
2147 <xsl:value-of select="@name"/>
2150 <xsl:text>_</xsl:text>
2153 <xsl:text> := </xsl:text>
2154 <xsl:apply-templates select="./*[1]">
2155 <xsl:with-param name="current_indent" select="$current_indent"/>
2156 </xsl:apply-templates>
2159 <xsl:text> _ :? _ </xsl:text>
2163 |- <xsl:value-of select="./@no"/> :
2164 <xsl:apply-templates select="./Goal/*[1]">
2165 <xsl:with-param name="current_indent" select="$current_indent + 11"/>
2166 </xsl:apply-templates>
2170 <xsl:apply-templates select="body/*[1]">
2171 <xsl:with-param name="current_indent" select="$current_indent + 8"/>
2172 </xsl:apply-templates>
2176 <!-- MUTUAL INDUCTIVE DEFINITION -->
2178 <xsl:template match="InductiveDefinition">
2179 <xsl:param name="current_indent" select="0"/>
2181 <xsl:for-each select="InductiveType">
2183 <xsl:when test="position() = 1">
2185 <xsl:when test="string(./@inductive) = "true"">
2186 INDUCTIVE DEFINITION
2189 COINDUCTIVE DEFINITION
2197 <xsl:value-of select="./@name"/>(<xsl:if test="string(../Params) != """><xsl:value-of select="../Params"/></xsl:if>)
2199 <xsl:if test="string(../Param) != """>
2200 <xsl:for-each select="../Param">
2201 <xsl:value-of select="./@name"/>
2203 <xsl:apply-templates select="*"/>
2208 <xsl:apply-templates select="./arity/*[1]">
2209 <xsl:with-param name="current_indent" select="$current_indent + 9"/>
2210 </xsl:apply-templates> <br/>
2212 <xsl:for-each select="./Constructor">
2214 <xsl:call-template name="make_indent">
2215 <xsl:with-param name="current_indent" select="$current_indent + 3"/>
2216 </xsl:call-template>
2218 <xsl:when test="position() = 1">
2219 <xsl:text>  </xsl:text>
2222 <xsl:text>| </xsl:text>
2225 <xsl:value-of select="./@name"/>
2226 <xsl:text>: </xsl:text>
2227 <xsl:apply-templates select="./*[1]">
2228 <xsl:with-param name="current_indent" select="$current_indent + 2*string-length(./@name) + 5"/>
2229 </xsl:apply-templates>
2237 <xsl:template match="Variable">
2238 <xsl:param name="current_indent" select="0"/>
2240 VARIABLE <xsl:value-of select="@name"/><br/>
2241 TYPE = <xsl:apply-templates select="type/*[1]">
2242 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
2243 </xsl:apply-templates>
2244 <xsl:if test="body">
2246 BODY = <xsl:apply-templates select="body/*[1]">
2247 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
2248 </xsl:apply-templates>
2253 <!--***********************************************************************-->
2255 <!--***********************************************************************-->
2259 <xsl:template match="SECTION">
2260 <xsl:param name="current_indent" select="0"/>
2261 <h1>BEGIN OF SECTION</h1>
2262 <xsl:apply-templates/>
2263 <h1>END OF SECTION</h1>