3 <!--***********************************************************************-->
4 <!-- Extension to the XSLT version 0.07 of MathML content to presentation: -->
5 <!-- First draft: February 19 2000, Andrea Asperti, Irene Schena -->
6 <!-- Revised: March 3 2000, Irene Schena -->
7 <!-- Revised: March 15 2000, Claudio Sacerdoti Coen, Irene Schena -->
8 <!-- Revised: March 21 2000, Irene Schena -->
9 <!--***********************************************************************-->
11 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
12 xmlns:m="http://www.w3.org/1998/Math/MathML"
13 xmlns:helm="http://www.cs.unibo.it/helm">
15 <xsl:import href="mml2mmlv1_0.xsl"/>
17 <!--***********************************************************************-->
18 <!-- Parameter affecting line-breaking -->
19 <!--***********************************************************************-->
21 <xsl:variable name="framewidth" select="30"/>
23 <!--***********************************************************************-->
24 <!-- Gli oggetti sono stampati come mtext all'interno di una marca toplevel-->
25 <!-- math ma al di fuori di semantics. Ora vi sono tanti semantics quanti -->
26 <!-- sono i termini: la presentation per un termine e' generata come primo -->
27 <!-- figlio di un semantics e l'originario content viene inserito nel -->
28 <!-- nel secondo figlio di semantics, annotation-xml -->
29 <!--***********************************************************************-->
31 <!--**********************-->
33 <!--**********************-->
35 <xsl:template match="/">
36 <xsl:processing-instruction name="cocoon-format">type="text/xhtml"</xsl:processing-instruction>
37 <xsl:apply-templates select="*"/>
42 <xsl:template match="Definition">
44 <m:mtable align="baseline 1" equalrows="false" columnalign="left" helm:xref="{@helm:xref}">
48 <m:mtext>DEFINITION <xsl:value-of select="@name"/>(<xsl:if test="string(./Params) != """><xsl:value-of select="Params"/></xsl:if>) OF TYPE</m:mtext>
55 <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
56 <xsl:apply-templates select="type/*[1]"/>
70 <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
71 <xsl:apply-templates select="body/*[1]"/>
81 <xsl:template match="Axiom">
83 <m:mtable align="baseline 1" equalrows="false" columnalign="left" helm:xref="{@helm:xref}">
87 <m:mtext>AXIOM <xsl:value-of select="@name"/>(<xsl:if test="string(./Params) != """><xsl:value-of select="Params"/></xsl:if>) OF TYPE</m:mtext>
94 <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
95 <xsl:apply-templates select="type/*[1]"/>
103 <!-- UNFINISHED PROOF -->
105 <xsl:template match="CurrentProof">
107 <m:mtable align="baseline 1" equalrows="false" columnalign="left" helm:xref="{@helm:xref}">
111 <m:mtext>UNFINISHED PROOF <xsl:value-of select="@name"/>(<xsl:if test="string(./Params) != """><xsl:value-of select="Params"/></xsl:if>)</m:mtext>
118 <m:mtext>THESIS:</m:mtext>
125 <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
126 <xsl:apply-templates select="type/*[1]"/>
133 <m:mtext>CONJECTURES:</m:mtext>
137 <xsl:for-each select="Conjecture">
141 <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
142 <m:mtext><xsl:value-of select="./@no"/>:</m:mtext>
143 <xsl:apply-templates select="./*[1]"/>
151 <m:mtext>CORRESPONDING PROOF:</m:mtext>
158 <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
159 <xsl:apply-templates select="body/*[1]"/>
167 <!-- MUTUAL INDUCTIVE DEFINITION -->
169 <xsl:template match="InductiveDefinition">
171 <m:mtable align="baseline 1" equalrows="false" columnalign="left" helm:xref="{@helm:xref}">
172 <xsl:for-each select="InductiveType">
177 <xsl:when test="position() = 1">
179 <xsl:when test="string(./@inductive) = "true"">
180 <m:mtext>INDUCTIVE DEFINITION</m:mtext>
183 <m:mtext>COINDUCTIVE DEFINITION</m:mtext>
188 <m:mtext>AND</m:mtext>
191 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
192 <m:mtext><xsl:value-of select="./@name"/>(<xsl:if test="string(../Params) != """><xsl:value-of select="../Params"/></xsl:if>)</m:mtext>
199 <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
202 <xsl:when test="string(../Param) != """>
203 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
204 <xsl:for-each select="../Param">
208 <m:mi><xsl:value-of select="./@name"/></m:mi>
210 <xsl:apply-templates select="*"/>
234 <m:mtext>OF ARITY</m:mtext>
241 <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
242 <xsl:apply-templates select="./arity/*[1]"/>
249 <m:mtext>BUILT FROM</m:mtext>
253 <xsl:for-each select="./Constructor">
258 <xsl:when test="position() = 1">
259 <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
263 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
266 <m:mtext><xsl:value-of select="./@name"/> OF</m:mtext>
267 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
268 <xsl:apply-templates select="./*[1]"/>
280 <xsl:template match="Variable">
282 <m:mtable align="baseline 1" equalrows="false" columnalign="left" helm:xref="{@helm:xref}">
286 <m:mtext>VARIABLE <xsl:value-of select="@name"/> OF TYPE</m:mtext>
293 <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
294 <xsl:apply-templates select="type/*[1]"/>
302 <!--**********************-->
304 <!--**********************-->
306 <xsl:template match="m:bvar">
308 <xsl:when test="m:type">
309 <xsl:variable name="charlength">
310 <xsl:apply-templates select="m:ci" mode="charcount"/>
313 <xsl:when test="$charlength >= $framewidth">
314 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
317 <xsl:apply-templates select="m:ci"/>
323 <xsl:apply-templates select="m:type"/>
329 <xsl:apply-templates select="m:ci"/>
331 <xsl:apply-templates select="m:type"/>
336 <xsl:apply-templates select="m:ci"/>
344 <xsl:template match="m:apply[m:csymbol]">
345 <xsl:variable name="name"><xsl:value-of select="m:csymbol"/></xsl:variable>
346 <xsl:variable name="charlength"><xsl:apply-templates select="m:csymbol" mode="charcount"/></xsl:variable>
348 <xsl:if test="@helm:xref">
349 <xsl:attribute name="helm:xref"><xsl:value-of select="@helm:xref"/></xsl:attribute>
352 <xsl:when test="$name='prod'">
354 <xsl:when test="$charlength >= $framewidth">
355 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
358 <m:mo color="Blue">Π</m:mo>
359 <xsl:apply-templates select="m:bvar"/>
366 <xsl:apply-templates select="*[position()=3]"/>
373 <m:mo color="Blue">Π</m:mo>
374 <xsl:apply-templates select="m:bvar/m:ci"/>
376 <xsl:apply-templates select="m:bvar/m:type"/>
378 <xsl:apply-templates select="*[position()=3]"/>
382 <xsl:when test="$name='arrow'">
384 <xsl:when test="$charlength >= $framewidth">
385 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
389 <m:mo stretchy="false">(</m:mo>
390 <xsl:apply-templates select="*[position()=2]"/>
397 <m:mo color="Blue">→</m:mo>
398 <xsl:apply-templates select="*[position()=3]"/>
405 <m:mo stretchy="false">)</m:mo>
412 <m:mo stretchy="false">(</m:mo>
413 <xsl:apply-templates select="*[position()=2]"/>
414 <m:mo color="Blue">→</m:mo>
415 <xsl:apply-templates select="*[position()=3]"/>
416 <m:mo stretchy="false">)</m:mo>
420 <xsl:when test="$name='app'">
422 <xsl:when test="$charlength >= $framewidth">
423 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
427 <m:mo stretchy="false">(</m:mo>
428 <xsl:apply-templates select="*[position()=2]"/>
432 <xsl:for-each select="*[position()>2]">
436 <m:mphantom><m:mtext>(</m:mtext></m:mphantom>
437 <xsl:apply-templates select="."/>
445 <m:mo stretchy="false">)</m:mo>
452 <m:mo stretchy="false">(</m:mo>
453 <xsl:apply-templates select="*[position()=2]"/>
454 <xsl:for-each select="*[position()>2]">
455 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
456 <xsl:apply-templates select="."/>
458 <m:mo stretchy="false">)</m:mo>
462 <xsl:when test="$name='cast'">
464 <xsl:when test="$charlength >= $framewidth">
465 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
469 <m:mo stretchy="false">(</m:mo>
470 <xsl:apply-templates select="*[position()=2]"/>
477 <m:mo color="#b03060">:></m:mo>
478 <xsl:apply-templates select="*[position()=3]"/>
485 <m:mo stretchy="false">)</m:mo>
492 <m:mo stretchy="false">(</m:mo>
493 <xsl:apply-templates select="*[position()=2]"/>
494 <m:mo color="#b03060">:></m:mo>
495 <xsl:apply-templates select="*[position()=3]"/>
496 <m:mo stretchy="false">)</m:mo>
500 <xsl:when test="$name='Prop'">
503 <xsl:when test="$name='Set'">
506 <xsl:when test="$name='Type'">
509 <xsl:when test="$name='mutcase'">
511 <xsl:when test="$charlength >= $framewidth">
512 <xsl:variable name="charlength"><xsl:apply-templates select="*[position()=2]" mode="charcount"><xsl:with-param name="nosibling" select="1"/></xsl:apply-templates></xsl:variable>
513 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
518 <xsl:apply-templates select="*[position()=2]"/>
519 <xsl:if test="$framewidth > $charlength">
522 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
523 <xsl:apply-templates select="*[position()=3]"/>
528 <xsl:if test="$charlength >= $framewidth">
534 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
535 <xsl:apply-templates select="*[position()=3]"/>
547 <xsl:for-each select="*[position() mod 2 = 0 and position()>3]">
548 <xsl:variable name="charlength"><xsl:apply-templates select="." mode="charcount"><xsl:with-param name="nosibling" select="1"/></xsl:apply-templates></xsl:variable>
553 <xsl:when test="position() = 1">
554 <m:mphantom><m:mtext>|</m:mtext></m:mphantom>
557 <m:mo stretchy="false">|</m:mo>
560 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
561 <xsl:apply-templates select="."/>
562 <xsl:if test="$framewidth > $charlength">
563 <m:mo color="Green">⇒</m:mo>
564 <xsl:apply-templates select="following-sibling::*[position()= 1]"/>
569 <xsl:if test="$charlength >= $framewidth">
573 <m:mphantom><m:mtext>|_</m:mtext></m:mphantom>
574 <m:mo color="Green">⇒</m:mo>
575 <xsl:apply-templates select="following-sibling::*[position()= 1]"/>
591 <m:mo><</m:mo><xsl:apply-templates select="*[position()=2]"/><m:mo>></m:mo>
593 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
594 <xsl:apply-templates select="*[position()=3]"/>
595 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
597 <xsl:for-each select="*[position() mod 2 = 0 and position()>3]">
599 <xsl:when test="position() != 1">
600 <m:mo stretchy="false">|</m:mo>
603 <xsl:apply-templates select="."/>
604 <m:mo color="Green">⇒</m:mo>
605 <xsl:apply-templates select="following-sibling::*[position()= 1]"/>
607 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
612 <xsl:when test="$name='fix'">
614 <xsl:when test="$charlength >= $framewidth">
615 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
620 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
621 <m:mi><xsl:value-of select="m:ci"/></m:mi>
622 <m:mo stretchy="false">{</m:mo>
629 <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
630 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
631 <xsl:for-each select="m:bvar">
632 <xsl:variable name="charlength"><xsl:apply-templates select="m:type" mode="charcount"><xsl:with-param name="nosibling" select="1"/></xsl:apply-templates></xsl:variable>
636 <m:mi><xsl:value-of select="m:ci"/></m:mi>
638 <xsl:if test="$framewidth > $charlength">
639 <xsl:apply-templates select="m:type"/>
644 <xsl:if test="$charlength >= $framewidth">
648 <m:mphantom><m:mtext>:=</m:mtext></m:mphantom>
649 <xsl:apply-templates select="m:type"/>
658 <xsl:apply-templates select="following-sibling::*[position()=1]"/>
670 <m:mo stretchy="false">}</m:mo>
678 <m:mi><xsl:value-of select="m:ci"/></m:mi>
679 <m:mo stretchy="false">{</m:mo>
680 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
681 <xsl:for-each select="m:bvar">
685 <m:mi><xsl:value-of select="m:ci"/></m:mi>
687 <xsl:apply-templates select="m:type"/>
689 <xsl:apply-templates select="following-sibling::*[position() = 1]"/>
690 <xsl:if test="position()=last()">
691 <m:mo stretchy="false">}</m:mo>
701 <xsl:when test="$name='cofix'">
703 <xsl:when test="$charlength >= $framewidth">
704 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
709 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
710 <m:mi><xsl:value-of select="m:ci"/></m:mi>
711 <m:mo stretchy="false">{</m:mo>
718 <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
719 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
720 <xsl:for-each select="m:bvar">
721 <xsl:variable name="charlength"><xsl:apply-templates select="m:type" mode="charcount"><xsl:with-param name="nosibling" select="1"/></xsl:apply-templates></xsl:variable>
725 <m:mi><xsl:value-of select="m:ci"/></m:mi>
727 <xsl:if test="$framewidth > $charlength">
728 <xsl:apply-templates select="m:type"/>
733 <xsl:if test="$charlength >= $framewidth">
737 <m:mphantom><m:mtext>:=</m:mtext></m:mphantom>
738 <xsl:apply-templates select="m:type"/>
747 <xsl:apply-templates select="following-sibling::*[position() = 1]"/>
759 <m:mo stretchy="false">}</m:mo>
767 <m:mi><xsl:value-of select="m:ci"/></m:mi>
768 <m:mo stretchy="false">{</m:mo>
769 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
770 <xsl:for-each select="m:bvar">
774 <m:mi><xsl:value-of select="m:ci"/></m:mi>
776 <xsl:apply-templates select="m:type"/>
778 <xsl:apply-templates select="following-sibling::*[position() = 1]"/>
779 <xsl:if test="position()=last()">
780 <m:mo stretchy="false">}</m:mo>
790 <!-- ***************************************** -->
791 <!-- *********** PROOF ELEMENTS ************** -->
792 <!-- ***************************************** -->
793 <xsl:when test="$name='proof'">
794 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
798 <xsl:apply-templates select="*[position()=2]"/>
805 <m:mtext color="#b03060">we proved </m:mtext>
806 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
807 <xsl:apply-templates select="*[position()=3]"/>
813 <xsl:when test="$name='letin'">
814 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
815 <!-- <xsl:for-each select="APPLY[m:csymbol and (string(m:csymbol)='let')]"> -->
816 <xsl:for-each select="*[(last() > position()) and (position()>1)]">
820 <xsl:apply-templates select="."/>
828 <xsl:apply-templates select="*[position()=last()]"/>
834 <xsl:when test="$name='let'">
836 <xsl:apply-templates select="m:ci"/>
837 <m:mtext>) </m:mtext>
838 <xsl:apply-templates select="*[3]"/>
840 <xsl:when test="$name='thread'">
841 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
846 <xsl:when test="name(*[last()])='m:apply'">
847 <xsl:apply-templates select="*[last()]"/>
850 <m:mtext>Consider </m:mtext>
851 <xsl:apply-templates select="*[last()]"/>
857 <xsl:apply-templates mode="thread" select="*[(last()-2)]"/>
860 <xsl:when test="$name='rewrite_and_apply'">
865 <m:mtext>Rewrite</m:mtext>
866 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
867 <xsl:apply-templates select="*[2]/*[2]"/>
868 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
869 <m:mtext>with</m:mtext>
870 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
871 <xsl:apply-templates select="*[2]/*[3]"/>
872 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
873 <m:mtext>by</m:mtext>
874 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
875 <xsl:apply-templates select="*[2]/*[4]"/>
876 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
877 <m:mtext>in</m:mtext>
878 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
879 <xsl:apply-templates select="*[3]"/>
880 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
881 <m:mtext>and apply</m:mtext>
882 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
883 <xsl:apply-templates select="*[position()>3]"/>
889 <xsl:when test="$name='and_ind'">
890 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
895 <xsl:when test="name(*[2])='m:apply'">
896 <xsl:apply-templates select="*[2]"/>
899 <m:mtext>Consider </m:mtext>
900 <xsl:apply-templates select="*[2]"/>
908 <m:mtext>In particular, we have</m:mtext>
915 <xsl:apply-templates select="*[3]"/>
917 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
918 <xsl:apply-templates select="*[4]"/>
926 <xsl:apply-templates select="*[5]"/>
928 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
929 <xsl:apply-templates select="*[6]"/>
936 <xsl:apply-templates select="*[7]"/>
942 <xsl:when test="$name='or_ind'">
943 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
948 <xsl:when test="name(*[2])='m:apply'">
949 <xsl:apply-templates select="*[2]"/>
952 <m:mtext>Consider</m:mtext>
953 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
954 <xsl:apply-templates select="*[2]"/>
962 <m:mtext>We prove</m:mtext>
963 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
964 <xsl:apply-templates select="*[3]"/>
965 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
966 <m:mtext>by cases:</m:mtext>
973 <xsl:apply-templates select="*[4]"/>
981 <xsl:apply-templates select="*[5]"/>
994 <xsl:template match="*" mode="thread">
995 <xsl:variable name="name"><xsl:value-of select="following-sibling::*[position()=1]/m:csymbol"/></xsl:variable>
997 <xsl:when test="$name='rw_step'">
1001 <m:mtext>Rewrite</m:mtext>
1002 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1003 <xsl:apply-templates select="following-sibling::*[position()=1]/*[2]"/>
1004 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1005 <m:mtext>with</m:mtext>
1006 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1007 <xsl:apply-templates select="following-sibling::*[position()=1]/*[3]"/>
1008 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1009 <m:mtext>by</m:mtext>
1010 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1011 <xsl:apply-templates select="following-sibling::*[position()=1]/*[4]"/>
1018 <m:mtext color="#b03060">we get</m:mtext>
1019 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1020 <xsl:apply-templates select="."/>
1029 <xsl:apply-templates select="following-sibling::*[position()=1]"/>
1036 <m:mtext color="#b03060">we get</m:mtext>
1037 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1038 <xsl:apply-templates select="."/>
1044 <xsl:apply-templates mode="thread" select="preceding-sibling::*[position()=2]"/>
1050 <xsl:template match="m:lambda">
1051 <xsl:variable name="charlength"><xsl:apply-templates select="*[position()=1]" mode="charcount"/></xsl:variable>
1052 <m:mrow helm:xref="{@helm:xref}">
1054 <xsl:when test="$charlength >= $framewidth">
1055 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1058 <m:mo color="Red">λ</m:mo>
1059 <xsl:apply-templates select="m:bvar"/>
1066 <xsl:apply-templates select="*[position()=2]"/>
1073 <m:mo color="Red">λ</m:mo>
1074 <xsl:apply-templates select="m:bvar/m:ci"/>
1076 <xsl:apply-templates select="m:bvar/m:type"/>
1078 <xsl:apply-templates select="*[position()=2]"/>
1084 <!-- *********************************** -->
1085 <!-- BASE SET OF MATHML CONTENT ELEMENTS -->
1086 <!-- *********************************** -->
1090 <xsl:template match = "m:apply[m:eq[1]]">
1091 <xsl:variable name="charlength">
1092 <xsl:apply-templates select="*[1]" mode="charcount"/>
1095 <xsl:when test="$charlength >= $framewidth">
1096 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1097 <xsl:if test="@helm:xref">
1098 <xsl:attribute name="helm:xref">
1099 <xsl:value-of select="@helm:xref"/>
1104 <m:mo stretchy="false">(</m:mo>
1105 <xsl:apply-templates select="*[position()=2]"/>
1108 <xsl:for-each select = "*[position()>2]">
1111 <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
1112 <m:mo helm:xref="m:in/@helm:xref">
1115 <xsl:apply-templates select="."/>
1121 <m:mo stretchy="false">)</m:mo>
1127 <xsl:apply-imports/>
1133 <xsl:template match = "m:apply[m:and[1]|m:or[1]
1134 |m:geq[1]|m:leq[1]|m:gt[1]|m:lt[1]
1135 |m:in[1]|m:intesect[1]|m:union[1]|m:subset[1]
1136 |m:prsubset|m:setdiff[1]]">
1137 <xsl:variable name="symbol">
1139 <xsl:when test="m:and[1]">
1140 <xsl:value-of select="'wedge'"/>
1142 <xsl:when test="m:or[1]">
1143 <xsl:value-of select="'vee'"/>
1145 <xsl:when test="m:geq[1]">
1146 <xsl:value-of select="'geq'"/>
1148 <xsl:when test="m:leq[1]">
1149 <xsl:value-of select="'leq'"/>
1151 <xsl:when test="m:gt[1]">
1152 <xsl:value-of select="'gt'"/>
1154 <xsl:when test="m:lt[1]">
1155 <xsl:value-of select="'lt'"/>
1157 <xsl:when test="m:eq[1]">
1158 <xsl:value-of select="'Equal'"/>
1160 <xsl:when test="m:in[1]">
1161 <xsl:value-of select="'Element'"/>
1163 <xsl:when test="m:subset[1]">
1164 <xsl:value-of select="'SubsetEqual'"/>
1166 <xsl:when test="m:prsubset[1]">
1167 <xsl:value-of select="'subset'"/>
1169 <xsl:when test="m:intersect[1]">
1170 <xsl:value-of select="'Intersection'"/>
1172 <xsl:when test="m:union[1]">
1173 <xsl:value-of select="'Union'"/>
1175 <xsl:when test="m:setdiff[1]">
1176 <xsl:value-of select="'Backslash'"/>
1180 <xsl:variable name="charlength">
1181 <xsl:apply-templates select="*[1]" mode="charcount"/>
1184 <xsl:when test="$charlength >= $framewidth">
1185 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1186 <xsl:if test="@helm:xref">
1187 <xsl:attribute name="helm:xref">
1188 <xsl:value-of select="@helm:xref"/>
1193 <m:mo stretchy="false">(</m:mo>
1194 <xsl:apply-templates select="*[position()=2]"/>
1197 <xsl:for-each select = "*[position()>2]">
1200 <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
1201 <m:mo helm:xref="{*[1]/@helm:xref}">
1202 <m:mchar name="{$symbol}"/>
1204 <xsl:apply-templates select="."/>
1210 <m:mo stretchy="false">)</m:mo>
1216 <xsl:apply-imports/>
1221 <xsl:template match = "m:set">
1223 <xsl:when test="count(child::*) = 0">
1225 <m:mchar name="EmptySet"/>
1229 <xsl:variable name="charlength">
1230 <xsl:apply-templates select="*[1]" mode="charcount"/>
1233 <xsl:when test="$charlength >= $framewidth">
1235 <xsl:when test="name(*[1]) = 'm:bvar'">
1236 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1239 <m:mo stretchy="false">{</m:mo>
1240 <xsl:apply-templates select="*[position()=1]"/>
1245 <m:mphantom><m:mtext>{</m:mtext></m:mphantom>
1246 <m:mo stretchy="false">|</m:mo>
1247 <xsl:apply-templates select="m:condition/*[1]"/>
1252 <m:mo stretchy="false">}</m:mo>
1258 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1261 <m:mo stretchy="false">{</m:mo>
1262 <xsl:apply-templates select="*[position()=1]"/>
1263 <xsl:if test="position() != last()">
1268 <xsl:for-each select = "*[position()>2]">
1271 <m:mphantom><m:mtext>{</m:mtext></m:mphantom>
1272 <xsl:apply-templates select="."/>
1273 <xsl:if test="position() != last()">
1281 <m:mo stretchy="false">}</m:mo>
1289 <xsl:apply-imports/>
1296 <xsl:template match = "m:apply[m:card[1]]">
1297 <m:mo stretchy="false">|</m:mo>
1298 <xsl:apply-templates select="*[2]"/>
1299 <m:mo stretchy="false">|</m:mo>
1302 <!-- *********************************** -->
1303 <!-- PROOF ELEMENTS -->
1304 <!-- *********************************** -->
1308 <!--**********************-->
1310 <!--**********************-->
1312 <xsl:template match="m:cn|m:and|m:or|m:not|m:exists|m:eq|m:lt|m:leq|m:gt|m:geq
1313 |m:in|m:notin|m:intersect|m:union|m:subset|m:prsubset|m:card|m:setdiff
1314 |m:plus|m:minus|m:times" mode="charcount">
1315 <xsl:param name="incurrent_length" select="0"/>
1317 <xsl:when test="$framewidth > ($incurrent_length + 3 + string-length())">
1318 <xsl:variable name="siblength">
1319 <xsl:apply-templates select="following-sibling::*[position()=1]" mode="charcount">
1320 <xsl:with-param name="incurrent_length" select="$incurrent_length + string-length()"/>
1321 </xsl:apply-templates>
1324 <xsl:when test="string($siblength) = """>
1325 <xsl:value-of select="$incurrent_length + 3 + string-length()"/>
1328 <xsl:value-of select="number($siblength)"/>
1333 <xsl:value-of select="$incurrent_length + 3 + string-length()"/>
1338 <xsl:template match="m:ci|m:csymbol" mode="charcount">
1339 <xsl:param name="incurrent_length" select="0"/>
1340 <xsl:param name="nosibling" select="0"/>
1342 <xsl:when test="$framewidth > ($incurrent_length + string-length()) and ($nosibling = 0)">
1343 <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>
1345 <xsl:when test="string($siblength) = """>
1346 <xsl:value-of select="$incurrent_length + string-length()"/>
1349 <xsl:value-of select="number($siblength)"/>
1354 <xsl:value-of select="$incurrent_length + string-length()"/>
1359 <xsl:template match="*" mode="charcount">
1360 <xsl:param name="incurrent_length" select="0"/>
1361 <xsl:param name="nosibling" select="0"/>
1363 <xsl:when test="count(child::*) = 0">
1364 <xsl:value-of select="$incurrent_length"/>
1367 <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>
1369 <xsl:when test="$framewidth > number($childlength) and ($nosibling = 0)">
1370 <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>
1372 <xsl:when test="string($siblength) = """>
1373 <xsl:value-of select="number($childlength)"/>
1376 <xsl:value-of select="number($siblength)"/>
1381 <xsl:value-of select="number($childlength)"/>