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="'®'"/>
86 <FONT FACE="symbol" SIZE="{$size}" mathcolor="{$color}">
87 <xsl:value-of select="$fontsymbol"/>
91 <xsl:variable name="unicodesymbol">
93 <xsl:when test="$symbol = 'forall'">
94 <xsl:value-of select="'∀'"/>
96 <xsl:when test="$symbol = 'lambda'">
97 <xsl:value-of select="'λ'"/>
99 <xsl:when test="$symbol = 'prod'">
100 <xsl:value-of select="'Π'"/>
102 <xsl:when test="$symbol = 'arrow'">
103 <xsl:value-of select="'→'"/>
107 <FONT color="{$color}">
108 <xsl:value-of select="$unicodesymbol"/>
114 <xsl:template match="/">
115 <xsl:param name="current_indent" select="0"/>
117 <xsl:when test="$type = 'standalone'">
120 <title> <xsl:value-of select="$CICURI"/> </title> <!-- FG -->
121 <style> A { text-decoration: none } </style>
123 <body bgcolor="white">
124 <xsl:apply-templates>
125 <xsl:with-param name="current_indent" select="0"/>
126 </xsl:apply-templates>
132 <xsl:apply-templates>
133 <xsl:with-param name="current_indent" select="0"/>
134 </xsl:apply-templates>
140 <!--***********************************************************************-->
142 <!--***********************************************************************-->
144 <xsl:template name="make_indent">
145 <xsl:param name="current_indent" select="0"/>
146 <xsl:if test="$current_indent > 0">
147 <xsl:text> </xsl:text>
148 <xsl:call-template name="make_indent">
149 <xsl:with-param name="current_indent" select="$current_indent - 1"/>
154 <!-- Syntactic Sugar -->
155 <xsl:template match="m:type">
156 <xsl:param name="current_indent" select="0"/>
157 <xsl:apply-templates>
158 <xsl:with-param name="current_indent"
159 select="$current_indent"/>
160 </xsl:apply-templates>
163 <xsl:template match="m:condition">
164 <xsl:param name="current_indent" select="0"/>
165 <xsl:apply-templates>
166 <xsl:with-param name="current_indent"
167 select="$current_indent"/>
168 </xsl:apply-templates>
171 <xsl:template match="m:math">
172 <xsl:param name="current_indent" select="0"/>
173 <xsl:apply-templates>
174 <xsl:with-param name="current_indent"
175 select="$current_indent"/>
176 </xsl:apply-templates>
179 <!--*********************************************************************-->
181 <!--*********************************************************************-->
184 <xsl:template mode="inline" match="m:ci">
186 <xsl:when test="boolean(@definitionURL)">
187 <a href="{@definitionURL}">
188 <xsl:apply-templates/>
192 <xsl:value-of select="."/>
199 <xsl:template match="m:apply[m:csymbol]" mode="inline">
200 <xsl:variable name="name">
201 <xsl:value-of select="m:csymbol"/>
205 <xsl:when test="$name='forall'">
206 <xsl:call-template name="mksymbol-1">
207 <xsl:with-param name="symbol" select="$name"/>
208 <xsl:with-param name="color" select="'blue'"/>
209 <xsl:with-param name="size" select="'+2'"/>
211 <xsl:apply-templates select="m:bvar/m:ci"/>
212 <xsl:text>:</xsl:text>
213 <xsl:apply-templates mode="inline" select="m:bvar/m:type"/>
214 <xsl:text>.</xsl:text>
215 <xsl:apply-templates mode="inline" select="*[position()=3]"/>
217 <xsl:when test="$name='prod'">
218 <xsl:call-template name="mksymbol-1">
219 <xsl:with-param name="symbol" select="$name"/>
220 <xsl:with-param name="color" select="'blue'"/>
221 <xsl:with-param name="size" select="'+2'"/>
223 <xsl:apply-templates mode="inline" select="m:bvar/m:ci"/>
224 <xsl:text>:</xsl:text>
225 <xsl:apply-templates mode="inline" select="m:bvar/m:type"/>
226 <xsl:text>.</xsl:text>
227 <xsl:apply-templates mode="inline" select="*[position()=3]"/>
230 <xsl:when test="$name='arrow'">
231 <xsl:text>(</xsl:text>
232 <xsl:apply-templates mode="inline" select="*[position()=2]"/>
233 <xsl:call-template name="mksymbol-1">
234 <xsl:with-param name="symbol" select="$name"/>
235 <xsl:with-param name="color" select="'blue'"/>
236 <xsl:with-param name="size" select="'+0'"/>
238 <xsl:apply-templates mode="inline" select="*[position()=3]"/>
239 <xsl:text>)</xsl:text>
242 <xsl:when test="$name='app'">
243 <xsl:text>(</xsl:text>
244 <xsl:apply-templates mode="inline" select="*[position()=2]"/>
245 <xsl:for-each select="*[position()>2]">
246 <xsl:text> </xsl:text>
247 <xsl:apply-templates mode="inline" select="."/>
249 <xsl:text>)</xsl:text>
252 <xsl:when test="$name='cast'">
253 <xsl:text>(</xsl:text>
254 <xsl:apply-templates mode="inline" select="*[position()=2]"/>
255 <xsl:text>:></xsl:text>
256 <xsl:apply-templates mode="inline" select="*[position()=3]"/>
257 <xsl:text>)</xsl:text>
259 <xsl:when test="$name='Prop'">
260 <FONT color="violet">Prop</FONT>
262 <xsl:when test="$name='Set'">
263 <FONT color="violet">Set</FONT>
265 <xsl:when test="$name='Type'">
266 <FONT color="violet">Type</FONT>
269 <xsl:when test="$name='mutcase'">
270 <xsl:text><</xsl:text>
271 <xsl:apply-templates mode="inline" select="*[position()=2]"/>
272 <xsl:text>> </xsl:text>
273 <FONT color="red">CASE </FONT>
274 <xsl:apply-templates mode="inline" select="*[position()=3]"/>
275 <FONT color="red"> OF </FONT>
276 <xsl:for-each select="*[position() mod 2 = 0 and position()>3]">
278 <xsl:when test="not(position() = 1)">
279 <xsl:text> | </xsl:text>
282 <xsl:apply-templates mode="inline" select="."/>
283 <FONT FACE="Symbol" SIZE="+0" mathcolor="green">Þ</FONT>
284 <xsl:apply-templates mode="inline"
285 select="following-sibling::*[position()= 1]"/>
289 <xsl:when test="$name='fix'">
290 <FONT color="red">FIX</FONT>
291 <xsl:value-of select="m:ci"/>
292 <xsl:text>{</xsl:text>
293 <xsl:for-each select="m:bvar">
294 <xsl:value-of select="m:ci"/>
295 <xsl:text>:</xsl:text>
296 <xsl:apply-templates mode="inline" select="m:type"/>
297 <xsl:text>:=</xsl:text>
298 <xsl:apply-templates mode="inline"
299 select="following-sibling::*[position() = 1]"/>
301 <xsl:when test="position()=last()">
302 <xsl:text>}</xsl:text>
305 <xsl:text>;</xsl:text>
311 <xsl:when test="$name='cofix'">
312 <xsl:text>COFIX</xsl:text>
313 <xsl:value-of select="m:ci"/>
314 <xsl:text>{</xsl:text>
315 <xsl:for-each select="m:bvar">
316 <xsl:value-of select="m:ci"/>
317 <xsl:text>:</xsl:text>
318 <xsl:apply-templates mode="inline" select="m:type"/>
319 <xsl:text>:=</xsl:text>
320 <xsl:apply-templates mode="inline"
321 select="following-sibling::*[position() = 1]"/>
323 <xsl:when test="position()=last()">
324 <xsl:text>}</xsl:text>
327 <xsl:text>;</xsl:text>
333 <xsl:when test="$name='proof'">
334 <xsl:apply-templates mode="inline" select="*[position()=2]"/>
335 <FONT color="red"> proves </FONT>
336 <xsl:apply-templates mode="inline" select="*[position()=3]"/>
339 <xsl:when test="$name='false_ind'">
340 <xsl:apply-templates mode="inline" select="*[3]"/>
341 <FONT color="red">Contradiction.</FONT>
344 <xsl:when test="$name='and_ind'">
345 <FONT color="red">From </FONT>
346 <xsl:apply-templates select="*[2]"/>
347 <FONT color="red"> we get</FONT>
349 <xsl:apply-templates select="*[3]"/>
351 <xsl:apply-templates mode="inline" select="*[4]"/>
352 <FONT color="red"> and </FONT>
354 <xsl:apply-templates select="*[5]"/>
356 <xsl:apply-templates mode="inline" select="*[6]"/>
358 <FONT color="red"> hence </FONT>
359 <xsl:apply-templates mode="inline" select="*[7]"/>
362 <xsl:when test="$name='subst'">
363 <xsl:apply-templates select="*[3]" mode="inline"/>
364 <xsl:text>[</xsl:text>
365 <xsl:apply-templates select="*[4]" mode="inline"/>
366 <a href="{*[1]/@definitionURL}">
367 <FONT color="green" FACE="symbol">
368 <xsl:text>¬</xsl:text>
371 <xsl:apply-templates select="*[2]" mode="inline"/>
372 <xsl:text>]</xsl:text>
375 <xsl:when test="$name='lift_with_base'">
377 <xsl:apply-templates select="*[3]" mode="inline"/>
379 <a href="{*[1]/@definitionURL}">
380 <FONT color="green" FACE="symbol">
381 <xsl:text>­</xsl:text>
385 <xsl:apply-templates select="*[4]" mode="inline"/>
387 <xsl:text>(</xsl:text>
388 <xsl:apply-templates select="*[2]" mode="inline"/>
389 <xsl:text>)</xsl:text>
392 <xsl:when test="$name='lift'">
393 <a href="{*[1]/@definitionURL}">
394 <FONT color="green" FACE="symbol">
395 <xsl:text>­</xsl:text>
399 <xsl:apply-templates select="*[2]" mode="inline"/>
401 <xsl:text>(</xsl:text>
402 <xsl:apply-templates select="*[3]" mode="inline"/>
403 <xsl:text>)</xsl:text>
407 <xsl:when test="$name='beta_red1'">
408 <xsl:apply-templates select="*[2]" mode="inline"/>
409 <a href="{*[1]/@definitionURL}">
410 <FONT color="green" FACE="symbol">
411 <xsl:text>®</xsl:text>
414 <FONT color="green" FACE="symbol">
415 <xsl:text>b</xsl:text>
419 <xsl:apply-templates select="*[3]" mode="inline"/>
422 <xsl:when test="$name='beta_red'">
423 <xsl:apply-templates select="*[2]" mode="inline"/>
424 <a href="{*[1]/@definitionURL}">
425 <FONT color="green" FACE="symbol">
426 <xsl:text>®</xsl:text>
429 <FONT color="green" FACE="symbol">
430 <xsl:text>b*</xsl:text>
434 <xsl:apply-templates select="*[3]" mode="inline"/>
437 <xsl:when test="$name='par_beta_red1'">
438 <xsl:apply-templates select="*[2]" mode="inline"/>
439 <a href="{*[1]/@definitionURL}">
440 <FONT color="green" FACE="symbol">
441 <xsl:text>Þ</xsl:text>
444 <FONT color="green" FACE="symbol">
445 <xsl:text>b</xsl:text>
449 <xsl:apply-templates select="*[3]" mode="inline"/>
452 <xsl:when test="$name='par_beta_red'">
453 <xsl:apply-templates select="*[2]" mode="inline"/>
454 <a href="{*[1]/@definitionURL}">
455 <FONT color="green" FACE="symbol">
456 <xsl:text>Þ</xsl:text>
459 <FONT color="green" FACE="symbol">
460 <xsl:text>b*</xsl:text>
464 <xsl:apply-templates select="*[3]" mode="inline"/>
468 <xsl:when test="$name='forgetful'">
469 <a href="{*[1]/@definitionURL}">|</a>
470 <xsl:apply-templates select="*[2]" mode="inline"/>
471 <a href="{*[1]/@definitionURL}">|</a>
474 <!-- boolean algebra of redexes -->
477 <xsl:when test="$name='isomorphic'">
478 <xsl:apply-templates select="*[2]" mode="inline"/>
479 <a href="{*[1]/@definitionURL}">
480 <FONT color="green" FACE="symbol">
481 <xsl:text>@</xsl:text>
484 <xsl:apply-templates select="*[3]" mode="inline"/>
488 <xsl:when test="$name='interp'">
489 <font color="green">[</font>
490 <xsl:apply-templates select="*[2]"/>
491 <font color="green">]</font>
497 <xsl:template mode="inline" match="m:lambda">
498 <xsl:call-template name="mksymbol-1">
499 <xsl:with-param name="symbol" select="'lambda'"/>
500 <xsl:with-param name="color" select="'red'"/>
501 <xsl:with-param name="size" select="'+2'"/>
503 <xsl:apply-templates select="m:bvar/m:ci"/>
504 <xsl:text>:</xsl:text>
505 <xsl:apply-templates mode="inline" select="m:bvar/m:type"/>
506 <xsl:text>.</xsl:text>
507 <xsl:apply-templates mode="inline" select="*[position()=2]"/>
510 <!--*********************************************************************-->
511 <!-- COUNTING MODE -->
512 <!--*********************************************************************-->
514 <xsl:template match="m:apply[m:csymbol]">
515 <xsl:param name="current_indent" select="0"/>
516 <xsl:param name="width" select="$framewidth"/>
517 <xsl:variable name="name">
518 <xsl:value-of select="m:csymbol"/>
520 <xsl:variable name="charlength">
521 <xsl:apply-templates select="m:csymbol" mode="charcount"/>
523 <!-- <xsl:value-of select="$current_indent"/> -->
524 <!-- <xsl:value-of select="$charlength"/> -->
527 <xsl:when test="$name='forall'">
529 <xsl:when test="$charlength > $framewidth">
531 <xsl:call-template name="mksymbol-1">
532 <xsl:with-param name="symbol" select="$name"/>
533 <xsl:with-param name="color" select="'blue'"/>
534 <xsl:with-param name="size" select="'+2'"/>
536 <xsl:apply-templates select="m:bvar/m:ci"/>
537 <xsl:text>:</xsl:text>
538 <xsl:apply-templates select="m:bvar/m:type">
539 <xsl:with-param name="current_indent"
540 select="$current_indent + 5 + 2*string-length(m:bvar/m:ci)"/>
541 </xsl:apply-templates>
543 <xsl:call-template name="make_indent">
544 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
546 <xsl:text>.</xsl:text>
547 <xsl:apply-templates select="*[position()=3]">
548 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
549 </xsl:apply-templates>
552 <xsl:apply-templates mode="inline" select="."/>
557 <xsl:when test="$name='prod'">
559 <xsl:when test="$charlength > $framewidth">
560 <xsl:call-template name="mksymbol-1">
561 <xsl:with-param name="symbol" select="$name"/>
562 <xsl:with-param name="color" select="'blue'"/>
563 <xsl:with-param name="size" select="'+2'"/>
565 <xsl:apply-templates select="m:bvar/m:ci"/>
566 <xsl:text>:</xsl:text>
567 <xsl:apply-templates select="m:bvar/m:type">
568 <xsl:with-param name="current_indent"
569 select="$current_indent + 5 + 2*string-length(m:bvar/m:ci)"/>
570 </xsl:apply-templates><br/>
571 <xsl:call-template name="make_indent">
572 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
574 <xsl:text>.</xsl:text>
575 <xsl:apply-templates select="*[position()=3]">
576 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
577 </xsl:apply-templates>
580 <xsl:apply-templates mode="inline" select="."/>
585 <xsl:when test="$name='arrow'">
587 <xsl:when test="$charlength > $framewidth">
588 <xsl:text>(</xsl:text>
589 <xsl:apply-templates select="*[position()=2]">
590 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
591 </xsl:apply-templates>
593 <xsl:call-template name="make_indent">
594 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
597 <xsl:call-template name="mksymbol-1">
598 <xsl:with-param name="symbol" select="$name"/>
599 <xsl:with-param name="color" select="'blue'"/>
600 <xsl:with-param name="size" select="'+2'"/>
602 <xsl:apply-templates select="*[position()=3]">
603 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
604 </xsl:apply-templates>
605 <xsl:text>)</xsl:text>
608 <xsl:apply-templates mode="inline" select="."/>
613 <xsl:when test="$name='app'">
615 <xsl:when test="$charlength > $framewidth">
616 <xsl:text>(</xsl:text>
617 <xsl:apply-templates select="*[position()=2]">
618 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
619 </xsl:apply-templates>
620 <xsl:for-each select="*[position()>2]">
622 <xsl:call-template name="make_indent">
623 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
625 <xsl:apply-templates select=".">
626 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
627 </xsl:apply-templates>
629 <xsl:text>)</xsl:text>
632 <xsl:apply-templates mode="inline" select="."/>
636 <xsl:when test="$name='cast'">
638 <xsl:when test="$showcast = 1">
640 <xsl:when test="$charlength > $framewidth">
641 <xsl:text>(</xsl:text>
642 <xsl:apply-templates select="*[position()=2]">
643 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
644 </xsl:apply-templates><br/>
645 <xsl:call-template name="make_indent">
646 <xsl:with-param name="current_indent" select="$current_indent + 2"/> </xsl:call-template>
647 <xsl:text>:></xsl:text>
648 <xsl:apply-templates select="*[position()=3]">
649 <xsl:with-param name="current_indent" select="$current_indent + 3"/>
650 </xsl:apply-templates>
651 <xsl:text>)</xsl:text>
654 <xsl:apply-templates mode="inline" select="."/>
659 <xsl:apply-templates select="*[position()=2]">
660 <xsl:with-param name="current_indent" select="$current_indent"/>
661 </xsl:apply-templates>
665 <xsl:when test="$name='Prop'">
666 <xsl:text>Prop</xsl:text>
668 <xsl:when test="$name='Set'">
669 <xsl:text>Set</xsl:text>
671 <xsl:when test="$name='Type'">
672 <xsl:text>Type</xsl:text>
674 <xsl:when test="$name='mutcase'">
676 <xsl:when test="$charlength > $framewidth">
677 <xsl:text><</xsl:text>
678 <xsl:apply-templates select="*[position()=2]">
679 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
680 </xsl:apply-templates>
681 <xsl:text>> </xsl:text>
683 <xsl:call-template name="make_indent">
684 <xsl:with-param name="current_indent" select="$current_indent + 2"/> </xsl:call-template>
685 <xsl:text>CASE </xsl:text>
686 <xsl:apply-templates select="*[position()=3]">
687 <xsl:with-param name="current_indent" select="$current_indent + 8"/>
688 </xsl:apply-templates>
689 <xsl:text> OF </xsl:text>
690 <xsl:for-each select="*[position() mod 2 = 0 and position()>3]">
692 <xsl:call-template name="make_indent">
693 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
696 <xsl:when test="position() = 1">
697 <xsl:text>  </xsl:text>
700 <xsl:text>| </xsl:text>
703 <xsl:apply-templates select="."/>
704 <FONT FACE="Symbol" SIZE="+0" mathcolor="green">Þ</FONT>
705 <xsl:variable name="body_size">
707 select="following-sibling::*[1]/*[1]" mode="charcount"/>
710 <xsl:when test="$body_size > $framewidth">
712 <xsl:call-template name="make_indent">
713 <xsl:with-param name="current_indent"
714 select="$current_indent + 8"/>
717 select="following-sibling::*[position()= 1]">
718 <xsl:with-param name="current_indent"
719 select="$current_indent + 8"/>
720 </xsl:apply-templates>
723 <xsl:apply-templates select="following-sibling::*[position()= 1]"
730 <xsl:apply-templates mode="inline" select="."/>
735 <xsl:when test="$name='fix'">
737 <xsl:when test="$charlength > $framewidth">
738 <xsl:text>FIX</xsl:text>
739 <xsl:value-of select="m:ci"/>
740 <xsl:text>{</xsl:text>
741 <xsl:for-each select="m:bvar">
743 <xsl:call-template name="make_indent">
744 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
746 <xsl:value-of select="m:ci"/>
747 <xsl:text>:</xsl:text>
748 <xsl:apply-templates select="m:type">
749 <xsl:with-param name="current_indent"
750 select="$current_indent + 5 + string-length(m:ci)"/>
751 </xsl:apply-templates>
753 <xsl:call-template name="make_indent">
754 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
756 <xsl:text>:=</xsl:text>
757 <xsl:apply-templates select="following-sibling::*[position() = 1]">
758 <xsl:with-param name="current_indent" select="$current_indent +2"/>
759 </xsl:apply-templates>
762 <xsl:call-template name="make_indent">
763 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
765 <xsl:text>}</xsl:text>
768 <xsl:apply-templates mode="inline" select="."/>
773 <xsl:when test="$name='cofix'">
775 <xsl:when test="($charlength + 10) > $framewidth">
776 <xsl:text>COFIX</xsl:text>
777 <xsl:value-of select="m:ci"/>
778 <xsl:text>{</xsl:text>
780 <xsl:call-template name="make_indent">
781 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
783 <xsl:for-each select="m:bvar">
784 <xsl:value-of select="m:ci"/>
785 <xsl:text>:</xsl:text>
786 <xsl:apply-templates select="m:type">
787 <xsl:with-param name="current_indent"
788 select="$current_indent + 5 + string-length(m:ci)"/>
789 </xsl:apply-templates>
791 <xsl:call-template name="make_indent">
792 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
794 <xsl:text>:=</xsl:text>
795 <xsl:apply-templates select="following-sibling::*[position() = 1]">
796 <xsl:with-param name="current_indent" select="$current_indent + 3"/>
797 </xsl:apply-templates>
801 <xsl:call-template name="make_indent">
802 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
804 <xsl:text>}</xsl:text>
807 <xsl:apply-templates mode="inline" select="m:type"/>
811 <xsl:when test="$name='let_in'">
812 <xsl:text>let </xsl:text>
813 <xsl:apply-templates select="m:bvar/m:ci"/>
814 <xsl:text> := </xsl:text>
815 <xsl:apply-templates select="*[3]">
816 <xsl:with-param name="current_indent" select="$current_indent+14"/>
817 </xsl:apply-templates>
819 <xsl:call-template name="make_indent">
820 <xsl:with-param name="current_indent" select="$current_indent"/>
822 <xsl:text>in </xsl:text>
823 <xsl:apply-templates select="*[4]">
824 <xsl:with-param name="current_indent" select="$current_indent+5"/>
825 </xsl:apply-templates>
828 <!-- ***************************************** -->
829 <!-- *********** PROOF ELEMENTS ************** -->
830 <!-- ***************************************** -->
832 <xsl:when test="$name='proof'">
833 <xsl:apply-templates select="*[position()=2]">
834 <xsl:with-param name="current_indent" select="$current_indent"/>
835 </xsl:apply-templates>
837 <!-- <xsl:element name="br"/> -->
838 <xsl:call-template name="make_indent">
839 <xsl:with-param name="current_indent" select="$current_indent"/>
841 <FONT color="red">we proved </FONT>
842 <xsl:apply-templates select="*[position()=3]">
843 <xsl:with-param name="current_indent" select="$current_indent + 16"/>
844 </xsl:apply-templates>
847 <xsl:when test="$name='letin1'">
848 <xsl:apply-templates select="*[position()=2]">
849 <xsl:with-param name="current_indent" select="$current_indent"/>
850 </xsl:apply-templates>
852 <xsl:call-template name="make_indent">
853 <xsl:with-param name="current_indent" select="$current_indent"/>
855 <xsl:apply-templates select="*[position()=3]">
856 <xsl:with-param name="current_indent" select="$current_indent"/>
857 </xsl:apply-templates>
860 <xsl:when test="$name='letin'">
861 <xsl:for-each select="*[position()>1 and last()>position()]">
862 <xsl:apply-templates select=".">
863 <xsl:with-param name="current_indent" select="$current_indent"/>
864 </xsl:apply-templates>
866 <xsl:call-template name="make_indent">
867 <xsl:with-param name="current_indent" select="$current_indent"/>
870 <xsl:apply-templates select="*[position()=last()]">
871 <xsl:with-param name="current_indent" select="$current_indent"/>
872 </xsl:apply-templates>
875 <xsl:when test="$name='let'">
877 <xsl:apply-templates select="m:ci"/>
879 <xsl:apply-templates select="*[3]">
880 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
881 </xsl:apply-templates>
884 <xsl:when test="$name='rw_step'">
886 <xsl:when test="name(*[2])='m:apply'">
887 <xsl:apply-templates select="*[2]">
888 <xsl:with-param name="current_indent" select="$current_indent"/>
889 </xsl:apply-templates>
892 <FONT color="red">Consider </FONT>
893 <xsl:apply-templates select="*[2]"/>
896 <xsl:variable name="charlength_first">
897 <xsl:apply-templates select="*[3]/*[1]" mode="charcount"/>
899 <xsl:variable name="charlength_second">
900 <xsl:apply-templates select="*[4]/*[1]" mode="charcount"/>
902 <xsl:variable name="charlength_side_proof">
903 <xsl:apply-templates select="*[5]/*[1]" mode="charcount"/>
905 <xsl:variable name="split1"
906 select="$charlength_first + $charlength_second > $framewidth"/>
907 <xsl:variable name="split2"
908 select="$charlength_second + $charlength_side_proof > $framewidth"/>
909 <!-- <xsl:value-of select="$current_indent"/> -->
910 <!-- <xsl:value-of select="$charlength"/> -->
912 <xsl:call-template name="make_indent">
913 <xsl:with-param name="current_indent" select="$current_indent"/>
915 <FONT color="red">Rewrite </FONT>
916 <xsl:apply-templates mode="inline" select="*[3]"/>
917 <xsl:text> </xsl:text>
918 <xsl:if test="$split1">
920 <xsl:call-template name="make_indent">
921 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
924 <FONT color="red">with </FONT>
925 <xsl:apply-templates mode="inline" select="*[4]"/>
926 <xsl:text> </xsl:text>
927 <xsl:if test="$split2">
929 <xsl:call-template name="make_indent">
930 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
933 <FONT color="red">by </FONT>
934 <xsl:apply-templates select="*[5]">
935 <xsl:with-param name="current_indent" select="$current_indent+7"/>
936 </xsl:apply-templates>
938 <!-- rewrite and apply -->
939 <xsl:when test="$name='rewrite_and_apply'">
940 <xsl:apply-templates select="*[2]">
941 <xsl:with-param name="current_indent" select="$current_indent"/>
942 </xsl:apply-templates>
944 <xsl:call-template name="make_indent">
945 <xsl:with-param name="current_indent" select="$current_indent"/>
947 <FONT color="red">Then apply it to </FONT>
948 <xsl:apply-templates select="*[position()>2]"/>
950 <!-- by_induction -->
951 <xsl:when test="$name='by_induction'">
952 <FONT color="red">We prove </FONT>
953 <xsl:apply-templates select="../*[3]">
954 <xsl:with-param name="current_indent" select="$current_indent+18"/>
955 </xsl:apply-templates>
957 <xsl:call-template name="make_indent">
958 <xsl:with-param name="current_indent" select="$current_indent"/>
960 <FONT color="red">by induction on </FONT>
961 <xsl:apply-templates select="*[position()=last()]/*[position()=last()]">
962 <xsl:with-param name="current_indent" select="$current_indent+30"/>
963 </xsl:apply-templates>
966 <xsl:call-template name="make_indent">
967 <xsl:with-param name="current_indent" select="$current_indent"/>
969 <xsl:text>The induction property is</xsl:text>
971 <xsl:call-template name="make_indent">
972 <xsl:with-param name="current_indent" select="$current_indent"/>
974 <xsl:apply-templates select="*[3]">
975 <xsl:with-param name="current_indent" select="$current_indent"/>
976 </xsl:apply-templates>
979 select="*[position()>3 and not(position()=last())]">
980 <xsl:with-param name="current_indent" select="$current_indent+4"/>
981 </xsl:apply-templates>
983 <xsl:call-template name="make_indent">
984 <xsl:with-param name="current_indent" select="$current_indent"/>
986 <xsl:text>End induction</xsl:text> -->
988 <!-- inductive_case -->
989 <xsl:when test="$name='inductive_case'">
991 <xsl:call-template name="make_indent">
992 <xsl:with-param name="current_indent" select="$current_indent"/>
994 <FONT color="red">Case </FONT>
995 <xsl:apply-templates select="*[2]">
996 <xsl:with-param name="current_indent" select="$current_indent +10"/>
997 </xsl:apply-templates>
998 <xsl:if test="*[3]/*[position()>1]">
1000 <xsl:call-template name="make_indent">
1001 <xsl:with-param name="current_indent" select="$current_indent+4"/>
1002 </xsl:call-template>
1003 <FONT color="red">By induction hypothesis, we have:</FONT>
1004 <xsl:for-each select="*[3]/*[position()>1]">
1006 <xsl:call-template name="make_indent">
1007 <xsl:with-param name="current_indent" select="$current_indent + 4"/>
1008 </xsl:call-template>
1009 <xsl:text>(</xsl:text>
1010 <xsl:apply-templates select="m:ci"/>
1011 <xsl:text>) </xsl:text>
1012 <xsl:apply-templates select="m:type">
1013 <xsl:with-param name="current_indent" select="$current_indent + 8"/>
1014 </xsl:apply-templates>
1018 <xsl:call-template name="make_indent">
1019 <xsl:with-param name="current_indent" select="$current_indent + 4"/>
1020 </xsl:call-template>
1021 <xsl:apply-templates select="*[4]">
1022 <xsl:with-param name="current_indent" select="$current_indent +4"/>
1023 </xsl:apply-templates>
1025 <xsl:call-template name="make_indent">
1026 <xsl:with-param name="current_indent" select="$current_indent"/>
1027 </xsl:call-template>
1028 <xsl:text>End Case</xsl:text> -->
1031 <xsl:when test="$name='case_lhs'">
1033 <xsl:when test="count(*)=2">
1034 <xsl:apply-templates mode="inline" select="*[2]"/>
1037 <xsl:text>(</xsl:text>
1038 <xsl:apply-templates mode="inline" select="*[2]"/>
1039 <xsl:for-each select="m:bvar">
1040 <xsl:text> </xsl:text>
1041 <xsl:apply-templates mode="inline" select="*[1]"/>
1042 <xsl:text>:</xsl:text>
1043 <xsl:apply-templates mode="inline" select="m:type/*[1]"/>
1045 <xsl:text>)</xsl:text>
1050 <xsl:when test="$name='nat_ind_complete'">
1051 <FONT color="red">By induction on </FONT>
1052 <xsl:apply-templates select="*[2]"/>:
1054 <xsl:call-template name="make_indent">
1055 <xsl:with-param name="current_indent" select="$current_indent"/>
1056 </xsl:call-template>
1057 <xsl:text>0 </xsl:text>
1058 <FONT FACE="Symbol" mathcolor="green">Þ</FONT>
1059 <xsl:apply-templates select="*[3]">
1060 <xsl:with-param name="current_indent" select="$current_indent + 8"/>
1061 </xsl:apply-templates>
1063 <xsl:call-template name="make_indent">
1064 <xsl:with-param name="current_indent" select="$current_indent"/>
1065 </xsl:call-template>
1066 <xsl:text>S(</xsl:text>
1067 <xsl:apply-templates select="*[4]"/>
1068 <xsl:text>) </xsl:text>
1069 <FONT FACE="Symbol" mathcolor="green">Þ</FONT>
1070 <FONT color="red">Assume by induction</FONT>
1072 <xsl:call-template name="make_indent">
1073 <xsl:with-param name="current_indent" select="$current_indent +10"/>
1074 </xsl:call-template>
1075 <xsl:text>(</xsl:text>
1076 <xsl:apply-templates select="*[5]"/>
1077 <xsl:text>)</xsl:text>
1078 <xsl:apply-templates select="*[6]">
1079 <xsl:with-param name="current_indent" select="$current_indent + 14"/>
1080 </xsl:apply-templates>
1082 <xsl:call-template name="make_indent">
1083 <xsl:with-param name="current_indent" select="$current_indent +10"/>
1084 </xsl:call-template>
1085 <xsl:apply-templates select="*[7]">
1086 <xsl:with-param name="current_indent" select="$current_indent + 10"/>
1087 </xsl:apply-templates>
1090 <xsl:when test="$name='false_ind'">
1091 <xsl:apply-templates select="*[3]">
1092 <xsl:with-param name="current_indent" select="$current_indent"/>
1093 </xsl:apply-templates>
1095 <xsl:call-template name="make_indent">
1096 <xsl:with-param name="current_indent" select="$current_indent"/>
1097 </xsl:call-template>
1098 <FONT color="red">Contradiction.</FONT>
1101 <xsl:when test="$name='and_ind'">
1103 <xsl:when test="name(*[2])='m:apply'">
1104 <xsl:apply-templates select="*[2]">
1105 <xsl:with-param name="current_indent" select="$current_indent"/>
1106 </xsl:apply-templates>
1109 <FONT color="red">Consider </FONT>
1110 <xsl:apply-templates select="*[2]"/>
1114 <xsl:call-template name="make_indent">
1115 <xsl:with-param name="current_indent" select="$current_indent"/>
1116 </xsl:call-template>
1117 <FONT color="red">In particular, we have</FONT>
1119 <xsl:call-template name="make_indent">
1120 <xsl:with-param name="current_indent" select="$current_indent"/>
1121 </xsl:call-template>
1123 <xsl:apply-templates select="*[3]"/>
1125 <xsl:apply-templates select="*[4]">
1126 <xsl:with-param name="current_indent" select="$current_indent + 9"/>
1127 </xsl:apply-templates>
1129 <xsl:call-template name="make_indent">
1130 <xsl:with-param name="current_indent" select="$current_indent"/>
1131 </xsl:call-template>
1133 <xsl:apply-templates select="*[5]"/>
1135 <xsl:apply-templates select="*[6]">
1136 <xsl:with-param name="current_indent" select="$current_indent + 9"/>
1137 </xsl:apply-templates>
1139 <xsl:call-template name="make_indent">
1140 <xsl:with-param name="current_indent" select="$current_indent"/>
1141 </xsl:call-template>
1142 <xsl:apply-templates select="*[7]">
1143 <xsl:with-param name="current_indent" select="$current_indent"/>
1144 </xsl:apply-templates>
1146 <!-- full_or_ind -->
1147 <xsl:when test="$name='full_or_ind'">
1149 <xsl:when test="name(*[2])='m:apply'">
1150 <xsl:apply-templates select="*[2]">
1151 <xsl:with-param name="current_indent" select="$current_indent"/>
1152 </xsl:apply-templates>
1155 <FONT color="red">Consider </FONT>
1156 <xsl:apply-templates select="*[2]"/>
1160 <xsl:call-template name="make_indent">
1161 <xsl:with-param name="current_indent" select="$current_indent"/>
1162 </xsl:call-template>
1163 <FONT color="red">We proceed by cases to prove </FONT>
1164 <xsl:apply-templates select="*[3]"/>
1166 <xsl:call-template name="make_indent">
1167 <xsl:with-param name="current_indent" select="$current_indent+4"/>
1168 </xsl:call-template>
1169 <FONT color="red">Left: suppose </FONT>
1170 <xsl:text>(</xsl:text>
1171 <xsl:value-of select="*[4]/m:bvar/m:ci"/>
1172 <xsl:text>) </xsl:text>
1173 <xsl:apply-templates
1174 select="*[4]/m:bvar/m:type/*[1]"/>
1176 <xsl:call-template name="make_indent">
1177 <xsl:with-param name="current_indent" select="$current_indent+15"/>
1178 </xsl:call-template>
1179 <xsl:apply-templates
1181 <xsl:with-param name="current_indent" select="$current_indent+15"/>
1182 </xsl:apply-templates>
1184 <xsl:call-template name="make_indent">
1185 <xsl:with-param name="current_indent" select="$current_indent+4"/>
1186 </xsl:call-template>
1187 <FONT color="red">Right: suppose </FONT>
1188 <xsl:text>(</xsl:text>
1189 <xsl:value-of select="*[5]/m:bvar/m:ci"/>
1190 <xsl:text>) </xsl:text>
1191 <xsl:apply-templates
1192 select="*[5]/m:bvar/m:type/*[1]"/>
1194 <xsl:call-template name="make_indent">
1195 <xsl:with-param name="current_indent" select="$current_indent+16"/>
1196 </xsl:call-template>
1197 <xsl:apply-templates
1199 <xsl:with-param name="current_indent" select="$current_indent+16"/>
1200 </xsl:apply-templates>
1203 <xsl:when test="$name='or_ind'">
1205 <xsl:when test="name(*[2])='m:apply'">
1206 <xsl:apply-templates select="*[2]">
1207 <xsl:with-param name="current_indent" select="$current_indent"/>
1208 </xsl:apply-templates>
1211 <FONT color="red">Consider </FONT>
1212 <xsl:apply-templates select="*[2]"/>
1216 <xsl:call-template name="make_indent">
1217 <xsl:with-param name="current_indent" select="$current_indent"/>
1218 </xsl:call-template>
1219 <FONT color="red">We prove </FONT>
1220 <xsl:apply-templates select="*[3]"/>
1221 <FONT color="red"> by cases:</FONT>
1223 <xsl:call-template name="make_indent">
1224 <xsl:with-param name="current_indent" select="$current_indent"/>
1225 </xsl:call-template>
1227 <xsl:apply-templates select="*[4]">
1228 <xsl:with-param name="current_indent" select="$current_indent"/>
1229 </xsl:apply-templates>
1231 <xsl:call-template name="make_indent">
1232 <xsl:with-param name="current_indent" select="$current_indent"/>
1233 </xsl:call-template>
1235 <xsl:apply-templates select="*[5]">
1236 <xsl:with-param name="current_indent" select="$current_indent"/>
1237 </xsl:apply-templates>
1240 <xsl:when test="$name='ex_ind'">
1242 <xsl:when test="name(*[2])='m:apply'">
1243 <xsl:apply-templates select="*[2]">
1244 <xsl:with-param name="current_indent" select="$current_indent"/>
1245 </xsl:apply-templates>
1248 <FONT color="red">Consider </FONT>
1249 <xsl:apply-templates select="*[2]">
1250 <xsl:with-param name="current_indent" select="$current_indent"/>
1251 </xsl:apply-templates>
1255 <xsl:call-template name="make_indent">
1256 <xsl:with-param name="current_indent" select="$current_indent"/>
1257 </xsl:call-template>
1258 <FONT color="red">Let </FONT>
1259 <xsl:apply-templates mode="inline" select="*[3]"/>
1261 <xsl:apply-templates mode="inline" select="*[4]"/>
1262 <FONT color="red"> such that</FONT>
1264 <xsl:call-template name="make_indent">
1265 <xsl:with-param name="current_indent" select="$current_indent"/>
1266 </xsl:call-template>
1268 <xsl:apply-templates mode="inline" select="*[5]"/>
1270 <xsl:apply-templates select="*[6]">
1271 <xsl:with-param name="current_indent" select="$current_indent +7"/>
1272 </xsl:apply-templates>
1274 <xsl:call-template name="make_indent">
1275 <xsl:with-param name="current_indent" select="$current_indent"/>
1276 </xsl:call-template>
1277 <xsl:apply-templates select="*[7]">
1278 <xsl:with-param name="current_indent" select="$current_indent"/>
1279 </xsl:apply-templates>
1281 <!-- ***************************************** -->
1282 <!-- *********** LAMBDA ELEMENTS ************** -->
1283 <!-- ***************************************** -->
1284 <xsl:when test="$name='subst'">
1285 <xsl:apply-templates select="*[3]"/>
1286 <xsl:text>[</xsl:text>
1287 <xsl:apply-templates select="*[4]"/>
1288 <a href="{*[1]/@definitionURL}">
1289 <FONT color="blue" SIZE="+0" FACE="symbol">
1290 <xsl:text>¬</xsl:text>
1293 <xsl:apply-templates select="*[2]"/>
1294 <xsl:text>]</xsl:text>
1297 <xsl:when test="$name='lift_with_base'">
1299 <xsl:apply-templates select="*[3]" mode="inline"/>
1301 <a href="{*[1]/@definitionURL}">
1302 <FONT color="green" FACE="symbol">
1303 <xsl:text>­</xsl:text>
1307 <xsl:apply-templates select="*[4]" mode="inline"/>
1309 <xsl:text>(</xsl:text>
1310 <xsl:apply-templates select="*[2]" mode="inline"/>
1311 <xsl:text>)</xsl:text>
1314 <xsl:when test="$name='lift'">
1315 <a href="{*[1]/@definitionURL}">
1316 <FONT color="green" FACE="symbol">
1317 <xsl:text>­</xsl:text>
1321 <xsl:apply-templates select="*[2]" mode="inline"/>
1323 <xsl:text>(</xsl:text>
1324 <xsl:apply-templates select="*[3]" mode="inline"/>
1325 <xsl:text>)</xsl:text>
1329 <xsl:when test="$name='beta_red1'">
1330 <xsl:apply-templates select="*[2]" mode="inline"/>
1331 <a href="{*[1]/@definitionURL}">
1332 <FONT color="green" FACE="symbol">
1333 <xsl:text>®</xsl:text>
1336 <FONT color="green" FACE="symbol">
1337 <xsl:text>b</xsl:text>
1341 <xsl:apply-templates select="*[3]" mode="inline"/>
1344 <xsl:when test="$name='beta_red'">
1345 <xsl:apply-templates select="*[2]" mode="inline"/>
1346 <a href="{*[1]/@definitionURL}">
1347 <FONT color="green" FACE="symbol">
1348 <xsl:text>®</xsl:text>
1351 <FONT color="green" FACE="symbol">
1352 <xsl:text>b*</xsl:text>
1356 <xsl:apply-templates select="*[3]" mode="inline"/>
1359 <xsl:when test="$name='par_beta_red1'">
1360 <xsl:apply-templates select="*[2]" mode="inline"/>
1361 <a href="{*[1]/@definitionURL}">
1362 <FONT color="green" FACE="symbol">
1363 <xsl:text>Þ</xsl:text>
1366 <FONT color="green" FACE="symbol">
1367 <xsl:text>b</xsl:text>
1371 <xsl:apply-templates select="*[3]" mode="inline"/>
1374 <xsl:when test="$name='par_beta_red'">
1375 <xsl:apply-templates select="*[2]" mode="inline"/>
1376 <a href="{*[1]/@definitionURL}">
1377 <FONT color="green" FACE="symbol">
1378 <xsl:text>Þ</xsl:text>
1381 <FONT color="green" FACE="symbol">
1382 <xsl:text>b*</xsl:text>
1386 <xsl:apply-templates select="*[3]" mode="inline"/>
1390 <xsl:when test="$name='forgetful'">
1391 <a href="{*[1]/@definitionURL}">|</a>
1392 <xsl:apply-templates select="*[2]" mode="inline"/>
1393 <a href="{*[1]/@definitionURL}">|</a>
1396 <!-- boolean algebra of redexes -->
1399 <xsl:when test="$name='isomorphic'">
1400 <xsl:apply-templates select="*[2]" mode="inline"/>
1401 <a href="{*[1]/@definitionURL}">
1402 <FONT color="green" FACE="symbol">
1403 <xsl:text>@</xsl:text>
1406 <xsl:apply-templates select="*[3]" mode="inline"/>
1410 <xsl:when test="$name='interp'">
1411 <font color="green">[</font>
1412 <xsl:apply-templates select="*[2]"/>
1413 <font color="green">]</font>
1421 <xsl:template match="m:lambda">
1422 <xsl:param name="current_indent" select="0"/>
1423 <xsl:variable name="charlength">
1424 <xsl:apply-templates select="*[position()=1]" mode="charcount"/>
1425 <!-- <xsl:apply-templates select="." mode="charcount"/> -->
1427 <!-- <xsl:value-of select="$charlength"/> -->
1428 <!-- <xsl:value-of select="$current_indent"/> -->
1430 <xsl:when test="$charlength > $framewidth">
1432 <xsl:call-template name="mksymbol-1">
1433 <xsl:with-param name="symbol" select="'lambda'"/>
1434 <xsl:with-param name="color" select="'red'"/>
1435 <xsl:with-param name="size" select="'+2'"/>
1436 </xsl:call-template>
1437 <xsl:apply-templates select="m:bvar/m:ci"/>
1438 <xsl:text>:</xsl:text>
1439 <xsl:apply-templates select="m:bvar/m:type">
1440 <xsl:with-param name="current_indent"
1441 select="$current_indent + 4 + 2*string-length(m:bvar/m:ci)"/>
1442 </xsl:apply-templates><br/>
1443 <xsl:call-template name="make_indent">
1444 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1445 </xsl:call-template>
1446 <xsl:text>.</xsl:text>
1447 <xsl:apply-templates select="*[position()=2]">
1448 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
1449 </xsl:apply-templates>
1452 <xsl:apply-templates mode="inline" select="."/>
1458 <xsl:template match="m:ci">
1460 <xsl:when test="boolean(@definitionURL)">
1461 <a href="{@definitionURL}">
1462 <xsl:apply-templates/>
1466 <xsl:value-of select="."/>
1473 <xsl:template match="m:ci|m:csymbol" mode="charcount">
1474 <xsl:param name="incurrent_length" select="0"/>
1476 <xsl:when test="$framewidth >= ($incurrent_length + string-length())">
1477 <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>
1479 <xsl:when test="string($siblength) = """>
1480 <xsl:value-of select="$incurrent_length + string-length()"/>
1483 <xsl:value-of select="number($siblength)"/>
1488 <xsl:value-of select="$incurrent_length + string-length()"/>
1493 <xsl:template match="*" mode="charcount">
1494 <xsl:param name="incurrent_length" select="0"/>
1496 <xsl:when test="count(child::*) = 0">
1497 <xsl:value-of select="$incurrent_length"/>
1500 <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>
1502 <xsl:when test="$framewidth >= number($childlength)">
1503 <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>
1505 <xsl:when test="string($siblength) = """>
1506 <xsl:value-of select="number($childlength)"/>
1509 <xsl:value-of select="number($siblength)"/>
1514 <xsl:value-of select="number($childlength)"/>
1522 <!--***********************************************************************-->
1524 <!--***********************************************************************-->
1528 <xsl:template match="Definition">
1529 <xsl:param name="current_indent" select="0"/>
1531 DEFINITION <xsl:value-of select="@name"/>(<xsl:if test="string(./Params) != """><xsl:value-of select="Params"/></xsl:if>)<br/>
1533 <xsl:call-template name="make_indent">
1534 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
1535 </xsl:call-template>
1536 <xsl:apply-templates select="type/*[1]">
1537 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
1538 </xsl:apply-templates><br/>
1540 <xsl:call-template name="make_indent">
1541 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
1542 </xsl:call-template>
1543 <xsl:apply-templates select="body/*[1]">
1544 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
1545 </xsl:apply-templates>
1551 <xsl:template match="Axiom">
1552 <xsl:param name="current_indent" select="0"/>
1554 AXIOM <xsl:value-of select="@name"/>(<xsl:if test="string(./Params) != """><xsl:value-of select="Params"/></xsl:if>)<br/>
1556 <xsl:call-template name="make_indent">
1557 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
1558 </xsl:call-template>
1559 <xsl:apply-templates select="type/*[1]">
1560 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
1561 </xsl:apply-templates>
1565 <!-- UNFINISHED PROOF -->
1567 <xsl:template match="CurrentProof">
1568 <xsl:param name="current_indent" select="0"/>
1570 UNFINISHED PROOF <xsl:value-of select="@name"/>(<xsl:if test="string(./Params) != """><xsl:value-of select="Params"/></xsl:if>)<br/>
1571 THESIS: <xsl:apply-templates select="type/*[1]">
1572 <xsl:with-param name="current_indent" select="$current_indent + 8"/>
1573 </xsl:apply-templates><br/>
1575 <xsl:for-each select="Conjecture">
1577 <xsl:call-template name="make_indent">
1578 <xsl:with-param name="current_indent" select="$current_indent + 8"/>
1579 </xsl:call-template>
1580 <xsl:value-of select="./@no"/> :
1581 <xsl:apply-templates select="./*[1]">
1582 <xsl:with-param name="current_indent" select="$current_indent + 11"/>
1583 </xsl:apply-templates>
1587 <xsl:apply-templates select="body/*[1]">
1588 <xsl:with-param name="current_indent" select="$current_indent + 8"/>
1589 </xsl:apply-templates>
1593 <!-- MUTUAL INDUCTIVE DEFINITION -->
1595 <xsl:template match="InductiveDefinition">
1596 <xsl:param name="current_indent" select="0"/>
1598 <xsl:for-each select="InductiveType">
1600 <xsl:when test="position() = 1">
1602 <xsl:when test="string(./@inductive) = "true"">
1603 INDUCTIVE DEFINITION
1606 COINDUCTIVE DEFINITION
1614 <xsl:value-of select="./@name"/>(<xsl:if test="string(../Params) != """><xsl:value-of select="../Params"/></xsl:if>)
1616 <xsl:if test="string(../Param) != """>
1617 <xsl:for-each select="../Param">
1618 <xsl:value-of select="./@name"/>
1620 <xsl:apply-templates select="*"/>
1625 <xsl:apply-templates select="./arity/*[1]">
1626 <xsl:with-param name="current_indent" select="$current_indent + 9"/>
1627 </xsl:apply-templates> <br/>
1629 <xsl:for-each select="./Constructor">
1631 <xsl:call-template name="make_indent">
1632 <xsl:with-param name="current_indent" select="$current_indent + 3"/>
1633 </xsl:call-template>
1635 <xsl:when test="position() = 1">
1636 <xsl:text>  </xsl:text>
1639 <xsl:text>| </xsl:text>
1642 <xsl:value-of select="./@name"/>
1643 <xsl:text>: </xsl:text>
1644 <xsl:apply-templates select="./*[1]">
1645 <xsl:with-param name="current_indent" select="$current_indent + 2*string-length(./@name) + 5"/>
1646 </xsl:apply-templates>
1654 <xsl:template match="Variable">
1655 <xsl:param name="current_indent" select="0"/>
1657 VARIABLE <xsl:value-of select="@name"/><br/>
1658 TYPE = <xsl:apply-templates select="type/*[1]">
1659 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
1660 </xsl:apply-templates>
1664 <!--***********************************************************************-->
1666 <!--***********************************************************************-->
1670 <xsl:template match="SECTION">
1671 <xsl:param name="current_indent" select="0"/>
1672 <h1>BEGIN OF SECTION</h1>
1673 <xsl:apply-templates/>
1674 <h1>END OF SECTION</h1>