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 -->
33 <!--***********************************************************************-->
35 <xsl:include href="html_init.xsl"/>
36 <xsl:include href="html_set.xsl"/>
37 <xsl:include href="html_reals.xsl"/>
39 <xsl:variable name="showcast" select="0"/>
41 <!--***********************************************************************-->
42 <!-- HTML Head and Body -->
43 <!--***********************************************************************-->
45 <!-- <xsl:output method="html" encoding="iso-8859-1"/> -->
47 <!-- document needs method="xml" and searches locally for the dtd if -->
48 <!-- doctype-system is specified (the dtd must exist locally for parsing). -->
49 <!-- For having output html must be media-type="html" and for having the -->
50 <!-- correct <br /> you must specify at least the remote dtd by means of -->
51 <!-- doctype-public -->
55 media-type="text/html"
56 doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" />
58 <xsl:variable name="framewidth" select="36"/>
60 <xsl:template match="/">
61 <xsl:param name="current_indent" select="0"/>
65 A { text-decoration: none }
68 <body bgcolor="white">
70 <xsl:with-param name="current_indent" select="0"/>
71 </xsl:apply-templates>
76 <!--***********************************************************************-->
78 <!--***********************************************************************-->
80 <xsl:template name="make_indent">
81 <xsl:param name="current_indent" select="0"/>
82 <xsl:if test="$current_indent > 0">
83 <xsl:text> </xsl:text>
84 <xsl:call-template name="make_indent">
85 <xsl:with-param name="current_indent" select="$current_indent - 1"/>
90 <!-- Syntactic Sugar -->
91 <xsl:template match="m:type">
92 <xsl:param name="current_indent" select="0"/>
94 <xsl:with-param name="current_indent"
95 select="$current_indent"/>
96 </xsl:apply-templates>
99 <xsl:template match="m:condition">
100 <xsl:param name="current_indent" select="0"/>
101 <xsl:apply-templates>
102 <xsl:with-param name="current_indent"
103 select="$current_indent"/>
104 </xsl:apply-templates>
107 <xsl:template match="m:math">
108 <xsl:param name="current_indent" select="0"/>
109 <xsl:apply-templates>
110 <xsl:with-param name="current_indent"
111 select="$current_indent"/>
112 </xsl:apply-templates>
115 <!--*********************************************************************-->
117 <!--*********************************************************************-->
120 <xsl:template mode="inline" match="m:ci">
122 <xsl:when test="boolean(@definitionURL)">
123 <a href="{@definitionURL}">
124 <xsl:apply-templates/>
128 <xsl:value-of select="."/>
135 <xsl:template match="m:apply[m:csymbol]" mode="inline">
136 <xsl:variable name="name">
137 <xsl:value-of select="m:csymbol"/>
141 <xsl:when test="$name='forall'">
142 <FONT FACE="Symbol" SIZE="+2" color="blue">"</FONT>
143 <xsl:apply-templates select="m:bvar/m:ci"/>
144 <xsl:text>:</xsl:text>
145 <xsl:apply-templates mode="inline" select="m:bvar/m:type"/>
146 <xsl:text>.</xsl:text>
147 <xsl:apply-templates mode="inline" select="*[position()=3]"/>
149 <xsl:when test="$name='prod'">
150 <FONT FACE="Symbol" SIZE="+2" color="blue">Õ</FONT>
151 <xsl:apply-templates mode="inline" select="m:bvar/m:ci"/>
152 <xsl:text>:</xsl:text>
153 <xsl:apply-templates mode="inline" select="m:bvar/m:type"/>
154 <xsl:text>.</xsl:text>
155 <xsl:apply-templates mode="inline" select="*[position()=3]"/>
158 <xsl:when test="$name='arrow'">
159 <xsl:text>(</xsl:text>
160 <xsl:apply-templates mode="inline" select="*[position()=2]"/>
161 <FONT color="blue" FACE="symbol">
162 <xsl:text>®</xsl:text>
164 <xsl:apply-templates mode="inline" select="*[position()=3]"/>
165 <xsl:text>)</xsl:text>
168 <xsl:when test="$name='app'">
169 <xsl:text>(</xsl:text>
170 <xsl:apply-templates mode="inline" select="*[position()=2]"/>
171 <xsl:for-each select="*[position()>2]">
172 <xsl:text> </xsl:text>
173 <xsl:apply-templates mode="inline" select="."/>
175 <xsl:text>)</xsl:text>
178 <xsl:when test="$name='cast'">
179 <xsl:text>(</xsl:text>
180 <xsl:apply-templates mode="inline" select="*[position()=2]"/>
181 <xsl:text>:></xsl:text>
182 <xsl:apply-templates mode="inline" select="*[position()=3]"/>
183 <xsl:text>)</xsl:text>
185 <xsl:when test="$name='Prop'">
186 <FONT color="violet">Prop</FONT>
188 <xsl:when test="$name='Set'">
189 <FONT color="violet">Set</FONT>
191 <xsl:when test="$name='Type'">
192 <FONT color="violet">Type</FONT>
195 <xsl:when test="$name='mutcase'">
196 <xsl:text><</xsl:text>
197 <xsl:apply-templates mode="inline" select="*[position()=2]"/>
198 <xsl:text>> </xsl:text>
199 <FONT color="red">CASE </FONT>
200 <xsl:apply-templates mode="inline" select="*[position()=3]"/>
201 <FONT color="red"> OF </FONT>
202 <xsl:for-each select="*[position() mod 2 = 0 and position()>3]">
204 <xsl:when test="not(position() = 1)">
205 <xsl:text> | </xsl:text>
208 <xsl:apply-templates mode="inline" select="."/>
209 <FONT FACE="Symbol" SIZE="+2" mathcolor="green">Þ</FONT>
210 <xsl:apply-templates mode="inline"
211 select="following-sibling::*[position()= 1]"/>
215 <xsl:when test="$name='fix'">
216 <FONT color="red">FIX</FONT>
217 <xsl:value-of select="m:ci"/>
218 <xsl:text>{</xsl:text>
219 <xsl:for-each select="m:bvar">
220 <xsl:value-of select="m:ci"/>
221 <xsl:text>:</xsl:text>
222 <xsl:apply-templates mode="inline" select="m:type"/>
223 <xsl:text>:=</xsl:text>
224 <xsl:apply-templates mode="inline"
225 select="following-sibling::*[position() = 1]"/>
227 <xsl:when test="position()=last()">
228 <xsl:text>}</xsl:text>
231 <xsl:text>;</xsl:text>
237 <xsl:when test="$name='cofix'">
238 <xsl:text>COFIX</xsl:text>
239 <xsl:value-of select="m:ci"/>
240 <xsl:text>{</xsl:text>
241 <xsl:for-each select="m:bvar">
242 <xsl:value-of select="m:ci"/>
243 <xsl:text>:</xsl:text>
244 <xsl:apply-templates mode="inline" select="m:type"/>
245 <xsl:text>:=</xsl:text>
246 <xsl:apply-templates mode="inline"
247 select="following-sibling::*[position() = 1]"/>
249 <xsl:when test="position()=last()">
250 <xsl:text>}</xsl:text>
253 <xsl:text>;</xsl:text>
259 <xsl:when test="$name='proof'">
260 <xsl:apply-templates mode="inline" select="*[position()=2]"/>
261 <FONT color="red"> proves </FONT>
262 <xsl:apply-templates mode="inline" select="*[position()=3]"/>
265 <xsl:when test="$name='and_ind'">
266 <FONT color="red">From </FONT>
267 <xsl:apply-templates select="*[2]"/>
268 <FONT color="red"> we get</FONT>
270 <xsl:apply-templates select="*[3]"/>
272 <xsl:apply-templates mode="inline" select="*[4]"/>
273 <FONT color="red"> and </FONT>
275 <xsl:apply-templates select="*[5]"/>
277 <xsl:apply-templates mode="inline" select="*[6]"/>
279 <FONT color="red"> hence </FONT>
280 <xsl:apply-templates mode="inline" select="*[7]"/>
285 <xsl:template mode="inline" match="m:lambda">
286 <FONT SIZE="+2" color="red" FACE="symbol">l</FONT>
287 <xsl:apply-templates select="m:bvar/m:ci"/>
288 <xsl:text>:</xsl:text>
289 <xsl:apply-templates mode="inline" select="m:bvar/m:type"/>
290 <xsl:text>.</xsl:text>
291 <xsl:apply-templates mode="inline" select="*[position()=2]"/>
294 <!--*********************************************************************-->
295 <!-- COUNTING MODE -->
296 <!--*********************************************************************-->
298 <xsl:template match="m:apply[m:csymbol]">
299 <xsl:param name="current_indent" select="0"/>
300 <xsl:param name="width" select="$framewidth"/>
301 <xsl:variable name="name">
302 <xsl:value-of select="m:csymbol"/>
304 <xsl:variable name="charlength">
305 <xsl:apply-templates select="m:csymbol" mode="charcount"/>
307 <!-- <xsl:value-of select="$current_indent"/> -->
308 <!-- <xsl:value-of select="$charlength"/> -->
311 <xsl:when test="$name='forall'">
313 <xsl:when test="$charlength > $framewidth">
315 <FONT FACE="Symbol" SIZE="+2" color="blue">"</FONT>
316 <xsl:apply-templates select="m:bvar/m:ci"/>
317 <xsl:text>:</xsl:text>
318 <xsl:apply-templates select="m:bvar/m:type">
319 <xsl:with-param name="current_indent"
320 select="$current_indent + 5 + 2*string-length(m:bvar/m:ci)"/>
321 </xsl:apply-templates>
323 <xsl:call-template name="make_indent">
324 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
326 <xsl:text>.</xsl:text>
327 <xsl:apply-templates select="*[position()=3]">
328 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
329 </xsl:apply-templates>
332 <xsl:apply-templates mode="inline" select="."/>
337 <xsl:when test="$name='prod'">
339 <xsl:when test="$charlength > $framewidth">
340 <FONT FACE="Symbol" SIZE="+2" color="blue">Õ</FONT>
341 <xsl:apply-templates select="m:bvar/m:ci"/>
342 <xsl:text>:</xsl:text>
343 <xsl:apply-templates select="m:bvar/m:type">
344 <xsl:with-param name="current_indent"
345 select="$current_indent + 5 + 2*string-length(m:bvar/m:ci)"/>
346 </xsl:apply-templates><br/>
347 <xsl:call-template name="make_indent">
348 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
350 <xsl:text>.</xsl:text>
351 <xsl:apply-templates select="*[position()=3]">
352 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
353 </xsl:apply-templates>
356 <xsl:apply-templates mode="inline" select="."/>
361 <xsl:when test="$name='arrow'">
363 <xsl:when test="$charlength > $framewidth">
364 <xsl:text>(</xsl:text>
365 <xsl:apply-templates select="*[position()=2]">
366 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
367 </xsl:apply-templates>
369 <xsl:call-template name="make_indent">
370 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
373 <FONT color="blue" FACE="symbol">
374 <xsl:text>®</xsl:text>
376 <xsl:apply-templates select="*[position()=3]">
377 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
378 </xsl:apply-templates>
379 <xsl:text>)</xsl:text>
382 <xsl:apply-templates mode="inline" select="."/>
387 <xsl:when test="$name='app'">
389 <xsl:when test="$charlength > $framewidth">
390 <xsl:text>(</xsl:text>
391 <xsl:apply-templates select="*[position()=2]">
392 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
393 </xsl:apply-templates>
394 <xsl:for-each select="*[position()>2]">
396 <xsl:call-template name="make_indent">
397 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
399 <xsl:apply-templates select=".">
400 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
401 </xsl:apply-templates>
403 <xsl:text>)</xsl:text>
406 <xsl:apply-templates mode="inline" select="."/>
410 <xsl:when test="$name='cast'">
412 <xsl:when test="$showcast = 1">
414 <xsl:when test="$charlength > $framewidth">
415 <xsl:text>(</xsl:text>
416 <xsl:apply-templates select="*[position()=2]">
417 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
418 </xsl:apply-templates><br/>
419 <xsl:call-template name="make_indent">
420 <xsl:with-param name="current_indent" select="$current_indent + 2"/> </xsl:call-template>
421 <xsl:text>:></xsl:text>
422 <xsl:apply-templates select="*[position()=3]">
423 <xsl:with-param name="current_indent" select="$current_indent + 3"/>
424 </xsl:apply-templates>
425 <xsl:text>)</xsl:text>
428 <xsl:apply-templates mode="inline" select="."/>
433 <xsl:apply-templates select="*[position()=2]">
434 <xsl:with-param name="current_indent" select="$current_indent"/>
435 </xsl:apply-templates>
439 <xsl:when test="$name='Prop'">
440 <xsl:text>Prop</xsl:text>
442 <xsl:when test="$name='Set'">
443 <xsl:text>Set</xsl:text>
445 <xsl:when test="$name='Type'">
446 <xsl:text>Type</xsl:text>
448 <xsl:when test="$name='mutcase'">
450 <xsl:when test="$charlength > $framewidth">
451 <xsl:text><</xsl:text>
452 <xsl:apply-templates select="*[position()=2]">
453 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
454 </xsl:apply-templates>
455 <xsl:text>> </xsl:text>
456 <xsl:text>CASE </xsl:text>
457 <xsl:apply-templates select="*[position()=3]">
458 <xsl:with-param name="current_indent" select="$current_indent + 8"/>
459 </xsl:apply-templates>
460 <xsl:text> OF </xsl:text>
461 <xsl:for-each select="*[position() mod 2 = 0 and position()>3]">
463 <xsl:call-template name="make_indent">
464 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
467 <xsl:when test="position() = 1">
468 <xsl:text>  </xsl:text>
471 <xsl:text>| </xsl:text>
474 <xsl:apply-templates select="."/>
475 <FONT FACE="Symbol" SIZE="+2" mathcolor="green">Þ</FONT>
476 <xsl:apply-templates select="following-sibling::*[position()= 1]">
477 <xsl:with-param name="current_indent" select="$current_indent + 4 + string-length()"/>
478 </xsl:apply-templates>
482 <xsl:apply-templates mode="inline" select="."/>
487 <xsl:when test="$name='fix'">
489 <xsl:when test="$charlength > $framewidth">
490 <xsl:text>FIX</xsl:text>
491 <xsl:value-of select="m:ci"/>
492 <xsl:text>{</xsl:text>
493 <xsl:for-each select="m:bvar">
495 <xsl:call-template name="make_indent">
496 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
498 <xsl:value-of select="m:ci"/>
499 <xsl:text>:</xsl:text>
500 <xsl:apply-templates select="m:type">
501 <xsl:with-param name="current_indent"
502 select="$current_indent + 5 + string-length(m:ci)"/>
503 </xsl:apply-templates>
505 <xsl:call-template name="make_indent">
506 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
508 <xsl:text>:=</xsl:text>
509 <xsl:apply-templates select="following-sibling::*[position() = 1]">
510 <xsl:with-param name="current_indent" select="$current_indent +2"/>
511 </xsl:apply-templates>
514 <xsl:call-template name="make_indent">
515 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
517 <xsl:text>}</xsl:text>
520 <xsl:apply-templates mode="inline" select="."/>
525 <xsl:when test="$name='cofix'">
527 <xsl:when test="($charlength + 10) > $framewidth">
528 <xsl:text>COFIX</xsl:text>
529 <xsl:value-of select="m:ci"/>
530 <xsl:text>{</xsl:text>
532 <xsl:call-template name="make_indent">
533 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
535 <xsl:for-each select="m:bvar">
536 <xsl:value-of select="m:ci"/>
537 <xsl:text>:</xsl:text>
538 <xsl:apply-templates select="m:type">
539 <xsl:with-param name="current_indent"
540 select="$current_indent + 5 + string-length(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="following-sibling::*[position() = 1]">
548 <xsl:with-param name="current_indent" select="$current_indent + 3"/>
549 </xsl:apply-templates>
553 <xsl:call-template name="make_indent">
554 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
556 <xsl:text>}</xsl:text>
559 <xsl:apply-templates mode="inline" select="m:type"/>
563 <!-- ***************************************** -->
564 <!-- *********** PROOF ELEMENTS ************** -->
565 <!-- ***************************************** -->
567 <xsl:when test="$name='proof'">
568 <xsl:apply-templates select="*[position()=2]">
569 <xsl:with-param name="current_indent" select="$current_indent"/>
570 </xsl:apply-templates>
572 <!-- <xsl:element name="br"/> -->
573 <xsl:call-template name="make_indent">
574 <xsl:with-param name="current_indent" select="$current_indent"/>
576 <FONT color="red">we proved </FONT>
577 <xsl:apply-templates select="*[position()=3]">
578 <xsl:with-param name="current_indent" select="$current_indent + 16"/>
579 </xsl:apply-templates>
582 <xsl:when test="$name='letin1'">
583 <xsl:apply-templates select="*[position()=2]">
584 <xsl:with-param name="current_indent" select="$current_indent"/>
585 </xsl:apply-templates>
587 <xsl:call-template name="make_indent">
588 <xsl:with-param name="current_indent" select="$current_indent"/>
590 <xsl:apply-templates select="*[position()=3]">
591 <xsl:with-param name="current_indent" select="$current_indent"/>
592 </xsl:apply-templates>
595 <xsl:when test="$name='letin'">
596 <xsl:for-each select="*[position()>1 and last()>position()]">
597 <xsl:apply-templates select=".">
598 <xsl:with-param name="current_indent" select="$current_indent"/>
599 </xsl:apply-templates>
601 <xsl:call-template name="make_indent">
602 <xsl:with-param name="current_indent" select="$current_indent"/>
605 <xsl:apply-templates select="*[position()=last()]">
606 <xsl:with-param name="current_indent" select="$current_indent"/>
607 </xsl:apply-templates>
610 <xsl:when test="$name='let'">
612 <xsl:apply-templates select="m:ci"/>
614 <xsl:apply-templates select="*[3]">
615 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
616 </xsl:apply-templates>
619 <xsl:when test="$name='rw_step'">
621 <xsl:when test="name(*[2])='m:apply'">
622 <xsl:apply-templates select="*[2]">
623 <xsl:with-param name="current_indent" select="$current_indent"/>
624 </xsl:apply-templates>
627 <FONT color="red">Consider </FONT>
628 <xsl:apply-templates select="*[2]"/>
632 <xsl:call-template name="make_indent">
633 <xsl:with-param name="current_indent" select="$current_indent"/>
635 <FONT color="red">Rewrite </FONT>
636 <xsl:apply-templates select="*[3]"/>
637 <FONT color="red"> with </FONT>
638 <xsl:apply-templates select="*[4]"/>
639 <FONT color="red"> by </FONT>
640 <xsl:apply-templates select="*[5]"/>
642 <!-- rewrite and apply -->
643 <xsl:when test="$name='rewrite_and_apply'">
644 <xsl:apply-templates select="*[2]">
645 <xsl:with-param name="current_indent" select="$current_indent"/>
646 </xsl:apply-templates>
648 <xsl:call-template name="make_indent">
649 <xsl:with-param name="current_indent" select="$current_indent"/>
651 <FONT color="red">Then apply it to </FONT>
652 <xsl:apply-templates select="*[position()>2]"/>
655 <xsl:when test="$name='and_ind'">
657 <xsl:when test="name(*[2])='m:apply'">
658 <xsl:apply-templates select="*[2]">
659 <xsl:with-param name="current_indent" select="$current_indent"/>
660 </xsl:apply-templates>
663 <FONT color="red">Consider </FONT>
664 <xsl:apply-templates select="*[2]"/>
668 <xsl:call-template name="make_indent">
669 <xsl:with-param name="current_indent" select="$current_indent"/>
671 <FONT color="red">In particular, we have</FONT>
673 <xsl:call-template name="make_indent">
674 <xsl:with-param name="current_indent" select="$current_indent"/>
677 <xsl:apply-templates select="*[3]"/>
679 <xsl:apply-templates select="*[4]">
680 <xsl:with-param name="current_indent" select="$current_indent + 9"/>
681 </xsl:apply-templates>
683 <xsl:call-template name="make_indent">
684 <xsl:with-param name="current_indent" select="$current_indent"/>
687 <xsl:apply-templates select="*[5]"/>
689 <xsl:apply-templates select="*[6]">
690 <xsl:with-param name="current_indent" select="$current_indent + 9"/>
691 </xsl:apply-templates>
693 <xsl:call-template name="make_indent">
694 <xsl:with-param name="current_indent" select="$current_indent"/>
696 <xsl:apply-templates select="*[7]">
697 <xsl:with-param name="current_indent" select="$current_indent"/>
698 </xsl:apply-templates>
701 <xsl:when test="$name='or_ind'">
703 <xsl:when test="name(*[2])='m:apply'">
704 <xsl:apply-templates select="*[2]">
705 <xsl:with-param name="current_indent" select="$current_indent"/>
706 </xsl:apply-templates>
709 <FONT color="red">Consider </FONT>
710 <xsl:apply-templates select="*[2]"/>
714 <xsl:call-template name="make_indent">
715 <xsl:with-param name="current_indent" select="$current_indent"/>
717 <FONT color="red">We prove </FONT>
718 <xsl:apply-templates select="*[3]"/>
719 <FONT color="red"> by cases:</FONT>
721 <xsl:call-template name="make_indent">
722 <xsl:with-param name="current_indent" select="$current_indent"/>
725 <xsl:apply-templates select="*[4]">
726 <xsl:with-param name="current_indent" select="$current_indent"/>
727 </xsl:apply-templates>
729 <xsl:call-template name="make_indent">
730 <xsl:with-param name="current_indent" select="$current_indent"/>
733 <xsl:apply-templates select="*[5]">
734 <xsl:with-param name="current_indent" select="$current_indent"/>
735 </xsl:apply-templates>
738 <xsl:when test="$name='ex_ind'">
740 <xsl:when test="name(*[2])='m:apply'">
741 <xsl:apply-templates select="*[2]">
742 <xsl:with-param name="current_indent" select="$current_indent"/>
743 </xsl:apply-templates>
746 <FONT color="red">Consider </FONT>
747 <xsl:apply-templates select="*[2]">
748 <xsl:with-param name="current_indent" select="$current_indent"/>
749 </xsl:apply-templates>
753 <xsl:call-template name="make_indent">
754 <xsl:with-param name="current_indent" select="$current_indent"/>
756 <FONT color="red">Let </FONT>
757 <xsl:apply-templates mode="inline" select="*[3]"/>
759 <xsl:apply-templates mode="inline" select="*[4]"/>
760 <FONT color="red"> such that</FONT>
762 <xsl:call-template name="make_indent">
763 <xsl:with-param name="current_indent" select="$current_indent"/>
766 <xsl:apply-templates mode="inline" select="*[5]"/>
768 <xsl:apply-templates select="*[6]">
769 <xsl:with-param name="current_indent" select="$current_indent +7"/>
770 </xsl:apply-templates>
772 <xsl:call-template name="make_indent">
773 <xsl:with-param name="current_indent" select="$current_indent"/>
775 <xsl:apply-templates select="*[7]">
776 <xsl:with-param name="current_indent" select="$current_indent"/>
777 </xsl:apply-templates>
784 <xsl:template match="m:lambda">
785 <xsl:param name="current_indent" select="0"/>
786 <xsl:variable name="charlength">
787 <xsl:apply-templates select="*[position()=1]" mode="charcount"/>
788 <!-- <xsl:apply-templates select="." mode="charcount"/> -->
790 <!-- <xsl:value-of select="$charlength"/> -->
791 <!-- <xsl:value-of select="$current_indent"/> -->
793 <xsl:when test="$charlength > $framewidth">
795 <FONT SIZE="+2" color="red" FACE="symbol">l</FONT>
796 <xsl:apply-templates select="m:bvar/m:ci"/>
797 <xsl:text>:</xsl:text>
798 <xsl:apply-templates select="m:bvar/m:type">
799 <xsl:with-param name="current_indent"
800 select="$current_indent + 4 + 2*string-length(m:bvar/m:ci)"/>
801 </xsl:apply-templates><br/>
802 <xsl:call-template name="make_indent">
803 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
805 <xsl:text>.</xsl:text>
806 <xsl:apply-templates select="*[position()=2]">
807 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
808 </xsl:apply-templates>
811 <xsl:apply-templates mode="inline" select="."/>
817 <xsl:template match="m:ci">
819 <xsl:when test="boolean(@definitionURL)">
820 <a href="{@definitionURL}">
821 <xsl:apply-templates/>
825 <xsl:value-of select="."/>
832 <xsl:template match="m:ci|m:csymbol" mode="charcount">
833 <xsl:param name="incurrent_length" select="0"/>
835 <xsl:when test="$framewidth >= ($incurrent_length + string-length())">
836 <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>
838 <xsl:when test="string($siblength) = """>
839 <xsl:value-of select="$incurrent_length + string-length()"/>
842 <xsl:value-of select="number($siblength)"/>
847 <xsl:value-of select="$incurrent_length + string-length()"/>
852 <xsl:template match="*" mode="charcount">
853 <xsl:param name="incurrent_length" select="0"/>
855 <xsl:when test="count(child::*) = 0">
856 <xsl:value-of select="$incurrent_length"/>
859 <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>
861 <xsl:when test="$framewidth >= number($childlength)">
862 <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>
864 <xsl:when test="string($siblength) = """>
865 <xsl:value-of select="number($childlength)"/>
868 <xsl:value-of select="number($siblength)"/>
873 <xsl:value-of select="number($childlength)"/>
881 <!--***********************************************************************-->
883 <!--***********************************************************************-->
887 <xsl:template match="Definition">
888 <xsl:param name="current_indent" select="0"/>
890 DEFINITION <xsl:value-of select="@name"/>(<xsl:if test="string(./Params) != """><xsl:value-of select="Params"/></xsl:if>)<br/>
892 <xsl:call-template name="make_indent">
893 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
895 <xsl:apply-templates select="type/*[1]">
896 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
897 </xsl:apply-templates><br/>
899 <xsl:call-template name="make_indent">
900 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
902 <xsl:apply-templates select="body/*[1]">
903 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
904 </xsl:apply-templates>
910 <xsl:template match="Axiom">
911 <xsl:param name="current_indent" select="0"/>
913 AXIOM <xsl:value-of select="@name"/>(<xsl:if test="string(./Params) != """><xsl:value-of select="Params"/></xsl:if>)<br/>
915 <xsl:call-template name="make_indent">
916 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
918 <xsl:apply-templates select="type/*[1]">
919 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
920 </xsl:apply-templates>
924 <!-- UNFINISHED PROOF -->
926 <xsl:template match="CurrentProof">
927 <xsl:param name="current_indent" select="0"/>
929 UNFINISHED PROOF <xsl:value-of select="@name"/>(<xsl:if test="string(./Params) != """><xsl:value-of select="Params"/></xsl:if>)<br/>
930 THESIS: <xsl:apply-templates select="type/*[1]">
931 <xsl:with-param name="current_indent" select="$current_indent + 8"/>
932 </xsl:apply-templates><br/>
934 <xsl:for-each select="Conjecture">
936 <xsl:call-template name="make_indent">
937 <xsl:with-param name="current_indent" select="$current_indent + 8"/>
939 <xsl:value-of select="./@no"/> :
940 <xsl:apply-templates select="./*[1]">
941 <xsl:with-param name="current_indent" select="$current_indent + 11"/>
942 </xsl:apply-templates>
946 <xsl:apply-templates select="body/*[1]">
947 <xsl:with-param name="current_indent" select="$current_indent + 8"/>
948 </xsl:apply-templates>
952 <!-- MUTUAL INDUCTIVE DEFINITION -->
954 <xsl:template match="InductiveDefinition">
955 <xsl:param name="current_indent" select="0"/>
957 <xsl:for-each select="InductiveType">
959 <xsl:when test="position() = 1">
961 <xsl:when test="string(./@inductive) = "true"">
965 COINDUCTIVE DEFINITION
973 <xsl:value-of select="./@name"/>(<xsl:if test="string(../Params) != """><xsl:value-of select="../Params"/></xsl:if>)
975 <xsl:if test="string(../Param) != """>
976 <xsl:for-each select="../Param">
977 <xsl:value-of select="./@name"/>
979 <xsl:apply-templates select="*"/>
984 <xsl:apply-templates select="./arity/*[1]">
985 <xsl:with-param name="current_indent" select="$current_indent + 9"/>
986 </xsl:apply-templates> <br/>
988 <xsl:for-each select="./Constructor">
990 <xsl:call-template name="make_indent">
991 <xsl:with-param name="current_indent" select="$current_indent + 3"/>
994 <xsl:when test="position() = 1">
995 <xsl:text>  </xsl:text>
998 <xsl:text>| </xsl:text>
1001 <xsl:value-of select="./@name"/>
1002 <xsl:text>: </xsl:text>
1003 <xsl:apply-templates select="./*[1]">
1004 <xsl:with-param name="current_indent" select="$current_indent + 2*string-length(./@name) + 5"/>
1005 </xsl:apply-templates>
1013 <xsl:template match="Variable">
1014 <xsl:param name="current_indent" select="0"/>
1016 VARIABLE <xsl:value-of select="@name"/><br/>
1017 TYPE = <xsl:apply-templates select="type/*[1]">
1018 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
1019 </xsl:apply-templates>
1023 <!--***********************************************************************-->
1025 <!--***********************************************************************-->
1029 <xsl:template match="SECTION">
1030 <xsl:param name="current_indent" select="0"/>
1031 <h1>BEGIN OF SECTION</h1>
1032 <xsl:apply-templates/>
1033 <h1>END OF SECTION</h1>