]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/style/content.xsl
*** empty log message ***
[helm.git] / helm / style / content.xsl
index d557cb5e87f57b043aa424746b34cdd547b9ab19..e4712613802889706116468f0ebbab55ec97ecfc 100644 (file)
@@ -62,38 +62,6 @@ Amaya o da chi di dovere in /really_very_local/helm/PARSER/example/.../]
 
 <!-- CIC TERMS -->
 
-<!--xsl:template match="LAMBDA" mode="pure">
-    <m:lambda helm:xref="{decl/@id}">
-     <m:bvar>
-      <m:ci>
-       <xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="decl/@binder"/></xsl:with-param></xsl:call-template>
-      </m:ci>
-      <m:type>
-       <xsl:apply-templates select="decl/*[1]" mode="noannot"/>
-      </m:type>
-     </m:bvar>
-     <xsl:apply-templates select="target/*[1]" mode="noannot"/>
-    </m:lambda>
-</xsl:template-->
-
-<!--xsl:template match="LAMBDA" mode="pure">
-       <xsl:for-each select="decl">
-        <m:lambda helm:xref="{@id}">
-         <m:bvar>
-          <m:ci>
-           <xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="@binder"/></xsl:with-param></xsl:call-template>
-          </m:ci>
-          <m:type>
-           <xsl:apply-templates select="*[1]" mode="noannot"/>
-           </m:type>
-         </m:bvar>
-        </m:lambda>
-       </xsl:for-each>
-       <xsl:apply-templates select="target/*[1]" mode="noannot"/-->
-        <!--xsl:for-each select="decl">
-         </m:lambda>
-        </xsl:for-each-->
-<!--/xsl:template-->
 
 <xsl:template match="LAMBDA" mode="pure">
        <xsl:apply-templates select="*[1]" mode="lambda"/>
@@ -113,28 +81,20 @@ Amaya o da chi di dovere in /really_very_local/helm/PARSER/example/.../]
        </m:lambda>
 </xsl:template>
 
+
 <xsl:template match="target" mode="lambda">
        <xsl:apply-templates select="*[1]" mode="noannot"/>
 </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="LETIN" mode="pure">
-       <xsl:apply-templates select="*[1]" mode="letin"/>
+       <xsl:apply-templates select="*[1]" mode="letin_pure"/>
 </xsl:template>
 
-<xsl:template match="def" mode="letin">        
+<!-- Andrea: mode letin already exists in proofs.xsl, with a 
+    different meaning -->
+
+<xsl:template match="def" mode="letin_pure">   
     <m:apply helm:xref="{@id}">
      <m:csymbol>let_in</m:csymbol>
      <m:bvar>
@@ -143,50 +103,21 @@ Amaya o da chi di dovere in /really_very_local/helm/PARSER/example/.../]
       </m:ci>
      </m:bvar>
      <xsl:apply-templates select="*[1]" mode="noannot"/>
-     <xsl:apply-templates select="following-sibling::*[1]" mode="letin"/>
+     <xsl:apply-templates select="following-sibling::*[1]" mode="letin_pure"/>
     </m:apply>
 </xsl:template>
 
-<xsl:template match="target" mode="letin">
+
+<xsl:template match="target" mode="letin_pure">
        <xsl:apply-templates select="*[1]" mode="noannot"/>
 </xsl:template>
 
-<!--xsl:template match="PROD" mode="pure">
-    <xsl:for-each select="decl">
-     <m:apply helm:xref="{@id}">
-      <xsl:choose>
-       <xsl:when test="string(@binder)= &quot;&quot;">
-        <m:csymbol>arrow</m:csymbol>
-        <xsl:apply-templates select="*[1]" mode="noannot"/>
-       </xsl:when>
-       <xsl:otherwise>
-        <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="@binder"/></xsl:with-param></xsl:call-template>
-         </m:ci>
-         <m:type>
-          <xsl:apply-templates select="*[1]" mode="noannot"/>
-         </m:type>
-        </m:bvar>
-       </xsl:otherwise>
-      </xsl:choose>
-     </m:apply>
-    </xsl:for-each>
-    <xsl:apply-templates select="target/*[1]" mode="noannot"/> 
-</xsl:template-->
 
 <xsl:template match="PROD" mode="pure">
        <xsl:apply-templates select="*[1]" mode="prod"/>
 </xsl:template>
 
+
 <xsl:template match="decl" mode="prod">
      <m:apply helm:xref="{@id}">
       <xsl:choose>
@@ -222,6 +153,7 @@ Amaya o da chi di dovere in /really_very_local/helm/PARSER/example/.../]
        <xsl:apply-templates select="*[1]" mode="noannot"/>
 </xsl:template>
 
+
 <xsl:template match="CAST" mode="pure">
     <m:apply helm:xref="{@id}">
      <m:csymbol>cast</m:csymbol>
@@ -229,12 +161,14 @@ Amaya o da chi di dovere in /really_very_local/helm/PARSER/example/.../]
     </m:apply>
 </xsl:template>
 
+
 <xsl:template match="REL" mode="pure">
     <m:ci helm:xref="{@id}">
      <xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="@binder"/></xsl:with-param></xsl:call-template>
     </m:ci>
 </xsl:template>
 
+
 <xsl:template match="SORT" mode="pure">
     <m:apply helm:xref="{@id}">
      <m:csymbol>
@@ -243,6 +177,7 @@ Amaya o da chi di dovere in /really_very_local/helm/PARSER/example/.../]
     </m:apply>
 </xsl:template>
 
+
 <xsl:template match="APPLY" mode="pure">
       <m:apply helm:xref="{@id}">
        <m:csymbol>app</m:csymbol>
@@ -250,6 +185,7 @@ Amaya o da chi di dovere in /really_very_local/helm/PARSER/example/.../]
       </m:apply>
 </xsl:template>
 
+
 <!-- Gestione senza pre-processing -->
 <!-- 
 <xsl:template match="APPLY" mode="pure">
@@ -267,12 +203,11 @@ Amaya o da chi di dovere in /really_very_local/helm/PARSER/example/.../]
 <xsl:template match="VAR" mode="pure">
     <m:ci helm:xref="{@id}">
      <xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:call-template name="name_of_uri_bis">
-          <xsl:with-param name="uri" select="@uri"/>
-             </xsl:call-template>
-             </xsl:with-param></xsl:call-template>
+      <xsl:with-param name="uri" select="@uri"/></xsl:call-template></xsl:with-param></xsl:call-template>
     </m:ci>
 </xsl:template>
 
+
 <xsl:template match="META" mode="pure">
    <m:apply helm:xref="{@id}">
     <m:csymbol>meta</m:csymbol>
@@ -297,6 +232,7 @@ Amaya o da chi di dovere in /really_very_local/helm/PARSER/example/.../]
    </m:apply>
 </xsl:template>
 
+
 <xsl:template match="CONST" mode="pure">
    <m:ci definitionURL="{@uri}" helm:xref="{@id}">
       <xsl:call-template name="insert_subscript">
@@ -309,6 +245,7 @@ Amaya o da chi di dovere in /really_very_local/helm/PARSER/example/.../]
    </m:ci>
 </xsl:template>
 
+
 <xsl:template match="MUTIND" mode="pure">
     <m:ci definitionURL="{@uri}" helm:xref="{@id}">
      <xsl:variable name="InductiveTypeUrl"><xsl:call-template name="URLofURI4getter"><xsl:with-param name="uri" select="@uri"/></xsl:call-template></xsl:variable>
@@ -317,6 +254,7 @@ Amaya o da chi di dovere in /really_very_local/helm/PARSER/example/.../]
     </m:ci>
 </xsl:template>
 
+
 <xsl:template match="MUTCONSTRUCT" mode="pure">
     <m:ci definitionURL="{@uri}" helm:xref="{@id}">
      <xsl:variable name="InductiveTypeUrl"><xsl:call-template name="URLofURI4getter"><xsl:with-param name="uri" select="@uri"/></xsl:call-template></xsl:variable>
@@ -326,6 +264,7 @@ Amaya o da chi di dovere in /really_very_local/helm/PARSER/example/.../]
     </m:ci>
 </xsl:template>
 
+
 <xsl:template match="MUTCASE" mode="pure">
     <xsl:variable name="Tindex"><xsl:value-of select="@noType"/></xsl:variable>
     <xsl:variable name="Turi"><xsl:value-of select="@uriType"/></xsl:variable>
@@ -364,6 +303,7 @@ Amaya o da chi di dovere in /really_very_local/helm/PARSER/example/.../]
     </m:apply>
 </xsl:template>
 
+
 <xsl:template match="FIX" mode="pure">
     <m:apply helm:xref="{@id}">
      <xsl:variable name="findex"><xsl:value-of select="@noFun"/></xsl:variable>
@@ -373,6 +313,7 @@ Amaya o da chi di dovere in /really_very_local/helm/PARSER/example/.../]
     </m:apply>
 </xsl:template>
 
+
 <xsl:template match="COFIX" mode="pure">
    <m:apply helm:xref="{@id}">
      <xsl:variable name="findex"><xsl:value-of select="@noFun"/></xsl:variable>
@@ -382,6 +323,32 @@ Amaya o da chi di dovere in /really_very_local/helm/PARSER/example/.../]
     </m:apply>
 </xsl:template>
 
+<xsl:template match="instantiate" mode="pure">
+       <m:apply helm:xref="{@id}">
+        <m:csymbol>inst</m:csymbol>
+        <xsl:apply-templates mode="noannot" select="*[1]" />
+        <xsl:for-each select="arg">
+          <xsl:variable name="base_path">
+           <xsl:call-template name="path">
+            <xsl:with-param name="uri" select="../*[1]/@uri"/>
+           </xsl:call-template>
+          </xsl:variable>
+          <xsl:variable name="varUri" select="concat($base_path,@relUri)"/>
+         <m:ci definitionURL="{$varUri}">
+           <xsl:call-template name="insert_subscript">
+            <xsl:with-param name="node_value">
+             <xsl:call-template name="name_of_uri">
+              <xsl:with-param name="uri" select="$varUri"/>
+              <xsl:with-param name="extension" select="'.var'"/>
+             </xsl:call-template>
+            </xsl:with-param>
+           </xsl:call-template>
+          </m:ci>
+         <xsl:apply-templates mode ="noannot" select="*[1]" />
+        </xsl:for-each>
+       </m:apply>
+</xsl:template>
+
 <!-- ELEMENTS OF CIC TERMS -->
 
 <xsl:template match="FixFunction" mode="pure">
@@ -392,6 +359,7 @@ Amaya o da chi di dovere in /really_very_local/helm/PARSER/example/.../]
     <xsl:apply-templates select="body/*[1]" mode="noannot"/>
 </xsl:template>
 
+
 <xsl:template match="CofixFunction" mode="pure">
     <m:bvar>
      <m:ci><xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="@name"/></xsl:with-param></xsl:call-template></m:ci>