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 <!--***********************************************************************-->
28 <!-- Extension to the XSLT version 0.07 of MathML content to presentation: -->
29 <!-- First draft: February 19 2000, Andrea Asperti, Irene Schena -->
30 <!-- Revised: March 3 2000, Irene Schena -->
31 <!-- Revised: March 15 2000, Claudio Sacerdoti Coen, Irene Schena -->
32 <!-- Revised: March 21 2000, Irene Schena -->
33 <!--***********************************************************************-->
35 <!-- NOTE: the namespace declaration has to be done in the stylesheets
36 which generates the toplevel element (see for instance xlink) -->
37 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
38 xmlns:m="http://www.w3.org/1998/Math/MathML"
39 xmlns:helm="http://www.cs.unibo.it/helm"
40 xmlns:xlink="http://www.w3.org/1999/xlink">
42 <!-- OLD: <xsl:import href="mml2mmlv1_0.xsl"/> -->
43 <xsl:import href="mmlctop.xsl-0.14"/>
45 <xsl:import href="mmltheoryextension.xsl"/>
47 <xsl:param name="explodeall" select="false()"/>
49 <!--***********************************************************************-->
50 <!-- Parameter affecting line-breaking -->
51 <!--***********************************************************************-->
53 <xsl:variable name="framewidth" select="35"/>
55 <!--***********************************************************************-->
56 <!-- Gli oggetti sono stampati come mtext all'interno di una marca toplevel-->
57 <!-- math ma al di fuori di semantics. Ora vi sono tanti semantics quanti -->
58 <!-- sono i termini: la presentation per un termine e' generata come primo -->
59 <!-- figlio di un semantics e l'originario content viene inserito nel -->
60 <!-- nel secondo figlio di semantics, annotation-xml -->
61 <!--***********************************************************************-->
63 <!--**********************-->
65 <!--**********************-->
67 <xsl:param name="type" select="'standalone'"/>
69 <xsl:template match="/">
71 <xsl:when test="$type = 'standalone'">
72 <xsl:apply-templates select="*"/>
76 <xsl:apply-templates select="*"/>
84 <xsl:template match="Definition">
86 <m:mtable align="baseline 1" equalrows="false" columnalign="left" helm:xref="{@helm:xref}">
90 <m:mtext>DEFINITION <xsl:value-of select="@name"/>(<xsl:if test="string(./Params) != """><xsl:value-of select="Params"/></xsl:if>) OF TYPE</m:mtext>
97 <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
98 <xsl:apply-templates select="type/*[1]"/>
105 <m:mtext>AS</m:mtext>
112 <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
113 <xsl:apply-templates select="body/*[1]"/>
123 <xsl:template match="Axiom">
125 <m:mtable align="baseline 1" equalrows="false" columnalign="left" helm:xref="{@helm:xref}">
129 <m:mtext>AXIOM <xsl:value-of select="@name"/>(<xsl:if test="string(./Params) != """><xsl:value-of select="Params"/></xsl:if>) OF TYPE</m:mtext>
136 <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
137 <xsl:apply-templates select="type/*[1]"/>
145 <!-- UNFINISHED PROOF -->
147 <xsl:template match="CurrentProof">
149 <m:mtable align="baseline 1" equalrows="false" columnalign="left" helm:xref="{@helm:xref}">
153 <m:mtext>UNFINISHED PROOF <xsl:value-of select="@name"/>(<xsl:if test="string(./Params) != """><xsl:value-of select="Params"/></xsl:if>)</m:mtext>
160 <m:mtext>THESIS:</m:mtext>
167 <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
168 <xsl:apply-templates select="type/*[1]"/>
175 <m:mtext>CONJECTURES:</m:mtext>
179 <xsl:for-each select="Conjecture">
183 <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
184 <m:mtext><xsl:value-of select="./@no"/>:</m:mtext>
185 <xsl:apply-templates select="./*[1]"/>
193 <m:mtext>CORRESPONDING PROOF:</m:mtext>
200 <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
201 <xsl:apply-templates select="body/*[1]"/>
209 <!-- MUTUAL INDUCTIVE DEFINITION -->
211 <xsl:template match="InductiveDefinition">
213 <m:mtable align="baseline 1" equalrows="false" columnalign="left" helm:xref="{@helm:xref}">
214 <xsl:for-each select="InductiveType">
219 <xsl:when test="position() = 1">
221 <xsl:when test="string(./@inductive) = "true"">
222 <m:mtext>INDUCTIVE DEFINITION</m:mtext>
225 <m:mtext>COINDUCTIVE DEFINITION</m:mtext>
230 <m:mtext>AND</m:mtext>
233 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
234 <m:mtext><xsl:value-of select="./@name"/>(<xsl:if test="string(../Params) != """><xsl:value-of select="../Params"/></xsl:if>)</m:mtext>
241 <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
244 <xsl:when test="string(../Param) != """>
245 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
246 <xsl:for-each select="../Param">
250 <m:mi><xsl:value-of select="./@name"/></m:mi>
252 <xsl:apply-templates select="*"/>
276 <m:mtext>OF ARITY</m:mtext>
283 <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
284 <xsl:apply-templates select="./arity/*[1]"/>
291 <m:mtext>BUILT FROM</m:mtext>
295 <xsl:for-each select="./Constructor">
300 <xsl:when test="position() = 1">
301 <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
305 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
308 <m:mtext><xsl:value-of select="./@name"/> OF</m:mtext>
309 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
310 <xsl:apply-templates select="./*[1]"/>
322 <xsl:template match="Variable">
324 <m:mtable align="baseline 1" equalrows="false" columnalign="left" helm:xref="{@helm:xref}">
328 <m:mtext>VARIABLE <xsl:value-of select="@name"/> OF TYPE</m:mtext>
335 <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
336 <xsl:apply-templates select="type/*[1]"/>
340 <xsl:if test="name(*[1])='body'">
344 <m:mtext>AS</m:mtext>
351 <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
352 <xsl:apply-templates select="body/*[1]"/>
361 <!--**********************-->
363 <!--**********************-->
365 <xsl:template match="m:bvar">
367 <xsl:when test="m:type">
368 <xsl:variable name="charlength">
369 <xsl:apply-templates select="m:ci" mode="charcount"/>
372 <xsl:when test="$charlength >= $framewidth">
373 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
377 <xsl:apply-templates select="m:ci"/>
385 <xsl:apply-templates select="m:type"/>
393 <xsl:apply-templates select="m:ci"/>
395 <xsl:apply-templates select="m:type"/>
401 <xsl:apply-templates select="m:ci"/>
409 <xsl:template match="m:apply[m:csymbol]">
410 <xsl:param name="nopar" select="0"/>
411 <xsl:variable name="name"><xsl:value-of select="m:csymbol"/></xsl:variable>
412 <xsl:variable name="charlength"><xsl:apply-templates select="m:csymbol" mode="charcount"/></xsl:variable>
415 <xsl:attribute name="m:xref"><xsl:value-of select="@id"/></xsl:attribute>
419 <xsl:when test="$name='forall'">
421 <xsl:when test="$charlength >= $framewidth">
422 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
426 <m:mo mathcolor="Blue">∀</m:mo>
427 <xsl:apply-templates select="m:bvar"/>
435 <xsl:apply-templates select="*[position()=3]"/>
442 <m:mo mathcolor="Blue">∀</m:mo>
443 <xsl:apply-templates select="m:bvar/m:ci"/>
445 <xsl:apply-templates select="m:bvar/m:type"/>
447 <xsl:apply-templates select="*[position()=3]"/>
452 <xsl:when test="$name='let_in'">
454 <xsl:when test="$charlength >= $framewidth">
455 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
460 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
461 <xsl:apply-templates select="m:bvar"/>
469 <xsl:apply-templates select="*[position()=3]"/>
477 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
478 <xsl:apply-templates select="*[position()=4]"/>
486 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
487 <xsl:apply-templates select="m:bvar/m:ci"/>
489 <xsl:apply-templates select="*[position()=3]"/>
490 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
491 <m:mtext>IN</m:mtext>
492 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
493 <xsl:apply-templates select="*[position()=4]"/>
498 <xsl:when test="$name='prod'">
500 <xsl:when test="$charlength >= $framewidth">
501 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
505 <m:mo mathcolor="Blue">Π</m:mo>
506 <xsl:apply-templates select="m:bvar"/>
514 <xsl:apply-templates select="*[position()=3]"/>
521 <m:mo mathcolor="Blue">Π</m:mo>
522 <xsl:apply-templates select="m:bvar/m:ci"/>
524 <xsl:apply-templates select="m:bvar/m:type"/>
526 <xsl:apply-templates select="*[position()=3]"/>
531 <xsl:when test="$name='arrow'">
533 <xsl:when test="$charlength >= $framewidth">
534 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
538 <xsl:if test="$nopar=0">
539 <m:mo stretchy="false">(</m:mo>
541 <xsl:apply-templates select="*[position()=2]"/>
548 <m:mo mathmathcolor="Blue">→</m:mo>
550 <xsl:when test="*[position()=3]/m:csymbol">
551 <xsl:variable name="nextp"><xsl:value-of select="*[position()=3]/m:csymbol"/></xsl:variable>
553 <xsl:when test="$nextp='arrow'">
554 <xsl:apply-templates select="*[position()=3]"><xsl:with-param name="nopar" select="1"/></xsl:apply-templates>
557 <xsl:apply-templates select="*[position()=3]"/>
562 <xsl:apply-templates select="*[position()=3]"/>
568 <xsl:if test="$nopar=0">
572 <m:mo stretchy="false">)</m:mo>
580 <xsl:if test="$nopar=0">
581 <m:mo stretchy="false">(</m:mo>
583 <xsl:apply-templates select="*[position()=2]"/>
584 <m:mo mathcolor="Blue">→</m:mo>
586 <xsl:when test="*[position()=3]/m:csymbol">
587 <xsl:variable name="nextp"><xsl:value-of select="*[position()=3]/m:csymbol"/></xsl:variable>
589 <xsl:when test="$nextp='arrow'">
590 <xsl:apply-templates select="*[position()=3]"><xsl:with-param name="nopar" select="1"/></xsl:apply-templates>
593 <xsl:apply-templates select="*[position()=3]"/>
598 <xsl:apply-templates select="*[position()=3]"/>
601 <xsl:if test="$nopar=0">
602 <m:mo stretchy="false">)</m:mo>
608 <xsl:when test="$name='app'">
610 <xsl:when test="$charlength >= $framewidth">
611 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
615 <m:mo stretchy="false">(</m:mo>
616 <xsl:apply-templates select="*[position()=2]"/>
620 <xsl:for-each select="*[position()>2]">
624 <m:mphantom><m:mtext>(</m:mtext></m:mphantom>
625 <xsl:apply-templates select="."/>
633 <m:mo stretchy="false">)</m:mo>
640 <m:mo stretchy="false">(</m:mo>
641 <xsl:apply-templates select="*[position()=2]"/>
642 <xsl:for-each select="*[position()>2]">
643 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
644 <xsl:apply-templates select="."/>
646 <m:mo stretchy="false">)</m:mo>
651 <xsl:when test="$name='cast'">
653 <xsl:when test="$charlength >= $framewidth">
654 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
658 <m:mo stretchy="false">(</m:mo>
659 <xsl:apply-templates select="*[position()=2]"/>
666 <m:mo mathcolor="Maroon">:></m:mo>
667 <xsl:apply-templates select="*[position()=3]"/>
674 <m:mo stretchy="false">)</m:mo>
681 <m:mo stretchy="false">(</m:mo>
682 <xsl:apply-templates select="*[position()=2]"/>
683 <m:mo mathcolor="Maroon">:></m:mo>
684 <xsl:apply-templates select="*[position()=3]"/>
685 <m:mo stretchy="false">)</m:mo>
690 <xsl:when test="$name='Prop'">
694 <xsl:when test="$name='Set'">
698 <xsl:when test="$name='Type'">
702 <xsl:when test="$name='mutcase'">
704 <xsl:when test="$charlength >= $framewidth">
705 <xsl:variable name="charlength"><xsl:apply-templates select="*[position()=2]" mode="charcount"><xsl:with-param name="nosibling" select="1"/></xsl:apply-templates></xsl:variable>
706 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
711 <xsl:apply-templates select="*[position()=2]"/>
712 <xsl:if test="$framewidth > $charlength">
715 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
716 <xsl:apply-templates select="*[position()=3]"/>
721 <xsl:if test="$charlength >= $framewidth">
727 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
728 <xsl:apply-templates select="*[position()=3]"/>
740 <xsl:for-each select="piecewise/piece">
741 <xsl:variable name="charlength"><xsl:apply-templates select="./*[2]" mode="charcount"><xsl:with-param name="nosibling" select="1"/></xsl:apply-templates></xsl:variable>
746 <xsl:when test="position() = 1">
747 <m:mphantom><m:mtext>|</m:mtext></m:mphantom>
750 <m:mo stretchy="false">|</m:mo>
753 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
754 <xsl:apply-templates select="./*[2]"/>
755 <xsl:if test="$framewidth > $charlength">
756 <m:mo mathcolor="Green">⇒</m:mo>
757 <xsl:apply-templates select="./*[1]"/>
762 <xsl:if test="$charlength >= $framewidth">
766 <m:mphantom><m:mtext>|_</m:mtext></m:mphantom>
767 <m:mo mathcolor="Green">⇒</m:mo>
768 <xsl:apply-templates select="./*[1]"/>
784 <m:mo><</m:mo><xsl:apply-templates select="*[position()=2]"/><m:mo>></m:mo>
786 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
787 <xsl:apply-templates select="*[position()=3]"/>
788 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
790 <xsl:for-each select="piecewise/piece">
792 <xsl:when test="position() != 1">
793 <m:mo stretchy="false">|</m:mo>
796 <xsl:apply-templates select="./*[2]"/>
797 <m:mo mathcolor="Green">⇒</m:mo>
798 <xsl:apply-templates select="./*[1]"/>
800 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
806 <xsl:when test="$name='fix'">
808 <xsl:when test="$charlength >= $framewidth">
809 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
814 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
815 <m:mi><xsl:value-of select="m:ci"/></m:mi>
816 <m:mo stretchy="false">{</m:mo>
823 <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
824 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
825 <xsl:for-each select="m:bvar">
826 <xsl:variable name="charlength"><xsl:apply-templates select="m:type" mode="charcount"><xsl:with-param name="nosibling" select="1"/></xsl:apply-templates></xsl:variable>
830 <m:mi><xsl:value-of select="m:ci"/></m:mi>
832 <xsl:if test="$framewidth > $charlength">
833 <xsl:apply-templates select="m:type"/>
838 <xsl:if test="$charlength >= $framewidth">
842 <m:mphantom><m:mtext>:=</m:mtext></m:mphantom>
843 <xsl:apply-templates select="m:type"/>
852 <xsl:apply-templates select="following-sibling::*[position()=1]"/>
864 <m:mo stretchy="false">}</m:mo>
872 <m:mi><xsl:value-of select="m:ci"/></m:mi>
873 <m:mo stretchy="false">{</m:mo>
874 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
875 <xsl:for-each select="m:bvar">
879 <m:mi><xsl:value-of select="m:ci"/></m:mi>
881 <xsl:apply-templates select="m:type"/>
883 <xsl:apply-templates select="following-sibling::*[position() = 1]"/>
884 <xsl:if test="position()=last()">
885 <m:mo stretchy="false">}</m:mo>
896 <xsl:when test="$name='cofix'">
898 <xsl:when test="$charlength >= $framewidth">
899 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
904 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
905 <m:mi><xsl:value-of select="m:ci"/></m:mi>
906 <m:mo stretchy="false">{</m:mo>
913 <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
914 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
915 <xsl:for-each select="m:bvar">
916 <xsl:variable name="charlength"><xsl:apply-templates select="m:type" mode="charcount"><xsl:with-param name="nosibling" select="1"/></xsl:apply-templates></xsl:variable>
920 <m:mi><xsl:value-of select="m:ci"/></m:mi>
922 <xsl:if test="$framewidth > $charlength">
923 <xsl:apply-templates select="m:type"/>
928 <xsl:if test="$charlength >= $framewidth">
932 <m:mphantom><m:mtext>:=</m:mtext></m:mphantom>
933 <xsl:apply-templates select="m:type"/>
942 <xsl:apply-templates select="following-sibling::*[position() = 1]"/>
954 <m:mo stretchy="false">}</m:mo>
962 <m:mi><xsl:value-of select="m:ci"/></m:mi>
963 <m:mo stretchy="false">{</m:mo>
964 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
965 <xsl:for-each select="m:bvar">
969 <m:mi><xsl:value-of select="m:ci"/></m:mi>
971 <xsl:apply-templates select="m:type"/>
973 <xsl:apply-templates select="following-sibling::*[position() = 1]"/>
974 <xsl:if test="position()=last()">
975 <m:mo stretchy="false">}</m:mo>
985 <!-- ***************************************** -->
986 <!-- *********** PROOF ELEMENTS ************** -->
987 <!-- ***************************************** -->
989 <xsl:when test="$name='proof'">
990 <m:maction actiontype="toggle">
991 <!-- CSC: $explodeall until the annotationHelper can handle mactions -->
992 <xsl:variable name="test" select="(not($explodeall)) and
993 (not(preceding-sibling::*[1]/text()='letin1')) and
994 (not(preceding-sibling::*[1]/text()='rw_step')) and
995 (not(name(..)='m:lambda'))"/>
996 <xsl:if test="$test">
997 <!-- Details hided (default) -->
998 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1002 <m:mtext mathcolor="Maroon">We can prove</m:mtext>
1003 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1004 <xsl:apply-templates select="*[position()=3]"/>
1006 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1007 <m:mtext mathcolor="Green">(explain)</m:mtext>
1014 <!-- Show details -->
1015 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1019 <xsl:apply-templates select="*[position()=2]"/>
1026 <m:mtext mathcolor="Maroon">we proved</m:mtext>
1027 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1028 <xsl:apply-templates select="*[position()=3]"/>
1031 <m:mtext>_</m:mtext>
1033 <xsl:if test="$test">
1034 <m:mtext mathcolor="Green">(hide details)</m:mtext>
1044 <xsl:when test="$name='letin1'">
1045 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1049 <xsl:apply-templates select="*[2]"/>
1056 <xsl:apply-templates select="*[3]"/>
1062 <xsl:when test="$name='by_induction'">
1063 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1067 <m:mtext mathcolor="red">We prove</m:mtext>
1068 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1069 <xsl:apply-templates select="../*[3]"/>
1076 <m:mtext mathcolor="red">by induction on</m:mtext>
1077 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1078 <xsl:apply-templates
1079 select="*[position()=last()]/*[position()=last()]"/>
1086 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1087 <xsl:for-each select="*[position()>3 and not(position()=last())]">
1091 <xsl:apply-templates select="."/>
1102 <!-- inductive_case -->
1103 <xsl:when test="$name='inductive_case'">
1104 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1108 <m:mtext mathcolor="red">Case</m:mtext>
1109 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1110 <xsl:apply-templates select="*[2]"/>
1117 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1118 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1119 <xsl:if test="*[3]/*[position()>1]">
1123 <m:mtext mathcolor="red">By induction hypothesis, we have:</m:mtext>
1130 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1131 <xsl:for-each select="*[3]/*[position()>1]">
1132 <m:mo stretchy="false">(</m:mo>
1133 <xsl:apply-templates select="m:ci"/>
1134 <m:mo stretchy="false">) </m:mo>
1135 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1136 <xsl:apply-templates select="m:type"/>
1145 <xsl:apply-templates select="*[4]"/>
1156 <xsl:when test="$name='case_lhs'">
1159 <xsl:when test="count(*)=2">
1160 <xsl:apply-templates select="*[2]"/>
1163 <m:mo stretchy="false">(</m:mo>
1164 <xsl:apply-templates select="*[2]"/>
1165 <xsl:for-each select="m:bvar">
1166 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1167 <xsl:apply-templates select="*[1]"/>
1168 <m:mtext>:</m:mtext>
1169 <xsl:apply-templates select="m:type/*[1]"/>
1171 <m:mo stretchy="false">)</m:mo>
1177 <xsl:when test="$name='false_ind'">
1178 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1182 <xsl:apply-templates select="*[3]"/>
1189 <m:mtext mathcolor="Red">Contradiction.</m:mtext>
1196 <xsl:when test="$name='letin'">
1197 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1198 <!-- <xsl:for-each select="APPLY[m:csymbol and (string(m:csymbol)='let')]"> -->
1199 <xsl:for-each select="*[(last() > position()) and (position()>1)]">
1203 <xsl:apply-templates select="."/>
1211 <xsl:apply-templates select="*[position()=last()]"/>
1218 <xsl:when test="$name='let'">
1219 <m:mtext>(</m:mtext>
1220 <xsl:apply-templates select="m:ci"/>
1221 <m:mtext>) </m:mtext>
1222 <xsl:apply-templates select="*[3]"/>
1225 <xsl:when test="$name='rw_step'">
1226 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1231 <xsl:when test="name(*[2])='m:apply'">
1232 <xsl:apply-templates select="*[2]"/>
1235 <m:mtext>Consider</m:mtext>
1236 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1237 <xsl:apply-templates select="*[2]"/>
1246 <m:mtext>Rewrite</m:mtext>
1247 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1248 <xsl:apply-templates select="*[3]"/>
1249 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1250 <m:mtext>with</m:mtext>
1251 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1252 <xsl:apply-templates select="*[4]"/>
1253 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1254 <m:mtext>by</m:mtext>
1255 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1256 <xsl:apply-templates select="*[5]"/>
1262 <!-- not existing any more
1263 <xsl:when test="$name='thread'">
1264 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1269 <xsl:when test="name(*[last()])='m:apply'">
1270 <xsl:apply-templates select="*[last()]"/>
1273 <m:mtext>Consider</m:mtext>
1274 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1275 <xsl:apply-templates select="*[last()]"/>
1281 <xsl:apply-templates mode="thread" select="*[(last()-2)]"/>
1285 <!-- REWRITE_AND_APPLY -->
1286 <xsl:when test="$name='rewrite_and_apply'">
1287 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1291 <xsl:apply-templates select="*[2]"/>
1298 <m:mtext>Then apply it to</m:mtext>
1299 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1300 <xsl:apply-templates select="*[position()>2]"/>
1307 <xsl:when test="$name='and_ind'">
1308 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1313 <xsl:when test="name(*[2])='m:apply'">
1314 <xsl:apply-templates select="*[2]"/>
1317 <m:mtext>Consider</m:mtext>
1318 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1319 <xsl:apply-templates select="*[2]"/>
1328 <m:mtext>In particular, we have</m:mtext>
1335 <m:mtext>(</m:mtext>
1336 <xsl:apply-templates select="*[3]"/>
1337 <m:mtext>)</m:mtext>
1338 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1339 <xsl:apply-templates select="*[4]"/>
1346 <m:mtext>(</m:mtext>
1347 <xsl:apply-templates select="*[5]"/>
1348 <m:mtext>)</m:mtext>
1349 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1350 <xsl:apply-templates select="*[6]"/>
1357 <xsl:apply-templates select="*[7]"/>
1363 <!-- full_or_ind -->
1364 <xsl:when test="$name='full_or_ind'">
1365 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1370 <xsl:when test="name(*[2])='m:apply'">
1371 <xsl:apply-templates select="*[2]"/>
1374 <m:mtext>Consider</m:mtext>
1375 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1376 <xsl:apply-templates select="*[2]"/>
1385 <m:mtext>We proceed by cases to prove</m:mtext>
1386 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1387 <xsl:apply-templates select="*[3]"/>
1394 <m:mtext>Left: suppose</m:mtext>
1395 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1396 <m:mo stretchy="false">(</m:mo>
1397 <xsl:apply-templates select="*[4]/m:bvar/m:ci"/>
1398 <m:mo stretchy="false">)</m:mo>
1399 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1400 <xsl:apply-templates select="*[4]/m:bvar/m:type/*[1]"/>
1407 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1408 <xsl:apply-templates select="*[4]/*[3]"/>
1415 <m:mtext>Right: suppose</m:mtext>
1416 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1417 <m:mo stretchy="false">(</m:mo>
1418 <xsl:apply-templates select="*[5]/m:bvar/m:ci"/>
1419 <m:mo stretchy="false">)</m:mo>
1420 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1421 <xsl:apply-templates select="*[5]/m:bvar/m:type/*[1]"/>
1428 <xsl:apply-templates select="*[5]/*[3]"/>
1435 <xsl:when test="$name='or_ind'">
1436 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1441 <xsl:when test="name(*[2])='m:apply'">
1442 <xsl:apply-templates select="*[2]"/>
1445 <m:mtext>Consider</m:mtext>
1446 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1447 <xsl:apply-templates select="*[2]"/>
1456 <m:mtext>We prove</m:mtext>
1457 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1458 <xsl:apply-templates select="*[3]"/>
1459 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1460 <m:mtext>by cases:</m:mtext>
1467 <m:mtext>Left</m:mtext>
1468 <xsl:apply-templates select="*[4]"/>
1475 <m:mtext>Right</m:mtext>
1476 <xsl:apply-templates select="*[5]"/>
1483 <xsl:when test="$name='ex_ind'">
1484 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1489 <xsl:when test="name(*[2])='m:apply'">
1490 <xsl:apply-templates select="*[2]"/>
1493 <m:mtext>Consider</m:mtext>
1494 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1495 <xsl:apply-templates select="*[2]"/>
1504 <m:mtext>Let</m:mtext>
1505 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1506 <xsl:apply-templates select="*[3]"/>
1507 <m:mtext>:</m:mtext>
1508 <xsl:apply-templates select="*[4]"/>
1509 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1510 <m:mtext>such that</m:mtext>
1511 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1512 <m:mtext>(</m:mtext>
1513 <xsl:apply-templates select="*[5]"/>
1514 <m:mtext>)</m:mtext>
1515 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1516 <xsl:apply-templates select="*[6]"/>
1523 <xsl:apply-templates select="*[7]"/>
1529 <!-- ***************************************** -->
1530 <!-- *********** NOTATIONS ******************* -->
1531 <!-- ***************************************** -->
1533 <xsl:when test="$name='subst'">
1534 <xsl:apply-templates select="*[3]"/>
1535 <!-- no font for ApplyFunction: <m:mo></m:mo> -->
1536 <m:mo stretchy="false">[</m:mo>
1537 <xsl:apply-templates select="*[4]"/>
1538 <m:mo mathcolor="green">
1539 <xsl:if test="$id != ''">
1540 <xsl:attribute name="m:xref"><xsl:value-of select="$id"/></xsl:attribute>
1541 </xsl:if>←</m:mo>
1542 <xsl:apply-templates select="*[2]"/>
1543 <m:mo stretchy="false">]</m:mo>
1546 <xsl:when test="$name='lift'">
1548 <m:mo mathcolor="green">
1549 <xsl:if test="$id != ''">
1550 <xsl:attribute name="m:xref"><xsl:value-of select="$id"/></xsl:attribute>
1551 </xsl:if>↑</m:mo>
1552 <xsl:apply-templates select="*[2]"/>
1555 <m:mo stretchy="false">(</m:mo>
1556 <xsl:apply-templates select="*[3]"/>
1557 <m:mo stretchy="false">)</m:mo>
1560 <!-- lift_with_base -->
1561 <xsl:when test="$name='lift_with_base'">
1563 <m:mo mathcolor="green">
1564 <xsl:if test="$id != ''">
1565 <xsl:attribute name="m:xref"><xsl:value-of select="$id"/></xsl:attribute>
1566 </xsl:if>↑</m:mo>
1567 <xsl:apply-templates select="*[3]"/>
1568 <xsl:apply-templates select="*[4]"/>
1571 <m:mo stretchy="false">(</m:mo>
1572 <xsl:apply-templates select="*[2]"/>
1573 <m:mo stretchy="false">)</m:mo>
1577 <xsl:when test="$name='beta_red1'">
1578 <xsl:apply-templates select="*[2]"/>
1580 <m:mo mathcolor="green">
1581 <xsl:if test="$id != ''">
1582 <xsl:attribute name="m:xref"><xsl:value-of select="$id"/></xsl:attribute>
1583 </xsl:if>→</m:mo>
1584 <m:mi mathcolor="green">β</m:mi>
1586 <xsl:apply-templates select="*[3]"/>
1589 <xsl:when test="$name='beta_red'">
1590 <xsl:apply-templates select="*[2]"/>
1592 <m:mo mathcolor="green">
1593 <xsl:if test="$id != ''">
1594 <xsl:attribute name="m:xref"><xsl:value-of select="$id"/></xsl:attribute>
1595 </xsl:if>→</m:mo>
1596 <m:mi mathcolor="green">β</m:mi>
1597 <m:mi mathcolor="green">*</m:mi>
1599 <xsl:apply-templates select="*[3]"/>
1601 <!-- par_beta_red1 -->
1602 <xsl:when test="$name='par_beta_red1'">
1603 <xsl:apply-templates select="*[2]"/>
1605 <m:mo mathcolor="green">
1606 <xsl:if test="$id != ''">
1607 <xsl:attribute name="m:xref"><xsl:value-of select="$id"/></xsl:attribute>
1608 </xsl:if>⇒</m:mo>
1609 <m:mi mathcolor="green">β</m:mi>
1611 <xsl:apply-templates select="*[3]"/>
1613 <!-- par_beta_red -->
1614 <xsl:when test="$name='par_beta_red'">
1615 <xsl:apply-templates select="*[2]"/>
1617 <m:mo mathcolor="green">
1618 <xsl:if test="$id != ''">
1619 <xsl:attribute name="m:xref"><xsl:value-of select="$id"/></xsl:attribute>
1620 </xsl:if>⇒</m:mo>
1621 <m:mi mathcolor="green">β</m:mi>
1622 <m:mi mathcolor="green">*</m:mi>
1624 <xsl:apply-templates select="*[3]"/>
1627 <xsl:when test="$name='forgetful'">
1628 <m:mfenced open="|" close="|">
1629 <xsl:if test="$id != ''">
1630 <xsl:attribute name="m:xref"><xsl:value-of select="$id"/></xsl:attribute>
1632 <xsl:apply-templates select="*[2]"/>
1636 <xsl:when test="$name='isomorphic'">
1637 <xsl:apply-templates select="*[2]"/>
1638 <m:mo mathcolor="green">
1639 <xsl:if test="$id != ''">
1640 <xsl:attribute name="m:xref"><xsl:value-of select="$id"/></xsl:attribute>
1641 </xsl:if>≅</m:mo>
1642 <xsl:apply-templates select="*[3]"/>
1645 <xsl:when test="$name='forgetful'">
1646 <m:mfenced open="[" close="]">
1647 <xsl:if test="$id != ''">
1648 <xsl:attribute name="m:xref"><xsl:value-of select="$id"/></xsl:attribute>
1650 <xsl:apply-templates select="*[2]"/>
1662 <!-- Il modo Thread non esiste piu'
1663 <xsl:template match="*" mode="thread">
1664 <xsl:variable name="name"><xsl:value-of select="following-sibling::*[position()=1]/m:csymbol"/></xsl:variable>
1666 <xsl:when test="$name='rw_step'">
1670 <m:mtext>Rewrite</m:mtext>
1671 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1672 <xsl:apply-templates select="following-sibling::*[position()=1]/*[2]"/>
1673 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1674 <m:mtext>with</m:mtext>
1675 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1676 <xsl:apply-templates select="following-sibling::*[position()=1]/*[3]"/>
1677 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1678 <m:mtext>by</m:mtext>
1679 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1680 <xsl:apply-templates select="following-sibling::*[position()=1]/*[4]"/>
1687 <m:mtext mathcolor="Maroon">we get</m:mtext>
1688 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1689 <xsl:apply-templates select="."/>
1698 <xsl:apply-templates select="following-sibling::*[position()=1]"/>
1705 <m:mtext mathcolor="Maroon">we get</m:mtext>
1706 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1707 <xsl:apply-templates select="."/>
1713 <xsl:apply-templates mode="thread" select="preceding-sibling::*[position()=2]"/>
1719 <xsl:template match="m:lambda">
1720 <xsl:variable name="charlength"><xsl:apply-templates select="*[position()=1]" mode="charcount"/></xsl:variable>
1723 <xsl:attribute name="m:xref">
1724 <xsl:value-of select="@id"/>
1728 <xsl:when test="$charlength >= $framewidth">
1729 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1733 <m:mo mathcolor="Red">λ</m:mo>
1734 <xsl:apply-templates select="m:bvar"/>
1742 <xsl:apply-templates select="*[position()=2]"/>
1749 <m:mo mathcolor="Red">λ</m:mo>
1750 <xsl:apply-templates select="m:bvar/m:ci"/>
1752 <xsl:apply-templates select="m:bvar/m:type"/>
1754 <xsl:apply-templates select="*[position()=2]"/>
1760 <!-- *********************************** -->
1761 <!-- BASE SET OF MATHML CONTENT ELEMENTS -->
1762 <!-- *********************************** -->
1766 <xsl:template match = "m:apply[m:eq[1]]">
1767 <xsl:variable name="charlength">
1768 <xsl:apply-templates select="*[1]" mode="charcount"/>
1771 <xsl:when test="$charlength >= $framewidth">
1772 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1774 <xsl:attribute name="m:xref">
1775 <xsl:value-of select="@id"/>
1781 <m:mo stretchy="false">(</m:mo>
1782 <xsl:apply-templates select="*[position()=2]"/>
1786 <xsl:for-each select = "*[position()>2]">
1790 <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
1792 <xsl:if test="m:in/@id">
1793 <xsl:attribute name="m:xref">
1794 <xsl:value-of select="m:in/@id"/>
1797 <xsl:apply-templates select="."/>
1805 <m:mo stretchy="false">)</m:mo>
1812 <xsl:apply-imports/>
1818 <xsl:template match = "m:apply[m:and[1]|m:or[1]
1819 |m:geq[1]|m:leq[1]|m:gt[1]|m:lt[1]
1820 |m:in[1]|m:intesect[1]|m:union[1]|m:subset[1]
1821 |m:prsubset|m:setdiff[1]]">
1822 <xsl:variable name="symbol">
1824 <xsl:when test="m:and[1]">
1825 <xsl:value-of select="'∧'"/>
1827 <xsl:when test="m:or[1]">
1828 <xsl:value-of select="'∨'"/>
1830 <xsl:when test="m:geq[1]">
1831 <xsl:value-of select="'≥'"/>
1833 <xsl:when test="m:leq[1]">
1834 <xsl:value-of select="'≤'"/>
1836 <xsl:when test="m:gt[1]">
1837 <xsl:value-of select="'>'"/>
1839 <xsl:when test="m:lt[1]">
1840 <xsl:value-of select="'< '"/>
1842 <xsl:when test="m:eq[1]">
1843 <xsl:value-of select="'='"/>
1845 <xsl:when test="m:in[1]">
1846 <xsl:value-of select="'∈'"/>
1848 <xsl:when test="m:subset[1]">
1849 <xsl:value-of select="'⊆'"/>
1851 <xsl:when test="m:prsubset[1]">
1852 <xsl:value-of select="'⊂'"/>
1854 <xsl:when test="m:intersect[1]">
1855 <xsl:value-of select="'⋂'"/>
1857 <xsl:when test="m:union[1]">
1858 <xsl:value-of select="'⋃'"/>
1860 <xsl:when test="m:setdiff[1]">
1861 <xsl:value-of select="'∖'"/>
1865 <xsl:variable name="charlength">
1866 <xsl:apply-templates select="*[1]" mode="charcount"/>
1869 <xsl:when test="$charlength >= $framewidth">
1870 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1872 <xsl:attribute name="m:xref">
1873 <xsl:value-of select="@id"/>
1879 <m:mo stretchy="false">(</m:mo>
1880 <xsl:apply-templates select="*[position()=2]"/>
1884 <xsl:for-each select = "*[position()>2]">
1888 <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
1890 <xsl:if test="*[1]/@id">
1891 <xsl:attribute name="m:xref">
1892 <xsl:value-of select="*[1]/@id"/>
1894 </xsl:if><xsl:value-of select="$symbol"/></m:mo>
1895 <xsl:apply-templates select="."/>
1903 <m:mo stretchy="false">)</m:mo>
1910 <xsl:apply-imports/>
1915 <xsl:template match = "m:set">
1917 <xsl:when test="count(child::*) = 0">
1920 <xsl:attribute name="m:xref">
1921 <xsl:value-of select="@id"/>
1923 </xsl:if>∅</m:mi>
1926 <xsl:variable name="charlength">
1927 <xsl:apply-templates select="*[1]" mode="charcount"/>
1930 <xsl:when test="$charlength >= $framewidth">
1932 <xsl:when test="name(*[1]) = 'm:bvar'">
1933 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1937 <m:mo stretchy="false">
1939 <xsl:attribute name="m:xref">
1940 <xsl:value-of select="@id"/>
1943 <xsl:apply-templates select="*[position()=1]"/>
1950 <m:mphantom><m:mtext>{</m:mtext></m:mphantom>
1951 <m:mo stretchy="false">|</m:mo>
1952 <xsl:apply-templates select="m:condition/*[1]"/>
1959 <m:mo stretchy="false">
1961 <xsl:attribute name="m:xref">
1962 <xsl:value-of select="@id"/>
1971 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1975 <m:mo stretchy="false">
1977 <xsl:attribute name="m:xref">
1978 <xsl:value-of select="@id"/>
1981 <xsl:apply-templates select="*[position()=1]"/>
1982 <xsl:if test="position() != last()">
1988 <xsl:for-each select = "*[position()>2]">
1992 <m:mphantom><m:mtext>{</m:mtext></m:mphantom>
1993 <xsl:apply-templates select="."/>
1994 <xsl:if test="position() != last()">
2004 <m:mo stretchy="false">
2006 <xsl:attribute name="m:xref">
2007 <xsl:value-of select="@id"/>
2018 <xsl:apply-imports/>
2025 <xsl:template match = "m:apply[m:card[1]]">
2026 <m:mfenced open="|" close="|" stretchy="false">
2027 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
2028 <xsl:attribute name="m:xref">
2029 <xsl:value-of select="@id"/>
2032 <xsl:apply-templates select="*[2]"/>
2037 <!--**********************-->
2039 <!--**********************-->
2041 <xsl:template match="m:cn|m:and|m:or|m:not|m:exists|m:eq|m:lt|m:leq|m:gt|m:geq
2042 |m:in|m:notin|m:intersect|m:union|m:subset|m:prsubset|m:card|m:setdiff
2043 |m:plus|m:minus|m:times" mode="charcount">
2044 <xsl:param name="incurrent_length" select="0"/>
2046 <xsl:when test="$framewidth > ($incurrent_length + 3 + string-length())">
2047 <xsl:variable name="siblength">
2048 <xsl:apply-templates select="following-sibling::*[position()=1]" mode="charcount">
2049 <xsl:with-param name="incurrent_length" select="$incurrent_length + string-length()"/>
2050 </xsl:apply-templates>
2053 <xsl:when test="string($siblength) = """>
2054 <xsl:value-of select="$incurrent_length + 3 + string-length()"/>
2057 <xsl:value-of select="number($siblength)"/>
2062 <xsl:value-of select="$incurrent_length + 3 + string-length()"/>
2067 <xsl:template match="m:ci|m:csymbol" mode="charcount">
2068 <xsl:param name="incurrent_length" select="0"/>
2069 <xsl:param name="nosibling" select="0"/>
2071 <xsl:when test="$framewidth > ($incurrent_length + string-length()) and ($nosibling = 0)">
2072 <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>
2074 <xsl:when test="string($siblength) = """>
2075 <xsl:value-of select="$incurrent_length + string-length()"/>
2078 <xsl:value-of select="number($siblength)"/>
2083 <xsl:value-of select="$incurrent_length + string-length()"/>
2088 <xsl:template match="*" mode="charcount">
2089 <xsl:param name="incurrent_length" select="0"/>
2090 <xsl:param name="nosibling" select="0"/>
2092 <xsl:when test="count(child::*) = 0">
2093 <xsl:value-of select="$incurrent_length"/>
2096 <xsl:variable name="childlength"><xsl:apply-templates select="*[position()=1]" mode="charcount"><xsl:with-param name="incurrent_length" select="$incurrent_length"/><xsl:with-param name="nosibling" select="0"/></xsl:apply-templates></xsl:variable>
2098 <xsl:when test="$framewidth > number($childlength) and ($nosibling = 0)">
2099 <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>
2101 <xsl:when test="string($siblength) = """>
2102 <xsl:value-of select="number($childlength)"/>
2105 <xsl:value-of select="number($siblength)"/>
2110 <xsl:value-of select="number($childlength)"/>