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>
417 <xsl:variable name="id" select="m:csymbol/@id"/>
420 <xsl:when test="$name='forall'">
422 <xsl:when test="$charlength >= $framewidth">
423 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
427 <m:mo mathcolor="Blue">∀</m:mo>
428 <xsl:apply-templates select="m:bvar"/>
436 <xsl:apply-templates select="*[position()=3]"/>
443 <m:mo mathcolor="Blue">∀</m:mo>
444 <xsl:apply-templates select="m:bvar/m:ci"/>
446 <xsl:apply-templates select="m:bvar/m:type"/>
448 <xsl:apply-templates select="*[position()=3]"/>
453 <xsl:when test="$name='let_in'">
455 <xsl:when test="$charlength >= $framewidth">
456 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
461 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
462 <xsl:apply-templates select="m:bvar"/>
470 <xsl:apply-templates select="*[position()=3]"/>
478 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
479 <xsl:apply-templates select="*[position()=4]"/>
487 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
488 <xsl:apply-templates select="m:bvar/m:ci"/>
490 <xsl:apply-templates select="*[position()=3]"/>
491 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
492 <m:mtext>IN</m:mtext>
493 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
494 <xsl:apply-templates select="*[position()=4]"/>
499 <xsl:when test="$name='prod'">
501 <xsl:when test="$charlength >= $framewidth">
502 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
506 <m:mo mathcolor="Blue">Π</m:mo>
507 <xsl:apply-templates select="m:bvar"/>
515 <xsl:apply-templates select="*[position()=3]"/>
522 <m:mo mathcolor="Blue">Π</m:mo>
523 <xsl:apply-templates select="m:bvar/m:ci"/>
525 <xsl:apply-templates select="m:bvar/m:type"/>
527 <xsl:apply-templates select="*[position()=3]"/>
532 <xsl:when test="$name='arrow'">
534 <xsl:when test="$charlength >= $framewidth">
535 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
539 <xsl:if test="$nopar=0">
540 <m:mo stretchy="false">(</m:mo>
542 <xsl:apply-templates select="*[position()=2]"/>
549 <m:mo mathmathcolor="Blue">→</m:mo>
551 <xsl:when test="*[position()=3]/m:csymbol">
552 <xsl:variable name="nextp"><xsl:value-of select="*[position()=3]/m:csymbol"/></xsl:variable>
554 <xsl:when test="$nextp='arrow'">
555 <xsl:apply-templates select="*[position()=3]"><xsl:with-param name="nopar" select="1"/></xsl:apply-templates>
558 <xsl:apply-templates select="*[position()=3]"/>
563 <xsl:apply-templates select="*[position()=3]"/>
569 <xsl:if test="$nopar=0">
573 <m:mo stretchy="false">)</m:mo>
581 <xsl:if test="$nopar=0">
582 <m:mo stretchy="false">(</m:mo>
584 <xsl:apply-templates select="*[position()=2]"/>
585 <m:mo mathcolor="Blue">→</m:mo>
587 <xsl:when test="*[position()=3]/m:csymbol">
588 <xsl:variable name="nextp"><xsl:value-of select="*[position()=3]/m:csymbol"/></xsl:variable>
590 <xsl:when test="$nextp='arrow'">
591 <xsl:apply-templates select="*[position()=3]"><xsl:with-param name="nopar" select="1"/></xsl:apply-templates>
594 <xsl:apply-templates select="*[position()=3]"/>
599 <xsl:apply-templates select="*[position()=3]"/>
602 <xsl:if test="$nopar=0">
603 <m:mo stretchy="false">)</m:mo>
609 <xsl:when test="$name='app'">
611 <xsl:when test="$charlength >= $framewidth">
612 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
616 <m:mo stretchy="false">(</m:mo>
617 <xsl:apply-templates select="*[position()=2]"/>
621 <xsl:for-each select="*[position()>2]">
625 <m:mphantom><m:mtext>(</m:mtext></m:mphantom>
626 <xsl:apply-templates select="."/>
634 <m:mo stretchy="false">)</m:mo>
641 <m:mo stretchy="false">(</m:mo>
642 <xsl:apply-templates select="*[position()=2]"/>
643 <xsl:for-each select="*[position()>2]">
644 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
645 <xsl:apply-templates select="."/>
647 <m:mo stretchy="false">)</m:mo>
652 <xsl:when test="$name='cast'">
654 <xsl:when test="$charlength >= $framewidth">
655 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
659 <m:mo stretchy="false">(</m:mo>
660 <xsl:apply-templates select="*[position()=2]"/>
667 <m:mo mathcolor="Maroon">:></m:mo>
668 <xsl:apply-templates select="*[position()=3]"/>
675 <m:mo stretchy="false">)</m:mo>
682 <m:mo stretchy="false">(</m:mo>
683 <xsl:apply-templates select="*[position()=2]"/>
684 <m:mo mathcolor="Maroon">:></m:mo>
685 <xsl:apply-templates select="*[position()=3]"/>
686 <m:mo stretchy="false">)</m:mo>
691 <xsl:when test="$name='Prop'">
695 <xsl:when test="$name='Set'">
699 <xsl:when test="$name='Type'">
703 <xsl:when test="$name='mutcase'">
705 <xsl:when test="$charlength >= $framewidth">
706 <xsl:variable name="charlength"><xsl:apply-templates select="*[position()=2]" mode="charcount"><xsl:with-param name="nosibling" select="1"/></xsl:apply-templates></xsl:variable>
707 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
712 <xsl:apply-templates select="*[position()=2]"/>
713 <xsl:if test="$framewidth > $charlength">
716 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
717 <xsl:apply-templates select="*[position()=3]"/>
722 <xsl:if test="$charlength >= $framewidth">
728 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
729 <xsl:apply-templates select="*[position()=3]"/>
741 <xsl:for-each select="piecewise/piece">
742 <xsl:variable name="charlength"><xsl:apply-templates select="./*[2]" mode="charcount"><xsl:with-param name="nosibling" select="1"/></xsl:apply-templates></xsl:variable>
747 <xsl:when test="position() = 1">
748 <m:mphantom><m:mtext>|</m:mtext></m:mphantom>
751 <m:mo stretchy="false">|</m:mo>
754 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
755 <xsl:apply-templates select="./*[2]"/>
756 <xsl:if test="$framewidth > $charlength">
757 <m:mo mathcolor="Green">⇒</m:mo>
758 <xsl:apply-templates select="./*[1]"/>
763 <xsl:if test="$charlength >= $framewidth">
767 <m:mphantom><m:mtext>|_</m:mtext></m:mphantom>
768 <m:mo mathcolor="Green">⇒</m:mo>
769 <xsl:apply-templates select="./*[1]"/>
785 <m:mo><</m:mo><xsl:apply-templates select="*[position()=2]"/><m:mo>></m:mo>
787 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
788 <xsl:apply-templates select="*[position()=3]"/>
789 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
791 <xsl:for-each select="piecewise/piece">
793 <xsl:when test="position() != 1">
794 <m:mo stretchy="false">|</m:mo>
797 <xsl:apply-templates select="./*[2]"/>
798 <m:mo mathcolor="Green">⇒</m:mo>
799 <xsl:apply-templates select="./*[1]"/>
801 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
807 <xsl:when test="$name='fix'">
809 <xsl:when test="$charlength >= $framewidth">
810 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
815 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
816 <m:mi><xsl:value-of select="m:ci"/></m:mi>
817 <m:mo stretchy="false">{</m:mo>
824 <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
825 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
826 <xsl:for-each select="m:bvar">
827 <xsl:variable name="charlength"><xsl:apply-templates select="m:type" mode="charcount"><xsl:with-param name="nosibling" select="1"/></xsl:apply-templates></xsl:variable>
831 <m:mi><xsl:value-of select="m:ci"/></m:mi>
833 <xsl:if test="$framewidth > $charlength">
834 <xsl:apply-templates select="m:type"/>
839 <xsl:if test="$charlength >= $framewidth">
843 <m:mphantom><m:mtext>:=</m:mtext></m:mphantom>
844 <xsl:apply-templates select="m:type"/>
853 <xsl:apply-templates select="following-sibling::*[position()=1]"/>
865 <m:mo stretchy="false">}</m:mo>
873 <m:mi><xsl:value-of select="m:ci"/></m:mi>
874 <m:mo stretchy="false">{</m:mo>
875 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
876 <xsl:for-each select="m:bvar">
880 <m:mi><xsl:value-of select="m:ci"/></m:mi>
882 <xsl:apply-templates select="m:type"/>
884 <xsl:apply-templates select="following-sibling::*[position() = 1]"/>
885 <xsl:if test="position()=last()">
886 <m:mo stretchy="false">}</m:mo>
897 <xsl:when test="$name='cofix'">
899 <xsl:when test="$charlength >= $framewidth">
900 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
905 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
906 <m:mi><xsl:value-of select="m:ci"/></m:mi>
907 <m:mo stretchy="false">{</m:mo>
914 <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
915 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
916 <xsl:for-each select="m:bvar">
917 <xsl:variable name="charlength"><xsl:apply-templates select="m:type" mode="charcount"><xsl:with-param name="nosibling" select="1"/></xsl:apply-templates></xsl:variable>
921 <m:mi><xsl:value-of select="m:ci"/></m:mi>
923 <xsl:if test="$framewidth > $charlength">
924 <xsl:apply-templates select="m:type"/>
929 <xsl:if test="$charlength >= $framewidth">
933 <m:mphantom><m:mtext>:=</m:mtext></m:mphantom>
934 <xsl:apply-templates select="m:type"/>
943 <xsl:apply-templates select="following-sibling::*[position() = 1]"/>
955 <m:mo stretchy="false">}</m:mo>
963 <m:mi><xsl:value-of select="m:ci"/></m:mi>
964 <m:mo stretchy="false">{</m:mo>
965 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
966 <xsl:for-each select="m:bvar">
970 <m:mi><xsl:value-of select="m:ci"/></m:mi>
972 <xsl:apply-templates select="m:type"/>
974 <xsl:apply-templates select="following-sibling::*[position() = 1]"/>
975 <xsl:if test="position()=last()">
976 <m:mo stretchy="false">}</m:mo>
986 <!-- ***************************************** -->
987 <!-- *********** PROOF ELEMENTS ************** -->
988 <!-- ***************************************** -->
990 <xsl:when test="$name='proof'">
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:variable name="hidden_details">
997 <xsl:if test="$test">
998 <!-- Details hided (default) -->
999 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1003 <m:mtext mathcolor="Maroon">We can prove</m:mtext>
1004 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1005 <xsl:apply-templates select="*[position()=3]"/>
1007 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1008 <m:mtext mathcolor="Green">(explain)</m:mtext>
1016 <xsl:variable name="shown_details">
1017 <!-- Show details -->
1018 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1022 <xsl:apply-templates select="*[position()=2]"/>
1029 <m:mtext mathcolor="Maroon">we proved</m:mtext>
1030 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1031 <xsl:apply-templates select="*[position()=3]"/>
1034 <m:mtext>_</m:mtext>
1036 <xsl:if test="$test">
1037 <m:mtext mathcolor="Green">(hide details)</m:mtext>
1046 <xsl:when test="$test">
1047 <m:maction actiontype="toggle">
1048 <xsl:copy-of select="$hidden_details"/>
1049 <xsl:copy-of select="$shown_details"/>
1053 <xsl:copy-of select="$shown_details"/>
1058 <xsl:when test="$name='letin1'">
1059 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1063 <xsl:apply-templates select="*[2]"/>
1070 <xsl:apply-templates select="*[3]"/>
1076 <xsl:when test="$name='by_induction'">
1077 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1081 <m:mtext mathcolor="red">We prove</m:mtext>
1082 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1083 <xsl:apply-templates select="../*[3]"/>
1090 <m:mtext mathcolor="red">by induction on</m:mtext>
1091 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1092 <xsl:apply-templates
1093 select="*[position()=last()]/*[position()=last()]"/>
1100 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1101 <xsl:for-each select="*[position()>3 and not(position()=last())]">
1105 <xsl:apply-templates select="."/>
1116 <!-- inductive_case -->
1117 <xsl:when test="$name='inductive_case'">
1118 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1122 <m:mtext mathcolor="red">Case</m:mtext>
1123 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1124 <xsl:apply-templates select="*[2]"/>
1131 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1132 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1133 <xsl:if test="*[3]/*[position()>1]">
1137 <m:mtext mathcolor="red">By induction hypothesis, we have:</m:mtext>
1144 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1145 <xsl:for-each select="*[3]/*[position()>1]">
1146 <m:mo stretchy="false">(</m:mo>
1147 <xsl:apply-templates select="m:ci"/>
1148 <m:mo stretchy="false">) </m:mo>
1149 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1150 <xsl:apply-templates select="m:type"/>
1159 <xsl:apply-templates select="*[4]"/>
1170 <xsl:when test="$name='case_lhs'">
1173 <xsl:when test="count(*)=2">
1174 <xsl:apply-templates select="*[2]"/>
1177 <m:mo stretchy="false">(</m:mo>
1178 <xsl:apply-templates select="*[2]"/>
1179 <xsl:for-each select="m:bvar">
1180 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1181 <xsl:apply-templates select="*[1]"/>
1182 <m:mtext>:</m:mtext>
1183 <xsl:apply-templates select="m:type/*[1]"/>
1185 <m:mo stretchy="false">)</m:mo>
1191 <xsl:when test="$name='false_ind'">
1192 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1196 <xsl:apply-templates select="*[3]"/>
1203 <m:mtext mathcolor="Red">Contradiction.</m:mtext>
1210 <xsl:when test="$name='letin'">
1211 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1212 <!-- <xsl:for-each select="APPLY[m:csymbol and (string(m:csymbol)='let')]"> -->
1213 <xsl:for-each select="*[(last() > position()) and (position()>1)]">
1217 <xsl:apply-templates select="."/>
1225 <xsl:apply-templates select="*[position()=last()]"/>
1232 <xsl:when test="$name='let'">
1233 <m:mtext>(</m:mtext>
1234 <xsl:apply-templates select="m:ci"/>
1235 <m:mtext>) </m:mtext>
1236 <xsl:apply-templates select="*[3]"/>
1239 <xsl:when test="$name='rw_step'">
1240 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1245 <xsl:when test="name(*[2])='m:apply'">
1246 <xsl:apply-templates select="*[2]"/>
1249 <m:mtext>Consider</m:mtext>
1250 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1251 <xsl:apply-templates select="*[2]"/>
1260 <m:mtext>Rewrite</m:mtext>
1261 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1262 <xsl:apply-templates select="*[3]"/>
1263 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1264 <m:mtext>with</m:mtext>
1265 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1266 <xsl:apply-templates select="*[4]"/>
1267 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1268 <m:mtext>by</m:mtext>
1269 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1270 <xsl:apply-templates select="*[5]"/>
1276 <!-- not existing any more
1277 <xsl:when test="$name='thread'">
1278 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1283 <xsl:when test="name(*[last()])='m:apply'">
1284 <xsl:apply-templates select="*[last()]"/>
1287 <m:mtext>Consider</m:mtext>
1288 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1289 <xsl:apply-templates select="*[last()]"/>
1295 <xsl:apply-templates mode="thread" select="*[(last()-2)]"/>
1299 <!-- REWRITE_AND_APPLY -->
1300 <xsl:when test="$name='rewrite_and_apply'">
1301 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1305 <xsl:apply-templates select="*[2]"/>
1312 <m:mtext>Then apply it to</m:mtext>
1313 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1314 <xsl:apply-templates select="*[position()>2]"/>
1321 <xsl:when test="$name='and_ind'">
1322 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1327 <xsl:when test="name(*[2])='m:apply'">
1328 <xsl:apply-templates select="*[2]"/>
1331 <m:mtext>Consider</m:mtext>
1332 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1333 <xsl:apply-templates select="*[2]"/>
1342 <m:mtext>In particular, we have</m:mtext>
1349 <m:mtext>(</m:mtext>
1350 <xsl:apply-templates select="*[3]"/>
1351 <m:mtext>)</m:mtext>
1352 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1353 <xsl:apply-templates select="*[4]"/>
1360 <m:mtext>(</m:mtext>
1361 <xsl:apply-templates select="*[5]"/>
1362 <m:mtext>)</m:mtext>
1363 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1364 <xsl:apply-templates select="*[6]"/>
1371 <xsl:apply-templates select="*[7]"/>
1377 <!-- full_or_ind -->
1378 <xsl:when test="$name='full_or_ind'">
1379 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1384 <xsl:when test="name(*[2])='m:apply'">
1385 <xsl:apply-templates select="*[2]"/>
1388 <m:mtext>Consider</m:mtext>
1389 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1390 <xsl:apply-templates select="*[2]"/>
1399 <m:mtext>We proceed by cases to prove</m:mtext>
1400 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1401 <xsl:apply-templates select="*[3]"/>
1408 <m:mtext>Left: suppose</m:mtext>
1409 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1410 <m:mo stretchy="false">(</m:mo>
1411 <xsl:apply-templates select="*[4]/m:bvar/m:ci"/>
1412 <m:mo stretchy="false">)</m:mo>
1413 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1414 <xsl:apply-templates select="*[4]/m:bvar/m:type/*[1]"/>
1421 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1422 <xsl:apply-templates select="*[4]/*[3]"/>
1429 <m:mtext>Right: suppose</m:mtext>
1430 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1431 <m:mo stretchy="false">(</m:mo>
1432 <xsl:apply-templates select="*[5]/m:bvar/m:ci"/>
1433 <m:mo stretchy="false">)</m:mo>
1434 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1435 <xsl:apply-templates select="*[5]/m:bvar/m:type/*[1]"/>
1442 <xsl:apply-templates select="*[5]/*[3]"/>
1449 <xsl:when test="$name='or_ind'">
1450 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1455 <xsl:when test="name(*[2])='m:apply'">
1456 <xsl:apply-templates select="*[2]"/>
1459 <m:mtext>Consider</m:mtext>
1460 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1461 <xsl:apply-templates select="*[2]"/>
1470 <m:mtext>We prove</m:mtext>
1471 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1472 <xsl:apply-templates select="*[3]"/>
1473 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1474 <m:mtext>by cases:</m:mtext>
1481 <m:mtext>Left</m:mtext>
1482 <xsl:apply-templates select="*[4]"/>
1489 <m:mtext>Right</m:mtext>
1490 <xsl:apply-templates select="*[5]"/>
1497 <xsl:when test="$name='ex_ind'">
1498 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1503 <xsl:when test="name(*[2])='m:apply'">
1504 <xsl:apply-templates select="*[2]"/>
1507 <m:mtext>Consider</m:mtext>
1508 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1509 <xsl:apply-templates select="*[2]"/>
1518 <m:mtext>Let</m:mtext>
1519 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1520 <xsl:apply-templates select="*[3]"/>
1521 <m:mtext>:</m:mtext>
1522 <xsl:apply-templates select="*[4]"/>
1523 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1524 <m:mtext>such that</m:mtext>
1525 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1526 <m:mtext>(</m:mtext>
1527 <xsl:apply-templates select="*[5]"/>
1528 <m:mtext>)</m:mtext>
1529 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1530 <xsl:apply-templates select="*[6]"/>
1537 <xsl:apply-templates select="*[7]"/>
1543 <!-- ***************************************** -->
1544 <!-- *********** NOTATIONS ******************* -->
1545 <!-- ***************************************** -->
1547 <xsl:when test="$name='subst'">
1548 <xsl:apply-templates select="*[3]"/>
1549 <!-- no font for ApplyFunction: <m:mo></m:mo> -->
1550 <m:mo stretchy="false">[</m:mo>
1551 <xsl:apply-templates select="*[4]"/>
1552 <m:mo mathcolor="green">
1553 <xsl:if test="$id != ''">
1554 <xsl:attribute name="m:xref"><xsl:value-of select="$id"/></xsl:attribute>
1555 </xsl:if>←</m:mo>
1556 <xsl:apply-templates select="*[2]"/>
1557 <m:mo stretchy="false">]</m:mo>
1560 <xsl:when test="$name='lift'">
1562 <m:mo mathcolor="green">
1563 <xsl:if test="$id != ''">
1564 <xsl:attribute name="m:xref"><xsl:value-of select="$id"/></xsl:attribute>
1565 </xsl:if>↑</m:mo>
1566 <xsl:apply-templates select="*[2]"/>
1569 <m:mo stretchy="false">(</m:mo>
1570 <xsl:apply-templates select="*[3]"/>
1571 <m:mo stretchy="false">)</m:mo>
1574 <!-- lift_with_base -->
1575 <xsl:when test="$name='lift_with_base'">
1577 <m:mo mathcolor="green">
1578 <xsl:if test="$id != ''">
1579 <xsl:attribute name="m:xref"><xsl:value-of select="$id"/></xsl:attribute>
1580 </xsl:if>↑</m:mo>
1581 <xsl:apply-templates select="*[3]"/>
1582 <xsl:apply-templates select="*[4]"/>
1585 <m:mo stretchy="false">(</m:mo>
1586 <xsl:apply-templates select="*[2]"/>
1587 <m:mo stretchy="false">)</m:mo>
1591 <xsl:when test="$name='beta_red1'">
1592 <xsl:apply-templates select="*[2]"/>
1594 <m:mo mathcolor="green">
1595 <xsl:if test="$id != ''">
1596 <xsl:attribute name="m:xref"><xsl:value-of select="$id"/></xsl:attribute>
1597 </xsl:if>→</m:mo>
1598 <m:mi mathcolor="green">β</m:mi>
1600 <xsl:apply-templates select="*[3]"/>
1603 <xsl:when test="$name='beta_red'">
1604 <xsl:apply-templates select="*[2]"/>
1606 <m:mo mathcolor="green">
1607 <xsl:if test="$id != ''">
1608 <xsl:attribute name="m:xref"><xsl:value-of select="$id"/></xsl:attribute>
1609 </xsl:if>→</m:mo>
1610 <m:mi mathcolor="green">β</m:mi>
1611 <m:mi mathcolor="green">*</m:mi>
1613 <xsl:apply-templates select="*[3]"/>
1615 <!-- par_beta_red1 -->
1616 <xsl:when test="$name='par_beta_red1'">
1617 <xsl:apply-templates select="*[2]"/>
1619 <m:mo mathcolor="green">
1620 <xsl:if test="$id != ''">
1621 <xsl:attribute name="m:xref"><xsl:value-of select="$id"/></xsl:attribute>
1622 </xsl:if>⇒</m:mo>
1623 <m:mi mathcolor="green">β</m:mi>
1625 <xsl:apply-templates select="*[3]"/>
1627 <!-- par_beta_red -->
1628 <xsl:when test="$name='par_beta_red'">
1629 <xsl:apply-templates select="*[2]"/>
1631 <m:mo mathcolor="green">
1632 <xsl:if test="$id != ''">
1633 <xsl:attribute name="m:xref"><xsl:value-of select="$id"/></xsl:attribute>
1634 </xsl:if>⇒</m:mo>
1635 <m:mi mathcolor="green">β</m:mi>
1636 <m:mi mathcolor="green">*</m:mi>
1638 <xsl:apply-templates select="*[3]"/>
1641 <xsl:when test="$name='forgetful'">
1642 <m:mfenced open="|" close="|">
1643 <xsl:if test="$id != ''">
1644 <xsl:attribute name="m:xref"><xsl:value-of select="$id"/></xsl:attribute>
1646 <xsl:apply-templates select="*[2]"/>
1650 <xsl:when test="$name='isomorphic'">
1651 <xsl:apply-templates select="*[2]"/>
1652 <m:mo mathcolor="green">
1653 <xsl:if test="$id != ''">
1654 <xsl:attribute name="m:xref"><xsl:value-of select="$id"/></xsl:attribute>
1655 </xsl:if>≅</m:mo>
1656 <xsl:apply-templates select="*[3]"/>
1659 <xsl:when test="$name='forgetful'">
1660 <m:mfenced open="[" close="]">
1661 <xsl:if test="$id != ''">
1662 <xsl:attribute name="m:xref"><xsl:value-of select="$id"/></xsl:attribute>
1664 <xsl:apply-templates select="*[2]"/>
1676 <!-- Il modo Thread non esiste piu'
1677 <xsl:template match="*" mode="thread">
1678 <xsl:variable name="name"><xsl:value-of select="following-sibling::*[position()=1]/m:csymbol"/></xsl:variable>
1680 <xsl:when test="$name='rw_step'">
1684 <m:mtext>Rewrite</m:mtext>
1685 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1686 <xsl:apply-templates select="following-sibling::*[position()=1]/*[2]"/>
1687 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1688 <m:mtext>with</m:mtext>
1689 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1690 <xsl:apply-templates select="following-sibling::*[position()=1]/*[3]"/>
1691 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1692 <m:mtext>by</m:mtext>
1693 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1694 <xsl:apply-templates select="following-sibling::*[position()=1]/*[4]"/>
1701 <m:mtext mathcolor="Maroon">we get</m:mtext>
1702 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1703 <xsl:apply-templates select="."/>
1712 <xsl:apply-templates select="following-sibling::*[position()=1]"/>
1719 <m:mtext mathcolor="Maroon">we get</m:mtext>
1720 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1721 <xsl:apply-templates select="."/>
1727 <xsl:apply-templates mode="thread" select="preceding-sibling::*[position()=2]"/>
1733 <xsl:template match="m:lambda">
1734 <xsl:variable name="charlength"><xsl:apply-templates select="*[position()=1]" mode="charcount"/></xsl:variable>
1737 <xsl:attribute name="m:xref">
1738 <xsl:value-of select="@id"/>
1742 <xsl:when test="$charlength >= $framewidth">
1743 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1747 <m:mo mathcolor="Red">λ</m:mo>
1748 <xsl:apply-templates select="m:bvar"/>
1756 <xsl:apply-templates select="*[position()=2]"/>
1763 <m:mo mathcolor="Red">λ</m:mo>
1764 <xsl:apply-templates select="m:bvar/m:ci"/>
1766 <xsl:apply-templates select="m:bvar/m:type"/>
1768 <xsl:apply-templates select="*[position()=2]"/>
1774 <!-- *********************************** -->
1775 <!-- BASE SET OF MATHML CONTENT ELEMENTS -->
1776 <!-- *********************************** -->
1780 <xsl:template match = "m:apply[m:eq[1]]">
1781 <xsl:variable name="charlength">
1782 <xsl:apply-templates select="*[1]" mode="charcount"/>
1785 <xsl:when test="$charlength >= $framewidth">
1786 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1788 <xsl:attribute name="m:xref">
1789 <xsl:value-of select="@id"/>
1795 <m:mo stretchy="false">(</m:mo>
1796 <xsl:apply-templates select="*[position()=2]"/>
1800 <xsl:for-each select = "*[position()>2]">
1804 <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
1806 <xsl:if test="m:in/@id">
1807 <xsl:attribute name="m:xref">
1808 <xsl:value-of select="m:in/@id"/>
1811 <xsl:apply-templates select="."/>
1819 <m:mo stretchy="false">)</m:mo>
1826 <xsl:apply-imports/>
1832 <xsl:template match = "m:apply[m:and[1]|m:or[1]
1833 |m:geq[1]|m:leq[1]|m:gt[1]|m:lt[1]
1834 |m:in[1]|m:intesect[1]|m:union[1]|m:subset[1]
1835 |m:prsubset|m:setdiff[1]]">
1836 <xsl:variable name="symbol">
1838 <xsl:when test="m:and[1]">
1839 <xsl:value-of select="'∧'"/>
1841 <xsl:when test="m:or[1]">
1842 <xsl:value-of select="'∨'"/>
1844 <xsl:when test="m:geq[1]">
1845 <xsl:value-of select="'≥'"/>
1847 <xsl:when test="m:leq[1]">
1848 <xsl:value-of select="'≤'"/>
1850 <xsl:when test="m:gt[1]">
1851 <xsl:value-of select="'>'"/>
1853 <xsl:when test="m:lt[1]">
1854 <xsl:value-of select="'< '"/>
1856 <xsl:when test="m:eq[1]">
1857 <xsl:value-of select="'='"/>
1859 <xsl:when test="m:in[1]">
1860 <xsl:value-of select="'∈'"/>
1862 <xsl:when test="m:subset[1]">
1863 <xsl:value-of select="'⊆'"/>
1865 <xsl:when test="m:prsubset[1]">
1866 <xsl:value-of select="'⊂'"/>
1868 <xsl:when test="m:intersect[1]">
1869 <xsl:value-of select="'⋂'"/>
1871 <xsl:when test="m:union[1]">
1872 <xsl:value-of select="'⋃'"/>
1874 <xsl:when test="m:setdiff[1]">
1875 <xsl:value-of select="'∖'"/>
1879 <xsl:variable name="charlength">
1880 <xsl:apply-templates select="*[1]" mode="charcount"/>
1883 <xsl:when test="$charlength >= $framewidth">
1884 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1886 <xsl:attribute name="m:xref">
1887 <xsl:value-of select="@id"/>
1893 <m:mo stretchy="false">(</m:mo>
1894 <xsl:apply-templates select="*[position()=2]"/>
1898 <xsl:for-each select = "*[position()>2]">
1902 <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
1904 <xsl:if test="*[1]/@id">
1905 <xsl:attribute name="m:xref">
1906 <xsl:value-of select="*[1]/@id"/>
1908 </xsl:if><xsl:value-of select="$symbol"/></m:mo>
1909 <xsl:apply-templates select="."/>
1917 <m:mo stretchy="false">)</m:mo>
1924 <xsl:apply-imports/>
1929 <xsl:template match = "m:set">
1931 <xsl:when test="count(child::*) = 0">
1934 <xsl:attribute name="m:xref">
1935 <xsl:value-of select="@id"/>
1937 </xsl:if>∅</m:mi>
1940 <xsl:variable name="charlength">
1941 <xsl:apply-templates select="*[1]" mode="charcount"/>
1944 <xsl:when test="$charlength >= $framewidth">
1946 <xsl:when test="name(*[1]) = 'm:bvar'">
1947 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1951 <m:mo stretchy="false">
1953 <xsl:attribute name="m:xref">
1954 <xsl:value-of select="@id"/>
1957 <xsl:apply-templates select="*[position()=1]"/>
1964 <m:mphantom><m:mtext>{</m:mtext></m:mphantom>
1965 <m:mo stretchy="false">|</m:mo>
1966 <xsl:apply-templates select="m:condition/*[1]"/>
1973 <m:mo stretchy="false">
1975 <xsl:attribute name="m:xref">
1976 <xsl:value-of select="@id"/>
1985 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1989 <m:mo stretchy="false">
1991 <xsl:attribute name="m:xref">
1992 <xsl:value-of select="@id"/>
1995 <xsl:apply-templates select="*[position()=1]"/>
1996 <xsl:if test="position() != last()">
2002 <xsl:for-each select = "*[position()>2]">
2006 <m:mphantom><m:mtext>{</m:mtext></m:mphantom>
2007 <xsl:apply-templates select="."/>
2008 <xsl:if test="position() != last()">
2018 <m:mo stretchy="false">
2020 <xsl:attribute name="m:xref">
2021 <xsl:value-of select="@id"/>
2032 <xsl:apply-imports/>
2039 <xsl:template match = "m:apply[m:card[1]]">
2040 <m:mfenced open="|" close="|" stretchy="false">
2041 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
2042 <xsl:attribute name="m:xref">
2043 <xsl:value-of select="@id"/>
2046 <xsl:apply-templates select="*[2]"/>
2051 <!--**********************-->
2053 <!--**********************-->
2055 <xsl:template match="m:cn|m:and|m:or|m:not|m:exists|m:eq|m:lt|m:leq|m:gt|m:geq
2056 |m:in|m:notin|m:intersect|m:union|m:subset|m:prsubset|m:card|m:setdiff
2057 |m:plus|m:minus|m:times" mode="charcount">
2058 <xsl:param name="incurrent_length" select="0"/>
2060 <xsl:when test="$framewidth > ($incurrent_length + 3 + string-length())">
2061 <xsl:variable name="siblength">
2062 <xsl:apply-templates select="following-sibling::*[position()=1]" mode="charcount">
2063 <xsl:with-param name="incurrent_length" select="$incurrent_length + string-length()"/>
2064 </xsl:apply-templates>
2067 <xsl:when test="string($siblength) = """>
2068 <xsl:value-of select="$incurrent_length + 3 + string-length()"/>
2071 <xsl:value-of select="number($siblength)"/>
2076 <xsl:value-of select="$incurrent_length + 3 + string-length()"/>
2081 <xsl:template match="m:ci|m:csymbol" mode="charcount">
2082 <xsl:param name="incurrent_length" select="0"/>
2083 <xsl:param name="nosibling" select="0"/>
2085 <xsl:when test="$framewidth > ($incurrent_length + string-length()) and ($nosibling = 0)">
2086 <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>
2088 <xsl:when test="string($siblength) = """>
2089 <xsl:value-of select="$incurrent_length + string-length()"/>
2092 <xsl:value-of select="number($siblength)"/>
2097 <xsl:value-of select="$incurrent_length + string-length()"/>
2102 <xsl:template match="*" mode="charcount">
2103 <xsl:param name="incurrent_length" select="0"/>
2104 <xsl:param name="nosibling" select="0"/>
2106 <xsl:when test="count(child::*) = 0">
2107 <xsl:value-of select="$incurrent_length"/>
2110 <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>
2112 <xsl:when test="$framewidth > number($childlength) and ($nosibling = 0)">
2113 <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>
2115 <xsl:when test="string($siblength) = """>
2116 <xsl:value-of select="number($childlength)"/>
2119 <xsl:value-of select="number($siblength)"/>
2124 <xsl:value-of select="number($childlength)"/>