]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/style/drop_coercions.xsl
Initial revision
[helm.git] / helm / style / drop_coercions.xsl
index a259955dd305a38584e7909023846835fc6962ad..b31160eab490d350a6b0d24f10604d17a33cc855 100644 (file)
@@ -34,7 +34,7 @@
 
 <xsl:param name="CICURI" select="''"/>
 <xsl:param name="getterURL" select="''"/>
-<xsl:variable name="absPath"><xsl:value-of select="$getterURL"/>getxml?uri=</xsl:variable>
+<xsl:include href="getter.xsl"/>
 <xsl:include href="params.xsl"/>
 
 <!-- coercions -->
     </xsl:choose>
 </xsl:template>
 
+<xsl:template match="APPLY[CONST[position()='1' and 
+   @uri='cic:/Algebra/CSetoids/CSetoid_relations_and_predicates/csr_rel.con']]">
+     <xsl:variable name="no_params">
+      <xsl:call-template name="get_no_params">
+       <xsl:with-param name="first_uri" select="$CICURI"/>
+       <xsl:with-param name="second_uri" select="CONST[1]/@uri"/>
+      </xsl:call-template>
+     </xsl:variable>
+    <xsl:choose>
+     <xsl:when test="(count(child::*) - number($no_params)) = 4">
+      <xsl:choose>
+       <xsl:when test="name(*[2+$no_params])='APPLY'">
+        <APPLY id="{@id}" sort="{@sort}">
+         <xsl:apply-templates select="*[2+$no_params]/*"/>
+         <xsl:apply-templates select="*[3+$no_params]"/>
+         <xsl:apply-templates select="*[4+$no_params]"/>
+        </APPLY>
+       </xsl:when>
+       <xsl:otherwise>
+        <APPLY id="{@id}" sort="{@sort}">
+         <xsl:apply-templates select="*[2+$no_params]"/>
+         <xsl:apply-templates select="*[3+$no_params]"/>
+         <xsl:apply-templates select="*[4+$no_params]"/>
+        </APPLY>
+       </xsl:otherwise>
+      </xsl:choose>
+     </xsl:when>
+     <xsl:otherwise>
+      <APPLY id="{@id}" sort="{@sort}">
+       <xsl:apply-templates select="*"/>
+      </APPLY>
+     </xsl:otherwise>
+    </xsl:choose>
+</xsl:template>
+
+<xsl:template match="APPLY[CONST[position()='1' and 
+   @uri='cic:/Algebra/CRings/nat_injection/nring.con']]">
+     <xsl:variable name="no_params">
+      <xsl:call-template name="get_no_params">
+       <xsl:with-param name="first_uri" select="$CICURI"/>
+       <xsl:with-param name="second_uri" select="CONST[1]/@uri"/>
+      </xsl:call-template>
+     </xsl:variable>
+    <xsl:choose>
+     <xsl:when test="(count(child::*) - number($no_params)) = 2">
+      <xsl:apply-templates select="*[2+$no_params]"/>
+     </xsl:when>
+     <xsl:otherwise>
+      <APPLY id="{@id}" sort="{@sort}">
+       <xsl:apply-templates select="*"/>
+      </APPLY>
+     </xsl:otherwise>
+    </xsl:choose>
+</xsl:template>
 
 <xsl:template match = "/|*">
   <xsl:copy>