3 <!-- Copyright (C) 2000, HELM Team -->
5 <!-- This file is part of HELM, an Hypertextual, Electronic -->
6 <!-- Library of Mathematics, developed at the Computer Science -->
7 <!-- Department, University of Bologna, Italy. -->
9 <!-- HELM is free software; you can redistribute it and/or -->
10 <!-- modify it under the terms of the GNU General Public License -->
11 <!-- as published by the Free Software Foundation; either version 2 -->
12 <!-- of the License, or (at your option) any later version. -->
14 <!-- HELM is distributed in the hope that it will be useful, -->
15 <!-- but WITHOUT ANY WARRANTY; without even the implied warranty of -->
16 <!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -->
17 <!-- GNU General Public License for more details. -->
19 <!-- You should have received a copy of the GNU General Public License -->
20 <!-- along with HELM; if not, write to the Free Software -->
21 <!-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, -->
22 <!-- MA 02111-1307, USA. -->
24 <!-- For details, see the HELM World-Wide-Web page, -->
25 <!-- http://cs.unibo.it/helm/. -->
27 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
28 xmlns:m="http://www.w3.org/1998/Math/MathML">
30 <!--***********************************************************************-->
31 <!-- From MathML content to HTML -->
32 <!-- HELM Group: Asperti, Padovani, Sacerdoti, Schena, Guidi -->
33 <!--***********************************************************************-->
35 <xsl:param name="CICURI" select="''"/>
36 <xsl:param name="type" select="'standalone'"/>
37 <xsl:param name="UNICODEvsSYMBOL" select="'symbol'"/>
39 <xsl:include href="html_init.xsl"/>
40 <xsl:include href="html_set.xsl"/>
41 <xsl:include href="html_reals.xsl"/>
43 <xsl:variable name="showcast" select="0"/>
45 <!--***********************************************************************-->
46 <!-- HTML Head and Body -->
47 <!--***********************************************************************-->
49 <!-- <xsl:output method="html" encoding="iso-8859-1"/> -->
51 <!-- document needs method="xml" and searches locally for the dtd if -->
52 <!-- doctype-system is specified (the dtd must exist locally for parsing). -->
53 <!-- For having output html must be media-type="html" and for having the -->
54 <!-- correct <br /> you must specify at least the remote dtd by means of -->
55 <!-- doctype-public -->
59 media-type="text/html"
60 doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" />
62 <xsl:variable name="framewidth" select="45"/>
64 <xsl:template name="mksymbol-1">
65 <xsl:param name="symbol" select="''"/>
66 <xsl:param name="color" select="''"/>
67 <xsl:param name="size" select="''"/>
69 <xsl:when test="$UNICODEvsSYMBOL = 'symbol'">
70 <xsl:variable name="fontsymbol">
72 <xsl:when test="$symbol = 'forall'">
73 <xsl:value-of select="'"'"/>
75 <xsl:when test="$symbol = 'lambda'">
76 <xsl:value-of select="'l'"/>
78 <xsl:when test="$symbol = 'prod'">
79 <xsl:value-of select="'Õ'"/>
81 <xsl:when test="$symbol = 'arrow'">
82 <xsl:value-of select="'®'"/>
84 <xsl:when test="$symbol = 'RightArrow'">
85 <xsl:value-of select="'Þ'"/>
87 <xsl:when test="$symbol = 'subst'">
88 <xsl:value-of select="'¬'"/>
90 <xsl:when test="$symbol = 'lift' or $symbol = 'lift_with_base'">
91 <xsl:value-of select="'­'"/>
93 <xsl:when test="$symbol = 'beta_red' or $symbol = 'beta_red1'">
94 <xsl:value-of select="'®'"/>
96 <xsl:when test="$symbol = 'beta'">
97 <xsl:value-of select="'b'"/>
99 <xsl:when test="$symbol = 'par_beta_red' or $symbol = 'par_beta_red1'">
100 <xsl:value-of select="'Þ'"/>
102 <xsl:when test="$symbol = 'isomorphic'">
103 <xsl:value-of select="'@'"/>
106 <xsl:text>???</xsl:text>
110 <FONT FACE="symbol" SIZE="{$size}" color="{$color}">
111 <xsl:value-of select="$fontsymbol"/>
115 <xsl:variable name="unicodesymbol">
117 <xsl:when test="$symbol = 'forall'">
118 <xsl:value-of select="'∀'"/>
120 <xsl:when test="$symbol = 'lambda'">
121 <xsl:value-of select="'λ'"/>
123 <xsl:when test="$symbol = 'prod'">
124 <xsl:value-of select="'Π'"/>
126 <xsl:when test="$symbol = 'arrow'">
127 <xsl:value-of select="'→'"/>
129 <xsl:when test="$symbol = 'RightArrow'">
130 <xsl:value-of select="'⇒'"/>
132 <xsl:when test="$symbol = 'subst'">
133 <xsl:value-of select="'←'"/>
135 <xsl:when test="$symbol = 'lift' or $symbol = 'lift_with_base'">
136 <xsl:value-of select="'↑'"/>
138 <xsl:when test="$symbol = 'beta_red' or $symbol = 'beta_red1'">
139 <xsl:value-of select="'→'"/>
141 <xsl:when test="$symbol = 'beta'">
142 <xsl:value-of select="'β'"/>
144 <xsl:when test="$symbol = 'par_beta_red' or $symbol = 'par_beta_red1'">
145 <xsl:value-of select="'⇒'"/>
147 <xsl:when test="$symbol = 'isomorphic'">
148 <xsl:value-of select="'≅'"/>
151 <xsl:text>???</xsl:text>
155 <FONT color="{$color}">
156 <xsl:value-of select="$unicodesymbol"/>
162 <xsl:template match="/">
163 <xsl:param name="current_indent" select="0"/>
165 <xsl:when test="$type = 'standalone'">
168 <title> <xsl:value-of select="$CICURI"/> </title> <!-- FG -->
169 <style> A { text-decoration: none } </style>
171 <body bgcolor="white">
172 <xsl:apply-templates>
173 <xsl:with-param name="current_indent" select="0"/>
174 </xsl:apply-templates>
180 <xsl:apply-templates>
181 <xsl:with-param name="current_indent" select="0"/>
182 </xsl:apply-templates>
188 <!--***********************************************************************-->
190 <!--***********************************************************************-->
192 <xsl:template name="make_indent">
193 <xsl:param name="current_indent" select="0"/>
194 <xsl:if test="$current_indent > 0">
195 <xsl:text> </xsl:text>
196 <xsl:call-template name="make_indent">
197 <xsl:with-param name="current_indent" select="$current_indent - 1"/>
202 <!-- Syntactic Sugar -->
203 <xsl:template match="m:type">
204 <xsl:param name="current_indent" select="0"/>
205 <xsl:apply-templates>
206 <xsl:with-param name="current_indent"
207 select="$current_indent"/>
208 </xsl:apply-templates>
211 <xsl:template match="m:condition">
212 <xsl:param name="current_indent" select="0"/>
213 <xsl:apply-templates>
214 <xsl:with-param name="current_indent"
215 select="$current_indent"/>
216 </xsl:apply-templates>
219 <xsl:template match="m:math">
220 <xsl:param name="current_indent" select="0"/>
221 <xsl:apply-templates>
222 <xsl:with-param name="current_indent"
223 select="$current_indent"/>
224 </xsl:apply-templates>
227 <!--*********************************************************************-->
229 <!--*********************************************************************-->
232 <xsl:template mode="inline" match="m:ci">
234 <xsl:when test="boolean(@definitionURL)">
235 <a href="{@definitionURL}">
236 <xsl:apply-templates/>
240 <xsl:value-of select="."/>
247 <xsl:template match="m:apply[m:csymbol]" mode="inline">
248 <xsl:variable name="name">
249 <xsl:value-of select="m:csymbol"/>
251 <xsl:variable name="uri"><xsl:value-of select="*[1]/@definitionURL"/></xsl:variable>
254 <xsl:when test="$name='forall'">
255 <xsl:call-template name="mksymbol-1">
256 <xsl:with-param name="symbol" select="$name"/>
257 <xsl:with-param name="color" select="'blue'"/>
258 <xsl:with-param name="size" select="'+2'"/>
260 <xsl:apply-templates select="m:bvar/m:ci"/>
261 <xsl:text>:</xsl:text>
262 <xsl:apply-templates mode="inline" select="m:bvar/m:type"/>
263 <xsl:text>.</xsl:text>
264 <xsl:apply-templates mode="inline" select="*[position()=3]"/>
266 <xsl:when test="$name='prod'">
267 <xsl:call-template name="mksymbol-1">
268 <xsl:with-param name="symbol" select="$name"/>
269 <xsl:with-param name="color" select="'blue'"/>
270 <xsl:with-param name="size" select="'+2'"/>
272 <xsl:apply-templates mode="inline" select="m:bvar/m:ci"/>
273 <xsl:text>:</xsl:text>
274 <xsl:apply-templates mode="inline" select="m:bvar/m:type"/>
275 <xsl:text>.</xsl:text>
276 <xsl:apply-templates mode="inline" select="*[position()=3]"/>
279 <xsl:when test="$name='arrow'">
280 <xsl:text>(</xsl:text>
281 <xsl:apply-templates mode="inline" select="*[position()=2]"/>
282 <xsl:call-template name="mksymbol-1">
283 <xsl:with-param name="symbol" select="$name"/>
284 <xsl:with-param name="color" select="'blue'"/>
285 <xsl:with-param name="size" select="'+0'"/>
287 <xsl:apply-templates mode="inline" select="*[position()=3]"/>
288 <xsl:text>)</xsl:text>
291 <xsl:when test="$name='app'">
292 <xsl:text>(</xsl:text>
293 <xsl:apply-templates mode="inline" select="*[position()=2]"/>
294 <xsl:for-each select="*[position()>2]">
295 <xsl:text> </xsl:text>
296 <xsl:apply-templates mode="inline" select="."/>
298 <xsl:text>)</xsl:text>
301 <xsl:when test="$name='cast'">
302 <xsl:text>(</xsl:text>
303 <xsl:apply-templates mode="inline" select="*[position()=2]"/>
304 <xsl:text>:></xsl:text>
305 <xsl:apply-templates mode="inline" select="*[position()=3]"/>
306 <xsl:text>)</xsl:text>
308 <xsl:when test="$name='Prop'">
309 <FONT color="violet">Prop</FONT>
311 <xsl:when test="$name='Set'">
312 <FONT color="violet">Set</FONT>
314 <xsl:when test="$name='Type'">
315 <FONT color="violet">Type</FONT>
318 <xsl:when test="$name='mutcase'">
319 <xsl:text><</xsl:text>
320 <xsl:apply-templates mode="inline" select="*[position()=2]"/>
321 <xsl:text>> </xsl:text>
322 <FONT color="red">CASE </FONT>
323 <xsl:apply-templates mode="inline" select="*[position()=3]"/>
324 <FONT color="red"> OF </FONT>
325 <xsl:for-each select="piecewise/piece">
326 <!--<xsl:for-each select="*[position() mod 2 = 0 and position()>3]">-->
328 <xsl:when test="not(position() = 1)">
329 <xsl:text> | </xsl:text>
332 <xsl:apply-templates mode="inline" select="./*[2]"/>
333 <xsl:call-template name="mksymbol-1">
334 <xsl:with-param name="symbol" select="'RightArrow'"/>
335 <xsl:with-param name="color" select="'green'"/>
336 <xsl:with-param name="size" select="'+0'"/>
338 <xsl:apply-templates mode="inline"
343 <xsl:when test="$name='fix'">
344 <FONT color="red">FIX</FONT>
345 <xsl:value-of select="m:ci"/>
346 <xsl:text>{</xsl:text>
347 <xsl:for-each select="m:bvar">
348 <xsl:value-of select="m:ci"/>
349 <xsl:text>:</xsl:text>
350 <xsl:apply-templates mode="inline" select="m:type"/>
351 <xsl:text>:=</xsl:text>
352 <xsl:apply-templates mode="inline"
353 select="following-sibling::*[position() = 1]"/>
355 <xsl:when test="position()=last()">
356 <xsl:text>}</xsl:text>
359 <xsl:text>;</xsl:text>
365 <xsl:when test="$name='cofix'">
366 <xsl:text>COFIX</xsl:text>
367 <xsl:value-of select="m:ci"/>
368 <xsl:text>{</xsl:text>
369 <xsl:for-each select="m:bvar">
370 <xsl:value-of select="m:ci"/>
371 <xsl:text>:</xsl:text>
372 <xsl:apply-templates mode="inline" select="m:type"/>
373 <xsl:text>:=</xsl:text>
374 <xsl:apply-templates mode="inline"
375 select="following-sibling::*[position() = 1]"/>
377 <xsl:when test="position()=last()">
378 <xsl:text>}</xsl:text>
381 <xsl:text>;</xsl:text>
387 <xsl:when test="$name='proof'">
388 <xsl:apply-templates mode="inline" select="*[position()=2]"/>
389 <FONT color="red"> proves </FONT>
390 <xsl:apply-templates mode="inline" select="*[position()=3]"/>
393 <xsl:when test="$name='false_ind'">
394 <xsl:apply-templates mode="inline" select="*[3]"/>
395 <FONT color="red">Contradiction.</FONT>
398 <xsl:when test="$name='and_ind'">
399 <FONT color="red">From </FONT>
400 <xsl:apply-templates select="*[2]"/>
401 <FONT color="red"> we get</FONT>
403 <xsl:apply-templates select="*[3]"/>
405 <xsl:apply-templates mode="inline" select="*[4]"/>
406 <FONT color="red"> and </FONT>
408 <xsl:apply-templates select="*[5]"/>
410 <xsl:apply-templates mode="inline" select="*[6]"/>
412 <FONT color="red"> hence </FONT>
413 <xsl:apply-templates mode="inline" select="*[7]"/>
416 <xsl:when test="$name='subst'">
417 <xsl:apply-templates select="*[3]" mode="inline"/>
418 <xsl:text>[</xsl:text>
419 <xsl:apply-templates select="*[4]" mode="inline"/>
421 <xsl:when test="$uri != ''">
423 <xsl:call-template name="mksymbol-1">
424 <xsl:with-param name="symbol" select="$name"/>
425 <xsl:with-param name="color" select="'green'"/>
426 <xsl:with-param name="size" select="'+0'"/>
431 <xsl:call-template name="mksymbol-1">
432 <xsl:with-param name="symbol" select="$name"/>
433 <xsl:with-param name="color" select="'green'"/>
434 <xsl:with-param name="size" select="'+0'"/>
438 <xsl:apply-templates select="*[2]" mode="inline"/>
439 <xsl:text>]</xsl:text>
442 <xsl:when test="$name='lift_with_base'">
444 <xsl:apply-templates select="*[3]" mode="inline"/>
447 <xsl:when test="$uri != ''">
449 <xsl:call-template name="mksymbol-1">
450 <xsl:with-param name="symbol" select="$name"/>
451 <xsl:with-param name="color" select="'green'"/>
452 <xsl:with-param name="size" select="'+0'"/>
457 <xsl:call-template name="mksymbol-1">
458 <xsl:with-param name="symbol" select="$name"/>
459 <xsl:with-param name="color" select="'green'"/>
460 <xsl:with-param name="size" select="'+0'"/>
465 <xsl:apply-templates select="*[4]" mode="inline"/>
467 <xsl:text>(</xsl:text>
468 <xsl:apply-templates select="*[2]" mode="inline"/>
469 <xsl:text>)</xsl:text>
472 <xsl:when test="$name='lift'">
474 <xsl:when test="$uri != ''">
476 <xsl:call-template name="mksymbol-1">
477 <xsl:with-param name="symbol" select="$name"/>
478 <xsl:with-param name="color" select="'green'"/>
479 <xsl:with-param name="size" select="'+0'"/>
484 <xsl:call-template name="mksymbol-1">
485 <xsl:with-param name="symbol" select="$name"/>
486 <xsl:with-param name="color" select="'green'"/>
487 <xsl:with-param name="size" select="'+0'"/>
492 <xsl:apply-templates select="*[2]" mode="inline"/>
494 <xsl:text>(</xsl:text>
495 <xsl:apply-templates select="*[3]" mode="inline"/>
496 <xsl:text>)</xsl:text>
500 <xsl:when test="$name='beta_red1'">
501 <xsl:apply-templates select="*[2]" mode="inline"/>
503 <xsl:when test="$uri != ''">
505 <xsl:call-template name="mksymbol-1">
506 <xsl:with-param name="symbol" select="$name"/>
507 <xsl:with-param name="color" select="'green'"/>
508 <xsl:with-param name="size" select="'+0'"/>
511 <xsl:call-template name="mksymbol-1">
512 <xsl:with-param name="symbol" select="'beta'"/>
513 <xsl:with-param name="color" select="'green'"/>
514 <xsl:with-param name="size" select="'+0'"/>
520 <xsl:call-template name="mksymbol-1">
521 <xsl:with-param name="symbol" select="$name"/>
522 <xsl:with-param name="color" select="'green'"/>
523 <xsl:with-param name="size" select="'+0'"/>
526 <xsl:call-template name="mksymbol-1">
527 <xsl:with-param name="symbol" select="'beta'"/>
528 <xsl:with-param name="color" select="'green'"/>
529 <xsl:with-param name="size" select="'+0'"/>
534 <xsl:apply-templates select="*[3]" mode="inline"/>
537 <xsl:when test="$name='beta_red'">
538 <xsl:apply-templates select="*[2]" mode="inline"/>
540 <xsl:when test="$uri != ''">
542 <xsl:call-template name="mksymbol-1">
543 <xsl:with-param name="symbol" select="$name"/>
544 <xsl:with-param name="color" select="'green'"/>
545 <xsl:with-param name="size" select="'+0'"/>
548 <xsl:call-template name="mksymbol-1">
549 <xsl:with-param name="symbol" select="'beta'"/>
550 <xsl:with-param name="color" select="'green'"/>
551 <xsl:with-param name="size" select="'+0'"/>
553 <xsl:text>*</xsl:text>
558 <xsl:call-template name="mksymbol-1">
559 <xsl:with-param name="symbol" select="$name"/>
560 <xsl:with-param name="color" select="'green'"/>
561 <xsl:with-param name="size" select="'+0'"/>
564 <xsl:call-template name="mksymbol-1">
565 <xsl:with-param name="symbol" select="'beta'"/>
566 <xsl:with-param name="color" select="'green'"/>
567 <xsl:with-param name="size" select="'+0'"/>
569 <xsl:text>*</xsl:text>
573 <xsl:apply-templates select="*[3]" mode="inline"/>
576 <xsl:when test="$name='par_beta_red1'">
577 <xsl:apply-templates select="*[2]" mode="inline"/>
579 <xsl:when test="$uri != ''">
581 <xsl:call-template name="mksymbol-1">
582 <xsl:with-param name="symbol" select="$name"/>
583 <xsl:with-param name="color" select="'green'"/>
584 <xsl:with-param name="size" select="'+0'"/>
587 <xsl:call-template name="mksymbol-1">
588 <xsl:with-param name="symbol" select="'beta'"/>
589 <xsl:with-param name="color" select="'green'"/>
590 <xsl:with-param name="size" select="'+0'"/>
596 <xsl:call-template name="mksymbol-1">
597 <xsl:with-param name="symbol" select="$name"/>
598 <xsl:with-param name="color" select="'green'"/>
599 <xsl:with-param name="size" select="'+0'"/>
602 <xsl:call-template name="mksymbol-1">
603 <xsl:with-param name="symbol" select="'beta'"/>
604 <xsl:with-param name="color" select="'green'"/>
605 <xsl:with-param name="size" select="'+0'"/>
610 <xsl:apply-templates select="*[3]" mode="inline"/>
613 <xsl:when test="$name='par_beta_red'">
614 <xsl:apply-templates select="*[2]" mode="inline"/>
616 <xsl:when test="$uri != ''">
618 <xsl:call-template name="mksymbol-1">
619 <xsl:with-param name="symbol" select="$name"/>
620 <xsl:with-param name="color" select="'green'"/>
621 <xsl:with-param name="size" select="'+0'"/>
624 <xsl:call-template name="mksymbol-1">
625 <xsl:with-param name="symbol" select="'beta'"/>
626 <xsl:with-param name="color" select="'green'"/>
627 <xsl:with-param name="size" select="'+0'"/>
629 <xsl:text>*</xsl:text>
634 <xsl:call-template name="mksymbol-1">
635 <xsl:with-param name="symbol" select="$name"/>
636 <xsl:with-param name="color" select="'green'"/>
637 <xsl:with-param name="size" select="'+0'"/>
640 <xsl:call-template name="mksymbol-1">
641 <xsl:with-param name="symbol" select="'beta'"/>
642 <xsl:with-param name="color" select="'green'"/>
643 <xsl:with-param name="size" select="'+0'"/>
645 <xsl:text>*</xsl:text>
649 <xsl:apply-templates select="*[3]" mode="inline"/>
653 <xsl:when test="$name='forgetful'">
655 <xsl:when test="$uri != ''">
656 <a href="{$uri}">|</a>
662 <xsl:apply-templates select="*[2]" mode="inline"/>
664 <xsl:when test="$uri != ''">
665 <a href="{$uri}">|</a>
673 <!-- boolean algebra of redexes -->
676 <xsl:when test="$name='isomorphic'">
677 <xsl:apply-templates select="*[2]" mode="inline"/>
679 <xsl:when test="$uri != ''">
681 <xsl:call-template name="mksymbol-1">
682 <xsl:with-param name="symbol" select="$name"/>
683 <xsl:with-param name="color" select="'green'"/>
684 <xsl:with-param name="size" select="'+0'"/>
689 <xsl:call-template name="mksymbol-1">
690 <xsl:with-param name="symbol" select="$name"/>
691 <xsl:with-param name="color" select="'green'"/>
692 <xsl:with-param name="size" select="'+0'"/>
696 <xsl:apply-templates select="*[3]" mode="inline"/>
700 <xsl:when test="$name='interp'">
701 <font color="green">[</font>
702 <xsl:apply-templates select="*[2]"/>
703 <font color="green">]</font>
709 <xsl:template mode="inline" match="m:lambda">
710 <xsl:call-template name="mksymbol-1">
711 <xsl:with-param name="symbol" select="'lambda'"/>
712 <xsl:with-param name="color" select="'red'"/>
713 <xsl:with-param name="size" select="'+2'"/>
715 <xsl:apply-templates select="m:bvar/m:ci"/>
716 <xsl:text>:</xsl:text>
717 <xsl:apply-templates mode="inline" select="m:bvar/m:type"/>
718 <xsl:text>.</xsl:text>
719 <xsl:apply-templates mode="inline" select="*[position()=2]"/>
722 <!--*********************************************************************-->
723 <!-- COUNTING MODE -->
724 <!--*********************************************************************-->
726 <xsl:template match="m:apply[m:csymbol]">
727 <xsl:param name="current_indent" select="0"/>
728 <xsl:param name="width" select="$framewidth"/>
729 <xsl:variable name="name">
730 <xsl:value-of select="m:csymbol"/>
732 <xsl:variable name="charlength">
733 <xsl:apply-templates select="m:csymbol" mode="charcount"/>
735 <!-- <xsl:value-of select="$current_indent"/> -->
736 <!-- <xsl:value-of select="$charlength"/> -->
737 <xsl:variable name="uri"><xsl:value-of select="*[1]/@definitionURL"/></xsl:variable>
740 <xsl:when test="$name='forall'">
742 <xsl:when test="$charlength > $framewidth">
744 <xsl:call-template name="mksymbol-1">
745 <xsl:with-param name="symbol" select="$name"/>
746 <xsl:with-param name="color" select="'blue'"/>
747 <xsl:with-param name="size" select="'+2'"/>
749 <xsl:apply-templates select="m:bvar/m:ci"/>
750 <xsl:text>:</xsl:text>
751 <xsl:apply-templates select="m:bvar/m:type">
752 <xsl:with-param name="current_indent"
753 select="$current_indent + 5 + 2*string-length(m:bvar/m:ci)"/>
754 </xsl:apply-templates>
756 <xsl:call-template name="make_indent">
757 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
759 <xsl:text>.</xsl:text>
760 <xsl:apply-templates select="*[position()=3]">
761 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
762 </xsl:apply-templates>
765 <xsl:apply-templates mode="inline" select="."/>
770 <xsl:when test="$name='prod'">
772 <xsl:when test="$charlength > $framewidth">
773 <xsl:call-template name="mksymbol-1">
774 <xsl:with-param name="symbol" select="$name"/>
775 <xsl:with-param name="color" select="'blue'"/>
776 <xsl:with-param name="size" select="'+2'"/>
778 <xsl:apply-templates select="m:bvar/m:ci"/>
779 <xsl:text>:</xsl:text>
780 <xsl:apply-templates select="m:bvar/m:type">
781 <xsl:with-param name="current_indent"
782 select="$current_indent + 5 + 2*string-length(m:bvar/m:ci)"/>
783 </xsl:apply-templates><br/>
784 <xsl:call-template name="make_indent">
785 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
787 <xsl:text>.</xsl:text>
788 <xsl:apply-templates select="*[position()=3]">
789 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
790 </xsl:apply-templates>
793 <xsl:apply-templates mode="inline" select="."/>
798 <xsl:when test="$name='arrow'">
800 <xsl:when test="$charlength > $framewidth">
801 <xsl:text>(</xsl:text>
802 <xsl:apply-templates select="*[position()=2]">
803 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
804 </xsl:apply-templates>
806 <xsl:call-template name="make_indent">
807 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
810 <xsl:call-template name="mksymbol-1">
811 <xsl:with-param name="symbol" select="$name"/>
812 <xsl:with-param name="color" select="'blue'"/>
813 <xsl:with-param name="size" select="'+0'"/>
815 <xsl:apply-templates select="*[position()=3]">
816 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
817 </xsl:apply-templates>
818 <xsl:text>)</xsl:text>
821 <xsl:apply-templates mode="inline" select="."/>
826 <xsl:when test="$name='app'">
828 <xsl:when test="$charlength > $framewidth">
829 <xsl:text>(</xsl:text>
830 <xsl:apply-templates select="*[position()=2]">
831 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
832 </xsl:apply-templates>
833 <xsl:for-each select="*[position()>2]">
835 <xsl:call-template name="make_indent">
836 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
838 <xsl:apply-templates select=".">
839 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
840 </xsl:apply-templates>
842 <xsl:text>)</xsl:text>
845 <xsl:apply-templates mode="inline" select="."/>
849 <xsl:when test="$name='cast'">
851 <xsl:when test="$showcast = 1">
853 <xsl:when test="$charlength > $framewidth">
854 <xsl:text>(</xsl:text>
855 <xsl:apply-templates select="*[position()=2]">
856 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
857 </xsl:apply-templates><br/>
858 <xsl:call-template name="make_indent">
859 <xsl:with-param name="current_indent" select="$current_indent + 2"/> </xsl:call-template>
860 <xsl:text>:></xsl:text>
861 <xsl:apply-templates select="*[position()=3]">
862 <xsl:with-param name="current_indent" select="$current_indent + 3"/>
863 </xsl:apply-templates>
864 <xsl:text>)</xsl:text>
867 <xsl:apply-templates mode="inline" select="."/>
872 <xsl:apply-templates select="*[position()=2]">
873 <xsl:with-param name="current_indent" select="$current_indent"/>
874 </xsl:apply-templates>
878 <xsl:when test="$name='Prop'">
879 <xsl:text>Prop</xsl:text>
881 <xsl:when test="$name='Set'">
882 <xsl:text>Set</xsl:text>
884 <xsl:when test="$name='Type'">
885 <xsl:text>Type</xsl:text>
887 <xsl:when test="$name='mutcase'">
889 <xsl:when test="$charlength > $framewidth">
890 <xsl:text><</xsl:text>
891 <xsl:apply-templates select="*[position()=2]">
892 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
893 </xsl:apply-templates>
894 <xsl:text>> </xsl:text>
896 <xsl:call-template name="make_indent">
897 <xsl:with-param name="current_indent" select="$current_indent + 2"/> </xsl:call-template>
898 <xsl:text>CASE </xsl:text>
899 <xsl:apply-templates select="*[position()=3]">
900 <xsl:with-param name="current_indent" select="$current_indent + 8"/>
901 </xsl:apply-templates>
902 <xsl:text> OF </xsl:text>
903 <xsl:for-each select="piecewise/piece">
904 <!-- <xsl:for-each select="*[position() mod 2 = 0 and position()>3]">-->
906 <xsl:call-template name="make_indent">
907 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
910 <xsl:when test="position() = 1">
911 <xsl:text>  </xsl:text>
914 <xsl:text>| </xsl:text>
917 <xsl:apply-templates select="./*[2]"/>
918 <xsl:call-template name="mksymbol-1">
919 <xsl:with-param name="symbol" select="'RightArrow'"/>
920 <xsl:with-param name="color" select="'green'"/>
921 <xsl:with-param name="size" select="'+0'"/>
923 <xsl:variable name="body_size">
925 select="./*[1]/*[1]" mode="charcount"/>
928 <xsl:when test="$body_size > $framewidth">
930 <xsl:call-template name="make_indent">
931 <xsl:with-param name="current_indent"
932 select="$current_indent + 8"/>
936 <xsl:with-param name="current_indent"
937 select="$current_indent + 8"/>
938 </xsl:apply-templates>
941 <xsl:apply-templates select="./*[1]"
948 <xsl:apply-templates mode="inline" select="."/>
953 <xsl:when test="$name='fix'">
955 <xsl:when test="$charlength > $framewidth">
956 <xsl:text>FIX</xsl:text>
957 <xsl:value-of select="m:ci"/>
958 <xsl:text>{</xsl:text>
959 <xsl:for-each select="m:bvar">
961 <xsl:call-template name="make_indent">
962 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
964 <xsl:value-of select="m:ci"/>
965 <xsl:text>:</xsl:text>
966 <xsl:apply-templates select="m:type">
967 <xsl:with-param name="current_indent"
968 select="$current_indent + 5 + string-length(m:ci)"/>
969 </xsl:apply-templates>
971 <xsl:call-template name="make_indent">
972 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
974 <xsl:text>:=</xsl:text>
975 <xsl:apply-templates select="following-sibling::*[position() = 1]">
976 <xsl:with-param name="current_indent" select="$current_indent +2"/>
977 </xsl:apply-templates>
980 <xsl:call-template name="make_indent">
981 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
983 <xsl:text>}</xsl:text>
986 <xsl:apply-templates mode="inline" select="."/>
991 <xsl:when test="$name='cofix'">
993 <xsl:when test="($charlength + 10) > $framewidth">
994 <xsl:text>COFIX</xsl:text>
995 <xsl:value-of select="m:ci"/>
996 <xsl:text>{</xsl:text>
998 <xsl:call-template name="make_indent">
999 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1000 </xsl:call-template>
1001 <xsl:for-each select="m:bvar">
1002 <xsl:value-of select="m:ci"/>
1003 <xsl:text>:</xsl:text>
1004 <xsl:apply-templates select="m:type">
1005 <xsl:with-param name="current_indent"
1006 select="$current_indent + 5 + string-length(m:ci)"/>
1007 </xsl:apply-templates>
1009 <xsl:call-template name="make_indent">
1010 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1011 </xsl:call-template>
1012 <xsl:text>:=</xsl:text>
1013 <xsl:apply-templates select="following-sibling::*[position() = 1]">
1014 <xsl:with-param name="current_indent" select="$current_indent + 3"/>
1015 </xsl:apply-templates>
1019 <xsl:call-template name="make_indent">
1020 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1021 </xsl:call-template>
1022 <xsl:text>}</xsl:text>
1025 <xsl:apply-templates mode="inline" select="m:type"/>
1029 <xsl:when test="$name='let_in'">
1030 <xsl:text>let </xsl:text>
1031 <xsl:apply-templates select="m:bvar/m:ci"/>
1032 <xsl:text> := </xsl:text>
1033 <xsl:apply-templates select="*[3]">
1034 <xsl:with-param name="current_indent" select="$current_indent+14"/>
1035 </xsl:apply-templates>
1037 <xsl:call-template name="make_indent">
1038 <xsl:with-param name="current_indent" select="$current_indent"/>
1039 </xsl:call-template>
1040 <xsl:text>in </xsl:text>
1041 <xsl:apply-templates select="*[4]">
1042 <xsl:with-param name="current_indent" select="$current_indent+5"/>
1043 </xsl:apply-templates>
1046 <!-- ***************************************** -->
1047 <!-- *********** PROOF ELEMENTS ************** -->
1048 <!-- ***************************************** -->
1050 <xsl:when test="$name='proof'">
1051 <xsl:apply-templates select="*[position()=2]">
1052 <xsl:with-param name="current_indent" select="$current_indent"/>
1053 </xsl:apply-templates>
1055 <!-- <xsl:element name="br"/> -->
1056 <xsl:call-template name="make_indent">
1057 <xsl:with-param name="current_indent" select="$current_indent"/>
1058 </xsl:call-template>
1059 <FONT color="red">we proved </FONT>
1060 <xsl:apply-templates select="*[position()=3]">
1061 <xsl:with-param name="current_indent" select="$current_indent + 16"/>
1062 </xsl:apply-templates>
1065 <xsl:when test="$name='letin1'">
1066 <xsl:apply-templates select="*[position()=2]">
1067 <xsl:with-param name="current_indent" select="$current_indent"/>
1068 </xsl:apply-templates>
1070 <xsl:call-template name="make_indent">
1071 <xsl:with-param name="current_indent" select="$current_indent"/>
1072 </xsl:call-template>
1073 <xsl:apply-templates select="*[position()=3]">
1074 <xsl:with-param name="current_indent" select="$current_indent"/>
1075 </xsl:apply-templates>
1078 <xsl:when test="$name='letin'">
1079 <xsl:for-each select="*[position()>1 and last()>position()]">
1080 <xsl:apply-templates select=".">
1081 <xsl:with-param name="current_indent" select="$current_indent"/>
1082 </xsl:apply-templates>
1084 <xsl:call-template name="make_indent">
1085 <xsl:with-param name="current_indent" select="$current_indent"/>
1086 </xsl:call-template>
1088 <xsl:apply-templates select="*[position()=last()]">
1089 <xsl:with-param name="current_indent" select="$current_indent"/>
1090 </xsl:apply-templates>
1093 <xsl:when test="$name='let'">
1095 <xsl:apply-templates select="m:ci"/>
1097 <xsl:apply-templates select="*[3]">
1098 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
1099 </xsl:apply-templates>
1102 <xsl:when test="$name='rw_step'">
1104 <xsl:when test="name(*[2])='m:apply'">
1105 <xsl:apply-templates select="*[2]">
1106 <xsl:with-param name="current_indent" select="$current_indent"/>
1107 </xsl:apply-templates>
1110 <FONT color="red">Consider </FONT>
1111 <xsl:apply-templates select="*[2]"/>
1114 <xsl:variable name="charlength_first">
1115 <xsl:apply-templates select="*[3]/*[1]" mode="charcount"/>
1117 <xsl:variable name="charlength_second">
1118 <xsl:apply-templates select="*[4]/*[1]" mode="charcount"/>
1120 <xsl:variable name="charlength_side_proof">
1121 <xsl:apply-templates select="*[5]/*[1]" mode="charcount"/>
1123 <xsl:variable name="split1"
1124 select="$charlength_first + $charlength_second > $framewidth"/>
1125 <xsl:variable name="split2"
1126 select="$charlength_second + $charlength_side_proof > $framewidth"/>
1127 <!-- <xsl:value-of select="$current_indent"/> -->
1128 <!-- <xsl:value-of select="$charlength"/> -->
1130 <xsl:call-template name="make_indent">
1131 <xsl:with-param name="current_indent" select="$current_indent"/>
1132 </xsl:call-template>
1133 <FONT color="red">Rewrite </FONT>
1134 <xsl:apply-templates mode="inline" select="*[3]"/>
1135 <xsl:text> </xsl:text>
1136 <xsl:if test="$split1">
1138 <xsl:call-template name="make_indent">
1139 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1140 </xsl:call-template>
1142 <FONT color="red">with </FONT>
1143 <xsl:apply-templates mode="inline" select="*[4]"/>
1144 <xsl:text> </xsl:text>
1145 <xsl:if test="$split2">
1147 <xsl:call-template name="make_indent">
1148 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1149 </xsl:call-template>
1151 <FONT color="red">by </FONT>
1152 <xsl:apply-templates select="*[5]">
1153 <xsl:with-param name="current_indent" select="$current_indent+7"/>
1154 </xsl:apply-templates>
1156 <!-- rewrite and apply -->
1157 <xsl:when test="$name='rewrite_and_apply'">
1158 <xsl:apply-templates select="*[2]">
1159 <xsl:with-param name="current_indent" select="$current_indent"/>
1160 </xsl:apply-templates>
1162 <xsl:call-template name="make_indent">
1163 <xsl:with-param name="current_indent" select="$current_indent"/>
1164 </xsl:call-template>
1165 <FONT color="red">Then apply it to </FONT>
1166 <xsl:apply-templates select="*[position()>2]"/>
1168 <!-- by_induction -->
1169 <xsl:when test="$name='by_induction'">
1170 <FONT color="red">We prove </FONT>
1171 <xsl:apply-templates select="../*[3]">
1172 <xsl:with-param name="current_indent" select="$current_indent+18"/>
1173 </xsl:apply-templates>
1175 <xsl:call-template name="make_indent">
1176 <xsl:with-param name="current_indent" select="$current_indent"/>
1177 </xsl:call-template>
1178 <FONT color="red">by induction on </FONT>
1179 <xsl:apply-templates select="*[position()=last()]/*[position()=last()]">
1180 <xsl:with-param name="current_indent" select="$current_indent+30"/>
1181 </xsl:apply-templates>
1184 <xsl:call-template name="make_indent">
1185 <xsl:with-param name="current_indent" select="$current_indent"/>
1186 </xsl:call-template>
1187 <xsl:text>The induction property is</xsl:text>
1189 <xsl:call-template name="make_indent">
1190 <xsl:with-param name="current_indent" select="$current_indent"/>
1191 </xsl:call-template>
1192 <xsl:apply-templates select="*[3]">
1193 <xsl:with-param name="current_indent" select="$current_indent"/>
1194 </xsl:apply-templates>
1196 <xsl:apply-templates
1197 select="*[position()>3 and not(position()=last())]">
1198 <xsl:with-param name="current_indent" select="$current_indent+4"/>
1199 </xsl:apply-templates>
1201 <xsl:call-template name="make_indent">
1202 <xsl:with-param name="current_indent" select="$current_indent"/>
1203 </xsl:call-template>
1204 <xsl:text>End induction</xsl:text> -->
1206 <!-- inductive_case -->
1207 <xsl:when test="$name='inductive_case'">
1209 <xsl:call-template name="make_indent">
1210 <xsl:with-param name="current_indent" select="$current_indent"/>
1211 </xsl:call-template>
1212 <FONT color="red">Case </FONT>
1213 <xsl:apply-templates select="*[2]">
1214 <xsl:with-param name="current_indent" select="$current_indent +10"/>
1215 </xsl:apply-templates>
1216 <xsl:if test="*[3]/*[position()>1]">
1218 <xsl:call-template name="make_indent">
1219 <xsl:with-param name="current_indent" select="$current_indent+4"/>
1220 </xsl:call-template>
1221 <FONT color="red">By induction hypothesis, we have:</FONT>
1222 <xsl:for-each select="*[3]/*[position()>1]">
1224 <xsl:call-template name="make_indent">
1225 <xsl:with-param name="current_indent" select="$current_indent + 4"/>
1226 </xsl:call-template>
1227 <xsl:text>(</xsl:text>
1228 <xsl:apply-templates select="m:ci"/>
1229 <xsl:text>) </xsl:text>
1230 <xsl:apply-templates select="m:type">
1231 <xsl:with-param name="current_indent" select="$current_indent + 8"/>
1232 </xsl:apply-templates>
1236 <xsl:call-template name="make_indent">
1237 <xsl:with-param name="current_indent" select="$current_indent + 4"/>
1238 </xsl:call-template>
1239 <xsl:apply-templates select="*[4]">
1240 <xsl:with-param name="current_indent" select="$current_indent +4"/>
1241 </xsl:apply-templates>
1243 <xsl:call-template name="make_indent">
1244 <xsl:with-param name="current_indent" select="$current_indent"/>
1245 </xsl:call-template>
1246 <xsl:text>End Case</xsl:text> -->
1249 <xsl:when test="$name='case_lhs'">
1251 <xsl:when test="count(*)=2">
1252 <xsl:apply-templates mode="inline" select="*[2]"/>
1255 <xsl:text>(</xsl:text>
1256 <xsl:apply-templates mode="inline" select="*[2]"/>
1257 <xsl:for-each select="m:bvar">
1258 <xsl:text> </xsl:text>
1259 <xsl:apply-templates mode="inline" select="*[1]"/>
1260 <xsl:text>:</xsl:text>
1261 <xsl:apply-templates mode="inline" select="m:type/*[1]"/>
1263 <xsl:text>)</xsl:text>
1268 <xsl:when test="$name='false_ind'">
1269 <xsl:apply-templates select="*[3]">
1270 <xsl:with-param name="current_indent" select="$current_indent"/>
1271 </xsl:apply-templates>
1273 <xsl:call-template name="make_indent">
1274 <xsl:with-param name="current_indent" select="$current_indent"/>
1275 </xsl:call-template>
1276 <FONT color="red">Contradiction.</FONT>
1279 <xsl:when test="$name='and_ind'">
1281 <xsl:when test="name(*[2])='m:apply'">
1282 <xsl:apply-templates select="*[2]">
1283 <xsl:with-param name="current_indent" select="$current_indent"/>
1284 </xsl:apply-templates>
1287 <FONT color="red">Consider </FONT>
1288 <xsl:apply-templates select="*[2]"/>
1292 <xsl:call-template name="make_indent">
1293 <xsl:with-param name="current_indent" select="$current_indent"/>
1294 </xsl:call-template>
1295 <FONT color="red">In particular, we have</FONT>
1297 <xsl:call-template name="make_indent">
1298 <xsl:with-param name="current_indent" select="$current_indent"/>
1299 </xsl:call-template>
1301 <xsl:apply-templates select="*[3]"/>
1303 <xsl:apply-templates select="*[4]">
1304 <xsl:with-param name="current_indent" select="$current_indent + 9"/>
1305 </xsl:apply-templates>
1307 <xsl:call-template name="make_indent">
1308 <xsl:with-param name="current_indent" select="$current_indent"/>
1309 </xsl:call-template>
1311 <xsl:apply-templates select="*[5]"/>
1313 <xsl:apply-templates select="*[6]">
1314 <xsl:with-param name="current_indent" select="$current_indent + 9"/>
1315 </xsl:apply-templates>
1317 <xsl:call-template name="make_indent">
1318 <xsl:with-param name="current_indent" select="$current_indent"/>
1319 </xsl:call-template>
1320 <xsl:apply-templates select="*[7]">
1321 <xsl:with-param name="current_indent" select="$current_indent"/>
1322 </xsl:apply-templates>
1324 <!-- full_or_ind -->
1325 <xsl:when test="$name='full_or_ind'">
1327 <xsl:when test="name(*[2])='m:apply'">
1328 <xsl:apply-templates select="*[2]">
1329 <xsl:with-param name="current_indent" select="$current_indent"/>
1330 </xsl:apply-templates>
1333 <FONT color="red">Consider </FONT>
1334 <xsl:apply-templates select="*[2]"/>
1338 <xsl:call-template name="make_indent">
1339 <xsl:with-param name="current_indent" select="$current_indent"/>
1340 </xsl:call-template>
1341 <FONT color="red">We proceed by cases to prove </FONT>
1342 <xsl:apply-templates select="*[3]"/>
1344 <xsl:call-template name="make_indent">
1345 <xsl:with-param name="current_indent" select="$current_indent+4"/>
1346 </xsl:call-template>
1347 <FONT color="red">Left: suppose </FONT>
1348 <xsl:text>(</xsl:text>
1349 <xsl:value-of select="*[4]/m:bvar/m:ci"/>
1350 <xsl:text>) </xsl:text>
1351 <xsl:apply-templates
1352 select="*[4]/m:bvar/m:type/*[1]"/>
1354 <xsl:call-template name="make_indent">
1355 <xsl:with-param name="current_indent" select="$current_indent+15"/>
1356 </xsl:call-template>
1357 <xsl:apply-templates
1359 <xsl:with-param name="current_indent" select="$current_indent+15"/>
1360 </xsl:apply-templates>
1362 <xsl:call-template name="make_indent">
1363 <xsl:with-param name="current_indent" select="$current_indent+4"/>
1364 </xsl:call-template>
1365 <FONT color="red">Right: suppose </FONT>
1366 <xsl:text>(</xsl:text>
1367 <xsl:value-of select="*[5]/m:bvar/m:ci"/>
1368 <xsl:text>) </xsl:text>
1369 <xsl:apply-templates
1370 select="*[5]/m:bvar/m:type/*[1]"/>
1372 <xsl:call-template name="make_indent">
1373 <xsl:with-param name="current_indent" select="$current_indent+16"/>
1374 </xsl:call-template>
1375 <xsl:apply-templates
1377 <xsl:with-param name="current_indent" select="$current_indent+16"/>
1378 </xsl:apply-templates>
1381 <xsl:when test="$name='or_ind'">
1383 <xsl:when test="name(*[2])='m:apply'">
1384 <xsl:apply-templates select="*[2]">
1385 <xsl:with-param name="current_indent" select="$current_indent"/>
1386 </xsl:apply-templates>
1389 <FONT color="red">Consider </FONT>
1390 <xsl:apply-templates select="*[2]"/>
1394 <xsl:call-template name="make_indent">
1395 <xsl:with-param name="current_indent" select="$current_indent"/>
1396 </xsl:call-template>
1397 <FONT color="red">We prove </FONT>
1398 <xsl:apply-templates select="*[3]"/>
1399 <FONT color="red"> by cases:</FONT>
1401 <xsl:call-template name="make_indent">
1402 <xsl:with-param name="current_indent" select="$current_indent"/>
1403 </xsl:call-template>
1405 <xsl:apply-templates select="*[4]">
1406 <xsl:with-param name="current_indent" select="$current_indent"/>
1407 </xsl:apply-templates>
1409 <xsl:call-template name="make_indent">
1410 <xsl:with-param name="current_indent" select="$current_indent"/>
1411 </xsl:call-template>
1413 <xsl:apply-templates select="*[5]">
1414 <xsl:with-param name="current_indent" select="$current_indent"/>
1415 </xsl:apply-templates>
1418 <xsl:when test="$name='ex_ind'">
1420 <xsl:when test="name(*[2])='m:apply'">
1421 <xsl:apply-templates select="*[2]">
1422 <xsl:with-param name="current_indent" select="$current_indent"/>
1423 </xsl:apply-templates>
1426 <FONT color="red">Consider </FONT>
1427 <xsl:apply-templates select="*[2]">
1428 <xsl:with-param name="current_indent" select="$current_indent"/>
1429 </xsl:apply-templates>
1433 <xsl:call-template name="make_indent">
1434 <xsl:with-param name="current_indent" select="$current_indent"/>
1435 </xsl:call-template>
1436 <FONT color="red">Let </FONT>
1437 <xsl:apply-templates mode="inline" select="*[3]"/>
1439 <xsl:apply-templates mode="inline" select="*[4]"/>
1440 <FONT color="red"> such that</FONT>
1442 <xsl:call-template name="make_indent">
1443 <xsl:with-param name="current_indent" select="$current_indent"/>
1444 </xsl:call-template>
1446 <xsl:apply-templates mode="inline" select="*[5]"/>
1448 <xsl:apply-templates select="*[6]">
1449 <xsl:with-param name="current_indent" select="$current_indent +7"/>
1450 </xsl:apply-templates>
1452 <xsl:call-template name="make_indent">
1453 <xsl:with-param name="current_indent" select="$current_indent"/>
1454 </xsl:call-template>
1455 <xsl:apply-templates select="*[7]">
1456 <xsl:with-param name="current_indent" select="$current_indent"/>
1457 </xsl:apply-templates>
1459 <!-- ***************************************** -->
1460 <!-- *********** LAMBDA ELEMENTS ************** -->
1461 <!-- ***************************************** -->
1462 <xsl:when test="$name='subst'">
1463 <xsl:apply-templates select="*[3]"/>
1464 <xsl:text>[</xsl:text>
1465 <xsl:apply-templates select="*[4]"/>
1467 <xsl:when test="$uri != ''">
1469 <xsl:call-template name="mksymbol-1">
1470 <xsl:with-param name="symbol" select="$name"/>
1471 <xsl:with-param name="color" select="'blue'"/>
1472 <xsl:with-param name="size" select="'+0'"/>
1473 </xsl:call-template>
1477 <xsl:call-template name="mksymbol-1">
1478 <xsl:with-param name="symbol" select="$name"/>
1479 <xsl:with-param name="color" select="'blue'"/>
1480 <xsl:with-param name="size" select="'+0'"/>
1481 </xsl:call-template>
1484 <xsl:apply-templates select="*[2]"/>
1485 <xsl:text>]</xsl:text>
1488 <xsl:when test="$name='lift_with_base'">
1490 <xsl:apply-templates select="*[3]" mode="inline"/>
1493 <xsl:when test="$uri != ''">
1495 <xsl:call-template name="mksymbol-1">
1496 <xsl:with-param name="symbol" select="$name"/>
1497 <xsl:with-param name="color" select="'green'"/>
1498 <xsl:with-param name="size" select="'+0'"/>
1499 </xsl:call-template>
1503 <xsl:call-template name="mksymbol-1">
1504 <xsl:with-param name="symbol" select="$name"/>
1505 <xsl:with-param name="color" select="'green'"/>
1506 <xsl:with-param name="size" select="'+0'"/>
1507 </xsl:call-template>
1511 <xsl:apply-templates select="*[4]" mode="inline"/>
1513 <xsl:text>(</xsl:text>
1514 <xsl:apply-templates select="*[2]" mode="inline"/>
1515 <xsl:text>)</xsl:text>
1518 <xsl:when test="$name='lift'">
1520 <xsl:when test="$uri != ''">
1522 <xsl:call-template name="mksymbol-1">
1523 <xsl:with-param name="symbol" select="$name"/>
1524 <xsl:with-param name="color" select="'green'"/>
1525 <xsl:with-param name="size" select="'+0'"/>
1526 </xsl:call-template>
1530 <xsl:call-template name="mksymbol-1">
1531 <xsl:with-param name="symbol" select="$name"/>
1532 <xsl:with-param name="color" select="'green'"/>
1533 <xsl:with-param name="size" select="'+0'"/>
1534 </xsl:call-template>
1538 <xsl:apply-templates select="*[2]" mode="inline"/>
1540 <xsl:text>(</xsl:text>
1541 <xsl:apply-templates select="*[3]" mode="inline"/>
1542 <xsl:text>)</xsl:text>
1546 <xsl:when test="$name='beta_red1'">
1547 <xsl:apply-templates select="*[2]" mode="inline"/>
1549 <xsl:when test="$uri != ''">
1551 <xsl:call-template name="mksymbol-1">
1552 <xsl:with-param name="symbol" select="$name"/>
1553 <xsl:with-param name="color" select="'green'"/>
1554 <xsl:with-param name="size" select="'+0'"/>
1555 </xsl:call-template>
1557 <xsl:call-template name="mksymbol-1">
1558 <xsl:with-param name="symbol" select="'beta'"/>
1559 <xsl:with-param name="color" select="'green'"/>
1560 <xsl:with-param name="size" select="'+0'"/>
1561 </xsl:call-template>
1566 <xsl:call-template name="mksymbol-1">
1567 <xsl:with-param name="symbol" select="$name"/>
1568 <xsl:with-param name="color" select="'green'"/>
1569 <xsl:with-param name="size" select="'+0'"/>
1570 </xsl:call-template>
1572 <xsl:call-template name="mksymbol-1">
1573 <xsl:with-param name="symbol" select="'beta'"/>
1574 <xsl:with-param name="color" select="'green'"/>
1575 <xsl:with-param name="size" select="'+0'"/>
1576 </xsl:call-template>
1580 <xsl:apply-templates select="*[3]" mode="inline"/>
1583 <xsl:when test="$name='beta_red'">
1584 <xsl:apply-templates select="*[2]" mode="inline"/>
1586 <xsl:when test="$uri != ''">
1588 <xsl:call-template name="mksymbol-1">
1589 <xsl:with-param name="symbol" select="$name"/>
1590 <xsl:with-param name="color" select="'green'"/>
1591 <xsl:with-param name="size" select="'+0'"/>
1592 </xsl:call-template>
1594 <xsl:call-template name="mksymbol-1">
1595 <xsl:with-param name="symbol" select="'beta'"/>
1596 <xsl:with-param name="color" select="'green'"/>
1597 <xsl:with-param name="size" select="'+0'"/>
1598 </xsl:call-template>
1599 <xsl:text>*</xsl:text>
1604 <xsl:call-template name="mksymbol-1">
1605 <xsl:with-param name="symbol" select="$name"/>
1606 <xsl:with-param name="color" select="'green'"/>
1607 <xsl:with-param name="size" select="'+0'"/>
1608 </xsl:call-template>
1610 <xsl:call-template name="mksymbol-1">
1611 <xsl:with-param name="symbol" select="'beta'"/>
1612 <xsl:with-param name="color" select="'green'"/>
1613 <xsl:with-param name="size" select="'+0'"/>
1614 </xsl:call-template>
1615 <xsl:text>*</xsl:text>
1619 <xsl:apply-templates select="*[3]" mode="inline"/>
1622 <xsl:when test="$name='par_beta_red1'">
1623 <xsl:apply-templates select="*[2]" mode="inline"/>
1625 <xsl:when test="$uri != ''">
1627 <xsl:call-template name="mksymbol-1">
1628 <xsl:with-param name="symbol" select="$name"/>
1629 <xsl:with-param name="color" select="'green'"/>
1630 <xsl:with-param name="size" select="'+0'"/>
1631 </xsl:call-template>
1633 <xsl:call-template name="mksymbol-1">
1634 <xsl:with-param name="symbol" select="'beta'"/>
1635 <xsl:with-param name="color" select="'green'"/>
1636 <xsl:with-param name="size" select="'+0'"/>
1637 </xsl:call-template>
1642 <xsl:call-template name="mksymbol-1">
1643 <xsl:with-param name="symbol" select="$name"/>
1644 <xsl:with-param name="color" select="'green'"/>
1645 <xsl:with-param name="size" select="'+0'"/>
1646 </xsl:call-template>
1648 <xsl:call-template name="mksymbol-1">
1649 <xsl:with-param name="symbol" select="'beta'"/>
1650 <xsl:with-param name="color" select="'green'"/>
1651 <xsl:with-param name="size" select="'+0'"/>
1652 </xsl:call-template>
1656 <xsl:apply-templates select="*[3]" mode="inline"/>
1659 <xsl:when test="$name='par_beta_red'">
1660 <xsl:apply-templates select="*[2]" mode="inline"/>
1662 <xsl:when test="$uri != ''">
1664 <xsl:call-template name="mksymbol-1">
1665 <xsl:with-param name="symbol" select="$name"/>
1666 <xsl:with-param name="color" select="'green'"/>
1667 <xsl:with-param name="size" select="'+0'"/>
1668 </xsl:call-template>
1670 <xsl:call-template name="mksymbol-1">
1671 <xsl:with-param name="symbol" select="'beta'"/>
1672 <xsl:with-param name="color" select="'green'"/>
1673 <xsl:with-param name="size" select="'+0'"/>
1674 </xsl:call-template>
1675 <xsl:text>*</xsl:text>
1680 <xsl:call-template name="mksymbol-1">
1681 <xsl:with-param name="symbol" select="$name"/>
1682 <xsl:with-param name="color" select="'green'"/>
1683 <xsl:with-param name="size" select="'+0'"/>
1684 </xsl:call-template>
1686 <xsl:call-template name="mksymbol-1">
1687 <xsl:with-param name="symbol" select="'beta'"/>
1688 <xsl:with-param name="color" select="'green'"/>
1689 <xsl:with-param name="size" select="'+0'"/>
1690 </xsl:call-template>
1691 <xsl:text>*</xsl:text>
1695 <xsl:apply-templates select="*[3]" mode="inline"/>
1699 <xsl:when test="$name='forgetful'">
1701 <xsl:when test="$uri != ''">
1702 <a href="{$uri}">|</a>
1708 <xsl:apply-templates select="*[2]" mode="inline"/>
1710 <xsl:when test="$uri != ''">
1711 <a href="{$uri}">|</a>
1719 <!-- boolean algebra of redexes -->
1722 <xsl:when test="$name='isomorphic'">
1723 <xsl:apply-templates select="*[2]" mode="inline"/>
1725 <xsl:when test="$uri != ''">
1727 <xsl:call-template name="mksymbol-1">
1728 <xsl:with-param name="symbol" select="$name"/>
1729 <xsl:with-param name="color" select="'green'"/>
1730 <xsl:with-param name="size" select="'+0'"/>
1731 </xsl:call-template>
1735 <xsl:call-template name="mksymbol-1">
1736 <xsl:with-param name="symbol" select="$name"/>
1737 <xsl:with-param name="color" select="'green'"/>
1738 <xsl:with-param name="size" select="'+0'"/>
1739 </xsl:call-template>
1742 <xsl:apply-templates select="*[3]" mode="inline"/>
1746 <xsl:when test="$name='interp'">
1747 <font color="green">[</font>
1748 <xsl:apply-templates select="*[2]"/>
1749 <font color="green">]</font>
1757 <xsl:template match="m:lambda">
1758 <xsl:param name="current_indent" select="0"/>
1759 <xsl:variable name="charlength">
1760 <xsl:apply-templates select="*[position()=1]" mode="charcount"/>
1761 <!-- <xsl:apply-templates select="." mode="charcount"/> -->
1763 <!-- <xsl:value-of select="$charlength"/> -->
1764 <!-- <xsl:value-of select="$current_indent"/> -->
1766 <xsl:when test="$charlength > $framewidth">
1768 <xsl:call-template name="mksymbol-1">
1769 <xsl:with-param name="symbol" select="'lambda'"/>
1770 <xsl:with-param name="color" select="'red'"/>
1771 <xsl:with-param name="size" select="'+2'"/>
1772 </xsl:call-template>
1773 <xsl:apply-templates select="m:bvar/m:ci"/>
1774 <xsl:text>:</xsl:text>
1775 <xsl:apply-templates select="m:bvar/m:type">
1776 <xsl:with-param name="current_indent"
1777 select="$current_indent + 4 + 2*string-length(m:bvar/m:ci)"/>
1778 </xsl:apply-templates><br/>
1779 <xsl:call-template name="make_indent">
1780 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1781 </xsl:call-template>
1782 <xsl:text>.</xsl:text>
1783 <xsl:apply-templates select="*[position()=2]">
1784 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1785 </xsl:apply-templates>
1788 <xsl:apply-templates mode="inline" select="."/>
1794 <xsl:template match="m:ci">
1796 <xsl:when test="boolean(@definitionURL)">
1797 <a href="{@definitionURL}">
1798 <xsl:apply-templates/>
1802 <xsl:value-of select="."/>
1809 <xsl:template match="m:ci|m:csymbol" mode="charcount">
1810 <xsl:param name="incurrent_length" select="0"/>
1812 <xsl:when test="$framewidth >= ($incurrent_length + string-length())">
1813 <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>
1815 <xsl:when test="string($siblength) = """>
1816 <xsl:value-of select="$incurrent_length + string-length()"/>
1819 <xsl:value-of select="number($siblength)"/>
1824 <xsl:value-of select="$incurrent_length + string-length()"/>
1829 <xsl:template match="*" mode="charcount">
1830 <xsl:param name="incurrent_length" select="0"/>
1832 <xsl:when test="count(child::*) = 0">
1833 <xsl:value-of select="$incurrent_length"/>
1836 <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>
1838 <xsl:when test="$framewidth >= number($childlength)">
1839 <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>
1841 <xsl:when test="string($siblength) = """>
1842 <xsl:value-of select="number($childlength)"/>
1845 <xsl:value-of select="number($siblength)"/>
1850 <xsl:value-of select="number($childlength)"/>
1858 <!--***********************************************************************-->
1860 <!--***********************************************************************-->
1864 <xsl:template match="Definition">
1865 <xsl:param name="current_indent" select="0"/>
1867 DEFINITION <xsl:value-of select="@name"/>(<xsl:if test="string(./Params) != """><xsl:value-of select="Params"/></xsl:if>)<br/>
1869 <xsl:call-template name="make_indent">
1870 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
1871 </xsl:call-template>
1872 <xsl:apply-templates select="type/*[1]">
1873 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
1874 </xsl:apply-templates><br/>
1876 <xsl:call-template name="make_indent">
1877 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
1878 </xsl:call-template>
1879 <xsl:apply-templates select="body/*[1]">
1880 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
1881 </xsl:apply-templates>
1887 <xsl:template match="Axiom">
1888 <xsl:param name="current_indent" select="0"/>
1890 AXIOM <xsl:value-of select="@name"/>(<xsl:if test="string(./Params) != """><xsl:value-of select="Params"/></xsl:if>)<br/>
1892 <xsl:call-template name="make_indent">
1893 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
1894 </xsl:call-template>
1895 <xsl:apply-templates select="type/*[1]">
1896 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
1897 </xsl:apply-templates>
1901 <!-- UNFINISHED PROOF -->
1903 <xsl:template match="CurrentProof">
1904 <xsl:param name="current_indent" select="0"/>
1906 UNFINISHED PROOF <xsl:value-of select="@name"/>(<xsl:if test="string(./Params) != """><xsl:value-of select="Params"/></xsl:if>)<br/>
1907 THESIS: <xsl:apply-templates select="type/*[1]">
1908 <xsl:with-param name="current_indent" select="$current_indent + 8"/>
1909 </xsl:apply-templates><br/>
1911 <xsl:for-each select="Conjecture">
1913 <xsl:call-template name="make_indent">
1914 <xsl:with-param name="current_indent" select="$current_indent + 8"/>
1915 </xsl:call-template>
1916 <xsl:value-of select="./@no"/> :
1917 <xsl:apply-templates select="./*[1]">
1918 <xsl:with-param name="current_indent" select="$current_indent + 11"/>
1919 </xsl:apply-templates>
1923 <xsl:apply-templates select="body/*[1]">
1924 <xsl:with-param name="current_indent" select="$current_indent + 8"/>
1925 </xsl:apply-templates>
1929 <!-- MUTUAL INDUCTIVE DEFINITION -->
1931 <xsl:template match="InductiveDefinition">
1932 <xsl:param name="current_indent" select="0"/>
1934 <xsl:for-each select="InductiveType">
1936 <xsl:when test="position() = 1">
1938 <xsl:when test="string(./@inductive) = "true"">
1939 INDUCTIVE DEFINITION
1942 COINDUCTIVE DEFINITION
1950 <xsl:value-of select="./@name"/>(<xsl:if test="string(../Params) != """><xsl:value-of select="../Params"/></xsl:if>)
1952 <xsl:if test="string(../Param) != """>
1953 <xsl:for-each select="../Param">
1954 <xsl:value-of select="./@name"/>
1956 <xsl:apply-templates select="*"/>
1961 <xsl:apply-templates select="./arity/*[1]">
1962 <xsl:with-param name="current_indent" select="$current_indent + 9"/>
1963 </xsl:apply-templates> <br/>
1965 <xsl:for-each select="./Constructor">
1967 <xsl:call-template name="make_indent">
1968 <xsl:with-param name="current_indent" select="$current_indent + 3"/>
1969 </xsl:call-template>
1971 <xsl:when test="position() = 1">
1972 <xsl:text>  </xsl:text>
1975 <xsl:text>| </xsl:text>
1978 <xsl:value-of select="./@name"/>
1979 <xsl:text>: </xsl:text>
1980 <xsl:apply-templates select="./*[1]">
1981 <xsl:with-param name="current_indent" select="$current_indent + 2*string-length(./@name) + 5"/>
1982 </xsl:apply-templates>
1990 <xsl:template match="Variable">
1991 <xsl:param name="current_indent" select="0"/>
1993 VARIABLE <xsl:value-of select="@name"/><br/>
1994 TYPE = <xsl:apply-templates select="type/*[1]">
1995 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
1996 </xsl:apply-templates>
2000 <!--***********************************************************************-->
2002 <!--***********************************************************************-->
2006 <xsl:template match="SECTION">
2007 <xsl:param name="current_indent" select="0"/>
2008 <h1>BEGIN OF SECTION</h1>
2009 <xsl:apply-templates/>
2010 <h1>END OF SECTION</h1>