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 <xsl:apply-templates select="*[position()=3]"/>
812 <xsl:when test="$name='letin'">
813 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
814 <!-- <xsl:for-each select="APPLY[m:csymbol and (string(m:csymbol)='let')]"> -->
815 <xsl:for-each select="*[(last() > position()) and (position()>1)]">
819 <xsl:apply-templates select="."/>
827 <xsl:apply-templates select="*[position()=last()]"/>
833 <xsl:when test="$name='let'">
835 <xsl:apply-templates select="m:ci"/>
836 <m:mtext>) </m:mtext>
837 <xsl:apply-templates select="*[3]"/>
839 <xsl:when test="$name='thread'">
840 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
845 <xsl:when test="name(*[last()])='m:apply'">
846 <xsl:apply-templates select="*[last()]"/>
849 <m:mtext>Consider </m:mtext>
850 <xsl:apply-templates select="*[last()]"/>
856 <xsl:apply-templates mode="thread" select="*[(last()-2)]"/>
859 <xsl:when test="$name='rewrite_and_apply'">
864 <m:mtext>Rewrite</m:mtext>
865 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
866 <xsl:apply-templates select="*[2]/*[2]"/>
867 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
868 <m:mtext>with</m:mtext>
869 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
870 <xsl:apply-templates select="*[2]/*[3]"/>
871 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
872 <m:mtext>by</m:mtext>
873 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
874 <xsl:apply-templates select="*[2]/*[4]"/>
875 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
876 <m:mtext>in</m:mtext>
877 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
878 <xsl:apply-templates select="*[3]"/>
879 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
880 <m:mtext>and apply</m:mtext>
881 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
882 <xsl:apply-templates select="*[position()>3]"/>
888 <xsl:when test="$name='and_ind'">
889 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
894 <xsl:when test="name(*[2])='m:apply'">
895 <xsl:apply-templates select="*[2]"/>
898 <m:mtext>Consider </m:mtext>
899 <xsl:apply-templates select="*[2]"/>
907 <m:mtext>In particular, we have</m:mtext>
914 <xsl:apply-templates select="*[3]"/>
916 <xsl:apply-templates select="*[4]"/>
924 <xsl:apply-templates select="*[5]"/>
926 <xsl:apply-templates select="*[6]"/>
933 <xsl:apply-templates select="*[7]"/>
939 <xsl:when test="$name='or_ind'">
940 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
945 <xsl:when test="name(*[2])='m:apply'">
946 <xsl:apply-templates select="*[2]"/>
949 <m:mtext>Consider</m:mtext>
950 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
951 <xsl:apply-templates select="*[2]"/>
959 <m:mtext>We prove</m:mtext>
960 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
961 <xsl:apply-templates select="*[3]"/>
962 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
963 <m:mtext>by cases:</m:mtext>
970 <xsl:apply-templates select="*[4]"/>
978 <xsl:apply-templates select="*[5]"/>
991 <xsl:template match="*" mode="thread">
992 <xsl:variable name="name"><xsl:value-of select="following-sibling::*[position()=1]/m:csymbol"/></xsl:variable>
994 <xsl:when test="$name='rw_step'">
998 <m:mtext>Rewrite</m:mtext>
999 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1000 <xsl:apply-templates select="following-sibling::*[position()=1]/*[2]"/>
1001 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1002 <m:mtext>with</m:mtext>
1003 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1004 <xsl:apply-templates select="following-sibling::*[position()=1]/*[3]"/>
1005 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1006 <m:mtext>by</m:mtext>
1007 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1008 <xsl:apply-templates select="following-sibling::*[position()=1]/*[4]"/>
1015 <xsl:apply-templates select="."/>
1024 <xsl:apply-templates select="following-sibling::*[position()=1]"/>
1031 <xsl:apply-templates select="."/>
1037 <xsl:apply-templates mode="thread" select="preceding-sibling::*[position()=2]"/>
1043 <xsl:template match="m:lambda">
1044 <xsl:variable name="charlength"><xsl:apply-templates select="*[position()=1]" mode="charcount"/></xsl:variable>
1045 <m:mrow helm:xref="{@helm:xref}">
1047 <xsl:when test="$charlength >= $framewidth">
1048 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1051 <m:mo color="Red">λ</m:mo>
1052 <xsl:apply-templates select="m:bvar"/>
1059 <xsl:apply-templates select="*[position()=2]"/>
1066 <m:mo color="Red">λ</m:mo>
1067 <xsl:apply-templates select="m:bvar/m:ci"/>
1069 <xsl:apply-templates select="m:bvar/m:type"/>
1071 <xsl:apply-templates select="*[position()=2]"/>
1077 <!-- *********************************** -->
1078 <!-- BASE SET OF MATHML CONTENT ELEMENTS -->
1079 <!-- *********************************** -->
1083 <xsl:template match = "m:apply[m:eq[1]]">
1084 <xsl:variable name="charlength">
1085 <xsl:apply-templates select="*[1]" mode="charcount"/>
1088 <xsl:when test="$charlength >= $framewidth">
1089 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1090 <xsl:if test="@helm:xref">
1091 <xsl:attribute name="helm:xref">
1092 <xsl:value-of select="@helm:xref"/>
1097 <m:mo stretchy="false">(</m:mo>
1098 <xsl:apply-templates select="*[position()=2]"/>
1101 <xsl:for-each select = "*[position()>2]">
1104 <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
1105 <m:mo helm:xref="m:in/@helm:xref">
1108 <xsl:apply-templates select="."/>
1114 <m:mo stretchy="false">)</m:mo>
1120 <xsl:apply-imports/>
1126 <xsl:template match = "m:apply[m:and[1]|m:or[1]
1127 |m:geq[1]|m:leq[1]|m:gt[1]|m:lt[1]
1128 |m:in[1]|m:intesect[1]|m:union[1]|m:subset[1]
1129 |m:prsubset|m:setdiff[1]]">
1130 <xsl:variable name="symbol">
1132 <xsl:when test="m:and[1]">
1133 <xsl:value-of select="'wedge'"/>
1135 <xsl:when test="m:or[1]">
1136 <xsl:value-of select="'vee'"/>
1138 <xsl:when test="m:geq[1]">
1139 <xsl:value-of select="'geq'"/>
1141 <xsl:when test="m:leq[1]">
1142 <xsl:value-of select="'leq'"/>
1144 <xsl:when test="m:gt[1]">
1145 <xsl:value-of select="'gt'"/>
1147 <xsl:when test="m:lt[1]">
1148 <xsl:value-of select="'lt'"/>
1150 <xsl:when test="m:eq[1]">
1151 <xsl:value-of select="'Equal'"/>
1153 <xsl:when test="m:in[1]">
1154 <xsl:value-of select="'Element'"/>
1156 <xsl:when test="m:subset[1]">
1157 <xsl:value-of select="'SubsetEqual'"/>
1159 <xsl:when test="m:prsubset[1]">
1160 <xsl:value-of select="'subset'"/>
1162 <xsl:when test="m:intersect[1]">
1163 <xsl:value-of select="'Intersection'"/>
1165 <xsl:when test="m:union[1]">
1166 <xsl:value-of select="'Union'"/>
1168 <xsl:when test="m:setdiff[1]">
1169 <xsl:value-of select="'Backslash'"/>
1173 <xsl:variable name="charlength">
1174 <xsl:apply-templates select="*[1]" mode="charcount"/>
1177 <xsl:when test="$charlength >= $framewidth">
1178 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1179 <xsl:if test="@helm:xref">
1180 <xsl:attribute name="helm:xref">
1181 <xsl:value-of select="@helm:xref"/>
1186 <m:mo stretchy="false">(</m:mo>
1187 <xsl:apply-templates select="*[position()=2]"/>
1190 <xsl:for-each select = "*[position()>2]">
1193 <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
1194 <m:mo helm:xref="{*[1]/@helm:xref}">
1195 <m:mchar name="{$symbol}"/>
1197 <xsl:apply-templates select="."/>
1203 <m:mo stretchy="false">)</m:mo>
1209 <xsl:apply-imports/>
1214 <xsl:template match = "m:set">
1216 <xsl:when test="count(child::*) = 0">
1218 <m:mchar name="EmptySet"/>
1222 <xsl:variable name="charlength">
1223 <xsl:apply-templates select="*[1]" mode="charcount"/>
1226 <xsl:when test="$charlength >= $framewidth">
1228 <xsl:when test="name(*[1]) = 'm:bvar'">
1229 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1232 <m:mo stretchy="false">{</m:mo>
1233 <xsl:apply-templates select="*[position()=1]"/>
1238 <m:mphantom><m:mtext>{</m:mtext></m:mphantom>
1239 <m:mo stretchy="false">|</m:mo>
1240 <xsl:apply-templates select="m:condition/*[1]"/>
1245 <m:mo stretchy="false">}</m:mo>
1251 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1254 <m:mo stretchy="false">{</m:mo>
1255 <xsl:apply-templates select="*[position()=1]"/>
1256 <xsl:if test="position() != last()">
1261 <xsl:for-each select = "*[position()>2]">
1264 <m:mphantom><m:mtext>{</m:mtext></m:mphantom>
1265 <xsl:apply-templates select="."/>
1266 <xsl:if test="position() != last()">
1274 <m:mo stretchy="false">}</m:mo>
1282 <xsl:apply-imports/>
1289 <xsl:template match = "m:apply[m:card[1]]">
1290 <m:mo stretchy="false">|</m:mo>
1291 <xsl:apply-templates select="*[2]"/>
1292 <m:mo stretchy="false">|</m:mo>
1295 <!-- *********************************** -->
1296 <!-- PROOF ELEMENTS -->
1297 <!-- *********************************** -->
1301 <!--**********************-->
1303 <!--**********************-->
1305 <xsl:template match="m:cn|m:and|m:or|m:not|m:exists|m:eq|m:lt|m:leq|m:gt|m:geq
1306 |m:in|m:notin|m:intersect|m:union|m:subset|m:prsubset|m:card|m:setdiff
1307 |m:plus|m:minus|m:times" mode="charcount">
1308 <xsl:param name="incurrent_length" select="0"/>
1310 <xsl:when test="$framewidth > ($incurrent_length + 3 + string-length())">
1311 <xsl:variable name="siblength">
1312 <xsl:apply-templates select="following-sibling::*[position()=1]" mode="charcount">
1313 <xsl:with-param name="incurrent_length" select="$incurrent_length + string-length()"/>
1314 </xsl:apply-templates>
1317 <xsl:when test="string($siblength) = """>
1318 <xsl:value-of select="$incurrent_length + 3 + string-length()"/>
1321 <xsl:value-of select="number($siblength)"/>
1326 <xsl:value-of select="$incurrent_length + 3 + string-length()"/>
1331 <xsl:template match="m:ci|m:csymbol" mode="charcount">
1332 <xsl:param name="incurrent_length" select="0"/>
1333 <xsl:param name="nosibling" select="0"/>
1335 <xsl:when test="$framewidth > ($incurrent_length + string-length()) and ($nosibling = 0)">
1336 <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>
1338 <xsl:when test="string($siblength) = """>
1339 <xsl:value-of select="$incurrent_length + string-length()"/>
1342 <xsl:value-of select="number($siblength)"/>
1347 <xsl:value-of select="$incurrent_length + string-length()"/>
1352 <xsl:template match="*" mode="charcount">
1353 <xsl:param name="incurrent_length" select="0"/>
1354 <xsl:param name="nosibling" select="0"/>
1356 <xsl:when test="count(child::*) = 0">
1357 <xsl:value-of select="$incurrent_length"/>
1360 <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>
1362 <xsl:when test="$framewidth > number($childlength) and ($nosibling = 0)">
1363 <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>
1365 <xsl:when test="string($siblength) = """>
1366 <xsl:value-of select="number($childlength)"/>
1369 <xsl:value-of select="number($siblength)"/>
1374 <xsl:value-of select="number($childlength)"/>