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 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
36 xmlns:m="http://www.w3.org/1998/Math/MathML"
37 xmlns:helm="http://www.cs.unibo.it/helm">
39 <xsl:import href="mml2mmlv1_0.xsl"/>
41 <!--***********************************************************************-->
42 <!-- Parameter affecting line-breaking -->
43 <!--***********************************************************************-->
45 <xsl:variable name="framewidth" select="35"/>
47 <!--***********************************************************************-->
48 <!-- Gli oggetti sono stampati come mtext all'interno di una marca toplevel-->
49 <!-- math ma al di fuori di semantics. Ora vi sono tanti semantics quanti -->
50 <!-- sono i termini: la presentation per un termine e' generata come primo -->
51 <!-- figlio di un semantics e l'originario content viene inserito nel -->
52 <!-- nel secondo figlio di semantics, annotation-xml -->
53 <!--***********************************************************************-->
55 <!--**********************-->
57 <!--**********************-->
59 <xsl:template match="/">
60 <xsl:processing-instruction name="cocoon-format">type="text/xhtml"</xsl:processing-instruction>
61 <xsl:apply-templates select="*"/>
66 <xsl:template match="Definition">
68 <m:mtable align="baseline 1" equalrows="false" columnalign="left" helm:xref="{@helm:xref}">
72 <m:mtext>DEFINITION <xsl:value-of select="@name"/>(<xsl:if test="string(./Params) != """><xsl:value-of select="Params"/></xsl:if>) OF TYPE</m:mtext>
79 <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
80 <xsl:apply-templates select="type/*[1]"/>
94 <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
95 <xsl:apply-templates select="body/*[1]"/>
105 <xsl:template match="Axiom">
107 <m:mtable align="baseline 1" equalrows="false" columnalign="left" helm:xref="{@helm:xref}">
111 <m:mtext>AXIOM <xsl:value-of select="@name"/>(<xsl:if test="string(./Params) != """><xsl:value-of select="Params"/></xsl:if>) OF TYPE</m:mtext>
118 <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
119 <xsl:apply-templates select="type/*[1]"/>
127 <!-- UNFINISHED PROOF -->
129 <xsl:template match="CurrentProof">
131 <m:mtable align="baseline 1" equalrows="false" columnalign="left" helm:xref="{@helm:xref}">
135 <m:mtext>UNFINISHED PROOF <xsl:value-of select="@name"/>(<xsl:if test="string(./Params) != """><xsl:value-of select="Params"/></xsl:if>)</m:mtext>
142 <m:mtext>THESIS:</m:mtext>
149 <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
150 <xsl:apply-templates select="type/*[1]"/>
157 <m:mtext>CONJECTURES:</m:mtext>
161 <xsl:for-each select="Conjecture">
165 <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
166 <m:mtext><xsl:value-of select="./@no"/>:</m:mtext>
167 <xsl:apply-templates select="./*[1]"/>
175 <m:mtext>CORRESPONDING PROOF:</m:mtext>
182 <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
183 <xsl:apply-templates select="body/*[1]"/>
191 <!-- MUTUAL INDUCTIVE DEFINITION -->
193 <xsl:template match="InductiveDefinition">
195 <m:mtable align="baseline 1" equalrows="false" columnalign="left" helm:xref="{@helm:xref}">
196 <xsl:for-each select="InductiveType">
201 <xsl:when test="position() = 1">
203 <xsl:when test="string(./@inductive) = "true"">
204 <m:mtext>INDUCTIVE DEFINITION</m:mtext>
207 <m:mtext>COINDUCTIVE DEFINITION</m:mtext>
212 <m:mtext>AND</m:mtext>
215 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
216 <m:mtext><xsl:value-of select="./@name"/>(<xsl:if test="string(../Params) != """><xsl:value-of select="../Params"/></xsl:if>)</m:mtext>
223 <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
226 <xsl:when test="string(../Param) != """>
227 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
228 <xsl:for-each select="../Param">
232 <m:mi><xsl:value-of select="./@name"/></m:mi>
234 <xsl:apply-templates select="*"/>
258 <m:mtext>OF ARITY</m:mtext>
265 <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
266 <xsl:apply-templates select="./arity/*[1]"/>
273 <m:mtext>BUILT FROM</m:mtext>
277 <xsl:for-each select="./Constructor">
282 <xsl:when test="position() = 1">
283 <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
287 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
290 <m:mtext><xsl:value-of select="./@name"/> OF</m:mtext>
291 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
292 <xsl:apply-templates select="./*[1]"/>
304 <xsl:template match="Variable">
306 <m:mtable align="baseline 1" equalrows="false" columnalign="left" helm:xref="{@helm:xref}">
310 <m:mtext>VARIABLE <xsl:value-of select="@name"/> OF TYPE</m:mtext>
317 <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
318 <xsl:apply-templates select="type/*[1]"/>
326 <!--**********************-->
328 <!--**********************-->
330 <xsl:template match="m:bvar">
332 <xsl:when test="m:type">
333 <xsl:variable name="charlength">
334 <xsl:apply-templates select="m:ci" mode="charcount"/>
337 <xsl:when test="$charlength >= $framewidth">
338 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
341 <xsl:apply-templates select="m:ci"/>
347 <xsl:apply-templates select="m:type"/>
353 <xsl:apply-templates select="m:ci"/>
355 <xsl:apply-templates select="m:type"/>
360 <xsl:apply-templates select="m:ci"/>
368 <xsl:template match="m:apply[m:csymbol]">
369 <xsl:variable name="name"><xsl:value-of select="m:csymbol"/></xsl:variable>
370 <xsl:variable name="charlength"><xsl:apply-templates select="m:csymbol" mode="charcount"/></xsl:variable>
372 <xsl:if test="@helm:xref">
373 <xsl:attribute name="helm:xref"><xsl:value-of select="@helm:xref"/></xsl:attribute>
376 <xsl:when test="$name='forall'">
378 <xsl:when test="$charlength >= $framewidth">
379 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
382 <m:mo color="Blue"><m:mchar name="ForAll"/></m:mo>
383 <xsl:apply-templates select="m:bvar"/>
390 <xsl:apply-templates select="*[position()=3]"/>
397 <m:mo color="Blue"><m:mchar name="ForAll"/></m:mo>
398 <xsl:apply-templates select="m:bvar/m:ci"/>
400 <xsl:apply-templates select="m:bvar/m:type"/>
402 <xsl:apply-templates select="*[position()=3]"/>
406 <xsl:when test="$name='prod'">
408 <xsl:when test="$charlength >= $framewidth">
409 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
412 <m:mo color="Blue">Π</m:mo>
413 <xsl:apply-templates select="m:bvar"/>
420 <xsl:apply-templates select="*[position()=3]"/>
427 <m:mo color="Blue">Π</m:mo>
428 <xsl:apply-templates select="m:bvar/m:ci"/>
430 <xsl:apply-templates select="m:bvar/m:type"/>
432 <xsl:apply-templates select="*[position()=3]"/>
436 <xsl:when test="$name='arrow'">
438 <xsl:when test="$charlength >= $framewidth">
439 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
443 <m:mo stretchy="false">(</m:mo>
444 <xsl:apply-templates select="*[position()=2]"/>
451 <m:mo color="Blue">→</m:mo>
452 <xsl:apply-templates select="*[position()=3]"/>
459 <m:mo stretchy="false">)</m:mo>
466 <m:mo stretchy="false">(</m:mo>
467 <xsl:apply-templates select="*[position()=2]"/>
468 <m:mo color="Blue">→</m:mo>
469 <xsl:apply-templates select="*[position()=3]"/>
470 <m:mo stretchy="false">)</m:mo>
474 <xsl:when test="$name='app'">
476 <xsl:when test="$charlength >= $framewidth">
477 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
481 <m:mo stretchy="false">(</m:mo>
482 <xsl:apply-templates select="*[position()=2]"/>
486 <xsl:for-each select="*[position()>2]">
490 <m:mphantom><m:mtext>(</m:mtext></m:mphantom>
491 <xsl:apply-templates select="."/>
499 <m:mo stretchy="false">)</m:mo>
506 <m:mo stretchy="false">(</m:mo>
507 <xsl:apply-templates select="*[position()=2]"/>
508 <xsl:for-each select="*[position()>2]">
509 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
510 <xsl:apply-templates select="."/>
512 <m:mo stretchy="false">)</m:mo>
516 <xsl:when test="$name='cast'">
518 <xsl:when test="$charlength >= $framewidth">
519 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
523 <m:mo stretchy="false">(</m:mo>
524 <xsl:apply-templates select="*[position()=2]"/>
531 <m:mo color="Maroon">:></m:mo>
532 <xsl:apply-templates select="*[position()=3]"/>
539 <m:mo stretchy="false">)</m:mo>
546 <m:mo stretchy="false">(</m:mo>
547 <xsl:apply-templates select="*[position()=2]"/>
548 <m:mo color="Maroon">:></m:mo>
549 <xsl:apply-templates select="*[position()=3]"/>
550 <m:mo stretchy="false">)</m:mo>
554 <xsl:when test="$name='Prop'">
557 <xsl:when test="$name='Set'">
560 <xsl:when test="$name='Type'">
563 <xsl:when test="$name='mutcase'">
565 <xsl:when test="$charlength >= $framewidth">
566 <xsl:variable name="charlength"><xsl:apply-templates select="*[position()=2]" mode="charcount"><xsl:with-param name="nosibling" select="1"/></xsl:apply-templates></xsl:variable>
567 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
572 <xsl:apply-templates select="*[position()=2]"/>
573 <xsl:if test="$framewidth > $charlength">
576 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
577 <xsl:apply-templates select="*[position()=3]"/>
582 <xsl:if test="$charlength >= $framewidth">
588 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
589 <xsl:apply-templates select="*[position()=3]"/>
601 <xsl:for-each select="*[position() mod 2 = 0 and position()>3]">
602 <xsl:variable name="charlength"><xsl:apply-templates select="." mode="charcount"><xsl:with-param name="nosibling" select="1"/></xsl:apply-templates></xsl:variable>
607 <xsl:when test="position() = 1">
608 <m:mphantom><m:mtext>|</m:mtext></m:mphantom>
611 <m:mo stretchy="false">|</m:mo>
614 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
615 <xsl:apply-templates select="."/>
616 <xsl:if test="$framewidth > $charlength">
617 <m:mo color="Green">⇒</m:mo>
618 <xsl:apply-templates select="following-sibling::*[position()= 1]"/>
623 <xsl:if test="$charlength >= $framewidth">
627 <m:mphantom><m:mtext>|_</m:mtext></m:mphantom>
628 <m:mo color="Green">⇒</m:mo>
629 <xsl:apply-templates select="following-sibling::*[position()= 1]"/>
645 <m:mo><</m:mo><xsl:apply-templates select="*[position()=2]"/><m:mo>></m:mo>
647 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
648 <xsl:apply-templates select="*[position()=3]"/>
649 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
651 <xsl:for-each select="*[position() mod 2 = 0 and position()>3]">
653 <xsl:when test="position() != 1">
654 <m:mo stretchy="false">|</m:mo>
657 <xsl:apply-templates select="."/>
658 <m:mo color="Green">⇒</m:mo>
659 <xsl:apply-templates select="following-sibling::*[position()= 1]"/>
661 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
666 <xsl:when test="$name='fix'">
668 <xsl:when test="$charlength >= $framewidth">
669 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
674 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
675 <m:mi><xsl:value-of select="m:ci"/></m:mi>
676 <m:mo stretchy="false">{</m:mo>
683 <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
684 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
685 <xsl:for-each select="m:bvar">
686 <xsl:variable name="charlength"><xsl:apply-templates select="m:type" mode="charcount"><xsl:with-param name="nosibling" select="1"/></xsl:apply-templates></xsl:variable>
690 <m:mi><xsl:value-of select="m:ci"/></m:mi>
692 <xsl:if test="$framewidth > $charlength">
693 <xsl:apply-templates select="m:type"/>
698 <xsl:if test="$charlength >= $framewidth">
702 <m:mphantom><m:mtext>:=</m:mtext></m:mphantom>
703 <xsl:apply-templates select="m:type"/>
712 <xsl:apply-templates select="following-sibling::*[position()=1]"/>
724 <m:mo stretchy="false">}</m:mo>
732 <m:mi><xsl:value-of select="m:ci"/></m:mi>
733 <m:mo stretchy="false">{</m:mo>
734 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
735 <xsl:for-each select="m:bvar">
739 <m:mi><xsl:value-of select="m:ci"/></m:mi>
741 <xsl:apply-templates select="m:type"/>
743 <xsl:apply-templates select="following-sibling::*[position() = 1]"/>
744 <xsl:if test="position()=last()">
745 <m:mo stretchy="false">}</m:mo>
755 <xsl:when test="$name='cofix'">
757 <xsl:when test="$charlength >= $framewidth">
758 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
763 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
764 <m:mi><xsl:value-of select="m:ci"/></m:mi>
765 <m:mo stretchy="false">{</m:mo>
772 <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
773 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
774 <xsl:for-each select="m:bvar">
775 <xsl:variable name="charlength"><xsl:apply-templates select="m:type" mode="charcount"><xsl:with-param name="nosibling" select="1"/></xsl:apply-templates></xsl:variable>
779 <m:mi><xsl:value-of select="m:ci"/></m:mi>
781 <xsl:if test="$framewidth > $charlength">
782 <xsl:apply-templates select="m:type"/>
787 <xsl:if test="$charlength >= $framewidth">
791 <m:mphantom><m:mtext>:=</m:mtext></m:mphantom>
792 <xsl:apply-templates select="m:type"/>
801 <xsl:apply-templates select="following-sibling::*[position() = 1]"/>
813 <m:mo stretchy="false">}</m:mo>
821 <m:mi><xsl:value-of select="m:ci"/></m:mi>
822 <m:mo stretchy="false">{</m:mo>
823 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
824 <xsl:for-each select="m:bvar">
828 <m:mi><xsl:value-of select="m:ci"/></m:mi>
830 <xsl:apply-templates select="m:type"/>
832 <xsl:apply-templates select="following-sibling::*[position() = 1]"/>
833 <xsl:if test="position()=last()">
834 <m:mo stretchy="false">}</m:mo>
844 <!-- ***************************************** -->
845 <!-- *********** PROOF ELEMENTS ************** -->
846 <!-- ***************************************** -->
847 <xsl:when test="$name='proof'">
848 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
852 <xsl:apply-templates select="*[position()=2]"/>
859 <m:mtext color="Maroon">we proved </m:mtext>
860 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
861 <xsl:apply-templates select="*[position()=3]"/>
867 <xsl:when test="$name='letin'">
868 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
869 <!-- <xsl:for-each select="APPLY[m:csymbol and (string(m:csymbol)='let')]"> -->
870 <xsl:for-each select="*[(last() > position()) and (position()>1)]">
874 <xsl:apply-templates select="."/>
882 <xsl:apply-templates select="*[position()=last()]"/>
888 <xsl:when test="$name='let'">
890 <xsl:apply-templates select="m:ci"/>
891 <m:mtext>) </m:mtext>
892 <xsl:apply-templates select="*[3]"/>
894 <xsl:when test="$name='thread'">
895 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
900 <xsl:when test="name(*[last()])='m:apply'">
901 <xsl:apply-templates select="*[last()]"/>
904 <m:mtext>Consider </m:mtext>
905 <xsl:apply-templates select="*[last()]"/>
911 <xsl:apply-templates mode="thread" select="*[(last()-2)]"/>
914 <xsl:when test="$name='rewrite_and_apply'">
919 <m:mtext>Rewrite</m:mtext>
920 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
921 <xsl:apply-templates select="*[2]/*[2]"/>
922 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
923 <m:mtext>with</m:mtext>
924 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
925 <xsl:apply-templates select="*[2]/*[3]"/>
926 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
927 <m:mtext>by</m:mtext>
928 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
929 <xsl:apply-templates select="*[2]/*[4]"/>
930 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
931 <m:mtext>in</m:mtext>
932 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
933 <xsl:apply-templates select="*[3]"/>
934 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
935 <m:mtext>and apply to</m:mtext>
936 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
937 <xsl:apply-templates select="*[position()>3]"/>
943 <xsl:when test="$name='and_ind'">
944 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
949 <xsl:when test="name(*[2])='m:apply'">
950 <xsl:apply-templates select="*[2]"/>
953 <m:mtext>Consider </m:mtext>
954 <xsl:apply-templates select="*[2]"/>
962 <m:mtext>In particular, we have</m:mtext>
969 <xsl:apply-templates select="*[3]"/>
971 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
972 <xsl:apply-templates select="*[4]"/>
980 <xsl:apply-templates select="*[5]"/>
982 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
983 <xsl:apply-templates select="*[6]"/>
990 <xsl:apply-templates select="*[7]"/>
996 <xsl:when test="$name='or_ind'">
997 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1002 <xsl:when test="name(*[2])='m:apply'">
1003 <xsl:apply-templates select="*[2]"/>
1006 <m:mtext>Consider</m:mtext>
1007 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1008 <xsl:apply-templates select="*[2]"/>
1016 <m:mtext>We prove</m:mtext>
1017 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1018 <xsl:apply-templates select="*[3]"/>
1019 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1020 <m:mtext>by cases:</m:mtext>
1026 <m:mtext>*</m:mtext>
1027 <xsl:apply-templates select="*[4]"/>
1034 <m:mtext>*</m:mtext>
1035 <xsl:apply-templates select="*[5]"/>
1048 <xsl:template match="*" mode="thread">
1049 <xsl:variable name="name"><xsl:value-of select="following-sibling::*[position()=1]/m:csymbol"/></xsl:variable>
1051 <xsl:when test="$name='rw_step'">
1055 <m:mtext>Rewrite</m:mtext>
1056 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1057 <xsl:apply-templates select="following-sibling::*[position()=1]/*[2]"/>
1058 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1059 <m:mtext>with</m:mtext>
1060 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1061 <xsl:apply-templates select="following-sibling::*[position()=1]/*[3]"/>
1062 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1063 <m:mtext>by</m:mtext>
1064 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1065 <xsl:apply-templates select="following-sibling::*[position()=1]/*[4]"/>
1072 <m:mtext color="Maroon">we get</m:mtext>
1073 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1074 <xsl:apply-templates select="."/>
1083 <xsl:apply-templates select="following-sibling::*[position()=1]"/>
1090 <m:mtext color="Maroon">we get</m:mtext>
1091 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1092 <xsl:apply-templates select="."/>
1098 <xsl:apply-templates mode="thread" select="preceding-sibling::*[position()=2]"/>
1104 <xsl:template match="m:lambda">
1105 <xsl:variable name="charlength"><xsl:apply-templates select="*[position()=1]" mode="charcount"/></xsl:variable>
1106 <m:mrow helm:xref="{@helm:xref}">
1108 <xsl:when test="$charlength >= $framewidth">
1109 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1112 <m:mo color="Red">λ</m:mo>
1113 <xsl:apply-templates select="m:bvar"/>
1120 <xsl:apply-templates select="*[position()=2]"/>
1127 <m:mo color="Red">λ</m:mo>
1128 <xsl:apply-templates select="m:bvar/m:ci"/>
1130 <xsl:apply-templates select="m:bvar/m:type"/>
1132 <xsl:apply-templates select="*[position()=2]"/>
1138 <!-- *********************************** -->
1139 <!-- BASE SET OF MATHML CONTENT ELEMENTS -->
1140 <!-- *********************************** -->
1144 <xsl:template match = "m:apply[m:eq[1]]">
1145 <xsl:variable name="charlength">
1146 <xsl:apply-templates select="*[1]" mode="charcount"/>
1149 <xsl:when test="$charlength >= $framewidth">
1150 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1151 <xsl:if test="@helm:xref">
1152 <xsl:attribute name="helm:xref">
1153 <xsl:value-of select="@helm:xref"/>
1158 <m:mo stretchy="false">(</m:mo>
1159 <xsl:apply-templates select="*[position()=2]"/>
1162 <xsl:for-each select = "*[position()>2]">
1165 <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
1166 <m:mo helm:xref="m:in/@helm:xref">
1169 <xsl:apply-templates select="."/>
1175 <m:mo stretchy="false">)</m:mo>
1181 <xsl:apply-imports/>
1187 <xsl:template match = "m:apply[m:and[1]|m:or[1]
1188 |m:geq[1]|m:leq[1]|m:gt[1]|m:lt[1]
1189 |m:in[1]|m:intesect[1]|m:union[1]|m:subset[1]
1190 |m:prsubset|m:setdiff[1]]">
1191 <xsl:variable name="symbol">
1193 <xsl:when test="m:and[1]">
1194 <xsl:value-of select="'wedge'"/>
1196 <xsl:when test="m:or[1]">
1197 <xsl:value-of select="'vee'"/>
1199 <xsl:when test="m:geq[1]">
1200 <xsl:value-of select="'geq'"/>
1202 <xsl:when test="m:leq[1]">
1203 <xsl:value-of select="'leq'"/>
1205 <xsl:when test="m:gt[1]">
1206 <xsl:value-of select="'gt'"/>
1208 <xsl:when test="m:lt[1]">
1209 <xsl:value-of select="'lt'"/>
1211 <xsl:when test="m:eq[1]">
1212 <xsl:value-of select="'Equal'"/>
1214 <xsl:when test="m:in[1]">
1215 <xsl:value-of select="'Element'"/>
1217 <xsl:when test="m:subset[1]">
1218 <xsl:value-of select="'SubsetEqual'"/>
1220 <xsl:when test="m:prsubset[1]">
1221 <xsl:value-of select="'subset'"/>
1223 <xsl:when test="m:intersect[1]">
1224 <xsl:value-of select="'Intersection'"/>
1226 <xsl:when test="m:union[1]">
1227 <xsl:value-of select="'Union'"/>
1229 <xsl:when test="m:setdiff[1]">
1230 <xsl:value-of select="'Backslash'"/>
1234 <xsl:variable name="charlength">
1235 <xsl:apply-templates select="*[1]" mode="charcount"/>
1238 <xsl:when test="$charlength >= $framewidth">
1239 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1240 <xsl:if test="@helm:xref">
1241 <xsl:attribute name="helm:xref">
1242 <xsl:value-of select="@helm:xref"/>
1247 <m:mo stretchy="false">(</m:mo>
1248 <xsl:apply-templates select="*[position()=2]"/>
1251 <xsl:for-each select = "*[position()>2]">
1254 <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
1255 <m:mo helm:xref="{*[1]/@helm:xref}">
1256 <m:mchar name="{$symbol}"/>
1258 <xsl:apply-templates select="."/>
1264 <m:mo stretchy="false">)</m:mo>
1270 <xsl:apply-imports/>
1275 <xsl:template match = "m:set">
1277 <xsl:when test="count(child::*) = 0">
1279 <m:mchar name="emptyset"/>
1283 <xsl:variable name="charlength">
1284 <xsl:apply-templates select="*[1]" mode="charcount"/>
1287 <xsl:when test="$charlength >= $framewidth">
1289 <xsl:when test="name(*[1]) = 'm:bvar'">
1290 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1293 <m:mo stretchy="false">{</m:mo>
1294 <xsl:apply-templates select="*[position()=1]"/>
1299 <m:mphantom><m:mtext>{</m:mtext></m:mphantom>
1300 <m:mo stretchy="false">|</m:mo>
1301 <xsl:apply-templates select="m:condition/*[1]"/>
1306 <m:mo stretchy="false">}</m:mo>
1312 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1315 <m:mo stretchy="false">{</m:mo>
1316 <xsl:apply-templates select="*[position()=1]"/>
1317 <xsl:if test="position() != last()">
1322 <xsl:for-each select = "*[position()>2]">
1325 <m:mphantom><m:mtext>{</m:mtext></m:mphantom>
1326 <xsl:apply-templates select="."/>
1327 <xsl:if test="position() != last()">
1335 <m:mo stretchy="false">}</m:mo>
1343 <xsl:apply-imports/>
1350 <xsl:template match = "m:apply[m:card[1]]">
1351 <m:mo stretchy="false">|</m:mo>
1352 <xsl:apply-templates select="*[2]"/>
1353 <m:mo stretchy="false">|</m:mo>
1356 <!-- *********************************** -->
1357 <!-- PROOF ELEMENTS -->
1358 <!-- *********************************** -->
1362 <!--**********************-->
1364 <!--**********************-->
1366 <xsl:template match="m:cn|m:and|m:or|m:not|m:exists|m:eq|m:lt|m:leq|m:gt|m:geq
1367 |m:in|m:notin|m:intersect|m:union|m:subset|m:prsubset|m:card|m:setdiff
1368 |m:plus|m:minus|m:times" mode="charcount">
1369 <xsl:param name="incurrent_length" select="0"/>
1371 <xsl:when test="$framewidth > ($incurrent_length + 3 + string-length())">
1372 <xsl:variable name="siblength">
1373 <xsl:apply-templates select="following-sibling::*[position()=1]" mode="charcount">
1374 <xsl:with-param name="incurrent_length" select="$incurrent_length + string-length()"/>
1375 </xsl:apply-templates>
1378 <xsl:when test="string($siblength) = """>
1379 <xsl:value-of select="$incurrent_length + 3 + string-length()"/>
1382 <xsl:value-of select="number($siblength)"/>
1387 <xsl:value-of select="$incurrent_length + 3 + string-length()"/>
1392 <xsl:template match="m:ci|m:csymbol" mode="charcount">
1393 <xsl:param name="incurrent_length" select="0"/>
1394 <xsl:param name="nosibling" select="0"/>
1396 <xsl:when test="$framewidth > ($incurrent_length + string-length()) and ($nosibling = 0)">
1397 <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>
1399 <xsl:when test="string($siblength) = """>
1400 <xsl:value-of select="$incurrent_length + string-length()"/>
1403 <xsl:value-of select="number($siblength)"/>
1408 <xsl:value-of select="$incurrent_length + string-length()"/>
1413 <xsl:template match="*" mode="charcount">
1414 <xsl:param name="incurrent_length" select="0"/>
1415 <xsl:param name="nosibling" select="0"/>
1417 <xsl:when test="count(child::*) = 0">
1418 <xsl:value-of select="$incurrent_length"/>
1421 <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>
1423 <xsl:when test="$framewidth > number($childlength) and ($nosibling = 0)">
1424 <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>
1426 <xsl:when test="string($siblength) = """>
1427 <xsl:value-of select="number($childlength)"/>
1430 <xsl:value-of select="number($siblength)"/>
1435 <xsl:value-of select="number($childlength)"/>