]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/style/set.xsl
...
[helm.git] / helm / style / set.xsl
index 849365f3f6f155b1bda2ae33150525752dd6e99b..f1f7b7e50b5bf56e470fa0592dec67b76b002d14 100644 (file)
@@ -68,7 +68,7 @@
 <xsl:template match="APPLY[CONST[attribute::uri='cic:/Coq/Sets/Ensembles/Ensembles/In.con']]" mode="pure">
     <xsl:variable name="no_params">
      <xsl:call-template name="get_no_params">
-      <xsl:with-param name="first_uri" select="/cicxml/@uri"/>
+      <xsl:with-param name="first_uri" select="$CICURI"/>
       <xsl:with-param name="second_uri" select="CONST/@uri"/>
      </xsl:call-template>
     </xsl:variable>
@@ -94,7 +94,7 @@
 and (count(child::*) = 2) and APPLY[CONST[attribute::uri='cic:/Coq/Sets/Ensembles/Ensembles/In.con']]]" mode="pure">
     <xsl:variable name="no_params">
      <xsl:call-template name="get_no_params">
-      <xsl:with-param name="first_uri" select="/cicxml/@uri"/>
+      <xsl:with-param name="first_uri" select="$CICURI"/>
       <xsl:with-param name="second_uri" select="APPLY/CONST/@uri"/>
      </xsl:call-template>
     </xsl:variable>
@@ -118,7 +118,7 @@ and (count(child::*) = 2) and APPLY[CONST[attribute::uri='cic:/Coq/Sets/Ensemble
 <xsl:template match="APPLY[MUTIND[attribute::uri='cic:/Coq/Sets/Ensembles/Ensembles/Empty_set.ind']]" mode="pure">
     <xsl:variable name="no_params">
      <xsl:call-template name="get_no_params">
-      <xsl:with-param name="first_uri" select="/cicxml/@uri"/>
+      <xsl:with-param name="first_uri" select="$CICURI"/>
       <xsl:with-param name="second_uri" select="MUTIND/@uri"/>
      </xsl:call-template>
     </xsl:variable>
@@ -146,7 +146,7 @@ and (count(child::*) = 2) and APPLY[CONST[attribute::uri='cic:/Coq/Sets/Ensemble
 <xsl:template match="APPLY[MUTIND[attribute::uri='cic:/Coq/Sets/Ensembles/Ensembles/Singleton.ind']]" mode="pure">
     <xsl:variable name="no_params">
      <xsl:call-template name="get_no_params">
-      <xsl:with-param name="first_uri" select="/cicxml/@uri"/>
+      <xsl:with-param name="first_uri" select="$CICURI"/>
       <xsl:with-param name="second_uri" select="MUTIND/@uri"/>
      </xsl:call-template>
     </xsl:variable>
@@ -176,7 +176,7 @@ and (count(child::*) = 2) and APPLY[CONST[attribute::uri='cic:/Coq/Sets/Ensemble
 <xsl:template match="APPLY[MUTIND[attribute::uri='cic:/Coq/Sets/Ensembles/Ensembles/Couple.ind']]" mode="pure">
     <xsl:variable name="no_params">
      <xsl:call-template name="get_no_params">
-      <xsl:with-param name="first_uri" select="/cicxml/@uri"/>
+      <xsl:with-param name="first_uri" select="$CICURI"/>
       <xsl:with-param name="second_uri" select="MUTIND/@uri"/>
      </xsl:call-template>
     </xsl:variable>
@@ -208,7 +208,7 @@ and (count(child::*) = 2) and APPLY[CONST[attribute::uri='cic:/Coq/Sets/Ensemble
 <xsl:template match="APPLY[MUTIND[attribute::uri='cic:/Coq/Sets/Ensembles/Ensembles/Triple.ind'] and (count(child::*) = 5)]" mode="pure">
     <xsl:variable name="no_params">
      <xsl:call-template name="get_no_params">
-      <xsl:with-param name="first_uri" select="/cicxml/@uri"/>
+      <xsl:with-param name="first_uri" select="$CICURI"/>
       <xsl:with-param name="second_uri" select="MUTIND/@uri"/>
      </xsl:call-template>
     </xsl:variable>
@@ -242,7 +242,7 @@ and (count(child::*) = 2) and APPLY[CONST[attribute::uri='cic:/Coq/Sets/Ensemble
 <xsl:template match="APPLY[MUTIND[attribute::uri='cic:/Coq/Sets/Ensembles/Ensembles/Intersection.ind']]" mode="pure">
     <xsl:variable name="no_params">
      <xsl:call-template name="get_no_params">
-      <xsl:with-param name="first_uri" select="/cicxml/@uri"/>
+      <xsl:with-param name="first_uri" select="$CICURI"/>
       <xsl:with-param name="second_uri" select="MUTIND/@uri"/>
      </xsl:call-template>
     </xsl:variable>
@@ -277,7 +277,7 @@ and (count(child::*) = 2) and APPLY[CONST[attribute::uri='cic:/Coq/Sets/Ensemble
 <xsl:template match="APPLY[MUTIND[attribute::uri='cic:/Coq/Sets/Ensembles/Ensembles/Union.ind']]" mode="pure">
     <xsl:variable name="no_params">
      <xsl:call-template name="get_no_params">
-      <xsl:with-param name="first_uri" select="/cicxml/@uri"/>
+      <xsl:with-param name="first_uri" select="$CICURI"/>
       <xsl:with-param name="second_uri" select="MUTIND/@uri"/>
      </xsl:call-template>
     </xsl:variable>
@@ -311,7 +311,7 @@ and (count(child::*) = 2) and APPLY[CONST[attribute::uri='cic:/Coq/Sets/Ensemble
 <xsl:template match="APPLY[CONST[attribute::uri='cic:/Coq/Sets/Ensembles/Ensembles/Included.con']]" mode="pure">
     <xsl:variable name="no_params">
      <xsl:call-template name="get_no_params">
-      <xsl:with-param name="first_uri" select="/cicxml/@uri"/>
+      <xsl:with-param name="first_uri" select="$CICURI"/>
       <xsl:with-param name="second_uri" select="CONST/@uri"/>
      </xsl:call-template>
     </xsl:variable>
@@ -334,7 +334,7 @@ and (count(child::*) = 2) and APPLY[CONST[attribute::uri='cic:/Coq/Sets/Ensemble
 <xsl:template match="APPLY[CONST[attribute::uri='cic:/Coq/Sets/Ensembles/Ensembles/Strict_Included.con']]" mode="pure">
     <xsl:variable name="no_params">
      <xsl:call-template name="get_no_params">
-      <xsl:with-param name="first_uri" select="/cicxml/@uri"/>
+      <xsl:with-param name="first_uri" select="$CICURI"/>
       <xsl:with-param name="second_uri" select="CONST/@uri"/>
      </xsl:call-template>
     </xsl:variable>
@@ -357,7 +357,7 @@ and (count(child::*) = 2) and APPLY[CONST[attribute::uri='cic:/Coq/Sets/Ensemble
 <xsl:template match="APPLY[CONST[attribute::uri='cic:/Coq/Sets/Ensembles/Ensembles/Setminus.con']]" mode="pure">
     <xsl:variable name="no_params">
      <xsl:call-template name="get_no_params">
-      <xsl:with-param name="first_uri" select="/cicxml/@uri"/>
+      <xsl:with-param name="first_uri" select="$CICURI"/>
       <xsl:with-param name="second_uri" select="CONST/@uri"/>
      </xsl:call-template>
     </xsl:variable>
@@ -391,7 +391,7 @@ and (count(child::*) = 2) and APPLY[CONST[attribute::uri='cic:/Coq/Sets/Ensemble
 <xsl:template match="APPLY[CONST[attribute::uri='cic:/Coq/Sets/Ensembles/Ensembles/Add.con']]" mode="pure">
     <xsl:variable name="no_params">
      <xsl:call-template name="get_no_params">
-      <xsl:with-param name="first_uri" select="/cicxml/@uri"/>
+      <xsl:with-param name="first_uri" select="$CICURI"/>
       <xsl:with-param name="second_uri" select="CONST/@uri"/>
      </xsl:call-template>
     </xsl:variable>
@@ -429,7 +429,7 @@ and (count(child::*) = 2) and APPLY[CONST[attribute::uri='cic:/Coq/Sets/Ensemble
 <xsl:template match="APPLY[CONST[attribute::uri='cic:/Coq/Sets/Ensembles/Ensembles/Subtract.con']]" mode="pure">
     <xsl:variable name="no_params">
      <xsl:call-template name="get_no_params">
-      <xsl:with-param name="first_uri" select="/cicxml/@uri"/>
+      <xsl:with-param name="first_uri" select="$CICURI"/>
       <xsl:with-param name="second_uri" select="CONST/@uri"/>
      </xsl:call-template>
     </xsl:variable>
@@ -467,7 +467,7 @@ and (count(child::*) = 2) and APPLY[CONST[attribute::uri='cic:/Coq/Sets/Ensemble
 <xsl:template match="APPLY[MUTIND[attribute::uri='cic:/Coq/Sets/Finite_sets/Ensembles_finis/cardinal.ind']]" mode="pure">
     <xsl:variable name="no_params">
      <xsl:call-template name="get_no_params">
-      <xsl:with-param name="first_uri" select="/cicxml/@uri"/>
+      <xsl:with-param name="first_uri" select="$CICURI"/>
       <xsl:with-param name="second_uri" select="MUTIND/@uri"/>
      </xsl:call-template>
     </xsl:variable>
@@ -488,4 +488,51 @@ and (count(child::*) = 2) and APPLY[CONST[attribute::uri='cic:/Coq/Sets/Ensemble
     </xsl:choose>
 </xsl:template>
 
+<!-- *******************  SIGMA TYPES  **************************** -->
+
+<xsl:template match="APPLY[MUTIND[attribute::uri='cic:/Coq/Init/Specif/Subsets/sig.ind']]" mode="pure">
+ <xsl:choose>
+  <xsl:when test="count(child::*) = 3">
+   <xsl:choose>
+    <xsl:when test="name(*[3]) = 'LAMBDA'">
+     <m:set>
+       <m:bvar>
+        <m:ci>
+         <xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="*[3]/target/@binder"/></xsl:with-param></xsl:call-template>
+        </m:ci>
+        <m:type>
+         <xsl:apply-templates select="*[3]/source/*[1]" mode="noannot"/>
+        </m:type>
+       </m:bvar>
+       <m:condition>
+        <xsl:apply-templates select="*[3]/target/*[1]" mode="noannot"/>
+       </m:condition>
+     </m:set>
+    </xsl:when>
+    <xsl:otherwise>
+     <m:set>
+       <m:bvar>
+        <m:ci>$x</m:ci>
+        <m:type>
+         <xsl:apply-templates select="*[2]" mode="noannot"/>
+        </m:type>
+       </m:bvar>
+       <m:condition>
+        <m:apply>
+         <m:csymbol>app</m:csymbol>
+         <xsl:apply-templates select="*[3]" mode="noannot"/>
+         <m:ci>$x</m:ci>
+        </m:apply>
+       </m:condition>
+     </m:set>
+    </xsl:otherwise>
+   </xsl:choose>
+  </xsl:when>
+  <xsl:otherwise>
+   <xsl:apply-imports/>
+  </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+
 </xsl:stylesheet>