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='inst'">
368 <xsl:apply-templates select="*[1]" mode="inline"/>
369 <FONT color="blue">{</FONT>
370 <xsl:text>trjsh</xsl:text>
371 <xsl:apply-templates select="*[2]" mode="args"/>
372 <FONT color="blue">}</FONT>
375 <xsl:when test="$name='fix'">
376 <FONT color="red">FIX</FONT>
377 <xsl:value-of select="m:ci"/>
378 <xsl:text>{</xsl:text>
379 <xsl:for-each select="m:bvar">
380 <xsl:value-of select="m:ci"/>
381 <xsl:text>:</xsl:text>
382 <xsl:apply-templates mode="inline" select="m:type"/>
383 <xsl:text>:=</xsl:text>
384 <xsl:apply-templates mode="inline"
385 select="following-sibling::*[position() = 1]"/>
387 <xsl:when test="position()=last()">
388 <xsl:text>}</xsl:text>
391 <xsl:text>;</xsl:text>
397 <xsl:when test="$name='cofix'">
398 <xsl:text>COFIX</xsl:text>
399 <xsl:value-of select="m:ci"/>
400 <xsl:text>{</xsl:text>
401 <xsl:for-each select="m:bvar">
402 <xsl:value-of select="m:ci"/>
403 <xsl:text>:</xsl:text>
404 <xsl:apply-templates mode="inline" select="m:type"/>
405 <xsl:text>:=</xsl:text>
406 <xsl:apply-templates mode="inline"
407 select="following-sibling::*[position() = 1]"/>
409 <xsl:when test="position()=last()">
410 <xsl:text>}</xsl:text>
413 <xsl:text>;</xsl:text>
418 <!-- proof and side_proof -->
419 <xsl:when test="$name='proof' or $name='side_proof'">
420 <xsl:apply-templates mode="inline" select="*[position()=2]"/>
421 <FONT color="red"> proves </FONT>
422 <xsl:apply-templates mode="inline" select="*[position()=3]"/>
424 <FONT color="red"> which is equivalent to </FONT>
425 <xsl:apply-templates mode="inline" select="*[position()=4]"/>
429 <xsl:when test="$name='letin1'">
430 <xsl:text>letin1 (inline error)</xsl:text>
433 <xsl:when test="$name='false_ind'">
434 <xsl:apply-templates mode="inline" select="*[3]"/>
435 <FONT color="red">Contradiction.</FONT>
438 <xsl:when test="$name='and_ind'">
439 <FONT color="red">From </FONT>
440 <xsl:apply-templates select="*[2]"/>
441 <FONT color="red"> we get</FONT>
443 <xsl:apply-templates select="*[3]"/>
445 <xsl:apply-templates mode="inline" select="*[4]"/>
446 <FONT color="red"> and </FONT>
448 <xsl:apply-templates select="*[5]"/>
450 <xsl:apply-templates mode="inline" select="*[6]"/>
452 <FONT color="red"> hence </FONT>
453 <xsl:apply-templates mode="inline" select="*[7]"/>
456 <xsl:when test="$name='subst'">
457 <xsl:apply-templates select="*[3]" mode="inline"/>
458 <xsl:text>[</xsl:text>
459 <xsl:apply-templates select="*[4]" mode="inline"/>
461 <xsl:when test="$uri != ''">
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'"/>
471 <xsl:call-template name="mksymbol-1">
472 <xsl:with-param name="symbol" select="$name"/>
473 <xsl:with-param name="color" select="'green'"/>
474 <xsl:with-param name="size" select="'+0'"/>
478 <xsl:apply-templates select="*[2]" mode="inline"/>
479 <xsl:text>]</xsl:text>
482 <xsl:when test="$name='lift_with_base'">
484 <xsl:apply-templates select="*[3]" mode="inline"/>
487 <xsl:when test="$uri != ''">
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:call-template name="mksymbol-1">
498 <xsl:with-param name="symbol" select="$name"/>
499 <xsl:with-param name="color" select="'green'"/>
500 <xsl:with-param name="size" select="'+0'"/>
505 <xsl:apply-templates select="*[4]" mode="inline"/>
507 <xsl:text>(</xsl:text>
508 <xsl:apply-templates select="*[2]" mode="inline"/>
509 <xsl:text>)</xsl:text>
512 <xsl:when test="$name='lift'">
514 <xsl:when test="$uri != ''">
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:call-template name="mksymbol-1">
525 <xsl:with-param name="symbol" select="$name"/>
526 <xsl:with-param name="color" select="'green'"/>
527 <xsl:with-param name="size" select="'+0'"/>
532 <xsl:apply-templates select="*[2]" mode="inline"/>
534 <xsl:text>(</xsl:text>
535 <xsl:apply-templates select="*[3]" mode="inline"/>
536 <xsl:text>)</xsl:text>
540 <xsl:when test="$name='beta_red1'">
541 <xsl:apply-templates select="*[2]" mode="inline"/>
543 <xsl:when test="$uri != ''">
545 <xsl:call-template name="mksymbol-1">
546 <xsl:with-param name="symbol" select="$name"/>
547 <xsl:with-param name="color" select="'green'"/>
548 <xsl:with-param name="size" select="'+0'"/>
551 <xsl:call-template name="mksymbol-1">
552 <xsl:with-param name="symbol" select="'beta'"/>
553 <xsl:with-param name="color" select="'green'"/>
554 <xsl:with-param name="size" select="'+0'"/>
560 <xsl:call-template name="mksymbol-1">
561 <xsl:with-param name="symbol" select="$name"/>
562 <xsl:with-param name="color" select="'green'"/>
563 <xsl:with-param name="size" select="'+0'"/>
566 <xsl:call-template name="mksymbol-1">
567 <xsl:with-param name="symbol" select="'beta'"/>
568 <xsl:with-param name="color" select="'green'"/>
569 <xsl:with-param name="size" select="'+0'"/>
574 <xsl:apply-templates select="*[3]" mode="inline"/>
577 <xsl:when test="$name='beta_red'">
578 <xsl:apply-templates select="*[2]" mode="inline"/>
580 <xsl:when test="$uri != ''">
582 <xsl:call-template name="mksymbol-1">
583 <xsl:with-param name="symbol" select="$name"/>
584 <xsl:with-param name="color" select="'green'"/>
585 <xsl:with-param name="size" select="'+0'"/>
588 <xsl:call-template name="mksymbol-1">
589 <xsl:with-param name="symbol" select="'beta'"/>
590 <xsl:with-param name="color" select="'green'"/>
591 <xsl:with-param name="size" select="'+0'"/>
593 <xsl:text>*</xsl:text>
598 <xsl:call-template name="mksymbol-1">
599 <xsl:with-param name="symbol" select="$name"/>
600 <xsl:with-param name="color" select="'green'"/>
601 <xsl:with-param name="size" select="'+0'"/>
604 <xsl:call-template name="mksymbol-1">
605 <xsl:with-param name="symbol" select="'beta'"/>
606 <xsl:with-param name="color" select="'green'"/>
607 <xsl:with-param name="size" select="'+0'"/>
609 <xsl:text>*</xsl:text>
613 <xsl:apply-templates select="*[3]" mode="inline"/>
616 <xsl:when test="$name='par_beta_red1'">
617 <xsl:apply-templates select="*[2]" mode="inline"/>
619 <xsl:when test="$uri != ''">
621 <xsl:call-template name="mksymbol-1">
622 <xsl:with-param name="symbol" select="$name"/>
623 <xsl:with-param name="color" select="'green'"/>
624 <xsl:with-param name="size" select="'+0'"/>
627 <xsl:call-template name="mksymbol-1">
628 <xsl:with-param name="symbol" select="'beta'"/>
629 <xsl:with-param name="color" select="'green'"/>
630 <xsl:with-param name="size" select="'+0'"/>
636 <xsl:call-template name="mksymbol-1">
637 <xsl:with-param name="symbol" select="$name"/>
638 <xsl:with-param name="color" select="'green'"/>
639 <xsl:with-param name="size" select="'+0'"/>
642 <xsl:call-template name="mksymbol-1">
643 <xsl:with-param name="symbol" select="'beta'"/>
644 <xsl:with-param name="color" select="'green'"/>
645 <xsl:with-param name="size" select="'+0'"/>
650 <xsl:apply-templates select="*[3]" mode="inline"/>
653 <xsl:when test="$name='par_beta_red'">
654 <xsl:apply-templates select="*[2]" mode="inline"/>
656 <xsl:when test="$uri != ''">
658 <xsl:call-template name="mksymbol-1">
659 <xsl:with-param name="symbol" select="$name"/>
660 <xsl:with-param name="color" select="'green'"/>
661 <xsl:with-param name="size" select="'+0'"/>
664 <xsl:call-template name="mksymbol-1">
665 <xsl:with-param name="symbol" select="'beta'"/>
666 <xsl:with-param name="color" select="'green'"/>
667 <xsl:with-param name="size" select="'+0'"/>
669 <xsl:text>*</xsl:text>
674 <xsl:call-template name="mksymbol-1">
675 <xsl:with-param name="symbol" select="$name"/>
676 <xsl:with-param name="color" select="'green'"/>
677 <xsl:with-param name="size" select="'+0'"/>
680 <xsl:call-template name="mksymbol-1">
681 <xsl:with-param name="symbol" select="'beta'"/>
682 <xsl:with-param name="color" select="'green'"/>
683 <xsl:with-param name="size" select="'+0'"/>
685 <xsl:text>*</xsl:text>
689 <xsl:apply-templates select="*[3]" mode="inline"/>
693 <xsl:when test="$name='forgetful'">
695 <xsl:when test="$uri != ''">
696 <a href="{$uri}">|</a>
702 <xsl:apply-templates select="*[2]" mode="inline"/>
704 <xsl:when test="$uri != ''">
705 <a href="{$uri}">|</a>
713 <!-- boolean algebra of redexes -->
716 <xsl:when test="$name='isomorphic'">
717 <xsl:apply-templates select="*[2]" mode="inline"/>
719 <xsl:when test="$uri != ''">
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'"/>
729 <xsl:call-template name="mksymbol-1">
730 <xsl:with-param name="symbol" select="$name"/>
731 <xsl:with-param name="color" select="'green'"/>
732 <xsl:with-param name="size" select="'+0'"/>
736 <xsl:apply-templates select="*[3]" mode="inline"/>
740 <xsl:when test="$name='interp'">
741 <font color="green">[</font>
742 <xsl:apply-templates select="*[2]"/>
743 <font color="green">]</font>
749 <xsl:template mode="inline" match="m:lambda">
750 <xsl:call-template name="mksymbol-1">
751 <xsl:with-param name="symbol" select="'lambda'"/>
752 <xsl:with-param name="color" select="'red'"/>
753 <xsl:with-param name="size" select="'+2'"/>
755 <xsl:apply-templates select="m:bvar/m:ci"/>
756 <xsl:text>:</xsl:text>
757 <xsl:apply-templates mode="inline" select="m:bvar/m:type"/>
758 <xsl:text>.</xsl:text>
759 <xsl:apply-templates mode="inline" select="*[position()=2]"/>
762 <!--*********************************************************************-->
763 <!-- COUNTING MODE -->
764 <!--*********************************************************************-->
766 <xsl:template match="m:apply[m:csymbol]">
767 <xsl:param name="current_indent" select="0"/>
768 <xsl:param name="width" select="$framewidth"/>
769 <xsl:variable name="name">
770 <xsl:value-of select="m:csymbol"/>
772 <xsl:variable name="charlength">
773 <xsl:apply-templates select="m:csymbol" mode="charcount"/>
775 <!-- <xsl:value-of select="$current_indent"/> -->
776 <!-- <xsl:value-of select="$charlength"/> -->
777 <xsl:variable name="uri"><xsl:value-of select="*[1]/@definitionURL"/></xsl:variable>
780 <xsl:when test="$name='forall'">
782 <xsl:when test="$charlength > $framewidth">
784 <xsl:call-template name="mksymbol-1">
785 <xsl:with-param name="symbol" select="$name"/>
786 <xsl:with-param name="color" select="'blue'"/>
787 <xsl:with-param name="size" select="'+2'"/>
789 <xsl:apply-templates select="m:bvar/m:ci"/>
790 <xsl:text>:</xsl:text>
791 <xsl:apply-templates select="m:bvar/m:type">
792 <xsl:with-param name="current_indent"
793 select="$current_indent + 5 + 2*string-length(m:bvar/m:ci)"/>
794 </xsl:apply-templates>
796 <xsl:call-template name="make_indent">
797 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
799 <xsl:text>.</xsl:text>
800 <xsl:apply-templates select="*[position()=3]">
801 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
802 </xsl:apply-templates>
805 <xsl:apply-templates mode="inline" select="."/>
810 <xsl:when test="$name='prod'">
812 <xsl:when test="$charlength > $framewidth">
813 <xsl:call-template name="mksymbol-1">
814 <xsl:with-param name="symbol" select="$name"/>
815 <xsl:with-param name="color" select="'blue'"/>
816 <xsl:with-param name="size" select="'+2'"/>
818 <xsl:apply-templates select="m:bvar/m:ci"/>
819 <xsl:text>:</xsl:text>
820 <xsl:apply-templates select="m:bvar/m:type">
821 <xsl:with-param name="current_indent"
822 select="$current_indent + 5 + 2*string-length(m:bvar/m:ci)"/>
823 </xsl:apply-templates><br/>
824 <xsl:call-template name="make_indent">
825 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
827 <xsl:text>.</xsl:text>
828 <xsl:apply-templates select="*[position()=3]">
829 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
830 </xsl:apply-templates>
833 <xsl:apply-templates mode="inline" select="."/>
838 <xsl:when test="$name='arrow'">
840 <xsl:when test="$charlength > $framewidth">
841 <xsl:text>(</xsl:text>
842 <xsl:apply-templates select="*[position()=2]">
843 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
844 </xsl:apply-templates>
846 <xsl:call-template name="make_indent">
847 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
850 <xsl:call-template name="mksymbol-1">
851 <xsl:with-param name="symbol" select="$name"/>
852 <xsl:with-param name="color" select="'blue'"/>
853 <xsl:with-param name="size" select="'+0'"/>
855 <xsl:apply-templates select="*[position()=3]">
856 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
857 </xsl:apply-templates>
858 <xsl:text>)</xsl:text>
861 <xsl:apply-templates mode="inline" select="."/>
866 <xsl:when test="$name='app'">
868 <xsl:when test="$charlength > $framewidth">
869 <xsl:text>(</xsl:text>
870 <xsl:apply-templates select="*[position()=2]">
871 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
872 </xsl:apply-templates>
873 <xsl:for-each select="*[position()>2]">
875 <xsl:call-template name="make_indent">
876 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
878 <xsl:apply-templates select=".">
879 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
880 </xsl:apply-templates>
882 <xsl:text>)</xsl:text>
885 <xsl:apply-templates mode="inline" select="."/>
889 <xsl:when test="$name='cast'">
891 <xsl:when test="$showcast = 1">
893 <xsl:when test="$charlength > $framewidth">
894 <xsl:text>(</xsl:text>
895 <xsl:apply-templates select="*[position()=2]">
896 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
897 </xsl:apply-templates><br/>
898 <xsl:call-template name="make_indent">
899 <xsl:with-param name="current_indent" select="$current_indent + 2"/> </xsl:call-template>
900 <xsl:text>:></xsl:text>
901 <xsl:apply-templates select="*[position()=3]">
902 <xsl:with-param name="current_indent" select="$current_indent + 3"/>
903 </xsl:apply-templates>
904 <xsl:text>)</xsl:text>
907 <xsl:apply-templates mode="inline" select="."/>
912 <xsl:apply-templates select="*[position()=2]">
913 <xsl:with-param name="current_indent" select="$current_indent"/>
914 </xsl:apply-templates>
918 <xsl:when test="$name='Prop'">
919 <xsl:text>Prop</xsl:text>
921 <xsl:when test="$name='Set'">
922 <xsl:text>Set</xsl:text>
924 <xsl:when test="$name='Type'">
925 <xsl:text>Type</xsl:text>
927 <xsl:when test="$name='mutcase'">
929 <xsl:when test="$charlength > $framewidth">
930 <xsl:text><</xsl:text>
931 <xsl:apply-templates select="*[position()=2]">
932 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
933 </xsl:apply-templates>
934 <xsl:text>> </xsl:text>
936 <xsl:call-template name="make_indent">
937 <xsl:with-param name="current_indent" select="$current_indent + 2"/> </xsl:call-template>
938 <xsl:text>CASE </xsl:text>
939 <xsl:apply-templates select="*[position()=3]">
940 <xsl:with-param name="current_indent" select="$current_indent + 8"/>
941 </xsl:apply-templates>
942 <xsl:text> OF </xsl:text>
943 <xsl:for-each select="m:piecewise/m:piece">
944 <!-- <xsl:for-each select="*[position() mod 2 = 0 and position()>3]">-->
946 <xsl:call-template name="make_indent">
947 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
950 <xsl:when test="position() = 1">
951 <xsl:text>  </xsl:text>
954 <xsl:text>| </xsl:text>
957 <xsl:apply-templates select="./*[2]"/>
958 <xsl:call-template name="mksymbol-1">
959 <xsl:with-param name="symbol" select="'RightArrow'"/>
960 <xsl:with-param name="color" select="'green'"/>
961 <xsl:with-param name="size" select="'+0'"/>
963 <xsl:variable name="body_size">
965 select="./*[1]/*[1]" mode="charcount"/>
968 <xsl:when test="$body_size > $framewidth">
970 <xsl:call-template name="make_indent">
971 <xsl:with-param name="current_indent"
972 select="$current_indent + 8"/>
976 <xsl:with-param name="current_indent"
977 select="$current_indent + 8"/>
978 </xsl:apply-templates>
981 <xsl:apply-templates select="./*[1]"
988 <xsl:apply-templates mode="inline" select="."/>
993 <xsl:when test="$name='fix'">
995 <xsl:when test="$charlength > $framewidth">
996 <xsl:text>FIX</xsl:text>
997 <xsl:value-of select="m:ci"/>
998 <xsl:text>{</xsl:text>
999 <xsl:for-each select="m:bvar">
1001 <xsl:call-template name="make_indent">
1002 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1003 </xsl:call-template>
1004 <xsl:value-of select="m:ci"/>
1005 <xsl:text>:</xsl:text>
1006 <xsl:apply-templates select="m:type">
1007 <xsl:with-param name="current_indent"
1008 select="$current_indent + 5 + string-length(m:ci)"/>
1009 </xsl:apply-templates>
1011 <xsl:call-template name="make_indent">
1012 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1013 </xsl:call-template>
1014 <xsl:text>:=</xsl:text>
1015 <xsl:apply-templates select="following-sibling::*[position() = 1]">
1016 <xsl:with-param name="current_indent" select="$current_indent +2"/>
1017 </xsl:apply-templates>
1020 <xsl:call-template name="make_indent">
1021 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1022 </xsl:call-template>
1023 <xsl:text>}</xsl:text>
1026 <xsl:apply-templates mode="inline" select="."/>
1031 <xsl:when test="$name='cofix'">
1033 <xsl:when test="($charlength + 10) > $framewidth">
1034 <xsl:text>COFIX</xsl:text>
1035 <xsl:value-of select="m:ci"/>
1036 <xsl:text>{</xsl:text>
1038 <xsl:call-template name="make_indent">
1039 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1040 </xsl:call-template>
1041 <xsl:for-each select="m:bvar">
1042 <xsl:value-of select="m:ci"/>
1043 <xsl:text>:</xsl:text>
1044 <xsl:apply-templates select="m:type">
1045 <xsl:with-param name="current_indent"
1046 select="$current_indent + 5 + string-length(m:ci)"/>
1047 </xsl:apply-templates>
1049 <xsl:call-template name="make_indent">
1050 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1051 </xsl:call-template>
1052 <xsl:text>:=</xsl:text>
1053 <xsl:apply-templates select="following-sibling::*[position() = 1]">
1054 <xsl:with-param name="current_indent" select="$current_indent + 3"/>
1055 </xsl:apply-templates>
1059 <xsl:call-template name="make_indent">
1060 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1061 </xsl:call-template>
1062 <xsl:text>}</xsl:text>
1065 <xsl:apply-templates mode="inline" select="m:type"/>
1069 <xsl:when test="$name='let_in'">
1070 <xsl:text>let </xsl:text>
1071 <xsl:apply-templates select="m:bvar/m:ci"/>
1072 <xsl:text> := </xsl:text>
1073 <xsl:apply-templates select="*[3]">
1074 <xsl:with-param name="current_indent" select="$current_indent+14"/>
1075 </xsl:apply-templates>
1077 <xsl:call-template name="make_indent">
1078 <xsl:with-param name="current_indent" select="$current_indent"/>
1079 </xsl:call-template>
1080 <xsl:text>in </xsl:text>
1081 <xsl:apply-templates select="*[4]">
1082 <xsl:with-param name="current_indent" select="$current_indent+5"/>
1083 </xsl:apply-templates>
1086 <!-- ***************************************** -->
1087 <!-- *********** PROOF ELEMENTS ************** -->
1088 <!-- ***************************************** -->
1090 <xsl:when test="$name='proof'">
1091 <xsl:variable name="nonce" select="generate-id()"/>
1092 <xsl:variable name="freshid1" select="concat('a',$nonce)"/>
1093 <xsl:variable name="freshid2" select="concat('b',$nonce)"/>
1094 <xsl:variable name="freshid3" select="concat('c',$nonce)"/>
1095 <span ID="{$freshid1}">
1096 <xsl:apply-templates select="*[position()=2]">
1097 <xsl:with-param name="current_indent" select="$current_indent"/>
1098 </xsl:apply-templates>
1102 <xsl:when test="(preceding-sibling::*[1]/text()='letin1') or
1103 (preceding-sibling::*[1]/text()='rw_step') or
1104 (name(..)='m:lambda')">
1106 <xsl:call-template name="make_indent">
1107 <xsl:with-param name="current_indent" select="$current_indent"/>
1108 </xsl:call-template>
1109 <FONT color="red">we proved </FONT>
1113 if(document.getElementById) {
1115 <span ID="{$freshid2}">\
1116 <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>\
1118 <span ID="{$freshid3}">\
1120 <xsl:call-template name="make_indent">
1121 <xsl:with-param name="current_indent" select="$current_indent"/>
1122 </xsl:call-template>\
1123 <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>\
1126 document.to_be_deleted.push('<xsl:value-of select="$freshid1"/>');
1127 document.to_be_deleted.push('<xsl:value-of select="$freshid3"/>');
1128 document.write(' ');
1132 <xsl:call-template name="make_indent">
1133 <xsl:with-param name="current_indent" select="$current_indent"/>
1134 </xsl:call-template>\
1135 <FONT color="red">we proved </FONT>\
1141 <xsl:apply-templates select="*[position()=3]">
1142 <xsl:with-param name="current_indent" select="$current_indent + 16"/>
1143 </xsl:apply-templates>
1146 <xsl:when test="$name='side_proof'">
1147 <xsl:variable name="nonce" select="generate-id()"/>
1148 <xsl:variable name="freshid1" select="concat('a',$nonce)"/>
1149 <xsl:variable name="freshid2" select="concat('b',$nonce)"/>
1150 <xsl:variable name="freshid3" select="concat('c',$nonce)"/>
1151 <xsl:variable name="freshid4" select="concat('d',$nonce)"/>
1152 <span ID="{$freshid1}">
1153 <xsl:apply-templates select="*[position()=2]">
1154 <xsl:with-param name="current_indent" select="$current_indent"/>
1155 </xsl:apply-templates>
1159 if(document.getElementById) {
1161 <span ID="{$freshid2}">\
1162 <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>\
1164 <span ID="{$freshid3}">\
1166 <xsl:call-template name="make_indent">
1167 <xsl:with-param name="current_indent" select="$current_indent"/>
1168 </xsl:call-template>\
1169 <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>\
1172 document.to_be_deleted.push('<xsl:value-of select="$freshid1"/>');
1173 document.to_be_deleted.push('<xsl:value-of select="$freshid3"/>');
1174 document.to_be_deleted.push('<xsl:value-of select="$freshid4"/>');
1175 document.write(' ');
1179 <xsl:call-template name="make_indent">
1180 <xsl:with-param name="current_indent" select="$current_indent"/>
1181 </xsl:call-template>\
1182 <FONT color="red">we proved </FONT>\
1186 <span ID="{$freshid4}">
1187 <xsl:apply-templates select="*[position()=3]">
1188 <xsl:with-param name="current_indent" select="$current_indent + 16"/>
1189 </xsl:apply-templates>
1193 <xsl:when test="$name='eq_chain'">
1194 <FONT color="red">We have the following equality chain:</FONT>
1195 <xsl:for-each select="*[position() mod 2 = 0]">
1196 <xsl:variable name="pos" select="position()"/>
1198 <xsl:call-template name="make_indent">
1199 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
1200 </xsl:call-template>
1202 <xsl:when test="$pos=1">
1203 <xsl:apply-templates select=".">
1204 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
1205 </xsl:apply-templates>
1206 <xsl:text> =</xsl:text>
1209 <xsl:text>= </xsl:text>
1210 <xsl:apply-templates select=".">
1211 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
1212 </xsl:apply-templates>
1215 <xsl:if test="$pos != last()">
1217 <xsl:call-template name="make_indent">
1218 <xsl:with-param name="current_indent" select="$current_indent + 15"/>
1219 </xsl:call-template>
1220 <xsl:apply-templates select="../*[position()=2*$pos +1]">
1221 <xsl:with-param name="current_indent" select="$current_indent + 15"/>
1222 </xsl:apply-templates>
1226 <!-- diseq_chain -->
1227 <xsl:when test="$name='diseq_chain'">
1228 <FONT color="red">We have the following chain of disequalities:</FONT>
1229 <xsl:for-each select="*[position() mod 3 = 2]">
1230 <xsl:variable name="pos" select="position()"/>
1232 <xsl:call-template name="make_indent">
1233 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
1234 </xsl:call-template>
1236 <xsl:when test="$pos=1">
1237 <xsl:apply-templates select=".">
1238 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
1239 </xsl:apply-templates>
1240 <xsl:text> </xsl:text>
1241 <xsl:apply-templates mode="inline" select="../*[position()=3*$pos]"/>
1244 <xsl:apply-templates mode="inline" select="../*[position()=3*($pos - 1)]"/>
1245 <xsl:text> </xsl:text>
1246 <xsl:apply-templates select=".">
1247 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
1248 </xsl:apply-templates>
1251 <xsl:if test="$pos != last()">
1253 <xsl:call-template name="make_indent">
1254 <xsl:with-param name="current_indent" select="$current_indent + 15"/>
1255 </xsl:call-template>
1256 <xsl:apply-templates select="../*[position()=3*$pos +1]">
1257 <xsl:with-param name="current_indent" select="$current_indent + 15"/>
1258 </xsl:apply-templates>
1263 <xsl:when test="$name='letin1'">
1264 <xsl:apply-templates select="*[position()=2]">
1265 <xsl:with-param name="current_indent" select="$current_indent"/>
1266 </xsl:apply-templates>
1268 <xsl:call-template name="make_indent">
1269 <xsl:with-param name="current_indent" select="$current_indent"/>
1270 </xsl:call-template>
1271 <xsl:apply-templates select="*[position()=3]">
1272 <xsl:with-param name="current_indent" select="$current_indent"/>
1273 </xsl:apply-templates>
1276 <xsl:when test="$name='letin'">
1277 <xsl:for-each select="*[position()>1 and last()>position()]">
1278 <xsl:apply-templates select=".">
1279 <xsl:with-param name="current_indent" select="$current_indent"/>
1280 </xsl:apply-templates>
1282 <xsl:call-template name="make_indent">
1283 <xsl:with-param name="current_indent" select="$current_indent"/>
1284 </xsl:call-template>
1286 <xsl:apply-templates select="*[position()=last()]">
1287 <xsl:with-param name="current_indent" select="$current_indent"/>
1288 </xsl:apply-templates>
1291 <xsl:when test="$name='let'">
1293 <xsl:apply-templates select="m:ci"/>
1295 <xsl:apply-templates select="*[3]">
1296 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
1297 </xsl:apply-templates>
1300 <xsl:when test="$name='rw_step'">
1302 <xsl:when test="name(*[2])='m:apply'">
1303 <xsl:apply-templates select="*[2]">
1304 <xsl:with-param name="current_indent" select="$current_indent"/>
1305 </xsl:apply-templates>
1308 <FONT color="red">Consider </FONT>
1309 <xsl:apply-templates select="*[2]"/>
1312 <xsl:variable name="charlength_first">
1313 <xsl:apply-templates select="*[3]" mode="root_charcount"/>
1315 <xsl:variable name="charlength_second">
1316 <xsl:apply-templates select="*[4]" mode="root_charcount"/>
1318 <xsl:variable name="charlength_side_proof">
1319 <xsl:apply-templates select="*[5]" mode="root_charcount"/>
1321 <xsl:variable name="split1"
1322 select="($charlength_first + $charlength_second) > $framewidth"/>
1323 <xsl:variable name="split2"
1324 select="($charlength_second + $charlength_side_proof) > $framewidth"/>
1325 <!-- <xsl:value-of select="$current_indent"/> -->
1326 <!-- <xsl:value-of select="string($charlength_second)"/> -->
1327 <!-- <xsl:value-of select="$charlength_side_proof"/> -->
1328 <!-- <xsl:value-of select="$split2"/> -->
1330 <xsl:call-template name="make_indent">
1331 <xsl:with-param name="current_indent" select="$current_indent"/>
1332 </xsl:call-template>
1333 <FONT color="red">Rewrite </FONT>
1334 <xsl:apply-templates mode="inline" select="*[3]"/>
1335 <xsl:text> </xsl:text>
1336 <xsl:if test="$split1">
1338 <xsl:call-template name="make_indent">
1339 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1340 </xsl:call-template>
1342 <FONT color="red">with </FONT>
1343 <xsl:apply-templates mode="inline" select="*[4]"/>
1344 <xsl:text> </xsl:text>
1345 <xsl:if test="$split2">
1347 <xsl:call-template name="make_indent">
1348 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1349 </xsl:call-template>
1351 <FONT color="red">by </FONT>
1352 <xsl:apply-templates select="*[5]">
1353 <xsl:with-param name="current_indent" select="$current_indent+7"/>
1354 </xsl:apply-templates>
1356 <!-- rewrite and apply -->
1357 <xsl:when test="$name='rewrite_and_apply'">
1358 <xsl:apply-templates select="*[2]">
1359 <xsl:with-param name="current_indent" select="$current_indent"/>
1360 </xsl:apply-templates>
1362 <xsl:call-template name="make_indent">
1363 <xsl:with-param name="current_indent" select="$current_indent"/>
1364 </xsl:call-template>
1365 <FONT color="red">Then apply it to </FONT>
1366 <xsl:apply-templates select="*[position()>2]"/>
1368 <!-- by_induction -->
1369 <xsl:when test="$name='by_induction'">
1370 <FONT color="red">We prove </FONT>
1371 <xsl:apply-templates select="../*[3]">
1372 <xsl:with-param name="current_indent" select="$current_indent+18"/>
1373 </xsl:apply-templates>
1375 <xsl:call-template name="make_indent">
1376 <xsl:with-param name="current_indent" select="$current_indent"/>
1377 </xsl:call-template>
1378 <FONT color="red">by induction on </FONT>
1379 <xsl:apply-templates select="*[position()=last()]/*[position()=last()]">
1380 <xsl:with-param name="current_indent" select="$current_indent+30"/>
1381 </xsl:apply-templates>
1384 <xsl:call-template name="make_indent">
1385 <xsl:with-param name="current_indent" select="$current_indent"/>
1386 </xsl:call-template>
1387 <xsl:text>The induction property is</xsl:text>
1389 <xsl:call-template name="make_indent">
1390 <xsl:with-param name="current_indent" select="$current_indent"/>
1391 </xsl:call-template>
1392 <xsl:apply-templates select="*[3]">
1393 <xsl:with-param name="current_indent" select="$current_indent"/>
1394 </xsl:apply-templates>
1396 <xsl:apply-templates
1397 select="*[position()>3 and not(position()=last())]">
1398 <xsl:with-param name="current_indent" select="$current_indent+4"/>
1399 </xsl:apply-templates>
1401 <xsl:call-template name="make_indent">
1402 <xsl:with-param name="current_indent" select="$current_indent"/>
1403 </xsl:call-template>
1404 <xsl:text>End induction</xsl:text> -->
1406 <!-- inductive_case -->
1407 <xsl:when test="$name='inductive_case'">
1409 <xsl:call-template name="make_indent">
1410 <xsl:with-param name="current_indent" select="$current_indent"/>
1411 </xsl:call-template>
1412 <FONT color="red">Case </FONT>
1413 <xsl:apply-templates select="*[2]">
1414 <xsl:with-param name="current_indent" select="$current_indent +10"/>
1415 </xsl:apply-templates>
1416 <xsl:if test="*[3]/*[position()>1]">
1418 <xsl:call-template name="make_indent">
1419 <xsl:with-param name="current_indent" select="$current_indent+4"/>
1420 </xsl:call-template>
1421 <FONT color="red">By induction hypothesis, we have:</FONT>
1422 <xsl:for-each select="*[3]/*[position()>1]">
1424 <xsl:call-template name="make_indent">
1425 <xsl:with-param name="current_indent" select="$current_indent + 4"/>
1426 </xsl:call-template>
1427 <xsl:text>(</xsl:text>
1428 <xsl:apply-templates select="m:ci"/>
1429 <xsl:text>) </xsl:text>
1430 <xsl:apply-templates select="m:type">
1431 <xsl:with-param name="current_indent" select="$current_indent + 8"/>
1432 </xsl:apply-templates>
1436 <xsl:call-template name="make_indent">
1437 <xsl:with-param name="current_indent" select="$current_indent + 4"/>
1438 </xsl:call-template>
1439 <xsl:apply-templates select="*[4]">
1440 <xsl:with-param name="current_indent" select="$current_indent +4"/>
1441 </xsl:apply-templates>
1443 <xsl:call-template name="make_indent">
1444 <xsl:with-param name="current_indent" select="$current_indent"/>
1445 </xsl:call-template>
1446 <xsl:text>End Case</xsl:text> -->
1449 <xsl:when test="$name='case_lhs'">
1451 <xsl:when test="count(*)=2">
1452 <xsl:apply-templates mode="inline" select="*[2]"/>
1455 <xsl:text>(</xsl:text>
1456 <xsl:apply-templates mode="inline" select="*[2]"/>
1457 <xsl:for-each select="m:bvar">
1458 <xsl:text> </xsl:text>
1459 <xsl:apply-templates mode="inline" select="*[1]"/>
1460 <xsl:text>:</xsl:text>
1461 <xsl:apply-templates mode="inline" select="m:type/*[1]"/>
1463 <xsl:text>)</xsl:text>
1468 <xsl:when test="$name='false_ind'">
1469 <xsl:apply-templates select="*[3]">
1470 <xsl:with-param name="current_indent" select="$current_indent"/>
1471 </xsl:apply-templates>
1473 <xsl:call-template name="make_indent">
1474 <xsl:with-param name="current_indent" select="$current_indent"/>
1475 </xsl:call-template>
1476 <FONT color="red">Contradiction.</FONT>
1479 <xsl:when test="$name='and_ind'">
1481 <xsl:when test="name(*[2])='m:apply'">
1482 <xsl:apply-templates select="*[2]">
1483 <xsl:with-param name="current_indent" select="$current_indent"/>
1484 </xsl:apply-templates>
1487 <FONT color="red">Consider </FONT>
1488 <xsl:apply-templates select="*[2]"/>
1492 <xsl:call-template name="make_indent">
1493 <xsl:with-param name="current_indent" select="$current_indent"/>
1494 </xsl:call-template>
1495 <FONT color="red">In particular, we have</FONT>
1497 <xsl:call-template name="make_indent">
1498 <xsl:with-param name="current_indent" select="$current_indent"/>
1499 </xsl:call-template>
1501 <xsl:apply-templates select="*[3]"/>
1503 <xsl:apply-templates select="*[4]">
1504 <xsl:with-param name="current_indent" select="$current_indent + 9"/>
1505 </xsl:apply-templates>
1507 <xsl:call-template name="make_indent">
1508 <xsl:with-param name="current_indent" select="$current_indent"/>
1509 </xsl:call-template>
1511 <xsl:apply-templates select="*[5]"/>
1513 <xsl:apply-templates select="*[6]">
1514 <xsl:with-param name="current_indent" select="$current_indent + 9"/>
1515 </xsl:apply-templates>
1517 <xsl:call-template name="make_indent">
1518 <xsl:with-param name="current_indent" select="$current_indent"/>
1519 </xsl:call-template>
1520 <xsl:apply-templates select="*[7]">
1521 <xsl:with-param name="current_indent" select="$current_indent"/>
1522 </xsl:apply-templates>
1524 <!-- full_or_ind -->
1525 <xsl:when test="$name='full_or_ind'">
1527 <xsl:when test="name(*[2])='m:apply'">
1528 <xsl:apply-templates select="*[2]">
1529 <xsl:with-param name="current_indent" select="$current_indent"/>
1530 </xsl:apply-templates>
1533 <FONT color="red">Consider </FONT>
1534 <xsl:apply-templates select="*[2]"/>
1538 <xsl:call-template name="make_indent">
1539 <xsl:with-param name="current_indent" select="$current_indent"/>
1540 </xsl:call-template>
1541 <FONT color="red">We proceed by cases to prove </FONT>
1542 <xsl:apply-templates select="*[3]"/>
1544 <xsl:call-template name="make_indent">
1545 <xsl:with-param name="current_indent" select="$current_indent+4"/>
1546 </xsl:call-template>
1547 <FONT color="red">Left: suppose </FONT>
1548 <xsl:text>(</xsl:text>
1549 <xsl:value-of select="*[4]/m:bvar/m:ci"/>
1550 <xsl:text>) </xsl:text>
1551 <xsl:apply-templates
1552 select="*[4]/m:bvar/m:type/*[1]"/>
1554 <xsl:call-template name="make_indent">
1555 <xsl:with-param name="current_indent" select="$current_indent+15"/>
1556 </xsl:call-template>
1557 <xsl:apply-templates
1559 <xsl:with-param name="current_indent" select="$current_indent+15"/>
1560 </xsl:apply-templates>
1562 <xsl:call-template name="make_indent">
1563 <xsl:with-param name="current_indent" select="$current_indent+4"/>
1564 </xsl:call-template>
1565 <FONT color="red">Right: suppose </FONT>
1566 <xsl:text>(</xsl:text>
1567 <xsl:value-of select="*[5]/m:bvar/m:ci"/>
1568 <xsl:text>) </xsl:text>
1569 <xsl:apply-templates
1570 select="*[5]/m:bvar/m:type/*[1]"/>
1572 <xsl:call-template name="make_indent">
1573 <xsl:with-param name="current_indent" select="$current_indent+16"/>
1574 </xsl:call-template>
1575 <xsl:apply-templates
1577 <xsl:with-param name="current_indent" select="$current_indent+16"/>
1578 </xsl:apply-templates>
1581 <xsl:when test="$name='or_ind'">
1583 <xsl:when test="name(*[2])='m:apply'">
1584 <xsl:apply-templates select="*[2]">
1585 <xsl:with-param name="current_indent" select="$current_indent"/>
1586 </xsl:apply-templates>
1589 <FONT color="red">Consider </FONT>
1590 <xsl:apply-templates select="*[2]"/>
1594 <xsl:call-template name="make_indent">
1595 <xsl:with-param name="current_indent" select="$current_indent"/>
1596 </xsl:call-template>
1597 <FONT color="red">We prove </FONT>
1598 <xsl:apply-templates select="*[3]"/>
1599 <FONT color="red"> by cases:</FONT>
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="*[4]">
1606 <xsl:with-param name="current_indent" select="$current_indent"/>
1607 </xsl:apply-templates>
1609 <xsl:call-template name="make_indent">
1610 <xsl:with-param name="current_indent" select="$current_indent"/>
1611 </xsl:call-template>
1613 <xsl:apply-templates select="*[5]">
1614 <xsl:with-param name="current_indent" select="$current_indent"/>
1615 </xsl:apply-templates>
1618 <xsl:when test="$name='ex_ind'">
1620 <xsl:when test="name(*[2])='m:apply'">
1621 <xsl:apply-templates select="*[2]">
1622 <xsl:with-param name="current_indent" select="$current_indent"/>
1623 </xsl:apply-templates>
1626 <FONT color="red">Consider </FONT>
1627 <xsl:apply-templates select="*[2]">
1628 <xsl:with-param name="current_indent" select="$current_indent"/>
1629 </xsl:apply-templates>
1633 <xsl:call-template name="make_indent">
1634 <xsl:with-param name="current_indent" select="$current_indent"/>
1635 </xsl:call-template>
1636 <FONT color="red">Let </FONT>
1637 <xsl:apply-templates mode="inline" select="*[3]"/>
1639 <xsl:apply-templates mode="inline" select="*[4]"/>
1640 <FONT color="red"> such that</FONT>
1642 <xsl:call-template name="make_indent">
1643 <xsl:with-param name="current_indent" select="$current_indent"/>
1644 </xsl:call-template>
1646 <xsl:apply-templates mode="inline" select="*[5]"/>
1648 <xsl:apply-templates select="*[6]">
1649 <xsl:with-param name="current_indent" select="$current_indent +7"/>
1650 </xsl:apply-templates>
1652 <xsl:call-template name="make_indent">
1653 <xsl:with-param name="current_indent" select="$current_indent"/>
1654 </xsl:call-template>
1655 <xsl:apply-templates select="*[7]">
1656 <xsl:with-param name="current_indent" select="$current_indent"/>
1657 </xsl:apply-templates>
1659 <!-- ***************************************** -->
1660 <!-- *********** LAMBDA ELEMENTS ************** -->
1661 <!-- ***************************************** -->
1662 <xsl:when test="$name='subst'">
1663 <xsl:apply-templates select="*[3]"/>
1664 <xsl:text>[</xsl:text>
1665 <xsl:apply-templates select="*[4]"/>
1667 <xsl:when test="$uri != ''">
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>
1677 <xsl:call-template name="mksymbol-1">
1678 <xsl:with-param name="symbol" select="$name"/>
1679 <xsl:with-param name="color" select="'blue'"/>
1680 <xsl:with-param name="size" select="'+0'"/>
1681 </xsl:call-template>
1684 <xsl:apply-templates select="*[2]"/>
1685 <xsl:text>]</xsl:text>
1688 <xsl:when test="$name='lift_with_base'">
1690 <xsl:apply-templates select="*[3]" mode="inline"/>
1693 <xsl:when test="$uri != ''">
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:call-template name="mksymbol-1">
1704 <xsl:with-param name="symbol" select="$name"/>
1705 <xsl:with-param name="color" select="'green'"/>
1706 <xsl:with-param name="size" select="'+0'"/>
1707 </xsl:call-template>
1711 <xsl:apply-templates select="*[4]" mode="inline"/>
1713 <xsl:text>(</xsl:text>
1714 <xsl:apply-templates select="*[2]" mode="inline"/>
1715 <xsl:text>)</xsl:text>
1718 <xsl:when test="$name='lift'">
1720 <xsl:when test="$uri != ''">
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:call-template name="mksymbol-1">
1731 <xsl:with-param name="symbol" select="$name"/>
1732 <xsl:with-param name="color" select="'green'"/>
1733 <xsl:with-param name="size" select="'+0'"/>
1734 </xsl:call-template>
1738 <xsl:apply-templates select="*[2]" mode="inline"/>
1740 <xsl:text>(</xsl:text>
1741 <xsl:apply-templates select="*[3]" mode="inline"/>
1742 <xsl:text>)</xsl:text>
1746 <xsl:when test="$name='beta_red1'">
1747 <xsl:apply-templates select="*[2]" mode="inline"/>
1749 <xsl:when test="$uri != ''">
1751 <xsl:call-template name="mksymbol-1">
1752 <xsl:with-param name="symbol" select="$name"/>
1753 <xsl:with-param name="color" select="'green'"/>
1754 <xsl:with-param name="size" select="'+0'"/>
1755 </xsl:call-template>
1757 <xsl:call-template name="mksymbol-1">
1758 <xsl:with-param name="symbol" select="'beta'"/>
1759 <xsl:with-param name="color" select="'green'"/>
1760 <xsl:with-param name="size" select="'+0'"/>
1761 </xsl:call-template>
1766 <xsl:call-template name="mksymbol-1">
1767 <xsl:with-param name="symbol" select="$name"/>
1768 <xsl:with-param name="color" select="'green'"/>
1769 <xsl:with-param name="size" select="'+0'"/>
1770 </xsl:call-template>
1772 <xsl:call-template name="mksymbol-1">
1773 <xsl:with-param name="symbol" select="'beta'"/>
1774 <xsl:with-param name="color" select="'green'"/>
1775 <xsl:with-param name="size" select="'+0'"/>
1776 </xsl:call-template>
1780 <xsl:apply-templates select="*[3]" mode="inline"/>
1783 <xsl:when test="$name='beta_red'">
1784 <xsl:apply-templates select="*[2]" mode="inline"/>
1786 <xsl:when test="$uri != ''">
1788 <xsl:call-template name="mksymbol-1">
1789 <xsl:with-param name="symbol" select="$name"/>
1790 <xsl:with-param name="color" select="'green'"/>
1791 <xsl:with-param name="size" select="'+0'"/>
1792 </xsl:call-template>
1794 <xsl:call-template name="mksymbol-1">
1795 <xsl:with-param name="symbol" select="'beta'"/>
1796 <xsl:with-param name="color" select="'green'"/>
1797 <xsl:with-param name="size" select="'+0'"/>
1798 </xsl:call-template>
1799 <xsl:text>*</xsl:text>
1804 <xsl:call-template name="mksymbol-1">
1805 <xsl:with-param name="symbol" select="$name"/>
1806 <xsl:with-param name="color" select="'green'"/>
1807 <xsl:with-param name="size" select="'+0'"/>
1808 </xsl:call-template>
1810 <xsl:call-template name="mksymbol-1">
1811 <xsl:with-param name="symbol" select="'beta'"/>
1812 <xsl:with-param name="color" select="'green'"/>
1813 <xsl:with-param name="size" select="'+0'"/>
1814 </xsl:call-template>
1815 <xsl:text>*</xsl:text>
1819 <xsl:apply-templates select="*[3]" mode="inline"/>
1822 <xsl:when test="$name='par_beta_red1'">
1823 <xsl:apply-templates select="*[2]" mode="inline"/>
1825 <xsl:when test="$uri != ''">
1827 <xsl:call-template name="mksymbol-1">
1828 <xsl:with-param name="symbol" select="$name"/>
1829 <xsl:with-param name="color" select="'green'"/>
1830 <xsl:with-param name="size" select="'+0'"/>
1831 </xsl:call-template>
1833 <xsl:call-template name="mksymbol-1">
1834 <xsl:with-param name="symbol" select="'beta'"/>
1835 <xsl:with-param name="color" select="'green'"/>
1836 <xsl:with-param name="size" select="'+0'"/>
1837 </xsl:call-template>
1842 <xsl:call-template name="mksymbol-1">
1843 <xsl:with-param name="symbol" select="$name"/>
1844 <xsl:with-param name="color" select="'green'"/>
1845 <xsl:with-param name="size" select="'+0'"/>
1846 </xsl:call-template>
1848 <xsl:call-template name="mksymbol-1">
1849 <xsl:with-param name="symbol" select="'beta'"/>
1850 <xsl:with-param name="color" select="'green'"/>
1851 <xsl:with-param name="size" select="'+0'"/>
1852 </xsl:call-template>
1856 <xsl:apply-templates select="*[3]" mode="inline"/>
1859 <xsl:when test="$name='par_beta_red'">
1860 <xsl:apply-templates select="*[2]" mode="inline"/>
1862 <xsl:when test="$uri != ''">
1864 <xsl:call-template name="mksymbol-1">
1865 <xsl:with-param name="symbol" select="$name"/>
1866 <xsl:with-param name="color" select="'green'"/>
1867 <xsl:with-param name="size" select="'+0'"/>
1868 </xsl:call-template>
1870 <xsl:call-template name="mksymbol-1">
1871 <xsl:with-param name="symbol" select="'beta'"/>
1872 <xsl:with-param name="color" select="'green'"/>
1873 <xsl:with-param name="size" select="'+0'"/>
1874 </xsl:call-template>
1875 <xsl:text>*</xsl:text>
1880 <xsl:call-template name="mksymbol-1">
1881 <xsl:with-param name="symbol" select="$name"/>
1882 <xsl:with-param name="color" select="'green'"/>
1883 <xsl:with-param name="size" select="'+0'"/>
1884 </xsl:call-template>
1886 <xsl:call-template name="mksymbol-1">
1887 <xsl:with-param name="symbol" select="'beta'"/>
1888 <xsl:with-param name="color" select="'green'"/>
1889 <xsl:with-param name="size" select="'+0'"/>
1890 </xsl:call-template>
1891 <xsl:text>*</xsl:text>
1895 <xsl:apply-templates select="*[3]" mode="inline"/>
1899 <xsl:when test="$name='forgetful'">
1901 <xsl:when test="$uri != ''">
1902 <a href="{$uri}">|</a>
1908 <xsl:apply-templates select="*[2]" mode="inline"/>
1910 <xsl:when test="$uri != ''">
1911 <a href="{$uri}">|</a>
1919 <!-- boolean algebra of redexes -->
1922 <xsl:when test="$name='isomorphic'">
1923 <xsl:apply-templates select="*[2]" mode="inline"/>
1925 <xsl:when test="$uri != ''">
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>
1935 <xsl:call-template name="mksymbol-1">
1936 <xsl:with-param name="symbol" select="$name"/>
1937 <xsl:with-param name="color" select="'green'"/>
1938 <xsl:with-param name="size" select="'+0'"/>
1939 </xsl:call-template>
1942 <xsl:apply-templates select="*[3]" mode="inline"/>
1946 <xsl:when test="$name='interp'">
1947 <font color="green">[</font>
1948 <xsl:apply-templates select="*[2]"/>
1949 <font color="green">]</font>
1957 <xsl:template match="m:lambda">
1958 <xsl:param name="current_indent" select="0"/>
1959 <xsl:variable name="charlength">
1960 <xsl:apply-templates select="*[position()=1]" mode="charcount"/>
1961 <!-- <xsl:apply-templates select="." mode="charcount"/> -->
1963 <!-- <xsl:value-of select="$charlength"/> -->
1964 <!-- <xsl:value-of select="$current_indent"/> -->
1966 <xsl:when test="$charlength > $framewidth">
1968 <xsl:call-template name="mksymbol-1">
1969 <xsl:with-param name="symbol" select="'lambda'"/>
1970 <xsl:with-param name="color" select="'red'"/>
1971 <xsl:with-param name="size" select="'+2'"/>
1972 </xsl:call-template>
1973 <xsl:apply-templates select="m:bvar/m:ci"/>
1974 <xsl:text>:</xsl:text>
1975 <xsl:apply-templates select="m:bvar/m:type">
1976 <xsl:with-param name="current_indent"
1977 select="$current_indent + 4 + 2*string-length(m:bvar/m:ci)"/>
1978 </xsl:apply-templates><br/>
1979 <xsl:call-template name="make_indent">
1980 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1981 </xsl:call-template>
1982 <xsl:text>.</xsl:text>
1983 <xsl:apply-templates select="*[position()=2]">
1984 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1985 </xsl:apply-templates>
1988 <xsl:apply-templates mode="inline" select="."/>
1994 <xsl:template match="m:ci">
1996 <xsl:when test="boolean(@definitionURL)">
1997 <a href="{@definitionURL}">
1998 <xsl:apply-templates/>
2002 <xsl:value-of select="."/>
2007 <!-- CHAR COUNTING -->
2009 <!-- enter this counting mode selecting the root -->
2010 <xsl:template match="*" mode="root_charcount">
2011 <xsl:param name="incurrent_length" select="0"/>
2013 <xsl:when test="count(*)=0">
2014 <xsl:value-of select="0"/>
2016 <xsl:when test="name()='m:ci'">
2017 <xsl:value-of select="string-length()"/>
2020 <xsl:apply-templates select="*[1]" mode="charcount">
2021 <xsl:with-param name="incurrent_length" select="$incurrent_length"/>
2022 </xsl:apply-templates>
2027 <!-- enter this mode selecting the first child -->
2029 <xsl:template match="m:ci|m:csymbol" mode="charcount">
2030 <xsl:param name="incurrent_length" select="0"/>
2032 <xsl:when test="$framewidth >= ($incurrent_length + string-length())">
2033 <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>
2035 <xsl:when test="string($siblength) = """>
2036 <xsl:value-of select="$incurrent_length + string-length()"/>
2039 <xsl:value-of select="number($siblength)"/>
2044 <xsl:value-of select="$incurrent_length + string-length()"/>
2049 <xsl:template match="*" mode="charcount">
2050 <xsl:param name="incurrent_length" select="0"/>
2052 <xsl:when test="count(child::*) = 0">
2053 <xsl:value-of select="$incurrent_length"/>
2056 <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>
2058 <xsl:when test="$framewidth >= number($childlength)">
2059 <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>
2061 <xsl:when test="string($siblength) = """>
2062 <xsl:value-of select="number($childlength)"/>
2065 <xsl:value-of select="number($siblength)"/>
2070 <xsl:value-of select="number($childlength)"/>
2078 <!--***********************************************************************-->
2080 <!--***********************************************************************-->
2084 <xsl:template match="Definition">
2085 <xsl:param name="current_indent" select="0"/>
2087 DEFINITION <xsl:value-of select="@name"/>(<xsl:if test="string(./Params) != """><xsl:value-of select="Params"/></xsl:if>)<br/>
2089 <xsl:call-template name="make_indent">
2090 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
2091 </xsl:call-template>
2092 <xsl:apply-templates select="type/*[1]">
2093 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
2094 </xsl:apply-templates><br/>
2096 <xsl:call-template name="make_indent">
2097 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
2098 </xsl:call-template>
2099 <xsl:apply-templates select="body/*[1]">
2100 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
2101 </xsl:apply-templates>
2107 <xsl:template match="Axiom">
2108 <xsl:param name="current_indent" select="0"/>
2110 AXIOM <xsl:value-of select="@name"/>(<xsl:if test="string(./Params) != """><xsl:value-of select="Params"/></xsl:if>)<br/>
2112 <xsl:call-template name="make_indent">
2113 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
2114 </xsl:call-template>
2115 <xsl:apply-templates select="type/*[1]">
2116 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
2117 </xsl:apply-templates>
2121 <!-- UNFINISHED PROOF -->
2123 <xsl:template match="CurrentProof">
2124 <xsl:param name="current_indent" select="0"/>
2126 UNFINISHED PROOF <xsl:value-of select="@name"/>(<xsl:if test="string(./Params) != """><xsl:value-of select="Params"/></xsl:if>)<br/>
2127 THESIS: <xsl:apply-templates select="type/*[1]">
2128 <xsl:with-param name="current_indent" select="$current_indent + 8"/>
2129 </xsl:apply-templates><br/>
2131 <xsl:for-each select="Conjecture">
2133 <xsl:call-template name="make_indent">
2134 <xsl:with-param name="current_indent" select="$current_indent + 8"/>
2135 </xsl:call-template>
2136 <xsl:for-each select="Decl|Def|Hidden">
2138 <xsl:when test="name(.)='Decl'">
2140 <xsl:when test="@name">
2141 <xsl:value-of select="@name"/>
2144 <xsl:text>_</xsl:text>
2147 <xsl:text> : </xsl:text>
2148 <xsl:apply-templates select="./*[1]">
2149 <xsl:with-param name="current_indent" select="$current_indent"/>
2150 </xsl:apply-templates>
2152 <xsl:when test="name(.)='Def'">
2154 <xsl:when test="@name">
2155 <xsl:value-of select="@name"/>
2158 <xsl:text>_</xsl:text>
2161 <xsl:text> := </xsl:text>
2162 <xsl:apply-templates select="./*[1]">
2163 <xsl:with-param name="current_indent" select="$current_indent"/>
2164 </xsl:apply-templates>
2167 <xsl:text> _ :? _ </xsl:text>
2171 |- <xsl:value-of select="./@no"/> :
2172 <xsl:apply-templates select="./Goal/*[1]">
2173 <xsl:with-param name="current_indent" select="$current_indent + 11"/>
2174 </xsl:apply-templates>
2178 <xsl:apply-templates select="body/*[1]">
2179 <xsl:with-param name="current_indent" select="$current_indent + 8"/>
2180 </xsl:apply-templates>
2184 <!-- MUTUAL INDUCTIVE DEFINITION -->
2186 <xsl:template match="InductiveDefinition">
2187 <xsl:param name="current_indent" select="0"/>
2189 <xsl:for-each select="InductiveType">
2191 <xsl:when test="position() = 1">
2193 <xsl:when test="string(./@inductive) = "true"">
2194 INDUCTIVE DEFINITION
2197 COINDUCTIVE DEFINITION
2205 <xsl:value-of select="./@name"/>(<xsl:if test="string(../Params) != """><xsl:value-of select="../Params"/></xsl:if>)
2207 <xsl:if test="string(../Param) != """>
2208 <xsl:for-each select="../Param">
2209 <xsl:value-of select="./@name"/>
2211 <xsl:apply-templates select="*"/>
2216 <xsl:apply-templates select="./arity/*[1]">
2217 <xsl:with-param name="current_indent" select="$current_indent + 9"/>
2218 </xsl:apply-templates> <br/>
2220 <xsl:for-each select="./Constructor">
2222 <xsl:call-template name="make_indent">
2223 <xsl:with-param name="current_indent" select="$current_indent + 3"/>
2224 </xsl:call-template>
2226 <xsl:when test="position() = 1">
2227 <xsl:text>  </xsl:text>
2230 <xsl:text>| </xsl:text>
2233 <xsl:value-of select="./@name"/>
2234 <xsl:text>: </xsl:text>
2235 <xsl:apply-templates select="./*[1]">
2236 <xsl:with-param name="current_indent" select="$current_indent + 2*string-length(./@name) + 5"/>
2237 </xsl:apply-templates>
2245 <xsl:template match="Variable">
2246 <xsl:param name="current_indent" select="0"/>
2248 VARIABLE <xsl:value-of select="@name"/><br/>
2249 TYPE = <xsl:apply-templates select="type/*[1]">
2250 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
2251 </xsl:apply-templates>
2252 <xsl:if test="body">
2254 BODY = <xsl:apply-templates select="body/*[1]">
2255 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
2256 </xsl:apply-templates>
2261 <!--***********************************************************************-->
2263 <!--***********************************************************************-->
2267 <xsl:template match="SECTION">
2268 <xsl:param name="current_indent" select="0"/>
2269 <h1>BEGIN OF SECTION</h1>
2270 <xsl:apply-templates/>
2271 <h1>END OF SECTION</h1>