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:param name="getterURL" select="'http://localhost:8081/'"/>
36 <xsl:param name="processorURL" select="'http://localhost:8080/helm/servlet/uwobo/'"/>
38 <xsl:variable name="absPath"><xsl:value-of select="$getterURL"/>getciconly?uri=</xsl:variable>
40 <xsl:variable name="header"><xsl:value-of select="$processorURL"/>/apply?key=C1&key=HC2&param.getterURL=<xsl:value-of select="$getterURL"/>&param.processorURL=<xsl:value-of select="$processorURL"/>&xmluri=<xsl:value-of select="$absPath"/></xsl:variable>
42 <xsl:include href="html_init.xsl"/>
43 <xsl:include href="html_set.xsl"/>
44 <xsl:include href="html_reals.xsl"/>
46 <xsl:variable name="showcast" select="0"/>
49 <!--***********************************************************************-->
50 <!-- HTML Head and Body -->
51 <!--***********************************************************************-->
53 <!-- <xsl:output method="html"/> -->
54 <xsl:output method="html" encoding="iso-8859-1"/>
56 <xsl:variable name="framewidth" select="36"/>
58 <xsl:template match="/">
59 <xsl:param name="current_indent" select="0"/>
63 A { text-decoration: none }
66 <body bgcolor="white">
68 <xsl:with-param name="current_indent" select="0"/>
69 </xsl:apply-templates>
74 <!--***********************************************************************-->
76 <!--***********************************************************************-->
78 <xsl:template name="make_indent">
79 <xsl:param name="current_indent" select="0"/>
80 <xsl:if test="$current_indent > 0">
81 <xsl:text> </xsl:text>
82 <xsl:call-template name="make_indent">
83 <xsl:with-param name="current_indent" select="$current_indent - 1"/>
88 <!-- Syntactic Sugar -->
89 <xsl:template match="m:type">
90 <xsl:param name="current_indent" select="0"/>
92 <xsl:with-param name="current_indent"
93 select="$current_indent"/>
94 </xsl:apply-templates>
97 <xsl:template match="m:condition">
98 <xsl:param name="current_indent" select="0"/>
100 <xsl:with-param name="current_indent"
101 select="$current_indent"/>
102 </xsl:apply-templates>
105 <xsl:template match="m:math">
106 <xsl:param name="current_indent" select="0"/>
107 <xsl:apply-templates>
108 <xsl:with-param name="current_indent"
109 select="$current_indent"/>
110 </xsl:apply-templates>
113 <!--*********************************************************************-->
115 <!--*********************************************************************-->
118 <xsl:template mode="inline" match="m:ci">
120 <xsl:when test="boolean(@definitionURL)">
122 <xsl:attribute name="href">
123 <xsl:value-of select="concat(string($header),string(@definitionURL))"/>
125 <xsl:apply-templates/>
129 <xsl:value-of select="."/>
136 <xsl:template match="m:apply[m:csymbol]" mode="inline">
137 <xsl:variable name="name">
138 <xsl:value-of select="m:csymbol"/>
142 <xsl:when test="$name='forall'">
143 <FONT FACE="Symbol" SIZE="+2" color="blue">"</FONT>
144 <xsl:apply-templates select="m:bvar/m:ci"/>
145 <xsl:text>:</xsl:text>
146 <xsl:apply-templates mode="inline" select="m:bvar/m:type"/>
147 <xsl:text>.</xsl:text>
148 <xsl:apply-templates mode="inline" select="*[position()=3]"/>
150 <xsl:when test="$name='prod'">
151 <FONT FACE="Symbol" SIZE="+2" color="blue">Õ</FONT>
152 <xsl:apply-templates mode="inline" select="m:bvar/m:ci"/>
153 <xsl:text>:</xsl:text>
154 <xsl:apply-templates mode="inline" select="m:bvar/m:type"/>
155 <xsl:text>.</xsl:text>
156 <xsl:apply-templates mode="inline" select="*[position()=3]"/>
159 <xsl:when test="$name='arrow'">
160 <xsl:text>(</xsl:text>
161 <xsl:apply-templates mode="inline" select="*[position()=2]"/>
162 <FONT color="blue" FACE="symbol">
163 <xsl:text>®</xsl:text>
165 <xsl:apply-templates mode="inline" select="*[position()=3]"/>
166 <xsl:text>)</xsl:text>
169 <xsl:when test="$name='app'">
170 <xsl:text>(</xsl:text>
171 <xsl:apply-templates mode="inline" select="*[position()=2]"/>
172 <xsl:for-each select="*[position()>2]">
173 <xsl:text> </xsl:text>
174 <xsl:apply-templates mode="inline" select="."/>
176 <xsl:text>)</xsl:text>
179 <xsl:when test="$name='cast'">
180 <xsl:text>(</xsl:text>
181 <xsl:apply-templates mode="inline" select="*[position()=2]"/>
182 <xsl:text>:></xsl:text>
183 <xsl:apply-templates mode="inline" select="*[position()=3]"/>
184 <xsl:text>)</xsl:text>
186 <xsl:when test="$name='Prop'">
187 <FONT color="violet">Prop</FONT>
189 <xsl:when test="$name='Set'">
190 <FONT color="violet">Set</FONT>
192 <xsl:when test="$name='Type'">
193 <FONT color="violet">Type</FONT>
196 <xsl:when test="$name='mutcase'">
197 <xsl:text><</xsl:text>
198 <xsl:apply-templates mode="inline" select="*[position()=2]"/>
199 <xsl:text>> </xsl:text>
200 <FONT color="red">CASE </FONT>
201 <xsl:apply-templates mode="inline" select="*[position()=3]"/>
202 <FONT color="red"> OF </FONT>
203 <xsl:for-each select="*[position() mod 2 = 0 and position()>3]">
205 <xsl:when test="not(position() = 1)">
206 <xsl:text> | </xsl:text>
209 <xsl:apply-templates mode="inline" select="."/>
210 <FONT FACE="Symbol" SIZE="+2" mathcolor="green">Þ</FONT>
211 <xsl:apply-templates mode="inline"
212 select="following-sibling::*[position()= 1]"/>
216 <xsl:when test="$name='fix'">
217 <FONT color="red">FIX</FONT>
218 <xsl:value-of select="m:ci"/>
219 <xsl:text>{</xsl:text>
220 <xsl:for-each select="m:bvar">
221 <xsl:value-of select="m:ci"/>
222 <xsl:text>:</xsl:text>
223 <xsl:apply-templates mode="inline" select="m:type"/>
224 <xsl:text>:=</xsl:text>
225 <xsl:apply-templates mode="inline"
226 select="following-sibling::*[position() = 1]"/>
228 <xsl:when test="position()=last()">
229 <xsl:text>}</xsl:text>
232 <xsl:text>;</xsl:text>
238 <xsl:when test="$name='cofix'">
239 <xsl:text>COFIX</xsl:text>
240 <xsl:value-of select="m:ci"/>
241 <xsl:text>{</xsl:text>
242 <xsl:for-each select="m:bvar">
243 <xsl:value-of select="m:ci"/>
244 <xsl:text>:</xsl:text>
245 <xsl:apply-templates mode="inline" select="m:type"/>
246 <xsl:text>:=</xsl:text>
247 <xsl:apply-templates mode="inline"
248 select="following-sibling::*[position() = 1]"/>
250 <xsl:when test="position()=last()">
251 <xsl:text>}</xsl:text>
254 <xsl:text>;</xsl:text>
260 <xsl:when test="$name='proof'">
261 <xsl:apply-templates mode="inline" select="*[position()=2]"/>
262 <FONT color="red"> proves </FONT>
263 <xsl:apply-templates mode="inline" select="*[position()=3]"/>
266 <xsl:when test="$name='and_ind'">
267 <FONT color="red">From </FONT>
268 <xsl:apply-templates select="*[2]"/>
269 <FONT color="red"> we get</FONT>
271 <xsl:apply-templates select="*[3]"/>
272 <m:mtext>) </m:mtext>
273 <xsl:apply-templates mode="inline" select="*[4]"/>
274 <FONT color="red"> and </FONT>
276 <xsl:apply-templates select="*[5]"/>
277 <m:mtext>) </m:mtext>
278 <xsl:apply-templates mode="inline" select="*[6]"/>
280 <FONT color="red"> hence </FONT>
281 <xsl:apply-templates mode="inline" select="*[7]"/>
286 <xsl:template mode="inline" match="m:lambda">
287 <FONT SIZE="+2" color="red" FACE="symbol">l</FONT>
288 <xsl:apply-templates select="m:bvar/m:ci"/>
289 <xsl:text>:</xsl:text>
290 <xsl:apply-templates mode="inline" select="m:bvar/m:type"/>
291 <xsl:text>.</xsl:text>
292 <xsl:apply-templates mode="inline" select="*[position()=2]"/>
295 <!--*********************************************************************-->
296 <!-- COUNTING MODE -->
297 <!--*********************************************************************-->
299 <xsl:template match="m:apply[m:csymbol]">
300 <xsl:param name="current_indent" select="0"/>
301 <xsl:param name="width" select="$framewidth"/>
302 <xsl:variable name="name">
303 <xsl:value-of select="m:csymbol"/>
305 <xsl:variable name="charlength">
306 <xsl:apply-templates select="m:csymbol" mode="charcount"/>
308 <!-- <xsl:value-of select="$current_indent"/> -->
309 <!-- <xsl:value-of select="$charlength"/> -->
312 <xsl:when test="$name='forall'">
314 <xsl:when test="$charlength > $framewidth">
316 <FONT FACE="Symbol" SIZE="+2" color="blue">"</FONT>
317 <xsl:apply-templates select="m:bvar/m:ci"/>
318 <xsl:text>:</xsl:text>
319 <xsl:apply-templates select="m:bvar/m:type">
320 <xsl:with-param name="current_indent"
321 select="$current_indent + 2 + string-length(m:bvar/m:ci)"/>
322 </xsl:apply-templates>
324 <xsl:call-template name="make_indent">
325 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
327 <xsl:text>.</xsl:text>
328 <xsl:apply-templates select="*[position()=3]">
329 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
330 </xsl:apply-templates>
333 <xsl:apply-templates mode="inline" select="."/>
338 <xsl:when test="$name='prod'">
340 <xsl:when test="$charlength > $framewidth">
341 <FONT FACE="Symbol" SIZE="+2" color="blue">Õ</FONT>
342 <xsl:apply-templates select="m:bvar/m:ci"/>
343 <xsl:text>:</xsl:text>
344 <xsl:apply-templates select="m:bvar/m:type">
345 <xsl:with-param name="current_indent"
346 select="$current_indent + 2 + string-length(m:bvar/m:ci)"/>
347 </xsl:apply-templates><br/>
348 <xsl:call-template name="make_indent">
349 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
351 <xsl:text>.</xsl:text>
352 <xsl:apply-templates select="*[position()=3]">
353 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
354 </xsl:apply-templates>
357 <xsl:apply-templates mode="inline" select="."/>
362 <xsl:when test="$name='arrow'">
364 <xsl:when test="$charlength > $framewidth">
365 <xsl:text>(</xsl:text>
366 <xsl:apply-templates select="*[position()=2]">
367 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
368 </xsl:apply-templates>
370 <xsl:call-template name="make_indent">
371 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
374 <FONT color="blue" FACE="symbol">
375 <xsl:text>®</xsl:text>
377 <xsl:apply-templates select="*[position()=3]">
378 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
379 </xsl:apply-templates>
380 <xsl:text>)</xsl:text>
383 <xsl:apply-templates mode="inline" select="."/>
388 <xsl:when test="$name='app'">
390 <xsl:when test="$charlength > $framewidth">
391 <xsl:text>(</xsl:text>
392 <xsl:apply-templates select="*[position()=2]">
393 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
394 </xsl:apply-templates>
395 <xsl:for-each select="*[position()>2]">
397 <xsl:call-template name="make_indent">
398 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
400 <xsl:apply-templates select=".">
401 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
402 </xsl:apply-templates>
404 <xsl:text>)</xsl:text>
407 <xsl:apply-templates mode="inline" select="."/>
411 <xsl:when test="$name='cast'">
413 <xsl:when test="$showcast = 1">
415 <xsl:when test="$charlength > $framewidth">
416 <xsl:text>(</xsl:text>
417 <xsl:apply-templates select="*[position()=2]">
418 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
419 </xsl:apply-templates><br/>
420 <xsl:call-template name="make_indent">
421 <xsl:with-param name="current_indent" select="$current_indent + 2"/> </xsl:call-template>
422 <xsl:text>:></xsl:text>
423 <xsl:apply-templates select="*[position()=3]">
424 <xsl:with-param name="current_indent" select="$current_indent + 3"/>
425 </xsl:apply-templates>
426 <xsl:text>)</xsl:text>
429 <xsl:apply-templates mode="inline" select="."/>
434 <xsl:apply-templates select="*[position()=2]">
435 <xsl:with-param name="current_indent" select="$current_indent"/>
436 </xsl:apply-templates>
440 <xsl:when test="$name='Prop'">
441 <xsl:text>Prop</xsl:text>
443 <xsl:when test="$name='Set'">
444 <xsl:text>Set</xsl:text>
446 <xsl:when test="$name='Type'">
447 <xsl:text>Type</xsl:text>
449 <xsl:when test="$name='mutcase'">
451 <xsl:when test="$charlength > $framewidth">
452 <xsl:text><</xsl:text>
453 <xsl:apply-templates select="*[position()=2]">
454 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
455 </xsl:apply-templates>
456 <xsl:text>> </xsl:text>
457 <xsl:text>CASE </xsl:text>
458 <xsl:apply-templates select="*[position()=3]">
459 <xsl:with-param name="current_indent" select="$current_indent + 8"/>
460 </xsl:apply-templates>
461 <xsl:text> OF </xsl:text>
462 <xsl:for-each select="*[position() mod 2 = 0 and position()>3]">
464 <xsl:call-template name="make_indent">
465 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
468 <xsl:when test="position() = 1">
469 <xsl:text>  </xsl:text>
472 <xsl:text>| </xsl:text>
475 <xsl:apply-templates select="."/>
476 <FONT FACE="Symbol" SIZE="+2" mathcolor="green">Þ</FONT>
477 <xsl:apply-templates select="following-sibling::*[position()= 1]">
478 <xsl:with-param name="current_indent" select="$current_indent + 4 + string-length()"/>
479 </xsl:apply-templates>
483 <xsl:apply-templates mode="inline" select="."/>
488 <xsl:when test="$name='fix'">
490 <xsl:when test="$charlength > $framewidth">
491 <xsl:text>FIX</xsl:text>
492 <xsl:value-of select="m:ci"/>
493 <xsl:text>{</xsl:text>
494 <xsl:for-each select="m:bvar">
496 <xsl:call-template name="make_indent">
497 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
499 <xsl:value-of select="m:ci"/>
500 <xsl:text>:</xsl:text>
501 <xsl:apply-templates select="m:type">
502 <xsl:with-param name="current_indent"
503 select="$current_indent + 5 + string-length(m:ci)"/>
504 </xsl:apply-templates>
506 <xsl:call-template name="make_indent">
507 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
509 <xsl:text>:=</xsl:text>
510 <xsl:apply-templates select="following-sibling::*[position() = 1]">
511 <xsl:with-param name="current_indent" select="$current_indent +2"/>
512 </xsl:apply-templates>
515 <xsl:call-template name="make_indent">
516 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
518 <xsl:text>}</xsl:text>
521 <xsl:apply-templates mode="inline" select="."/>
526 <xsl:when test="$name='cofix'">
528 <xsl:when test="($charlength + 10) > $framewidth">
529 <xsl:text>COFIX</xsl:text>
530 <xsl:value-of select="m:ci"/>
531 <xsl:text>{</xsl:text>
533 <xsl:call-template name="make_indent">
534 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
536 <xsl:for-each select="m:bvar">
537 <xsl:value-of select="m:ci"/>
538 <xsl:text>:</xsl:text>
539 <xsl:apply-templates select="m:type">
540 <xsl:with-param name="current_indent"
541 select="$current_indent + 5 + string-length(m:ci)"/>
542 </xsl:apply-templates>
544 <xsl:call-template name="make_indent">
545 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
547 <xsl:text>:=</xsl:text>
548 <xsl:apply-templates select="following-sibling::*[position() = 1]">
549 <xsl:with-param name="current_indent" select="$current_indent + 3"/>
550 </xsl:apply-templates>
554 <xsl:call-template name="make_indent">
555 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
557 <xsl:text>}</xsl:text>
560 <xsl:apply-templates mode="inline" select="m:type"/>
564 <!-- ***************************************** -->
565 <!-- *********** PROOF ELEMENTS ************** -->
566 <!-- ***************************************** -->
568 <xsl:when test="$name='proof'">
569 <xsl:apply-templates select="*[position()=2]">
570 <xsl:with-param name="current_indent" select="$current_indent"/>
571 </xsl:apply-templates>
573 <!-- <xsl:element name="br"/> -->
574 <xsl:call-template name="make_indent">
575 <xsl:with-param name="current_indent" select="$current_indent"/>
577 <FONT color="red">we proved </FONT>
578 <xsl:apply-templates select="*[position()=3]">
579 <xsl:with-param name="current_indent" select="$current_indent + 16"/>
580 </xsl:apply-templates>
583 <xsl:when test="$name='letin1'">
584 <xsl:apply-templates select="*[position()=2]">
585 <xsl:with-param name="current_indent" select="$current_indent"/>
586 </xsl:apply-templates>
588 <xsl:call-template name="make_indent">
589 <xsl:with-param name="current_indent" select="$current_indent"/>
591 <xsl:apply-templates select="*[position()=3]">
592 <xsl:with-param name="current_indent" select="$current_indent"/>
593 </xsl:apply-templates>
596 <xsl:when test="$name='letin'">
597 <xsl:for-each select="*[position()>1 and last()>position()]">
598 <xsl:apply-templates select=".">
599 <xsl:with-param name="current_indent" select="$current_indent"/>
600 </xsl:apply-templates>
602 <xsl:call-template name="make_indent">
603 <xsl:with-param name="current_indent" select="$current_indent"/>
606 <xsl:apply-templates select="*[position()=last()]">
607 <xsl:with-param name="current_indent" select="$current_indent"/>
608 </xsl:apply-templates>
611 <xsl:when test="$name='let'">
613 <xsl:apply-templates select="m:ci"/>
614 <m:mtext>) </m:mtext>
615 <xsl:apply-templates select="*[3]">
616 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
617 </xsl:apply-templates>
620 <xsl:when test="$name='rw_step'">
622 <xsl:when test="name(*[2])='m:apply'">
623 <xsl:apply-templates select="*[2]">
624 <xsl:with-param name="current_indent" select="$current_indent"/>
625 </xsl:apply-templates>
628 <FONT color="red">Consider </FONT>
629 <xsl:apply-templates select="*[2]"/>
633 <xsl:call-template name="make_indent">
634 <xsl:with-param name="current_indent" select="$current_indent"/>
636 <FONT color="red">Rewrite </FONT>
637 <xsl:apply-templates select="*[3]"/>
638 <FONT color="red"> with </FONT>
639 <xsl:apply-templates select="*[4]"/>
640 <FONT color="red"> by </FONT>
641 <xsl:apply-templates select="*[5]"/>
643 <!-- rewrite and apply -->
644 <xsl:when test="$name='rewrite_and_apply'">
645 <xsl:apply-templates select="*[2]">
646 <xsl:with-param name="current_indent" select="$current_indent"/>
647 </xsl:apply-templates>
649 <xsl:call-template name="make_indent">
650 <xsl:with-param name="current_indent" select="$current_indent"/>
652 <FONT color="red">Then apply it to </FONT>
653 <xsl:apply-templates select="*[position()>2]"/>
656 <xsl:when test="$name='and_ind'">
658 <xsl:when test="name(*[2])='m:apply'">
659 <xsl:apply-templates select="*[2]">
660 <xsl:with-param name="current_indent" select="$current_indent"/>
661 </xsl:apply-templates>
664 <FONT color="red">Consider </FONT>
665 <xsl:apply-templates select="*[2]"/>
669 <xsl:call-template name="make_indent">
670 <xsl:with-param name="current_indent" select="$current_indent"/>
672 <FONT color="red">In particular, we have</FONT>
674 <xsl:call-template name="make_indent">
675 <xsl:with-param name="current_indent" select="$current_indent"/>
678 <xsl:apply-templates select="*[3]"/>
679 <m:mtext>) </m:mtext>
680 <xsl:apply-templates select="*[4]">
681 <xsl:with-param name="current_indent" select="$current_indent + 9"/>
682 </xsl:apply-templates>
684 <xsl:call-template name="make_indent">
685 <xsl:with-param name="current_indent" select="$current_indent"/>
688 <xsl:apply-templates select="*[5]"/>
689 <m:mtext>) </m:mtext>
690 <xsl:apply-templates select="*[6]">
691 <xsl:with-param name="current_indent" select="$current_indent + 9"/>
692 </xsl:apply-templates>
694 <xsl:call-template name="make_indent">
695 <xsl:with-param name="current_indent" select="$current_indent"/>
697 <xsl:apply-templates select="*[7]">
698 <xsl:with-param name="current_indent" select="$current_indent"/>
699 </xsl:apply-templates>
702 <xsl:when test="$name='or_ind'">
704 <xsl:when test="name(*[2])='m:apply'">
705 <xsl:apply-templates select="*[2]">
706 <xsl:with-param name="current_indent" select="$current_indent"/>
707 </xsl:apply-templates>
710 <FONT color="red">Consider </FONT>
711 <xsl:apply-templates select="*[2]"/>
715 <xsl:call-template name="make_indent">
716 <xsl:with-param name="current_indent" select="$current_indent"/>
718 <FONT color="red">We prove </FONT>
719 <xsl:apply-templates select="*[3]"/>
720 <FONT color="red"> by cases:</FONT>
722 <xsl:call-template name="make_indent">
723 <xsl:with-param name="current_indent" select="$current_indent"/>
726 <xsl:apply-templates select="*[4]">
727 <xsl:with-param name="current_indent" select="$current_indent"/>
728 </xsl:apply-templates>
730 <xsl:call-template name="make_indent">
731 <xsl:with-param name="current_indent" select="$current_indent"/>
734 <xsl:apply-templates select="*[5]">
735 <xsl:with-param name="current_indent" select="$current_indent"/>
736 </xsl:apply-templates>
739 <xsl:when test="$name='ex_ind'">
741 <xsl:when test="name(*[2])='m:apply'">
742 <xsl:apply-templates select="*[2]">
743 <xsl:with-param name="current_indent" select="$current_indent"/>
744 </xsl:apply-templates>
747 <FONT color="red">Consider </FONT>
748 <xsl:apply-templates select="*[2]">
749 <xsl:with-param name="current_indent" select="$current_indent"/>
750 </xsl:apply-templates>
754 <xsl:call-template name="make_indent">
755 <xsl:with-param name="current_indent" select="$current_indent"/>
757 <FONT color="red">Let </FONT>
758 <xsl:apply-templates mode="inline" select="*[3]"/>
760 <xsl:apply-templates mode="inline" select="*[4]"/>
761 <FONT color="red"> such that</FONT>
763 <xsl:call-template name="make_indent">
764 <xsl:with-param name="current_indent" select="$current_indent"/>
767 <xsl:apply-templates mode="inline" select="*[5]"/>
769 <xsl:apply-templates select="*[6]">
770 <xsl:with-param name="current_indent" select="$current_indent +7"/>
771 </xsl:apply-templates>
773 <xsl:call-template name="make_indent">
774 <xsl:with-param name="current_indent" select="$current_indent"/>
776 <xsl:apply-templates select="*[7]">
777 <xsl:with-param name="current_indent" select="$current_indent"/>
778 </xsl:apply-templates>
785 <xsl:template match="m:lambda">
786 <xsl:param name="current_indent" select="0"/>
787 <xsl:variable name="charlength">
788 <xsl:apply-templates select="*[position()=1]" mode="charcount"/>
789 <!-- <xsl:apply-templates select="." mode="charcount"/> -->
791 <!-- <xsl:value-of select="$charlength"/> -->
792 <!-- <xsl:value-of select="$current_indent"/> -->
794 <xsl:when test="$charlength > $framewidth">
796 <FONT SIZE="+2" color="red" FACE="symbol">l</FONT>
797 <xsl:apply-templates select="m:bvar/m:ci"/>
798 <xsl:text>:</xsl:text>
799 <xsl:apply-templates select="m:bvar/m:type">
800 <xsl:with-param name="current_indent"
801 select="$current_indent + 2 + string-length(m:bvar/m:ci)"/>
802 </xsl:apply-templates><br/>
803 <xsl:call-template name="make_indent">
804 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
806 <xsl:text>.</xsl:text>
807 <xsl:apply-templates select="*[position()=2]">
808 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
809 </xsl:apply-templates>
812 <xsl:apply-templates mode="inline" select="."/>
818 <xsl:template match="m:ci">
820 <xsl:when test="boolean(@definitionURL)">
822 <xsl:attribute name="href">
823 <xsl:value-of select="concat(string($header),string(@definitionURL))"/>
825 <xsl:apply-templates/>
829 <xsl:value-of select="."/>
836 <xsl:template match="m:ci|m:csymbol" mode="charcount">
837 <xsl:param name="incurrent_length" select="0"/>
839 <xsl:when test="$framewidth >= ($incurrent_length + string-length())">
840 <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>
842 <xsl:when test="string($siblength) = """>
843 <xsl:value-of select="$incurrent_length + string-length()"/>
846 <xsl:value-of select="number($siblength)"/>
851 <xsl:value-of select="$incurrent_length + string-length()"/>
856 <xsl:template match="*" mode="charcount">
857 <xsl:param name="incurrent_length" select="0"/>
859 <xsl:when test="count(child::*) = 0">
860 <xsl:value-of select="$incurrent_length"/>
863 <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>
865 <xsl:when test="$framewidth >= number($childlength)">
866 <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>
868 <xsl:when test="string($siblength) = """>
869 <xsl:value-of select="number($childlength)"/>
872 <xsl:value-of select="number($siblength)"/>
877 <xsl:value-of select="number($childlength)"/>
885 <!--***********************************************************************-->
887 <!--***********************************************************************-->
891 <xsl:template match="Definition">
892 <xsl:param name="current_indent" select="0"/>
894 DEFINITION <xsl:value-of select="@name"/>(<xsl:if test="string(./Params) != """><xsl:value-of select="Params"/></xsl:if>)<br/>
896 <xsl:call-template name="make_indent">
897 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
899 <xsl:apply-templates select="type/*[1]">
900 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
901 </xsl:apply-templates><br/>
903 <xsl:call-template name="make_indent">
904 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
906 <xsl:apply-templates select="body/*[1]">
907 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
908 </xsl:apply-templates>
914 <xsl:template match="Axiom">
915 <xsl:param name="current_indent" select="0"/>
917 AXIOM <xsl:value-of select="@name"/>(<xsl:if test="string(./Params) != """><xsl:value-of select="Params"/></xsl:if>)<br/>
919 <xsl:call-template name="make_indent">
920 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
922 <xsl:apply-templates select="type/*[1]">
923 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
924 </xsl:apply-templates>
928 <!-- UNFINISHED PROOF -->
930 <xsl:template match="CurrentProof">
931 <xsl:param name="current_indent" select="0"/>
933 UNFINISHED PROOF <xsl:value-of select="@name"/>(<xsl:if test="string(./Params) != """><xsl:value-of select="Params"/></xsl:if>)<br/>
934 THESIS: <xsl:apply-templates select="type/*[1]">
935 <xsl:with-param name="current_indent" select="$current_indent + 8"/>
936 </xsl:apply-templates><br/>
938 <xsl:for-each select="Conjecture">
940 <xsl:call-template name="make_indent">
941 <xsl:with-param name="current_indent" select="$current_indent + 8"/>
943 <xsl:value-of select="./@no"/> :
944 <xsl:apply-templates select="./*[1]">
945 <xsl:with-param name="current_indent" select="$current_indent + 11"/>
946 </xsl:apply-templates>
950 <xsl:apply-templates select="body/*[1]">
951 <xsl:with-param name="current_indent" select="$current_indent + 8"/>
952 </xsl:apply-templates>
956 <!-- MUTUAL INDUCTIVE DEFINITION -->
958 <xsl:template match="InductiveDefinition">
959 <xsl:param name="current_indent" select="0"/>
961 <xsl:for-each select="InductiveType">
963 <xsl:when test="position() = 1">
965 <xsl:when test="string(./@inductive) = "true"">
969 COINDUCTIVE DEFINITION
977 <xsl:value-of select="./@name"/>(<xsl:if test="string(../Params) != """><xsl:value-of select="../Params"/></xsl:if>)
979 <xsl:if test="string(../Param) != """>
980 <xsl:for-each select="../Param">
981 <xsl:value-of select="./@name"/>
983 <xsl:apply-templates select="*"/>
988 <xsl:apply-templates select="./arity/*[1]">
989 <xsl:with-param name="current_indent" select="$current_indent + 9"/>
990 </xsl:apply-templates> <br/>
992 <xsl:for-each select="./Constructor">
994 <xsl:call-template name="make_indent">
995 <xsl:with-param name="current_indent" select="$current_indent + 3"/>
998 <xsl:when test="position() = 1">
999 <xsl:text>  </xsl:text>
1002 <xsl:text>| </xsl:text>
1005 <xsl:value-of select="./@name"/>
1006 <xsl:text>: </xsl:text>
1007 <xsl:apply-templates select="./*[1]">
1008 <xsl:with-param name="current_indent" select="$current_indent + string-length(./@name) + 4"/>
1009 </xsl:apply-templates>
1017 <xsl:template match="Variable">
1018 <xsl:param name="current_indent" select="0"/>
1020 VARIABLE <xsl:value-of select="@name"/><br/>
1021 TYPE = <xsl:apply-templates select="type/*[1]">
1022 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
1023 </xsl:apply-templates>
1027 <!--***********************************************************************-->
1029 <!--***********************************************************************-->
1033 <xsl:template match="SECTION">
1034 <xsl:param name="current_indent" select="0"/>
1035 <h1>BEGIN OF SECTION</h1>
1036 <xsl:apply-templates/>
1037 <h1>END OF SECTION</h1>