]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/style/mk_dep_graph.xsl
New graph implementation: the visit is no more pruned on a level base, but
[helm.git] / helm / style / mk_dep_graph.xsl
index b6c6041c94283a0a5334752da21b8539e4972414..739bd279bba6f11bdde265436b095601850bbc5f 100644 (file)
 <xsl:param name="CICURI" select="''"/>
 <xsl:param name="PID" select="''"/>
 <xsl:param name="getterURL" select="''"/>
+<xsl:param name="uri_set_queueURL" select="'http://localhost:8084/'"/>
+<xsl:param name="uri_set_size" select="30"/>
 <xsl:variable name="base_URL_of_CIC_URI" select="concat($getterURL,'getxml?uri=')"/>
 
-<!-- CSC: next function because I don't remember the name of the    -->
+<!-- CSC: next functions because I don't remember the name of the    -->
 <!-- CSC: subst function of xslt and I don't have the specs with me -->
 <xsl:template name="quote">
  <xsl:param name="s" select="''"/>
  -->
  <xsl:text>strict digraph L0 { size = "83,83"; node [style=filled, shape = box];&CSCbr;</xsl:text>
  <!-- The nonce is used to force the document reload -->
- <xsl:variable name="dummy1" select="document(concat('http://phd.cs.unibo.it:8084/add_if_not_in?uri=',$CICURI,'&amp;nonce=',generate-id(),'&amp;PID=',$PID))"/>
- <xsl:apply-templates mode="loop" select="document(concat('http://phd.cs.unibo.it:8084/get_next?uri=',$CICURI,'&amp;nonce=',generate-id(),'&amp;PID=',$PID))"/>
- <xsl:variable name="dummy2" select="document(concat('http://phd.cs.unibo.it:8084/reset_to_empty?PID=',$PID))"/>
+ <xsl:variable name="dummy0" select="document(concat($uri_set_queueURL,'set_uri_set_size?uri=',$CICURI,'&amp;nonce=',generate-id(),'&amp;PID=',$PID,'&amp;size=',$uri_set_size))"/>
+ <xsl:variable name="dummy1" select="document(concat($uri_set_queueURL,'add_if_not_in?uri=',$CICURI,'&amp;nonce=',generate-id(),'&amp;PID=',$PID))"/>
+ <xsl:apply-templates mode="loop" select="document(concat($uri_set_queueURL,'get_next?uri=',$CICURI,'&amp;nonce=',generate-id(),'&amp;PID=',$PID))"/>
+ <xsl:variable name="dummy2" select="document(concat($uri_set_queueURL,'reset_to_empty?PID=',$PID))"/>
  <xsl:text>}</xsl:text>
 </xsl:template>
 
   <xsl:with-param name="do_not_visit" select="name(.)"/>
  </xsl:apply-templates>
  <!-- The couple (uri,nonce) is used to force the document reload -->
- <xsl:apply-templates mode="loop" select="document(concat('http://phd.cs.unibo.it:8084/get_next?uri=',@value,'&amp;nonce=',generate-id(),'&amp;PID=',$PID))"/>
+ <xsl:apply-templates mode="loop" select="document(concat($uri_set_queueURL,'get_next?uri=',@value,'&amp;nonce=',generate-id(),'&amp;PID=',$PID))"/>
 </xsl:template>
 
 <xsl:template mode="first_time" match="*">
  <xsl:param name="currentCICURI" select="''"/>
  <xsl:param name="quotedCurrentCICURI" select="''"/>
  <xsl:param name="do_not_visit" select="'uri'"/>
+ <xsl:if test="$do_not_visit='uri'">
+  <xsl:apply-templates select=".">
+   <xsl:with-param name="currentCICURI" select="$currentCICURI"/>
+   <xsl:with-param name="quotedCurrentCICURI" select="$quotedCurrentCICURI"/>
+  </xsl:apply-templates>
+ </xsl:if>
  <xsl:text> </xsl:text>
  <xsl:value-of select="$quotedCurrentCICURI"/>
 <!-- <xsl:text> [fontname="LucidaSansRegular",color=red,label="</xsl:text> -->
  <xsl:text>",URL="</xsl:text>
  <xsl:value-of select="$currentCICURI"/>
  <xsl:text>"</xsl:text>
- <xsl:if test="$do_not_visit='marked_uri'">
+ <xsl:if test="name(document(concat($uri_set_queueURL,'is_overflowed?uri=',$quotedCurrentCICURI,'&amp;nonce=',generate-id(),'&amp;PID=',$PID))/*)='true'">
   <xsl:text>,color=red</xsl:text>
  </xsl:if>
  <xsl:text>];&CSCbr;</xsl:text>
- <xsl:if test="$do_not_visit='uri'">
-  <xsl:apply-templates select=".">
-   <xsl:with-param name="currentCICURI" select="$currentCICURI"/>
-   <xsl:with-param name="quotedCurrentCICURI" select="$quotedCurrentCICURI"/>
-  </xsl:apply-templates>
- </xsl:if>
 </xsl:template>
 
 <!-- CSC: uriType missing!!! -->
     <xsl:with-param name="s" select="@uri"/>
    </xsl:call-template>
   </xsl:variable>
-  <xsl:text> </xsl:text>
-  <xsl:value-of select="$quotedCurrentCICURI"/>
-  <xsl:text> -&gt; </xsl:text>
-  <xsl:value-of select="$quotedURI"/>
-  <xsl:text>;&CSCbr;</xsl:text>
-  <!-- The nonce is used to force the document reload -->
-  <xsl:variable name="dummy" select="document(concat('http://phd.cs.unibo.it:8084/add_if_not_in?uri=',@uri,'&amp;nonce=',generate-id(),'&amp;PID=',$PID))"/>
+  <!-- The nonce, quotedCurrentCICURI are used to force the document reload -->
+  <xsl:if test="not(name(document(concat($uri_set_queueURL,'add_if_not_in?uri=',@uri,'&amp;nonce=',generate-id(),'&amp;PID=',$PID,'&amp;quotedCurrentCICURI=',$quotedCurrentCICURI))/*)='not_added_because_already_too_many')">
+   <xsl:text> </xsl:text>
+   <xsl:value-of select="$quotedCurrentCICURI"/>
+   <xsl:text> -&gt; </xsl:text>
+   <xsl:value-of select="$quotedURI"/>
+   <xsl:text>;&CSCbr;</xsl:text>
+  </xsl:if>
  </xsl:if>
  <xsl:apply-templates>
   <xsl:with-param name="currentCICURI" select="$currentCICURI"/>