]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/style/content_to_html.xsl
Bug in zarith notation corrected.
[helm.git] / helm / style / content_to_html.xsl
index ba3ec1d002d111a5aa5ddbf51c5347162e391647..fdf9b7829e3a5970d623ea95ca4f12ed23476849 100644 (file)
@@ -33,6 +33,8 @@
 <!--***********************************************************************--> 
 
 <xsl:param name="CICURI" select="''"/>
+<xsl:param name="type" select="'standalone'"/>
+<xsl:param name="UNICODEvsSYMBOL" select="'symbol'"/>
 
 <xsl:include href="html_init.xsl"/>
 <xsl:include href="html_set.xsl"/>
 
 <xsl:variable name="framewidth" select="45"/>
 
+<xsl:template name="mksymbol-1">
+ <xsl:param name="symbol" select="''"/>
+ <xsl:param name="color" select="''"/>
+ <xsl:param name="size" select="''"/>
+  <xsl:choose>
+   <xsl:when test="$UNICODEvsSYMBOL = 'symbol'">
+    <xsl:variable name="fontsymbol">
+     <xsl:choose>
+      <xsl:when test="$symbol = 'forall'">
+       <xsl:value-of select="'&#x22;'"/>
+      </xsl:when>
+      <xsl:when test="$symbol = 'lambda'">
+       <xsl:value-of select="'l'"/>
+      </xsl:when>
+      <xsl:when test="$symbol = 'prod'">
+       <xsl:value-of select="'&#x00d5;'"/>
+      </xsl:when>
+      <xsl:when test="$symbol = 'arrow'">
+       <xsl:value-of select="'&#x00ae;'"/>
+      </xsl:when>
+      <xsl:when test="$symbol = 'RightArrow'">
+       <xsl:value-of select="'&#222;'"/>
+      </xsl:when>
+      <xsl:when test="$symbol = 'subst'">
+       <xsl:value-of select="'&#x00ac;'"/>
+      </xsl:when>
+      <xsl:when test="$symbol = 'lift' or $symbol = 'lift_with_base'">
+       <xsl:value-of select="'&#x00ad;'"/>
+      </xsl:when>
+      <xsl:when test="$symbol = 'beta_red' or $symbol = 'beta_red1'">
+       <xsl:value-of select="'&#x00ae;'"/>
+      </xsl:when>
+      <xsl:when test="$symbol = 'beta'">
+       <xsl:value-of select="'&#x0062;'"/>
+      </xsl:when>
+      <xsl:when test="$symbol = 'par_beta_red' or $symbol = 'par_beta_red1'">
+       <xsl:value-of select="'&#x00de;'"/>
+      </xsl:when>
+      <xsl:when test="$symbol = 'isomorphic'">
+       <xsl:value-of select="'&#x0040;'"/>
+      </xsl:when>
+      <xsl:otherwise>
+       <xsl:text>???</xsl:text>
+      </xsl:otherwise>
+     </xsl:choose>
+    </xsl:variable>
+    <FONT FACE="symbol" SIZE="{$size}" color="{$color}">
+     <xsl:value-of select="$fontsymbol"/>
+    </FONT>
+   </xsl:when>
+   <xsl:otherwise>
+    <xsl:variable name="unicodesymbol">
+     <xsl:choose>
+      <xsl:when test="$symbol = 'forall'">
+       <xsl:value-of select="'&#8704;'"/>
+      </xsl:when>
+      <xsl:when test="$symbol = 'lambda'">
+       <xsl:value-of select="'&#955;'"/>
+      </xsl:when>
+      <xsl:when test="$symbol = 'prod'">
+       <xsl:value-of select="'&#928;'"/>
+      </xsl:when>
+      <xsl:when test="$symbol = 'arrow'">
+       <xsl:value-of select="'&#8594;'"/>
+      </xsl:when>
+      <xsl:when test="$symbol = 'RightArrow'">
+       <xsl:value-of select="'&#8658;'"/>
+      </xsl:when>
+      <xsl:when test="$symbol = 'subst'">
+       <xsl:value-of select="'&#8592;'"/>
+      </xsl:when>
+      <xsl:when test="$symbol = 'lift' or $symbol = 'lift_with_base'">
+       <xsl:value-of select="'&#8593;'"/>
+      </xsl:when>
+      <xsl:when test="$symbol = 'beta_red' or $symbol = 'beta_red1'">
+       <xsl:value-of select="'&#8594;'"/>
+      </xsl:when>
+      <xsl:when test="$symbol = 'beta'">
+       <xsl:value-of select="'&#946;'"/>
+      </xsl:when>
+      <xsl:when test="$symbol = 'par_beta_red' or $symbol = 'par_beta_red1'">
+       <xsl:value-of select="'&#8658;'"/>
+      </xsl:when>
+      <xsl:when test="$symbol = 'isomorphic'">
+       <xsl:value-of select="'&#8773;'"/>
+      </xsl:when>
+      <xsl:otherwise>
+       <xsl:text>???</xsl:text>
+      </xsl:otherwise>
+     </xsl:choose>
+    </xsl:variable>
+    <FONT color="{$color}">
+     <xsl:value-of select="$unicodesymbol"/>
+    </FONT>
+   </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
 <xsl:template match="/">
-   <xsl:param name="current_indent" select="0"/>
+ <xsl:param name="current_indent" select="0"/>
+ <xsl:choose>
+  <xsl:when test="$type = 'standalone'">
    <html> 
       <head>
         <title> <xsl:value-of select="$CICURI"/> </title> <!-- FG -->
          </xsl:apply-templates>
       </body>
    </html>
+  </xsl:when>
+  <xsl:otherwise>
+   <to_be_embedded>
+    <xsl:apply-templates>
+     <xsl:with-param name="current_indent" select="0"/>
+    </xsl:apply-templates>
+   </to_be_embedded>
+  </xsl:otherwise>
+ </xsl:choose>
 </xsl:template>
 
 <!--***********************************************************************-->
    <xsl:choose>
     <!-- FORALL -->
     <xsl:when test="$name='forall'">
-     <FONT FACE="Symbol" SIZE="+2" color="blue">&#x22;</FONT>
+     <xsl:call-template name="mksymbol-1">
+      <xsl:with-param name="symbol" select="$name"/>
+      <xsl:with-param name="color" select="'blue'"/>
+      <xsl:with-param name="size" select="'+2'"/>
+     </xsl:call-template>
      <xsl:apply-templates select="m:bvar/m:ci"/>
      <xsl:text>:</xsl:text>
      <xsl:apply-templates mode="inline" select="m:bvar/m:type"/>
      <xsl:apply-templates mode="inline" select="*[position()=3]"/>
     </xsl:when>
     <xsl:when test="$name='prod'">
-     <FONT FACE="Symbol" SIZE="+2" color="blue">&#x00d5;</FONT>
+     <xsl:call-template name="mksymbol-1">
+      <xsl:with-param name="symbol" select="$name"/>
+      <xsl:with-param name="color" select="'blue'"/>
+      <xsl:with-param name="size" select="'+2'"/>
+     </xsl:call-template>
      <xsl:apply-templates mode="inline" select="m:bvar/m:ci"/>
      <xsl:text>:</xsl:text>
      <xsl:apply-templates mode="inline" select="m:bvar/m:type"/>
     <xsl:when test="$name='arrow'">
      <xsl:text>(</xsl:text>
      <xsl:apply-templates mode="inline" select="*[position()=2]"/>
-     <FONT color="blue" SIZE="+0" FACE="symbol">
-      <xsl:text>&#x00ae;</xsl:text>
-     </FONT>
+     <xsl:call-template name="mksymbol-1">
+      <xsl:with-param name="symbol" select="$name"/>
+      <xsl:with-param name="color" select="'blue'"/>
+      <xsl:with-param name="size" select="'+0'"/>
+     </xsl:call-template>
      <xsl:apply-templates mode="inline" select="*[position()=3]"/>
      <xsl:text>)</xsl:text>
     </xsl:when>
      <FONT color="red">CASE </FONT>
      <xsl:apply-templates mode="inline" select="*[position()=3]"/>
      <FONT color="red"> OF </FONT>
-     <xsl:for-each select="*[position() mod 2 = 0 and position()>3]">
+<xsl:for-each select="piecewise/piece">
+<!--<xsl:for-each select="*[position() mod 2 = 0 and position()>3]">-->
       <xsl:choose>
        <xsl:when test="not(position() = 1)">
         <xsl:text> | </xsl:text> 
        </xsl:when> 
       </xsl:choose>
-      <xsl:apply-templates mode="inline" select="."/>
-      <FONT FACE="Symbol" SIZE="+0" mathcolor="green">&#222;</FONT>
+<xsl:apply-templates mode="inline" select="./*[2]"/>
+      <xsl:call-template name="mksymbol-1">
+       <xsl:with-param name="symbol" select="'RightArrow'"/>
+       <xsl:with-param name="color" select="'green'"/>
+       <xsl:with-param name="size" select="'+0'"/>
+      </xsl:call-template>
       <xsl:apply-templates mode="inline"
-           select="following-sibling::*[position()= 1]"/>
+           select="./*[1]"/>
      </xsl:for-each>
     </xsl:when>
     <!-- FIX -->
      <FONT color="red">&#x00a0;hence&#x00a0;</FONT>
      <xsl:apply-templates mode="inline" select="*[7]"/>
     </xsl:when>
-   
+
+       <xsl:when test="$name='subst'">
+       <xsl:apply-templates select="*[3]" mode="inline"/>
+       <xsl:text>[</xsl:text>
+       <xsl:apply-templates select="*[4]" mode="inline"/>
+       <a href="{*[1]/@definitionURL}">
+        <xsl:call-template name="mksymbol-1">
+         <xsl:with-param name="symbol" select="$name"/>
+         <xsl:with-param name="color" select="'green'"/>
+         <xsl:with-param name="size" select="'+0'"/>
+        </xsl:call-template>
+       </a>
+       <xsl:apply-templates select="*[2]" mode="inline"/>
+       <xsl:text>]</xsl:text>
+      </xsl:when>
+
+      <xsl:when test="$name='lift_with_base'">
+       <SUB>
+       <xsl:apply-templates select="*[3]" mode="inline"/>
+       </SUB>
+       <a href="{*[1]/@definitionURL}">
+        <xsl:call-template name="mksymbol-1">
+         <xsl:with-param name="symbol" select="$name"/>
+         <xsl:with-param name="color" select="'green'"/>
+         <xsl:with-param name="size" select="'+0'"/>
+        </xsl:call-template>
+       </a>
+       <SUP>
+       <xsl:apply-templates select="*[4]" mode="inline"/>
+       </SUP>
+       <xsl:text>(</xsl:text>
+       <xsl:apply-templates select="*[2]" mode="inline"/>
+       <xsl:text>)</xsl:text>
+      </xsl:when>
+
+      <xsl:when test="$name='lift'">
+       <a href="{*[1]/@definitionURL}">
+        <xsl:call-template name="mksymbol-1">
+         <xsl:with-param name="symbol" select="$name"/>
+         <xsl:with-param name="color" select="'green'"/>
+         <xsl:with-param name="size" select="'+0'"/>
+        </xsl:call-template>
+       </a>
+       <SUP>
+       <xsl:apply-templates select="*[2]" mode="inline"/>
+       </SUP>
+       <xsl:text>(</xsl:text>
+       <xsl:apply-templates select="*[3]" mode="inline"/>
+       <xsl:text>)</xsl:text>
+      </xsl:when>
+
+      <!-- reduction --> 
+      <xsl:when test="$name='beta_red1'">
+       <xsl:apply-templates select="*[2]" mode="inline"/>
+       <a href="{*[1]/@definitionURL}">
+        <xsl:call-template name="mksymbol-1">
+         <xsl:with-param name="symbol" select="$name"/>
+         <xsl:with-param name="color" select="'green'"/>
+         <xsl:with-param name="size" select="'+0'"/>
+        </xsl:call-template>
+       <SUB>
+        <xsl:call-template name="mksymbol-1">
+         <xsl:with-param name="symbol" select="'beta'"/>
+         <xsl:with-param name="color" select="'green'"/>
+         <xsl:with-param name="size" select="'+0'"/>
+        </xsl:call-template>
+       </SUB>
+       </a>
+       <xsl:apply-templates select="*[3]" mode="inline"/>
+      </xsl:when>
+
+      <xsl:when test="$name='beta_red'">
+       <xsl:apply-templates select="*[2]" mode="inline"/>
+       <a href="{*[1]/@definitionURL}">
+        <xsl:call-template name="mksymbol-1">
+         <xsl:with-param name="symbol" select="$name"/>
+         <xsl:with-param name="color" select="'green'"/>
+         <xsl:with-param name="size" select="'+0'"/>
+        </xsl:call-template>
+       <SUB>
+        <xsl:call-template name="mksymbol-1">
+         <xsl:with-param name="symbol" select="'beta'"/>
+         <xsl:with-param name="color" select="'green'"/>
+         <xsl:with-param name="size" select="'+0'"/>
+        </xsl:call-template>
+        <xsl:text>*</xsl:text>
+       </SUB>
+       </a>
+       <xsl:apply-templates select="*[3]" mode="inline"/>
+      </xsl:when>
+
+      <xsl:when test="$name='par_beta_red1'">
+       <xsl:apply-templates select="*[2]" mode="inline"/>
+       <a href="{*[1]/@definitionURL}">
+        <xsl:call-template name="mksymbol-1">
+         <xsl:with-param name="symbol" select="$name"/>
+         <xsl:with-param name="color" select="'green'"/>
+         <xsl:with-param name="size" select="'+0'"/>
+        </xsl:call-template>
+       <SUB>
+        <xsl:call-template name="mksymbol-1">
+         <xsl:with-param name="symbol" select="'beta'"/>
+         <xsl:with-param name="color" select="'green'"/>
+         <xsl:with-param name="size" select="'+0'"/>
+        </xsl:call-template>
+       </SUB>
+       </a>
+       <xsl:apply-templates select="*[3]" mode="inline"/>
+      </xsl:when>
+
+      <xsl:when test="$name='par_beta_red'">
+       <xsl:apply-templates select="*[2]" mode="inline"/>
+       <a href="{*[1]/@definitionURL}">
+        <xsl:call-template name="mksymbol-1">
+         <xsl:with-param name="symbol" select="$name"/>
+         <xsl:with-param name="color" select="'green'"/>
+         <xsl:with-param name="size" select="'+0'"/>
+        </xsl:call-template>
+       <SUB>
+        <xsl:call-template name="mksymbol-1">
+         <xsl:with-param name="symbol" select="'beta'"/>
+         <xsl:with-param name="color" select="'green'"/>
+         <xsl:with-param name="size" select="'+0'"/>
+        </xsl:call-template>
+        <xsl:text>*</xsl:text>
+       </SUB>
+       </a>
+       <xsl:apply-templates select="*[3]" mode="inline"/>
+      </xsl:when>
+
+      <!-- forgetful -->
+      <xsl:when test="$name='forgetful'">
+       <a href="{*[1]/@definitionURL}">|</a>
+       <xsl:apply-templates select="*[2]" mode="inline"/>
+       <a href="{*[1]/@definitionURL}">|</a>
+      </xsl:when>
+      <!-- boolean algebra of redexes -->
+
+      <!-- isomorphic -->
+      <xsl:when test="$name='isomorphic'">
+       <xsl:apply-templates select="*[2]" mode="inline"/>
+       <a href="{*[1]/@definitionURL}">
+        <xsl:call-template name="mksymbol-1">
+         <xsl:with-param name="symbol" select="$name"/>
+         <xsl:with-param name="color" select="'green'"/>
+         <xsl:with-param name="size" select="'+0'"/>
+        </xsl:call-template>
+       </a>
+       <xsl:apply-templates select="*[3]" mode="inline"/>
+      </xsl:when>
+
       <!-- INTERP -->
       <xsl:when test="$name='interp'">
          <font color="green">[</font>
 </xsl:template>
 
 <xsl:template mode="inline" match="m:lambda">
-      <FONT SIZE="+2" color="red" FACE="symbol">l</FONT>
+      <xsl:call-template name="mksymbol-1">
+       <xsl:with-param name="symbol" select="'lambda'"/>
+       <xsl:with-param name="color" select="'red'"/>
+       <xsl:with-param name="size" select="'+2'"/>
+      </xsl:call-template>
       <xsl:apply-templates select="m:bvar/m:ci"/>
       <xsl:text>:</xsl:text>
       <xsl:apply-templates mode="inline" select="m:bvar/m:type"/>
        <xsl:choose>
        <xsl:when test="$charlength > $framewidth">
          <!-- &#x03a0; -->
-         <FONT FACE="Symbol" SIZE="+2" color="blue">&#x22;</FONT>
+         <xsl:call-template name="mksymbol-1">
+          <xsl:with-param name="symbol" select="$name"/>
+          <xsl:with-param name="color" select="'blue'"/>
+          <xsl:with-param name="size" select="'+2'"/>
+         </xsl:call-template>
          <xsl:apply-templates select="m:bvar/m:ci"/>
          <xsl:text>:</xsl:text>
          <xsl:apply-templates select="m:bvar/m:type">
       <xsl:when test="$name='prod'">
        <xsl:choose>
        <xsl:when test="$charlength > $framewidth">
-         <FONT FACE="Symbol" SIZE="+2" color="blue">&#x00d5;</FONT>
+         <xsl:call-template name="mksymbol-1">
+          <xsl:with-param name="symbol" select="$name"/>
+          <xsl:with-param name="color" select="'blue'"/>
+          <xsl:with-param name="size" select="'+2'"/>
+         </xsl:call-template>
          <xsl:apply-templates select="m:bvar/m:ci"/>
          <xsl:text>:</xsl:text>
          <xsl:apply-templates select="m:bvar/m:type">
         <xsl:with-param name="current_indent" select="$current_indent + 2"/> 
        </xsl:call-template>
        <!-- -> -->
-       <FONT color="blue" SIZE="+0" FACE="symbol">
-        <xsl:text>&#x00ae;</xsl:text>
-       </FONT>
+       <xsl:call-template name="mksymbol-1">
+        <xsl:with-param name="symbol" select="$name"/>
+        <xsl:with-param name="color" select="'blue'"/>
+        <xsl:with-param name="size" select="'+0'"/>
+       </xsl:call-template>
        <xsl:apply-templates select="*[position()=3]">
         <xsl:with-param name="current_indent" select="$current_indent + 5"/>
        </xsl:apply-templates>
           <xsl:with-param name="current_indent" select="$current_indent + 2"/>
          </xsl:apply-templates>
          <xsl:text>&gt; </xsl:text>
+         <br/>
+         <xsl:call-template name="make_indent">
+          <xsl:with-param name="current_indent" select="$current_indent + 2"/>           </xsl:call-template>
          <xsl:text>CASE </xsl:text>
          <xsl:apply-templates select="*[position()=3]">
           <xsl:with-param name="current_indent" select="$current_indent + 8"/>
          </xsl:apply-templates>
          <xsl:text> OF </xsl:text> 
-         <xsl:for-each select="*[position() mod 2 = 0 and position()>3]">
+         <xsl:for-each select="piecewise/piece">
+    <!--   <xsl:for-each select="*[position() mod 2 = 0 and position()>3]">-->
          <br/>
          <xsl:call-template name="make_indent">
-            <xsl:with-param name="current_indent" select="$current_indent + 2"/>  
+          <xsl:with-param name="current_indent" select="$current_indent + 2"/> 
          </xsl:call-template> 
             <xsl:choose>
             <xsl:when test="position() = 1">
              <xsl:text>| </xsl:text>
             </xsl:otherwise>
             </xsl:choose>
-            <xsl:apply-templates select="."/>
-            <FONT FACE="Symbol" SIZE="+0" mathcolor="green">&#222;</FONT>
-            <xsl:apply-templates select="following-sibling::*[position()= 1]">
-             <xsl:with-param name="current_indent" select="$current_indent + 4 + string-length()"/>
-            </xsl:apply-templates>
+          <xsl:apply-templates select="./*[2]"/>
+            <xsl:call-template name="mksymbol-1">
+             <xsl:with-param name="symbol" select="'RightArrow'"/>
+             <xsl:with-param name="color" select="'green'"/>
+             <xsl:with-param name="size" select="'+0'"/>
+            </xsl:call-template>
+            <xsl:variable name="body_size">
+  <xsl:apply-templates 
+              select="./*[1]/*[1]" mode="charcount"/>
+            </xsl:variable>
+            <xsl:choose>
+             <xsl:when test="$body_size > $framewidth">
+              <br/>
+              <xsl:call-template name="make_indent">
+               <xsl:with-param name="current_indent" 
+                    select="$current_indent + 8"/>   
+              </xsl:call-template>
+<xsl:apply-templates 
+                   select="./*[1]">
+              <xsl:with-param name="current_indent" 
+                   select="$current_indent + 8"/>      
+             </xsl:apply-templates>
+            </xsl:when>
+            <xsl:otherwise>
+     <xsl:apply-templates select="./*[1]"
+                   mode="inline" />
+            </xsl:otherwise>
+           </xsl:choose>
          </xsl:for-each>
        </xsl:when>
        <xsl:otherwise>
        </xsl:otherwise>
        </xsl:choose>
       </xsl:when>
+      <xsl:when test="$name='let_in'">
+       <xsl:text>let&#x00a0;</xsl:text>
+       <xsl:apply-templates select="m:bvar/m:ci"/>
+       <xsl:text>&#x00a0;:=&#x00a0;</xsl:text>
+       <xsl:apply-templates select="*[3]">
+        <xsl:with-param name="current_indent" select="$current_indent+14"/>
+       </xsl:apply-templates>
+       <br/>
+       <xsl:call-template name="make_indent">
+        <xsl:with-param name="current_indent" select="$current_indent"/> 
+       </xsl:call-template>
+       <xsl:text>in&#x00a0;</xsl:text>
+       <xsl:apply-templates select="*[4]">
+        <xsl:with-param name="current_indent" select="$current_indent+5"/>
+       </xsl:apply-templates>
+      </xsl:when>
+
       <!-- ***************************************** -->
       <!-- *********** PROOF ELEMENTS ************** -->
       <!-- ***************************************** -->
         </xsl:otherwise>
        </xsl:choose>
        <xsl:variable name="charlength_first">
-        <xsl:apply-templates select="*[3]" mode="charcount"/>
+        <xsl:apply-templates select="*[3]/*[1]" mode="charcount"/>
        </xsl:variable>
        <xsl:variable name="charlength_second">
-        <xsl:apply-templates select="*[4]" mode="charcount"/>
+        <xsl:apply-templates select="*[4]/*[1]" mode="charcount"/>
        </xsl:variable>
        <xsl:variable name="charlength_side_proof">
-        <xsl:apply-templates select="*[5]" mode="charcount"/>
+        <xsl:apply-templates select="*[5]/*[1]" mode="charcount"/>
        </xsl:variable>
        <xsl:variable name="split1"
           select="$charlength_first + $charlength_second > $framewidth"/>
        <xsl:if test="$split1">
        <br/>
        <xsl:call-template name="make_indent">
-        <xsl:with-param name="current_indent" select="$current_indent"/> 
+        <xsl:with-param name="current_indent" select="$current_indent + 2"/> 
        </xsl:call-template>
        </xsl:if>
        <FONT color="red">with&#x00a0;</FONT>
        <xsl:if test="$split2">
        <br/>
        <xsl:call-template name="make_indent">
-        <xsl:with-param name="current_indent" select="$current_indent"/> 
+        <xsl:with-param name="current_indent" select="$current_indent + 2"/> 
        </xsl:call-template>
        </xsl:if>
        <FONT color="red">by&#x00a0;</FONT>
        <xsl:apply-templates select="*[5]">
-        <xsl:with-param name="current_indent" select="$current_indent+5"/>
+        <xsl:with-param name="current_indent" select="$current_indent+7"/>
        </xsl:apply-templates>
       </xsl:when>
       <!-- rewrite and apply -->
         </xsl:otherwise>
        </xsl:choose>
       </xsl:when>
-      <!-- nat_ind -->
-      <xsl:when test="$name='nat_ind_complete'">
-       <FONT color="red">By induction on&#x00a0;</FONT>
-       <xsl:apply-templates select="*[2]"/>:
-       <br/>
-       <xsl:call-template name="make_indent">
-        <xsl:with-param name="current_indent" select="$current_indent"/> 
-       </xsl:call-template>
-       <xsl:text>0&#x00a0;</xsl:text>
-       <FONT FACE="Symbol" mathcolor="green">&#222;</FONT>
-       <xsl:apply-templates select="*[3]">
-        <xsl:with-param name="current_indent" select="$current_indent + 8"/>
-       </xsl:apply-templates>
-       <br/>
-       <xsl:call-template name="make_indent">
-        <xsl:with-param name="current_indent" select="$current_indent"/> 
-       </xsl:call-template>
-       <xsl:text>S(</xsl:text>
-       <xsl:apply-templates select="*[4]"/>
-       <xsl:text>)&#x00a0;</xsl:text>
-       <FONT FACE="Symbol" mathcolor="green">&#222;</FONT>
-       <FONT color="red">Assume by induction</FONT>
-       <br/>
-       <xsl:call-template name="make_indent">
-        <xsl:with-param name="current_indent" select="$current_indent +10"/> 
-       </xsl:call-template>
-       <xsl:text>(</xsl:text>
-       <xsl:apply-templates select="*[5]"/>
-       <xsl:text>)</xsl:text>
-       <xsl:apply-templates select="*[6]">
-        <xsl:with-param name="current_indent" select="$current_indent + 14"/>
-       </xsl:apply-templates>
-       <br/>
-       <xsl:call-template name="make_indent">
-        <xsl:with-param name="current_indent" select="$current_indent +10"/> 
-       </xsl:call-template>
-       <xsl:apply-templates select="*[7]">
-        <xsl:with-param name="current_indent" select="$current_indent + 10"/>
-       </xsl:apply-templates>
-      </xsl:when>
       <!-- false_ind -->
       <xsl:when test="$name='false_ind'">
        <xsl:apply-templates select="*[3]">
        <xsl:call-template name="make_indent">
         <xsl:with-param name="current_indent" select="$current_indent"/> 
        </xsl:call-template>
-       *
+       Left:&#x00a0;
        <xsl:apply-templates select="*[4]">
         <xsl:with-param name="current_indent" select="$current_indent"/> 
        </xsl:apply-templates>
        <xsl:call-template name="make_indent">
         <xsl:with-param name="current_indent" select="$current_indent"/> 
        </xsl:call-template>
-       *
+       Right:&#x00a0;
        <xsl:apply-templates select="*[5]">
         <xsl:with-param name="current_indent" select="$current_indent"/> 
        </xsl:apply-templates>
         <xsl:with-param name="current_indent" select="$current_indent"/>
        </xsl:apply-templates>
       </xsl:when>
+      <!-- ***************************************** -->
+      <!-- *********** LAMBDA ELEMENTS ************** -->
+      <!-- ***************************************** -->
+      <xsl:when test="$name='subst'">
+       <xsl:apply-templates select="*[3]"/>
+       <xsl:text>[</xsl:text>
+       <xsl:apply-templates select="*[4]"/>
+       <a href="{*[1]/@definitionURL}">
+        <xsl:call-template name="mksymbol-1">
+         <xsl:with-param name="symbol" select="$name"/>
+         <xsl:with-param name="color" select="'blue'"/>
+         <xsl:with-param name="size" select="'+0'"/>
+        </xsl:call-template>
+       </a>
+       <xsl:apply-templates select="*[2]"/>
+       <xsl:text>]</xsl:text>
+      </xsl:when>
+
+      <xsl:when test="$name='lift_with_base'">
+       <SUB>
+       <xsl:apply-templates select="*[3]" mode="inline"/>
+       </SUB>
+       <a href="{*[1]/@definitionURL}">
+        <xsl:call-template name="mksymbol-1">
+         <xsl:with-param name="symbol" select="$name"/>
+         <xsl:with-param name="color" select="'green'"/>
+         <xsl:with-param name="size" select="'+0'"/>
+        </xsl:call-template>
+       </a>
+       <SUP>
+       <xsl:apply-templates select="*[4]" mode="inline"/>
+       </SUP>
+       <xsl:text>(</xsl:text>
+       <xsl:apply-templates select="*[2]" mode="inline"/>
+       <xsl:text>)</xsl:text>
+      </xsl:when>
+
+      <xsl:when test="$name='lift'">
+       <a href="{*[1]/@definitionURL}">
+        <xsl:call-template name="mksymbol-1">
+         <xsl:with-param name="symbol" select="$name"/>
+         <xsl:with-param name="color" select="'green'"/>
+         <xsl:with-param name="size" select="'+0'"/>
+        </xsl:call-template>
+       </a>
+       <SUP>
+       <xsl:apply-templates select="*[2]" mode="inline"/>
+       </SUP>
+       <xsl:text>(</xsl:text>
+       <xsl:apply-templates select="*[3]" mode="inline"/>
+       <xsl:text>)</xsl:text>
+      </xsl:when>
+
+      <!-- reduction --> 
+      <xsl:when test="$name='beta_red1'">
+       <xsl:apply-templates select="*[2]" mode="inline"/>
+       <a href="{*[1]/@definitionURL}">
+        <xsl:call-template name="mksymbol-1">
+         <xsl:with-param name="symbol" select="$name"/>
+         <xsl:with-param name="color" select="'green'"/>
+         <xsl:with-param name="size" select="'+0'"/>
+        </xsl:call-template>
+       <SUB>
+        <xsl:call-template name="mksymbol-1">
+         <xsl:with-param name="symbol" select="'beta'"/>
+         <xsl:with-param name="color" select="'green'"/>
+         <xsl:with-param name="size" select="'+0'"/>
+        </xsl:call-template>
+       </SUB>
+       </a>
+       <xsl:apply-templates select="*[3]" mode="inline"/>
+      </xsl:when>
+      <xsl:when test="$name='beta_red'">
+       <xsl:apply-templates select="*[2]" mode="inline"/>
+       <a href="{*[1]/@definitionURL}">
+        <xsl:call-template name="mksymbol-1">
+         <xsl:with-param name="symbol" select="$name"/>
+         <xsl:with-param name="color" select="'green'"/>
+         <xsl:with-param name="size" select="'+0'"/>
+        </xsl:call-template>
+       <SUB>
+        <xsl:call-template name="mksymbol-1">
+         <xsl:with-param name="symbol" select="'beta'"/>
+         <xsl:with-param name="color" select="'green'"/>
+         <xsl:with-param name="size" select="'+0'"/>
+        </xsl:call-template>
+        <xsl:text>*</xsl:text>
+       </SUB>
+       </a>
+       <xsl:apply-templates select="*[3]" mode="inline"/>
+      </xsl:when>
+
+      <xsl:when test="$name='par_beta_red1'">
+       <xsl:apply-templates select="*[2]" mode="inline"/>
+       <a href="{*[1]/@definitionURL}">
+        <xsl:call-template name="mksymbol-1">
+         <xsl:with-param name="symbol" select="$name"/>
+         <xsl:with-param name="color" select="'green'"/>
+         <xsl:with-param name="size" select="'+0'"/>
+        </xsl:call-template>
+       <SUB>
+        <xsl:call-template name="mksymbol-1">
+         <xsl:with-param name="symbol" select="'beta'"/>
+         <xsl:with-param name="color" select="'green'"/>
+         <xsl:with-param name="size" select="'+0'"/>
+        </xsl:call-template>
+       </SUB>
+       </a>
+       <xsl:apply-templates select="*[3]" mode="inline"/>
+      </xsl:when>
+
+      <xsl:when test="$name='par_beta_red'">
+       <xsl:apply-templates select="*[2]" mode="inline"/>
+       <a href="{*[1]/@definitionURL}">
+        <xsl:call-template name="mksymbol-1">
+         <xsl:with-param name="symbol" select="$name"/>
+         <xsl:with-param name="color" select="'green'"/>
+         <xsl:with-param name="size" select="'+0'"/>
+        </xsl:call-template>
+       <SUB>
+        <xsl:call-template name="mksymbol-1">
+         <xsl:with-param name="symbol" select="'beta'"/>
+         <xsl:with-param name="color" select="'green'"/>
+         <xsl:with-param name="size" select="'+0'"/>
+        </xsl:call-template>
+        <xsl:text>*</xsl:text>
+       </SUB>
+       </a>
+       <xsl:apply-templates select="*[3]" mode="inline"/>
+      </xsl:when>
+
+      <!-- forgetful -->
+      <xsl:when test="$name='forgetful'">
+       <a href="{*[1]/@definitionURL}">|</a>
+       <xsl:apply-templates select="*[2]" mode="inline"/>
+       <a href="{*[1]/@definitionURL}">|</a>
+      </xsl:when>
+      <!-- boolean algebra of redexes -->
+
+      <!-- isomorphic -->
+      <xsl:when test="$name='isomorphic'">
+       <xsl:apply-templates select="*[2]" mode="inline"/>
+       <a href="{*[1]/@definitionURL}">
+        <xsl:call-template name="mksymbol-1">
+         <xsl:with-param name="symbol" select="$name"/>
+         <xsl:with-param name="color" select="'green'"/>
+         <xsl:with-param name="size" select="'+0'"/>
+        </xsl:call-template>
+       </a>
+       <xsl:apply-templates select="*[3]" mode="inline"/>
+      </xsl:when>
 
       <!-- INTERP -->
       <xsl:when test="$name='interp'">
      <xsl:choose>
      <xsl:when test="$charlength > $framewidth">
        <!-- &#x03bb; -->
-       <FONT SIZE="+2" color="red" FACE="symbol">l</FONT>
+       <xsl:call-template name="mksymbol-1">
+        <xsl:with-param name="symbol" select="'lambda'"/>
+        <xsl:with-param name="color" select="'red'"/>
+        <xsl:with-param name="size" select="'+2'"/>
+       </xsl:call-template>
        <xsl:apply-templates select="m:bvar/m:ci"/>
        <xsl:text>:</xsl:text>
        <xsl:apply-templates select="m:bvar/m:type">