Index: Singular/LIB/ellipticcovers.lib
===================================================================
--- Singular/LIB/ellipticcovers.lib	(revision ce45c3875a5144c82068f119b9783eeb7adcfcea)
+++ Singular/LIB/ellipticcovers.lib	(revision 30bd623ca1f0c0a63607b206e02914bcc6580c2b)
@@ -67,33 +67,32 @@
 
 
-proc mod_init()
-{
-newstruct("graph","list vertices, list edges");
-newstruct("Net","list rows");
-
-system("install","graph","print",printGraph,1);
-system("install","Net","print",printNet,1);
-system("install","Net","+",catNet,2);
-
-}
-
+static proc mod_init()
+{
+  newstruct("graph","list vertices, list edges");
+  newstruct("Net","list rows");
+
+  system("install","graph","print",printGraph,1);
+  system("install","Net","print",printNet,1);
+  system("install","Net","+",catNet,2);
+}
 
 static proc catNet(Net N, Net M)
 {
-list L;
-list LN=N.rows;
-list LM=M.rows;
-int widthN=size(LN[1]);
-int widthM=size(LM[1]);
-int nm=max(size(LN),size(LM));
-for (int j=1; j<=nm; j++)
-{
+  list L;
+  list LN=N.rows;
+  list LM=M.rows;
+  int widthN=size(LN[1]);
+  int widthM=size(LM[1]);
+  int nm=max(size(LN),size(LM));
+  for (int j=1; j<=nm; j++)
+  {
     if (j>size(LN)){LN[j]=emptyString(widthN);}
     if (j>size(LM)){LM[j]=emptyString(widthM);}
     L[j]=LN[j]+LM[j];
-}
-Net NM;
-NM.rows=L;
-return(NM);}
+  }
+  Net NM;
+  NM.rows=L;
+  return(NM);
+}
 
 
@@ -111,13 +110,15 @@
 static proc printNet(Net N)
 {
-list L = N.rows;
-for (int j=1; j<=size(L); j++)
-{
-   print(L[j]);
-}
-}
-
-static proc net(def M){
-  if (typeof(M)=="list"){
+  list L = N.rows;
+  for (int j=1; j<=size(L); j++)
+  {
+    print(L[j]);
+  }
+}
+
+static proc net(def M)
+{
+  if (typeof(M)=="list")
+  {
     return(netList(M));
   }
@@ -126,5 +127,6 @@
   L[1]=string(M);
   N.rows=L;
-return(N);}
+  return(N);
+}
 
 
@@ -147,6 +149,4 @@
   G;
 }
-
-
 
 proc makeGraph(list v, list e)
@@ -170,5 +170,4 @@
   G;
 }
-
 
 proc propagator(def xy, def d)
@@ -195,5 +194,6 @@
 "
 {
-  if ((typeof(xy)=="list")||(typeof(d)=="int")) {
+  if ((typeof(xy)=="list")||(typeof(d)=="int"))
+  {
     number x = xy[1];
     number y = xy[2];
@@ -201,14 +201,17 @@
     if (d==0) {return(x^2*y^2/(x^2-y^2)^2);}
     number p=0;
-    for (int j=1; j<=d; j++){
+    for (int j=1; j<=d; j++)
+    {
        if (d%j==0){p=p+(j*x^(4*j)+j*y^(4*j))/(x*y)^(2*j);}
     }
     return(p);
   }
-  if ((typeof(xy)=="graph")||(typeof(d)=="list"))  {
+  if ((typeof(xy)=="graph")||(typeof(d)=="list"))
+  {
     list xl = ringlist(basering)[1][2];
     list ed = xy.edges;
     number f=1;
-    for (int j=1; j<=size(ed); j++){
+    for (int j=1; j<=size(ed); j++)
+    {
        execute("number xx1 = "+xl[ed[j][1]]);
        execute("number xx2 = "+xl[ed[j][2]]);
@@ -219,7 +222,9 @@
     return(f);
   }
-  if ((typeof(xy)=="graph")||(typeof(d)=="int"))  {
-  }
-ERROR("wrong input type");}
+  if ((typeof(xy)=="graph")||(typeof(d)=="int"))
+  {
+  }
+  ERROR("wrong input type");
+}
 example
 { "EXAMPLE:"; echo=2;
@@ -230,8 +235,4 @@
   propagator(G,list(1,1,1,0,0,0));
 }
-
-
-
-
 
 proc computeConstant(number f,number xx)
@@ -240,5 +241,4 @@
 RETURN:  number, the constant coefficient of the Laurent series of f in the variable x.
 THEORY:  Computes the constant coefficient of the Laurent series by iterative differentiation.
-
 KEYWORDS: Laurent series
 EXAMPLE:  example computeConstant; shows an example
@@ -250,17 +250,21 @@
   int j;
   poly de;
-  while (tst==0){
-     ff=f*xx^k;
-     for (j=1; j<=k; j++){
-        ff=diff(ff,xx)/j;
-     }
-  de = subst(denominator(ff),xx,0);
-  if (de!=0){
-     poly nu = subst(numerator(ff),xx,0);
-     return(number(nu/de));
-  }
-  k=k+1;
-  }
-ERROR("error in computeConstant");}
+  while (tst==0)
+  {
+    ff=f*xx^k;
+    for (j=1; j<=k; j++)i
+    {
+      ff=diff(ff,xx)/j;
+    }
+    de = subst(denominator(ff),xx,0);
+    if (de!=0)
+    {
+      poly nu = subst(numerator(ff),xx,0);
+      return(number(nu/de));
+    }
+    k++;
+  }
+  ERROR("error in computeConstant");
+}
 example
 { "EXAMPLE:"; echo=2;
@@ -270,7 +274,4 @@
   computeConstant(P,x2);
 }
-
-
-
 
 proc evaluateIntegral(number P, list xL)
@@ -289,8 +290,10 @@
 {
   number p = P;
-  for(int j=1; j<=size(xL); j++){
+  for(int j=1; j<=size(xL); j++)
+  {
      p=computeConstant(p,xL[j]);
   }
-return(p);}
+  return(p);
+}
 example
 { "EXAMPLE:"; echo=2;
@@ -300,5 +303,4 @@
   evaluateIntegral(p,list(x1,x3,x4,x2));
 }
-
 
 proc permute (list N)
@@ -314,19 +316,25 @@
 "
 {
-   int i,j,k;
-   list L,L1;
-   if (size(N)==1){
-     return(list(N));
-   } else {
-     k=1;
-     for (i=1; i<=size(N); i++){
-       L=permute(delete(N,i));
-       for (j=1; j<=size(L); j++){
-          L1[k]=L[j]+list(N[i]);
-          k=k+1;
-       }
-     }
-   }
-return(L1);}
+  int i,j,k;
+  list L,L1;
+  if (size(N)==1)
+  {
+    return(list(N));
+  }
+  else
+  {
+    k=1;
+    for (i=1; i<=size(N); i++)
+    {
+      L=permute(delete(N,i));
+      for (j=1; j<=size(L); j++)
+      {
+        L1[k]=L[j]+list(N[i]);
+        k=k+1;
+      }
+    }
+  }
+  return(L1);
+}
 example
 { "EXAMPLE:"; echo=2;
@@ -349,17 +357,17 @@
 "
 {
-ring R = 2,(x(1..n)),dp;
-ideal I = maxideal(a);
-list L;
-for (int j=1;j<=size(I);j++){
-  L[j]=leadexp(I[j]);
-}
-return(L);}
+  ring R = 2,(x(1..n)),dp;
+  ideal I = maxideal(a);
+  list L;
+  for (int j=1;j<=size(I);j++)i
+  {
+    L[j]=leadexp(I[j]);
+  }
+  return(L);
+}
 example
 { "EXAMPLE:"; echo=2;
   partitions(3,7);
 }
-
-
 
 proc gromovWitten(def P,list #)
@@ -385,35 +393,43 @@
 "
 {
-  if (typeof(P)=="number") {
-  list xl = ringlist(basering)[1][2];
-  int j;
-  for(j=1; j<=size(xl); j++){
-     execute("number n= "+xl[j]);
-     xl[j]=n;
-     kill n;
-  }
-  list pxl = permute(xl);
-  number p = 0;
-  for(j=1; j<=size(pxl); j++){
-     p=p+evaluateIntegral(P,pxl[j]);
-  }
-  return(p);
-  }
-  if (typeof(P)=="graph"){
-     if (size(#)>1){
-       return(gromovWitten(propagator(P,#)));
-     } else {
+  if (typeof(P)=="number")
+  {
+    list xl = ringlist(basering)[1][2];
+    int j;
+    for(j=1; j<=size(xl); j++)
+    {
+      execute("number n= "+xl[j]);
+      xl[j]=n;
+      kill n;
+    }
+    list pxl = permute(xl);
+    number p = 0;
+    for(j=1; j<=size(pxl); j++)
+    {
+      p=p+evaluateIntegral(P,pxl[j]);
+    }
+    return(p);
+  }
+  if (typeof(P)=="graph")
+  {
+    if (size(#)>1)
+    {
+      return(gromovWitten(propagator(P,#)));
+    }
+    else
+    {
       int d =#[1];
       list pa = partitions(size(P.edges),d);
       list re;
       int ti;
-      for (int j=1; j<=size(pa); j++) {
-       ti=timer;
-       re[j]=gromovWitten(propagator(P,pa[j]));
-       ti=timer-ti;
-       //print(string(j)+" / "+string(size(pa))+"    "+string(pa[j])+"     "+string(re[j])+"      "+string(sum(re))+"     "+string(ti));
+      for (int j=1; j<=size(pa); j++)
+      {
+        ti=timer;
+        re[j]=gromovWitten(propagator(P,pa[j]));
+        ti=timer-ti;
+        //print(string(j)+" / "+string(size(pa))+"    "+string(pa[j])+"     "+string(re[j])+"      "+string(sum(re))+"     "+string(ti));
       }
-     return(lsum(re));
-     }
+      return(lsum(re));
+    }
   }
 }
@@ -427,6 +443,4 @@
   gromovWitten(G,2);
 }
-
-
 
 proc computeGromovWitten(graph P,int d, int st, int en, list #)
@@ -443,23 +457,27 @@
 "
 {
-     number s =0;
-     list pararg;
-     list re;
-     list pa = partitions(size(P.edges),d);
-     int vb=0;
-     if (size(#)>0){vb=#[1];}
-     int ti;
-     if (vb>0){print(size(pa));}
-     for (int j=1; j<=size(pa); j++) {
-      if ((j>=st)&(j<=en)){
-       ti=timer;
-       //pararg[j]=list(propagator(G,pa[j]));
-       re[j]=gromovWitten(propagator(P,pa[j]));
-       ti=timer-ti;
-       if (vb>0){print(string(j)+" / "+string(size(pa))+"    "+string(pa[j])+"     "+string(re[j])+"      "+string(lsum(re))+"     "+string(ti));}
-      } else {re[j]=s;}
-     }
-     //list re = parallelWaitAll("gromovWitten", pararg, list(list(list(2))));
-     return(re);
+  number s =0;
+  list pararg;
+  list re;
+  list pa = partitions(size(P.edges),d);
+  int vb=0;
+  if (size(#)>0){vb=#[1];}
+  int ti;
+  if (vb>0){print(size(pa));}
+  for (int j=1; j<=size(pa); j++)
+  {
+    if ((j>=st)&(j<=en))
+    {
+      ti=timer;
+      //pararg[j]=list(propagator(G,pa[j]));
+      re[j]=gromovWitten(propagator(P,pa[j]));
+      ti=timer-ti;
+      if (vb>0){print(string(j)+" / "+string(size(pa))+"    "+string(pa[j])+"     "+string(re[j])+"      "+string(lsum(re))+"     "+string(ti));}
+    }
+    else 
+    {re[j]=s;}
+  }
+  //list re = parallelWaitAll("gromovWitten", pararg, list(list(list(2))));
+  return(re);
 }
 example
@@ -471,5 +489,4 @@
   computeGromovWitten(G,2,3,7,1);
 }
-
 
 proc lsum(list L)
@@ -485,8 +502,10 @@
 {
   execute(typeof(L[1])+" s");
-  for(int j=1; j<=size(L); j++){
-     s=s+L[j];
-  }
-return(s);}
+  for(int j=1; j<=size(L); j++)
+  {
+    s=s+L[j];
+  }
+  return(s);
+}
 example
 { "EXAMPLE:"; echo=2;
@@ -494,6 +513,4 @@
   lsum(L);
 }
-
-
 
 proc generatingFunction(graph G, int d)
@@ -512,12 +529,15 @@
   int j,jj;
   list pa,L;
-  for (j=1; j<=d; j++){
+  for (j=1; j<=d; j++)
+  {
     pa = partitions(size(G.edges),j);
     L = computeGromovWitten(G,j,1,size(pa));
-    for (jj=1; jj<=size(pa); jj++) {
-       s=s+L[jj]*monomial(pa[jj]);
-    }
-  }
-return(s);}
+    for (jj=1; jj<=size(pa); jj++)
+    {
+      s=s+L[jj]*monomial(pa[jj]);
+    }
+  }
+  return(s);
+}
 example
 { "EXAMPLE:"; echo=2;
