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: next if until the annotationHelper can handle mactions -->
992 <xsl:if test="not($explodeall)">
993 <!-- Details hided (default) -->
994 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
998 <m:mtext mathcolor="Maroon">We can prove</m:mtext>
999 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1000 <xsl:apply-templates select="*[position()=3]"/>
1002 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1003 <m:mtext mathcolor="Green">(explain)</m:mtext>
1010 <!-- Show details -->
1011 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1015 <xsl:apply-templates select="*[position()=2]"/>
1022 <m:mtext mathcolor="Maroon">we proved</m:mtext>
1023 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1024 <xsl:apply-templates select="*[position()=3]"/>
1027 <m:mtext>_</m:mtext>
1029 <m:mtext mathcolor="Green">(hide details)</m:mtext>
1038 <xsl:when test="$name='letin1'">
1039 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1043 <xsl:apply-templates select="*[2]"/>
1050 <xsl:apply-templates select="*[3]"/>
1056 <xsl:when test="$name='by_induction'">
1057 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1061 <m:mtext mathcolor="red">We prove</m:mtext>
1062 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1063 <xsl:apply-templates select="../*[3]"/>
1070 <m:mtext mathcolor="red">by induction on</m:mtext>
1071 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1072 <xsl:apply-templates
1073 select="*[position()=last()]/*[position()=last()]"/>
1080 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1081 <xsl:for-each select="*[position()>3 and not(position()=last())]">
1085 <xsl:apply-templates select="."/>
1096 <!-- inductive_case -->
1097 <xsl:when test="$name='inductive_case'">
1098 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1102 <m:mtext mathcolor="red">Case</m:mtext>
1103 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1104 <xsl:apply-templates select="*[2]"/>
1111 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1112 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1113 <xsl:if test="*[3]/*[position()>1]">
1117 <m:mtext mathcolor="red">By induction hypothesis, we have:</m:mtext>
1124 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1125 <xsl:for-each select="*[3]/*[position()>1]">
1126 <m:mo stretchy="false">(</m:mo>
1127 <xsl:apply-templates select="m:ci"/>
1128 <m:mo stretchy="false">) </m:mo>
1129 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1130 <xsl:apply-templates select="m:type"/>
1139 <xsl:apply-templates select="*[4]"/>
1150 <xsl:when test="$name='case_lhs'">
1153 <xsl:when test="count(*)=2">
1154 <xsl:apply-templates select="*[2]"/>
1157 <m:mo stretchy="false">(</m:mo>
1158 <xsl:apply-templates select="*[2]"/>
1159 <xsl:for-each select="m:bvar">
1160 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1161 <xsl:apply-templates select="*[1]"/>
1162 <m:mtext>:</m:mtext>
1163 <xsl:apply-templates select="m:type/*[1]"/>
1165 <m:mo stretchy="false">)</m:mo>
1171 <xsl:when test="$name='false_ind'">
1172 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1176 <xsl:apply-templates select="*[3]"/>
1183 <m:mtext mathcolor="Red">Contradiction.</m:mtext>
1190 <xsl:when test="$name='letin'">
1191 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1192 <!-- <xsl:for-each select="APPLY[m:csymbol and (string(m:csymbol)='let')]"> -->
1193 <xsl:for-each select="*[(last() > position()) and (position()>1)]">
1197 <xsl:apply-templates select="."/>
1205 <xsl:apply-templates select="*[position()=last()]"/>
1212 <xsl:when test="$name='let'">
1213 <m:mtext>(</m:mtext>
1214 <xsl:apply-templates select="m:ci"/>
1215 <m:mtext>) </m:mtext>
1216 <xsl:apply-templates select="*[3]"/>
1219 <xsl:when test="$name='rw_step'">
1220 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1225 <xsl:when test="name(*[2])='m:apply'">
1226 <xsl:apply-templates select="*[2]"/>
1229 <m:mtext>Consider</m:mtext>
1230 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1231 <xsl:apply-templates select="*[2]"/>
1240 <m:mtext>Rewrite</m:mtext>
1241 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1242 <xsl:apply-templates select="*[3]"/>
1243 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1244 <m:mtext>with</m:mtext>
1245 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1246 <xsl:apply-templates select="*[4]"/>
1247 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1248 <m:mtext>by</m:mtext>
1249 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1250 <xsl:apply-templates select="*[5]"/>
1256 <!-- not existing any more
1257 <xsl:when test="$name='thread'">
1258 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1263 <xsl:when test="name(*[last()])='m:apply'">
1264 <xsl:apply-templates select="*[last()]"/>
1267 <m:mtext>Consider</m:mtext>
1268 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1269 <xsl:apply-templates select="*[last()]"/>
1275 <xsl:apply-templates mode="thread" select="*[(last()-2)]"/>
1279 <!-- REWRITE_AND_APPLY -->
1280 <xsl:when test="$name='rewrite_and_apply'">
1281 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1285 <xsl:apply-templates select="*[2]"/>
1292 <m:mtext>Then apply it to</m:mtext>
1293 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1294 <xsl:apply-templates select="*[position()>2]"/>
1301 <xsl:when test="$name='and_ind'">
1302 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1307 <xsl:when test="name(*[2])='m:apply'">
1308 <xsl:apply-templates select="*[2]"/>
1311 <m:mtext>Consider</m:mtext>
1312 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1313 <xsl:apply-templates select="*[2]"/>
1322 <m:mtext>In particular, we have</m:mtext>
1329 <m:mtext>(</m:mtext>
1330 <xsl:apply-templates select="*[3]"/>
1331 <m:mtext>)</m:mtext>
1332 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1333 <xsl:apply-templates select="*[4]"/>
1340 <m:mtext>(</m:mtext>
1341 <xsl:apply-templates select="*[5]"/>
1342 <m:mtext>)</m:mtext>
1343 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1344 <xsl:apply-templates select="*[6]"/>
1351 <xsl:apply-templates select="*[7]"/>
1357 <!-- full_or_ind -->
1358 <xsl:when test="$name='full_or_ind'">
1359 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1364 <xsl:when test="name(*[2])='m:apply'">
1365 <xsl:apply-templates select="*[2]"/>
1368 <m:mtext>Consider</m:mtext>
1369 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1370 <xsl:apply-templates select="*[2]"/>
1379 <m:mtext>We proceed by cases to prove</m:mtext>
1380 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1381 <xsl:apply-templates select="*[3]"/>
1388 <m:mtext>Left: suppose</m:mtext>
1389 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1390 <m:mo stretchy="false">(</m:mo>
1391 <xsl:apply-templates select="*[4]/m:bvar/m:ci"/>
1392 <m:mo stretchy="false">)</m:mo>
1393 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1394 <xsl:apply-templates select="*[4]/m:bvar/m:type/*[1]"/>
1401 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1402 <xsl:apply-templates select="*[4]/*[3]"/>
1409 <m:mtext>Right: suppose</m:mtext>
1410 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1411 <m:mo stretchy="false">(</m:mo>
1412 <xsl:apply-templates select="*[5]/m:bvar/m:ci"/>
1413 <m:mo stretchy="false">)</m:mo>
1414 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1415 <xsl:apply-templates select="*[5]/m:bvar/m:type/*[1]"/>
1422 <xsl:apply-templates select="*[5]/*[3]"/>
1429 <xsl:when test="$name='or_ind'">
1430 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1435 <xsl:when test="name(*[2])='m:apply'">
1436 <xsl:apply-templates select="*[2]"/>
1439 <m:mtext>Consider</m:mtext>
1440 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1441 <xsl:apply-templates select="*[2]"/>
1450 <m:mtext>We prove</m:mtext>
1451 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1452 <xsl:apply-templates select="*[3]"/>
1453 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1454 <m:mtext>by cases:</m:mtext>
1461 <m:mtext>Left</m:mtext>
1462 <xsl:apply-templates select="*[4]"/>
1469 <m:mtext>Right</m:mtext>
1470 <xsl:apply-templates select="*[5]"/>
1477 <xsl:when test="$name='ex_ind'">
1478 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1483 <xsl:when test="name(*[2])='m:apply'">
1484 <xsl:apply-templates select="*[2]"/>
1487 <m:mtext>Consider</m:mtext>
1488 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1489 <xsl:apply-templates select="*[2]"/>
1498 <m:mtext>Let</m:mtext>
1499 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1500 <xsl:apply-templates select="*[3]"/>
1501 <m:mtext>:</m:mtext>
1502 <xsl:apply-templates select="*[4]"/>
1503 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1504 <m:mtext>such that</m:mtext>
1505 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1506 <m:mtext>(</m:mtext>
1507 <xsl:apply-templates select="*[5]"/>
1508 <m:mtext>)</m:mtext>
1509 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1510 <xsl:apply-templates select="*[6]"/>
1517 <xsl:apply-templates select="*[7]"/>
1523 <!-- ***************************************** -->
1524 <!-- *********** NOTATIONS ******************* -->
1525 <!-- ***************************************** -->
1527 <xsl:when test="$name='subst'">
1528 <xsl:apply-templates select="*[3]"/>
1529 <!-- no font for ApplyFunction: <m:mo></m:mo> -->
1530 <m:mo stretchy="false">[</m:mo>
1531 <xsl:apply-templates select="*[4]"/>
1532 <m:mo mathcolor="green">
1533 <xsl:if test="$id != ''">
1534 <xsl:attribute name="m:xref"><xsl:value-of select="$id"/></xsl:attribute>
1535 </xsl:if>←</m:mo>
1536 <xsl:apply-templates select="*[2]"/>
1537 <m:mo stretchy="false">]</m:mo>
1540 <xsl:when test="$name='lift'">
1542 <m:mo mathcolor="green">
1543 <xsl:if test="$id != ''">
1544 <xsl:attribute name="m:xref"><xsl:value-of select="$id"/></xsl:attribute>
1545 </xsl:if>↑</m:mo>
1546 <xsl:apply-templates select="*[2]"/>
1549 <m:mo stretchy="false">(</m:mo>
1550 <xsl:apply-templates select="*[3]"/>
1551 <m:mo stretchy="false">)</m:mo>
1554 <!-- lift_with_base -->
1555 <xsl:when test="$name='lift_with_base'">
1557 <m:mo mathcolor="green">
1558 <xsl:if test="$id != ''">
1559 <xsl:attribute name="m:xref"><xsl:value-of select="$id"/></xsl:attribute>
1560 </xsl:if>↑</m:mo>
1561 <xsl:apply-templates select="*[3]"/>
1562 <xsl:apply-templates select="*[4]"/>
1565 <m:mo stretchy="false">(</m:mo>
1566 <xsl:apply-templates select="*[2]"/>
1567 <m:mo stretchy="false">)</m:mo>
1571 <xsl:when test="$name='beta_red1'">
1572 <xsl:apply-templates select="*[2]"/>
1574 <m:mo mathcolor="green">
1575 <xsl:if test="$id != ''">
1576 <xsl:attribute name="m:xref"><xsl:value-of select="$id"/></xsl:attribute>
1577 </xsl:if>→</m:mo>
1578 <m:mi mathcolor="green">β</m:mi>
1580 <xsl:apply-templates select="*[3]"/>
1583 <xsl:when test="$name='beta_red'">
1584 <xsl:apply-templates select="*[2]"/>
1586 <m:mo mathcolor="green">
1587 <xsl:if test="$id != ''">
1588 <xsl:attribute name="m:xref"><xsl:value-of select="$id"/></xsl:attribute>
1589 </xsl:if>→</m:mo>
1590 <m:mi mathcolor="green">β</m:mi>
1591 <m:mi mathcolor="green">*</m:mi>
1593 <xsl:apply-templates select="*[3]"/>
1595 <!-- par_beta_red1 -->
1596 <xsl:when test="$name='par_beta_red1'">
1597 <xsl:apply-templates select="*[2]"/>
1599 <m:mo mathcolor="green">
1600 <xsl:if test="$id != ''">
1601 <xsl:attribute name="m:xref"><xsl:value-of select="$id"/></xsl:attribute>
1602 </xsl:if>⇒</m:mo>
1603 <m:mi mathcolor="green">β</m:mi>
1605 <xsl:apply-templates select="*[3]"/>
1607 <!-- par_beta_red -->
1608 <xsl:when test="$name='par_beta_red'">
1609 <xsl:apply-templates select="*[2]"/>
1611 <m:mo mathcolor="green">
1612 <xsl:if test="$id != ''">
1613 <xsl:attribute name="m:xref"><xsl:value-of select="$id"/></xsl:attribute>
1614 </xsl:if>⇒</m:mo>
1615 <m:mi mathcolor="green">β</m:mi>
1616 <m:mi mathcolor="green">*</m:mi>
1618 <xsl:apply-templates select="*[3]"/>
1621 <xsl:when test="$name='forgetful'">
1622 <m:mfenced open="|" close="|">
1623 <xsl:if test="$id != ''">
1624 <xsl:attribute name="m:xref"><xsl:value-of select="$id"/></xsl:attribute>
1626 <xsl:apply-templates select="*[2]"/>
1630 <xsl:when test="$name='isomorphic'">
1631 <xsl:apply-templates select="*[2]"/>
1632 <m:mo mathcolor="green">
1633 <xsl:if test="$id != ''">
1634 <xsl:attribute name="m:xref"><xsl:value-of select="$id"/></xsl:attribute>
1635 </xsl:if>≅</m:mo>
1636 <xsl:apply-templates select="*[3]"/>
1639 <xsl:when test="$name='forgetful'">
1640 <m:mfenced open="[" close="]">
1641 <xsl:if test="$id != ''">
1642 <xsl:attribute name="m:xref"><xsl:value-of select="$id"/></xsl:attribute>
1644 <xsl:apply-templates select="*[2]"/>
1656 <!-- Il modo Thread non esiste piu'
1657 <xsl:template match="*" mode="thread">
1658 <xsl:variable name="name"><xsl:value-of select="following-sibling::*[position()=1]/m:csymbol"/></xsl:variable>
1660 <xsl:when test="$name='rw_step'">
1664 <m:mtext>Rewrite</m:mtext>
1665 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1666 <xsl:apply-templates select="following-sibling::*[position()=1]/*[2]"/>
1667 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1668 <m:mtext>with</m:mtext>
1669 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1670 <xsl:apply-templates select="following-sibling::*[position()=1]/*[3]"/>
1671 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1672 <m:mtext>by</m:mtext>
1673 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1674 <xsl:apply-templates select="following-sibling::*[position()=1]/*[4]"/>
1681 <m:mtext mathcolor="Maroon">we get</m:mtext>
1682 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1683 <xsl:apply-templates select="."/>
1692 <xsl:apply-templates select="following-sibling::*[position()=1]"/>
1699 <m:mtext mathcolor="Maroon">we get</m:mtext>
1700 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1701 <xsl:apply-templates select="."/>
1707 <xsl:apply-templates mode="thread" select="preceding-sibling::*[position()=2]"/>
1713 <xsl:template match="m:lambda">
1714 <xsl:variable name="charlength"><xsl:apply-templates select="*[position()=1]" mode="charcount"/></xsl:variable>
1715 <m:mrow m:xref="{@id}">
1717 <xsl:when test="$charlength >= $framewidth">
1718 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1722 <m:mo mathcolor="Red">λ</m:mo>
1723 <xsl:apply-templates select="m:bvar"/>
1731 <xsl:apply-templates select="*[position()=2]"/>
1738 <m:mo mathcolor="Red">λ</m:mo>
1739 <xsl:apply-templates select="m:bvar/m:ci"/>
1741 <xsl:apply-templates select="m:bvar/m:type"/>
1743 <xsl:apply-templates select="*[position()=2]"/>
1749 <!-- *********************************** -->
1750 <!-- BASE SET OF MATHML CONTENT ELEMENTS -->
1751 <!-- *********************************** -->
1755 <xsl:template match = "m:apply[m:eq[1]]">
1756 <xsl:variable name="charlength">
1757 <xsl:apply-templates select="*[1]" mode="charcount"/>
1760 <xsl:when test="$charlength >= $framewidth">
1761 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1763 <xsl:attribute name="m:xref">
1764 <xsl:value-of select="@id"/>
1770 <m:mo stretchy="false">(</m:mo>
1771 <xsl:apply-templates select="*[position()=2]"/>
1775 <xsl:for-each select = "*[position()>2]">
1779 <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
1781 <xsl:if test="m:in/@id">
1782 <xsl:attribute name="m:xref">
1783 <xsl:value-of select="m:in/@id"/>
1786 <xsl:apply-templates select="."/>
1794 <m:mo stretchy="false">)</m:mo>
1801 <xsl:apply-imports/>
1807 <xsl:template match = "m:apply[m:and[1]|m:or[1]
1808 |m:geq[1]|m:leq[1]|m:gt[1]|m:lt[1]
1809 |m:in[1]|m:intesect[1]|m:union[1]|m:subset[1]
1810 |m:prsubset|m:setdiff[1]]">
1811 <xsl:variable name="symbol">
1813 <xsl:when test="m:and[1]">
1814 <xsl:value-of select="'∧'"/>
1816 <xsl:when test="m:or[1]">
1817 <xsl:value-of select="'∨'"/>
1819 <xsl:when test="m:geq[1]">
1820 <xsl:value-of select="'≥'"/>
1822 <xsl:when test="m:leq[1]">
1823 <xsl:value-of select="'≤'"/>
1825 <xsl:when test="m:gt[1]">
1826 <xsl:value-of select="'>'"/>
1828 <xsl:when test="m:lt[1]">
1829 <xsl:value-of select="'< '"/>
1831 <xsl:when test="m:eq[1]">
1832 <xsl:value-of select="'='"/>
1834 <xsl:when test="m:in[1]">
1835 <xsl:value-of select="'∈'"/>
1837 <xsl:when test="m:subset[1]">
1838 <xsl:value-of select="'⊆'"/>
1840 <xsl:when test="m:prsubset[1]">
1841 <xsl:value-of select="'⊂'"/>
1843 <xsl:when test="m:intersect[1]">
1844 <xsl:value-of select="'⋂'"/>
1846 <xsl:when test="m:union[1]">
1847 <xsl:value-of select="'⋃'"/>
1849 <xsl:when test="m:setdiff[1]">
1850 <xsl:value-of select="'∖'"/>
1854 <xsl:variable name="charlength">
1855 <xsl:apply-templates select="*[1]" mode="charcount"/>
1858 <xsl:when test="$charlength >= $framewidth">
1859 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1861 <xsl:attribute name="m:xref">
1862 <xsl:value-of select="@id"/>
1868 <m:mo stretchy="false">(</m:mo>
1869 <xsl:apply-templates select="*[position()=2]"/>
1873 <xsl:for-each select = "*[position()>2]">
1877 <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
1879 <xsl:if test="*[1]/@id">
1880 <xsl:attribute name="m:xref">
1881 <xsl:value-of select="*[1]/@id"/>
1883 </xsl:if><xsl:value-of select="$symbol"/></m:mo>
1884 <xsl:apply-templates select="."/>
1892 <m:mo stretchy="false">)</m:mo>
1899 <xsl:apply-imports/>
1904 <xsl:template match = "m:set">
1906 <xsl:when test="count(child::*) = 0">
1909 <xsl:attribute name="m:xref">
1910 <xsl:value-of select="@id"/>
1912 </xsl:if>∅</m:mi>
1915 <xsl:variable name="charlength">
1916 <xsl:apply-templates select="*[1]" mode="charcount"/>
1919 <xsl:when test="$charlength >= $framewidth">
1921 <xsl:when test="name(*[1]) = 'm:bvar'">
1922 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1926 <m:mo stretchy="false">
1928 <xsl:attribute name="m:xref">
1929 <xsl:value-of select="@id"/>
1932 <xsl:apply-templates select="*[position()=1]"/>
1939 <m:mphantom><m:mtext>{</m:mtext></m:mphantom>
1940 <m:mo stretchy="false">|</m:mo>
1941 <xsl:apply-templates select="m:condition/*[1]"/>
1948 <m:mo stretchy="false">
1950 <xsl:attribute name="m:xref">
1951 <xsl:value-of select="@id"/>
1960 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1964 <m:mo stretchy="false">
1966 <xsl:attribute name="m:xref">
1967 <xsl:value-of select="@id"/>
1970 <xsl:apply-templates select="*[position()=1]"/>
1971 <xsl:if test="position() != last()">
1977 <xsl:for-each select = "*[position()>2]">
1981 <m:mphantom><m:mtext>{</m:mtext></m:mphantom>
1982 <xsl:apply-templates select="."/>
1983 <xsl:if test="position() != last()">
1993 <m:mo stretchy="false">
1995 <xsl:attribute name="m:xref">
1996 <xsl:value-of select="@id"/>
2007 <xsl:apply-imports/>
2014 <xsl:template match = "m:apply[m:card[1]]">
2015 <m:mfenced open="|" close="|" stretchy="false">
2016 <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
2017 <xsl:attribute name="m:xref">
2018 <xsl:value-of select="@id"/>
2021 <xsl:apply-templates select="*[2]"/>
2026 <!--**********************-->
2028 <!--**********************-->
2030 <xsl:template match="m:cn|m:and|m:or|m:not|m:exists|m:eq|m:lt|m:leq|m:gt|m:geq
2031 |m:in|m:notin|m:intersect|m:union|m:subset|m:prsubset|m:card|m:setdiff
2032 |m:plus|m:minus|m:times" mode="charcount">
2033 <xsl:param name="incurrent_length" select="0"/>
2035 <xsl:when test="$framewidth > ($incurrent_length + 3 + string-length())">
2036 <xsl:variable name="siblength">
2037 <xsl:apply-templates select="following-sibling::*[position()=1]" mode="charcount">
2038 <xsl:with-param name="incurrent_length" select="$incurrent_length + string-length()"/>
2039 </xsl:apply-templates>
2042 <xsl:when test="string($siblength) = """>
2043 <xsl:value-of select="$incurrent_length + 3 + string-length()"/>
2046 <xsl:value-of select="number($siblength)"/>
2051 <xsl:value-of select="$incurrent_length + 3 + string-length()"/>
2056 <xsl:template match="m:ci|m:csymbol" mode="charcount">
2057 <xsl:param name="incurrent_length" select="0"/>
2058 <xsl:param name="nosibling" select="0"/>
2060 <xsl:when test="$framewidth > ($incurrent_length + string-length()) and ($nosibling = 0)">
2061 <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>
2063 <xsl:when test="string($siblength) = """>
2064 <xsl:value-of select="$incurrent_length + string-length()"/>
2067 <xsl:value-of select="number($siblength)"/>
2072 <xsl:value-of select="$incurrent_length + string-length()"/>
2077 <xsl:template match="*" mode="charcount">
2078 <xsl:param name="incurrent_length" select="0"/>
2079 <xsl:param name="nosibling" select="0"/>
2081 <xsl:when test="count(child::*) = 0">
2082 <xsl:value-of select="$incurrent_length"/>
2085 <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>
2087 <xsl:when test="$framewidth > number($childlength) and ($nosibling = 0)">
2088 <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>
2090 <xsl:when test="string($siblength) = """>
2091 <xsl:value-of select="number($childlength)"/>
2094 <xsl:value-of select="number($siblength)"/>
2099 <xsl:value-of select="number($childlength)"/>