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>
259 <xsl:when test="$name='proof'">
260 <xsl:apply-templates mode="inline" select="*[position()=2]"/>
261 <FONT color="red">we proved</FONT>
262 <xsl:apply-templates mode="inline" select="*[position()=3]"/>
267 <xsl:template mode="inline" match="m:lambda">
268 <FONT SIZE="+2" color="red" FACE="symbol">l</FONT>
269 <xsl:apply-templates select="m:bvar/m:ci"/>
270 <xsl:text>:</xsl:text>
271 <xsl:apply-templates mode="inline" select="m:bvar/m:type"/>
272 <xsl:text>.</xsl:text>
273 <xsl:apply-templates mode="inline" select="*[position()=2]"/>
276 <!--*********************************************************************-->
277 <!-- COUNTING MODE -->
278 <!--*********************************************************************-->
280 <xsl:template match="m:apply[m:csymbol]">
281 <xsl:param name="current_indent" select="0"/>
282 <xsl:param name="width" select="$framewidth"/>
283 <xsl:variable name="name">
284 <xsl:value-of select="m:csymbol"/>
286 <xsl:variable name="charlength">
287 <xsl:apply-templates select="m:csymbol" mode="charcount"/>
289 <!-- <xsl:value-of select="$current_indent"/> -->
290 <!-- <xsl:value-of select="$charlength"/> -->
293 <xsl:when test="$name='forall'">
295 <xsl:when test="$charlength > $framewidth">
297 <FONT FACE="Symbol" SIZE="+2" color="blue">"</FONT>
298 <xsl:apply-templates select="m:bvar/m:ci"/>
299 <xsl:text>:</xsl:text>
300 <xsl:apply-templates select="m:bvar/m:type">
301 <xsl:with-param name="current_indent"
302 select="$current_indent + 2 + string-length(m:bvar/m:ci)"/>
303 </xsl:apply-templates>
305 <xsl:call-template name="make_indent">
306 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
308 <xsl:text>.</xsl:text>
309 <xsl:apply-templates select="*[position()=3]">
310 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
311 </xsl:apply-templates>
314 <xsl:apply-templates mode="inline" select="."/>
319 <xsl:when test="$name='prod'">
321 <xsl:when test="$charlength > $framewidth">
322 <FONT FACE="Symbol" SIZE="+2" color="blue">Õ</FONT>
323 <xsl:apply-templates select="m:bvar/m:ci"/>
324 <xsl:text>:</xsl:text>
325 <xsl:apply-templates select="m:bvar/m:type">
326 <xsl:with-param name="current_indent"
327 select="$current_indent + 2 + string-length(m:bvar/m:ci)"/>
328 </xsl:apply-templates><br/>
329 <xsl:call-template name="make_indent">
330 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
332 <xsl:text>.</xsl:text>
333 <xsl:apply-templates select="*[position()=3]">
334 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
335 </xsl:apply-templates>
338 <xsl:apply-templates mode="inline" select="."/>
343 <xsl:when test="$name='arrow'">
345 <xsl:when test="$charlength > $framewidth">
346 <xsl:text>(</xsl:text>
347 <xsl:apply-templates select="*[position()=2]">
348 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
349 </xsl:apply-templates>
351 <xsl:call-template name="make_indent">
352 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
355 <FONT color="blue" FACE="symbol">
356 <xsl:text>®</xsl:text>
358 <xsl:apply-templates select="*[position()=3]">
359 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
360 </xsl:apply-templates>
361 <xsl:text>)</xsl:text>
364 <xsl:apply-templates mode="inline" select="."/>
369 <xsl:when test="$name='app'">
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>
376 <xsl:for-each select="*[position()>2]">
378 <xsl:call-template name="make_indent">
379 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
381 <xsl:apply-templates select=".">
382 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
383 </xsl:apply-templates>
385 <xsl:text>)</xsl:text>
388 <xsl:apply-templates mode="inline" select="."/>
392 <xsl:when test="$name='cast'">
394 <xsl:when test="$showcast = 1">
396 <xsl:when test="$charlength > $framewidth">
397 <xsl:text>(</xsl:text>
398 <xsl:apply-templates select="*[position()=2]">
399 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
400 </xsl:apply-templates><br/>
401 <xsl:call-template name="make_indent">
402 <xsl:with-param name="current_indent" select="$current_indent + 2"/> </xsl:call-template>
403 <xsl:text>:></xsl:text>
404 <xsl:apply-templates select="*[position()=3]">
405 <xsl:with-param name="current_indent" select="$current_indent + 3"/>
406 </xsl:apply-templates>
407 <xsl:text>)</xsl:text>
410 <xsl:apply-templates mode="inline" select="."/>
415 <xsl:apply-templates select="*[position()=2]">
416 <xsl:with-param name="current_indent" select="$current_indent"/>
417 </xsl:apply-templates>
421 <xsl:when test="$name='Prop'">
422 <xsl:text>Prop</xsl:text>
424 <xsl:when test="$name='Set'">
425 <xsl:text>Set</xsl:text>
427 <xsl:when test="$name='Type'">
428 <xsl:text>Type</xsl:text>
430 <xsl:when test="$name='mutcase'">
432 <xsl:when test="$charlength > $framewidth">
433 <xsl:text><</xsl:text>
434 <xsl:apply-templates select="*[position()=2]">
435 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
436 </xsl:apply-templates>
437 <xsl:text>> </xsl:text>
438 <xsl:text>CASE </xsl:text>
439 <xsl:apply-templates select="*[position()=3]">
440 <xsl:with-param name="current_indent" select="$current_indent + 8"/>
441 </xsl:apply-templates>
442 <xsl:text> OF </xsl:text>
443 <xsl:for-each select="*[position() mod 2 = 0 and position()>3]">
445 <xsl:call-template name="make_indent">
446 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
449 <xsl:when test="position() = 1">
450 <xsl:text>  </xsl:text>
453 <xsl:text>| </xsl:text>
456 <xsl:apply-templates select="."/>
457 <FONT FACE="Symbol" SIZE="+2" mathcolor="green">Þ</FONT>
458 <xsl:apply-templates select="following-sibling::*[position()= 1]">
459 <xsl:with-param name="current_indent" select="$current_indent + 4 + string-length()"/>
460 </xsl:apply-templates>
464 <xsl:apply-templates mode="inline" select="."/>
469 <xsl:when test="$name='fix'">
471 <xsl:when test="$charlength > $framewidth">
472 <xsl:text>FIX</xsl:text>
473 <xsl:value-of select="m:ci"/>
474 <xsl:text>{</xsl:text>
475 <xsl:for-each select="m:bvar">
477 <xsl:call-template name="make_indent">
478 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
480 <xsl:value-of select="m:ci"/>
481 <xsl:text>:</xsl:text>
482 <xsl:apply-templates select="m:type">
483 <xsl:with-param name="current_indent"
484 select="$current_indent + 5 + string-length(m:ci)"/>
485 </xsl:apply-templates>
487 <xsl:call-template name="make_indent">
488 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
490 <xsl:text>:=</xsl:text>
491 <xsl:apply-templates select="following-sibling::*[position() = 1]">
492 <xsl:with-param name="current_indent" select="$current_indent +2"/>
493 </xsl:apply-templates>
496 <xsl:call-template name="make_indent">
497 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
499 <xsl:text>}</xsl:text>
502 <xsl:apply-templates mode="inline" select="."/>
507 <xsl:when test="$name='cofix'">
509 <xsl:when test="($charlength + 10) > $framewidth">
510 <xsl:text>COFIX</xsl:text>
511 <xsl:value-of select="m:ci"/>
512 <xsl:text>{</xsl:text>
514 <xsl:call-template name="make_indent">
515 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
517 <xsl:for-each select="m:bvar">
518 <xsl:value-of select="m:ci"/>
519 <xsl:text>:</xsl:text>
520 <xsl:apply-templates select="m:type">
521 <xsl:with-param name="current_indent"
522 select="$current_indent + 5 + string-length(m:ci)"/>
523 </xsl:apply-templates>
525 <xsl:call-template name="make_indent">
526 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
528 <xsl:text>:=</xsl:text>
529 <xsl:apply-templates select="following-sibling::*[position() = 1]">
530 <xsl:with-param name="current_indent" select="$current_indent + 3"/>
531 </xsl:apply-templates>
535 <xsl:call-template name="make_indent">
536 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
538 <xsl:text>}</xsl:text>
541 <xsl:apply-templates mode="inline" select="m:type"/>
545 <!-- ***************************************** -->
546 <!-- *********** PROOF ELEMENTS ************** -->
547 <!-- ***************************************** -->
549 <xsl:when test="$name='proof'">
550 <xsl:apply-templates select="*[position()=2]">
551 <xsl:with-param name="current_indent" select="$current_indent"/>
552 </xsl:apply-templates>
554 <!-- <xsl:element name="br"/> -->
555 <xsl:call-template name="make_indent">
556 <xsl:with-param name="current_indent" select="$current_indent"/>
558 <FONT color="red">we proved </FONT>
559 <xsl:apply-templates select="*[position()=3]">
560 <xsl:with-param name="current_indent" select="$current_indent + 16"/>
561 </xsl:apply-templates>
564 <xsl:when test="$name='letin1'">
565 <xsl:apply-templates select="*[position()=2]">
566 <xsl:with-param name="current_indent" select="$current_indent"/>
567 </xsl:apply-templates>
569 <xsl:call-template name="make_indent">
570 <xsl:with-param name="current_indent" select="$current_indent"/>
572 <xsl:apply-templates select="*[position()=3]">
573 <xsl:with-param name="current_indent" select="$current_indent"/>
574 </xsl:apply-templates>
577 <xsl:when test="$name='letin'">
578 <xsl:for-each select="*[position()>1 and last()>position()]">
579 <xsl:apply-templates select=".">
580 <xsl:with-param name="current_indent" select="$current_indent"/>
581 </xsl:apply-templates>
583 <xsl:call-template name="make_indent">
584 <xsl:with-param name="current_indent" select="$current_indent"/>
587 <xsl:apply-templates select="*[position()=last()]">
588 <xsl:with-param name="current_indent" select="$current_indent"/>
589 </xsl:apply-templates>
592 <xsl:when test="$name='let'">
594 <xsl:apply-templates select="m:ci"/>
595 <m:mtext>) </m:mtext>
596 <xsl:apply-templates select="*[3]">
597 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
598 </xsl:apply-templates>
601 <xsl:when test="$name='rw_step'">
603 <xsl:when test="name(*[2])='m:apply'">
604 <xsl:apply-templates select="*[2]">
605 <xsl:with-param name="current_indent" select="$current_indent"/>
606 </xsl:apply-templates>
609 <FONT color="red">Consider </FONT>
610 <xsl:apply-templates select="*[2]"/>
614 <xsl:call-template name="make_indent">
615 <xsl:with-param name="current_indent" select="$current_indent"/>
617 <FONT color="red">Rewrite </FONT>
618 <xsl:apply-templates select="*[3]"/>
619 <FONT color="red"> with </FONT>
620 <xsl:apply-templates select="*[4]"/>
621 <FONT color="red"> by </FONT>
622 <xsl:apply-templates select="*[5]"/>
624 <!-- rewrite and apply -->
625 <xsl:when test="$name='rewrite_and_apply'">
626 <xsl:apply-templates select="*[2]">
627 <xsl:with-param name="current_indent" select="$current_indent"/>
628 </xsl:apply-templates>
630 <xsl:call-template name="make_indent">
631 <xsl:with-param name="current_indent" select="$current_indent"/>
633 <FONT color="red">Then apply it to </FONT>
634 <xsl:apply-templates select="*[position()>2]"/>
637 <xsl:when test="$name='and_ind'">
639 <xsl:when test="name(*[2])='m:apply'">
640 <xsl:apply-templates select="*[2]">
641 <xsl:with-param name="current_indent" select="$current_indent"/>
642 </xsl:apply-templates>
645 <FONT color="red">Consider </FONT>
646 <xsl:apply-templates select="*[2]"/>
650 <xsl:call-template name="make_indent">
651 <xsl:with-param name="current_indent" select="$current_indent"/>
653 <FONT color="red">In particular, we have</FONT>
655 <xsl:call-template name="make_indent">
656 <xsl:with-param name="current_indent" select="$current_indent"/>
659 <xsl:apply-templates select="*[3]"/>
660 <m:mtext>) </m:mtext>
661 <xsl:apply-templates select="*[4]">
662 <xsl:with-param name="current_indent" select="$current_indent + 9"/>
663 </xsl:apply-templates>
665 <xsl:call-template name="make_indent">
666 <xsl:with-param name="current_indent" select="$current_indent"/>
669 <xsl:apply-templates select="*[5]"/>
670 <m:mtext>) </m:mtext>
671 <xsl:apply-templates select="*[6]">
672 <xsl:with-param name="current_indent" select="$current_indent + 9"/>
673 </xsl:apply-templates>
675 <xsl:call-template name="make_indent">
676 <xsl:with-param name="current_indent" select="$current_indent"/>
678 <xsl:apply-templates select="*[7]">
679 <xsl:with-param name="current_indent" select="$current_indent"/>
680 </xsl:apply-templates>
683 <xsl:when test="$name='or_ind'">
685 <xsl:when test="name(*[2])='m:apply'">
686 <xsl:apply-templates select="*[2]">
687 <xsl:with-param name="current_indent" select="$current_indent"/>
688 </xsl:apply-templates>
691 <FONT color="red">Consider </FONT>
692 <xsl:apply-templates select="*[2]"/>
696 <xsl:call-template name="make_indent">
697 <xsl:with-param name="current_indent" select="$current_indent"/>
699 <FONT color="red">We prove </FONT>
700 <xsl:apply-templates select="*[3]"/>
701 <FONT color="red"> by cases:</FONT>
703 <xsl:call-template name="make_indent">
704 <xsl:with-param name="current_indent" select="$current_indent"/>
707 <xsl:apply-templates select="*[4]">
708 <xsl:with-param name="current_indent" select="$current_indent"/>
709 </xsl:apply-templates>
711 <xsl:call-template name="make_indent">
712 <xsl:with-param name="current_indent" select="$current_indent"/>
715 <xsl:apply-templates select="*[5]">
716 <xsl:with-param name="current_indent" select="$current_indent"/>
717 </xsl:apply-templates>
720 <xsl:when test="$name='ex_ind'">
722 <xsl:when test="name(*[2])='m:apply'">
723 <xsl:apply-templates select="*[2]">
724 <xsl:with-param name="current_indent" select="$current_indent"/>
725 </xsl:apply-templates>
728 <FONT color="red">Consider </FONT>
729 <xsl:apply-templates select="*[2]">
730 <xsl:with-param name="current_indent" select="$current_indent"/>
731 </xsl:apply-templates>
735 <xsl:call-template name="make_indent">
736 <xsl:with-param name="current_indent" select="$current_indent"/>
738 <FONT color="red">Let </FONT>
739 <xsl:apply-templates mode="inline" select="*[3]"/>
741 <xsl:apply-templates mode="inline" select="*[4]"/>
742 <FONT color="red"> such that</FONT>
744 <xsl:call-template name="make_indent">
745 <xsl:with-param name="current_indent" select="$current_indent"/>
748 <xsl:apply-templates mode="inline" select="*[5]"/>
750 <xsl:apply-templates select="*[6]">
751 <xsl:with-param name="current_indent" select="$current_indent +7"/>
752 </xsl:apply-templates>
754 <xsl:call-template name="make_indent">
755 <xsl:with-param name="current_indent" select="$current_indent"/>
757 <xsl:apply-templates select="*[7]">
758 <xsl:with-param name="current_indent" select="$current_indent"/>
759 </xsl:apply-templates>
766 <xsl:template match="m:lambda">
767 <xsl:param name="current_indent" select="0"/>
768 <xsl:variable name="charlength">
769 <xsl:apply-templates select="*[position()=1]" mode="charcount"/>
770 <!-- <xsl:apply-templates select="." mode="charcount"/> -->
772 <!-- <xsl:value-of select="$charlength"/> -->
773 <!-- <xsl:value-of select="$current_indent"/> -->
775 <xsl:when test="$charlength > $framewidth">
777 <FONT SIZE="+2" color="red" FACE="symbol">l</FONT>
778 <xsl:apply-templates select="m:bvar/m:ci"/>
779 <xsl:text>:</xsl:text>
780 <xsl:apply-templates select="m:bvar/m:type">
781 <xsl:with-param name="current_indent"
782 select="$current_indent + 2 + string-length(m:bvar/m:ci)"/>
783 </xsl:apply-templates><br/>
784 <xsl:call-template name="make_indent">
785 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
787 <xsl:text>.</xsl:text>
788 <xsl:apply-templates select="*[position()=2]">
789 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
790 </xsl:apply-templates>
793 <xsl:apply-templates mode="inline" select="."/>
799 <xsl:template match="m:ci">
801 <xsl:when test="boolean(@definitionURL)">
803 <xsl:attribute name="href">
804 <xsl:value-of select="concat(string($header),string(@definitionURL))"/>
806 <xsl:apply-templates/>
810 <xsl:value-of select="."/>
817 <xsl:template match="m:ci|m:csymbol" mode="charcount">
818 <xsl:param name="incurrent_length" select="0"/>
820 <xsl:when test="$framewidth >= ($incurrent_length + string-length())">
821 <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>
823 <xsl:when test="string($siblength) = """>
824 <xsl:value-of select="$incurrent_length + string-length()"/>
827 <xsl:value-of select="number($siblength)"/>
832 <xsl:value-of select="$incurrent_length + string-length()"/>
837 <xsl:template match="*" mode="charcount">
838 <xsl:param name="incurrent_length" select="0"/>
840 <xsl:when test="count(child::*) = 0">
841 <xsl:value-of select="$incurrent_length"/>
844 <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>
846 <xsl:when test="$framewidth >= number($childlength)">
847 <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>
849 <xsl:when test="string($siblength) = """>
850 <xsl:value-of select="number($childlength)"/>
853 <xsl:value-of select="number($siblength)"/>
858 <xsl:value-of select="number($childlength)"/>
866 <!--***********************************************************************-->
868 <!--***********************************************************************-->
872 <xsl:template match="Definition">
873 <xsl:param name="current_indent" select="0"/>
875 DEFINITION <xsl:value-of select="@name"/>(<xsl:if test="string(./Params) != """><xsl:value-of select="Params"/></xsl:if>)<br/>
877 <xsl:call-template name="make_indent">
878 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
880 <xsl:apply-templates select="type/*[1]">
881 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
882 </xsl:apply-templates><br/>
884 <xsl:call-template name="make_indent">
885 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
887 <xsl:apply-templates select="body/*[1]">
888 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
889 </xsl:apply-templates>
895 <xsl:template match="Axiom">
896 <xsl:param name="current_indent" select="0"/>
898 AXIOM <xsl:value-of select="@name"/>(<xsl:if test="string(./Params) != """><xsl:value-of select="Params"/></xsl:if>)<br/>
900 <xsl:call-template name="make_indent">
901 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
903 <xsl:apply-templates select="type/*[1]">
904 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
905 </xsl:apply-templates>
909 <!-- UNFINISHED PROOF -->
911 <xsl:template match="CurrentProof">
912 <xsl:param name="current_indent" select="0"/>
914 UNFINISHED PROOF <xsl:value-of select="@name"/>(<xsl:if test="string(./Params) != """><xsl:value-of select="Params"/></xsl:if>)<br/>
915 THESIS: <xsl:apply-templates select="type/*[1]">
916 <xsl:with-param name="current_indent" select="$current_indent + 8"/>
917 </xsl:apply-templates><br/>
919 <xsl:for-each select="Conjecture">
921 <xsl:call-template name="make_indent">
922 <xsl:with-param name="current_indent" select="$current_indent + 8"/>
924 <xsl:value-of select="./@no"/> :
925 <xsl:apply-templates select="./*[1]">
926 <xsl:with-param name="current_indent" select="$current_indent + 11"/>
927 </xsl:apply-templates>
931 <xsl:apply-templates select="body/*[1]">
932 <xsl:with-param name="current_indent" select="$current_indent + 8"/>
933 </xsl:apply-templates>
937 <!-- MUTUAL INDUCTIVE DEFINITION -->
939 <xsl:template match="InductiveDefinition">
940 <xsl:param name="current_indent" select="0"/>
942 <xsl:for-each select="InductiveType">
944 <xsl:when test="position() = 1">
946 <xsl:when test="string(./@inductive) = "true"">
950 COINDUCTIVE DEFINITION
958 <xsl:value-of select="./@name"/>(<xsl:if test="string(../Params) != """><xsl:value-of select="../Params"/></xsl:if>)
960 <xsl:if test="string(../Param) != """>
961 <xsl:for-each select="../Param">
962 <xsl:value-of select="./@name"/>
964 <xsl:apply-templates select="*"/>
969 <xsl:apply-templates select="./arity/*[1]">
970 <xsl:with-param name="current_indent" select="$current_indent + 9"/>
971 </xsl:apply-templates> <br/>
973 <xsl:for-each select="./Constructor">
975 <xsl:call-template name="make_indent">
976 <xsl:with-param name="current_indent" select="$current_indent + 3"/>
979 <xsl:when test="position() = 1">
980 <xsl:text>  </xsl:text>
983 <xsl:text>| </xsl:text>
986 <xsl:value-of select="./@name"/>
987 <xsl:text>: </xsl:text>
988 <xsl:apply-templates select="./*[1]">
989 <xsl:with-param name="current_indent" select="$current_indent + string-length(./@name) + 4"/>
990 </xsl:apply-templates>
998 <xsl:template match="Variable">
999 <xsl:param name="current_indent" select="0"/>
1001 VARIABLE <xsl:value-of select="@name"/><br/>
1002 TYPE = <xsl:apply-templates select="type/*[1]">
1003 <xsl:with-param name="current_indent" select="$current_indent + 7"/>
1004 </xsl:apply-templates>
1008 <!--***********************************************************************-->
1010 <!--***********************************************************************-->
1014 <xsl:template match="SECTION">
1015 <xsl:param name="current_indent" select="0"/>
1016 <h1>BEGIN OF SECTION</h1>
1017 <xsl:apply-templates/>
1018 <h1>END OF SECTION</h1>