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.naturalLanguage=<xsl:value-of select="$naturalLanguage"/>&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"/>
49 <xsl:template name="makeURL">
50 <xsl:param name="url" select="''"/>
51 <xsl:value-of select="concat(string($header),string($url),'&param.CICURI=',string($url))"/>
54 <!--***********************************************************************-->
55 <!-- HTML Head and Body -->
56 <!--***********************************************************************-->
58 <!-- <xsl:output method="html"/> -->
59 <xsl:output method="html" encoding="iso-8859-1"/>
61 <xsl:variable name="framewidth" select="36"/>
63 <xsl:template match="/">
64 <xsl:param name="current_indent" select="0"/>
68 A { text-decoration: none }
71 <body bgcolor="white">
73 <xsl:with-param name="current_indent" select="0"/>
74 </xsl:apply-templates>
79 <!--***********************************************************************-->
81 <!--***********************************************************************-->
83 <xsl:template name="make_indent">
84 <xsl:param name="current_indent" select="0"/>
85 <xsl:if test="$current_indent > 0">
86 <xsl:text> </xsl:text>
87 <xsl:call-template name="make_indent">
88 <xsl:with-param name="current_indent" select="$current_indent - 1"/>
93 <!-- Syntactic Sugar -->
94 <xsl:template match="m:type">
95 <xsl:param name="current_indent" select="0"/>
97 <xsl:with-param name="current_indent"
98 select="$current_indent"/>
99 </xsl:apply-templates>
102 <xsl:template match="m:condition">
103 <xsl:param name="current_indent" select="0"/>
104 <xsl:apply-templates>
105 <xsl:with-param name="current_indent"
106 select="$current_indent"/>
107 </xsl:apply-templates>
110 <xsl:template match="m:math">
111 <xsl:param name="current_indent" select="0"/>
112 <xsl:apply-templates>
113 <xsl:with-param name="current_indent"
114 select="$current_indent"/>
115 </xsl:apply-templates>
118 <!--*********************************************************************-->
120 <!--*********************************************************************-->
123 <xsl:template mode="inline" match="m:ci">
125 <xsl:when test="boolean(@definitionURL)">
127 <xsl:attribute name="href">
128 <xsl:call-template name="makeURL">
129 <xsl:with-param name="url" select="@definitionURL"/>
132 <xsl:apply-templates/>
136 <xsl:value-of select="."/>
143 <xsl:template match="m:apply[m:csymbol]" mode="inline">
144 <xsl:variable name="name">
145 <xsl:value-of select="m:csymbol"/>
149 <xsl:when test="$name='forall'">
150 <FONT FACE="Symbol" SIZE="+2" color="blue">"</FONT>
151 <xsl:apply-templates 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]"/>
157 <xsl:when test="$name='prod'">
158 <FONT FACE="Symbol" SIZE="+2" color="blue">Õ</FONT>
159 <xsl:apply-templates mode="inline" select="m:bvar/m:ci"/>
160 <xsl:text>:</xsl:text>
161 <xsl:apply-templates mode="inline" select="m:bvar/m:type"/>
162 <xsl:text>.</xsl:text>
163 <xsl:apply-templates mode="inline" select="*[position()=3]"/>
166 <xsl:when test="$name='arrow'">
167 <xsl:text>(</xsl:text>
168 <xsl:apply-templates mode="inline" select="*[position()=2]"/>
169 <FONT color="blue" FACE="symbol">
170 <xsl:text>®</xsl:text>
172 <xsl:apply-templates mode="inline" select="*[position()=3]"/>
173 <xsl:text>)</xsl:text>
176 <xsl:when test="$name='app'">
177 <xsl:text>(</xsl:text>
178 <xsl:apply-templates mode="inline" select="*[position()=2]"/>
179 <xsl:for-each select="*[position()>2]">
180 <xsl:text> </xsl:text>
181 <xsl:apply-templates mode="inline" select="."/>
183 <xsl:text>)</xsl:text>
186 <xsl:when test="$name='cast'">
187 <xsl:text>(</xsl:text>
188 <xsl:apply-templates mode="inline" select="*[position()=2]"/>
189 <xsl:text>:></xsl:text>
190 <xsl:apply-templates mode="inline" select="*[position()=3]"/>
191 <xsl:text>)</xsl:text>
193 <xsl:when test="$name='Prop'">
194 <FONT color="violet">Prop</FONT>
196 <xsl:when test="$name='Set'">
197 <FONT color="violet">Set</FONT>
199 <xsl:when test="$name='Type'">
200 <FONT color="violet">Type</FONT>
203 <xsl:when test="$name='mutcase'">
204 <xsl:text><</xsl:text>
205 <xsl:apply-templates mode="inline" select="*[position()=2]"/>
206 <xsl:text>> </xsl:text>
207 <FONT color="red">CASE </FONT>
208 <xsl:apply-templates mode="inline" select="*[position()=3]"/>
209 <FONT color="red"> OF </FONT>
210 <xsl:for-each select="*[position() mod 2 = 0 and position()>3]">
212 <xsl:when test="not(position() = 1)">
213 <xsl:text> | </xsl:text>
216 <xsl:apply-templates mode="inline" select="."/>
217 <FONT FACE="Symbol" SIZE="+2" mathcolor="green">Þ</FONT>
218 <xsl:apply-templates mode="inline"
219 select="following-sibling::*[position()= 1]"/>
223 <xsl:when test="$name='fix'">
224 <FONT color="red">FIX</FONT>
225 <xsl:value-of select="m:ci"/>
226 <xsl:text>{</xsl:text>
227 <xsl:for-each select="m:bvar">
228 <xsl:value-of select="m:ci"/>
229 <xsl:text>:</xsl:text>
230 <xsl:apply-templates mode="inline" select="m:type"/>
231 <xsl:text>:=</xsl:text>
232 <xsl:apply-templates mode="inline"
233 select="following-sibling::*[position() = 1]"/>
235 <xsl:when test="position()=last()">
236 <xsl:text>}</xsl:text>
239 <xsl:text>;</xsl:text>
245 <xsl:when test="$name='cofix'">
246 <xsl:text>COFIX</xsl:text>
247 <xsl:value-of select="m:ci"/>
248 <xsl:text>{</xsl:text>
249 <xsl:for-each select="m:bvar">
250 <xsl:value-of select="m:ci"/>
251 <xsl:text>:</xsl:text>
252 <xsl:apply-templates mode="inline" select="m:type"/>
253 <xsl:text>:=</xsl:text>
254 <xsl:apply-templates mode="inline"
255 select="following-sibling::*[position() = 1]"/>
257 <xsl:when test="position()=last()">
258 <xsl:text>}</xsl:text>
261 <xsl:text>;</xsl:text>
267 <xsl:when test="$name='proof'">
268 <xsl:apply-templates mode="inline" select="*[position()=2]"/>
269 <FONT color="red"> proves </FONT>
270 <xsl:apply-templates mode="inline" select="*[position()=3]"/>
273 <xsl:when test="$name='and_ind'">
274 <FONT color="red">From </FONT>
275 <xsl:apply-templates select="*[2]"/>
276 <FONT color="red"> we get</FONT>
278 <xsl:apply-templates select="*[3]"/>
279 <m:mtext>) </m:mtext>
280 <xsl:apply-templates mode="inline" select="*[4]"/>
281 <FONT color="red"> and </FONT>
283 <xsl:apply-templates select="*[5]"/>
284 <m:mtext>) </m:mtext>
285 <xsl:apply-templates mode="inline" select="*[6]"/>
287 <FONT color="red"> hence </FONT>
288 <xsl:apply-templates mode="inline" select="*[7]"/>
293 <xsl:template mode="inline" match="m:lambda">
294 <FONT SIZE="+2" color="red" FACE="symbol">l</FONT>
295 <xsl:apply-templates select="m:bvar/m:ci"/>
296 <xsl:text>:</xsl:text>
297 <xsl:apply-templates mode="inline" select="m:bvar/m:type"/>
298 <xsl:text>.</xsl:text>
299 <xsl:apply-templates mode="inline" select="*[position()=2]"/>
302 <!--*********************************************************************-->
303 <!-- COUNTING MODE -->
304 <!--*********************************************************************-->
306 <xsl:template match="m:apply[m:csymbol]">
307 <xsl:param name="current_indent" select="0"/>
308 <xsl:param name="width" select="$framewidth"/>
309 <xsl:variable name="name">
310 <xsl:value-of select="m:csymbol"/>
312 <xsl:variable name="charlength">
313 <xsl:apply-templates select="m:csymbol" mode="charcount"/>
315 <!-- <xsl:value-of select="$current_indent"/> -->
316 <!-- <xsl:value-of select="$charlength"/> -->
319 <xsl:when test="$name='forall'">
321 <xsl:when test="$charlength > $framewidth">
323 <FONT FACE="Symbol" SIZE="+2" color="blue">"</FONT>
324 <xsl:apply-templates select="m:bvar/m:ci"/>
325 <xsl:text>:</xsl:text>
326 <xsl:apply-templates select="m:bvar/m:type">
327 <xsl:with-param name="current_indent"
328 select="$current_indent + 5 + 2*string-length(m:bvar/m:ci)"/>
329 </xsl:apply-templates>
331 <xsl:call-template name="make_indent">
332 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
334 <xsl:text>.</xsl:text>
335 <xsl:apply-templates select="*[position()=3]">
336 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
337 </xsl:apply-templates>
340 <xsl:apply-templates mode="inline" select="."/>
345 <xsl:when test="$name='prod'">
347 <xsl:when test="$charlength > $framewidth">
348 <FONT FACE="Symbol" SIZE="+2" color="blue">Õ</FONT>
349 <xsl:apply-templates select="m:bvar/m:ci"/>
350 <xsl:text>:</xsl:text>
351 <xsl:apply-templates select="m:bvar/m:type">
352 <xsl:with-param name="current_indent"
353 select="$current_indent + 5 + 2*string-length(m:bvar/m:ci)"/>
354 </xsl:apply-templates><br/>
355 <xsl:call-template name="make_indent">
356 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
358 <xsl:text>.</xsl:text>
359 <xsl:apply-templates select="*[position()=3]">
360 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
361 </xsl:apply-templates>
364 <xsl:apply-templates mode="inline" select="."/>
369 <xsl:when test="$name='arrow'">
371 <xsl:when test="$charlength > $framewidth">
372 <xsl:text>(</xsl:text>
373 <xsl:apply-templates select="*[position()=2]">
374 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
375 </xsl:apply-templates>
377 <xsl:call-template name="make_indent">
378 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
381 <FONT color="blue" FACE="symbol">
382 <xsl:text>®</xsl:text>
384 <xsl:apply-templates select="*[position()=3]">
385 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
386 </xsl:apply-templates>
387 <xsl:text>)</xsl:text>
390 <xsl:apply-templates mode="inline" select="."/>
395 <xsl:when test="$name='app'">
397 <xsl:when test="$charlength > $framewidth">
398 <xsl:text>(</xsl:text>
399 <xsl:apply-templates select="*[position()=2]">
400 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
401 </xsl:apply-templates>
402 <xsl:for-each select="*[position()>2]">
404 <xsl:call-template name="make_indent">
405 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
407 <xsl:apply-templates select=".">
408 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
409 </xsl:apply-templates>
411 <xsl:text>)</xsl:text>
414 <xsl:apply-templates mode="inline" select="."/>
418 <xsl:when test="$name='cast'">
420 <xsl:when test="$showcast = 1">
422 <xsl:when test="$charlength > $framewidth">
423 <xsl:text>(</xsl:text>
424 <xsl:apply-templates select="*[position()=2]">
425 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
426 </xsl:apply-templates><br/>
427 <xsl:call-template name="make_indent">
428 <xsl:with-param name="current_indent" select="$current_indent + 2"/> </xsl:call-template>
429 <xsl:text>:></xsl:text>
430 <xsl:apply-templates select="*[position()=3]">
431 <xsl:with-param name="current_indent" select="$current_indent + 3"/>
432 </xsl:apply-templates>
433 <xsl:text>)</xsl:text>
436 <xsl:apply-templates mode="inline" select="."/>
441 <xsl:apply-templates select="*[position()=2]">
442 <xsl:with-param name="current_indent" select="$current_indent"/>
443 </xsl:apply-templates>
447 <xsl:when test="$name='Prop'">
448 <xsl:text>Prop</xsl:text>
450 <xsl:when test="$name='Set'">
451 <xsl:text>Set</xsl:text>
453 <xsl:when test="$name='Type'">
454 <xsl:text>Type</xsl:text>
456 <xsl:when test="$name='mutcase'">
458 <xsl:when test="$charlength > $framewidth">
459 <xsl:text><</xsl:text>
460 <xsl:apply-templates select="*[position()=2]">
461 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
462 </xsl:apply-templates>
463 <xsl:text>> </xsl:text>
464 <xsl:text>CASE </xsl:text>
465 <xsl:apply-templates select="*[position()=3]">
466 <xsl:with-param name="current_indent" select="$current_indent + 8"/>
467 </xsl:apply-templates>
468 <xsl:text> OF </xsl:text>
469 <xsl:for-each select="*[position() mod 2 = 0 and position()>3]">
471 <xsl:call-template name="make_indent">
472 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
475 <xsl:when test="position() = 1">
476 <xsl:text>  </xsl:text>
479 <xsl:text>| </xsl:text>
482 <xsl:apply-templates select="."/>
483 <FONT FACE="Symbol" SIZE="+2" mathcolor="green">Þ</FONT>
484 <xsl:apply-templates select="following-sibling::*[position()= 1]">
485 <xsl:with-param name="current_indent" select="$current_indent + 4 + string-length()"/>
486 </xsl:apply-templates>
490 <xsl:apply-templates mode="inline" select="."/>
495 <xsl:when test="$name='fix'">
497 <xsl:when test="$charlength > $framewidth">
498 <xsl:text>FIX</xsl:text>
499 <xsl:value-of select="m:ci"/>
500 <xsl:text>{</xsl:text>
501 <xsl:for-each select="m:bvar">
503 <xsl:call-template name="make_indent">
504 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
506 <xsl:value-of select="m:ci"/>
507 <xsl:text>:</xsl:text>
508 <xsl:apply-templates select="m:type">
509 <xsl:with-param name="current_indent"
510 select="$current_indent + 5 + string-length(m:ci)"/>
511 </xsl:apply-templates>
513 <xsl:call-template name="make_indent">
514 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
516 <xsl:text>:=</xsl:text>
517 <xsl:apply-templates select="following-sibling::*[position() = 1]">
518 <xsl:with-param name="current_indent" select="$current_indent +2"/>
519 </xsl:apply-templates>
522 <xsl:call-template name="make_indent">
523 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
525 <xsl:text>}</xsl:text>
528 <xsl:apply-templates mode="inline" select="."/>
533 <xsl:when test="$name='cofix'">
535 <xsl:when test="($charlength + 10) > $framewidth">
536 <xsl:text>COFIX</xsl:text>
537 <xsl:value-of select="m:ci"/>
538 <xsl:text>{</xsl:text>
540 <xsl:call-template name="make_indent">
541 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
543 <xsl:for-each select="m:bvar">
544 <xsl:value-of select="m:ci"/>
545 <xsl:text>:</xsl:text>
546 <xsl:apply-templates select="m:type">
547 <xsl:with-param name="current_indent"
548 select="$current_indent + 5 + string-length(m:ci)"/>
549 </xsl:apply-templates>
551 <xsl:call-template name="make_indent">
552 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
554 <xsl:text>:=</xsl:text>
555 <xsl:apply-templates select="following-sibling::*[position() = 1]">
556 <xsl:with-param name="current_indent" select="$current_indent + 3"/>
557 </xsl:apply-templates>
561 <xsl:call-template name="make_indent">
562 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
564 <xsl:text>}</xsl:text>
567 <xsl:apply-templates mode="inline" select="m:type"/>
571 <!-- ***************************************** -->
572 <!-- *********** PROOF ELEMENTS ************** -->
573 <!-- ***************************************** -->
575 <xsl:when test="$name='proof'">
576 <xsl:apply-templates select="*[position()=2]">
577 <xsl:with-param name="current_indent" select="$current_indent"/>
578 </xsl:apply-templates>
580 <!-- <xsl:element name="br"/> -->
581 <xsl:call-template name="make_indent">
582 <xsl:with-param name="current_indent" select="$current_indent"/>
584 <FONT color="red">we proved </FONT>
585 <xsl:apply-templates select="*[position()=3]">
586 <xsl:with-param name="current_indent" select="$current_indent + 16"/>
587 </xsl:apply-templates>
590 <xsl:when test="$name='letin1'">
591 <xsl:apply-templates select="*[position()=2]">
592 <xsl:with-param name="current_indent" select="$current_indent"/>
593 </xsl:apply-templates>
595 <xsl:call-template name="make_indent">
596 <xsl:with-param name="current_indent" select="$current_indent"/>
598 <xsl:apply-templates select="*[position()=3]">
599 <xsl:with-param name="current_indent" select="$current_indent"/>
600 </xsl:apply-templates>
603 <xsl:when test="$name='letin'">
604 <xsl:for-each select="*[position()>1 and last()>position()]">
605 <xsl:apply-templates select=".">
606 <xsl:with-param name="current_indent" select="$current_indent"/>
607 </xsl:apply-templates>
609 <xsl:call-template name="make_indent">
610 <xsl:with-param name="current_indent" select="$current_indent"/>
613 <xsl:apply-templates select="*[position()=last()]">
614 <xsl:with-param name="current_indent" select="$current_indent"/>
615 </xsl:apply-templates>
618 <xsl:when test="$name='let'">
620 <xsl:apply-templates select="m:ci"/>
621 <m:mtext>) </m:mtext>
622 <xsl:apply-templates select="*[3]">
623 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
624 </xsl:apply-templates>
627 <xsl:when test="$name='rw_step'">
629 <xsl:when test="name(*[2])='m:apply'">
630 <xsl:apply-templates select="*[2]">
631 <xsl:with-param name="current_indent" select="$current_indent"/>
632 </xsl:apply-templates>
635 <FONT color="red">Consider </FONT>
636 <xsl:apply-templates select="*[2]"/>
640 <xsl:call-template name="make_indent">
641 <xsl:with-param name="current_indent" select="$current_indent"/>
643 <FONT color="red">Rewrite </FONT>
644 <xsl:apply-templates select="*[3]"/>
645 <FONT color="red"> with </FONT>
646 <xsl:apply-templates select="*[4]"/>
647 <FONT color="red"> by </FONT>
648 <xsl:apply-templates select="*[5]"/>
650 <!-- rewrite and apply -->
651 <xsl:when test="$name='rewrite_and_apply'">
652 <xsl:apply-templates select="*[2]">
653 <xsl:with-param name="current_indent" select="$current_indent"/>
654 </xsl:apply-templates>
656 <xsl:call-template name="make_indent">
657 <xsl:with-param name="current_indent" select="$current_indent"/>
659 <FONT color="red">Then apply it to </FONT>
660 <xsl:apply-templates select="*[position()>2]"/>
663 <xsl:when test="$name='and_ind'">
665 <xsl:when test="name(*[2])='m:apply'">
666 <xsl:apply-templates select="*[2]">
667 <xsl:with-param name="current_indent" select="$current_indent"/>
668 </xsl:apply-templates>
671 <FONT color="red">Consider </FONT>
672 <xsl:apply-templates select="*[2]"/>
676 <xsl:call-template name="make_indent">
677 <xsl:with-param name="current_indent" select="$current_indent"/>
679 <FONT color="red">In particular, we have</FONT>
681 <xsl:call-template name="make_indent">
682 <xsl:with-param name="current_indent" select="$current_indent"/>
685 <xsl:apply-templates select="*[3]"/>
686 <m:mtext>) </m:mtext>
687 <xsl:apply-templates select="*[4]">
688 <xsl:with-param name="current_indent" select="$current_indent + 9"/>
689 </xsl:apply-templates>
691 <xsl:call-template name="make_indent">
692 <xsl:with-param name="current_indent" select="$current_indent"/>
695 <xsl:apply-templates select="*[5]"/>
696 <m:mtext>) </m:mtext>
697 <xsl:apply-templates select="*[6]">
698 <xsl:with-param name="current_indent" select="$current_indent + 9"/>
699 </xsl:apply-templates>
701 <xsl:call-template name="make_indent">
702 <xsl:with-param name="current_indent" select="$current_indent"/>
704 <xsl:apply-templates select="*[7]">
705 <xsl:with-param name="current_indent" select="$current_indent"/>
706 </xsl:apply-templates>
709 <xsl:when test="$name='or_ind'">
711 <xsl:when test="name(*[2])='m:apply'">
712 <xsl:apply-templates select="*[2]">
713 <xsl:with-param name="current_indent" select="$current_indent"/>
714 </xsl:apply-templates>
717 <FONT color="red">Consider </FONT>
718 <xsl:apply-templates select="*[2]"/>
722 <xsl:call-template name="make_indent">
723 <xsl:with-param name="current_indent" select="$current_indent"/>
725 <FONT color="red">We prove </FONT>
726 <xsl:apply-templates select="*[3]"/>
727 <FONT color="red"> by cases:</FONT>
729 <xsl:call-template name="make_indent">
730 <xsl:with-param name="current_indent" select="$current_indent"/>
733 <xsl:apply-templates select="*[4]">
734 <xsl:with-param name="current_indent" select="$current_indent"/>
735 </xsl:apply-templates>
737 <xsl:call-template name="make_indent">
738 <xsl:with-param name="current_indent" select="$current_indent"/>
741 <xsl:apply-templates select="*[5]">
742 <xsl:with-param name="current_indent" select="$current_indent"/>
743 </xsl:apply-templates>
746 <xsl:when test="$name='ex_ind'">
748 <xsl:when test="name(*[2])='m:apply'">
749 <xsl:apply-templates select="*[2]">
750 <xsl:with-param name="current_indent" select="$current_indent"/>
751 </xsl:apply-templates>
754 <FONT color="red">Consider </FONT>
755 <xsl:apply-templates select="*[2]">
756 <xsl:with-param name="current_indent" select="$current_indent"/>
757 </xsl:apply-templates>
761 <xsl:call-template name="make_indent">
762 <xsl:with-param name="current_indent" select="$current_indent"/>
764 <FONT color="red">Let </FONT>
765 <xsl:apply-templates mode="inline" select="*[3]"/>
767 <xsl:apply-templates mode="inline" select="*[4]"/>
768 <FONT color="red"> such that</FONT>
770 <xsl:call-template name="make_indent">
771 <xsl:with-param name="current_indent" select="$current_indent"/>
774 <xsl:apply-templates mode="inline" select="*[5]"/>
776 <xsl:apply-templates select="*[6]">
777 <xsl:with-param name="current_indent" select="$current_indent +7"/>
778 </xsl:apply-templates>
780 <xsl:call-template name="make_indent">
781 <xsl:with-param name="current_indent" select="$current_indent"/>
783 <xsl:apply-templates select="*[7]">
784 <xsl:with-param name="current_indent" select="$current_indent"/>
785 </xsl:apply-templates>
792 <xsl:template match="m:lambda">
793 <xsl:param name="current_indent" select="0"/>
794 <xsl:variable name="charlength">
795 <xsl:apply-templates select="*[position()=1]" mode="charcount"/>
796 <!-- <xsl:apply-templates select="." mode="charcount"/> -->
798 <!-- <xsl:value-of select="$charlength"/> -->
799 <!-- <xsl:value-of select="$current_indent"/> -->
801 <xsl:when test="$charlength > $framewidth">
803 <FONT SIZE="+2" color="red" FACE="symbol">l</FONT>
804 <xsl:apply-templates select="m:bvar/m:ci"/>
805 <xsl:text>:</xsl:text>
806 <xsl:apply-templates select="m:bvar/m:type">
807 <xsl:with-param name="current_indent"
808 select="$current_indent + 4 + 2*string-length(m:bvar/m:ci)"/>
809 </xsl:apply-templates><br/>
810 <xsl:call-template name="make_indent">
811 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
813 <xsl:text>.</xsl:text>
814 <xsl:apply-templates select="*[position()=2]">
815 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
816 </xsl:apply-templates>
819 <xsl:apply-templates mode="inline" select="."/>
825 <xsl:template match="m:ci">
827 <xsl:when test="boolean(@definitionURL)">
829 <xsl:attribute name="href">
830 <xsl:call-template name="makeURL">
831 <xsl:with-param name="url" select="@definitionURL"/>
834 <xsl:apply-templates/>
838 <xsl:value-of select="."/>
845 <xsl:template match="m:ci|m:csymbol" mode="charcount">
846 <xsl:param name="incurrent_length" select="0"/>
848 <xsl:when test="$framewidth >= ($incurrent_length + string-length())">
849 <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>
851 <xsl:when test="string($siblength) = """>
852 <xsl:value-of select="$incurrent_length + string-length()"/>
855 <xsl:value-of select="number($siblength)"/>
860 <xsl:value-of select="$incurrent_length + string-length()"/>
865 <xsl:template match="*" mode="charcount">
866 <xsl:param name="incurrent_length" select="0"/>
868 <xsl:when test="count(child::*) = 0">
869 <xsl:value-of select="$incurrent_length"/>
872 <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>
874 <xsl:when test="$framewidth >= number($childlength)">
875 <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>
877 <xsl:when test="string($siblength) = """>
878 <xsl:value-of select="number($childlength)"/>
881 <xsl:value-of select="number($siblength)"/>
886 <xsl:value-of select="number($childlength)"/>
894 <!--***********************************************************************-->
896 <!--***********************************************************************-->
900 <xsl:template match="Definition">
901 <xsl:param name="current_indent" select="0"/>
903 DEFINITION <xsl:value-of select="@name"/>(<xsl:if test="string(./Params) != """><xsl:value-of select="Params"/></xsl:if>)<br/>
905 <xsl:call-template name="make_indent">
906 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
908 <xsl:apply-templates select="type/*[1]">
909 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
910 </xsl:apply-templates><br/>
912 <xsl:call-template name="make_indent">
913 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
915 <xsl:apply-templates select="body/*[1]">
916 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
917 </xsl:apply-templates>
923 <xsl:template match="Axiom">
924 <xsl:param name="current_indent" select="0"/>
926 AXIOM <xsl:value-of select="@name"/>(<xsl:if test="string(./Params) != """><xsl:value-of select="Params"/></xsl:if>)<br/>
928 <xsl:call-template name="make_indent">
929 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
931 <xsl:apply-templates select="type/*[1]">
932 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
933 </xsl:apply-templates>
937 <!-- UNFINISHED PROOF -->
939 <xsl:template match="CurrentProof">
940 <xsl:param name="current_indent" select="0"/>
942 UNFINISHED PROOF <xsl:value-of select="@name"/>(<xsl:if test="string(./Params) != """><xsl:value-of select="Params"/></xsl:if>)<br/>
943 THESIS: <xsl:apply-templates select="type/*[1]">
944 <xsl:with-param name="current_indent" select="$current_indent + 8"/>
945 </xsl:apply-templates><br/>
947 <xsl:for-each select="Conjecture">
949 <xsl:call-template name="make_indent">
950 <xsl:with-param name="current_indent" select="$current_indent + 8"/>
952 <xsl:value-of select="./@no"/> :
953 <xsl:apply-templates select="./*[1]">
954 <xsl:with-param name="current_indent" select="$current_indent + 11"/>
955 </xsl:apply-templates>
959 <xsl:apply-templates select="body/*[1]">
960 <xsl:with-param name="current_indent" select="$current_indent + 8"/>
961 </xsl:apply-templates>
965 <!-- MUTUAL INDUCTIVE DEFINITION -->
967 <xsl:template match="InductiveDefinition">
968 <xsl:param name="current_indent" select="0"/>
970 <xsl:for-each select="InductiveType">
972 <xsl:when test="position() = 1">
974 <xsl:when test="string(./@inductive) = "true"">
978 COINDUCTIVE DEFINITION
986 <xsl:value-of select="./@name"/>(<xsl:if test="string(../Params) != """><xsl:value-of select="../Params"/></xsl:if>)
988 <xsl:if test="string(../Param) != """>
989 <xsl:for-each select="../Param">
990 <xsl:value-of select="./@name"/>
992 <xsl:apply-templates select="*"/>
997 <xsl:apply-templates select="./arity/*[1]">
998 <xsl:with-param name="current_indent" select="$current_indent + 9"/>
999 </xsl:apply-templates> <br/>
1001 <xsl:for-each select="./Constructor">
1003 <xsl:call-template name="make_indent">
1004 <xsl:with-param name="current_indent" select="$current_indent + 3"/>
1005 </xsl:call-template>
1007 <xsl:when test="position() = 1">
1008 <xsl:text>  </xsl:text>
1011 <xsl:text>| </xsl:text>
1014 <xsl:value-of select="./@name"/>
1015 <xsl:text>: </xsl:text>
1016 <xsl:apply-templates select="./*[1]">
1017 <xsl:with-param name="current_indent" select="$current_indent + 2*string-length(./@name) + 5"/>
1018 </xsl:apply-templates>
1026 <xsl:template match="Variable">
1027 <xsl:param name="current_indent" select="0"/>
1029 VARIABLE <xsl:value-of select="@name"/><br/>
1030 TYPE = <xsl:apply-templates select="type/*[1]">
1031 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
1032 </xsl:apply-templates>
1036 <!--***********************************************************************-->
1038 <!--***********************************************************************-->
1042 <xsl:template match="SECTION">
1043 <xsl:param name="current_indent" select="0"/>
1044 <h1>BEGIN OF SECTION</h1>
1045 <xsl:apply-templates/>
1046 <h1>END OF SECTION</h1>