Index: Singular/LIB/atkins.lib
===================================================================
--- Singular/LIB/atkins.lib	(revision fba86f89b3458187b40c5f0d5f6408412d98d295)
+++ Singular/LIB/atkins.lib	(revision 7d56875cf7720719f5b6acd193768a4d5b57848f)
@@ -1,4 +1,4 @@
 ///////////////////////////////////////////////////////////////////////////////
-version="$Id: atkins.lib,v 1.4 2007-07-20 11:26:46 Singular Exp $";
+version="$Id: atkins.lib,v 1.5 2008-10-09 09:31:57 Singular Exp $";
 category="Teaching";
 info="
@@ -776,5 +776,5 @@
           K is input for the procedure "HilbertClassPolynomial",
           B describes the number of recursions being calculated
-        - The basis of the the algorithm is the following theorem:
+        - The basis of the algorithm is the following theorem:
           Let N be an integer coprime to 6 and different from 1 and E be an
           ellipic curve modulo N. Assume that we know an integer m and a
Index: Singular/LIB/crypto.lib
===================================================================
--- Singular/LIB/crypto.lib	(revision fba86f89b3458187b40c5f0d5f6408412d98d295)
+++ Singular/LIB/crypto.lib	(revision 7d56875cf7720719f5b6acd193768a4d5b57848f)
@@ -1,5 +1,5 @@
 //GP, last modified 28.6.06
 ///////////////////////////////////////////////////////////////////////////////
-version="$Id: crypto.lib,v 1.5 2008-08-07 16:00:50 Singular Exp $";
+version="$Id: crypto.lib,v 1.6 2008-10-09 09:31:57 Singular Exp $";
 category="Teaching";
 info="
@@ -1906,5 +1906,5 @@
          m,q integers
 ASSUME: gcd(N,6)=1
-NOTE:   The basis of the the algorithm is the following theorem:
+NOTE:   The basis of the algorithm is the following theorem:
          Given C, an elliptic curve over Z/N, P a point of C(Z/N),
          m an integer, q a prime with the following properties:
Index: Singular/LIB/dmodapp.lib
===================================================================
--- Singular/LIB/dmodapp.lib	(revision fba86f89b3458187b40c5f0d5f6408412d98d295)
+++ Singular/LIB/dmodapp.lib	(revision 7d56875cf7720719f5b6acd193768a4d5b57848f)
@@ -1,4 +1,4 @@
 //////////////////////////////////////////////////////////////////////////////
-version="$Id: dmodapp.lib,v 1.9 2008-10-06 17:04:26 Singular Exp $";
+version="$Id: dmodapp.lib,v 1.10 2008-10-09 09:31:57 Singular Exp $";
 category="Noncommutative";
 info="
@@ -75,5 +75,5 @@
 @*       graded ring while the Groebner basis is a subset of D.
 @*       If s<>0, @code{std} is used for Groebner basis computations, otherwise,
-@*       and by default, @code{slimgb} is used. 
+@*       and by default, @code{slimgb} is used.
 @*       If t<>0, a matrix ordering is used for Groebner basis computations,
 @*       otherwise, and by default, a block ordering is used.
@@ -124,7 +124,7 @@
 NOTE:    Activate the output ring with the @code{setring} command.
 @*       Varnames of the basering should not include t and Dt.
-@*       In the ouput ring, inF is is the initial Malgrange ideal.
+@*       In the ouput ring, inF is the initial Malgrange ideal.
 @*       If s<>0, @code{std} is used for Groebner basis computations, otherwise,
-@*        and by default, @code{slimgb} is used. 
+@*        and by default, @code{slimgb} is used.
 @*       If t<>0, a matrix ordering is used for Groebner basis computations,
 @*       otherwise, and by default, a block ordering is used.
@@ -136,5 +136,5 @@
 EXAMPLE: example initialmalgrange; shows examples
 "
-{ 
+{
   int ppl = printlevel - voice +2;
   def save = basering;
@@ -161,5 +161,5 @@
         {
           reversevars = int(#[3]);
-	}
+        }
         if (size(#)>3)
         {
@@ -167,6 +167,6 @@
           {
             u0 = #[4];
-	  }
-	}
+          }
+        }
       }
     }
@@ -272,9 +272,9 @@
       if (calledfrom == "initialideal")
       {
-	ring Dh = 0,(x(1..n),D(1..n),h),(a(@a),dp(noofvars-1),lp(1));
+        ring Dh = 0,(x(1..n),D(1..n),h),(a(@a),dp(noofvars-1),lp(1));
       }
       else // bfctonestep
       {
-	ring Dh = 0,(t,s,x(n..1),Dt,D(n..1),h),(a(@a),a(@a2),a(uv),dp(noofvars-1),lp(1));
+        ring Dh = 0,(t,s,x(n..1),Dt,D(n..1),h),(a(@a),a(@a2),a(uv),dp(noofvars-1),lp(1));
       }
     }
@@ -299,9 +299,9 @@
       if (calledfrom == "initialideal")
       {
-	ring Dh = 0,(x(1..n),D(1..n),h),(a(@a),M(@Ord));
+        ring Dh = 0,(x(1..n),D(1..n),h),(a(@a),M(@Ord));
       }
       else // bfctonestep
       {
-	ring Dh = 0,(t,s,x(n..1),Dt,D(n..1),h),(a(@a),a(@a2),M(@Ord));
+        ring Dh = 0,(t,s,x(n..1),Dt,D(n..1),h),(a(@a),a(@a2),M(@Ord));
       }
     }
@@ -323,5 +323,5 @@
       for (i=1; i<=n; i++)
       {
-	@relD[i,n+i] = h^2;
+        @relD[i,n+i] = h^2;
       }
     }
@@ -333,5 +333,5 @@
       for (i=1; i<=n; i++)
       {
-	@relD[i+2,n+3+i] = h^2;
+        @relD[i+2,n+3+i] = h^2;
       }
     }
@@ -361,5 +361,5 @@
       I = I,t*Dt-s;
     }
-  }  
+  }
   dbprint(ppl, "starting Groebner basis computation with engine:", whichengine);
   I = engine(I, whichengine);
@@ -379,5 +379,5 @@
       if (varnames[i] == "t")
       {
-	ERROR("Variable names should not include t");
+        ERROR("Variable names should not include t");
       }
     }
@@ -403,6 +403,6 @@
       for (i=1; i<=n; i++)
       {
-	newvarnames[i+1] = varnames[i];
-	newvarnames[i+n+2] = "D"+varnames[i];
+        newvarnames[i+1] = varnames[i];
+        newvarnames[i+n+2] = "D"+varnames[i];
       }
       rl[2] = newvarnames;
@@ -490,5 +490,5 @@
       }
     }
-    J[j] = g;  
+    J[j] = g;
   }
   if (typeof(#[1])=="poly")
@@ -537,5 +537,5 @@
   list LL = ringlist(save);
   list L;
-  int i; 
+  int i;
   for(i=1;i<=4;i++)
   {
@@ -562,5 +562,5 @@
   matrix @D = ncr[2];
   def @U = ring(L);
-  // 2. create the commutative ring  
+  // 2. create the commutative ring
   setring save;
   list CL;
@@ -606,5 +606,5 @@
 // TODO
 static proc charInfo(ideal I)
-"USAGE:  charInfo(I);  I an ideal 
+"USAGE:  charInfo(I);  I an ideal
 RETURN:  ring
 STATUS: experimental, todo
@@ -740,5 +740,5 @@
 proc isFsat(ideal I, poly F)
 "USAGE:  isFsat(I, F);  I an ideal, F a poly
-RETURN: int 
+RETURN: int
 PURPOSE: check whether the ideal I is F-saturated
 NOTE:    1 is returned if I is F-saturated, otherwise 0 is returned
@@ -815,7 +815,7 @@
   def R = Weyl();    setring R;
   poly F = x2-y3;
-  ideal I = (y^3 - x^2)*Dx - 2*x, (y^3 - x^2)*Dy + 3*y^2; // I = Dx*F, Dy*F; 
+  ideal I = (y^3 - x^2)*Dx - 2*x, (y^3 - x^2)*Dy + 3*y^2; // I = Dx*F, Dy*F;
   DLoc(I, x2-y3);
-  LD0; 
+  LD0;
   BS;
 }
@@ -871,5 +871,5 @@
   ideal bbs; int srat=0; int HasRatRoots = 0;
   int sP;
-  for (i=1; i<= size(bs); i++) 
+  for (i=1; i<= size(bs); i++)
   {
     if (deg(bs[i]) == 1)
@@ -920,5 +920,5 @@
       // no roots!
       dbprint(ppl,"// -2-4- no integer root, setting s0 = -1");
-      sP = -1; 
+      sP = -1;
       //      HasRatRoots = 0; // older stuff, here we do substitution
       HasRatRoots = 1;
@@ -1017,5 +1017,5 @@
     kill @R3;
     setring @R4;
-    ideal bs = imap(@R2,bs); // only rationals are the entries 
+    ideal bs = imap(@R2,bs); // only rationals are the entries
     list BS; BS[1] = bs; BS[2] = m;
     export BS;
@@ -1026,8 +1026,8 @@
     ideal LD0 = K4;
     export LD0;
-    return(@R4);    
+    return(@R4);
   }
   else
-  { 
+  {
     /* SHOULD NEVER GET THERE */
     /* no rational/integer roots */
@@ -1039,5 +1039,5 @@
     export BS;
     return(@R2);
-  }  
+  }
 }
 example;
@@ -1047,8 +1047,8 @@
   def R = Weyl();    setring R;
   poly F = x2-y3;
-  ideal I = (y^3 - x^2)*Dx - 2*x, (y^3 - x^2)*Dy + 3*y^2; // I = Dx*F, Dy*F; 
+  ideal I = (y^3 - x^2)*Dx - 2*x, (y^3 - x^2)*Dy + 3*y^2; // I = Dx*F, Dy*F;
   def W = SDLoc(I,F);  setring W; // creates ideal LD
   def U = DLoc0(LD, x2-y3);  setring U;
-  LD0; 
+  LD0;
   BS;
 }
@@ -1435,5 +1435,5 @@
   def R = Weyl();   setring R;
   poly F = x2-y3;
-  ideal I = (y^3 - x^2)*Dx - 2*x, (y^3 - x^2)*Dy + 3*y^2; // I = Dx*F, Dy*F; 
+  ideal I = (y^3 - x^2)*Dx - 2*x, (y^3 - x^2)*Dy + 3*y^2; // I = Dx*F, Dy*F;
   def W = SDLoc(I,F);
   setring W;
@@ -1442,5 +1442,5 @@
   setring U;
   LD0;
-  BS; 
+  BS;
   // the same with DLoc:
   setring R;
Index: Singular/LIB/gmssing.lib
===================================================================
--- Singular/LIB/gmssing.lib	(revision fba86f89b3458187b40c5f0d5f6408412d98d295)
+++ Singular/LIB/gmssing.lib	(revision 7d56875cf7720719f5b6acd193768a4d5b57848f)
@@ -1,4 +1,4 @@
 ///////////////////////////////////////////////////////////////////////////////
-version="$Id: gmssing.lib,v 1.11 2007-01-23 15:03:30 Singular Exp $";
+version="$Id: gmssing.lib,v 1.12 2008-10-09 09:31:57 Singular Exp $";
 category="Singularities";
 
@@ -8,5 +8,5 @@
 AUTHOR:   Mathias Schulze, email: mschulze@mathematik.uni-kl.de
 
-OVERVIEW: A library to compute invariants related to the the Gauss-Manin system
+OVERVIEW: A library to compute invariants related to the Gauss-Manin system
           of an isolated hypersurface singularity
 
Index: Singular/LIB/homolog.lib
===================================================================
--- Singular/LIB/homolog.lib	(revision fba86f89b3458187b40c5f0d5f6408412d98d295)
+++ Singular/LIB/homolog.lib	(revision 7d56875cf7720719f5b6acd193768a4d5b57848f)
@@ -1,4 +1,4 @@
 ///////////////////////////////////////////////////////////////////////////////
-version="$Id: homolog.lib,v 1.26 2008-09-09 09:54:30 Singular Exp $";
+version="$Id: homolog.lib,v 1.27 2008-10-09 09:31:57 Singular Exp $";
 category="Commutative Algebra";
 info="
@@ -137,5 +137,5 @@
    dbprint(p-1,"// kbase of Ext^2(M,M)",
              "//  - the columns present the kbase elements in Hom(F(2),F(0))",
-             "//  - F(*) is a a free resolution of M ",kb2);
+             "//  - F(*) is a free resolution of M ",kb2);
 //-------  compute: cup-products of base-elements -----------------------------
    for (i=1;i<=e1;i=i+1)
Index: Singular/LIB/phindex.lib
===================================================================
--- Singular/LIB/phindex.lib	(revision fba86f89b3458187b40c5f0d5f6408412d98d295)
+++ Singular/LIB/phindex.lib	(revision 7d56875cf7720719f5b6acd193768a4d5b57848f)
@@ -1,4 +1,4 @@
 //////////////////////////////////////////////////////////////////////////////
-version="$Id: phindex.lib,v 1.2 2008-08-18 10:42:27 Singular Exp $";
+version="$Id: phindex.lib,v 1.3 2008-10-09 09:31:57 Singular Exp $";
 category=" ";
 info="
@@ -495,5 +495,5 @@
 static proc SigntL(poly M)  //static procedure to compute the signature of any quadratic form.
 "USAGE:    SigntL(M); M is a quadratic form.
-RETURN:   The signature of of M of type int.
+RETURN:   The signature of M of type int.
 ASSUME:   M is a quadratic form (ply type).
 "
Index: Singular/LIB/primdec.lib
===================================================================
--- Singular/LIB/primdec.lib	(revision fba86f89b3458187b40c5f0d5f6408412d98d295)
+++ Singular/LIB/primdec.lib	(revision 7d56875cf7720719f5b6acd193768a4d5b57848f)
@@ -1,4 +1,4 @@
 ///////////////////////////////////////////////////////////////////////////////
-version="$Id: primdec.lib,v 1.139 2008-03-19 17:44:38 Singular Exp $";
+version="$Id: primdec.lib,v 1.140 2008-10-09 09:31:57 Singular Exp $";
 category="Commutative Algebra";
 info="
@@ -5606,5 +5606,5 @@
 //
 // Computes the radical of I using KL algorithm.
-// The only difference with the the previous implementation of KL algorithm is
+// The only difference with the previous implementation of KL algorithm is
 // that now it uses block dp instead of lp ordering for the reduction to the
 // zerodimensional case.
@@ -5730,5 +5730,5 @@
 //                 0 -> Otherwise
 // ideal ser       Only for radicalKL. (Same as in radicalKL)
-// list #          Only for radicalKL (If #[1] = 1, 
+// list #          Only for radicalKL (If #[1] = 1,
 //                    only equiradical is required.
 //                    It is used to set the value of done.)
Index: Singular/LIB/redcgs.lib
===================================================================
--- Singular/LIB/redcgs.lib	(revision fba86f89b3458187b40c5f0d5f6408412d98d295)
+++ Singular/LIB/redcgs.lib	(revision 7d56875cf7720719f5b6acd193768a4d5b57848f)
@@ -1,4 +1,4 @@
 //////////////////////////////////////////////////////////////////////////////
-version="$Id: redcgs.lib,v 1.2 2008-08-18 10:42:50 Singular Exp $";
+version="$Id: redcgs.lib,v 1.3 2008-10-09 09:31:58 Singular Exp $";
 category="General purpose";
 info="
@@ -6,36 +6,36 @@
 PURPOSE:  Comprehensive Groebner Systems. Canonical Forms.
           The library contains Monte's algorithms to compute disjoint, reduced
-          Comprehensive Groebner Systems (CGS). A CGS is a set of pairs of 
-          (segment,basis). The segments S_i are subsets of the parameter space, 
-          and the bases B_i are sets of polynomials specializing to Groebner 
+          Comprehensive Groebner Systems (CGS). A CGS is a set of pairs of
+          (segment,basis). The segments S_i are subsets of the parameter space,
+          and the bases B_i are sets of polynomials specializing to Groebner
           bases of the specialized ideal for every point in S_i.
-          
+
           The purpose of the routines in this library is to obtain CGS with
           better properties, namely disjoint segments forming a partition of
-          the parameter space and reduced bases. Reduced bases are sets of 
-          polynomials that specialize to the reduced Groebner basis of the 
-          specialized ideal preserving the leading power products (lpp). 
+          the parameter space and reduced bases. Reduced bases are sets of
+          polynomials that specialize to the reduced Groebner basis of the
+          specialized ideal preserving the leading power products (lpp).
           The lpp characterize the type of solution in each segment.
-          
+
           A further objective is to summarize as much as possible the segments
           with the same lpp into a single segment, and if possible to obtain
           a final result that is canonical, i.e. independent of the algorithm
           and only attached to the given ideal.
-          
-          There are three fundamental routines in the library: mrcgs, rcgs and 
-          crcgs. mrcgs (Minimal Reduced CGS) is an algorithm that packs so 
-          much as it is able to do (using algorithms adhoc) the segments with 
-          the same lpp, obtaining the minimal number of segments. The hypothesis 
-          is that the result is also canonical, but for the moment there is no 
-          proof of the uniqueness of this minimal packing. Moreover, the 
-          segments that are obtained are not locally closed, i.e. there are not 
+
+          There are three fundamental routines in the library: mrcgs, rcgs and
+          crcgs. mrcgs (Minimal Reduced CGS) is an algorithm that packs so
+          much as it is able to do (using algorithms adhoc) the segments with
+          the same lpp, obtaining the minimal number of segments. The hypothesis
+          is that the result is also canonical, but for the moment there is no
+          proof of the uniqueness of this minimal packing. Moreover, the
+          segments that are obtained are not locally closed, i.e. there are not
           difference of two varieties.
-          
+
           On the other side, Michael Wibmer has proved that for homogeneous ideals,
           all the segments with reduced bases having the same lpp admit a unique
           basis specializing well. For this purpose it is necessary to extend the
           description of the elements of the bases to functions, forming sheaves
-          of polynomials instead of simple polynomials, so that the polynomials in 
-          a sheaf either preserve the lpp of the corresponding polynomial of 
+          of polynomials instead of simple polynomials, so that the polynomials in
+          a sheaf either preserve the lpp of the corresponding polynomial of
           the specialized Groebner basis (and then it specializes well) or
           it specializes to 0. Moreover, in a sheaf, for every point in the
@@ -44,11 +44,11 @@
           segments are locally closed, that is can be described as the difference of
           two varieties.
-          
+
           Using Wibmer's Theorem we proved that an affine ideal can be homogenized,
           than discussed by mrcgs and finally de-homogenized. The bases so obtained
           can be reduced and specialize well in the segment. If the theoretic
-          objective is reached, and all the segments of the homogenized ideal 
+          objective is reached, and all the segments of the homogenized ideal
           have been packed, locally closed segments will be obtained.
-          
+
           If we only homogenize the given basis of the ideal, then we cannot ensure
           the canonicity of the partition obtained, because there are many different
@@ -58,33 +58,33 @@
           is usually faster than mrcgs and crcgs. But the given partition is not
           always canonical.
-          
+
           Finally it is possible to homogenize the whole affine ideal, and then
           the packing algorithm will provide canonical segments by dehomogenizing.
           This corresponds to crcgs routine. It provides the best description
-          of the segments and bases. In contrast crcgs algorithm is usually much 
-          more time consuming and it will not always finish in a reasonable time. 
-          Moreover it will contain more segments than mrcgs and possibly also more 
+          of the segments and bases. In contrast crcgs algorithm is usually much
+          more time consuming and it will not always finish in a reasonable time.
+          Moreover it will contain more segments than mrcgs and possibly also more
           than rcgs.
-          
+
           But the actual algorithms in the library to pack segments have some lacks.
           They are not theoretically always able to pack the segments that we know
           that can be packed. Nevertheless, thanks to Wibmer's Theorem, the
-          algorithms rcgs and crcgs are able to detect if the objective has not been 
-          reached, and if so, to give a Warning. The warning does not invalidate the 
-          output, but it only recognizes that the theoretical objective is not 
-          completely reached by the actual campcting methods and that some segments 
+          algorithms rcgs and crcgs are able to detect if the objective has not been
+          reached, and if so, to give a Warning. The warning does not invalidate the
+          output, but it only recognizes that the theoretical objective is not
+          completely reached by the actual campcting methods and that some segments
           that can be packed have not been packed with a single basis.
-          
+
           The routine buildtree is the first algorithm used in all the previous
           methods providing a first disjoint CGS, and can be used if none of the
           three fundamental algorithms of the library finishes in a reasonable time.
-          
-          There are also routines to visualize better the output of the previous 
+
+          There are also routines to visualize better the output of the previous
           algorithms:
           finalcases can be applied to the list provided by buildtree to obtain the
           CGS. The list provided by buildtree contains the whole discussion, and
           finalcases extracts the CGS.
-          The output of buildtree can also be transformed into a file using 
-          buildtreetoMaple routine that can be read in Maple. Using Monte's dpgb 
+          The output of buildtree can also be transformed into a file using
+          buildtreetoMaple routine that can be read in Maple. Using Monte's dpgb
           library in Maple the output can be plotted (with the routine tplot).
           To plot the output of mrcgs, rcgs or crcgs in Maple, the library also
@@ -95,12 +95,12 @@
           prime ideals in a canonical form that is described in the papers.
           Nevertheless this canonical form is somewhat uncomfortable to be
-          interpreted. When the segments are all locally closed (and this is 
+          interpreted. When the segments are all locally closed (and this is
           always the case for rcgs and crcgs) the routine cantodiffcgs transforms
           the output into a simpler form having only one list element for
           each segment and providing the two varieties whose difference represent
           the segment also in a canonical form.
-          
-AUTHORS:  Antonio Montes , Hans Schoenemann. 
-OVERVIEW: see \"Minimal Reduced Comprehensive Groebner Systems\" 
+
+AUTHORS:  Antonio Montes , Hans Schoenemann.
+OVERVIEW: see \"Minimal Reduced Comprehensive Groebner Systems\"
           by Antonio Montes. (http://www-ma2.upc.edu/~montes/).
 
@@ -118,60 +118,60 @@
 setglobalrings();    It is called by the fundamental routines of the library:
                      (buildtree, mrcgs, rcgs, crcgs).
-                     After calling it, the rings @R, @P and @RP are defined 
+                     After calling it, the rings @R, @P and @RP are defined
                      globally.
-memberpos(f,J);      Returns the list of two integers: the value 0 or 1 depending 
-                     on if f belongs to J or not, and the position in J (0 if it 
+memberpos(f,J);      Returns the list of two integers: the value 0 or 1 depending
+                     on if f belongs to J or not, and the position in J (0 if it
                      does not belong).
 subset(F,G);         If all elements of F belong to the ideal G it returns 1,
-                     and 0 otherwise. 
-pdivi(f,F);          Pseudodivision of a poly f by an ideal F in @R. Returns a 
+                     and 0 otherwise.
+pdivi(f,F);          Pseudodivision of a poly f by an ideal F in @R. Returns a
                      list (r,q,m) such that m*f=r+sum(q.G).
-facvar(ideal J)      Returns all the free-square factors of the elements 
+facvar(ideal J)      Returns all the free-square factors of the elements
                      of ideal J (non repeated). Integer factors are ignored,
                      even 0 is ignored. It can be called from ideal @R, but
                      the given ideal J must only contain poynomials in the
                      parameters.
-redspec(N,W);        Given null and non-null conditions depending only on the 
+redspec(N,W);        Given null and non-null conditions depending only on the
                      parameters it returns a red-specification.
-pnormalform(f,N,W);  Reduces the poly f wrt to the null condition ideal N and the 
+pnormalform(f,N,W);  Reduces the poly f wrt to the null condition ideal N and the
                      non-null condition ideal W (both depending on the parameters).
-buildtree(F);        Returns a list T describing a first reduced CGS of the ideal 
+buildtree(F);        Returns a list T describing a first reduced CGS of the ideal
                      F in K[a][x].
-buildtreetoMaple(T); Writes into a file the output of buildtree in Maple readable 
+buildtreetoMaple(T); Writes into a file the output of buildtree in Maple readable
                      form.
 finalcases(T);       From the output of buildtree it provides the list
-                     of its terminal vertices. That list represents the dichotomic, 
+                     of its terminal vertices. That list represents the dichotomic,
                      reduced CGS obtained by buildtree.
-mrcgs(F);            Returns a list T describing the Minimal Reduced CGS of the 
+mrcgs(F);            Returns a list T describing the Minimal Reduced CGS of the
                      ideal F of K[a][x]
-rcgs(F);             Returns a list T describing the Reduced CGS of the ideal F 
-                     of K[a][x] obtained by direct homogenizing and de-homogenizing 
+rcgs(F);             Returns a list T describing the Reduced CGS of the ideal F
+                     of K[a][x] obtained by direct homogenizing and de-homogenizing
                      the basis of the given ideal.
-crcgs(F);            Returns a list T describing the Canonical Reduced CGS of the 
-                     ideal F of K[a][x] obtained by homogenizing and de-homogenizing 
+crcgs(F);            Returns a list T describing the Canonical Reduced CGS of the
+                     ideal F of K[a][x] obtained by homogenizing and de-homogenizing
                      the initial ideal.
-cantreetoMaple)(M);  Writes into a file the output of mrcgs, rcgs or crcgs in Maple 
+cantreetoMaple)(M);  Writes into a file the output of mrcgs, rcgs or crcgs in Maple
                      readable form.
 cantodiffcgs(list L);From the output of rcgs or crcgs (or even of mrcgs when
                      it is possible) it returns a simpler list where the segments
-                     are given as difference of varieties.                    
-
-SEE ALSO: compregb_lib 
+                     are given as difference of varieties.
+
+SEE ALSO: compregb_lib
 ";
 
 // ************ Begin of the redCGS library *********************
-// Library redCGS 
-// (Reduced Comprehesive Groebner Systems): 
+// Library redCGS
+// (Reduced Comprehesive Groebner Systems):
 // Initial data: 21-1-2008
 // Release 1:
 // Final data: 3_7-2008
-// All given and determined polynomials and ideals are in the 
+// All given and determined polynomials and ideals are in the
 // basering K[a][x];
-// After calling setglobalrings(); the rings 
+// After calling setglobalrings(); the rings
 //        @R   (K[a][x]),
-//        @P   (K[a]), 
+//        @P   (K[a]),
 //        @RP   (K[x,a]) are globally defined
 //        They are used internally and can also be called by the user;
-//        setglobalrings() is called by buildtree, so it is not required to 
+//        setglobalrings() is called by buildtree, so it is not required to
 //        call setglobalrings before using
 //        the fundamental routines of the library.
@@ -184,5 +184,5 @@
 "USAGE:   setglobalrings();
           No arguments
-RETURN:   After its call the rings @R=K[a][x], @P=K[a], @RP=K[x,a] are 
+RETURN:   After its call the rings @R=K[a][x], @P=K[a], @RP=K[x,a] are
           defined as global variables.
 NOTE:     It is called by the fundamental routines of the library.
@@ -190,5 +190,5 @@
           the fundamental routines have been called and some
           other routines of the library are used.
-          The basering R, must be of the form K[a][x], a=parameters, 
+          The basering R, must be of the form K[a][x], a=parameters,
           x=variables, and should be defined previously.
 KEYWORDS: ring, rings
@@ -196,17 +196,17 @@
 {
   def @R=basering;  // must be of the form K[a][x], a=parameters, x=variables
-  def Rx=ringlist(@R);  
-  def @P=ring(Rx[1]);   
+  def Rx=ringlist(@R);
+  def @P=ring(Rx[1]);
   list Lx;
   Lx[1]=0;
   Lx[2]=Rx[2]+Rx[1][2];
   Lx[3]=Rx[1][3];
-  Lx[4]=Rx[1][4];  
+  Lx[4]=Rx[1][4];
   //def @K=ring(Lx);
   //exportto(Top,@K);  //global ring K[x,a] with the order of x extended to x,a
-  Rx[1]=0;              
-  def D=ring(Rx);       
-  def @RP=D+@P; 
-  exportto(Top,@R);      // global ring K[a][x]          
+  Rx[1]=0;
+  def D=ring(Rx);
+  def @RP=D+@P;
+  exportto(Top,@R);      // global ring K[a][x]
   exportto(Top,@P);      // global ring K[a]
   exportto(Top,@RP);     // global ring K[x,a] with product order
@@ -229,5 +229,5 @@
 //   ideal J (J can be also poly), but the output is an ideal;
 // output:
-//   ideal Jc (the new form of ideal J without denominators and 
+//   ideal Jc (the new form of ideal J without denominators and
 //       normalized to content 1)
 proc cld(ideal J)
@@ -392,5 +392,5 @@
 example
 { "EXAMPLE:"; echo = 2;
-  list J=list(7,3,2); 
+  list J=list(7,3,2);
   list K=list(1,2,3,5,7,8);
   subset(J,K);
@@ -439,8 +439,8 @@
           poly f: the polynomial to be divided
           ideal F: the divisor ideal
-RETURN:   A list (poly r, ideal q, poly m). r is the remainder of the 
-          pseudodivision, q is the ideal of quotients, and m is the 
-          factor by which f is to be multiplied.     
-NOTE:     Pseudodivision of a poly f by an ideal F in @R. Returns a 
+RETURN:   A list (poly r, ideal q, poly m). r is the remainder of the
+          pseudodivision, q is the ideal of quotients, and m is the
+          factor by which f is to be multiplied.
+NOTE:     Pseudodivision of a poly f by an ideal F in @R. Returns a
           list (r,q,m) such that m*f=r+sum(q.G).
 KEYWORDS: division, reduce
@@ -530,5 +530,5 @@
 };
 
-// facvar: Returns all the free-square factors of the elements 
+// facvar: Returns all the free-square factors of the elements
 //         of ideal J (non repeated). Integer factors are ignored,
 //         even 0 is ignored. It can be called from ideal @R, but
@@ -537,5 +537,5 @@
 //         Operates in the ring @P, but can be called from ring @R.
 // input:   ideal J
-// output:  ideal Jc: Returns all the free-square factors of the elements 
+// output:  ideal Jc: Returns all the free-square factors of the elements
 //         of ideal J (non repeated). Integer factors are ignored,
 //         even 0 is ignored. It can be called from ideal @R, but
@@ -545,11 +545,11 @@
 "USAGE:   facvar(J);
           J: an ideal in the parameters
-RETURN:   all the free-square factors of the elements 
+RETURN:   all the free-square factors of the elements
           of ideal J (non repeated). Integer factors are ignored,
           even 0 is ignored. It can be called from ideal @R, but
           the given ideal J must only contain poynomials in the
-          parameters.          
+          parameters.
 NOTE:     Operates in the ring @P, and the ideal J must contain only
-          polynomials in the parameters, but can be called from ring @R.  
+          polynomials in the parameters, but can be called from ring @R.
 KEYWORDS: factor
 EXAMPLE:  facvar; shows an example"
@@ -621,12 +621,12 @@
 proc pnormalform(poly f, ideal N, ideal W)
 "USAGE:   pnormalform(f,N,W);
-          f: the polynomial to be reduced modulo N,W (in parameters and 
+          f: the polynomial to be reduced modulo N,W (in parameters and
              variables)
           N: the null conditions ideal
-          W: the non-null conditions (set of irreducible polynomials, ideal)          
+          W: the non-null conditions (set of irreducible polynomials, ideal)
 RETURN:   a reduced polynomial g of f, whose coefficients are reduced
           modulo N and having no factor in W.
-NOTE:     Should be called from ring @R. Ideals N and W must be polynomials 
-          in the parameters forming a red-specification (see definition)         the papers). 
+NOTE:     Should be called from ring @R. Ideals N and W must be polynomials
+          in the parameters forming a red-specification (see definition)         the papers).
 KEYWORDS: division, pdivi, reduce
 EXAMPLE:  pnormalform; shows an example"
@@ -700,12 +700,12 @@
           W: set of non-null polynomials (ideal)
 RETURN:   a list (N1,W1,L1) containing a red-specification of the segment (N,W).
-          N1 is the radical reduced ideal characterizing the segment. 
-          V(N1) is the Zarisky closure of the segment (N,W). 
+          N1 is the radical reduced ideal characterizing the segment.
+          V(N1) is the Zarisky closure of the segment (N,W).
           The segment S=V(N1) \ V(h), where h=prod(w in W1)
           N1 is uniquely determined and no prime component of N1 contains none of
           the polynomials in W1. The polynomials in W1 are prime and reduced
           wrt N1, and are considered non-null on the segment.
-          L1 contains the list of prime components of N1.                     
-NOTE:     can be called from ring @R but it works in ring @P.     
+          L1 contains the list of prime components of N1.
+NOTE:     can be called from ring @R but it works in ring @P.
 KEYWORDS: specification
 EXAMPLE:  redspec; shows an example"
@@ -1284,5 +1284,5 @@
 "USAGE:   buildtree(F);
           F: ideal in K[a][x] (parameters and variables) to be discussed
-RETURN:   Returns a list T describing a dichotomic discussion tree, whose 
+RETURN:   Returns a list T describing a dichotomic discussion tree, whose
           content is the first discussion of the ideal F of K[a][x].
           The first element of the list is the root, and contains
@@ -1294,5 +1294,5 @@
                 no optional conditions are given.
             [7] the set of lpp of ideal F
-            [8] condition that was taken to reach the vertex 
+            [8] condition that was taken to reach the vertex
                 (poly 1, for the root).
           The remaning elements of the list represent vertices of the tree:
@@ -1306,5 +1306,5 @@
                 to reach the vertex
             [7] the set of lpp of the specialized ideal at this stage
-            [8] condition that was taken to reach the vertex from the 
+            [8] condition that was taken to reach the vertex from the
                 father's vertex (that was taken non-null if the last
                 integer in the label is 1, and null if it is 0)
@@ -1313,5 +1313,5 @@
           specialized ideal on each point of the segment and preserve
           the lpp. So they form a disjoint reduced CGS.
-NOTE:     The basering R, must be of the form K[a][x], a=parameters, 
+NOTE:     The basering R, must be of the form K[a][x], a=parameters,
           x=variables, and should be defined previously. The ideal must
           be defined on R.
@@ -1323,5 +1323,5 @@
           The file written by buildtreetoMaple when readed in a Maple
           worksheet can be plotted using the dbgb routine tplot;
-          
+
 KEYWORDS: CGS, disjoint, reduced, comprehensive Groebner system
 EXAMPLE:  buildtree; shows an example"
@@ -1938,12 +1938,12 @@
     // detect weather W1 intersect W2 is non-empty
     for (i=1;i<=size(W1);i++)
-    { 
+    {
       if (memberpos(W1[i],W2)[1])
-      {     
+      {
         W12[size(W12)+1]=W1[i];
       }
       else
       {
-        if (nonnull(W1[i],N2,W2)) 
+        if (nonnull(W1[i],N2,W2))
         {
           W12[size(W12)+1]=W1[i];
@@ -2130,5 +2130,5 @@
       G=G+(cA1*ww1*c1[alpha]-(matrix(N10)*T*qT)[1,1])*Tm[alpha];
     }
-    //T_ "genimage has found a more generic basis (method 2)";    
+    //T_ "genimage has found a more generic basis (method 2)";
     //T_ "f1:"; f1; "N1:"; N1; "W1:"; W1;
     //T_ "f2:"; f2; "N2:"; N2; "W2:"; W2;
@@ -2136,5 +2136,5 @@
     GG=ideal(G);
   }
-  else{GG=ideal(0);} 
+  else{GG=ideal(0);}
   return(GG);
 };
@@ -2147,7 +2147,7 @@
 //          that is non-null in the second segment.
 // input:
-// poly f:    a polynomials of the reduced basis in the segment (N,W) 
+// poly f:    a polynomials of the reduced basis in the segment (N,W)
 // ideal N:   the null-conditions ideal in the segment
-// ideal W12: the set of non-null polynomials common to the segment and 
+// ideal W12: the set of non-null polynomials common to the segment and
 //            a second segment
 proc extendpoly(poly f, ideal N, ideal W12)
@@ -2297,5 +2297,5 @@
     //T_ "A sheaf has been found (method 1)";
     return(ideal(g1,g2));
-  } 
+  }
   return(ideal(genimage(g1,N1,W1,g2,N2,W2)));
 }
@@ -2316,5 +2316,5 @@
            [3]: the reduced basis of the segment.
            [4], [5], [6]: the red-spec of the null and non-null conditions
-                of the segment. 
+                of the segment.
                 [4] is the null-conditions radical ideal N,
                 [5] is the non-null polynomials set (ideal) W,
@@ -2322,5 +2322,5 @@
            [7]: is the set of lpp
            [8]: poly 1 (irrelevant) is the condition to branch (but no
-                more branch is necessary in the discussion, so 1 is the result. 
+                more branch is necessary in the discussion, so 1 is the result.
 NOTE:     It can be called having as argument the list output by buildtree
 KEYWORDS: buildtree, buildtreetoMaple, CGS
@@ -2455,5 +2455,5 @@
 //            reduced basis. The elements of L are of the form
 //            list (lpp,B,list(list(N,W,L),..list(N,W,L)) )
-proc selectcases(list bT) 
+proc selectcases(list bT)
 {
   list T=groupsegments(finalcases(bT));
@@ -3071,5 +3071,5 @@
 }
 
-// given the the label labfu of the vertex fu it returns the last 
+// given the label labfu of the vertex fu it returns the last
 // int of the label of the last existing children.
 // if no child exists, then it ouputs 0.
@@ -3098,5 +3098,5 @@
 }
 
-// given the the vertex u it provides the next brother of u.
+// given the vertex u it provides the next brother of u.
 // if it does not exist, then it ouputs v=list(list(intvec(0)),0)
 proc nextbrother(intvec labu)
@@ -3252,9 +3252,9 @@
           The description given here is identical for rcgs and crcgs.
           The elements of the list T computed by mrcgs are lists representing
-          a rooted tree. 
+          a rooted tree.
           Each element has as the two first entries with the following content:
-           [1]: The label (intvec) representing the position in the rooted 
+           [1]: The label (intvec) representing the position in the rooted
                 tree:  0 for the root (and this is a special element)
-                       i for the root of the segment i 
+                       i for the root of the segment i
                        (i,...) for the children of the segment i
            [2]: the number of children (int) of the vertex.
@@ -3264,5 +3264,5 @@
            3) the rest of vertices labelled with more indices.
           Description of the root. Vertex type 1)
-           There is a special vertex (the first one) whose content is 
+           There is a special vertex (the first one) whose content is
            the following:
              [3] lpp of the given ideal
@@ -3286,10 +3286,10 @@
           with an odd number of integers in the label are to be considered as
           substraction. As an example consider the following vertices:
-          v1=((i),2,lpp,B), 
-          v2=((i,1),2,P_{(i,1)}), 
+          v1=((i),2,lpp,B),
+          v2=((i,1),2,P_{(i,1)}),
           v3=((i,1,1),2,P_{(i,1,1)},
-          v4=((i,1,1,1),1,P_{(i,1,1,1)}, 
+          v4=((i,1,1,1),1,P_{(i,1,1,1)},
           v5=((i,1,1,1,1),0,P_{(i,1,1,1,1)},
-          v6=((i,1,1,2),1,P_{(i,1,1,2)}, 
+          v6=((i,1,1,2),1,P_{(i,1,1,2)},
           v7=((i,1,1,2,1),0,P_{(i,1,1,2,1)},
           v8=((i,1,2),0,P_{(i,1,2)},
@@ -3299,15 +3299,15 @@
           (V(i,1)\(((V(i,1,1) \ ((V(i,1,1,1) \ V(i,1,1,1,1)) u (V(i,1,1,2) \ V(i,1,1,2,1)))))
           u V(i,1,2)) u (V(i,2) \ V(i,2,1))
-          and can also be represented by 
+          and can also be represented by
           (V(i,1) \ (V(i,1,1) u V(i,1,2))) u
           (V(i,1,1,1) \ V(i,1,1,1)) u
-          (V(i,1,1,2) \ V(i,1,1,2,1)) u 
+          (V(i,1,1,2) \ V(i,1,1,2,1)) u
           (V(i,2) \ V(i,2,1))
-          where V(i,j,..) = V(P_{(i,j,..)}          
+          where V(i,j,..) = V(P_{(i,j,..)}
 NOTE:     There are three fundamental routines in the library: mrcgs, rcgs and crcgs.
           mrcgs (Minimal Reduced CGS) is an algorithm that packs so much as it
-          is able to do (using algorithms adhoc) the segments with the same lpp, 
-          obtaining the minimal number of segments. The hypothesis is that this 
-          is also canonical, but for the moment there is no proof of the uniqueness 
+          is able to do (using algorithms adhoc) the segments with the same lpp,
+          obtaining the minimal number of segments. The hypothesis is that this
+          is also canonical, but for the moment there is no proof of the uniqueness
           of that minimal packing. Moreover, the segments that are obtained are not
           locally closed, i.e. there are not always the difference of two varieties,
@@ -3396,5 +3396,5 @@
   {
     if (size(@L[i][1])>1)
-    { 
+    {
       @L[i][3]=delidfromid(N,@L[i][3]);
     }
@@ -3403,5 +3403,5 @@
   {
     if ((size(@L[i][1])>1) and (size(@L[i][1]) mod 2==1) and (equalideals(@L[i][3],ideal(0))))
-    { 
+    {
       lab=@L[i][1];
       labfu=delintvec(lab,size(lab));
@@ -3595,9 +3595,9 @@
           The description given here is analogous as for mrcgs and crcgs.
           The elements of the list T computed by rcgs are lists representing
-          a rooted tree. 
+          a rooted tree.
           Each element has as the two first entries with the following content:
-           [1]: The label (intvec) representing the position in the rooted 
+           [1]: The label (intvec) representing the position in the rooted
                 tree:  0 for the root (and this is a special element)
-                       i for the root of the segment i 
+                       i for the root of the segment i
                        (i,...) for the children of the segment i
            [2]: the number of children (int) of the vertex.
@@ -3607,5 +3607,5 @@
            3) the rest of vertices labelled with more indices.
           Description of the root. Vertex type 1)
-           There is a special vertex (the first one) whose content is 
+           There is a special vertex (the first one) whose content is
            the following:
              [3] lpp of the given ideal
@@ -3629,16 +3629,16 @@
           with an odd number of integers in the label are to be considered as
           substraction. As an example consider the following vertices:
-          v1=((i),2,lpp,B), 
-          v2=((i,1),2,P_{(i,1)}), 
+          v1=((i),2,lpp,B),
+          v2=((i,1),2,P_{(i,1)}),
           v3=((i,1,1),0,P_{(i,1,1)}, v4=((i,1,2),0,P_{(i,1,1)}),
-          v5=((i,2),2,P_{(i,2)},  
+          v5=((i,2),2,P_{(i,2)},
           v6=((i,2,1),0,P_{(i,2,1)}, v7=((i,2,2),0,P_{(i,2,2)}
           They represent the segment:
-          (V(i,1)\(V(i,1,1) u V(i,1,2))) u 
+          (V(i,1)\(V(i,1,1) u V(i,1,2))) u
           (V(i,2)\(V(i,2,1) u V(i,2,2)))
-          where V(i,j,..) = V(P_{(i,j,..)}          
+          where V(i,j,..) = V(P_{(i,j,..)}
 NOTE:     There are three fundamental routines in the library: mrcgs, rcgs and crcgs.
           rcgs (Reduced CGS) is an algorithm that first homogenizes the
-          basis of the given ideal then applies mrcgs and finally de-homogenizes 
+          basis of the given ideal then applies mrcgs and finally de-homogenizes
           and reduces the resulting bases. (See the note of mrcgs).
           As a result of Wibmer's Theorem, the resulting segments are
@@ -3647,5 +3647,5 @@
           is not the homogenized ideal of the given ideal but only the ideal
           obtained by homogenizing the given basis.
-          
+
           The output can be visualized using cantreetoMaple, that will
           write a file with the content of mrcgs that can be read in Maple
@@ -3777,9 +3777,9 @@
           The description given here is identical for mrcgs and rcgs.
           The elements of the list T computed by crcgs are lists representing
-          a rooted tree. 
+          a rooted tree.
           Each element has as the two first entries with the following content:
-           [1]: The label (intvec) representing the position in the rooted 
+           [1]: The label (intvec) representing the position in the rooted
                 tree:  0 for the root (and this is a special element)
-                       i for the root of the segment i 
+                       i for the root of the segment i
                        (i,...) for the children of the segment i
            [2]: the number of children (int) of the vertex.
@@ -3789,5 +3789,5 @@
            3) the rest of vertices labelled with more indices.
           Description of the root. Vertex type 1)
-           There is a special vertex (the first one) whose content is 
+           There is a special vertex (the first one) whose content is
            the following:
              [3] lpp of the given ideal
@@ -3811,26 +3811,26 @@
           with an odd number of integers in the label are to be considered as
           substraction. As an example consider the following vertices:
-          v1=((i),2,lpp,B), 
-          v2=((i,1),2,P_{(i,1)}), 
+          v1=((i),2,lpp,B),
+          v2=((i,1),2,P_{(i,1)}),
           v3=((i,1,1),0,P_{(i,1,1)}, v4=((i,1,2),0,P_{(i,1,1)}),
-          v5=((i,2),2,P_{(i,2)},  
+          v5=((i,2),2,P_{(i,2)},
           v6=((i,2,1),0,P_{(i,2,1)}, v7=((i,2,2),0,P_{(i,2,2)}
           They represent the segment:
-          (V(i,1)\(V(i,1,1) u V(i,1,2))) u 
+          (V(i,1)\(V(i,1,1) u V(i,1,2))) u
           (V(i,2)\(V(i,2,1) u V(i,2,2)))
-          where V(i,j,..) = V(P_{(i,j,..)}          
+          where V(i,j,..) = V(P_{(i,j,..)}
 NOTE:     There are three fundamental routines in the library: mrcgs, rcgs and crcgs.
           crcgs (Canonical Reduced CGS) is an algorithm that first homogenizes the
-          the given ideal then applies mrcgs and finally de-homogenizes 
+          the given ideal then applies mrcgs and finally de-homogenizes
           and reduces the resulting bases. (See the note of mrcgs).
           As a result of Wibmer's Theorem, the resulting segments are
           locally closed (i.e. difference of varieties) and the partition is
-          canonical as the homogenized ideal is uniquely associated to the given 
+          canonical as the homogenized ideal is uniquely associated to the given
           ideal not depending of the given basis.
-          
+
           Nevertheless the computations to do are usually more time consuming
           and so it is preferable to compute first the rcgs and only if
           it success you can try crcgs.
-          
+
           The output can be visualized using cantreetoMaple, that will
           write a file with the content of crcgs that can be read in Maple
@@ -3882,5 +3882,5 @@
   def Jp=idint(Np,Mp);
   setring(RR);
-  return(imap(@P,Jp));  
+  return(imap(@P,Jp));
 }
 
@@ -3905,5 +3905,5 @@
           output where each segment corresponds to a single element of the list
           that is described as difference of two varieties.
-          
+
           The first element of the list is identical to the first element
           of the list provided by the corresponding cgs algorithm, and
@@ -3916,5 +3916,5 @@
            [4]; the ideal of the second variety (radical)
           The segment is V([3]) \ V([4]).
-          
+
 NOTE:     It can be called from the output of mrcgs or rcgs of crcgs
 KEYWORDS: mrcgs, rcgs, crcgs, Maple
@@ -3947,10 +3947,10 @@
       v=tree(intvec(i,j),L);
       Nn=v[1][3];
-      N=idintR(N,Nn); 
+      N=idintR(N,Nn);
       for (k=1;k<=v[1][2];k++)
       {
         w=tree(intvec(i,j,k),L);
         Mn=w[1][3];
-        M=idintR(M,Mn); 
+        M=idintR(M,Mn);
       }
     }
@@ -3964,6 +3964,6 @@
     MP=gbR(MP);
     setring(RR);
-    N=imap(@P,NP);     
-    M=imap(@P,MP);     
+    N=imap(@P,NP);
+    M=imap(@P,MP);
     LL[i+1]=list(u[1][3],u[1][4],N,M);
   }
@@ -3977,5 +3977,5 @@
   T;
   cantreetoMaple(T,"Tc","Tc.txt");
-  cantodiffcgs(T);  
+  cantodiffcgs(T);
 }
 
Index: Singular/LIB/sing.lib
===================================================================
--- Singular/LIB/sing.lib	(revision fba86f89b3458187b40c5f0d5f6408412d98d295)
+++ Singular/LIB/sing.lib	(revision 7d56875cf7720719f5b6acd193768a4d5b57848f)
@@ -1,7 +1,7 @@
-// $Id: sing.lib,v 1.31 2008-09-24 07:54:59 Singular Exp $
+// $Id: sing.lib,v 1.32 2008-10-09 09:31:58 Singular Exp $
 //(GMG/BM, last modified 26.06.96,
 //GMG, 27.7.08: in milnor printlevel und Ausschrift gendert)
 ///////////////////////////////////////////////////////////////////////////////
-version="$Id: sing.lib,v 1.31 2008-09-24 07:54:59 Singular Exp $";
+version="$Id: sing.lib,v 1.32 2008-10-09 09:31:58 Singular Exp $";
 category="Singularities";
 info="
@@ -11,5 +11,5 @@
 
 PROCEDURES:
- codim(id1, id2);       vector space dimension of of id2/id1 if finite
+ codim(id1, id2);       vector space dimension of id2/id1 if finite
  deform(i);             infinitesimal deformations of ideal i
  dim_slocus(i);         dimension of singular locus of ideal i
Index: Singular/LIB/tropical.lib
===================================================================
--- Singular/LIB/tropical.lib	(revision fba86f89b3458187b40c5f0d5f6408412d98d295)
+++ Singular/LIB/tropical.lib	(revision 7d56875cf7720719f5b6acd193768a4d5b57848f)
@@ -1,3 +1,3 @@
-version="$Id: tropical.lib,v 1.7 2008-08-20 17:36:04 keilen Exp $";
+version="$Id: tropical.lib,v 1.8 2008-10-09 09:31:58 Singular Exp $";
 category="Tropical Geometry";
 info="
@@ -8,5 +8,5 @@
 @*               Thomas Markwig,  email: keilen@mathematik.uni-kl.de
 
-WARNING: 
+WARNING:
      - tropicalLifting will only work under LINUX and if in addition gfan is installed.
 @*   - drawTropicalCurve and drawTropicalNewtonSubdivision will only display the tropical
@@ -20,8 +20,8 @@
      the torus is embedded via the map sending a point x in (K*)^n to the point (x^v0,...,x^vm).
      The generic hyperplane sections are just the images of the hypersurfaces in (K*)^n defined by
-     the polynomials f=a0*x^v0+...+am*x^vm=0. Some properties of these hypersurfaces can be studied 
-     via tropicalisation. 
-
-     For this we suppose that K=C{{t}} is the field of Puiseux series over the field of complex 
+     the polynomials f=a0*x^v0+...+am*x^vm=0. Some properties of these hypersurfaces can be studied
+     via tropicalisation.
+
+     For this we suppose that K=C{{t}} is the field of Puiseux series over the field of complex
      numbers (or any other field with a valuation into the real numbers). One associates to the
      hypersurface given by f=a0*x^v0+...+am*x^vm the tropical hypersurface defined by the tropicalisation
@@ -29,8 +29,8 @@
      of the integer vector v in Z^n with the vector x=(x1,...,xn) of variables, so that trop(f) is
      a piecewise linear function on R^n. The corner locus of this function (i.e. the points at which
-     the minimum is attained a least twice) is the tropical hypersurface defined by trop(f). 
+     the minimum is attained a least twice) is the tropical hypersurface defined by trop(f).
      The theorem of Newton-Kapranov states that this tropical hypersurface is the same as if one
      computes pointwise the valuation of the hypersurface given by f. The analogue holds true if one
-     replaces one equation f by an ideal I. A constructive proof of the theorem is given by an adapted 
+     replaces one equation f by an ideal I. A constructive proof of the theorem is given by an adapted
      version of the Newton-Puiseux algorithm. The hard part is to find a point in the variety over
      C{{t}} which corresponds to a given point in the tropical variety.
@@ -39,6 +39,6 @@
      Of course we cannot represent the field of Puiseux series over C in its full strength, however,
      in order to compute interesting examples it will be sufficient to replace the complex numbers C
-     by the rational numbers Q and to replace Puiseux series in t by rational functions in t, 
-     i.e. we replace C{{t}} by Q(t), or sometimes even by Q[t]. Note, that this in particular 
+     by the rational numbers Q and to replace Puiseux series in t by rational functions in t,
+     i.e. we replace C{{t}} by Q(t), or sometimes even by Q[t]. Note, that this in particular
      forbits rational exponents for the t's.
 
@@ -48,7 +48,7 @@
      If, however, for some reason you prefer to work with general vi, then you have to pass right away to
      the tropicalisation of the equations, whereever this is allowed -- these are linear polynomials
-     where the constant coefficient correspond to the valuation of the original coefficient and where 
+     where the constant coefficient correspond to the valuation of the original coefficient and where
      the non-constant coefficient correspond to the exponents of the monomials, thus they may be rational
-     numbers respectively negative numbers: 
+     numbers respectively negative numbers:
      e.g. if f=t^{1/2}*x^{-2}*y^3+2t*x*y+4  then  trop(f)=min{1/2-2x+3y,1+x+y,0}.
 
@@ -59,5 +59,5 @@
                           I have to be in the polynomial ring Q[t,x1,...,xn] considered as a subring of
                           C{{t}}[x1,...,xn]; a solution will be constructed up to given order; note that
-                          several field extensions of Q might be necessary thoughout the intermediate 
+                          several field extensions of Q might be necessary thoughout the intermediate
                           computations; the procedures uses the external program gfan
 @*   - drawTropicalCurve  visualises a tropical plane curve either given by a polynomial in Q(t)[x,y]
@@ -66,5 +66,5 @@
 @*   - tropicalJInvariant computes the tropical j-invaiant of a tropical elliptic curve
 @*   - jInvariant         computes the j-invariant of an elliptic curve
-@*   - weierstrassFom     computes the Weierstrass form of an elliptic curve     
+@*   - weierstrassFom     computes the Weierstrass form of an elliptic curve
 
 PROCEDURES CONCERNED WITH TROPICAL LIFTING:
@@ -93,10 +93,10 @@
 PROCEDURES CONCERNED WITH THE LATEX CONVERSION:
      texNumber(poly)                  outputs the texcommand for the leading coefficient of poly
-     texPolynomial(poly)              outputs the texcommand for the polynomial poly 
+     texPolynomial(poly)              outputs the texcommand for the polynomial poly
      texMatrix(matrix)                outputs the texcommand for the matrix
      texDrawBasic(list)               embeds the output of texDrawTropical in a texdraw environment
      texDrawTropical(list)            computes the texdraw commands for a tropical curve
-     texDrawNewtonSubdivision(list)   computes the texdraw commands for a Newton subdivision 
-     texDrawTriangulation(list,list)  computes the texdraw commands for a triangulation     
+     texDrawNewtonSubdivision(list)   computes the texdraw commands for a Newton subdivision
+     texDrawTriangulation(list,list)  computes the texdraw commands for a triangulation
 
 AUXILARY PROCEDURES:
@@ -108,5 +108,5 @@
      dualConic(poly)                  computes the dual of the affine plane conic defined by poly
      parameterSubstitute(poly,int)    substitutes in the poly the parameter t by t^N
-     tropcialSubst(poly,int,list)     computes the tropical polynomial of poly with certain substitutions 
+     tropcialSubst(poly,int,list)     computes the tropical polynomial of poly with certain substitutions
      randomPoly(int,int,int)          computes a polynomial with random coefficients
      cleanTmp()                       removes the latex and ps files from /tmp created by other procedures
@@ -137,5 +137,5 @@
 /// - eliminatecomponents
 /// - findzerosAndBasictransform
-/// - ordermaximalideals 
+/// - ordermaximalideals
 /// - verticesTropicalCurve
 /// - bunchOfLines
@@ -186,16 +186,16 @@
 
 ////////////////////////////////////////////////////////////////////////////////////
-/// Procedures concerned with tropical parametrisation 
-///////////////////////////////////////////////////////////////////////////////////  
+/// Procedures concerned with tropical parametrisation
+///////////////////////////////////////////////////////////////////////////////////
 
 proc tropicalLifting (ideal i,intvec w,int ordnung,list #)
 "USAGE:  tropicalLifting(i,w,ord[,opt]); i ideal, w intvec, ord int, opt string
-ASSUME:  - i is an ideal in Q[t,x_1,...,x_n], w=(w_0,w_1,...,w_n)  
-           and (w_1/w_0,...,w_n/w_0) is in the tropical variety of i, 
-           and ord is the order up to which a point in V(i) over Q{{t}} lying over 
+ASSUME:  - i is an ideal in Q[t,x_1,...,x_n], w=(w_0,w_1,...,w_n)
+           and (w_1/w_0,...,w_n/w_0) is in the tropical variety of i,
+           and ord is the order up to which a point in V(i) over Q{{t}} lying over
            (w_1/w_0,...,w_n/w_0) shall be computed; w_0 may NOT be ZERO
-@*       - the basering should not have any parameters on its own 
+@*       - the basering should not have any parameters on its own
            and it should have a global monomial ordering, e.g. ring r=0,(t,x(1..n)),dp;
-@*       - the first variable of the basering will be treated as the parameter t 
+@*       - the first variable of the basering will be treated as the parameter t
            in the Puiseux series field !!!!
 @*       - the optional parameter opt should be one or more strings among the following:
@@ -203,5 +203,5 @@
 @*         'isPrime'            : the ideal is prime over Q(t)[x_1,...,x_n]  (not to be checked);
 @*         'isInTrop'           : (w_1/w_0,...,w_n/w_0) is in the tropical variety (not to be checked);
-@*         'oldGfan'            : uses gfan version 0.2.1 or less 
+@*         'oldGfan'            : uses gfan version 0.2.1 or less
 @*         'findAll'            : find all solutions of a zero-dimensional ideal over (w_1/w_0,...,w_n/w_0)
 @*         'noAbs'              : do NOT use absolute primary decomposition
@@ -226,8 +226,8 @@
                in the tropical variety of i to a point in V(i) over Puiseux series field up to
                the first ord terms, if the ideal is zero-dimensional over Q{{t}};
-               more precisely, each entry of the list is a list l as computed if 
+               more precisely, each entry of the list is a list l as computed if
                'find_all' was NOT set
 @*       WE NOW DESCRIBE THE LIST ENTRIES IF 'findAll' WAS NOT SET:
-@*       - the ring l[1] contains an ideal LIFT, which contains 
+@*       - the ring l[1] contains an ideal LIFT, which contains
            a point in V(i) lying over w up to the first ord terms;
 @*       - and if the integer l[2] is N then t has to be replaced by t^1/N in the
@@ -235,5 +235,5 @@
 @*       - if the k+1st entry of l[3] is  non-zero, then the kth component of LIFT has to
            be multiplied t^(-l[3][k]/l[3][1]) AFTER substituting t by t^1/N
-@*       - unless the option 'noResubst' was set, the kth entry of list l[4] 
+@*       - unless the option 'noResubst' was set, the kth entry of list l[4]
            is a string which represents the kth generator of
            the ideal i where the coordinates have been replaced by the result of the lift;
@@ -246,5 +246,5 @@
 @*       - if the parameter 'findAll' is set AND the ideal i is zero-dimensional in Q{{t}}[x_1,...,x_n]
            then ALL points in V(i) lying over w are computed up to order ord; if the ideal
-           is not-zero dimenisonal, then only all points in the ideal after cutting down 
+           is not-zero dimenisonal, then only all points in the ideal after cutting down
            to dimension zero will be computed
 @*       - the procedure REQUIRES that the program GFAN is installed on your computer;
@@ -263,10 +263,10 @@
              and thus there may not exist a point in V(i) over the Puiseux series field
              with the desired valuation; so there is no chance that the procedure produced
-             a sensible output - e.g. if i=tx^p-tx-1 
-@*         + if the dimension of i over Z/pZ(t) is not zero the process of reduction to 
+             a sensible output - e.g. if i=tx^p-tx-1
+@*         + if the dimension of i over Z/pZ(t) is not zero the process of reduction to
              zero might not work if the characteristic is small and you are unlucky
-@*         + the option 'noAbs' has to be used since absolute primary decomposition in 
+@*         + the option 'noAbs' has to be used since absolute primary decomposition in
              Singular only works in characteristic zero
-@*       - the basefield should either be Q or Z/pZ for some prime p; field extensions 
+@*       - the basefield should either be Q or Z/pZ for some prime p; field extensions
            will be computed where necessary; if you need parameters or field extensions
            from the beginning they should rather be simulated as variables possibly adding
@@ -346,5 +346,5 @@
   {
     Error("The first coordinate of your input w must be NON-ZERO, since it is a DENOMINATOR!");
-  } 
+  }
   // if w_0<0, then replace w by -w, so that the "denominator" w_0 is positive
   if (w[1]<0)
@@ -362,5 +362,5 @@
     w[1]=-1;
   }
-  // if some entry of w is positive, we have to make a transformation, 
+  // if some entry of w is positive, we have to make a transformation,
   // which moves it to something non-positive
   for (j=2;j<=nvars(basering);j++)
@@ -387,12 +387,12 @@
   {
     variablen=variablen+var(j);
-  }    
+  }
   map GRUNDPHI=BASERING,t,variablen;
   ideal i=GRUNDPHI(i);
-  // compute the initial ideal of i and test if w is in the tropical variety of i 
+  // compute the initial ideal of i and test if w is in the tropical variety of i
   // - the last entry 1 only means that t is the last variable in the ring
   ideal ini=tInitialIdeal(i,w,1);
   if (isintrop==0) // test if w is in trop(i) only if isInTrop has not been set
-  {    
+  {
     poly product=1;
     for (j=1;j<=nvars(basering)-1;j++)
@@ -418,8 +418,8 @@
       // the procedurce cutdown computes a new ring, in which there lives a zero-dimensional
       // ideal which has been computed by cutting down the input with generic linear forms
-      // of the type x_i1-p_1,...,x_id-p_d for some polynomials p_1,...,p_d not depending 
+      // of the type x_i1-p_1,...,x_id-p_d for some polynomials p_1,...,p_d not depending
       // on the variables x_i1,...,x_id; that way we have reduced the number of variables by dd !!!
       // the new zero-dimensional ideal is called i, its t-initial ideal (with respect to
-      // the new w=CUTDOWN[2]) is ini, and finally there is a list repl in the ring 
+      // the new w=CUTDOWN[2]) is ini, and finally there is a list repl in the ring
       // which contains at the polynomial p_j at position i_j and a zero otherwise;
       if (isprime==0) // the minimal associated primes of i are computed
@@ -461,5 +461,5 @@
     for (jj=1;jj<=size(TP);jj++)
     {
-      // the list TP contains as a first entry the ring over which the tropical parametrisation 
+      // the list TP contains as a first entry the ring over which the tropical parametrisation
       // of the (possibly cutdown ideal) i lives
       def LIFTRING=TP[jj][1];
@@ -493,9 +493,9 @@
         }
         setring LIFTRING;
-        ideal LIFT=imap(REPLACEMENTRING,LIFT);    
-        // test now if the LIFT has the correct valuation !!!     
+        ideal LIFT=imap(REPLACEMENTRING,LIFT);
+        // test now if the LIFT has the correct valuation !!!
         // note: it may happen, that when resubstituting PARA into the replacement rules
         //       there occured some unexpected cancellation; we only know that for SOME
-        //       solution of the zero-dimensional reduction NO canellation will occur, 
+        //       solution of the zero-dimensional reduction NO canellation will occur,
         //       but for others this may very well happen; this in particular means that
         //       we possibly MUST compute all zero-dimensional solutions when cutting down!
@@ -548,5 +548,5 @@
           // replace @a by a in minpoly and in LIFT
           map phi=INTERRING,t,a,a;
-          mp=phi(mp);      
+          mp=phi(mp);
           LIFT=phi(LIFT);
           // pass now to a ring whithout @a and with a as parameter
@@ -555,9 +555,9 @@
           ideal LIFT=imap(INTERRING,LIFT);
           kill INTERRING;
-        }    
+        }
         // then export LIFT
-        export(LIFT); 
+        export(LIFT);
         // test the  result by resubstitution
-        setring GRUNDRING;  
+        setring GRUNDRING;
         list resubst;
         if (noresubst==0)
@@ -568,10 +568,10 @@
           }
           else
-          {      
+          {
             resubst=tropicalliftingresubstitute(substitute(i,t,t^(TP[jj][2])),list(LIFTRING),N*TP[jj][2]);
           }
         }
         setring BASERING;
-        // Finally, if t has been replaced by t^N, then we have to change the 
+        // Finally, if t has been replaced by t^N, then we have to change the
         // third entry of TP by multiplying by N.
         if (noabs==1)
@@ -598,5 +598,5 @@
       "The procedure will be restarted with the option 'findAll'.";
       "Go on by hitting RETURN!";
-      findall=1;    
+      findall=1;
       noabs=0;
       setring CUTDOWNRING;
@@ -604,5 +604,5 @@
       "i";i;
       "ini";tInitialIdeal(i,w,1);
-      
+
 /*
       setring GRUNDRING;
@@ -630,24 +630,24 @@
   if (voice+printlevel>=2)
   {
-      
+
       "The procedure has created a list of lists. The jth entry of this list
 contains a ring, an integer and an intvec.
 In this ring lives an ideal representing the wanted lifting,
 if the integer is N then in the parametrisation t has to be replaced by t^1/N,
-and if the ith component of the intvec is w[i] then the ith component in LIFT 
+and if the ith component of the intvec is w[i] then the ith component in LIFT
 should be multiplied by t^-w[i]/N in order to get the parametrisation.
-   
+
 Suppose your list has the name L, then you can access the 1st ring via:
 ";
     if (findall==1)
     {
-      "def LIFTRing=L[1][1]; setring LIFTRing; LIFT; 
+      "def LIFTRing=L[1][1]; setring LIFTRing; LIFT;
 ";
     }
     else
     {
-      "def LIFTRing=L[1]; setring LIFTRing; LIFT; 
+      "def LIFTRing=L[1]; setring LIFTRing; LIFT;
 ";
-    }  
+    }
   }
   if (findall==1) // if all solutions have been computed, return a list of lists
@@ -674,5 +674,5 @@
    def LIFTRing=LIST[1];
    setring LIFTRing;
-   // LIFT contains the first 4 terms of a point in the variety of i 
+   // LIFT contains the first 4 terms of a point in the variety of i
    // over the Puiseux series field C{{t}} whose order is -w[1]/w[0]=1
    LIFT;
@@ -702,5 +702,5 @@
    // NOTE: since the last component of v is positive, the lifting
    //       must start with a negative power of t, which in Singular
-   //       is not allowed for a variable. 
+   //       is not allowed for a variable.
    def LIFTRing3=LIST[1];
    setring LIFTRing3;
@@ -756,22 +756,22 @@
     }
     if (size(troplift)==4) // this means that tropicalLifting was called with absolute primary decomposition
-    {      
+    {
       setring LIFTRing;
       "The lifting of the point in the tropical variety lives in the ring";
       if ((size(LIFTpar)==0) and (N==1))
       {
-        Kstring+"[[t]]"; 
+        Kstring+"[[t]]";
       }
       if ((size(LIFTpar)==0) and (N!=1))
       {
-        Kstring+"[[t^(1/"+string(N)+")]]"; 
+        Kstring+"[[t^(1/"+string(N)+")]]";
       }
       if ((size(LIFTpar)!=0) and (N!=1))
-      {    
-        Kstring+"["+LIFTpar+"]/"+string(minpoly)+"[[t^(1/"+string(N)+")]]";  
+      {
+        Kstring+"["+LIFTpar+"]/"+string(minpoly)+"[[t^(1/"+string(N)+")]]";
       }
       if ((size(LIFTpar)!=0) and (N==1))
-      {    
-        Kstring+"["+LIFTpar+"]/"+string(minpoly)+"[[t]]";  
+      {
+        Kstring+"["+LIFTpar+"]/"+string(minpoly)+"[[t]]";
       }
     }
@@ -790,15 +790,15 @@
       }
       if ((size(LIFTpar)!=0) and (N!=1))
-      {    
-        Kstring+"["+LIFTpar+"]/M[[t^(1/"+string(N)+")]]";  
+      {
+        Kstring+"["+LIFTpar+"]/M[[t^(1/"+string(N)+")]]";
         "where M is the maximal ideal";
         "M=<"+m+">";
       }
       if ((size(LIFTpar)!=0) and (N==1))
-      {    
-        Kstring+"["+LIFTpar+"]/M[[t]]";  
+      {
+        Kstring+"["+LIFTpar+"]/M[[t]]";
         "where M is the maximal ideal";
         "M=<"+m+">";
-      }      
+      }
     }
     "";
@@ -827,5 +827,5 @@
       }
     }
-  }      
+  }
 }
 example
@@ -841,14 +841,14 @@
 
 ////////////////////////////////////////////////////////////////////////////////////
-/// Procedures concerned with drawing a tropical curve or a Newton subdivision 
+/// Procedures concerned with drawing a tropical curve or a Newton subdivision
 ////////////////////////////////////////////////////////////////////////////////////
 proc tropicalCurve (def tp,list #)
 "USAGE:      tropicalCurve(tp[,#]); tp list, # optional list
-ASSUME:      tp is list of linear polynomials of the form ax+by+c with integers a, b and a rational number c 
+ASSUME:      tp is list of linear polynomials of the form ax+by+c with integers a, b and a rational number c
              representing a tropical Laurent polynomial defining a tropical plane curve;
              alternatively tp can be a polynomial in Q(t)[x,y] defining a tropical plane curve
-             via the valuation map; 
+             via the valuation map;
              the basering must have a global monomial ordering, two variables and up to one parameter!
-RETURN:      list, each entry i=1,...,size(l)-1 corresponds to a vertex in the tropical plane 
+RETURN:      list, each entry i=1,...,size(l)-1 corresponds to a vertex in the tropical plane
                    curve defined by tp
                    l[i][1] = x-coordinate of the ith vertex
@@ -857,10 +857,10 @@
                              the tropical curve is connected to the jth vertex with multiplicity given
                              by the corresponding entry in the second row
-                   l[i][4] = list of lists, the first entry of a list is a primitive integer vector 
-                             defining the direction of an unbounded edge emerging from the ith vertex 
+                   l[i][4] = list of lists, the first entry of a list is a primitive integer vector
+                             defining the direction of an unbounded edge emerging from the ith vertex
                              of the graph, the corresponding second entry in the list is the multiplicity
                              of the unbounded edge
                    l[i][5] = a polynomial whose monomials mark the vertices in the Newton polygon
-                             corresponding to the entries in tp which take the common minimum 
+                             corresponding to the entries in tp which take the common minimum
                              at the ith vertex -- if some coefficient a or b of the linear polynomials
                              in the input was negative, then each monomial has to be shifted by
@@ -885,5 +885,5 @@
   }
   // if you insert a single polynomial instead of an ideal representing a tropicalised polynomial,
-  // then we compute first the tropicalisation of this polynomial -- this feature is not 
+  // then we compute first the tropicalisation of this polynomial -- this feature is not
   // documented in the above help string
   if (typeof(tp)=="poly")
@@ -892,5 +892,5 @@
     if ((npars(basering)!=1) or (nvars(basering)!=2))
     {
-      ERROR("The basering should have precisely one parameter and two indeterminates!");      
+      ERROR("The basering should have precisely one parameter and two indeterminates!");
     }
     poly f=tp;
@@ -901,5 +901,5 @@
   if (nvars(basering) != 2)
   {
-    ERROR("The basering should have precisely two indeterminates!");      
+    ERROR("The basering should have precisely two indeterminates!");
   }
   // -1) Exclude the pathological case that the defining tropical polynomial has only one term,
@@ -910,5 +910,5 @@
     intmat M[2][1]=0,0;
     return(list(list(0,0,M,list(),detropicalise(tp[1])),list(list(leadexp(detropicalise(tp[1]))),list())));
-  }    
+  }
   // 0) If the input was a list of linear polynomials, then some coefficient of x or y can be negative,
   //    i.e. the input corresponds to the tropical curve of a Laurent polynomial. In that case we should
@@ -925,5 +925,5 @@
     {
       bb=koeffizienten(tp[i],2);
-    }    
+    }
   }
   if ((aa!=0) or (bb!=0))
@@ -942,11 +942,11 @@
     return(bunchOfLines(tp));
   }
-  // 2) store all vertices belonging to the ith part of the 
+  // 2) store all vertices belonging to the ith part of the
   //    Newton subdivision in the list vtp[i] as 4th entry,
   //    and store those, which are not corners of the ith subdivision polygon
   //    in vtp[i][6]
-  poly nwt; 
+  poly nwt;
   list boundaryNSD;  // stores the boundary of a Newton subdivision
-  intmat zwsp[2][1]; // used for intermediate storage    
+  intmat zwsp[2][1]; // used for intermediate storage
   for (i=1;i<=size(vtp);i++)
   {
@@ -954,5 +954,5 @@
     nwt=vtp[i][3]; // the polynomial representing the ith part of the Newton subdivision
     // store the vertices of the ith part of the Newton subdivision in the list newton
-    list newton;  
+    list newton;
     while (nwt!=0)
     {
@@ -964,5 +964,5 @@
     vtp[i][4]=boundaryNSD[1];
     vtp[i][5]=boundaryNSD[2];
-    vtp[i][6]=zwsp; // the entries of the first row will denote to which vertex the ith one is connected 
+    vtp[i][6]=zwsp; // the entries of the first row will denote to which vertex the ith one is connected
                  // and the entries of the second row will denote with which multiplicity
     kill newton; // we kill the superflous list
@@ -984,5 +984,5 @@
     kill ipairs;
   }
-  // 4) Check for all pairs of verticies in the Newton diagram if they 
+  // 4) Check for all pairs of verticies in the Newton diagram if they
   //    occur in two different parts of the Newton subdivision
   int deleted; // if a pair occurs in two NSD, it can be removed from both - deleted is then set to 1
@@ -991,5 +991,5 @@
   d=1;  // counts the inner edges
   for (i=1;i<=size(pairs)-1;i++)
-  {  
+  {
     for (j=i+1;j<=size(pairs);j++)
     {
@@ -998,5 +998,5 @@
         deleted=0;
         for (l=size(pairs[j]);l>=1 and deleted==0;l--)
-        {  
+        {
           if (((pairs[i][k][1]==pairs[j][l][1]) and (pairs[i][k][2]==pairs[j][l][2])) or ((pairs[i][k][1]==pairs[j][l][2]) and (pairs[i][k][2]==pairs[j][l][1])))
           {
@@ -1062,5 +1062,5 @@
   for (i=1;i<=size(pairs);i++)
   {
-    list ubedges; // stores the unbounded edges 
+    list ubedges; // stores the unbounded edges
     k=1; // counts the unbounded edges
     for (j=1;j<=size(pairs[i]);j++)
@@ -1114,5 +1114,5 @@
     gr[3]=vtp[i][6];  // to which vertices is the ith vertex of the tropical curve connected
     gr[4]=vtp[i][7];  // the directions unbounded edges emerging from the ith vertex of the trop. curve
-    gr[5]=vtp[i][3];  // the vertices of the boundary of the ith part of the NSD 
+    gr[5]=vtp[i][3];  // the vertices of the boundary of the ith part of the NSD
     graph[i]=gr;
   }
@@ -1149,24 +1149,24 @@
 // the coordinates of the first vertex are graph[1][1],graph[1][2];
    graph[1][1],graph[1][2];
-// the first vertex is connected to the vertices 
+// the first vertex is connected to the vertices
 //     graph[1][3][1,1..ncols(graph[1][3])]
    intmat M=graph[1][3];
    M[1,1..ncols(graph[1][3])];
-// the weights of the edges to these vertices are 
+// the weights of the edges to these vertices are
 //     graph[1][3][2,1..ncols(graph[1][3])]
    M[2,1..ncols(graph[1][3])];
 // from the first vertex emerge size(graph[1][4]) unbounded edges
    size(graph[1][4]);
-// the primitive integral direction vector of the first unbounded edge 
+// the primitive integral direction vector of the first unbounded edge
 //     of the first vertex
    graph[1][4][1][1];
 // the weight of the first unbounded edge of the first vertex
    graph[1][4][1][2];
-// the monomials which are part of the Newton subdivision of the first vertex 
+// the monomials which are part of the Newton subdivision of the first vertex
    graph[1][5];
-// connecting the points in graph[size(graph)][1] we get 
+// connecting the points in graph[size(graph)][1] we get
 //     the boundary of the Newton polytope
    graph[size(graph)][1];
-// an entry in graph[size(graph)][2] is a pair of points 
+// an entry in graph[size(graph)][2] is a pair of points
 //     in the Newton polytope bounding an inner edge
    graph[size(graph)][2][1];
@@ -1175,17 +1175,17 @@
 proc drawTropicalCurve (def f,list #)
 "USAGE:      drawTropicalCurve(f[,#]); f poly or list, # optional list
-ASSUME:      f is list of linear polynomials of the form ax+by+c with integers a, b and a rational number c 
+ASSUME:      f is list of linear polynomials of the form ax+by+c with integers a, b and a rational number c
              representing a tropical Laurent polynomial defining a tropical plane curve;
              alternatively f can be a polynomial in Q(t)[x,y] defining a tropical plane curve
-             via the valuation map; 
+             via the valuation map;
              the basering must have a global monomial ordering, two variables and up to one parameter!
 RETURN:      NONE
-NOTE:        - the procedure produces the files /tmp/tropicalcurveNUMBER.tex and 
-               /tmp/tropicalcurveNUMBER.ps, where NUMBER is a random four digit integer; 
+NOTE:        - the procedure produces the files /tmp/tropicalcurveNUMBER.tex and
+               /tmp/tropicalcurveNUMBER.ps, where NUMBER is a random four digit integer;
                moreover it displays the tropical curve defined by f via kghostview;
                if you wish to remove all these files from /tmp, call the procedure cleanTmp
 @*           - edges with multiplicity greater than one carry this multiplicity
 @*           - if # is empty, then the tropical curve is computed w.r.t. minimum, if #[1] is the
-               string 'max', then it is computed w.r.t. maximum 
+               string 'max', then it is computed w.r.t. maximum
 @*           - if the last optional argument is 'onlytexfile' then only the latex file
                is produced; this option should be used if kghostview is not installed on
@@ -1212,5 +1212,5 @@
     if ((npars(basering)!=1) or (nvars(basering)!=2))
     {
-      ERROR("The basering should have precisely one parameter and two indeterminates!");      
+      ERROR("The basering should have precisely one parameter and two indeterminates!");
     }
     texf=texPolynomial(f); // write the polynomial over Q(t)
@@ -1223,9 +1223,9 @@
       texf="\\mbox{\\tt The defining equation was not handed over!}";
       list graph=f;
-    }   
+    }
     else
     { // write the tropical polynomial defined by f
       if (size(#)==0)
-      {      
+      {
         texf="\\min\\{";
       }
@@ -1236,5 +1236,5 @@
       for (j=1;j<=size(f);j++)
       {
-        texf=texf+texPolynomial(f[j]);    
+        texf=texf+texPolynomial(f[j]);
         if (j<size(f))
         {
@@ -1245,5 +1245,5 @@
           texf=texf+"\\}";
         }
-      }    
+      }
       list graph=tropicalCurve(f,#); // the graph of the tropical polynomial f
     }
@@ -1263,17 +1263,17 @@
 \\addtolength{\\topmargin}{-\\headheight}
 \\addtolength{\\topmargin}{-\\topskip}
-\\setlength{\\textheight}{267mm} 
+\\setlength{\\textheight}{267mm}
 \\addtolength{\\textheight}{\\topskip}
 \\addtolength{\\textheight}{-\\footskip}
 \\addtolength{\\textheight}{-30pt}
-\\setlength{\\oddsidemargin}{-1in} 
+\\setlength{\\oddsidemargin}{-1in}
 \\addtolength{\\oddsidemargin}{20mm}
 \\setlength{\\evensidemargin}{\\oddsidemargin}
-\\setlength{\\textwidth}{170mm} 
+\\setlength{\\textwidth}{170mm}
 
 \\begin{document}
    \\parindent0cm
    \\begin{center}
-      \\large\\bf The Tropicalisation of 
+      \\large\\bf The Tropicalisation of
 
       \\bigskip
@@ -1299,5 +1299,5 @@
 
    \\begin{center}
-       "+texDrawNewtonSubdivision(graph,#)+" 
+       "+texDrawNewtonSubdivision(graph,#)+"
    \\end{center}
 \\end{document}";
@@ -1306,5 +1306,5 @@
     int rdnum=random(1000,9999);
     write(":w /tmp/tropicalcurve"+string(rdnum)+".tex",TEXBILD);
-    system("sh","cd /tmp; latex /tmp/tropicalcurve"+string(rdnum)+".tex; dvips /tmp/tropicalcurve"+string(rdnum)+".dvi -o; /bin/rm tropicalcurve"+string(rdnum)+".log;  /bin/rm tropicalcurve"+string(rdnum)+".aux;  /bin/rm tropicalcurve"+string(rdnum)+".ps?;  /bin/rm tropicalcurve"+string(rdnum)+".dvi; kghostview tropicalcurve"+string(rdnum)+".ps &");  
+    system("sh","cd /tmp; latex /tmp/tropicalcurve"+string(rdnum)+".tex; dvips /tmp/tropicalcurve"+string(rdnum)+".dvi -o; /bin/rm tropicalcurve"+string(rdnum)+".log;  /bin/rm tropicalcurve"+string(rdnum)+".aux;  /bin/rm tropicalcurve"+string(rdnum)+".ps?;  /bin/rm tropicalcurve"+string(rdnum)+".dvi; kghostview tropicalcurve"+string(rdnum)+".ps &");
   }
   else
@@ -1331,16 +1331,16 @@
 proc drawNewtonSubdivision (def f,list #)
 "USAGE:   drawTropicalCurve(f[,#]); f poly, # optional list
-ASSUME:   f is list of linear polynomials of the form ax+by+c with integers a, b and a rational number c 
+ASSUME:   f is list of linear polynomials of the form ax+by+c with integers a, b and a rational number c
           representing a tropical Laurent polynomial defining a tropical plane curve;
           alternatively f can be a polynomial in Q(t)[x,y] defining a tropical plane curve
-          via the valuation map; 
+          via the valuation map;
           the basering must have a global monomial ordering, two variables and up to one parameter!
 RETURN:   NONE
-NOTE:     - the procedure produces the files /tmp/newtonsubdivisionNUMBER.tex, 
-            and /tmp/newtonsubdivisionNUMBER.ps, where NUMBER is a random four digit integer; 
+NOTE:     - the procedure produces the files /tmp/newtonsubdivisionNUMBER.tex,
+            and /tmp/newtonsubdivisionNUMBER.ps, where NUMBER is a random four digit integer;
             moreover it desplays the tropical curve defined by f via kghostview;
             if you wish to remove all these files from /tmp, call the procedure cleanTmp
 @*          if # is empty, then the tropical curve is computed w.r.t. minimum, if #[1] is the
-            string 'max', then it is computed w.r.t. maximum 
+            string 'max', then it is computed w.r.t. maximum
 @*        - note that lattice points in the Newton subdivision which are black correspond to markings
             of the marked subdivision, while lattice points in grey are not marked
@@ -1357,5 +1357,5 @@
   { // write the tropical polynomial defined by f
     if (size(#)==0)
-    {      
+    {
       texf="\\min\\{";
     }
@@ -1366,5 +1366,5 @@
     for (j=1;j<=size(f);j++)
     {
-      texf=texf+texPolynomial(f[j]);    
+      texf=texf+texPolynomial(f[j]);
       if (j<size(f))
       {
@@ -1375,5 +1375,5 @@
         texf=texf+"\\}";
       }
-    }    
+    }
     list graph=tropicalCurve(f,#); // the graph of the tropical polynomial f
   }
@@ -1383,5 +1383,5 @@
    \\parindent0cm
    \\begin{center}
-      \\large\\bf The Newtonsubdivison of 
+      \\large\\bf The Newtonsubdivison of
       \\begin{displaymath}
           f="+texf+"
@@ -1391,5 +1391,5 @@
 
    \\begin{center}
-"+texDrawNewtonSubdivision(graph)+  
+"+texDrawNewtonSubdivision(graph)+
 "   \\end{center}
 
@@ -1397,5 +1397,5 @@
   int rdnum=random(1000,9999);
   write(":w /tmp/newtonsubdivision"+string(rdnum)+".tex",TEXBILD);
-  system("sh","cd /tmp; latex /tmp/newtonsubdivision"+string(rdnum)+".tex; dvips /tmp/newtonsubdivision"+string(rdnum)+".dvi -o; /bin/rm newtonsubdivision"+string(rdnum)+".log;  /bin/rm newtonsubdivision"+string(rdnum)+".aux;  /bin/rm newtonsubdivision"+string(rdnum)+".ps?;  /bin/rm newtonsubdivision"+string(rdnum)+".dvi; kghostview newtonsubdivision"+string(rdnum)+".ps &");  
+  system("sh","cd /tmp; latex /tmp/newtonsubdivision"+string(rdnum)+".tex; dvips /tmp/newtonsubdivision"+string(rdnum)+".dvi -o; /bin/rm newtonsubdivision"+string(rdnum)+".log;  /bin/rm newtonsubdivision"+string(rdnum)+".aux;  /bin/rm newtonsubdivision"+string(rdnum)+".ps?;  /bin/rm newtonsubdivision"+string(rdnum)+".dvi; kghostview newtonsubdivision"+string(rdnum)+".ps &");
 //  return(TEXBILD);
 }
@@ -1422,23 +1422,23 @@
 proc tropicalJInvariant (def f,list #)
 "USAGE:      tropicalJInvariant(f[,#]); f poly or list, # optional list
-ASSUME:      f is list of linear polynomials of the form ax+by+c with integers a, b and a rational number c 
+ASSUME:      f is list of linear polynomials of the form ax+by+c with integers a, b and a rational number c
              representing a tropical Laurent polynomial defining a tropical plane curve;
              alternatively f can be a polynomial in Q(t)[x,y] defining a tropical plane curve
-             via the valuation map; 
+             via the valuation map;
 @*           the basering must have a global monomial ordering, two variables and up to one parameter!
 RETURN:      number, if the graph underlying the tropical curve has precisely one loop then its weighted
                      lattice length is returned, otherwise the result will be -1
-NOTE:        - if the tropical curve is elliptic and its embedded graph has precisely one loop, 
+NOTE:        - if the tropical curve is elliptic and its embedded graph has precisely one loop,
                then the weigthed lattice length of the loop is its tropical j-invariant
-@*           - the procedure checks if the embedded graph of the tropical curve has genus one, 
-               but it does NOT check if the loop can be resolved, so that the curve is not 
-               a proper tropical elliptic curve 
+@*           - the procedure checks if the embedded graph of the tropical curve has genus one,
+               but it does NOT check if the loop can be resolved, so that the curve is not
+               a proper tropical elliptic curve
 @*           - if the embedded graph of a tropical elliptic curve has more than one loop, then
                all but one can be resolved, but this is not observed by this procedure, so it
                will not compute the j-invariant
 @*           - if # is empty, then the tropical curve is computed w.r.t. minimum, if #[1] is the
-               string 'max', then it is computed w.r.t. maximum 
+               string 'max', then it is computed w.r.t. maximum
 @*           - the tropicalJInvariant of a plane tropical cubic is the 'cycle length' of the
-               cubic as introduced in the paper: 
+               cubic as introduced in the paper:
                Erik Katz, Hannah Markwig, Thomas Markwig: The j-invariant of a cubic tropical plane curve.
 EXAMPLE:     example tropicalJInvariant;   shows an example"
@@ -1454,5 +1454,5 @@
     {
       if (typeof(f[1])=="list")
-      {        
+      {
         list graph=f;
       }
@@ -1466,5 +1466,5 @@
         {
           ERROR("This is no valid input.");
-        }        
+        }
       }
     }
@@ -1494,6 +1494,6 @@
   else
   {
-    intmat nullmat[2][1];  // used to set 
-    // 4) find a vertex which has only one bounded edge, if none exists zero is returned, 
+    intmat nullmat[2][1];  // used to set
+    // 4) find a vertex which has only one bounded edge, if none exists zero is returned,
     //    otherwise the number of the vertex in the list graph
     int nonloopvertex=findNonLoopVertex(graph);
@@ -1528,6 +1528,6 @@
     intvec loop,weights; // encodes the loop and the edges
     i=1;
-    //    start by finding some vertex which belongs to the loop 
-    while (loop==0) 
+    //    start by finding some vertex which belongs to the loop
+    while (loop==0)
     {
       if (ncols(graph[i][3])==1) // the graph[i][3] of a vertex in the loop has 2 columns, all others have 1
@@ -1537,6 +1537,6 @@
       else
       {
-        loop[1]=i; // a starting vertex is found 
-        loop[2]=graph[i][3][1,1]; // it is connected to the vertex with this number 
+        loop[1]=i; // a starting vertex is found
+        loop[2]=graph[i][3][1,1]; // it is connected to the vertex with this number
         weights[2]=graph[i][3][2,1]; // and the edge has this weight
       }
@@ -1549,5 +1549,5 @@
       // to which the active vertex j is connected; one is loop[k-1], i.e. the one which
       // precedes j in the loop; we have to choose the other one
-      if (graph[j][3][1,1]==loop[k-1]) 
+      if (graph[j][3][1,1]==loop[k-1])
       {
         loop[k+1]=graph[j][3][1,2];
@@ -1560,22 +1560,22 @@
       }
       j=loop[k+1]; // set loop[k+1] the new active vertex
-      k++; 
-    }    
+      k++;
+    }
     // 7) compute for each edge in the loop the lattice length
     poly xcomp,ycomp; // the x- and y-components of the vectors connecting two vertices of the loop
     number nenner;    // the product of the denominators of the x- and y-components
     number jinvariant;  // the j-invariant
-    int eins,zwei,ggt;  
+    int eins,zwei,ggt;
     for (i=1;i<=size(loop)-1;i++) // compute the lattice length for each edge
     {
-      xcomp=graph[loop[i]][1]-graph[loop[i+1]][1]; 
-      ycomp=graph[loop[i]][2]-graph[loop[i+1]][2]; 
+      xcomp=graph[loop[i]][1]-graph[loop[i+1]][1];
+      ycomp=graph[loop[i]][2]-graph[loop[i+1]][2];
       nenner=denominator(leadcoef(xcomp))*denominator(leadcoef(ycomp));
-      execute("eins="+string(numerator(leadcoef(nenner*xcomp)))+";"); 
-      execute("zwei="+string(numerator(leadcoef(nenner*ycomp)))+";"); 
+      execute("eins="+string(numerator(leadcoef(nenner*xcomp)))+";");
+      execute("zwei="+string(numerator(leadcoef(nenner*ycomp)))+";");
       ggt=gcd(eins,zwei); // the lattice length is the "gcd" of the x-component and the y-component
       jinvariant=jinvariant+ggt/(nenner*weights[i+1]); // divided by the weight of the edge
     }
-    return(jinvariant);   
+    return(jinvariant);
   }
 }
@@ -1591,10 +1591,10 @@
 // the curve can have arbitrary degree
    tropicalJInvariant(t*(x7+y7+1)+1/t*(x4+y4+x2+y2+x3y+xy3)+1/t7*x2y2);
-// the procedure does not realise, if the embedded graph of the tropical 
+// the procedure does not realise, if the embedded graph of the tropical
 //     curve has a loop that can be resolved
    tropicalJInvariant(1+x+y+xy+tx2y+txy2);
 // but it does realise, if the curve has no loop at all ...
    tropicalJInvariant(x+y+1);
-// or if the embedded graph has more than one loop - even if only one 
+// or if the embedded graph has more than one loop - even if only one
 //     cannot be resolved
    tropicalJInvariant(1+x+y+xy+tx2y+txy2+t3x5+t3y5+tx2y2+t2xy4+t2yx4);
@@ -1603,9 +1603,9 @@
 proc weierstrassForm (poly f,list #)
 "USAGE:      weierstrassFormOfACubic(wf[,#]); wf poly, # list
-ASSUME:      wf is a a polynomial whose Newton polygon has precisely one interior lattice
+ASSUME:      wf is a polynomial whose Newton polygon has precisely one interior lattice
              point, so that it defines an elliptic curve on the toric surface corresponding
              to the Newton polygon
 RETURN:      poly, the Weierstrass normal form of the polygon
-NOTE:        - the algorithm for the coefficients of the Weierstrass form is due to 
+NOTE:        - the algorithm for the coefficients of the Weierstrass form is due to
                Fernando Rodriguez Villegas, villegas@math.utexas.edu
 @*           - the characteristic of the base field should not be 2 or 3
@@ -1669,9 +1669,9 @@
 
 proc jInvariant (poly f,list #)
-"USAGE:      jInvariant(f[,#]); f poly, # list 
-ASSUME:      - f is a a polynomial whose Newton polygon has precisely one interior lattice
+"USAGE:      jInvariant(f[,#]); f poly, # list
+ASSUME:      - f is a polynomial whose Newton polygon has precisely one interior lattice
                point, so that it defines an elliptic curve on the toric surface corresponding
                to the Newton polygon
-@*           - it the optional argument # is present the base field should be Q(t) and 
+@*           - it the optional argument # is present the base field should be Q(t) and
                the optional argument should be one of the following strings:
 @*             'ord'   : then the return value is of type integer, namely the order of the j-invariant
@@ -1704,7 +1704,7 @@
    echo=2;
    ring r=(0,t),(x,y),dp;
-// jInvariant computes the j-invariant of a cubic 
+// jInvariant computes the j-invariant of a cubic
    jInvariant(x+y+x2y+y3+1/t*xy);
-// if the ground field has one parameter t, then we can instead 
+// if the ground field has one parameter t, then we can instead
 //    compute the order of the j-invariant
    jInvariant(x+y+x2y+y3+1/t*xy,"ord");
@@ -1714,5 +1714,5 @@
    poly h=x22y11+x19y10+x17y9+x16y9+x12y7+x9y6+x7y5+x2y3+x14y8;
 // its j-invariant is
-   jInvariant(h);  
+   jInvariant(h);
 }
 
@@ -1777,5 +1777,5 @@
   ring tRING=0,t,ls;
   list pointdenom=imap(BASERING,pointdenom);
-  list pointnum=imap(BASERING,pointnum);  
+  list pointnum=imap(BASERING,pointnum);
   intvec pointcoordinates;
   for (i=1;i<=size(pointdenom);i++)
@@ -1853,5 +1853,5 @@
    We consider the concic through the following five points:
    \\begin{displaymath}
-";  
+";
   string texf=texDrawTropical(graphf,list("",scalefactor));
   for (i=1;i<=size(points);i++)
@@ -1891,10 +1891,10 @@
 \\end{document}";
   setring BASERING;
-  // If # non-empty, compute the dual conic and the tangents through the dual points 
+  // If # non-empty, compute the dual conic and the tangents through the dual points
   // corresponding to the tangents of the given conic.
   if (size(#)>0)
   {
     list dualpoints;
-    for (i=1;i<=size(points);i++) 
+    for (i=1;i<=size(points);i++)
     {
       dualpoints[i]=list(leadcoef(tangents[i])/substitute(tangents[i],x,0,y,0),leadcoef(tangents[i]-lead(tangents[i]))/substitute(tangents[i],x,0,y,0));
@@ -1920,28 +1920,28 @@
 // conic[2] is the equation of the conic f passing through the five points
    conic[2];
-// conic[3] is a list containing the equations of the tangents 
+// conic[3] is a list containing the equations of the tangents
 //          through the five points
    conic[3];
 // conic[4] is an ideal representing the tropicalisation of the conic f
    conic[4];
-// conic[5] is a list containing the tropicalisation 
+// conic[5] is a list containing the tropicalisation
 //          of the five tangents in conic[3]
    conic[5];
-// conic[6] is a list containing the vertices of the tropical conic 
+// conic[6] is a list containing the vertices of the tropical conic
    conic[6];
 // conic[7] is a list containing the vertices of the five tangents
    conic[7];
-// conic[8] contains the latex code to draw the tropical conic and 
-//          its tropicalised tangents; it can written in a file, processed and 
-//          displayed via kghostview 
-   write(":w /tmp/conic.tex",conic[8]);   
-   system("sh","cd /tmp; latex /tmp/conic.tex; dvips /tmp/conic.dvi -o; 
+// conic[8] contains the latex code to draw the tropical conic and
+//          its tropicalised tangents; it can written in a file, processed and
+//          displayed via kghostview
+   write(":w /tmp/conic.tex",conic[8]);
+   system("sh","cd /tmp; latex /tmp/conic.tex; dvips /tmp/conic.dvi -o;
             kghostview conic.ps &");
-// with an optional argument the same information for the dual conic is computed 
+// with an optional argument the same information for the dual conic is computed
 //         and saved in conic[9]
    conic=conicWithTangents(points,1);
    conic[9][2]; // the equation of the dual conic
 }
- 
+
 ////////////////////////////////////////////////////////////////////////////////////
 /// Procedures concerned with tropicalisation
@@ -1952,7 +1952,7 @@
 ASSUME:      f is a polynomial in Q(t)[x_1,...,x_n]
 RETURN:      list, the linear forms of the tropicalisation of f
-NOTE:        if # is empty, then the valuation of t will be 1, 
-@*           if # is the string 'max' it will be -1; 
-@*           the latter supposes that we consider the maximum of the the computed 
+NOTE:        if # is empty, then the valuation of t will be 1,
+@*           if # is the string 'max' it will be -1;
+@*           the latter supposes that we consider the maximum of the computed
              linear forms, the former that we consider their minimum
 EXAMPLE:     example tropicalise;   shows an example"
@@ -1977,5 +1977,5 @@
     {
       tropicalf[i]=tropicalf[i]+exp[j]*var(j);
-    }    
+    }
     f=f-lead(f);
   }
@@ -2013,5 +2013,5 @@
 }
 
-proc tInitialForm (poly f, intvec w) 
+proc tInitialForm (poly f, intvec w)
 "USAGE:      tInitialForm(f,w); f a polynomial, w an integer vector
 ASSUME:      f is a polynomial in Q[t,x_1,...,x_n] and w=(w_0,w_1,...,w_n)
@@ -2026,6 +2026,6 @@
   // do the same for the remaining part of f and compare the results
   // keep only the smallest ones
-  int vglgewicht;  
-  f=f-lead(f); 
+  int vglgewicht;
+  f=f-lead(f);
   while (f!=0)
   {
@@ -2042,5 +2042,5 @@
         initialf=initialf+lead(f);
       }
-    }    
+    }
     f=f-lead(f);
   }
@@ -2058,7 +2058,7 @@
 }
 
-proc tInitialIdeal (ideal i,intvec w,list #) 
+proc tInitialIdeal (ideal i,intvec w,list #)
 "USAGE:      tInitialIdeal(i,w); i ideal, w intvec
-ASSUME:      i is an ideal in Q[t,x_1,...,x_n] and w=(w_0,...,w_n) 
+ASSUME:      i is an ideal in Q[t,x_1,...,x_n] and w=(w_0,...,w_n)
 RETURN:      ideal ini, the t-initial ideal of i with respect to w"
 {
@@ -2087,7 +2087,7 @@
   // ... and compute a standard basis with
   // respect to the homogenised ordering defined by w. Since the generators
-  // of i will be homogeneous it we can instead take the ordering wp 
-  // with the weightvector (0,w) replaced by (M,...,M)+(0,w) for some 
-  // large M, so that all entries are positive 
+  // of i will be homogeneous it we can instead take the ordering wp
+  // with the weightvector (0,w) replaced by (M,...,M)+(0,w) for some
+  // large M, so that all entries are positive
   int M=-minInIntvec(w)[1]+1; // find M such that w[j]+M is strictly positive for all j
   intvec whomog=M+1;
@@ -2097,6 +2097,6 @@
   }
   execute("ring WEIGHTRING=("+charstr(basering)+"),("+varstr(basering)+"),(wp("+string(whomog)+"));");
-  // map i to the new ring and compute a GB of i, then dehomogenise i, 
-  // so that we can be sure, that the 
+  // map i to the new ring and compute a GB of i, then dehomogenise i,
+  // so that we can be sure, that the
   // initial forms of the generators generate the initial ideal
   ideal i=subst(groebner(imap(HOMOGRING,i)),@s,1);
@@ -2343,5 +2343,5 @@
 proc texDrawBasic (list texdraw)
 "USAGE:      texDrawBasic(texdraw); list texdraw
-ASSUME:      texdraw is a list of strings representing texdraw commands (as produced by 
+ASSUME:      texdraw is a list of strings representing texdraw commands (as produced by
              texDrawTropical) which should be embedded into a texdraw environment
 RETURN:      string, a texdraw environment enclosing the input
@@ -2363,5 +2363,5 @@
     \\end{texdraw}";
   return(texdrawtp);
-}  
+}
 example
 {
@@ -2378,9 +2378,9 @@
 ASSUME:  graph is the output of tropicalCurve
 RETURN:  string, the texdraw code of the tropical plane curve encoded by graph
-NOTE:    - if the list # is non-empty, the first entry should be a string; if this string is 'max', 
+NOTE:    - if the list # is non-empty, the first entry should be a string; if this string is 'max',
            then the tropical curve is considered with respect to the maximum; otherwise the curve
-           is considered with respect to the minimum and the string can be used to 
+           is considered with respect to the minimum and the string can be used to
            insert further texdraw commands (e.g. to have a lighter image as when called
-           from inside conicWithTangents); 
+           from inside conicWithTangents);
 @*       - the procedure computes a scalefactor for the texdraw command which should
            help to display the curve in the right way; this may, however, be a bad idea
@@ -2392,5 +2392,5 @@
   int i,j;
   // deal first with the pathological case that the input polynomial was a monomial
-  // and does therefore not define a tropical curve, and check if the Newton polytope is 
+  // and does therefore not define a tropical curve, and check if the Newton polytope is
   // a line segment so that the curve defines a bunch of lines
   int bunchoflines;
@@ -2414,5 +2414,5 @@
   // go on with the case that a tropical curve is defined
   if (size(#)==0)
-  {    
+  {
      string texdrawtp="
 
@@ -2422,5 +2422,5 @@
   {
     if ((#[1]!="max") and (#[1]!=""))
-    {      
+    {
       string texdrawtp=#[1];
     }
@@ -2545,5 +2545,5 @@
 NOTE:        - the list # should contain as only entry a string; if this string is 'max', then
                the tropical curve is considered with respect to the maximum; otherwise the curve
-               is considered with respect to the minimum and the string can be used to 
+               is considered with respect to the minimum and the string can be used to
                insert further texdraw commands (e.g. to have a lighter image as when called
                from inside conicWithTangents); the list # is optional and may as well be empty
@@ -2554,5 +2554,5 @@
   int i,j,k,l;
   list boundary=graph[size(graph)][1];
-  list inneredges=graph[size(graph)][2];  
+  list inneredges=graph[size(graph)][2];
   intvec shiftvector=graph[size(graph)][3];
   string subdivision;
@@ -2566,5 +2566,5 @@
   poly scalefactor=minOfPolys(list(12/leadcoef(maxx),12/leadcoef(maxy)));
   if (scalefactor<1)
-  {    
+  {
     subdivision=subdivision+"
        \\relunitscale"+ decimal(scalefactor);
@@ -2574,9 +2574,9 @@
   {
     subdivision=subdivision+"
-        \\move ("+string(boundary[i][1])+" "+string(boundary[i][2])+")        
+        \\move ("+string(boundary[i][1])+" "+string(boundary[i][2])+")
         \\lvec ("+string(boundary[i+1][1])+" "+string(boundary[i+1][2])+")";
-  } 
+  }
   subdivision=subdivision+"
-        \\move ("+string(boundary[size(boundary)][1])+" "+string(boundary[size(boundary)][2])+")        
+        \\move ("+string(boundary[size(boundary)][1])+" "+string(boundary[size(boundary)][2])+")
         \\lvec ("+string(boundary[1][1])+" "+string(boundary[1][2])+")
 
@@ -2585,5 +2585,5 @@
   {
     subdivision=subdivision+"
-        \\move ("+string(inneredges[i][1][1])+" "+string(inneredges[i][1][2])+")        
+        \\move ("+string(inneredges[i][1][1])+" "+string(inneredges[i][1][2])+")
         \\lvec ("+string(inneredges[i][2][1])+" "+string(inneredges[i][2][2])+")";
   }
@@ -2605,5 +2605,5 @@
     }
   }
-  // deal with the pathological cases 
+  // deal with the pathological cases
   if (size(boundary)==1) // then the Newton polytope is a point
   {
@@ -2660,11 +2660,11 @@
   {
     subdivision=subdivision+"
-       \\move ("+string(markings[i][1])+" "+string(markings[i][2])+") 
+       \\move ("+string(markings[i][1])+" "+string(markings[i][2])+")
        \\fcir f:0 r:"+decimal(2/(8*scalefactor),size(string(int(scalefactor)))+1);
   }
   // enclose subdivision in the texdraw environment
-  string texsubdivision="     
+  string texsubdivision="
     \\begin{texdraw}
-       \\drawdim cm  \\relunitscale 1 
+       \\drawdim cm  \\relunitscale 1
        \\linewd 0.05"
     +subdivision+"
@@ -2680,5 +2680,5 @@
    poly f=x+y+x2y+xy2+1/t*xy;
    list graph=tropicalCurve(f);
-// compute the texdraw code of the Newton subdivision of the tropical curve 
+// compute the texdraw code of the Newton subdivision of the tropical curve
    texDrawNewtonSubdivision(graph);
 }
@@ -2707,5 +2707,5 @@
     markings[3*i-2]=triang[i][1];
     markings[3*i-1]=triang[i][2];
-    markings[3*i]=triang[i][3];    
+    markings[3*i]=triang[i][3];
   }
   // delete redundant pairs which occur more than once
@@ -2740,5 +2740,5 @@
   {
     latex=latex+"
-        \\move ("+string(polygon[markings[i]][1])+" "+string(polygon[markings[i]][2])+")        
+        \\move ("+string(polygon[markings[i]][1])+" "+string(polygon[markings[i]][2])+")
         \\fcir f:0 r:0.08";
   }
@@ -2747,5 +2747,5 @@
   {
     latex=latex+"
-        \\move ("+string(polygon[pairs[i][1]][1])+" "+string(polygon[pairs[i][1]][2])+")        
+        \\move ("+string(polygon[pairs[i][1]][1])+" "+string(polygon[pairs[i][1]][2])+")
         \\lvec ("+string(polygon[pairs[i][2]][1])+" "+string(polygon[pairs[i][2]][2])+")";
   }
@@ -2754,5 +2754,5 @@
   {
     latex=latex+"
-        \\move ("+string(polygon[i][1])+" "+string(polygon[i][2])+")        
+        \\move ("+string(polygon[i][1])+" "+string(polygon[i][2])+")
         \\fcir f:0.7 r:0.04";
   }
@@ -2763,9 +2763,9 @@
    "EXAMPLE:";
    echo=2;
-   // the lattice polygon spanned by the points (0,0), (3,0) and (0,3) 
+   // the lattice polygon spanned by the points (0,0), (3,0) and (0,3)
    // with all integer points as markings
    list polygon=intvec(1,1),intvec(3,0),intvec(2,0),intvec(1,0),intvec(0,0),
                 intvec(2,1),intvec(0,1),intvec(1,2),intvec(0,2),intvec(0,3);
-   // define a triangulation by connecting the only interior point 
+   // define a triangulation by connecting the only interior point
    //        with the vertices
    list triang=intvec(1,2,5),intvec(1,5,10),intvec(1,2,10);
@@ -2775,5 +2775,5 @@
 
 ////////////////////////////////////////////////////////////////////////////////////
-/// Auxilary Procedures 
+/// Auxilary Procedures
 ////////////////////////////////////////////////////////////////////////////////////
 
@@ -2829,9 +2829,9 @@
   // do the same for the remaining part of f and compare the results
   // keep only the smallest ones
-  int vglgewicht;  
-  f=f-lead(f);  
+  int vglgewicht;
+  f=f-lead(f);
   while (f!=0)
   {
-    leitkoef=simplifyToOrder(f);    
+    leitkoef=simplifyToOrder(f);
     vglgewicht=leitkoef[1]+scalarproduct(w,leadexp(f));
     if (vglgewicht<gewicht)
@@ -2848,5 +2848,5 @@
         initialf=initialf+koef*leadmonom(f);
       }
-    }    
+    }
     f=f-lead(f);
   }
@@ -2872,5 +2872,5 @@
   // compute first the t-order of the leading coefficient of f (leitkoef[1]) and
   // the rational constant corresponding to this order in leadkoef(f) (leitkoef[2])
-  list leitkoef=simplifyToOrder(f);  
+  list leitkoef=simplifyToOrder(f);
   execute("poly koef="+leitkoef[2]+";");
   // take in lead(f) only the term of lowest t-order and set t=1
@@ -2881,5 +2881,5 @@
   // keep only the largest ones
   int vglgewicht;
-  f=f-lead(f);  
+  f=f-lead(f);
   while (f!=0)
   {
@@ -2899,5 +2899,5 @@
         initialf=initialf+koef*leadmonom(f);
       }
-    }    
+    }
     f=f-lead(f);
   }
@@ -2916,5 +2916,5 @@
 proc solveTInitialFormPar (ideal i)
 "USAGE:      solveTInitialFormPar(i); i ideal
-ASSUME:      i is a zero-dimensional ideal in Q(t)[x_1,...,x_n] generated by the (1,w)-homogeneous 
+ASSUME:      i is a zero-dimensional ideal in Q(t)[x_1,...,x_n] generated by the (1,w)-homogeneous
              elements for some integer vector w - i.e. by the (1,w)-initialforms of polynomials
 RETURN:      none
@@ -2941,5 +2941,5 @@
 }
 
-proc detropicalise (poly p) 
+proc detropicalise (poly p)
 "USAGE:      detropicalise(f); f poly
 ASSUME:      f is a linear polynomial with an arbitrary constant term and
@@ -2953,5 +2953,5 @@
   {
     if (leadmonom(p)!=1)
-    { 
+    {
       dtp=dtp*leadmonom(p)^int(leadcoef(p));
     }
@@ -3057,5 +3057,5 @@
    poly f=t2x+1/t*y-1;
    tropicalSubst(f,2,x,x+t,y,tx+y+t2);
-   // The procedure can be used to study the effect of a transformation of 
+   // The procedure can be used to study the effect of a transformation of
    // the form x -> x+t^b, with b a rational number, on the tropicalisation and
    // the j-invariant of a cubic over the Puiseux series.
@@ -3063,6 +3063,6 @@
    // - the j-invariant, and hence its valuation, does not change under the transformation
    jInvariant(f,"ord");
-   // - b=3/2, then the cycle length of the tropical cubic equals -val(j-inv)   
-   list g32=tropicalSubst(f,2,x,x+t3,y,y);  
+   // - b=3/2, then the cycle length of the tropical cubic equals -val(j-inv)
+   list g32=tropicalSubst(f,2,x,x+t3,y,y);
    tropicalJInvariant(g32);
    // - b=1, then it is still true, but only just ...
@@ -3075,9 +3075,9 @@
 
 proc randomPoly (int d,int ug, int og, list #)
-"USAGE:      randomPoly(d,ug,og[,#]);   d, ug, og int, # list 
+"USAGE:      randomPoly(d,ug,og[,#]);   d, ug, og int, # list
 ASSUME:      the basering has a parameter t
 RETURN:      poly, a polynomial of degree d where the coefficients are of the form t^j with
                    j a random integer between ug and og
-NOTE:        if an optional argument # is given, then the coefficients are instead either of the 
+NOTE:        if an optional argument # is given, then the coefficients are instead either of the
              form t^j as above or they are zero, and this is chosen randomly
 EXAMPLE:     example randomPoly;   shows an example"
@@ -3095,9 +3095,9 @@
   {
     if (size(#)!=0)
-    {      
+    {
       k=random(0,1);
     }
     if (k==0)
-    {      
+    {
       j=random(ug,og);
       randomPolynomial=randomPolynomial+t^j*m[i];
@@ -3127,5 +3127,5 @@
 RETURN:  none"
 {
-  system("sh","cd /tmp; /bin/rm -f tropicalcurve*; /bin/rm -f tropicalnewtonsubdivision*");  
+  system("sh","cd /tmp; /bin/rm -f tropicalcurve*; /bin/rm -f tropicalnewtonsubdivision*");
 }
 
@@ -3182,7 +3182,7 @@
 static proc cutdown (ideal jideal,intvec wvec,int dimension,list #)
 "USAGE:      cutdown(i,w,d); i ideal, w intvec, d int, # list
-ASSUME:      i an ideal in Q[t,x_1,...,x_n], (w_1,...,w_n) is in the tropical variety of jideal 
+ASSUME:      i an ideal in Q[t,x_1,...,x_n], (w_1,...,w_n) is in the tropical variety of jideal
              and d=dim(i)>0, in Q(t)[x]; the optional parameter # can contain the string 'isPrime'
-             to indicate that the input ideal is prime and no minimal associated primes have 
+             to indicate that the input ideal is prime and no minimal associated primes have
              to be computed
 RETURN:      list, the first entry is a ring, namely the basering where some variables have been
@@ -3195,9 +3195,9 @@
                    wvec with the components corresponding to the eliminated variables removed
 NOTE:        needs the libraries random.lib and primdec.lib; is called from tropicalLifting"
-{ 
-  // IDEA: i is an ideal of dimension d; we want to cut it with d random linear 
+{
+  // IDEA: i is an ideal of dimension d; we want to cut it with d random linear
   //       forms in such a way that the resulting
   //       ideal is 0-dim and still contains w in the tropical variety
-  // NOTE: t is the last variable in the basering  
+  // NOTE: t is the last variable in the basering
   ideal pideal;  //this is the ideal we want to return
   ideal cutideal;
@@ -3219,5 +3219,5 @@
     variablen=variablen+var(j1); //read the set of variables (needed to make the quotring later)
     product=product*var(j1); //make product of all variables (needed for the initial-monomial-check later
-  }    
+  }
   execute("ring QUOTRING=("+charstr(basering)+",t),("+string(variablen)+"),dp;");
   setring BASERING;
@@ -3226,12 +3226,12 @@
   {
     setring QUOTRING;
-    ideal jideal=imap(BASERING,jideal); 
-    list primp=minAssGTZ(jideal); //compute the primary decomposition  
+    ideal jideal=imap(BASERING,jideal);
+    list primp=minAssGTZ(jideal); //compute the primary decomposition
     for (j1=1;j1<=size(primp);j1++)
-    {      
+    {
       for(j2=1;j2<=size(primp[j1]);j2++)
       {
         primp[j1][j2]=primp[j1][j2]/content(primp[j1][j2]);// clear all denominators
-      }       
+      }
     }
     setring BASERING;
@@ -3239,5 +3239,5 @@
     // if i is not primary itself
     // go through the list of min. ass. primes and find the first one which has w in its tropical variety
-    if (size(primp)>1) 
+    if (size(primp)>1)
     {
       j1=1;
@@ -3246,8 +3246,8 @@
         //compute the t-initial of the associated prime
         // - the last entry 1 only means that t is the last variable in the ring
-        primini=tInitialIdeal(primp[j1],wvec,1); 
+        primini=tInitialIdeal(primp[j1],wvec,1);
         // check if it contains a monomial (resp if the product of var is in the radical)
-        if (radicalMemberShip(product,primini)==0) 
-        { 
+        if (radicalMemberShip(product,primini)==0)
+        {
           jideal=primp[j1];// if w is in the tropical variety of the prime, we take that
           setring QUOTRING;
@@ -3255,5 +3255,5 @@
           setring BASERING;
           winprim=1; // and stop the checking
-        } 
+        }
         j1=j1+1;  //else we look at the next associated prime
       }
@@ -3262,9 +3262,9 @@
     {
       jideal=primp[1]; //if i is primary itself we take its prime instead
-    }  
+    }
   }
   // now we start as a first try to intersect with a hyperplane parallel to
   // coordinate axes, because this would make our further computations
-  // a lot easier. 
+  // a lot easier.
   // We choose a subset of our n variables of size d=dim(ideal). For each of these
   // variables, we want to fix a value: x_i= a_i*t^-w_i. This will only work if the
@@ -3275,5 +3275,5 @@
   // (NOTE, there EXIST d variables such that a random choice of a_i's would work!).
   // But since this involves many computations, we prefer to choose randomly and just
-  // try in the end if our intersected ideal satisfies our requirements. If this does not 
+  // try in the end if our intersected ideal satisfies our requirements. If this does not
   // work, we give up this try and use our second intersection idea, which
   // will work for a Zariksi-open subset (i.e. almost always).
@@ -3282,5 +3282,5 @@
   // wvec-coordinate is smallest, because this will give us the smallest powers of t and hence
   // less effort in following computations. Note that the smallest absolute value have those
-  // which are biggest, because wvec is negative. 
+  // which are biggest, because wvec is negative.
   //print("first try");
   intvec wminust=intvecdelete(wvec,1);
@@ -3290,6 +3290,6 @@
   A[2,1..size(wminust)]=1..size(wminust);
   // sort this matrix in order to get the d biggest entries and their position in wvec
-  A=sortintmat(A); 
-  // we construct a vector which has 1 at entry j if j belongs to the list 
+  A=sortintmat(A);
+  // we construct a vector which has 1 at entry j if j belongs to the list
   // of the d biggest entries of wvec and a 0 else
   for (j1=1;j1<=nvars(basering)-1;j1++) //go through the variables
@@ -3300,8 +3300,8 @@
       {
         setvec[j1]=1;//put a 1
-      }        
-    }  
-  }
-  // using this 0/1-vector we produce a random constant (i.e. coeff in Q times something in t) 
+      }
+    }
+  }
+  // using this 0/1-vector we produce a random constant (i.e. coeff in Q times something in t)
   // for each of the biggest variables, we add the forms x_i-random constant to the ideal
   // and we save the constant at the i-th place of a list we want to return for later computations
@@ -3315,15 +3315,15 @@
     {
       if(setvec[j1]==1)//if x_i belongs to the biggest variables
-      {     
+      {
         if ((j3==1) and ((char(basering)==0) or (char(basering)>3)))
-        {        
+        {
           randomp1=random(1,3);
           randomp=t^(A[1,j2])*randomp1;//make a random constant --- first we try small numbers
-        }   
+        }
         if ((j3==2) and ((char(basering)==0) or (char(basering)>100)))
         {
           randomp1=random(1,100);
           randomp=t^(A[1,j2])*randomp1;//make a random constant --- next we try bigger numbers
-        }   
+        }
         else
         {
@@ -3337,10 +3337,10 @@
       else
       {
-        ergl[j1]=0; //if the variable belongs not the the d biggest ones, save 0 in the list
+        ergl[j1]=0; //if the variable belongs not the d biggest ones, save 0 in the list
         erglini[j1]=0;
-      }        
+      }
     }
       // print(ergl);print(pideal);
-      // now we check if we made a good choice of pideal, i.e. if dim=0 and 
+      // now we check if we made a good choice of pideal, i.e. if dim=0 and
       // wvec is still in the tropical variety
       //change to quotring where we compute dimension
@@ -3349,7 +3349,7 @@
     {
       if(setvec[j1]==1)
-      {      
-        cutideal=cutideal,var(j1)-ergl[j1];//add all forms to the ideal  
-      }      
+      {
+        cutideal=cutideal,var(j1)-ergl[j1];//add all forms to the ideal
+      }
     }
     setring QUOTRING;
@@ -3369,11 +3369,11 @@
       // and if the initial w.r.t. t contains no monomial as we want (checked with
       // radical-membership of the product of all variables)
-      if (radicalMemberShip(product,pini)==0) 
-      {
-        // we made the right choice and now we substitute the variables in the ideal    
+      if (radicalMemberShip(product,pini)==0)
+      {
+        // we made the right choice and now we substitute the variables in the ideal
         //to get an ideal in less variables
         // also we make a projected vector from wvec only the components of the remaining variables
         wvecp=wvec;
-        variablen=0;   
+        variablen=0;
         j2=0;
         for(j1=1;j1<=nvars(basering)-1;j1++)
@@ -3389,6 +3389,6 @@
           {
             variablen=variablen+var(j1); //read the set of remaining variables (needed to make quotring later)
-          }    
-        }      
+          }
+        }
         // return pideal, the initial and the list ergl which tells us
         // which variables we replaced by which form
@@ -3400,5 +3400,5 @@
         export(ini);
         export(repl);
-        return(list(BASERINGLESS1,wvecp)); 
+        return(list(BASERINGLESS1,wvecp));
       }
     }
@@ -3409,22 +3409,22 @@
   // probability 1.
   //
-  // We choose general hyperplanes, i.e. linear forms which involve all x_i. 
-  // Each x_i has to be multiplied bz t^(w_i) in order to get the same weight (namely 0) 
+  // We choose general hyperplanes, i.e. linear forms which involve all x_i.
+  // Each x_i has to be multiplied bz t^(w_i) in order to get the same weight (namely 0)
   // for each term. As we cannot have negative exponents, we multiply
-  // the whole form by t^minimumw. Notice that then in the first form, 
+  // the whole form by t^minimumw. Notice that then in the first form,
   // there is one term without t- the term of the variable
   // x_i such that w_i is minimal. That is, we can solve for this variable.
-  // In the second form, we can replace that variable, and divide by t as much as possible. 
-  // Then there is again one term wihtout t - the term of the variable with second least w. 
+  // In the second form, we can replace that variable, and divide by t as much as possible.
+  // Then there is again one term wihtout t - the term of the variable with second least w.
   // So we can solve for this one again and also replace it in the first form.
-  // Since all our coefficients are chosen randomly, we can also from the beginning on 
-  // choose the set of variables which belong to the d smallest entries of wvec 
-  // (t not counting) and pick random forms g_i(t,x') (where x' is the set of remaining variables) 
-  // and set x_i=g_i(t,x'). 
+  // Since all our coefficients are chosen randomly, we can also from the beginning on
+  // choose the set of variables which belong to the d smallest entries of wvec
+  // (t not counting) and pick random forms g_i(t,x') (where x' is the set of remaining variables)
+  // and set x_i=g_i(t,x').
   //
   // make a matrix with first row wvec (without t) and second row 1..n
   //print("second try");
   setring BASERING;
-  A[1,1..size(wminust)]=wminust;  
+  A[1,1..size(wminust)]=wminust;
   A[2,1..size(wminust)]=1..size(wminust);
   // sort this matrix in otder to get the d smallest entries (without counting the t-entry)
@@ -3433,5 +3433,5 @@
   setvec=0;
   setvec[nvars(basering)-1]=0;
-  // we construct a vector which has 1 at entry j if j belongs to the list of 
+  // we construct a vector which has 1 at entry j if j belongs to the list of
   // the d smallest entries of wvec and a 0 else
   for (j1=1;j1<=nvars(basering)-1;j1++) //go through the variables
@@ -3459,14 +3459,14 @@
       variablen=variablen+var(j1); //read the set of remaining variables (needed to make the quotring later)
     }
-  } 
+  }
   setring BASERING;
   execute("ring BASERINGLESS2=("+charstr(BASERING)+"),("+string(variablen)+",t),(dp("+string(ncols(variablen))+"),lp(1));");
   // using the 0/1-vector which tells us which variables belong to the set of smallest entries of wvec
-  // we construct a set of d random linear polynomials of the form x_i=g_i(t,x'), 
+  // we construct a set of d random linear polynomials of the form x_i=g_i(t,x'),
   // where the set of all x_i is the set of
   // all variables which are in the list of smallest entries in wvec, and x' are the other variables.
-  // We add these d random linear polynomials to the indeal pideal, i.e. we intersect 
+  // We add these d random linear polynomials to the indeal pideal, i.e. we intersect
   // with these and hope to get something
-  // 0-dim which still contains wvec in its tropical variety. Also, we produce a list ergl  
+  // 0-dim which still contains wvec in its tropical variety. Also, we produce a list ergl
   // with g_i at the i-th position.
   // This is a list we want to return.
@@ -3477,5 +3477,5 @@
   {
     if ((char(basering)==0) or (char(basering)>3))
-    { 
+    {
       randomp1=random(1,3);
       randomp=randomp1*t^(-A[1,j1]);
@@ -3514,5 +3514,5 @@
     }
   //print(ergl);
-  // Again, we have to test if we made a good choice to intersect,i.e. we have to check whether 
+  // Again, we have to test if we made a good choice to intersect,i.e. we have to check whether
   // pideal is 0-dim and contains wvec in the tropical variety.
   cutideal=pideal;
@@ -3521,6 +3521,6 @@
     if(setvec[j1]==1)
     {
-      cutideal=cutideal,var(j1)-ergl[j1];//add all forms to the ideal 
-    }    
+      cutideal=cutideal,var(j1)-ergl[j1];//add all forms to the ideal
+    }
   }
   setring QUOTRING;
@@ -3540,8 +3540,8 @@
     // and if the initial w.r.t. t contains no monomial as we want (checked with
     // radical-membership of the product of all variables)
-    if (radicalMemberShip(product,pini)==0) 
+    if (radicalMemberShip(product,pini)==0)
     {
       // we want to replace the variables x_i by the forms -g_i in
-      // our ideal in order to return an ideal with less variables  
+      // our ideal in order to return an ideal with less variables
       // first we substitute the chosen variables
       for(j1=1;j1<=nvars(basering)-1;j1++)
@@ -3560,5 +3560,5 @@
       export(ini);
       export(repl);
-      return(list(BASERINGLESS2,wvecp)); 
+      return(list(BASERINGLESS2,wvecp));
     }
   }
@@ -3573,10 +3573,10 @@
       randomp=randomp1*t^(-A[1,j1]);
       for(j2=1;j2<=nvars(basering)-1;j2++)//go through all variables
-      { 
+      {
         if(setvec[j2]==0)//if x_j belongs to the set x'
         {
           // add a random term with the suitable power of t to the random linear form
           if ((char(basering)==0) or (char(basering)>100))
-          {  
+          {
             randomp2=random(1,100);
             randomp1=randomp1+randomp2*var(j2);
@@ -3599,5 +3599,5 @@
       }
     //print(ergl);
-    // Again, we have to test if we made a good choice to intersect,i.e. we have to check whether 
+    // Again, we have to test if we made a good choice to intersect,i.e. we have to check whether
     // pideal is 0-dim and contains wvec in the tropical variety.
     cutideal=pideal;
@@ -3606,6 +3606,6 @@
       if(setvec[j1]==1)
       {
-        cutideal=cutideal,var(j1)-ergl[j1];//add all forms to the ideal  
-      }      
+        cutideal=cutideal,var(j1)-ergl[j1];//add all forms to the ideal
+      }
     }
     setring QUOTRING;
@@ -3615,5 +3615,5 @@
     //print(dimp);
     kill cutideal;
-    setring BASERING; 
+    setring BASERING;
     if (dimp==0) // if it is 0 as we want
     {
@@ -3625,5 +3625,5 @@
       // and if the initial w.r.t. t contains no monomial as we want (checked with
       // radical-membership of the product of all variables)
-      if (radicalMemberShip(product,pini)==0) 
+      if (radicalMemberShip(product,pini)==0)
       {
         // we want to replace the variables x_i by the forms -g_i in
@@ -3636,6 +3636,6 @@
             pideal=subst(pideal,var(j1),ergl[j1]);//substitute it
             pini=subst(pini,var(j1),erglini[j1]);
-          }   
-        }   
+          }
+        }
         // return pideal and the list ergl which tells us
         // which variables we replaced by which form
@@ -3647,5 +3647,5 @@
         export(ini);
         export(repl);
-        return(list(BASERINGLESS2,wvecp)); 
+        return(list(BASERINGLESS2,wvecp));
       }
     }
@@ -3656,18 +3656,18 @@
 static proc tropicalparametriseNoabs (ideal i,intvec ww,int ordnung,int gfanold,int nogfan,list #)
   "USAGE:  tropicalparametriseNoabs(i,tw,ord,gf,ng[,#]); i ideal, tw intvec, ord int, gf,ng int, # opt. list
-ASSUME:  - i is an ideal in Q[t,x_1,...,x_n,X_1,...,X_k], tw=(w_0,w_1,...,w_n,0,...,0) 
-           and (w_0,...,w_n,0,...,0) is in the tropical variety of i, 
-           and ord is the order up to which a point in V(i) over C((t)) lying over w shall be computed; 
+ASSUME:  - i is an ideal in Q[t,x_1,...,x_n,X_1,...,X_k], tw=(w_0,w_1,...,w_n,0,...,0)
+           and (w_0,...,w_n,0,...,0) is in the tropical variety of i,
+           and ord is the order up to which a point in V(i) over C((t)) lying over w shall be computed;
          - moreover, k should be zero if the procedure is not called recursively;
          - the point in the tropical variety is supposed to lie in the NEGATIVE orthant;
          - the ideal is zero-dimensional when considered in (Q(t)[X_1,...,X_k]/m)[x_1,...,x_n],
-           where m=#[2] is a maximal ideal in Q(t)[X_1,...,X_k]; 
+           where m=#[2] is a maximal ideal in Q(t)[X_1,...,X_k];
          - gf is 0 if version 2.2 or larger is used and it is 1 else
-         - ng is 1 if gfan should not be executed 
+         - ng is 1 if gfan should not be executed
 RETURN:  list, l[1] = ring Q(0,X_1,...,X_r)[[t]]
                l[2] = int
                l[3] = string
 NOTE:    - the procedure is also called recursively by itself, and
-           if it is called in the first recursion, the list # is empty, 
+           if it is called in the first recursion, the list # is empty,
            otherwise #[1] is an integer, one more than the number of true variables x_1,...,x_n,
            and #[2] will contain the maximal ideal m in the variables X_1,...X_k
@@ -3739,5 +3739,5 @@
   intvec tw=ww; // in case some variables are deleted, we have to store the old weight vector
   deletedvariables[anzahlvariablen]=0;
-  ideal I,LI; 
+  ideal I,LI;
   i=i+m; // if a field extension was necessary, then i has to be extended by m
   for (jj=anzahlvariablen-1;jj>=1;jj--)  // the variable t is the last one !!!
@@ -3751,5 +3751,5 @@
     if (size(LI)==0) // if no power of t is in lead(I) (where the X(i) are considered as field elements)
     {
-      // get rid of var(jj)   
+      // get rid of var(jj)
       i=eliminate(I,var(jj));
       deletedvariables[jj]=1;
@@ -3775,5 +3775,5 @@
     execute("ring NEURING=("+charstr(basering)+"),("+string(variablen)+"),(dp("+string(size(variablen)-1)+"),lp(1));");
     ideal i=imap(BASERING,i);
-    ideal gesamt_m=imap(BASERING,gesamt_m);    
+    ideal gesamt_m=imap(BASERING,gesamt_m);
   }
   // now we have to compute a point ww on the tropical variety of the transformed ideal i;
@@ -3784,16 +3784,16 @@
     def PREGFANRING=basering;
     if (nogfan!=1)
-    {      
+    {
       // pass to a ring which has variables which are suitable for gfan
       execute("ring GFANRING=("+charstr(basering)+"),(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z),dp;");
-      ideal phiideal=b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z; 
+      ideal phiideal=b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z;
       phiideal[nvars(PREGFANRING)]=a; // map t to a
-      map phi=PREGFANRING,phiideal; 
+      map phi=PREGFANRING,phiideal;
       ideal i=phi(i);
-      // homogenise the ideal i with the first not yet used variable in our ring, since gfan 
+      // homogenise the ideal i with the first not yet used variable in our ring, since gfan
       // only handles homogenous ideals; in principle for this one has first to compute a
-      // standard basis of i and homogenise that, but for the tropical variety (says Anders) 
+      // standard basis of i and homogenise that, but for the tropical variety (says Anders)
       // it suffices to homogenise an arbitrary system of generators
-      // i=groebner(i); 
+      // i=groebner(i);
       i=homog(i,maxideal(1)[nvars(PREGFANRING)+1]);
       // if gfan version >= 0.3.0 is used and the characteristic
@@ -3804,10 +3804,10 @@
         ringvariablen=ringvariablen[1..2*nvars(PREGFANRING)+1];
         write(":w /tmp/gfaninput","Z/"+string(char(GFANRING))+"Z["+ringvariablen+"]");
-        // write the ideal to a file which gfan takes as input and call gfan      
+        // write the ideal to a file which gfan takes as input and call gfan
         write(":a /tmp/gfaninput","{"+string(i)+"}");
       }
-      else  
-      {
-        // write the ideal to a file which gfan takes as input and call gfan      
+      else
+      {
+        // write the ideal to a file which gfan takes as input and call gfan
         write(":w /tmp/gfaninput","{"+string(i)+"}");
       }
@@ -3840,5 +3840,5 @@
         ~
           // THIS IS NOT NECESSARY !!!! IF WE COMPUTE NOT ONLY THE TROPICAL PREVARIETY
-          // test, if wneu really is in the tropical variety    
+          // test, if wneu really is in the tropical variety
           while (goon==0)
         {
@@ -3873,5 +3873,5 @@
   // if all variables were deleted, then i=0 and thus anzahlvariablen==0
   if ((ordnung>1) and (anzahlvariablen>1))
-  {   
+  {
     // we call the procedure with the transformed ideal i, the new weight vector, with the
     // required order lowered by one, and with additional parameters, namely the number of
@@ -3884,5 +3884,5 @@
     string PARAm=PARALIST[3];
     setring PARARing;
-    // if some variables have been eliminated in before, then we have to insert zeros 
+    // if some variables have been eliminated in before, then we have to insert zeros
     // into the parametrisation for those variables
     if (numberdeletedvariables>0)
@@ -3912,5 +3912,5 @@
     int tweight=-tw[1];
     // if additional variables were necessary, we introduce them now as parameters;
-    // in any case the parametrisation ring will have only one variable, namely t,  
+    // in any case the parametrisation ring will have only one variable, namely t,
     // and its order will be local, so that it displays the lowest term in t first
     if (anzahlvariablen+numberdeletedvariables<nvars(basering))
@@ -3933,5 +3933,5 @@
   list a=imap(BASERING,a);
   if (defined(wneu)==0) // when tropicalparametriseNoabs is called for the last time, it does not
-  {                     // enter the part, where wneu is defined and the variable t should have 
+  {                     // enter the part, where wneu is defined and the variable t should have
     intvec wneu=-1;     // weight -1
   }
@@ -3945,9 +3945,9 @@
   // note, if all variables were deleted, then i==0 and thus testaufnull==0
   if ((ordnung==1) or (anzahlvariablen==1))
-  {    
+  {
     export(PARA);
   }
   // kill the gfan files in /tmp
-  system("sh","cd /tmp; /bin/rm gfaninput; /bin/rm gfanoutput");  
+  system("sh","cd /tmp; /bin/rm gfaninput; /bin/rm gfanoutput");
   // we return a list which contains the parametrisation ring (with the parametrisation ideal)
   // and the string representing the maximal ideal describing the necessary field extension
@@ -3957,7 +3957,7 @@
 static proc findzeros (ideal i,intvec w,list #)
   "USAGE:      findzeros(i,w[,#]); i ideal, w intvec, # an optional list
-ASSUME:      i is an ideal in Q[t,x_1,...,x_n,X_n+1,...,X_m] and w=(w_0,...,w_n,0,...,0) 
+ASSUME:      i is an ideal in Q[t,x_1,...,x_n,X_n+1,...,X_m] and w=(w_0,...,w_n,0,...,0)
              is in the tropical variety of i
-RETURN:      list, l[1] = is polynomial ring containing an associated maximal ideal m of the w-initial 
+RETURN:      list, l[1] = is polynomial ring containing an associated maximal ideal m of the w-initial
                           ideal of i which does not contain any monomial and where the variables
                           which do not lead to a field extension have already been eliminated,
@@ -3969,9 +3969,9 @@
                           been eliminated
 NOTE:        the procedure is called from inside the recursive procedure tropicalparametriseNoabs;
-             if it is called in the first recursion, the list #[1] contains the t-initial ideal 
-             of i w.r.t. w, otherwise #[1] is an integer, one more than the number of true 
+             if it is called in the first recursion, the list #[1] contains the t-initial ideal
+             of i w.r.t. w, otherwise #[1] is an integer, one more than the number of true
              variables x_1,...,x_n"
 {
-  def BASERING=basering;  
+  def BASERING=basering;
   // set anzahlvariablen to the number of true variables
   if (typeof(#[1])=="int")
@@ -3990,5 +3990,5 @@
   ideal variablen;
   for (int j=1;j<=nvars(basering)-1;j++)
-  {   
+  {
     variablen=variablen+var(j);
   }
@@ -4002,5 +4002,5 @@
   intvec neuevariablen=maximalideals[1][3]; // the information which variable leads to a new one
   list a=maximalideals[1][4];               // a_k is the kth component of a zero of m, if it is not zero
-  // eliminate from m the superflous variables, that is those ones, which do not lead to 
+  // eliminate from m the superflous variables, that is those ones, which do not lead to
   // a new variable
   poly elimvars=1;
@@ -4012,6 +4012,6 @@
     }
   }
-  m=eliminate(m,elimvars);  
-  export(a);  
+  m=eliminate(m,elimvars);
+  export(a);
   export(m);
   list m_ring=INITIALRING,neuvar,neuevariablen;
@@ -4023,5 +4023,5 @@
 static proc basictransformideal (ideal i,intvec w,list m_ring,list #)
   "USAGE:      basictransformideal(i,w,m_ring[,#]); i ideal, w intvec, m_ring list, # an optional list
-ASSUME:      i is an ideal in Q[t,x_1,...,x_n,X_1,...,X_k], w=(w_0,...,w_n,0,...,0) 
+ASSUME:      i is an ideal in Q[t,x_1,...,x_n,X_1,...,X_k], w=(w_0,...,w_n,0,...,0)
              is in the tropical variety of i, and m_ring contains a ring containing a maximal ideal m needed
              to describe the field extension over which a corresponding associated maximal ideal of the
@@ -4034,10 +4034,10 @@
                    or l[1] = ring which contains the ideals i and m, and the list a
 NOTE:        the procedure is called from inside the recursive procedure tropicalparametriseNoabs;
-             if it is called in the first recursion, the list # is empty, 
+             if it is called in the first recursion, the list # is empty,
              otherwise #[1] is an integer, the number of true variables x_1,...,x_n;
              during the procedure we check if a field extension is necessary to express
              a zero (a_1,...,a_n) of m; if so, we have to introduce new variables and
              a list containing a ring is returned, otherwise the list containing i, a and m
-             is returned; 
+             is returned;
              the ideal m will be changed during the procedure since all variables which reduce
              to a polynomial in X_1,...,X_k modulo m will be eliminated, while the others are
@@ -4083,7 +4083,7 @@
     // map i into the new ring
     ideal i=imap(BASERING,i);
-    // define a map phi which maps the true variables, which are not 
+    // define a map phi which maps the true variables, which are not
     // reduced to polynomials in the additional variables modulo m, to
-    // the corresponding newly introduced variables, and which maps 
+    // the corresponding newly introduced variables, and which maps
     // the old additional variables to themselves
     ideal phiideal;
@@ -4098,5 +4098,5 @@
       else
       {
-        phiideal[j-1]=0;  
+        phiideal[j-1]=0;
       }
     }
@@ -4105,5 +4105,5 @@
       phiideal=phiideal,X(1..nvars(BASERING)-anzahlvariablen);
     }
-    map phi=MRING,phiideal; 
+    map phi=MRING,phiideal;
     // map m and a to the new ring via phi, so that the true variables in m and a are replaced by
     // the corresponding newly introduced variables
@@ -4115,8 +4115,8 @@
   // moreover, substitute right away in the ideal i the true variable x_j by (a_j+x_j)*t^w_j
   zaehler=nvars(BASERING)-anzahlvariablen+1;
-  for (j=1;j<=anzahlvariablen;j++)  
+  for (j=1;j<=anzahlvariablen;j++)
   {
     if ((a[j]==0) and (j!=1))  // a[1]=0, since t->t^w_0
-    {        
+    {
       a[j]=X(zaehler);
       zaehler++;
@@ -4125,5 +4125,5 @@
     {
       if (j!=1) // corresponds to  x_(j-1) --  note t is the last variable
-      {        
+      {
         i[k]=substitute(i[k],var(j-1),(a[j]+var(j-1))*t^(-w[j]));
       }
@@ -4138,5 +4138,5 @@
   {
     if (wdegs[j]<0) // if wdegs[j]==0 there is no need to divide, and we made sure that it is no positive
-    {      
+    {
       i[j]=i[j]/t^(-wdegs[j]);
     }
@@ -4164,5 +4164,5 @@
 static proc testw (ideal i,intvec w,int anzahlvariablen,list #)
 "USAGE:      testw(i,w,n); i ideal, w intvec, n number
-ASSUME:      i is an ideal in Q[t,x_1,...,x_n,X_1,...,X_k] and w=(w_0,...,w_n,0,...,0)            
+ASSUME:      i is an ideal in Q[t,x_1,...,x_n,X_1,...,X_k] and w=(w_0,...,w_n,0,...,0)
 RETURN:      int b, 0 if the t-initial ideal of i considered in Q(X_1,...,X_k)[t,x_1,...,x_n]
                     is monomial free, 1 else
@@ -4179,5 +4179,5 @@
     ideal tin=tInitialIdeal(i,w,1);
   }
-  
+
   int j;
   ideal variablen;
@@ -4211,5 +4211,5 @@
   def BASERING=basering;
   if (anzahlvariablen<nvars(basering))
-  {   
+  {
     execute("ring TINRING=("+charstr(basering)+","+string(Parameter)+"),("+string(variablen)+"),dp;");
   }
@@ -4221,9 +4221,9 @@
   poly monom=imap(BASERING,monom);
   return(radicalMemberShip(monom,tin));
-}  
+}
 
 static proc simplifyToOrder (poly f)
 "USAGE:      simplifyToOrder(f); f a polynomial
-ASSUME:      f is a polynomial in Q(t)[x_1,...,x_n] 
+ASSUME:      f is a polynomial in Q(t)[x_1,...,x_n]
 RETURN:      list, l[1] = t-order of leading term of f
                    l[2] = the rational coefficient of the term of lowest t-order
@@ -4246,5 +4246,5 @@
 static proc scalarproduct (intvec w,intvec v)
 "USAGE:      scalarproduct(w,v); w,v intvec
-ASSUME:      w and v are integer vectors of the same length 
+ASSUME:      w and v are integer vectors of the same length
 RETURN:      int, the scalarproduct of v and w
 NOTE:        the procedure is called by tropicalparametriseNoabs"
@@ -4304,5 +4304,5 @@
                    l[j][3] = intvec, if for the kth variable a new variable is needed to
                              define the corresponding zero of l[j][1], then the k+1st entry is one
-                   l[j][4] = list, if for the kth variable no new variable is needed to 
+                   l[j][4] = list, if for the kth variable no new variable is needed to
                              define the corresponding zero of l[j][1], then its value is the k+1st entry
 NOTE:        if a maximal ideal contains a variable, it is removed from the list;
@@ -4320,7 +4320,7 @@
   intvec testvariablen; // integer vector of length n=number of variables
   // compute for each maximal ideal the number of new variables, which are needed to describe
-  // its zeros -- note, a new variable is needed if modulo the maximal ideal it does not reduce 
+  // its zeros -- note, a new variable is needed if modulo the maximal ideal it does not reduce
   // to something which only depends on the following variables;
-  // if no new variable is needed, then store the value a variable reduces to in the list a; 
+  // if no new variable is needed, then store the value a variable reduces to in the list a;
   for (j=size(minassi);j>=1;j--)
   {
@@ -4341,5 +4341,5 @@
       {
         if (l<=k)
-        {          
+        {
           testvariablen[l]=1;
         }
@@ -4357,5 +4357,5 @@
         a[k+1]=nf;             // a_k is the normal form of the kth variable modulo m
         neuevariablen[k+1]=0;  // no new variable is needed
-      }    
+      }
       else
       {
@@ -4367,5 +4367,5 @@
     // if the maximal ideal contains a variable, we simply delete it
     if (pruefer==0)
-    {      
+    {
       minassisort[j]=list(minassi[j],neuvar,neuevariablen,a);
     }
@@ -4384,5 +4384,5 @@
     l=j;
     for (k=j-1;k>=1;k--)
-    {      
+    {
       if (minassisort[l][2]<minassisort[k][2])
       {
@@ -4400,5 +4400,5 @@
 "USAGE:  displaypoly(p,N,wj,w1); p poly, N, wj, w1 int
 ASSUME:  p is a polynomial in r=(0,X(1..k)),t,ls
-RETURN:  string, the string of t^-wj/w1*p(t^1/N)  
+RETURN:  string, the string of t^-wj/w1*p(t^1/N)
 NOTE:    the procedure is called from displayTropicalLifting"
 {
@@ -4418,5 +4418,5 @@
   {
     if (koeffizienten[j-ord(p)+1]!=0)
-    {      
+    {
       if ((j-(N*wj)/w1)==0)
       {
@@ -4534,6 +4534,6 @@
 "USAGE:   tropicalliftingresubstitute(i,L,N[,#]); i ideal, L list, N int, # string
 ASSUME:   i is an ideal and L[1] is a ring which contains the lifting of a point in the
-          tropical variety of i computed with tropicalLifting; 
-          t has to be replaced by t^1/N in the lifting; #[1]=m is the string of the maximal 
+          tropical variety of i computed with tropicalLifting;
+          t has to be replaced by t^1/N in the lifting; #[1]=m is the string of the maximal
           ideal defining the necessary field extension as computed by tropicalLifting,
           if #[1] is present
@@ -4559,5 +4559,5 @@
       ideal i=imap(BASERING,i);
     }
-  }  
+  }
   else
   {
@@ -4588,5 +4588,5 @@
   for (j=1;j<=ncols(i);j++)
   {
-    SUBSTTEST[j]=displaypoly(i[j],N,0,1);  
+    SUBSTTEST[j]=displaypoly(i[j],N,0,1);
   }
   return(SUBSTTEST);
@@ -4598,16 +4598,16 @@
 /// - eliminatecomponents
 /// - findzerosAndBasictransform
-/// - ordermaximalideals 
+/// - ordermaximalideals
 ////////////////////////////////////////////////////////////////////////////////////
 
 static proc tropicalparametrise (ideal i,intvec ww,int ordnung,int gfanold,int findall,int nogfan,list #)
 "USAGE:  tropicalparametrise(i,tw,ord,gf,fa,ng[,#]); i ideal, tw intvec, ord int, gf,fa,ng int, # opt. list
-ASSUME:  - i is an ideal in Q[t,x_1,...,x_n,@a], tw=(w_0,w_1,...,w_n,0) 
-           and (w_0,...,w_n,0) is in the tropical variety of i, 
-           and ord is the order up to which a point in V(i) over K{{t}} lying over w shall be computed; 
+ASSUME:  - i is an ideal in Q[t,x_1,...,x_n,@a], tw=(w_0,w_1,...,w_n,0)
+           and (w_0,...,w_n,0) is in the tropical variety of i,
+           and ord is the order up to which a point in V(i) over K{{t}} lying over w shall be computed;
          - moreover, @a should be not be there if the procedure is not called recursively;
          - the point in the tropical variety is supposed to lie in the NEGATIVE orthant;
          - the ideal is zero-dimensional when considered in (K(t)[@a]/m)[x_1,...,x_n],
-           where m=#[2] is a maximal ideal in K[@a]; 
+           where m=#[2] is a maximal ideal in K[@a];
          - gf is 0 if version 2.2 or larger is used and it is 1 else
          - fa is 1 if all solutions should be found
@@ -4616,5 +4616,5 @@
                l[2] = int
 NOTE:    - the procedure is also called recursively by itself, and
-           if it is called in the first recursion, the list # is empty, 
+           if it is called in the first recursion, the list # is empty,
            otherwise #[1] is an integer, one more than the number of true variables x_1,...,x_n,
            and #[2] will contain the maximal ideal m in the variable @a
@@ -4651,5 +4651,5 @@
     int anzahlvariablen=nvars(basering);
     list zerolist; // will carry the zeros which are computed in the recursion steps
-    
+
     // the initial ideal of i has been handed over as #[1]
     ideal ini=#[1];
@@ -4660,5 +4660,5 @@
   }
   list wneulist; // carries all newly computed weight vector
-  intvec wneu;   // carries the newly computed weight vector 
+  intvec wneu;   // carries the newly computed weight vector
   int tweight;   // carries the weight of t
   list PARALIST; // carries the result when tropicalparametrise is recursively called
@@ -4695,16 +4695,16 @@
       {
         if (nogfan!=1)
-        {          
+        {
           // pass to a ring which has variables which are suitable for gfan
           execute("ring GFANRING=("+string(char(basering))+"),(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z),dp;");
-          ideal phiideal=b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z; 
+          ideal phiideal=b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z;
           phiideal[nvars(PREGFANRING)]=a; // map t to a
-          map phi=PREGFANRING,phiideal; 
+          map phi=PREGFANRING,phiideal;
           ideal II=phi(i);
-          // homogenise the ideal II with the first not yet used variable in our ring, since gfan 
+          // homogenise the ideal II with the first not yet used variable in our ring, since gfan
           // only handles homogenous ideals; in principle for this one has first to compute a
-          // standard basis of II and homogenise that, but for the tropical variety (says Anders) 
+          // standard basis of II and homogenise that, but for the tropical variety (says Anders)
           // it suffices to homogenise an arbitrary system of generators
-          // II=groebner(II); 
+          // II=groebner(II);
           II=homog(II,maxideal(1)[nvars(PREGFANRING)+1]);
           // if gfan version >= 0.3.0 is used and the characteristic
@@ -4751,5 +4751,5 @@
             ~
             // THIS IS NOT NECESSARY !!!! IF WE COMPUTE NOT ONLY THE TROPICAL PREVARIETY
-            // test, if wneu really is in the tropical variety    
+            // test, if wneu really is in the tropical variety
             while (goon==0)
             {
@@ -4796,5 +4796,5 @@
       lll=0;
       if ((ordnung>1) and (anzahlvariablen>1))
-      { 
+      {
         partliftings=list(); // initialise partliftings
         // we call the procedure with the transformed ideal i, the new weight vector, with the
@@ -4808,9 +4808,9 @@
           // the maximal ideal that describes the necessary field extension
           for (ll=1;ll<=size(PARALIST);ll++)
-          {  
+          {
             def PARARing=PARALIST[ll][1];
             tweight=-ww[1]*PARALIST[ll][2];
             setring PARARing;
-            // if some variables have been eliminated in before, then we have to insert zeros 
+            // if some variables have been eliminated in before, then we have to insert zeros
             // into the parametrisation for those variables
             if (numberdeletedvariables>0)
@@ -4844,5 +4844,5 @@
         tweight=-ww[1];
         // if additional variables were necessary, we introduce them now as parameters;
-        // in any case the parametrisation ring will have only one variable, namely t,  
+        // in any case the parametrisation ring will have only one variable, namely t,
         // and its order will be local, so that it displays the lowest term in t first
         if (anzahlvariablen<nvars(basering))
@@ -4872,5 +4872,5 @@
       {
         if (size(partliftings[lll])==2) // when tropicalparametrise is called for the last time, it does not
-        {                     // enter the part, where wneu is defined and the variable t should have 
+        {                     // enter the part, where wneu is defined and the variable t should have
           wneu=-1;     // weight -1
         }
@@ -4904,5 +4904,5 @@
   }
   // kill the gfan files in /tmp
-  system("sh","cd /tmp; /bin/rm gfaninput; /bin/rm gfanoutput");  
+  system("sh","cd /tmp; /bin/rm gfaninput; /bin/rm gfanoutput");
   // we return a list which contains lists of the parametrisation rings (with the parametrisation ideal)
   // and an integer N such that t should be replaced by t^1/N
@@ -4912,7 +4912,7 @@
 static proc eliminatecomponents (ideal i,ideal m,int anzahlvariablen,int findall,int lastvar,intvec deletedvariables)
 "USAGE:  eliminatecomponents(i,m,n,a,v,d); i,m ideal, n,a,v int, d intvec
-ASSUME:  i is an ideal in Q[x_1,...,x_n,@a,t] and w=(-w_1/w_0,...,-w_n/w_0) 
-         is in the tropical variety of i considered in Q[@a]/m{{t}}[x_1,...,x_n]; 
-         considered in this ring i is zero-dimensional; @a need not be present 
+ASSUME:  i is an ideal in Q[x_1,...,x_n,@a,t] and w=(-w_1/w_0,...,-w_n/w_0)
+         is in the tropical variety of i considered in Q[@a]/m{{t}}[x_1,...,x_n];
+         considered in this ring i is zero-dimensional; @a need not be present
          in which case m is zero; 1<=v<=n
 RETURN:  list, L of lists
@@ -4922,5 +4922,5 @@
 NOTE:    - the procedure is called from inside the recursive procedure tropicalparametrise
          - the procedure checks for solutions which have certain components zero; these are
-           separated from the rest by elimination and saturation; the integer deletedvariables 
+           separated from the rest by elimination and saturation; the integer deletedvariables
            records which variables have been eliminated; the integer anzahlvariablen records how
            many true variables remain after the elimination
@@ -4933,14 +4933,14 @@
   // if all solutions have to be found
   if (findall==1)
-  {    
+  {
     list saturatelist,eliminatelist; // carry the solution of the two tests
-    // we test first if there is a solution which has the component lastvar zero and 
+    // we test first if there is a solution which has the component lastvar zero and
     // where the order of each component is strictly positive;
     // if so, we add this variable to the ideal and eliminate it - which amounts to
     // to projecting the solutions with this component zero to the hyperplane without this component;
     // for the test we compute the saturation with respect to t and replace each variable
-    // x_i and also t by zero -- if the result is zero, then 1 is not in I:t^infty 
+    // x_i and also t by zero -- if the result is zero, then 1 is not in I:t^infty
     // (i.e. there is a solution which has the component lastvar zero) and
-    // the result lives in the maximal ideal <t,x_1,...,[no x_lastvar],...,x_n> so that 
+    // the result lives in the maximal ideal <t,x_1,...,[no x_lastvar],...,x_n> so that
     // there is a solution which has strictly positive valuation
 /*
@@ -4954,5 +4954,5 @@
     // equal to zero then this component has a valuation with all strictly positive values!!!!;
     // for this we can either saturate the ideal after elimination with respect to <t,x_1,...,x_n>
-    // and see if the saturated ideal is contained in <t,x_1,...x_n>+m, 
+    // and see if the saturated ideal is contained in <t,x_1,...x_n>+m,
     // or ALTERNATIVELY we can pass to the ring 0,(t,x_1,...,x_n,@a),(ds(n+1),dp(1)),
     // compute a standard basis of the elimination ideal (plus m) there and check if the dimension 1
@@ -4989,5 +4989,5 @@
       {
         string elring="ring ELIMINATERING=("+charstr(basering)+"),("+string(simplify(reduce(maxideal(1),std(var(lastvar))),2))+"),(";
-      }    
+      }
       if (anzahlvariablen<nvars(basering)) // if @a was present, the ordersting needs an additional entry
       {
@@ -4995,5 +4995,5 @@
       }
       elring=elring+"lp(1));";
-      execute(elring);      
+      execute(elring);
       ideal i=imap(BASERING,I); // move the ideal I to the new ring
       // if not yet all variables have been checked, then go on with the next smaller variable,
@@ -5011,10 +5011,10 @@
     }
     // next we have to test if there is also a solution which has the variable lastvar non-zero;
-    // to do so, we saturate with respect to this variable; since when considered over K{{t}} 
+    // to do so, we saturate with respect to this variable; since when considered over K{{t}}
     // the ideal is zero dimensional, this really removes  all solutions with that component zero;
     // the checking is then done as above
     i=std(sat(i,var(lastvar))[1]);
     I=reduce(i,std(m)); // "remove" m from i
-    // test first, if i still is in the ideal <t,x_1,...,x_n> -- if not, then 
+    // test first, if i still is in the ideal <t,x_1,...,x_n> -- if not, then
     // we know that i has no longer a point in the tropical variety with all components negative
     LI=subst(I,var(nvars(basering)),0);
@@ -5024,5 +5024,5 @@
     }
     if (size(LI)==0) // the entries of i have not constant part
-    {      
+    {
       // check now, if the leading ideal of i contains an element which only depends on t
       LI=lead(I);
@@ -5040,5 +5040,5 @@
         }
         else
-        {   
+        {
           execute("ring SATURATERING=("+charstr(basering)+"),("+varstr(basering)+"),("+ordstr(basering)+");");
           ideal i=imap(BASERING,i);
@@ -5069,5 +5069,5 @@
       if (size(LI)==0) // if no power of t is in lead(I) (where the X(i) are considered as field elements)
       {
-        // get rid of var(j)   
+        // get rid of var(j)
         i=eliminate(I,var(j));
         deletedvariables[j]=1;
@@ -5086,5 +5086,5 @@
     }
     // if there are variables left, then pass to a ring which only realises these variables
-    // else we are done 
+    // else we are done
     if (anzahlvariablen>1)
     {
@@ -5094,5 +5094,5 @@
     {
       string elring="ring ELIMINATERING=("+charstr(basering)+"),("+string(variablen)+"),(";
-    }    
+    }
     if (size(deletedvariables)+1<nvars(basering)) // if @a was present, the ordersting needs an additional entry
     {
@@ -5100,5 +5100,5 @@
     }
     elring=elring+"lp(1));";
-    execute(elring);      
+    execute(elring);
     ideal i=imap(BASERING,i);
     ideal m=imap(BASERING,m);
@@ -5111,5 +5111,5 @@
 static proc findzerosAndBasictransform (ideal i,intvec w,list zerolist,int findall,list #)
 "USAGE:      findzerosAndBasictransform(i,w,z,f[,#]); i ideal, w intvec, z list, f int,# an optional list
-ASSUME:      i is an ideal in Q[t,x_1,...,x_n,@a] and w=(w_0,...,w_n,0) 
+ASSUME:      i is an ideal in Q[t,x_1,...,x_n,@a] and w=(w_0,...,w_n,0)
              is in the tropical variety of i; @a need not be present;
              the list 'zero' contains the zeros computed in previous recursion steps;
@@ -5125,6 +5125,6 @@
                    list zero  = zero[k+1] is the kth component of a zero the t-initial ideal of i
 NOTE:     -  the procedure is called from inside the recursive procedure tropicalparametrise;
-             if it is called in the first recursion, the list #[1] contains the t-initial ideal 
-             of i w.r.t. w, otherwise #[1] is an integer, one more than the number of true 
+             if it is called in the first recursion, the list #[1] contains the t-initial ideal
+             of i w.r.t. w, otherwise #[1] is an integer, one more than the number of true
              variables x_1,...,x_n
           -  if #[2] is present, then it is an integer which tells whether ALL zeros should be
@@ -5154,9 +5154,9 @@
     int anzahlvariablen=nvars(basering);
     ideal ini=#[1]; // the t-initial ideal has been computed in before and was handed over
-  } 
+  }
   // collect the true variables x_1,...,x_n plus @a, if it is defined in BASERING
   ideal variablen;
   for (j=1;j<=nvars(basering)-1;j++)
-  {   
+  {
     variablen=variablen+var(j);
   }
@@ -5187,5 +5187,5 @@
       // phi maps x_i to x_i, @a to @a (if present in the ring), and the additional variable
       // for the field extension is mapped to @a as well -- note that we only apply phi
-      // to the list a, and in this list no @a is present; therefore, it does not matter 
+      // to the list a, and in this list no @a is present; therefore, it does not matter
       // where this is mapped to
       map phi=ABSRING,imap(BASERING,variablen),@a;
@@ -5197,8 +5197,8 @@
       // for the field extension is mapped to @a as well respectively to 0, if no @a is present;
       // note that we only apply phi to the list a and to the replacement rule for
-      // the old variable @a, and in this list resp. replacement rule no @a is present; 
+      // the old variable @a, and in this list resp. replacement rule no @a is present;
       // therefore, it does not matter where this is mapped to;
       if (anzahlvariablen<nvars(EXTENSIONRING)) // @a is in EXTENSIONRING
-      {      
+      {
         map phi=ABSRING,imap(BASERING,variablen),@a; // additional variable is mapped to @a
       }
@@ -5212,8 +5212,8 @@
     poly m=maximalideals[j][1];    // extract m
     list zeroneu=maximalideals[j][2]; // extract the new zero
-    poly repl=maximalideals[j][3]; // extract the replacement rule    
+    poly repl=maximalideals[j][3]; // extract the replacement rule
     // the list zero may very well exist as an EMPTY global list - in this case we have to remove it
     // in order to avoid a redefining warning
-    if (defined(zero)!=0) 
+    if (defined(zero)!=0)
     {
       if (size(zero)==0)
@@ -5227,13 +5227,13 @@
       ideal i=imap(BASERING,i);
       if (defined(zerolist)==0) // if zerolist is empty, it does not depend on BASERING !
-      {        
+      {
         list zero=imap(BASERING,zerolist);
       }
-      else 
+      else
       {
         list zero=zerolist;
       }
     }
-    else // in BASERING was @a present 
+    else // in BASERING was @a present
     {
       ideal variablen=imap(BASERING,variablen);
@@ -5247,10 +5247,10 @@
     zero[size(zero)+1]=zeroneu;
     // do now the basic transformation sending x_l -> t^-w_l*(zero_l+x_l)
-    for (l=1;l<=anzahlvariablen;l++)  
+    for (l=1;l<=anzahlvariablen;l++)
     {
       for (k=1;k<=size(i);k++)
       {
         if (l!=1) // corresponds to  x_(l-1) --  note t is the last variable
-        {        
+        {
           i[k]=substitute(i[k],var(l-1),(zeroneu[l]+var(l-1))*t^(-w[l]));
         }
@@ -5265,5 +5265,5 @@
     {
       if (wdegs[l]<0) // if wdegs[l]==0 there is no need to divide, and we made sure that it is no positive
-      {      
+      {
         i[l]=i[l]/t^(-wdegs[l]);
       }
@@ -5276,5 +5276,5 @@
     export(i);
     export(m);
-    export(zero);    
+    export(zero);
     extensionringlist[j]=EXTENSIONRING;
     kill EXTENSIONRING;
@@ -5290,10 +5290,10 @@
              polynomial of the last variable in the ring which is considered as a parameter
 RETURN:      list, the procedure orders the maximal ideals in minassi according to how many new
-                   variables are needed (namely none or one) to describe the zeros of the ideal, 
+                   variables are needed (namely none or one) to describe the zeros of the ideal,
                    and accordingly to the degree of the corresponding minimal polynomial
                    l[j][1] = the minimal polynomial for the jth maximal ideal
-                   l[j][2] = list, the k+1st entry is the kth coordinate of the zero 
+                   l[j][2] = list, the k+1st entry is the kth coordinate of the zero
                                    described by the maximal ideal in terms of the last variable
-                   l[j][3] = poly, the replacement for the old variable @a 
+                   l[j][3] = poly, the replacement for the old variable @a
 NOTE:        if a maximal ideal contains a variable, it is removed from the list;
              the procedure is called by findzerosAndBasictransform"
@@ -5306,9 +5306,9 @@
   list zero;         // (a_1,...,a_n)=(zero[2],...,zero[n+1]) will be a common zero of the ideal m
   poly nf;           // normalform of a variable w.r.t. m
-  poly minimalpolynomial;  // minimal polynomial for the field extension 
+  poly minimalpolynomial;  // minimal polynomial for the field extension
   poly parrep;       // the old variable @a possibly has to be replaced by a new one
   // compute for each maximal ideal the number of new variables, which are needed to describe
   // its zeros -- note, a new variable is needed if the first entry of minassi[j][1] is not the last variable
-  // store the value a variable reduces to in the list a; 
+  // store the value a variable reduces to in the list a;
   for (j=size(minassi);j>=1;j--)
   {
@@ -5337,5 +5337,5 @@
     // if the maximal ideal contains a variable, we simply delete it
     if (pruefer==0)
-    {      
+    {
       minassisort[j]=list(minimalpolynomial,zero,parrep);
     }
@@ -5354,5 +5354,5 @@
     l=j;
     for (k=j-1;k>=1;k--)
-    {      
+    {
       if (deg(minassisort[l][1])<deg(minassisort[k][1]))
       {
@@ -5393,11 +5393,11 @@
                    l[i][2] = y-coordinate of the ith vertex
                    l[i][3] = a polynomial whose monimials mark the vertices in the Newton polygon
-                             corresponding to the entries in tp which take the common minimum 
+                             corresponding to the entries in tp which take the common minimum
                              at the ith vertex
-NOTE:      - the information in l[i][3] represents the subdivision of the Newton polygon of tp 
-             (respectively a polynomial which defines tp); 
-           - if # is non-empty and #[1] is the string 'max', then in the computations minimum and 
-             maximum are exchanged; 
-           - if # is non-empty and the #[1] is not a string, only the vertices will be computed 
+NOTE:      - the information in l[i][3] represents the subdivision of the Newton polygon of tp
+             (respectively a polynomial which defines tp);
+           - if # is non-empty and #[1] is the string 'max', then in the computations minimum and
+             maximum are exchanged;
+           - if # is non-empty and the #[1] is not a string, only the vertices will be computed
              and the information on the Newton subdivision will be omitted;
            - here the tropical polynomial is supposed to be the MINIMUM of the linear forms in tp,
@@ -5406,5 +5406,5 @@
 {
   // if you insert a single polynomial instead of an ideal representing a tropicalised polynomial,
-  // then we compute first the tropicalisation of this polynomial -- this feature is not 
+  // then we compute first the tropicalisation of this polynomial -- this feature is not
   // documented in the above help string
   if (typeof(tp)=="poly")
@@ -5485,5 +5485,5 @@
             e++;
           }
-        }          
+        }
       }
     }
@@ -5511,16 +5511,16 @@
 RETURN:      list, see the procedure tropicalCurve for an explanation of the syntax of this list
 NOTE:      - the tropical curve defined by tp will consist of a bunch of parallel lines and
-             throughout the procedure a list with the name bunchoflines is computed, which 
+             throughout the procedure a list with the name bunchoflines is computed, which
              represents these lines and has the following interpretation:
              list, each entry corresponds to a vertex in the tropical plane curve defined by tp
                    l[i][1] = the equation of the ith line in the tropical curve
                    l[i][2] = a polynomial whose monimials mark the vertices in the Newton polygon
-                             corresponding to the entries in tp which take the common minimum 
+                             corresponding to the entries in tp which take the common minimum
                              at the ith vertex
-           - the information in l[i][2] represents the subdivision of the Newton polygon of tp 
-             (respectively a polynomial which defines tp); 
-           - if # is non-empty and #[1] is the string 'max', then in the computations minimum and 
-             maximum are exchanged; 
-           - if # is non-empty and the #[1] is not a string, only the vertices will be computed 
+           - the information in l[i][2] represents the subdivision of the Newton polygon of tp
+             (respectively a polynomial which defines tp);
+           - if # is non-empty and #[1] is the string 'max', then in the computations minimum and
+             maximum are exchanged;
+           - if # is non-empty and the #[1] is not a string, only the vertices will be computed
              and the information on the Newton subdivision will be omitted;
            - here the tropical polynomial is supposed to be the MINIMUM of the linear forms in tp,
@@ -5571,5 +5571,5 @@
       {
         vergleich=substitute(tp[l],var(1),px);
-        if (vergleich==wert)  
+        if (vergleich==wert)
         {
           newton=newton+detropicalise(oldtp[l]);
@@ -5582,5 +5582,5 @@
         e++;
       }
-    }          
+    }
   }
   // if a vertex appears several times, only its first occurence will be kept
@@ -5589,5 +5589,5 @@
     for (j=i-1;j>=1;j--)
     {
-      if (bunchoflines[i][1]==bunchoflines[j][1]) 
+      if (bunchoflines[i][1]==bunchoflines[j][1])
       {
         bunchoflines=delete(bunchoflines,i);
@@ -5630,5 +5630,5 @@
     xc=substitute(bunchoflines[i][1]-cc,var(2),0,var(1),1);
     yc=substitute(bunchoflines[i][1]-cc,var(2),1,var(1),0);
-	if (xc!=0) // then there is a point on the line with y-coordinate zero
+        if (xc!=0) // then there is a point on the line with y-coordinate zero
     {
       gr[1]=-cc/leadcoef(xc);
@@ -5650,9 +5650,9 @@
 
 static proc clearintmat (intmat vv)
-"USAGE:      clearintmat(vv); vv intmat 
+"USAGE:      clearintmat(vv); vv intmat
 ASSUME:      all entries of the first column of vv are non-negative, not all entries are zero
              unless vv has only one column
-RETURN:      intmat, vv has been ordered in an ascending way by the entries of the first row; 
-                     if an entry in the first row occurs several times, the entries in the 
+RETURN:      intmat, vv has been ordered in an ascending way by the entries of the first row;
+                     if an entry in the first row occurs several times, the entries in the
                      second row have been added and only one row has been kept;
                      colums with a zero in the first row have been removed unless vv has only one
@@ -5663,5 +5663,5 @@
   for (int i=ncols(vv)-1;i>=1;i--)
   {
-    if (vv[1,i]==vv[1,i+1]) 
+    if (vv[1,i]==vv[1,i+1])
     {
       vv[2,i]=vv[2,i]+vv[2,i+1];
@@ -5693,5 +5693,5 @@
         k++;
       }
-      else 
+      else
       {
         stop=1;
@@ -5768,5 +5768,5 @@
   {
     int m=nrows(M);
-    
+
   }
   else
@@ -5890,13 +5890,13 @@
     return(c);
   }
-  f=f-c;  
+  f=f-c;
   if (k==1)
   {
     return(substitute(f,var(1),1,var(2),0));
-  }    
+  }
   else
   {
     return(substitute(f,var(1),0,var(2),1));
-  }    
+  }
 }
 
@@ -5983,5 +5983,5 @@
 ASSUME:      f is a polynomial in Q[x_1,...,x_n], and # is either empty or #[1] is a positive integer
 RETURN:      string, a decimal expansion of the leading coefficient of f up to order two respectively #[1]
-NOTE:        the procedure is called by texDrawTropical and conicWithTangents and 
+NOTE:        the procedure is called by texDrawTropical and conicWithTangents and
              f will actually be a number"
 {
@@ -6010,5 +6010,5 @@
       }
       for (j=i;j<=i+nachkomma;j++)
-      {        
+      {
         news=news+s[j];
       }
@@ -6040,5 +6040,5 @@
   }
   return(0);
-}      
+}
 
 static proc stringdelete (string w,int i)
@@ -6054,5 +6054,5 @@
   {
     return("");
-    
+
   }
   if (i==1)
@@ -6109,5 +6109,5 @@
       k=j+2;
       while (k<=size(F) and ((F[k]=="0") or (F[k]=="1") or (F[k]=="2") or (F[k]=="3") or
-                                (F[k]=="4") or (F[k]=="5") or (F[k]=="6") or (F[k]=="7") or (F[k]=="8") 
+                                (F[k]=="4") or (F[k]=="5") or (F[k]=="6") or (F[k]=="7") or (F[k]=="8")
                              or (F[k]=="9")))
       {
@@ -6123,5 +6123,5 @@
       k=j+2;
       while (k<=size(F) and ((F[k]=="0") or (F[k]=="1") or (F[k]=="2") or (F[k]=="3") or
-                                (F[k]=="4") or (F[k]=="5") or (F[k]=="6") or (F[k]=="7") or (F[k]=="8") 
+                                (F[k]=="4") or (F[k]=="5") or (F[k]=="6") or (F[k]=="7") or (F[k]=="8")
                              or (F[k]=="9")))
       {
@@ -6136,10 +6136,10 @@
       F=stringdelete(F,j);
       j--;
-    }      
+    }
   }
   short=altshort;
   return(F);
 }
-  
+
 static proc texcoefficient (poly f,list #)
 "USAGE:      texcoefficient(f[,#]); f poly, # optional list
@@ -6176,5 +6176,5 @@
   }
   if (size(koeffizient)>5)
-  {    
+  {
     string tfractest=koeffizient[2..6];
     if (tfractest=="tfrac")
@@ -6259,5 +6259,5 @@
 static proc coordinatechange (poly f,intmat A,intvec v)
 "USAGE:   coordinatechange(f,A,v);  f poly, A intmat, v intvec
-ASSUME:   f is a polynomial in two variables, A is a 2x2 
+ASSUME:   f is a polynomial in two variables, A is a 2x2
           integer matrix, and v is an integer vector with 2 entries
 RETURN:   poly, the polynomial transformed by (x,y)->A*(x,y)+v
@@ -6280,5 +6280,5 @@
 ASSUME:      poly is a cubic polynomial
 RETURN:      poly, the Weierstrass normal form of the cubic, 0 if poly is not a cubic
-NOTE:        - the algorithm for the coefficients of the Weierstrass form is due to 
+NOTE:        - the algorithm for the coefficients of the Weierstrass form is due to
                Fernando Rodriguez Villegas, villegas@math.utexas.edu
              - if an additional argument # is given, the simplified Weierstrass form
@@ -6304,18 +6304,18 @@
   poly a4=((-3*t0*r0+s0^2)*q1+(-3*s1*s0*q0+s1*r0^2))*q3
     +(t0*r0*q2^2+(s1*s0*q1+((-3*t0*r2+s1^2)*q0+s0*r0*r2))*q2
-      +(t0*r2*q1^2+s1*r0*r2*q1+s0*r2^2*q0)); 
+      +(t0*r2*q1^2+s1*r0*r2*q1+s0*r2^2*q0));
   poly a6=(-27*t0^2*q0^2+(9*t0*s0*r0-s0^3)*q0-t0*r0^3)*q3^2+
-	(((9*t0^2*q0-t0*s0*r0)*q1+((-3*t0*s0*r1+(3*t0*s1*r0+
-	2*s1*s0^2))*q0+(t0*r0^2*r1-s1*s0*r0^2)))*q2+(-t0^2*q1^3
-	+(t0*s0*r1+(2*t0*s1*r0-s1*s0^2))*q1^2+((3*t0*s0*r2+
-	(-3*t0*s1*r1+2*s1^2*s0))*q0+((2*t0*r0^2-s0^2*r0)*r2+
-	(-t0*r0*r1^2+s1*s0*r0*r1-s1^2*r0^2)))*q1+((9*t0*s1*r2-
-	s1^3)*q0^2+(((-3*t0*r0+s0^2)*r1-s1*s0*r0)*r2+(t0*r1^3
-	-s1*s0*r1^2+s1^2*r0*r1))*q0)))*q3+(-t0^2*q0*q2^3+
-	(-t0*s1*r0*q1+((2*t0*s0*r2+(t0*s1*r1-s1^2*s0))*q0-
-	t0*r0^2*r2))*q2^2+(-t0*s0*r2*q1^2+(-t0*s1*r2*q0+
-	(t0*r0*r1-s1*s0*r0)*r2)*q1+((2*t0*r0-s0^2)*r2^2+
-	(-t0*r1^2+s1*s0*r1-s1^2*r0)*r2)*q0)*q2+
-	(-t0*r0*r2^2*q1^2+(t0*r1-s1*s0)*r2^2*q0*q1-
+        (((9*t0^2*q0-t0*s0*r0)*q1+((-3*t0*s0*r1+(3*t0*s1*r0+
+        2*s1*s0^2))*q0+(t0*r0^2*r1-s1*s0*r0^2)))*q2+(-t0^2*q1^3
+        +(t0*s0*r1+(2*t0*s1*r0-s1*s0^2))*q1^2+((3*t0*s0*r2+
+        (-3*t0*s1*r1+2*s1^2*s0))*q0+((2*t0*r0^2-s0^2*r0)*r2+
+        (-t0*r0*r1^2+s1*s0*r0*r1-s1^2*r0^2)))*q1+((9*t0*s1*r2-
+        s1^3)*q0^2+(((-3*t0*r0+s0^2)*r1-s1*s0*r0)*r2+(t0*r1^3
+        -s1*s0*r1^2+s1^2*r0*r1))*q0)))*q3+(-t0^2*q0*q2^3+
+        (-t0*s1*r0*q1+((2*t0*s0*r2+(t0*s1*r1-s1^2*s0))*q0-
+        t0*r0^2*r2))*q2^2+(-t0*s0*r2*q1^2+(-t0*s1*r2*q0+
+        (t0*r0*r1-s1*s0*r0)*r2)*q1+((2*t0*r0-s0^2)*r2^2+
+        (-t0*r1^2+s1*s0*r1-s1^2*r0)*r2)*q0)*q2+
+        (-t0*r0*r2^2*q1^2+(t0*r1-s1*s0)*r2^2*q0*q1-
      t0*r2^3*q0^2));
   poly b2=a1^2+4*a2;
@@ -6365,5 +6365,5 @@
              i.e. a polynomial of the form a+bx+cx2+dy+exy+fx2y+gy2+hxy2+ix2y2
 RETURN:      poly, a Weierstrass form of the elliptic curve defined by poly
-NOTE:        - the algorithm is based on the paper Sang Yook An, Seog Young Kim, 
+NOTE:        - the algorithm is based on the paper Sang Yook An, Seog Young Kim,
                David C. Marshall, Susan H. Marshall, William G. McCallum and Alexander R. Perlis:
                Jacobians of Genus One Curves. Journal of Number Theory 90,2 (2001), 304-315.
@@ -6388,5 +6388,5 @@
 
 static proc jInvariantOfACubic (poly f,list #)
-"USAGE:      jInvariantOfACubic(f[,#]); f poly, # list 
+"USAGE:      jInvariantOfACubic(f[,#]); f poly, # list
 ASSUME:      poly is a cubic polynomial defining an elliptic curve
 RETURN:      poly, the j-invariant of the elliptic curve defined by poly
@@ -6429,5 +6429,5 @@
 
 static proc jInvariantOfA2x2Curve (poly f,list #)
-"USAGE:      jInvariantOfA2x2Curve(f[,#]); f poly, # list 
+"USAGE:      jInvariantOfA2x2Curve(f[,#]); f poly, # list
 ASSUME:      poly, is a polynomial defining an elliptic curve of type (2,2) on P^1xP^1,
              i.e. a polynomial of the form a+bx+cx2+dy+exy+fx2y+gy2+hxy2+ix2y2
@@ -6475,5 +6475,5 @@
 
 static proc jInvariantOfA4x2Curve (poly f,list #)
-"USAGE:      jInvariantOfA4x2Curve(f[,#]); f poly, # list 
+"USAGE:      jInvariantOfA4x2Curve(f[,#]); f poly, # list
 ASSUME:      poly, is a polynomial defining an elliptic curve of type (4,2),
              i.e. a polynomial of the form a+bx+cx2+dx3+ex4+fy+gxy+hx2y+iy2
@@ -6515,7 +6515,7 @@
 
 static proc jInvariantOfAPuiseuxCubic (poly f,list #)
-"USAGE:      jInvariantOfAPuiseuxCubic(f[,#]); f poly, # list 
+"USAGE:      jInvariantOfAPuiseuxCubic(f[,#]); f poly, # list
 ASSUME:      poly is a cubic polynomial over Q(t) defining an elliptic curve and # is empty
-RETURN:      list, containing two polynomials whose ratio is the j-invariant of the 
+RETURN:      list, containing two polynomials whose ratio is the j-invariant of the
                    elliptic curve defined by poly
 ASSUME:      poly is a cubic polynomial over Q(t) defining an elliptic curve and # is non-empty
@@ -6624,5 +6624,5 @@
 // Example 3 - the ideal is not zero dimensional
 // --------------------------------------------------------
-ring r1=0,(t,x,y),dp; 
+ring r1=0,(t,x,y),dp;
 poly f=(9t27-12t26-5t25+21t24+35t23-51t22-40t21+87t20+56t19-94t18-62t17+92t16+56t15-70t14-42t13+38t12+28t11+18t10-50t9-48t8+40t7+36t6-16t5-12t4+4t2)*x2+(-9t24+12t23-4t22-42t20+28t19+30t18-20t17-54t16+16t15+48t14-16t12+8t11-18t10-26t9+30t8+20t7-24t6+4t5+28t4-8t3-16t2+4)*xy+(6t16-10t15-2t14+16t13+4t12-18t11-10t10+24t9+6t8-20t7+8t6+8t5-20t4-4t3+12t2+4t-4)*y2+(-9t28+3t27+8t26-4t25-45t24-6t23+42t22+30t21-94t20-40t19+68t18+82t17-38t16-60t15+26t14+36t13-22t12-20t11+4t10+4t9+12t8+8t7-8t6-8t5+4t4)*x+(9t27-21t26+16t25+14t24+12t23-61t22+27t21+80t20-19t19-100t18+26t17+96t16-24t15-84t14+44t12-2t11-18t10+2t9+40t8+4t7-32t6-12t5+4t3+12t2-4)*y+(9t27-12t26+4t25+36t23-18t22-28t21-2t20+54t19+14t18-52t17-44t16+24t15+40t14-4t13-12t12+4t11-4t10-4t9+4t8);
 f;
@@ -6810,5 +6810,5 @@
 poly f=t*(x7+y7+1)+1/t*(x4+y4+x2+y2+x3y+xy3)+1/t7*x2y2;
 list graph=tropicalCurve(f);
-graph; 
+graph;
 size(graph)-1;
 drawTropicalCurve(graph);
Index: Singular/LIB/tst.lib
===================================================================
--- Singular/LIB/tst.lib	(revision fba86f89b3458187b40c5f0d5f6408412d98d295)
+++ Singular/LIB/tst.lib	(revision 7d56875cf7720719f5b6acd193768a4d5b57848f)
@@ -1,7 +1,7 @@
-// $Id: tst.lib,v 1.33 2005-05-18 17:54:58 Singular Exp $
+// $Id: tst.lib,v 1.34 2008-10-09 09:31:58 Singular Exp $
 //(obachman, last modified 6/30/98)
 /////////////////////////////////////////////////////////////////////////////
 
-version="$Id: tst.lib,v 1.33 2005-05-18 17:54:58 Singular Exp $";
+version="$Id: tst.lib,v 1.34 2008-10-09 09:31:58 Singular Exp $";
 category="Utilities";
 info="
@@ -13,5 +13,5 @@
                                    prepending prefix \"// tst_ignore:\"
  tst_init()             writes some identification data to GetTstStatusFile()
- tst_status([any])      writes status info to to GetTstStatusFile()
+ tst_status([any])      writes status info to GetTstStatusFile()
  tst_InitTimer()        initialize tst-Timer
  tst_StopTimer()        stop Tst-Timer
@@ -48,5 +48,5 @@
 {
   "EXAMPLE"; echo = 2;
-  string s = tst_system("echo This is is an example of tst_system");
+  string s = tst_system("echo This is an example of tst_system");
   "The following is what the system call wrote to stdout: " + s;
 }
Index: Singular/LIB/zeroset.lib
===================================================================
--- Singular/LIB/zeroset.lib	(revision fba86f89b3458187b40c5f0d5f6408412d98d295)
+++ Singular/LIB/zeroset.lib	(revision 7d56875cf7720719f5b6acd193768a4d5b57848f)
@@ -1,5 +1,5 @@
 // Last change 12.02.2001 (Eric Westenberger)
 ///////////////////////////////////////////////////////////////////////////////
-version="$Id: zeroset.lib,v 1.17 2007-03-14 18:27:47 Singular Exp $";
+version="$Id: zeroset.lib,v 1.18 2008-10-09 09:31:58 Singular Exp $";
 category="Symbolic-numerical solving";
 info="
@@ -110,5 +110,5 @@
   list result = RootsMain(f);  // find roots of f
 
-  // store the roots and the the new representation of 'a' and transform
+  // store the roots and the new representation of 'a' and transform
   // the coefficients of f.
 
