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/'"/>
37 <xsl:param name="keys" select="'C1,HC2'"/>
39 <xsl:variable name="absPath"><xsl:value-of select="$getterURL"/>getciconly?uri=</xsl:variable>
41 <xsl:variable name="header"><xsl:value-of select="$processorURL"/>/apply?keys=<xsl:value-of select="$keys"/>&param.keys=<xsl:value-of select="$keys"/>&param.getterURL=<xsl:value-of select="$getterURL"/>&param.processorURL=<xsl:value-of select="$processorURL"/>&xmluri=<xsl:value-of select="$absPath"/></xsl:variable>
43 <xsl:include href="html_init.xsl"/>
44 <xsl:include href="html_set.xsl"/>
45 <xsl:include href="html_reals.xsl"/>
47 <xsl:variable name="showcast" select="0"/>
50 <!--***********************************************************************-->
51 <!-- HTML Head and Body -->
52 <!--***********************************************************************-->
54 <!-- <xsl:output method="html"/> -->
55 <xsl:output method="html" encoding="iso-8859-1"/>
57 <xsl:variable name="framewidth" select="36"/>
59 <xsl:template match="/">
60 <xsl:param name="current_indent" select="0"/>
64 A { text-decoration: none }
67 <body bgcolor="white">
69 <xsl:with-param name="current_indent" select="0"/>
70 </xsl:apply-templates>
75 <!--***********************************************************************-->
77 <!--***********************************************************************-->
79 <xsl:template name="make_indent">
80 <xsl:param name="current_indent" select="0"/>
81 <xsl:if test="$current_indent > 0">
82 <xsl:text> </xsl:text>
83 <xsl:call-template name="make_indent">
84 <xsl:with-param name="current_indent" select="$current_indent - 1"/>
89 <!-- Syntactic Sugar -->
90 <xsl:template match="m:type">
91 <xsl:param name="current_indent" select="0"/>
93 <xsl:with-param name="current_indent"
94 select="$current_indent"/>
95 </xsl:apply-templates>
98 <xsl:template match="m:condition">
99 <xsl:param name="current_indent" select="0"/>
100 <xsl:apply-templates>
101 <xsl:with-param name="current_indent"
102 select="$current_indent"/>
103 </xsl:apply-templates>
106 <xsl:template match="m:math">
107 <xsl:param name="current_indent" select="0"/>
108 <xsl:apply-templates>
109 <xsl:with-param name="current_indent"
110 select="$current_indent"/>
111 </xsl:apply-templates>
114 <!--*********************************************************************-->
116 <!--*********************************************************************-->
119 <xsl:template mode="inline" match="m:ci">
121 <xsl:when test="boolean(@definitionURL)">
123 <xsl:attribute name="href">
124 <xsl:value-of select="concat(string($header),string(@definitionURL))"/>
126 <xsl:apply-templates/>
130 <xsl:value-of select="."/>
137 <xsl:template match="m:apply[m:csymbol]" mode="inline">
138 <xsl:variable name="name">
139 <xsl:value-of select="m:csymbol"/>
143 <xsl:when test="$name='forall'">
144 <FONT FACE="Symbol" SIZE="+2" color="blue">"</FONT>
145 <xsl:apply-templates select="m:bvar/m:ci"/>
146 <xsl:text>:</xsl:text>
147 <xsl:apply-templates mode="inline" select="m:bvar/m:type"/>
148 <xsl:text>.</xsl:text>
149 <xsl:apply-templates mode="inline" select="*[position()=3]"/>
151 <xsl:when test="$name='prod'">
152 <FONT FACE="Symbol" SIZE="+2" color="blue">Õ</FONT>
153 <xsl:apply-templates mode="inline" select="m:bvar/m:ci"/>
154 <xsl:text>:</xsl:text>
155 <xsl:apply-templates mode="inline" select="m:bvar/m:type"/>
156 <xsl:text>.</xsl:text>
157 <xsl:apply-templates mode="inline" select="*[position()=3]"/>
160 <xsl:when test="$name='arrow'">
161 <xsl:text>(</xsl:text>
162 <xsl:apply-templates mode="inline" select="*[position()=2]"/>
163 <FONT color="blue" FACE="symbol">
164 <xsl:text>®</xsl:text>
166 <xsl:apply-templates mode="inline" select="*[position()=3]"/>
167 <xsl:text>)</xsl:text>
170 <xsl:when test="$name='app'">
171 <xsl:text>(</xsl:text>
172 <xsl:apply-templates mode="inline" select="*[position()=2]"/>
173 <xsl:for-each select="*[position()>2]">
174 <xsl:text> </xsl:text>
175 <xsl:apply-templates mode="inline" select="."/>
177 <xsl:text>)</xsl:text>
180 <xsl:when test="$name='cast'">
181 <xsl:text>(</xsl:text>
182 <xsl:apply-templates mode="inline" select="*[position()=2]"/>
183 <xsl:text>:></xsl:text>
184 <xsl:apply-templates mode="inline" select="*[position()=3]"/>
185 <xsl:text>)</xsl:text>
187 <xsl:when test="$name='Prop'">
188 <FONT color="violet">Prop</FONT>
190 <xsl:when test="$name='Set'">
191 <FONT color="violet">Set</FONT>
193 <xsl:when test="$name='Type'">
194 <FONT color="violet">Type</FONT>
197 <xsl:when test="$name='mutcase'">
198 <xsl:text><</xsl:text>
199 <xsl:apply-templates mode="inline" select="*[position()=2]"/>
200 <xsl:text>> </xsl:text>
201 <FONT color="red">CASE </FONT>
202 <xsl:apply-templates mode="inline" select="*[position()=3]"/>
203 <FONT color="red"> OF </FONT>
204 <xsl:for-each select="*[position() mod 2 = 0 and position()>3]">
206 <xsl:when test="not(position() = 1)">
207 <xsl:text> | </xsl:text>
210 <xsl:apply-templates mode="inline" select="."/>
211 <FONT FACE="Symbol" SIZE="+2" mathcolor="green">Þ</FONT>
212 <xsl:apply-templates mode="inline"
213 select="following-sibling::*[position()= 1]"/>
217 <xsl:when test="$name='fix'">
218 <FONT color="red">FIX</FONT>
219 <xsl:value-of select="m:ci"/>
220 <xsl:text>{</xsl:text>
221 <xsl:for-each select="m:bvar">
222 <xsl:value-of select="m:ci"/>
223 <xsl:text>:</xsl:text>
224 <xsl:apply-templates mode="inline" select="m:type"/>
225 <xsl:text>:=</xsl:text>
226 <xsl:apply-templates mode="inline"
227 select="following-sibling::*[position() = 1]"/>
229 <xsl:when test="position()=last()">
230 <xsl:text>}</xsl:text>
233 <xsl:text>;</xsl:text>
239 <xsl:when test="$name='cofix'">
240 <xsl:text>COFIX</xsl:text>
241 <xsl:value-of select="m:ci"/>
242 <xsl:text>{</xsl:text>
243 <xsl:for-each select="m:bvar">
244 <xsl:value-of select="m:ci"/>
245 <xsl:text>:</xsl:text>
246 <xsl:apply-templates mode="inline" select="m:type"/>
247 <xsl:text>:=</xsl:text>
248 <xsl:apply-templates mode="inline"
249 select="following-sibling::*[position() = 1]"/>
251 <xsl:when test="position()=last()">
252 <xsl:text>}</xsl:text>
255 <xsl:text>;</xsl:text>
261 <xsl:when test="$name='proof'">
262 <xsl:apply-templates mode="inline" select="*[position()=2]"/>
263 <FONT color="red"> proves </FONT>
264 <xsl:apply-templates mode="inline" select="*[position()=3]"/>
267 <xsl:when test="$name='and_ind'">
268 <FONT color="red">From </FONT>
269 <xsl:apply-templates select="*[2]"/>
270 <FONT color="red"> we get</FONT>
272 <xsl:apply-templates select="*[3]"/>
273 <m:mtext>) </m:mtext>
274 <xsl:apply-templates mode="inline" select="*[4]"/>
275 <FONT color="red"> and </FONT>
277 <xsl:apply-templates select="*[5]"/>
278 <m:mtext>) </m:mtext>
279 <xsl:apply-templates mode="inline" select="*[6]"/>
281 <FONT color="red"> hence </FONT>
282 <xsl:apply-templates mode="inline" select="*[7]"/>
287 <xsl:template mode="inline" match="m:lambda">
288 <FONT SIZE="+2" color="red" FACE="symbol">l</FONT>
289 <xsl:apply-templates select="m:bvar/m:ci"/>
290 <xsl:text>:</xsl:text>
291 <xsl:apply-templates mode="inline" select="m:bvar/m:type"/>
292 <xsl:text>.</xsl:text>
293 <xsl:apply-templates mode="inline" select="*[position()=2]"/>
296 <!--*********************************************************************-->
297 <!-- COUNTING MODE -->
298 <!--*********************************************************************-->
300 <xsl:template match="m:apply[m:csymbol]">
301 <xsl:param name="current_indent" select="0"/>
302 <xsl:param name="width" select="$framewidth"/>
303 <xsl:variable name="name">
304 <xsl:value-of select="m:csymbol"/>
306 <xsl:variable name="charlength">
307 <xsl:apply-templates select="m:csymbol" mode="charcount"/>
309 <!-- <xsl:value-of select="$current_indent"/> -->
310 <!-- <xsl:value-of select="$charlength"/> -->
313 <xsl:when test="$name='forall'">
315 <xsl:when test="$charlength > $framewidth">
317 <FONT FACE="Symbol" SIZE="+2" color="blue">"</FONT>
318 <xsl:apply-templates select="m:bvar/m:ci"/>
319 <xsl:text>:</xsl:text>
320 <xsl:apply-templates select="m:bvar/m:type">
321 <xsl:with-param name="current_indent"
322 select="$current_indent + 5 + 2*string-length(m:bvar/m:ci)"/>
323 </xsl:apply-templates>
325 <xsl:call-template name="make_indent">
326 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
328 <xsl:text>.</xsl:text>
329 <xsl:apply-templates select="*[position()=3]">
330 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
331 </xsl:apply-templates>
334 <xsl:apply-templates mode="inline" select="."/>
339 <xsl:when test="$name='prod'">
341 <xsl:when test="$charlength > $framewidth">
342 <FONT FACE="Symbol" SIZE="+2" color="blue">Õ</FONT>
343 <xsl:apply-templates select="m:bvar/m:ci"/>
344 <xsl:text>:</xsl:text>
345 <xsl:apply-templates select="m:bvar/m:type">
346 <xsl:with-param name="current_indent"
347 select="$current_indent + 5 + 2*string-length(m:bvar/m:ci)"/>
348 </xsl:apply-templates><br/>
349 <xsl:call-template name="make_indent">
350 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
352 <xsl:text>.</xsl:text>
353 <xsl:apply-templates select="*[position()=3]">
354 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
355 </xsl:apply-templates>
358 <xsl:apply-templates mode="inline" select="."/>
363 <xsl:when test="$name='arrow'">
365 <xsl:when test="$charlength > $framewidth">
366 <xsl:text>(</xsl:text>
367 <xsl:apply-templates select="*[position()=2]">
368 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
369 </xsl:apply-templates>
371 <xsl:call-template name="make_indent">
372 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
375 <FONT color="blue" FACE="symbol">
376 <xsl:text>®</xsl:text>
378 <xsl:apply-templates select="*[position()=3]">
379 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
380 </xsl:apply-templates>
381 <xsl:text>)</xsl:text>
384 <xsl:apply-templates mode="inline" select="."/>
389 <xsl:when test="$name='app'">
391 <xsl:when test="$charlength > $framewidth">
392 <xsl:text>(</xsl:text>
393 <xsl:apply-templates select="*[position()=2]">
394 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
395 </xsl:apply-templates>
396 <xsl:for-each select="*[position()>2]">
398 <xsl:call-template name="make_indent">
399 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
401 <xsl:apply-templates select=".">
402 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
403 </xsl:apply-templates>
405 <xsl:text>)</xsl:text>
408 <xsl:apply-templates mode="inline" select="."/>
412 <xsl:when test="$name='cast'">
414 <xsl:when test="$showcast = 1">
416 <xsl:when test="$charlength > $framewidth">
417 <xsl:text>(</xsl:text>
418 <xsl:apply-templates select="*[position()=2]">
419 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
420 </xsl:apply-templates><br/>
421 <xsl:call-template name="make_indent">
422 <xsl:with-param name="current_indent" select="$current_indent + 2"/> </xsl:call-template>
423 <xsl:text>:></xsl:text>
424 <xsl:apply-templates select="*[position()=3]">
425 <xsl:with-param name="current_indent" select="$current_indent + 3"/>
426 </xsl:apply-templates>
427 <xsl:text>)</xsl:text>
430 <xsl:apply-templates mode="inline" select="."/>
435 <xsl:apply-templates select="*[position()=2]">
436 <xsl:with-param name="current_indent" select="$current_indent"/>
437 </xsl:apply-templates>
441 <xsl:when test="$name='Prop'">
442 <xsl:text>Prop</xsl:text>
444 <xsl:when test="$name='Set'">
445 <xsl:text>Set</xsl:text>
447 <xsl:when test="$name='Type'">
448 <xsl:text>Type</xsl:text>
450 <xsl:when test="$name='mutcase'">
452 <xsl:when test="$charlength > $framewidth">
453 <xsl:text><</xsl:text>
454 <xsl:apply-templates select="*[position()=2]">
455 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
456 </xsl:apply-templates>
457 <xsl:text>> </xsl:text>
458 <xsl:text>CASE </xsl:text>
459 <xsl:apply-templates select="*[position()=3]">
460 <xsl:with-param name="current_indent" select="$current_indent + 8"/>
461 </xsl:apply-templates>
462 <xsl:text> OF </xsl:text>
463 <xsl:for-each select="*[position() mod 2 = 0 and position()>3]">
465 <xsl:call-template name="make_indent">
466 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
469 <xsl:when test="position() = 1">
470 <xsl:text>  </xsl:text>
473 <xsl:text>| </xsl:text>
476 <xsl:apply-templates select="."/>
477 <FONT FACE="Symbol" SIZE="+2" mathcolor="green">Þ</FONT>
478 <xsl:apply-templates select="following-sibling::*[position()= 1]">
479 <xsl:with-param name="current_indent" select="$current_indent + 4 + string-length()"/>
480 </xsl:apply-templates>
484 <xsl:apply-templates mode="inline" select="."/>
489 <xsl:when test="$name='fix'">
491 <xsl:when test="$charlength > $framewidth">
492 <xsl:text>FIX</xsl:text>
493 <xsl:value-of select="m:ci"/>
494 <xsl:text>{</xsl:text>
495 <xsl:for-each select="m:bvar">
497 <xsl:call-template name="make_indent">
498 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
500 <xsl:value-of select="m:ci"/>
501 <xsl:text>:</xsl:text>
502 <xsl:apply-templates select="m:type">
503 <xsl:with-param name="current_indent"
504 select="$current_indent + 5 + string-length(m:ci)"/>
505 </xsl:apply-templates>
507 <xsl:call-template name="make_indent">
508 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
510 <xsl:text>:=</xsl:text>
511 <xsl:apply-templates select="following-sibling::*[position() = 1]">
512 <xsl:with-param name="current_indent" select="$current_indent +2"/>
513 </xsl:apply-templates>
516 <xsl:call-template name="make_indent">
517 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
519 <xsl:text>}</xsl:text>
522 <xsl:apply-templates mode="inline" select="."/>
527 <xsl:when test="$name='cofix'">
529 <xsl:when test="($charlength + 10) > $framewidth">
530 <xsl:text>COFIX</xsl:text>
531 <xsl:value-of select="m:ci"/>
532 <xsl:text>{</xsl:text>
534 <xsl:call-template name="make_indent">
535 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
537 <xsl:for-each select="m:bvar">
538 <xsl:value-of select="m:ci"/>
539 <xsl:text>:</xsl:text>
540 <xsl:apply-templates select="m:type">
541 <xsl:with-param name="current_indent"
542 select="$current_indent + 5 + string-length(m:ci)"/>
543 </xsl:apply-templates>
545 <xsl:call-template name="make_indent">
546 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
548 <xsl:text>:=</xsl:text>
549 <xsl:apply-templates select="following-sibling::*[position() = 1]">
550 <xsl:with-param name="current_indent" select="$current_indent + 3"/>
551 </xsl:apply-templates>
555 <xsl:call-template name="make_indent">
556 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
558 <xsl:text>}</xsl:text>
561 <xsl:apply-templates mode="inline" select="m:type"/>
565 <!-- ***************************************** -->
566 <!-- *********** PROOF ELEMENTS ************** -->
567 <!-- ***************************************** -->
569 <xsl:when test="$name='proof'">
570 <xsl:apply-templates select="*[position()=2]">
571 <xsl:with-param name="current_indent" select="$current_indent"/>
572 </xsl:apply-templates>
574 <!-- <xsl:element name="br"/> -->
575 <xsl:call-template name="make_indent">
576 <xsl:with-param name="current_indent" select="$current_indent"/>
578 <FONT color="red">we proved </FONT>
579 <xsl:apply-templates select="*[position()=3]">
580 <xsl:with-param name="current_indent" select="$current_indent + 16"/>
581 </xsl:apply-templates>
584 <xsl:when test="$name='letin1'">
585 <xsl:apply-templates select="*[position()=2]">
586 <xsl:with-param name="current_indent" select="$current_indent"/>
587 </xsl:apply-templates>
589 <xsl:call-template name="make_indent">
590 <xsl:with-param name="current_indent" select="$current_indent"/>
592 <xsl:apply-templates select="*[position()=3]">
593 <xsl:with-param name="current_indent" select="$current_indent"/>
594 </xsl:apply-templates>
597 <xsl:when test="$name='letin'">
598 <xsl:for-each select="*[position()>1 and last()>position()]">
599 <xsl:apply-templates select=".">
600 <xsl:with-param name="current_indent" select="$current_indent"/>
601 </xsl:apply-templates>
603 <xsl:call-template name="make_indent">
604 <xsl:with-param name="current_indent" select="$current_indent"/>
607 <xsl:apply-templates select="*[position()=last()]">
608 <xsl:with-param name="current_indent" select="$current_indent"/>
609 </xsl:apply-templates>
612 <xsl:when test="$name='let'">
614 <xsl:apply-templates select="m:ci"/>
615 <m:mtext>) </m:mtext>
616 <xsl:apply-templates select="*[3]">
617 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
618 </xsl:apply-templates>
621 <xsl:when test="$name='rw_step'">
623 <xsl:when test="name(*[2])='m:apply'">
624 <xsl:apply-templates select="*[2]">
625 <xsl:with-param name="current_indent" select="$current_indent"/>
626 </xsl:apply-templates>
629 <FONT color="red">Consider </FONT>
630 <xsl:apply-templates select="*[2]"/>
634 <xsl:call-template name="make_indent">
635 <xsl:with-param name="current_indent" select="$current_indent"/>
637 <FONT color="red">Rewrite </FONT>
638 <xsl:apply-templates select="*[3]"/>
639 <FONT color="red"> with </FONT>
640 <xsl:apply-templates select="*[4]"/>
641 <FONT color="red"> by </FONT>
642 <xsl:apply-templates select="*[5]"/>
644 <!-- rewrite and apply -->
645 <xsl:when test="$name='rewrite_and_apply'">
646 <xsl:apply-templates select="*[2]">
647 <xsl:with-param name="current_indent" select="$current_indent"/>
648 </xsl:apply-templates>
650 <xsl:call-template name="make_indent">
651 <xsl:with-param name="current_indent" select="$current_indent"/>
653 <FONT color="red">Then apply it to </FONT>
654 <xsl:apply-templates select="*[position()>2]"/>
657 <xsl:when test="$name='and_ind'">
659 <xsl:when test="name(*[2])='m:apply'">
660 <xsl:apply-templates select="*[2]">
661 <xsl:with-param name="current_indent" select="$current_indent"/>
662 </xsl:apply-templates>
665 <FONT color="red">Consider </FONT>
666 <xsl:apply-templates select="*[2]"/>
670 <xsl:call-template name="make_indent">
671 <xsl:with-param name="current_indent" select="$current_indent"/>
673 <FONT color="red">In particular, we have</FONT>
675 <xsl:call-template name="make_indent">
676 <xsl:with-param name="current_indent" select="$current_indent"/>
679 <xsl:apply-templates select="*[3]"/>
680 <m:mtext>) </m:mtext>
681 <xsl:apply-templates select="*[4]">
682 <xsl:with-param name="current_indent" select="$current_indent + 9"/>
683 </xsl:apply-templates>
685 <xsl:call-template name="make_indent">
686 <xsl:with-param name="current_indent" select="$current_indent"/>
689 <xsl:apply-templates select="*[5]"/>
690 <m:mtext>) </m:mtext>
691 <xsl:apply-templates select="*[6]">
692 <xsl:with-param name="current_indent" select="$current_indent + 9"/>
693 </xsl:apply-templates>
695 <xsl:call-template name="make_indent">
696 <xsl:with-param name="current_indent" select="$current_indent"/>
698 <xsl:apply-templates select="*[7]">
699 <xsl:with-param name="current_indent" select="$current_indent"/>
700 </xsl:apply-templates>
703 <xsl:when test="$name='or_ind'">
705 <xsl:when test="name(*[2])='m:apply'">
706 <xsl:apply-templates select="*[2]">
707 <xsl:with-param name="current_indent" select="$current_indent"/>
708 </xsl:apply-templates>
711 <FONT color="red">Consider </FONT>
712 <xsl:apply-templates select="*[2]"/>
716 <xsl:call-template name="make_indent">
717 <xsl:with-param name="current_indent" select="$current_indent"/>
719 <FONT color="red">We prove </FONT>
720 <xsl:apply-templates select="*[3]"/>
721 <FONT color="red"> by cases:</FONT>
723 <xsl:call-template name="make_indent">
724 <xsl:with-param name="current_indent" select="$current_indent"/>
727 <xsl:apply-templates select="*[4]">
728 <xsl:with-param name="current_indent" select="$current_indent"/>
729 </xsl:apply-templates>
731 <xsl:call-template name="make_indent">
732 <xsl:with-param name="current_indent" select="$current_indent"/>
735 <xsl:apply-templates select="*[5]">
736 <xsl:with-param name="current_indent" select="$current_indent"/>
737 </xsl:apply-templates>
740 <xsl:when test="$name='ex_ind'">
742 <xsl:when test="name(*[2])='m:apply'">
743 <xsl:apply-templates select="*[2]">
744 <xsl:with-param name="current_indent" select="$current_indent"/>
745 </xsl:apply-templates>
748 <FONT color="red">Consider </FONT>
749 <xsl:apply-templates select="*[2]">
750 <xsl:with-param name="current_indent" select="$current_indent"/>
751 </xsl:apply-templates>
755 <xsl:call-template name="make_indent">
756 <xsl:with-param name="current_indent" select="$current_indent"/>
758 <FONT color="red">Let </FONT>
759 <xsl:apply-templates mode="inline" select="*[3]"/>
761 <xsl:apply-templates mode="inline" select="*[4]"/>
762 <FONT color="red"> such that</FONT>
764 <xsl:call-template name="make_indent">
765 <xsl:with-param name="current_indent" select="$current_indent"/>
768 <xsl:apply-templates mode="inline" select="*[5]"/>
770 <xsl:apply-templates select="*[6]">
771 <xsl:with-param name="current_indent" select="$current_indent +7"/>
772 </xsl:apply-templates>
774 <xsl:call-template name="make_indent">
775 <xsl:with-param name="current_indent" select="$current_indent"/>
777 <xsl:apply-templates select="*[7]">
778 <xsl:with-param name="current_indent" select="$current_indent"/>
779 </xsl:apply-templates>
786 <xsl:template match="m:lambda">
787 <xsl:param name="current_indent" select="0"/>
788 <xsl:variable name="charlength">
789 <xsl:apply-templates select="*[position()=1]" mode="charcount"/>
790 <!-- <xsl:apply-templates select="." mode="charcount"/> -->
792 <!-- <xsl:value-of select="$charlength"/> -->
793 <!-- <xsl:value-of select="$current_indent"/> -->
795 <xsl:when test="$charlength > $framewidth">
797 <FONT SIZE="+2" color="red" FACE="symbol">l</FONT>
798 <xsl:apply-templates select="m:bvar/m:ci"/>
799 <xsl:text>:</xsl:text>
800 <xsl:apply-templates select="m:bvar/m:type">
801 <xsl:with-param name="current_indent"
802 select="$current_indent + 4 + 2*string-length(m:bvar/m:ci)"/>
803 </xsl:apply-templates><br/>
804 <xsl:call-template name="make_indent">
805 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
807 <xsl:text>.</xsl:text>
808 <xsl:apply-templates select="*[position()=2]">
809 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
810 </xsl:apply-templates>
813 <xsl:apply-templates mode="inline" select="."/>
819 <xsl:template match="m:ci">
821 <xsl:when test="boolean(@definitionURL)">
823 <xsl:attribute name="href">
824 <xsl:value-of select="concat(string($header),string(@definitionURL))"/>
826 <xsl:apply-templates/>
830 <xsl:value-of select="."/>
837 <xsl:template match="m:ci|m:csymbol" mode="charcount">
838 <xsl:param name="incurrent_length" select="0"/>
840 <xsl:when test="$framewidth >= ($incurrent_length + string-length())">
841 <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>
843 <xsl:when test="string($siblength) = """>
844 <xsl:value-of select="$incurrent_length + string-length()"/>
847 <xsl:value-of select="number($siblength)"/>
852 <xsl:value-of select="$incurrent_length + string-length()"/>
857 <xsl:template match="*" mode="charcount">
858 <xsl:param name="incurrent_length" select="0"/>
860 <xsl:when test="count(child::*) = 0">
861 <xsl:value-of select="$incurrent_length"/>
864 <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>
866 <xsl:when test="$framewidth >= number($childlength)">
867 <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>
869 <xsl:when test="string($siblength) = """>
870 <xsl:value-of select="number($childlength)"/>
873 <xsl:value-of select="number($siblength)"/>
878 <xsl:value-of select="number($childlength)"/>
886 <!--***********************************************************************-->
888 <!--***********************************************************************-->
892 <xsl:template match="Definition">
893 <xsl:param name="current_indent" select="0"/>
895 DEFINITION <xsl:value-of select="@name"/>(<xsl:if test="string(./Params) != """><xsl:value-of select="Params"/></xsl:if>)<br/>
897 <xsl:call-template name="make_indent">
898 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
900 <xsl:apply-templates select="type/*[1]">
901 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
902 </xsl:apply-templates><br/>
904 <xsl:call-template name="make_indent">
905 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
907 <xsl:apply-templates select="body/*[1]">
908 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
909 </xsl:apply-templates>
915 <xsl:template match="Axiom">
916 <xsl:param name="current_indent" select="0"/>
918 AXIOM <xsl:value-of select="@name"/>(<xsl:if test="string(./Params) != """><xsl:value-of select="Params"/></xsl:if>)<br/>
920 <xsl:call-template name="make_indent">
921 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
923 <xsl:apply-templates select="type/*[1]">
924 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
925 </xsl:apply-templates>
929 <!-- UNFINISHED PROOF -->
931 <xsl:template match="CurrentProof">
932 <xsl:param name="current_indent" select="0"/>
934 UNFINISHED PROOF <xsl:value-of select="@name"/>(<xsl:if test="string(./Params) != """><xsl:value-of select="Params"/></xsl:if>)<br/>
935 THESIS: <xsl:apply-templates select="type/*[1]">
936 <xsl:with-param name="current_indent" select="$current_indent + 8"/>
937 </xsl:apply-templates><br/>
939 <xsl:for-each select="Conjecture">
941 <xsl:call-template name="make_indent">
942 <xsl:with-param name="current_indent" select="$current_indent + 8"/>
944 <xsl:value-of select="./@no"/> :
945 <xsl:apply-templates select="./*[1]">
946 <xsl:with-param name="current_indent" select="$current_indent + 11"/>
947 </xsl:apply-templates>
951 <xsl:apply-templates select="body/*[1]">
952 <xsl:with-param name="current_indent" select="$current_indent + 8"/>
953 </xsl:apply-templates>
957 <!-- MUTUAL INDUCTIVE DEFINITION -->
959 <xsl:template match="InductiveDefinition">
960 <xsl:param name="current_indent" select="0"/>
962 <xsl:for-each select="InductiveType">
964 <xsl:when test="position() = 1">
966 <xsl:when test="string(./@inductive) = "true"">
970 COINDUCTIVE DEFINITION
978 <xsl:value-of select="./@name"/>(<xsl:if test="string(../Params) != """><xsl:value-of select="../Params"/></xsl:if>)
980 <xsl:if test="string(../Param) != """>
981 <xsl:for-each select="../Param">
982 <xsl:value-of select="./@name"/>
984 <xsl:apply-templates select="*"/>
989 <xsl:apply-templates select="./arity/*[1]">
990 <xsl:with-param name="current_indent" select="$current_indent + 9"/>
991 </xsl:apply-templates> <br/>
993 <xsl:for-each select="./Constructor">
995 <xsl:call-template name="make_indent">
996 <xsl:with-param name="current_indent" select="$current_indent + 3"/>
999 <xsl:when test="position() = 1">
1000 <xsl:text>  </xsl:text>
1003 <xsl:text>| </xsl:text>
1006 <xsl:value-of select="./@name"/>
1007 <xsl:text>: </xsl:text>
1008 <xsl:apply-templates select="./*[1]">
1009 <xsl:with-param name="current_indent" select="$current_indent + 2*string-length(./@name) + 5"/>
1010 </xsl:apply-templates>
1018 <xsl:template match="Variable">
1019 <xsl:param name="current_indent" select="0"/>
1021 VARIABLE <xsl:value-of select="@name"/><br/>
1022 TYPE = <xsl:apply-templates select="type/*[1]">
1023 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
1024 </xsl:apply-templates>
1028 <!--***********************************************************************-->
1030 <!--***********************************************************************-->
1034 <xsl:template match="SECTION">
1035 <xsl:param name="current_indent" select="0"/>
1036 <h1>BEGIN OF SECTION</h1>
1037 <xsl:apply-templates/>
1038 <h1>END OF SECTION</h1>