]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/style/content.xsl
When downloading stylesheets, substitutes all relative URLs with
[helm.git] / helm / style / content.xsl
index 948cbbaecc1989cdadcdf89c915160c72063d84c..65f9825128b4eb13d0208c8b2def3e359ea71786 100644 (file)
@@ -1,5 +1,29 @@
 <?xml version="1.0"?>
 
+<!-- Copyright (C) 2000, HELM Team                                     -->
+<!--                                                                   -->
+<!-- This file is part of HELM, an Hypertextual, Electronic            -->
+<!-- Library of Mathematics, developed at the Computer Science         -->
+<!-- Department, University of Bologna, Italy.                         -->
+<!--                                                                   -->
+<!-- HELM is free software; you can redistribute it and/or             -->
+<!-- modify it under the terms of the GNU General Public License       -->
+<!-- as published by the Free Software Foundation; either version 2    -->
+<!-- of the License, or (at your option) any later version.            -->
+<!--                                                                   -->
+<!-- HELM is distributed in the hope that it will be useful,           -->
+<!-- but WITHOUT ANY WARRANTY; without even the implied warranty of    -->
+<!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the     -->
+<!-- GNU General Public License for more details.                      -->
+<!--                                                                   -->
+<!-- You should have received a copy of the GNU General Public License -->
+<!-- along with HELM; if not, write to the Free Software               -->
+<!-- Foundation, Inc., 59 Temple Place - Suite 330, Boston,            -->
+<!-- MA  02111-1307, USA.                                              -->
+<!--                                                                   -->
+<!-- For details, see the HELM World-Wide-Web page,                    -->
+<!-- http://cs.unibo.it/helm/.                                         -->
+
 <!--******************************************************************--> 
 <!-- XSLT version 0.1 of CIC objects to MathML content:               -->
 <!-- First draft: February 14 2000, Andrea Asperti, Irene Schena      -->
@@ -55,6 +79,19 @@ Amaya o da chi di dovere in /really_very_local/helm/PARSER/example/.../]
     </m:lambda>
 </xsl:template>
 
+<xsl:template match="LETIN" mode="pure">
+    <m:apply helm:xref="{@id}">
+     <m:csymbol>let_in</m:csymbol>
+     <m:bvar>
+      <m:ci>
+       <xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="letintarget/@binder"/></xsl:with-param></xsl:call-template>
+      </m:ci>
+     </m:bvar>
+     <xsl:apply-templates select="*[1]" mode="noannot"/>
+     <xsl:apply-templates select="letintarget/*[1]" mode="noannot"/>
+    </m:apply>
+</xsl:template>
+
 <xsl:template match="PROD" mode="pure">
     <m:apply helm:xref="{@id}">
      <xsl:choose>
@@ -63,7 +100,14 @@ Amaya o da chi di dovere in /really_very_local/helm/PARSER/example/.../]
       <xsl:apply-templates select="source/*[1]" mode="noannot"/>
      </xsl:when>
      <xsl:otherwise>
-      <m:csymbol>prod</m:csymbol>
+      <xsl:choose>
+       <xsl:when test="@type = 'Prop'">
+        <m:csymbol>forall</m:csymbol>
+       </xsl:when>
+       <xsl:otherwise>
+        <m:csymbol>prod</m:csymbol>
+       </xsl:otherwise>
+      </xsl:choose>
        <m:bvar>
         <m:ci>
          <xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="target/@binder"/></xsl:with-param></xsl:call-template>
@@ -103,12 +147,13 @@ Amaya o da chi di dovere in /really_very_local/helm/PARSER/example/.../]
    <xsl:choose>
     <!-- <xsl:when test="//InnerTypes and boolean(key('typeid',*/@id))"> -->
     <!-- start looking for subproofs -->
-    <xsl:when test="((*/@id) = (//InnerTypes/TYPE/@of))"> 
+    <!-- <xsl:when test="((*/@id) = (//InnerTypes/TYPE/@of))"> -->
+    <xsl:when test="//InnerTypes and count(*[@sort='Prop' and (name(.)='LAMBDA' or name(.)='LETIN' or name(.)='APPLY' or name(.)='MUTCASE' or name(.)='FIX' or name(.)='COFIX')]) > 0">
      <m:apply helm:xref="{@id}">
       <m:csymbol>letin</m:csymbol>
       <!-- <xsl:for-each select="*[boolean(key('typeid',@id))]"> -->
       <!-- first process all subproofs (let-in) -->
-      <xsl:for-each select="*[@id = (//InnerTypes/TYPE/@of)]">
+      <xsl:for-each select="*[@sort='Prop' and (name(.)='LAMBDA' or name(.)='LETIN' or name(.)='APPLY' or name(.)='MUTCASE' or name(.)='FIX' or name(.)='COFIX')]">
        <m:apply>
         <m:csymbol>let</m:csymbol>
         <m:ci><xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="concat('h',position())"/></xsl:with-param></xsl:call-template></m:ci>
@@ -135,26 +180,17 @@ Amaya o da chi di dovere in /really_very_local/helm/PARSER/example/.../]
 
 <xsl:template match="*" mode="flat">
  <xsl:param name="n" select="1"/>
+ <xsl:variable name="id" select="@id"/>
  <xsl:choose>
-  <xsl:when test="@id">
-   <xsl:variable name="id" select="@id"/>
-   <xsl:choose>
-    <!-- <xsl:when test="key('typeid',@id)"> -->
-    <xsl:when test="//InnerTypes/TYPE[@of=$id]">
-     <m:ci>
-      <xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="concat('h',$n)"/></xsl:with-param></xsl:call-template>
-     </m:ci>
-     <xsl:apply-templates mode="flat" select="following-sibling::*[1]">
-      <xsl:with-param name="n" select="$n+1"/>
-     </xsl:apply-templates>
-    </xsl:when>
-    <xsl:otherwise>
-     <xsl:apply-templates mode="pure" select="."/>
-     <xsl:apply-templates mode="flat" select="following-sibling::*[1]">
-      <xsl:with-param name="n" select="$n"/>
-     </xsl:apply-templates>
-    </xsl:otherwise>
-   </xsl:choose>
+  <!-- <xsl:when test="key('typeid',@id)"> -->
+  <!-- <xsl:when test="//InnerTypes/TYPE[@of=$id]"> -->
+  <xsl:when test="//InnerTypes and @sort='Prop' and (name(.)='LAMBDA' or name(.)='LETIN' or name(.)='APPLY' or name(.)='MUTCASE' or name(.)='FIX' or name(.)='COFIX')">
+   <m:ci>
+    <xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="concat('h',$n)"/></xsl:with-param></xsl:call-template>
+   </m:ci>
+   <xsl:apply-templates mode="flat" select="following-sibling::*[1]">
+    <xsl:with-param name="n" select="$n+1"/>
+   </xsl:apply-templates>
   </xsl:when>
   <xsl:otherwise>
    <xsl:apply-templates mode="pure" select="."/>