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="/">
61 <xsl:processing-instruction name="cocoon-format">type="text/xhtml"</xsl:processing-instruction>
63 <xsl:apply-templates select="*"/>
68 <xsl:template match="Definition">
70 <m:mtable align="baseline 1" equalrows="false" columnalign="left" helm:xref="{@helm:xref}">
74 <m:mtext>DEFINITION <xsl:value-of select="@name"/>(<xsl:if test="string(./Params) != """><xsl:value-of select="Params"/></xsl:if>) OF TYPE</m:mtext>
81 <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
82 <xsl:apply-templates select="type/*[1]"/>
96 <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
97 <xsl:apply-templates select="body/*[1]"/>
107 <xsl:template match="Axiom">
109 <m:mtable align="baseline 1" equalrows="false" columnalign="left" helm:xref="{@helm:xref}">
113 <m:mtext>AXIOM <xsl:value-of select="@name"/>(<xsl:if test="string(./Params) != """><xsl:value-of select="Params"/></xsl:if>) OF TYPE</m:mtext>
120 <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
121 <xsl:apply-templates select="type/*[1]"/>
129 <!-- UNFINISHED PROOF -->
131 <xsl:template match="CurrentProof">
133 <m:mtable align="baseline 1" equalrows="false" columnalign="left" helm:xref="{@helm:xref}">
137 <m:mtext>UNFINISHED PROOF <xsl:value-of select="@name"/>(<xsl:if test="string(./Params) != """><xsl:value-of select="Params"/></xsl:if>)</m:mtext>
144 <m:mtext>THESIS:</m:mtext>
151 <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
152 <xsl:apply-templates select="type/*[1]"/>
159 <m:mtext>CONJECTURES:</m:mtext>
163 <xsl:for-each select="Conjecture">
167 <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
168 <m:mtext><xsl:value-of select="./@no"/>:</m:mtext>
169 <xsl:apply-templates select="./*[1]"/>
177 <m:mtext>CORRESPONDING PROOF:</m:mtext>
184 <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
185 <xsl:apply-templates select="body/*[1]"/>
193 <!-- MUTUAL INDUCTIVE DEFINITION -->
195 <xsl:template match="InductiveDefinition">
197 <m:mtable align="baseline 1" equalrows="false" columnalign="left" helm:xref="{@helm:xref}">
198 <xsl:for-each select="InductiveType">
203 <xsl:when test="position() = 1">
205 <xsl:when test="string(./@inductive) = "true"">
206 <m:mtext>INDUCTIVE DEFINITION</m:mtext>
209 <m:mtext>COINDUCTIVE DEFINITION</m:mtext>
214 <m:mtext>AND</m:mtext>
217 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
218 <m:mtext><xsl:value-of select="./@name"/>(<xsl:if test="string(../Params) != """><xsl:value-of select="../Params"/></xsl:if>)</m:mtext>
225 <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
228 <xsl:when test="string(../Param) != """>
229 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
230 <xsl:for-each select="../Param">
234 <m:mi><xsl:value-of select="./@name"/></m:mi>
236 <xsl:apply-templates select="*"/>
260 <m:mtext>OF ARITY</m:mtext>
267 <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
268 <xsl:apply-templates select="./arity/*[1]"/>
275 <m:mtext>BUILT FROM</m:mtext>
279 <xsl:for-each select="./Constructor">
284 <xsl:when test="position() = 1">
285 <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
289 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
292 <m:mtext><xsl:value-of select="./@name"/> OF</m:mtext>
293 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
294 <xsl:apply-templates select="./*[1]"/>
306 <xsl:template match="Variable">
308 <m:mtable align="baseline 1" equalrows="false" columnalign="left" helm:xref="{@helm:xref}">
312 <m:mtext>VARIABLE <xsl:value-of select="@name"/> OF TYPE</m:mtext>
319 <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
320 <xsl:apply-templates select="type/*[1]"/>
324 <xsl:if test="name(*[1])='body'">
328 <m:mtext>AS</m:mtext>
335 <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
336 <xsl:apply-templates select="body/*[1]"/>
345 <!--**********************-->
347 <!--**********************-->
349 <xsl:template match="m:bvar">
351 <xsl:when test="m:type">
352 <xsl:variable name="charlength">
353 <xsl:apply-templates select="m:ci" mode="charcount"/>
356 <xsl:when test="$charlength >= $framewidth">
357 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
360 <xsl:apply-templates select="m:ci"/>
366 <xsl:apply-templates select="m:type"/>
372 <xsl:apply-templates select="m:ci"/>
374 <xsl:apply-templates select="m:type"/>
379 <xsl:apply-templates select="m:ci"/>
387 <xsl:template match="m:apply[m:csymbol]">
388 <xsl:param name="nopar" select="0"/>
389 <xsl:variable name="name"><xsl:value-of select="m:csymbol"/></xsl:variable>
390 <xsl:variable name="charlength"><xsl:apply-templates select="m:csymbol" mode="charcount"/></xsl:variable>
392 <xsl:if test="@helm:xref">
393 <xsl:attribute name="helm:xref"><xsl:value-of select="@helm:xref"/></xsl:attribute>
396 <xsl:when test="$name='forall'">
398 <xsl:when test="$charlength >= $framewidth">
399 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
402 <m:mo mathcolor="Blue"><m:mchar name="ForAll"/></m:mo>
403 <xsl:apply-templates select="m:bvar"/>
410 <xsl:apply-templates select="*[position()=3]"/>
417 <m:mo mathcolor="Blue"><m:mchar name="ForAll"/></m:mo>
418 <xsl:apply-templates select="m:bvar/m:ci"/>
420 <xsl:apply-templates select="m:bvar/m:type"/>
422 <xsl:apply-templates select="*[position()=3]"/>
426 <xsl:when test="$name='let_in'">
428 <xsl:when test="$charlength >= $framewidth">
429 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
433 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
434 <xsl:apply-templates select="m:bvar"/>
441 <xsl:apply-templates select="*[position()=3]"/>
449 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
450 <xsl:apply-templates select="*[position()=4]"/>
458 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
459 <xsl:apply-templates select="m:bvar/m:ci"/>
461 <xsl:apply-templates select="*[position()=3]"/>
462 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
463 <m:mtext>IN</m:mtext>
464 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
465 <xsl:apply-templates select="*[position()=4]"/>
469 <xsl:when test="$name='prod'">
471 <xsl:when test="$charlength >= $framewidth">
472 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
475 <m:mo mathcolor="Blue">Π</m:mo>
476 <xsl:apply-templates select="m:bvar"/>
483 <xsl:apply-templates select="*[position()=3]"/>
490 <m:mo mathcolor="Blue">Π</m:mo>
491 <xsl:apply-templates select="m:bvar/m:ci"/>
493 <xsl:apply-templates select="m:bvar/m:type"/>
495 <xsl:apply-templates select="*[position()=3]"/>
499 <xsl:when test="$name='arrow'">
501 <xsl:when test="$charlength >= $framewidth">
502 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
506 <xsl:if test="$nopar=0">
507 <m:mo stretchy="false">(</m:mo>
509 <xsl:apply-templates select="*[position()=2]"/>
516 <m:mo mathmathcolor="Blue">→</m:mo>
518 <xsl:when test="*[position()=3]/m:csymbol">
519 <xsl:variable name="nextp"><xsl:value-of select="*[position()=3]/m:csymbol"/></xsl:variable>
521 <xsl:when test="$nextp='arrow'">
522 <xsl:apply-templates select="*[position()=3]"><xsl:with-param name="nopar" select="1"/></xsl:apply-templates>
525 <xsl:apply-templates select="*[position()=3]"/>
530 <xsl:apply-templates select="*[position()=3]"/>
536 <xsl:if test="$nopar=0">
540 <m:mo stretchy="false">)</m:mo>
548 <xsl:if test="$nopar=0">
549 <m:mo stretchy="false">(</m:mo>
551 <xsl:apply-templates select="*[position()=2]"/>
552 <m:mo mathcolor="Blue">→</m:mo>
554 <xsl:when test="*[position()=3]/m:csymbol">
555 <xsl:variable name="nextp"><xsl:value-of select="*[position()=3]/m:csymbol"/></xsl:variable>
557 <xsl:when test="$nextp='arrow'">
558 <xsl:apply-templates select="*[position()=3]"><xsl:with-param name="nopar" select="1"/></xsl:apply-templates>
561 <xsl:apply-templates select="*[position()=3]"/>
566 <xsl:apply-templates select="*[position()=3]"/>
569 <xsl:if test="$nopar=0">
570 <m:mo stretchy="false">)</m:mo>
575 <xsl:when test="$name='app'">
577 <xsl:when test="$charlength >= $framewidth">
578 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
582 <m:mo stretchy="false">(</m:mo>
583 <xsl:apply-templates select="*[position()=2]"/>
587 <xsl:for-each select="*[position()>2]">
591 <m:mphantom><m:mtext>(</m:mtext></m:mphantom>
592 <xsl:apply-templates select="."/>
600 <m:mo stretchy="false">)</m:mo>
607 <m:mo stretchy="false">(</m:mo>
608 <xsl:apply-templates select="*[position()=2]"/>
609 <xsl:for-each select="*[position()>2]">
610 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
611 <xsl:apply-templates select="."/>
613 <m:mo stretchy="false">)</m:mo>
617 <xsl:when test="$name='cast'">
619 <xsl:when test="$charlength >= $framewidth">
620 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
624 <m:mo stretchy="false">(</m:mo>
625 <xsl:apply-templates select="*[position()=2]"/>
632 <m:mo mathcolor="Maroon">:></m:mo>
633 <xsl:apply-templates select="*[position()=3]"/>
640 <m:mo stretchy="false">)</m:mo>
647 <m:mo stretchy="false">(</m:mo>
648 <xsl:apply-templates select="*[position()=2]"/>
649 <m:mo mathcolor="Maroon">:></m:mo>
650 <xsl:apply-templates select="*[position()=3]"/>
651 <m:mo stretchy="false">)</m:mo>
655 <xsl:when test="$name='Prop'">
658 <xsl:when test="$name='Set'">
661 <xsl:when test="$name='Type'">
664 <xsl:when test="$name='mutcase'">
666 <xsl:when test="$charlength >= $framewidth">
667 <xsl:variable name="charlength"><xsl:apply-templates select="*[position()=2]" mode="charcount"><xsl:with-param name="nosibling" select="1"/></xsl:apply-templates></xsl:variable>
668 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
673 <xsl:apply-templates select="*[position()=2]"/>
674 <xsl:if test="$framewidth > $charlength">
677 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
678 <xsl:apply-templates select="*[position()=3]"/>
683 <xsl:if test="$charlength >= $framewidth">
689 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
690 <xsl:apply-templates select="*[position()=3]"/>
702 <xsl:for-each select="*[position() mod 2 = 0 and position()>3]">
703 <xsl:variable name="charlength"><xsl:apply-templates select="." mode="charcount"><xsl:with-param name="nosibling" select="1"/></xsl:apply-templates></xsl:variable>
708 <xsl:when test="position() = 1">
709 <m:mphantom><m:mtext>|</m:mtext></m:mphantom>
712 <m:mo stretchy="false">|</m:mo>
715 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
716 <xsl:apply-templates select="."/>
717 <xsl:if test="$framewidth > $charlength">
718 <m:mo mathcolor="Green">⇒</m:mo>
719 <xsl:apply-templates select="following-sibling::*[position()= 1]"/>
724 <xsl:if test="$charlength >= $framewidth">
728 <m:mphantom><m:mtext>|_</m:mtext></m:mphantom>
729 <m:mo mathcolor="Green">⇒</m:mo>
730 <xsl:apply-templates select="following-sibling::*[position()= 1]"/>
746 <m:mo><</m:mo><xsl:apply-templates select="*[position()=2]"/><m:mo>></m:mo>
748 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
749 <xsl:apply-templates select="*[position()=3]"/>
750 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
752 <xsl:for-each select="*[position() mod 2 = 0 and position()>3]">
754 <xsl:when test="position() != 1">
755 <m:mo stretchy="false">|</m:mo>
758 <xsl:apply-templates select="."/>
759 <m:mo mathcolor="Green">⇒</m:mo>
760 <xsl:apply-templates select="following-sibling::*[position()= 1]"/>
762 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
767 <xsl:when test="$name='fix'">
769 <xsl:when test="$charlength >= $framewidth">
770 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
775 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
776 <m:mi><xsl:value-of select="m:ci"/></m:mi>
777 <m:mo stretchy="false">{</m:mo>
784 <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
785 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
786 <xsl:for-each select="m:bvar">
787 <xsl:variable name="charlength"><xsl:apply-templates select="m:type" mode="charcount"><xsl:with-param name="nosibling" select="1"/></xsl:apply-templates></xsl:variable>
791 <m:mi><xsl:value-of select="m:ci"/></m:mi>
793 <xsl:if test="$framewidth > $charlength">
794 <xsl:apply-templates select="m:type"/>
799 <xsl:if test="$charlength >= $framewidth">
803 <m:mphantom><m:mtext>:=</m:mtext></m:mphantom>
804 <xsl:apply-templates select="m:type"/>
813 <xsl:apply-templates select="following-sibling::*[position()=1]"/>
825 <m:mo stretchy="false">}</m:mo>
833 <m:mi><xsl:value-of select="m:ci"/></m:mi>
834 <m:mo stretchy="false">{</m:mo>
835 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
836 <xsl:for-each select="m:bvar">
840 <m:mi><xsl:value-of select="m:ci"/></m:mi>
842 <xsl:apply-templates select="m:type"/>
844 <xsl:apply-templates select="following-sibling::*[position() = 1]"/>
845 <xsl:if test="position()=last()">
846 <m:mo stretchy="false">}</m:mo>
856 <xsl:when test="$name='cofix'">
858 <xsl:when test="$charlength >= $framewidth">
859 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
864 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
865 <m:mi><xsl:value-of select="m:ci"/></m:mi>
866 <m:mo stretchy="false">{</m:mo>
873 <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
874 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
875 <xsl:for-each select="m:bvar">
876 <xsl:variable name="charlength"><xsl:apply-templates select="m:type" mode="charcount"><xsl:with-param name="nosibling" select="1"/></xsl:apply-templates></xsl:variable>
880 <m:mi><xsl:value-of select="m:ci"/></m:mi>
882 <xsl:if test="$framewidth > $charlength">
883 <xsl:apply-templates select="m:type"/>
888 <xsl:if test="$charlength >= $framewidth">
892 <m:mphantom><m:mtext>:=</m:mtext></m:mphantom>
893 <xsl:apply-templates select="m:type"/>
902 <xsl:apply-templates select="following-sibling::*[position() = 1]"/>
914 <m:mo stretchy="false">}</m:mo>
922 <m:mi><xsl:value-of select="m:ci"/></m:mi>
923 <m:mo stretchy="false">{</m:mo>
924 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
925 <xsl:for-each select="m:bvar">
929 <m:mi><xsl:value-of select="m:ci"/></m:mi>
931 <xsl:apply-templates select="m:type"/>
933 <xsl:apply-templates select="following-sibling::*[position() = 1]"/>
934 <xsl:if test="position()=last()">
935 <m:mo stretchy="false">}</m:mo>
945 <!-- ***************************************** -->
946 <!-- *********** PROOF ELEMENTS ************** -->
947 <!-- ***************************************** -->
948 <xsl:when test="$name='proof'">
949 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
953 <xsl:apply-templates select="*[position()=2]"/>
960 <m:mtext mathcolor="Maroon">we proved </m:mtext>
961 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
962 <xsl:apply-templates select="*[position()=3]"/>
968 <xsl:when test="$name='letin1'">
969 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
973 <xsl:apply-templates select="*[2]"/>
980 <xsl:apply-templates select="*[3]"/>
986 <xsl:when test="$name='letin'">
987 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
988 <!-- <xsl:for-each select="APPLY[m:csymbol and (string(m:csymbol)='let')]"> -->
989 <xsl:for-each select="*[(last() > position()) and (position()>1)]">
993 <xsl:apply-templates select="."/>
1001 <xsl:apply-templates select="*[position()=last()]"/>
1007 <xsl:when test="$name='let'">
1008 <m:mtext>(</m:mtext>
1009 <xsl:apply-templates select="m:ci"/>
1010 <m:mtext>) </m:mtext>
1011 <xsl:apply-templates select="*[3]"/>
1013 <xsl:when test="$name='rw_step'">
1014 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1019 <xsl:when test="name(*[2])='m:apply'">
1020 <xsl:apply-templates select="*[2]"/>
1023 <m:mtext>Consider</m:mtext>
1024 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1025 <xsl:apply-templates select="*[2]"/>
1034 <m:mtext>Rewrite</m:mtext>
1035 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1036 <xsl:apply-templates select="*[3]"/>
1037 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1038 <m:mtext>with</m:mtext>
1039 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1040 <xsl:apply-templates select="*[4]"/>
1041 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1042 <m:mtext>by</m:mtext>
1043 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1044 <xsl:apply-templates select="*[5]"/>
1050 <!-- not existing any more
1051 <xsl:when test="$name='thread'">
1052 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1057 <xsl:when test="name(*[last()])='m:apply'">
1058 <xsl:apply-templates select="*[last()]"/>
1061 <m:mtext>Consider</m:mtext>
1062 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1063 <xsl:apply-templates select="*[last()]"/>
1069 <xsl:apply-templates mode="thread" select="*[(last()-2)]"/>
1073 <xsl:when test="$name='rewrite_and_apply'">
1074 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1078 <xsl:apply-templates select="*[2]"/>
1085 <m:mtext>Then apply it to</m:mtext>
1086 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1087 <xsl:apply-templates select="*[position()>2]"/>
1094 <xsl:when test="$name='nat_ind'">
1095 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1098 <m:mtext>By induction</m:mtext>
1104 <m:mtext>base case:</m:mtext>
1105 <xsl:apply-templates select="*[2]"/>
1112 <m:mtext>inductive case:</m:mtext>
1113 <xsl:apply-templates select="*[3]"/>
1120 <xsl:when test="$name='and_ind'">
1121 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1126 <xsl:when test="name(*[2])='m:apply'">
1127 <xsl:apply-templates select="*[2]"/>
1130 <m:mtext>Consider</m:mtext>
1131 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1132 <xsl:apply-templates select="*[2]"/>
1140 <m:mtext>In particular, we have</m:mtext>
1146 <m:mtext>(</m:mtext>
1147 <xsl:apply-templates select="*[3]"/>
1148 <m:mtext>)</m:mtext>
1149 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1150 <xsl:apply-templates select="*[4]"/>
1157 <m:mtext>(</m:mtext>
1158 <xsl:apply-templates select="*[5]"/>
1159 <m:mtext>)</m:mtext>
1160 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1161 <xsl:apply-templates select="*[6]"/>
1168 <xsl:apply-templates select="*[7]"/>
1174 <xsl:when test="$name='or_ind'">
1175 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1180 <xsl:when test="name(*[2])='m:apply'">
1181 <xsl:apply-templates select="*[2]"/>
1184 <m:mtext>Consider</m:mtext>
1185 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1186 <xsl:apply-templates select="*[2]"/>
1194 <m:mtext>We prove</m:mtext>
1195 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1196 <xsl:apply-templates select="*[3]"/>
1197 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1198 <m:mtext>by cases:</m:mtext>
1204 <m:mtext>*</m:mtext>
1205 <xsl:apply-templates select="*[4]"/>
1212 <m:mtext>*</m:mtext>
1213 <xsl:apply-templates select="*[5]"/>
1219 <xsl:when test="$name='ex_ind'">
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]"/>
1239 <m:mtext>Let</m:mtext>
1240 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1241 <xsl:apply-templates select="*[3]"/>
1242 <m:mtext>:</m:mtext>
1243 <xsl:apply-templates select="*[4]"/>
1244 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1245 <m:mtext>such that</m:mtext>
1246 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1247 <m:mtext>(</m:mtext>
1248 <xsl:apply-templates select="*[5]"/>
1249 <m:mtext>)</m:mtext>
1250 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1251 <xsl:apply-templates select="*[6]"/>
1257 <xsl:apply-templates select="*[7]"/>
1270 <!-- Il modo Thread non esiste piu'
1271 <xsl:template match="*" mode="thread">
1272 <xsl:variable name="name"><xsl:value-of select="following-sibling::*[position()=1]/m:csymbol"/></xsl:variable>
1274 <xsl:when test="$name='rw_step'">
1278 <m:mtext>Rewrite</m:mtext>
1279 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1280 <xsl:apply-templates select="following-sibling::*[position()=1]/*[2]"/>
1281 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1282 <m:mtext>with</m:mtext>
1283 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1284 <xsl:apply-templates select="following-sibling::*[position()=1]/*[3]"/>
1285 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1286 <m:mtext>by</m:mtext>
1287 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1288 <xsl:apply-templates select="following-sibling::*[position()=1]/*[4]"/>
1295 <m:mtext mathcolor="Maroon">we get</m:mtext>
1296 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1297 <xsl:apply-templates select="."/>
1306 <xsl:apply-templates select="following-sibling::*[position()=1]"/>
1313 <m:mtext mathcolor="Maroon">we get</m:mtext>
1314 <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
1315 <xsl:apply-templates select="."/>
1321 <xsl:apply-templates mode="thread" select="preceding-sibling::*[position()=2]"/>
1327 <xsl:template match="m:lambda">
1328 <xsl:variable name="charlength"><xsl:apply-templates select="*[position()=1]" mode="charcount"/></xsl:variable>
1329 <m:mrow helm:xref="{@helm:xref}">
1331 <xsl:when test="$charlength >= $framewidth">
1332 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1335 <m:mo mathcolor="Red">λ</m:mo>
1336 <xsl:apply-templates select="m:bvar"/>
1343 <xsl:apply-templates select="*[position()=2]"/>
1350 <m:mo mathcolor="Red">λ</m:mo>
1351 <xsl:apply-templates select="m:bvar/m:ci"/>
1353 <xsl:apply-templates select="m:bvar/m:type"/>
1355 <xsl:apply-templates select="*[position()=2]"/>
1361 <!-- *********************************** -->
1362 <!-- BASE SET OF MATHML CONTENT ELEMENTS -->
1363 <!-- *********************************** -->
1367 <xsl:template match = "m:apply[m:eq[1]]">
1368 <xsl:variable name="charlength">
1369 <xsl:apply-templates select="*[1]" mode="charcount"/>
1372 <xsl:when test="$charlength >= $framewidth">
1373 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1374 <xsl:if test="@helm:xref">
1375 <xsl:attribute name="helm:xref">
1376 <xsl:value-of select="@helm:xref"/>
1381 <m:mo stretchy="false">(</m:mo>
1382 <xsl:apply-templates select="*[position()=2]"/>
1385 <xsl:for-each select = "*[position()>2]">
1388 <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
1389 <m:mo helm:xref="{m:in/@helm:xref}">=</m:mo>
1390 <xsl:apply-templates select="."/>
1396 <m:mo stretchy="false">)</m:mo>
1402 <xsl:apply-imports/>
1408 <xsl:template match = "m:apply[m:and[1]|m:or[1]
1409 |m:geq[1]|m:leq[1]|m:gt[1]|m:lt[1]
1410 |m:in[1]|m:intesect[1]|m:union[1]|m:subset[1]
1411 |m:prsubset|m:setdiff[1]]">
1412 <xsl:variable name="symbol">
1414 <xsl:when test="m:and[1]">
1415 <xsl:value-of select="'wedge'"/>
1417 <xsl:when test="m:or[1]">
1418 <xsl:value-of select="'vee'"/>
1420 <xsl:when test="m:geq[1]">
1421 <xsl:value-of select="'geq'"/>
1423 <xsl:when test="m:leq[1]">
1424 <xsl:value-of select="'leq'"/>
1426 <xsl:when test="m:gt[1]">
1427 <xsl:value-of select="'gt'"/>
1429 <xsl:when test="m:lt[1]">
1430 <xsl:value-of select="'lt'"/>
1432 <xsl:when test="m:eq[1]">
1433 <xsl:value-of select="'Equal'"/>
1435 <xsl:when test="m:in[1]">
1436 <xsl:value-of select="'Element'"/>
1438 <xsl:when test="m:subset[1]">
1439 <xsl:value-of select="'SubsetEqual'"/>
1441 <xsl:when test="m:prsubset[1]">
1442 <xsl:value-of select="'subset'"/>
1444 <xsl:when test="m:intersect[1]">
1445 <xsl:value-of select="'Intersection'"/>
1447 <xsl:when test="m:union[1]">
1448 <xsl:value-of select="'Union'"/>
1450 <xsl:when test="m:setdiff[1]">
1451 <xsl:value-of select="'Backslash'"/>
1455 <xsl:variable name="charlength">
1456 <xsl:apply-templates select="*[1]" mode="charcount"/>
1459 <xsl:when test="$charlength >= $framewidth">
1460 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1461 <xsl:if test="@helm:xref">
1462 <xsl:attribute name="helm:xref">
1463 <xsl:value-of select="@helm:xref"/>
1468 <m:mo stretchy="false">(</m:mo>
1469 <xsl:apply-templates select="*[position()=2]"/>
1472 <xsl:for-each select = "*[position()>2]">
1475 <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
1476 <m:mo helm:xref="{*[1]/@helm:xref}">
1477 <m:mchar name="{$symbol}"/>
1479 <xsl:apply-templates select="."/>
1485 <m:mo stretchy="false">)</m:mo>
1491 <xsl:apply-imports/>
1496 <xsl:template match = "m:set">
1498 <xsl:when test="count(child::*) = 0">
1500 <m:mchar name="emptyset"/>
1504 <xsl:variable name="charlength">
1505 <xsl:apply-templates select="*[1]" mode="charcount"/>
1508 <xsl:when test="$charlength >= $framewidth">
1510 <xsl:when test="name(*[1]) = 'm:bvar'">
1511 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1514 <m:mo stretchy="false">{</m:mo>
1515 <xsl:apply-templates select="*[position()=1]"/>
1520 <m:mphantom><m:mtext>{</m:mtext></m:mphantom>
1521 <m:mo stretchy="false">|</m:mo>
1522 <xsl:apply-templates select="m:condition/*[1]"/>
1527 <m:mo stretchy="false">}</m:mo>
1533 <m:mtable align="baseline 1" equalrows="false" columnalign="left">
1536 <m:mo stretchy="false">{</m:mo>
1537 <xsl:apply-templates select="*[position()=1]"/>
1538 <xsl:if test="position() != last()">
1543 <xsl:for-each select = "*[position()>2]">
1546 <m:mphantom><m:mtext>{</m:mtext></m:mphantom>
1547 <xsl:apply-templates select="."/>
1548 <xsl:if test="position() != last()">
1556 <m:mo stretchy="false">}</m:mo>
1564 <xsl:apply-imports/>
1571 <xsl:template match = "m:apply[m:card[1]]">
1572 <m:mo stretchy="false">|</m:mo>
1573 <xsl:apply-templates select="*[2]"/>
1574 <m:mo stretchy="false">|</m:mo>
1577 <!-- *********************************** -->
1578 <!-- PROOF ELEMENTS -->
1579 <!-- *********************************** -->
1583 <!--**********************-->
1585 <!--**********************-->
1587 <xsl:template match="m:cn|m:and|m:or|m:not|m:exists|m:eq|m:lt|m:leq|m:gt|m:geq
1588 |m:in|m:notin|m:intersect|m:union|m:subset|m:prsubset|m:card|m:setdiff
1589 |m:plus|m:minus|m:times" mode="charcount">
1590 <xsl:param name="incurrent_length" select="0"/>
1592 <xsl:when test="$framewidth > ($incurrent_length + 3 + string-length())">
1593 <xsl:variable name="siblength">
1594 <xsl:apply-templates select="following-sibling::*[position()=1]" mode="charcount">
1595 <xsl:with-param name="incurrent_length" select="$incurrent_length + string-length()"/>
1596 </xsl:apply-templates>
1599 <xsl:when test="string($siblength) = """>
1600 <xsl:value-of select="$incurrent_length + 3 + string-length()"/>
1603 <xsl:value-of select="number($siblength)"/>
1608 <xsl:value-of select="$incurrent_length + 3 + string-length()"/>
1613 <xsl:template match="m:ci|m:csymbol" mode="charcount">
1614 <xsl:param name="incurrent_length" select="0"/>
1615 <xsl:param name="nosibling" select="0"/>
1617 <xsl:when test="$framewidth > ($incurrent_length + string-length()) and ($nosibling = 0)">
1618 <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>
1620 <xsl:when test="string($siblength) = """>
1621 <xsl:value-of select="$incurrent_length + string-length()"/>
1624 <xsl:value-of select="number($siblength)"/>
1629 <xsl:value-of select="$incurrent_length + string-length()"/>
1634 <xsl:template match="*" mode="charcount">
1635 <xsl:param name="incurrent_length" select="0"/>
1636 <xsl:param name="nosibling" select="0"/>
1638 <xsl:when test="count(child::*) = 0">
1639 <xsl:value-of select="$incurrent_length"/>
1642 <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>
1644 <xsl:when test="$framewidth > number($childlength) and ($nosibling = 0)">
1645 <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>
1647 <xsl:when test="string($siblength) = """>
1648 <xsl:value-of select="number($childlength)"/>
1651 <xsl:value-of select="number($siblength)"/>
1656 <xsl:value-of select="number($childlength)"/>