]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/style/content.xsl
New version of proof.xsl
[helm.git] / helm / style / content.xsl
index afeb75493ff8a0f59de6e1f240157d98b4a33981..5aafef63f6bfb347b801b74fd3d35dbe2acb0916 100644 (file)
@@ -57,11 +57,6 @@ la forma cic:/.../ in definitionURL e questo schema di uri verra' risolto da
 Amaya o da chi di dovere in /really_very_local/helm/PARSER/example/.../]
 -->
 
-<!--******************************************************************-->
-<!-- Variable containing the absolute path of the CIC file            -->
-<!--******************************************************************-->
-
-<xsl:variable name="absPath">http://localhost:8081/getciconly?uri=</xsl:variable>
 
 <!-- CIC TERMS -->
 
@@ -79,6 +74,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>
@@ -131,63 +139,12 @@ Amaya o da chi di dovere in /really_very_local/helm/PARSER/example/.../]
 </xsl:template>
 
 <xsl:template match="APPLY" mode="pure">
-   <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="//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="*[@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>
-        <xsl:apply-templates mode="noannot" select="."/>
-       </m:apply>
-      </xsl:for-each>
-      <!-- now re-process the application in mode appflat -->
-      <xsl:apply-templates mode="appflat" select="."/> 
-     </m:apply>
-    </xsl:when>
-    <xsl:otherwise>
-     <xsl:apply-templates mode="appflat" select="."/>
-    </xsl:otherwise>
-   </xsl:choose>
-</xsl:template>
-
-<xsl:template match="APPLY" mode="appflat">
       <m:apply helm:xref="{@id}">
        <m:csymbol>app</m:csymbol>
-       <!-- mode flat looks for siblings: call with the first child -->
-       <xsl:apply-templates mode="flat" select="*[1]"/>
+       <xsl:apply-templates mode="noannot" select="*"/>
       </m:apply>
 </xsl:template>
 
-<xsl:template match="*" mode="flat">
- <xsl:param name="n" select="1"/>
- <xsl:variable name="id" select="@id"/>
- <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="."/>
-   <xsl:apply-templates mode="flat" select="following-sibling::*[1]">
-    <xsl:with-param name="n" select="$n"/>
-   </xsl:apply-templates>
-  </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
 <xsl:template match="VAR" mode="pure">
     <m:ci helm:xref="{@id}">
      <xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="substring-after(@relUri,&quot;,&quot;)"/></xsl:with-param></xsl:call-template>