Index: Tst/.singular_hist
===================================================================
--- Tst/.singular_hist	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/.singular_hist	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,61 @@
+proc msetring(int ch, int nvars, string ordering)
+{
+  execute "ring r = " + string(ch) + ",x(1.." + string(nvars) + "), " +
+  ordering + ";"; 
+}
+msetring(0,2,"dp");
+;
+proc msetring(int ch, int nv, string ordering)
+{
+  execute "ring r = " + string(ch) + ",x(1.." + string(nv) + "), " +
+  ordering + ";"; 
+}
+msetring(0,2,"dp");
+basering;
+proc msetring(int ch, int nv, string ordering)
+{
+  execute "ring r = " + string(ch) + ",x(1.." + string(nv) + "), " +
+  ordering + ";"; 
+  keepring r;
+}
+msetring(0,2,"dp");
+basering;
+<"~/tst/std_l.tst";
+q
+;
+$
+;
+basering;
+gcyclic(3,"r");
+gcyclic(3,"r");
+gcyclic(3,"r");
+gcyclic(3,"r");
+gcyclic(3,"r");
+gcyclic(3,"h");
+gcyclic(3,"h");
+gcyclic(3,"h");
+gcyclic(3,"h");
+gcyclic(3,"h");
+$
+;
+$
+;
+$
+$
+;
+$
+$
+$
+;
+help option;
+$
+def i = 3;
+typeof(i);
+$
+option();
+$
+option();
+$
+system("whoami");
+$
+$
Index: Tst/Long/classify_l.tst
===================================================================
--- Tst/Long/classify_l.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Long/classify_l.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,167 @@
+LIB "tst.lib";
+LIB "classify.lib";
+
+tst_init();
+tst_ignore("CVS: $Id: classify_l.tst,v 1.1.1.1 1998-04-17 15:07:36 obachman Exp $");
+
+
+"======================================================================";
+"// running tetst for corank<=2";
+ring r=0,(x,y),ds;
+poly f;
+map phi=r,y-x^2,x+y;
+
+  f=x^4+y2; // A[3]
+  classify(phi(f));
+
+"======================================================================";
+"// Step 3";
+  f=x2y+y3; // D[6]
+  classify(phi(f)); // D[6] // D[4]
+
+  f=x2y+y5; // D[6]
+  classify(phi(f));
+
+"======================================================================";
+"// Step 6-12";
+  f=x3+xy7+y10; // E[18]
+  classify(phi(f));
+
+  f=x3+xy5+y8; // E[13]
+  classify(phi(f));
+
+  f=x3+xy10+y14; // E[26]
+  classify(phi(f));
+
+  f=x3+x2y3+xy7+y9; // J[3,0]
+  classify(phi(f));
+
+  f=x3+x2y2+y11; // J[2,5]
+  classify(phi(f));
+
+"======================================================================";
+"// Step 13";
+  f=x4+x3y+x2y2+xy3; // X[1,0]
+  classify(f);
+
+  f=x4+y4; // T[4,4,2]
+  classify(phi(f));
+
+  f=x4+x3y+x2y2+y6; // X[1,2]
+  classify(phi(f));
+
+//f=x4+2x3y+x2y2+2x2y4+2xy5+y6+y8; // Y[1,2,2]
+"// The next step returns an error message. Y[1,p,q] cannot be recognized";
+  f=x4+2x3y+x2y2+x2y4+x2y7+2xy8+y9+y11; // Y[1,5,2]
+  classify(phi(f));
+
+"======================================================================";
+"// Step 17-24";
+  f=x3y+xy6+y8; // Z[17]
+  classify(phi(f));
+
+  f=x3y+xy8+y12; // Z[24]
+  classify(phi(f));
+
+  f=x3y+xy7+y9; // Z[19]
+  classify(phi(f));
+
+  f=x3y+x2y5+xy10+y13; // Z[3,0]
+  classify(phi(f));
+
+  f=x3y+x2y9+y29; // Z[7,4]
+  classify(phi(f));
+
+"======================================================================";
+"// Step 25-";
+f=x4+x2y3+xy4+y5; // W[24], step 27
+classify(phi(f));
+
+f=x4+x2y5+xy7+y10; // W[25], step 28
+classify(phi(f));
+
+f=x4+x2y7+xy11+y14; // W[3,0], step 30
+classify(phi(f));
+
+f=x4+x3y5+x2y9+y26; // W[4,8], step 31
+classify(f);
+
+f=x4+2x2y5+x2y7+y10+xy10; // W#[2,4], step 32
+classify(phi(f));
+
+f=x4+2x2y6+x2y7+y11+xy8; // W[29], step 34
+classify(phi(f));
+
+f=x4+x2y8+xy12+y15; // W[42], step 35
+classify(phi(f));
+
+f=x4+x3y2+x2y4+xy6; // X[2,0], step 37
+classify(phi(f));
+
+f=x4+x3y4+x2y8+y18; // X[4,2], step 38
+classify(phi(f));
+
+f=x4+2x3y4+x2y8+x2y10+x2y13+2xy14+y18+y23; // Y[4,2,5], step 39
+classify(phi(f));
+
+f=x4+x3y2+x2y7+xy9+xy10+y12; // Z[2,29], step 42, k=2, i=1
+phi=r,y-x,y+x;
+classify(f);
+
+f=x4+x3y2+x2y9+xy11+xy14+y16; // Z[2,36], step 43, k=2, i=2
+classify(f);
+
+f=(x+3y3)*(x3+xy18+y26); // Z[3,67], step 44, 	k=3, i=5
+classify(f);
+
+f=(x+3y4)*(x3+x2y6+xy13+y18);  // Z[4,2,0], step 45, k=4, i=2
+classify(f);
+
+f=x4+x3y2+x2y7+x2y11+xy13+y18; // Z[2,3,1], step 46, k=2, i=3, p=1
+classify(phi(f));
+
+
+kill r;
+
+////////////////////////////////////////////////////////////////////////////////
+// Corang 3
+//
+"======================================================================";
+"// running tetst for corank=3";
+ring r=0,(x,y,z),ds;
+poly f;
+map phi=r,y-x^2,x+y,y-z;
+
+//f= ; // T[3,3,3], step 51
+//f= ; // T[3,3,], step 53
+//f= ; // T[3,,], step 55
+//f= ; // T[,,], step 57
+
+//f= ; // Q[], step 60
+//f= ; // Q[], step 61
+//f= ; // Q[], step 62
+//f= ; // Q[,0], step 64
+//f= ; // Q[,], step 65
+
+"======================================================================";
+"// steps 62-81 are not implemented => not tests";
+
+//f= ; // U[], step 84
+//f= ; // U[,0], step 86
+//f= ; // U[,], step 87
+//f= ; // U[], step 89
+
+"======================================================================";
+"// steps 91-96, fix bug in algorythme before implementation";
+
+//f= ; // V[1,0], step 99
+//f= ; // V[1,], step 100
+//f= ; // V#[1,0], step 101
+//f= ; // V#[1,], step 102
+
+//classify(f);
+
+"======================================================================";
+"// reomving database.";
+int i=system("sh", "/bin/rm -f NFlist.dir NFlist.pag");
+quit;
Index: Tst/Long/fetch_l.tst
===================================================================
--- Tst/Long/fetch_l.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Long/fetch_l.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,132 @@
+proc generate_ring_str(int n, string r_name, string ostring)
+{
+  return ("ring "+r_name+" = 32003,x(1.." + string(n) + ")," + ostring + ";");
+}
+
+proc generate_polys_str(int n)
+{
+  string polystr = "poly p = ";
+  int i;
+
+  for (i=1; i<=n; i = i + (i / 10) + 1)
+  {
+    polystr = polystr + "x(" + string(i) + ") + ";
+  }
+  return (polystr + "1; poly p1 = p^2+p; vector p2 = (p^2+p)*(gen(2) + gen(3)); vector p3 = (p^2+p)*(gen(2) + gen(3))+ p^2 + p; vector p4 = p3 + p^3;p; p1; p2; p3; p4");
+}
+
+proc generate_weight_str(int j)
+{
+  int i;
+  string res_str = "(";
+  
+  for (i=1; i<j; i++)
+  {
+    res_str = res_str + string(i) + ",";
+  }
+  return (res_str + string(j) + ")");
+}
+
+
+list orderings = "lp", "dp", "Dp", "ls", "ds", "Ds";
+
+list l = "dp";
+
+proc extend_orderings(list olist, int j)
+{
+  int i;
+  int c1;
+  int c2;
+  string o1;
+  string o2;
+  string o3;
+  list nl;
+  string weight_string = generate_weight_str(j);
+  o1 = olist[1];
+  if (size(olist) > 1)
+  {
+    o2 = olist[2];
+    if (size(olist) > 2)
+    {
+      o3 = olist[3];
+    }
+    else
+    {
+      o3 = olist[2];
+    }
+  }
+  else
+  {
+    o2 = o1;
+    o3 = o1;
+  }
+      
+  // add weight orderings 
+  olist = olist + list("Wp" + weight_string, "wp" + weight_string);
+
+    
+  for (i=1; i<=size(olist); i++)
+  {
+    nl = nl + list(olist[i], "(C," + olist[i] + ")", "(c," + olist[i] + ")",
+                   "(" + olist[i] + ",C)", "(" + olist[i] + ",c)");
+  }
+
+  // add product orderings
+  if (j > 1)
+  {
+    c1 = j / 2;
+    if (c1 + c1 == j)
+    {
+      c2 = c1;
+    }
+    else
+    {
+      c2 = c1 + 1;
+    }
+    nl = nl + list("(" + o1 + "(" + string(c1) + "),"+ o2 + "(" + string(c2) + "))", "(" + o1 + "(" + string(c1) + "),"+ o3 + "(" + string(c2) + "))");
+    // and, extra weight vector
+    nl = nl + list("(a" + weight_string + "," + o2 + "(" + string(c1) + "),"+ o3 + "(" + string(c2) + "))", "(a" + generate_weight_str(j-1)+ "," + o3 + "(" + string(c1) + "),"+ o1 + "(" + string(c2) + "))");
+  }
+
+  // and, last but not least, a Matrix ordering
+  nl = nl + list("M(m)");
+  
+  return (nl);
+
+}
+    
+proc check_fetch(int n, list olist)
+{
+  int i;
+  int j;
+  list e_olist;
+  
+  for (j=1; j<=n; j = j + (j / 10) + 1)
+  {
+    e_olist = extend_orderings(olist, j);
+    execute generate_ring_str(j, "r", e_olist[1]);
+    execute generate_polys_str(j);
+    intmat m[j][j];
+    m = m + 1;
+    for (i=1; i<=size(e_olist); i++)
+    {
+      execute generate_ring_str(j, "r1", e_olist[i]);
+      fetch(r, p);
+      fetch(r, p1);
+      fetch(r, p2);
+      fetch(r, p3);
+      fetch(r, p4);
+      r1;
+      kill r1;
+    }
+    kill r;
+    kill m;
+  }
+}
+
+check_fetch(15, orderings);
+
+quit;
+  
+  
+
Index: Tst/Long/fglm1_l.tst
===================================================================
--- Tst/Long/fglm1_l.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Long/fglm1_l.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,34 @@
+// $Id: fglm1_l.tst,v 1.1.1.1 1998-04-17 15:07:39 obachman Exp $
+
+//
+// fglm_s.tst - long tests for fglm 
+//              fglm: cassou-mod1, lamm1 in char 0
+//
+
+
+LIB "tst.lib";
+tst_init();
+tst_ignore("CVS: $Id: fglm1_l.tst,v 1.1.1.1 1998-04-17 15:07:39 obachman Exp $");
+
+option(redSB);
+
+// =========================
+// cassou-mod1 in char 0
+ring r=0,(a,b,c,d), dp;
+ideal i= 15a4bc2+6a4b3+21a4b2c-144a2b-8a2b2d-28a2bcd-648a2c+36c2d+9a4c3-120, 30b3a4c-32cd2b-720ca2b-24b3a2d-432b2a2+576db-576cd+16ba2c2d+16c2d2+16d2b2+9b4a4+5184+39c2a4b2+18c3a4b-432c2a2+24c3a2d-16b2a2cd-240b, 216ca2b-162c2a2-81b2a2+5184+1008db-1008cd+15b2a2cd-15b3a2d-80cd2b+40c2d2+40d2b2, 261+4ca2b-3c2a2-4b2a2+22db-22cd;
+ideal is=std(i);
+ring s=0,(a,b,c,d), lp;
+fglm(r,is);
+kill r,s;
+
+// =============================================
+// lamm in char 0, with permutation of variables
+ring r=0,(x,y), dp;
+ideal i=45x8+3x7+39x6+30x5+13x4+41x3+5x2+46x+7, 49x7y+35xy7+37xy6+9y7+4x6+6y6+27x3y2+20xy4+31x4+33x2y+24x2+49y+43;
+ideal is=std(i);
+ring s=0,(y,x), lp;
+fglm(r,is);
+kill r,s;
+
+quit;
+
Index: Tst/Long/gcdp_l.tst
===================================================================
--- Tst/Long/gcdp_l.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Long/gcdp_l.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,102 @@
+// $Id: gcdp_l.tst,v 1.1.1.1 1998-04-17 15:07:35 obachman Exp $
+
+//
+// gcdp_l.tst - long tests for gcd calculations mod p.
+//
+// To Do: gcd calculations over transcendental extensions of
+// finite fields.
+//
+
+LIB "tst.lib";
+tst_init();
+tst_ignore("CVS ID  : $Id: gcdp_l.tst,v 1.1.1.1 1998-04-17 15:07:35 obachman Exp $");
+
+//
+// - ring r1=32003,x,dp.
+//
+
+ring r1=32003,x,dp;
+
+poly f;
+poly g;
+
+f=3812*x^22-6874*x^21+12586*x^20+3003*x^19-9568*x^18+11117*x^17+7524*x^16+11138*x^15-9743*x^14+1892*x^13+12485*x^12-569*x^11-8265*x^10-5991*x^9+13701*x^8+2644*x^7-3936*x^6-15875*x^5+1289*x^4+3956*x^3-10099*x^2-6616*x+5401;
+
+g=10652*x^20-4144*x^19-11810*x^18+8237*x^17-8675*x^16+6545*x^15-3601*x^14+14559*x^13+8090*x^12-8378*x^11+14255*x^10+8767*x^9-13932*x^8+11602*x^7-10751*x^6-4899*x^5+8637*x^4+14084*x^3-11583*x^2+5882*x+885;
+
+gcd(f,g);
+
+f=-7448*x^36+7714*x^35-13927*x^34+3932*x^33+3682*x^32-10010*x^31+5268*x^30+13873*x^29+13357*x^28-833*x^27-184*x^26+15676*x^25+13250*x^24-1501*x^23+4047*x^22-12971*x^21+1837*x^20-95*x^19+13420*x^18+6133*x^17+1202*x^16-10228*x^15+15007*x^14-5205*x^13+5458*x^12+11076*x^11-488*x^10-9898*x^9+7409*x^8+13329*x^7-11898*x^6-7619*x^5-8536*x^4+12785*x^3+11896*x^2-12853*x+2549;
+
+g=5104*x^34-12263*x^33-1609*x^32-6796*x^31-2994*x^30+7028*x^29-3014*x^28-1266*x^27-12321*x^26+14482*x^25+3663*x^24-3726*x^23+6983*x^22+1260*x^21-4850*x^20-2975*x^19+11044*x^18-14330*x^17-6739*x^16-11849*x^15+1213*x^14+3785*x^13+4837*x^12-11046*x^11+13804*x^10+8188*x^9+8122*x^8+10487*x^7+6814*x^6+9533*x^5-11550*x^4-10878*x^3-699*x^2-14751*x+3845;
+
+gcd(f,g);
+
+f=-11183*x^46+8215*x^45-14295*x^44+8289*x^43-7550*x^42+12650*x^41+10826*x^40-2442*x^39+6380*x^38-1209*x^37+1942*x^36+2715*x^35+15876*x^34+15415*x^33+6777*x^32-12712*x^31+12435*x^30-3063*x^29+10219*x^28-11110*x^27+7832*x^26-5236*x^25-12353*x^24+5050*x^23-1811*x^22+6642*x^21-3090*x^20-7071*x^19-12500*x^18+12953*x^17-10539*x^16+12938*x^15+8080*x^14+8451*x^13-9123*x^12-4021*x^11+4501*x^10-4506*x^9-407*x^8+12356*x^7-2074*x^6+690*x^5-14676*x^4-15971*x^3-1813*x^2+7707*x+1079;
+
+g=183*x^45+5561*x^44-1043*x^43+12612*x^42+1596*x^41-9268*x^40+4858*x^39-13517*x^38+14465*x^37-12452*x^36-15117*x^35-5775*x^34-8520*x^33-13105*x^32-12192*x^31-4843*x^30-5194*x^29-2000*x^28+13734*x^27-4211*x^26+6154*x^25+3930*x^24+11156*x^23+5575*x^22+12497*x^21+3708*x^20-13561*x^19+6457*x^18+7867*x^17+11794*x^16-13102*x^15+3546*x^14+11013*x^13+6443*x^12+9411*x^11-5881*x^10-11560*x^9+13919*x^8-2613*x^7+10716*x^6+10107*x^5-7507*x^4-14638*x^3-9884*x^2-4890*x-2671;
+
+gcd(f,g);
+
+f=2229*x^56+11515*x^55+5449*x^54-2102*x^53+10553*x^52+4459*x^51 -10713*x^50-10483*x^49+12815*x^48+1371*x^47+13136*x^46+13474*x^45 +15930*x^44-3951*x^43+3632*x^42+5483*x^41+15429*x^40+11158*x^39 +11618*x^38-11397*x^37+373*x^36+12655*x^35-14103*x^34-9976*x^33 -4906*x^32+10959*x^31-6889*x^30-4713*x^29-9677*x^28-12594*x^27 +6918*x^26-12226*x^25+3225*x^24+9437*x^23-9869*x^22-10191*x^21 -2477*x^20+11187*x^19+5746*x^18-15428*x^17+4405*x^16-1631*x^15 -13687*x^14-6654*x^13+8104*x^12+12147*x^11-4629*x^10+5415*x^9 +5461*x^8+14494*x^7-2563*x^6+9079*x^5+12571*x^4-3643*x^3-10904*x^2 -7490*x-6782;
+
+g=2877*x^61-351*x^60-12672*x^59-7991*x^58-2499*x^57-9709*x^56 +1219*x^55+5355*x^54-13710*x^53+3347*x^52-12542*x^51+12524*x^50 +8280*x^49+15488*x^48+13565*x^47+14659*x^46+9784*x^45+3738*x^44 +13042*x^43-2627*x^42-15378*x^41+7650*x^40-827*x^39-7590*x^38 +2687*x^37+15016*x^36+12855*x^35-8645*x^34+3930*x^33+1837*x^32 +335*x^31-11981*x^30-4414*x^29-7074*x^28+2715*x^27+3314*x^26-44*x^25 +8932*x^24+15583*x^23-2036*x^22-9074*x^21+9396*x^20+13732*x^19 -6178*x^18+2091*x^17+14186*x^16-7830*x^15+12864*x^14-583*x^13 -3809*x^12-5495*x^11+15730*x^10-9216*x^9+15330*x^8-12277*x^7-2666*x^6 -786*x^5-11567*x^4-6166*x^3-3486*x^2-3245*x-3393;
+
+gcd(f,g);
+
+//
+// - ring r2=(32003,a),x,dp.
+//
+
+ring r2=(32003,a),x,dp;
+minpoly=a^4+8734*a^3+a^2+11817*a+1;
+
+poly f;
+poly g;
+
+// first, some of the above examples
+
+f=3812*x^22-6874*x^21+12586*x^20+3003*x^19-9568*x^18+11117*x^17+7524*x^16+11138*x^15-9743*x^14+1892*x^13+12485*x^12-569*x^11-8265*x^10-5991*x^9+13701*x^8+2644*x^7-3936*x^6-15875*x^5+1289*x^4+3956*x^3-10099*x^2-6616*x+5401;
+
+g=10652*x^20-4144*x^19-11810*x^18+8237*x^17-8675*x^16+6545*x^15-3601*x^14+14559*x^13+8090*x^12-8378*x^11+14255*x^10+8767*x^9-13932*x^8+11602*x^7-10751*x^6-4899*x^5+8637*x^4+14084*x^3-11583*x^2+5882*x+885;
+
+gcd(f,g);
+
+f=-7448*x^36+7714*x^35-13927*x^34+3932*x^33+3682*x^32-10010*x^31+5268*x^30+13873*x^29+13357*x^28-833*x^27-184*x^26+15676*x^25+13250*x^24-1501*x^23+4047*x^22-12971*x^21+1837*x^20-95*x^19+13420*x^18+6133*x^17+1202*x^16-10228*x^15+15007*x^14-5205*x^13+5458*x^12+11076*x^11-488*x^10-9898*x^9+7409*x^8+13329*x^7-11898*x^6-7619*x^5-8536*x^4+12785*x^3+11896*x^2-12853*x+2549;
+
+g=5104*x^34-12263*x^33-1609*x^32-6796*x^31-2994*x^30+7028*x^29-3014*x^28-1266*x^27-12321*x^26+14482*x^25+3663*x^24-3726*x^23+6983*x^22+1260*x^21-4850*x^20-2975*x^19+11044*x^18-14330*x^17-6739*x^16-11849*x^15+1213*x^14+3785*x^13+4837*x^12-11046*x^11+13804*x^10+8188*x^9+8122*x^8+10487*x^7+6814*x^6+9533*x^5-11550*x^4-10878*x^3-699*x^2-14751*x+3845;
+
+gcd(f,g);
+
+// now, examples involving the algebraic variable
+f=(4338*a^3*x^22+30273*a^2*x^22+23626*a*x^22+28673*x^22+2688*a^3*x^21+18069*a^2*x^21+615*a*x^21+11551*x^21+23638*a^3*x^20+20268*a^2*x^20+20021*a*x^20+6060*x^20+15921*a^3*x^19+10779*a^2*x^19+5367*a*x^19+13257*x^19+23678*a^3*x^18+21957*a^2*x^18+22070*a*x^18+13372*x^18+22158*a^3*x^17+22426*a^2*x^17+27501*a*x^17+8746*x^17+13959*a^3*x^16+6774*a^2*x^16+2671*a*x^16+7421*x^16+14110*a^3*x^15+28074*a^2*x^15+31056*a*x^15+9720*x^15+25856*a^3*x^14+27097*a^2*x^14+11589*a*x^14+9779*x^14+28980*a^3*x^13+31376*a^2*x^13+24496*a*x^13+2505*x^13+5276*a^3*x^12+643*a^2*x^12+25052*a*x^12+2373*x^12+5591*a^3*x^11+20901*a^2*x^11+25344*a*x^11+28303*x^11+10490*a^3*x^10+11510*a^2*x^10+30069*a*x^10+26527*x^10+23272*a^3*x^9+6872*a^2*x^9+20576*a*x^9+26446*x^9+20162*a^3*x^8+6455*a^2*x^8+13121*a*x^8+3588*x^8+6763*a^3*x^7+9099*a^2*x^7+13479*a*x^7+31228*x^7+12100*a^3*x^6+8734*a^2*x^6+17132*a*x^6+11923*x^6);
+
+g=(21796*a^3*x^21+23013*a^2*x^21+19320*a*x^21+16794*x^21+15777*a^3*x^20+10745*a^2*x^20+18575*a*x^20+14270*x^20+21816*a^3*x^19+8096*a^2*x^19+22632*a*x^19+2859*x^19+11970*a^3*x^18+13157*a^2*x^18+21826*a*x^18+17544*x^18+22237*a^3*x^17+23414*a^2*x^17+28069*a*x^17+21121*x^17+20441*a^3*x^16+23414*a^2*x^16+17132*a*x^16+19928*x^16+4814*a^3*x^15+31789*a^2*x^15+26593*a*x^15+20904*x^15+2605*a^3*x^14+24991*a^2*x^14+19457*a*x^14+27354*x^14+7054*a^3*x^13+13551*a^2*x^13+8720*a*x^13+11331*x^13+20837*a^3*x^12+25525*a^2*x^12+12680*a*x^12+23860*x^12+17788*a^3*x^11+16365*a^2*x^11+20606*a*x^11+8950*x^11+5879*a^3*x^10+11444*a^2*x^10+8086*a*x^10+28735*x^10+10518*a^3*x^9+21493*a^2*x^9+13526*a*x^9+5403*x^9+4629*a^3*x^8+26419*a^2*x^8+2255*a*x^8+29703*x^8+21943*a^3*x^7+22203*a^2*x^7+10505*a*x^7+31699*x^7+25572*a^3*x^6+1423*a^2*x^6+25883*a*x^6+11415*x^6);
+
+gcd(f,g);
+
+f=(30402*a^2*x^11+18403*a^3*x^10+1601*a*x^10+7960*a^3*x^9+5100*a^2*x^9+12917*a*x^9+23503*x^9+19710*a^3*x^8+19683*a^2*x^8+5001*a*x^8+13321*x^8+8701*a^3*x^7+4852*a^2*x^7+7827*a*x^7+19791*x^7+31927*a^3*x^6+5410*a^2*x^6+5467*a*x^6+16037*x^6+17185*a^3*x^5+8307*a^2*x^5+19811*a*x^5+10473*x^5+19945*a^3*x^4+21657*a^2*x^4+10273*a*x^4+23983*x^4);
+
+g=(21403*a^3*x^22+7448*a^2*x^22+10810*a*x^22+21081*x^22+704*a^3*x^21+5272*a^2*x^21+17829*a*x^21+16706*x^21+10892*a^3*x^20+1510*a^2*x^20+15586*a*x^20+2137*x^20+11244*a^3*x^19+10003*a^2*x^19+3058*a*x^19+19748*x^19+12837*a^3*x^18+8949*a^2*x^18+2293*a*x^18+23488*x^18+29674*a^3*x^17+3512*a^2*x^17+18761*a*x^17+23333*x^17+22922*a^3*x^16+25227*a^2*x^16+12018*a*x^16+16378*x^16+8276*a^3*x^15+11474*a^2*x^15+976*a*x^15+5711*x^15+28827*a^3*x^14+562*a^2*x^14+14734*a*x^14+1896*x^14+21302*a^3*x^13+5155*a^2*x^13+10181*a*x^13+11503*x^13+10353*a^3*x^12+8770*a^2*x^12+16539*a*x^12+21667*x^12+4499*a^3*x^11+28026*a^2*x^11+3189*a*x^11+6258*x^11+27740*a^3*x^10+29513*a^2*x^10+19135*a*x^10+31028*x^10+10383*a^3*x^9+1093*a^2*x^9+10434*a*x^9+9615*x^9+8069*a^3*x^8+8198*a^2*x^8+24314*a*x^8+31073*x^8+2167*a^3*x^7+4389*a^2*x^7+3275*a*x^7+31051*x^7+12541*a^3*x^6+19566*a^2*x^6+2389*a*x^6+25016*x^6);
+
+gcd(f,g);
+
+f=(6932*a^3*x^30+8805*a^2*x^30+5025*a*x^30+10521*x^30+13279*a^3*x^29+23946*a^2*x^29+27819*a*x^29+10032*x^29+2815*a^3*x^28+8075*a^2*x^28+10956*a*x^28+6853*x^28+14883*a^3*x^27+24295*a^2*x^27+2927*a*x^27+4389*x^27+23314*a^3*x^26+16933*a^2*x^26+10692*a*x^26+26362*x^26+9650*a^3*x^25+25794*a^2*x^25+31656*a*x^25+5294*x^25+4194*a^3*x^24+22900*a^2*x^24+219*a*x^24+7145*x^24+30606*a^3*x^23+1584*a^2*x^23+20182*a*x^23+19601*x^23+2310*a^3*x^22+16413*a^2*x^22+22745*a*x^22+23328*x^22+6311*a^3*x^21+16014*a^2*x^21+29004*a*x^21+3675*x^21+22006*a^3*x^20+19717*a^2*x^20+31090*a*x^20+15989*x^20+27117*a^3*x^19+29878*a^2*x^19+29895*a*x^19+10204*x^19+3117*a^3*x^18+1944*a^2*x^18+29310*a*x^18+10935*x^18+10617*a^3*x^17+16150*a^2*x^17+13962*a*x^17+29419*x^17+16368*a^3*x^16+27265*a^2*x^16+11482*a*x^16+2769*x^16+26177*a^3*x^15+19647*a^2*x^15+19994*a*x^15+5812*x^15+21191*a^3*x^14+2344*a^2*x^14+8122*a*x^14+18768*x^14+31816*a^3*x^13+22070*a^2*x^13+21686*a*x^13+9954*x^13+5285*a^3*x^12+28355*a^2*x^12+21554*a*x^12+15017*x^12+20844*a^3*x^11+22880*a^2*x^11+29139*a*x^11+10198*x^11+22187*a^3*x^10+1845*a^2*x^10+124*a*x^10+20875*x^10+23655*a^3*x^9+27689*a^2*x^9+462*a*x^9+9921*x^9+27553*a^3*x^8+4227*a^2*x^8+14891*a*x^8+28692*x^8+15422*a^3*x^7+18364*a^2*x^7+6643*a*x^7+9238*x^7);
+
+g=(10159*a^3*x^31+16131*a^2*x^31+13528*a*x^31+23305*x^31+16104*a^3*x^30+31322*a^2*x^30+15822*a*x^30+15332*x^30+6117*a^3*x^29+22754*a^2*x^29+22263*a*x^29+15247*x^29+21262*a^3*x^28+21290*a^2*x^28+22581*a*x^28+19917*x^28+11941*a^3*x^27+14500*a^2*x^27+752*a*x^27+22628*x^27+20010*a^3*x^26+2870*a^2*x^26+4997*a*x^26+31196*x^26+435*a^3*x^25+10675*a^2*x^25+19556*a*x^25+8954*x^25+6160*a^3*x^24+8179*a^2*x^24+13464*a*x^24+5133*x^24+10300*a^3*x^23+16922*a^2*x^23+10977*a*x^23+8282*x^23+26357*a^3*x^22+29916*a^2*x^22+6574*a*x^22+27270*x^22+2454*a^3*x^21+18575*a^2*x^21+14149*a*x^21+19814*x^21+5816*a^3*x^20+25575*a^2*x^20+6813*a*x^20+7745*x^20+25535*a^3*x^19+29450*a^2*x^19+8899*a*x^19+29544*x^19+26603*a^3*x^18+8490*a^2*x^18+28259*a*x^18+19936*x^18+28599*a^3*x^17+9111*a^2*x^17+1453*a*x^17+29481*x^17+18730*a^3*x^16+6899*a^2*x^16+28194*a*x^16+23953*x^16+31494*a^3*x^15+2138*a^2*x^15+15148*a*x^15+22737*x^15+25852*a^3*x^14+10731*a^2*x^14+16293*a*x^14+13075*x^14+15602*a^3*x^13+11381*a^2*x^13+28493*a*x^13+27161*x^13+7432*a^3*x^12+20270*a^2*x^12+13437*a*x^12+313*x^12+12468*a^3*x^11+29981*a^2*x^11+28662*a*x^11+24642*x^11+11738*a^3*x^10+21558*a^2*x^10+20076*a*x^10+27087*x^10+18698*a^3*x^9+31594*a^2*x^9+3443*a*x^9+9974*x^9+9534*a^3*x^8+13115*a^2*x^8+11104*a*x^8+552*x^8+6650*a^3*x^7+20291*a^2*x^7+26968*a*x^7+14024*x^7+23978*a^3*x^6+20409*a^2*x^6+19489*a*x^6+30389*x^6);
+
+gcd(f,g);
+
+f=(3942*a^3*x^23+29103*a^2*x^23+12041*a*x^23+25126*x^23+20894*a^3*x^22+28895*a^2*x^22+11505*a*x^22+17368*x^22+13062*a^3*x^21+2762*a^2*x^21+21062*a*x^21+4750*x^21+23462*a^3*x^20+20870*a^2*x^20+2409*a*x^20+29192*x^20+11569*a^3*x^19+16322*a^2*x^19+11901*a*x^19+8892*x^19+9555*a^3*x^18+15798*a^2*x^18+2183*a*x^18+28858*x^18+10484*a^3*x^17+29114*a^2*x^17+7236*a*x^17+23244*x^17+14649*a^3*x^16+23659*a^2*x^16+18881*a*x^16+7039*x^16+5085*a^3*x^15+1172*a^2*x^15+24012*a*x^15+6392*x^15+29778*a^3*x^14+20684*a^2*x^14+13249*a*x^14+6939*x^14+28402*a^3*x^13+20158*a^2*x^13+11735*a*x^13+15324*x^13+16418*a^3*x^12+13712*a^2*x^12+28773*a*x^12+10656*x^12+27721*a^3*x^11+31296*a^2*x^11+5580*a*x^11+19101*x^11+20442*a^3*x^10+24260*a^2*x^10+22045*a*x^10+15747*x^10+16325*a^3*x^9+23879*a^2*x^9+6065*a*x^9+17821*x^9+10614*a^3*x^8+18747*a^2*x^8+19984*a*x^8+31361*x^8+2092*a^3*x^7+12565*a^2*x^7+16373*a*x^7+22666*x^7+16051*a^3*x^6+5112*a^2*x^6+3568*a*x^6+31215*x^6+7049*a^3*x^5+3561*a^2*x^5+23340*a*x^5+7954*x^5);
+
+g=(7790*a^3*x^31+10495*a^2*x^31+3298*a*x^31+22265*x^31+17500*a^3*x^30+10225*a^2*x^30+31566*a*x^30+912*x^30+5002*a^3*x^29+3880*a^2*x^29+5880*a*x^29+27490*x^29+10868*a^3*x^28+31164*a^2*x^28+29132*a*x^28+719*x^28+629*a^3*x^27+21530*a^2*x^27+28414*a*x^27+5748*x^27+18413*a^3*x^26+22024*a^2*x^26+2681*a*x^26+26497*x^26+29395*a^3*x^25+14381*a^2*x^25+23428*a*x^25+6567*x^25+15793*a^3*x^24+9976*a^2*x^24+31655*a*x^24+24728*x^24+22812*a^3*x^23+26206*a^2*x^23+6912*a*x^23+7265*x^23+17258*a^3*x^22+30267*a^2*x^22+25929*a*x^22+16493*x^22+12895*a^3*x^21+15734*a^2*x^21+29806*a*x^21+20282*x^21+14651*a^3*x^20+12822*a^2*x^20+12802*a*x^20+31183*x^20+51*a^3*x^19+25722*a^2*x^19+26227*a*x^19+27737*x^19+14804*a^3*x^18+255*a^2*x^18+24186*a*x^18+14659*x^18+10845*a^3*x^17+27841*a^2*x^17+15018*a*x^17+15319*x^17+22625*a^3*x^16+17940*a^2*x^16+13545*a*x^16+29977*x^16+12035*a^3*x^15+11966*a^2*x^15+20021*a*x^15+6*x^15+28097*a^3*x^14+6249*a^2*x^14+14666*a*x^14+22252*x^14+24456*a^3*x^13+12304*a^2*x^13+1870*a*x^13+26782*x^13+16348*a^3*x^12+25937*a^2*x^12+21062*a*x^12+9052*x^12+20170*a^3*x^11+14401*a^2*x^11+4713*a*x^11+9405*x^11+18164*a^3*x^10+292*a^2*x^10+9410*a*x^10+25268*x^10+2490*a^3*x^9+6288*a^2*x^9+28090*a*x^9+9720*x^9+13228*a^3*x^8+22541*a^2*x^8+19371*a*x^8+15795*x^8+1988*a^3*x^7+22172*a^2*x^7+14147*a*x^7+22800*x^7+11858*a^3*x^6+21917*a^2*x^6+21057*a*x^6+4514*x^6+97*a^3*x^5+14373*a^2*x^5+18053*a*x^5+6456*x^5);
+
+gcd(f,g);
+
+f=(30992*a^3*x^58+22948*a^2*x^58+10015*a*x^58+1073*x^58+18314*a^3*x^57+20073*a^2*x^57+22488*a*x^57+9402*x^57+17300*a^3*x^56+14831*a^2*x^56+26887*a*x^56+4935*x^56+26115*a^3*x^55+12934*a^2*x^55+20509*a*x^55+918*x^55+2507*a^3*x^54+5388*a^2*x^54+1772*a*x^54+28695*x^54+10945*a^3*x^53+4883*a^2*x^53+10536*a*x^53+24376*x^53+27275*a^3*x^52+14030*a^2*x^52+22660*a*x^52+21483*x^52+26646*a^3*x^51+10827*a^2*x^51+5408*a*x^51+17539*x^51+28027*a^3*x^50+2173*a^2*x^50+2283*a*x^50+11199*x^50+21879*a^3*x^49+29075*a^2*x^49+27564*a*x^49+26453*x^49+12193*a^3*x^48+23514*a^2*x^48+26819*a*x^48+19138*x^48+2586*a^3*x^47+3548*a^2*x^47+4181*a*x^47+31616*x^47+1166*a^3*x^46+4516*a^2*x^46+28352*a*x^46+11078*x^46+6154*a^3*x^45+31935*a^2*x^45+5097*a*x^45+12528*x^45+12919*a^3*x^44+25456*a^2*x^44+22681*a*x^44+8896*x^44+31045*a^3*x^43+24933*a^2*x^43+31089*a*x^43+4350*x^43+8333*a^3*x^42+22706*a^2*x^42+13*a*x^42+27625*x^42+1543*a^3*x^41+12183*a^2*x^41+6605*a*x^41+8748*x^41+4405*a^3*x^40+12876*a^2*x^40+6643*a*x^40+6818*x^40+23398*a^3*x^39+7637*a^2*x^39+17594*a*x^39+28548*x^39+9946*a^3*x^38+26913*a^2*x^38+12163*a*x^38+12432*x^38+20206*a^3*x^37+28123*a^2*x^37+27122*a*x^37+714*x^37+8552*a^3*x^36+4912*a^2*x^36+28324*a*x^36+10002*x^36+20129*a^3*x^35+3836*a^2*x^35+8003*a*x^35+28851*x^35+31693*a^3*x^34+28313*a^2*x^34+28756*a*x^34+866*x^34+16979*a^3*x^33+1241*a^2*x^33+13541*a*x^33+15837*x^33+11228*a^3*x^32+20746*a^2*x^32+29871*a*x^32+8014*x^32+421*a^3*x^31+25890*a^2*x^31+17989*a*x^31+12752*x^31+2877*a^3*x^30+27001*a^2*x^30+27903*a*x^30+10401*x^30+26701*a^3*x^29+26470*a^2*x^29+18273*a*x^29+15917*x^29+27051*a^3*x^28+25885*a^2*x^28+5757*a*x^28+22254*x^28+16901*a^3*x^27+15683*a^2*x^27+494*a*x^27+8580*x^27+9662*a^3*x^26+31031*a^2*x^26+6613*a*x^26+28791*x^26+14952*a^3*x^25+22011*a^2*x^25+159*a*x^25+30050*x^25+15689*a^3*x^24+11636*a^2*x^24+16643*a*x^24+11419*x^24+23851*a^3*x^23+6932*a^2*x^23+26864*a*x^23+22734*x^23+8225*a^3*x^22+7001*a^2*x^22+15435*a*x^22+19011*x^22+5589*a^3*x^21+31994*a^2*x^21+15741*a*x^21+7547*x^21+23329*a^3*x^20+2414*a^2*x^20+19361*a*x^20+8871*x^20+16038*a^3*x^19+27673*a^2*x^19+31205*a*x^19+28802*x^19+503*a^3*x^18+16146*a^2*x^18+11951*a*x^18+27659*x^18+5568*a^3*x^17+20655*a^2*x^17+10175*a*x^17+7756*x^17);
+
+g=(9770*a^3*x^59+23847*a^2*x^59+6476*a*x^59+6123*x^59+8421*a^3*x^58+1072*a^2*x^58+22097*a*x^58+29093*x^58+117*a^3*x^57+16911*a^2*x^57+18234*a*x^57+927*x^57+23772*a^3*x^56+22082*a^2*x^56+31256*a*x^56+20032*x^56+31604*a^3*x^55+2212*a^2*x^55+26550*a*x^55+21031*x^55+27901*a^3*x^54+9601*a^2*x^54+27259*a*x^54+26967*x^54+10891*a^3*x^53+9321*a^2*x^53+16017*a*x^53+11268*x^53+19635*a^3*x^52+22384*a^2*x^52+26394*a*x^52+9188*x^52+30422*a^3*x^51+7923*a^2*x^51+4253*a*x^51+27959*x^51+29878*a^3*x^50+31200*a^2*x^50+3950*a*x^50+5908*x^50+21728*a^3*x^49+17068*a^2*x^49+12530*a*x^49+27968*x^49+8548*a^3*x^48+14100*a^2*x^48+3133*a*x^48+14435*x^48+9732*a^3*x^47+25047*a^2*x^47+6513*a*x^47+8842*x^47+2627*a^3*x^46+9720*a^2*x^46+16557*a*x^46+14683*x^46+528*a^3*x^45+19121*a^2*x^45+9027*a*x^45+26620*x^45+30387*a^3*x^44+9802*a^2*x^44+3749*a*x^44+13517*x^44+2453*a^3*x^43+14699*a^2*x^43+19919*a*x^43+21225*x^43+28310*a^3*x^42+4499*a^2*x^42+3955*a*x^42+7682*x^42+26192*a^3*x^41+3875*a^2*x^41+18658*a*x^41+14678*x^41+23520*a^3*x^40+20042*a^2*x^40+10533*a*x^40+23098*x^40+3162*a^3*x^39+9685*a^2*x^39+15412*a*x^39+10106*x^39+8206*a^3*x^38+29658*a^2*x^38+17362*a*x^38+25937*x^38+12646*a^3*x^37+11011*a^2*x^37+28535*a*x^37+5519*x^37+3154*a^3*x^36+4244*a^2*x^36+28825*a*x^36+5374*x^36+28302*a^3*x^35+1136*a^2*x^35+16491*a*x^35+12998*x^35+30512*a^3*x^34+22305*a^2*x^34+26506*a*x^34+16012*x^34+17373*a^3*x^33+17704*a^2*x^33+24901*a*x^33+2583*x^33+3047*a^3*x^32+15647*a^2*x^32+20674*a*x^32+12458*x^32+17540*a^3*x^31+9355*a^2*x^31+19841*a*x^31+2413*x^31+3035*a^3*x^30+16099*a^2*x^30+20919*a*x^30+24963*x^30+6799*a^3*x^29+31086*a^2*x^29+11471*a*x^29+4081*x^29+423*a^3*x^28+7304*a^2*x^28+4181*a*x^28+16071*x^28+16654*a^3*x^27+19898*a^2*x^27+8695*a*x^27+29767*x^27+12283*a^3*x^26+30100*a^2*x^26+1878*a*x^26+21685*x^26+19555*a^3*x^25+19749*a^2*x^25+10671*a*x^25+17764*x^25+21311*a^3*x^24+16481*a^2*x^24+3963*a*x^24+6023*x^24+31590*a^3*x^23+22987*a^2*x^23+13610*a*x^23+23584*x^23+16875*a^3*x^22+23911*a^2*x^22+27572*a*x^22+27474*x^22+8657*a^3*x^21+18438*a^2*x^21+31480*a*x^21+16007*x^21+10748*a^3*x^20+19771*a^2*x^20+12922*a*x^20+25108*x^20+10465*a^3*x^19+25448*a^2*x^19+1174*a*x^19+13826*x^19+26840*a^3*x^18+31447*a^2*x^18+18936*a*x^18+17117*x^18+1648*a^3*x^17+22711*a^2*x^17+21403*a*x^17+24208*x^17+7784*a^3*x^16+3055*a^2*x^16+11088*a*x^16+13963*x^16);
+
+gcd(f,g);
+
+$
Index: Tst/Long/intdet_l.tst
===================================================================
--- Tst/Long/intdet_l.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Long/intdet_l.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,94 @@
+// $Id: intdet_l.tst,v 1.1.1.1 1998-04-17 15:07:35 obachman Exp $
+
+//
+// indet_l.tst - long tests for integer determinant.
+//
+
+LIB "tst.lib";
+tst_init();
+tst_ignore("CVS ID  : $Id: intdet_l.tst,v 1.1.1.1 1998-04-17 15:07:35 obachman Exp $");
+
+ring r=0,x,dp;
+
+// some zero matrices
+matrix zero1[100][100];
+det(zero1);
+
+// some singular matrices
+matrix singular1[40][40] =
+  0,899389655,0,0,0,545125421,0,591965874,0,0,822521142,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,925841662,0,0,0,0,0,15427512,0,0,0,479185967,0,0,0,
+  0,0,0,0,0,527034510,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,956091443,37107837,0,0,0,0,0,0,233603489,458368626,880379195,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,361476414,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,945670550,0,0,252826806,251905527,0,83020677,0,0,0,810724321,0,0,0,0,0,0,0,0,0,0,75606228,0,0,289429600,2426850,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,10949302,0,0,0,0,0,51706876,0,0,0,0,0,186239261,0,561278433,583189649,0,0,0,0,0,0,0,318572765,0,0,
+  25948588,0,0,0,0,0,0,0,0,5210652,0,0,0,0,0,0,388917350,940143040,0,0,504702663,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  430200614,0,634681001,0,0,0,548956228,0,263006793,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,552364835,0,
+  0,0,0,198708583,0,0,449127317,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,585297414,0,0,0,0,0,
+  0,0,0,0,0,0,0,91815123,0,0,0,0,0,0,0,0,410361477,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,691598243,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,769470716,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,677755699,818215380,0,0,0,0,0,0,0,0,0,0,182002142,761459510,0,0,
+  0,0,0,690520609,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,579563756,0,9684310,0,287947992,342023629,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,662638509,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,80842053,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,80552892,0,128117020,0,0,0,0,0,310722806,0,446318140,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,637084102,0,0,0,781286216,0,0,0,
+  0,0,0,244973609,0,0,0,0,0,0,0,0,0,221484471,0,0,0,0,0,0,0,0,121250532,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,257469698,626767712,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,478929101,100429011,0,0,0,0,0,0,0,0,0,0,0,0,459922313,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,157491734,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,786589709,0,0,0,0,0,0,0,0,0,575876535,0,0,0,0,0,0,0,895340635,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,547830633,0,0,88167599,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  838610744,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50976616,0,0,0,0,0,0,0,0,0,0,0,0,61412897,0,0,0,650163569,
+  0,0,0,0,0,0,796173233,0,0,0,0,0,0,0,0,0,0,0,0,0,0,579937820,0,0,713317646,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,604028373,0,0,0,0,0,0,472559585,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,838556878,0,
+  0,0,0,0,0,788469722,422381647,0,0,0,0,0,0,0,0,714424291,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,871529452,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,775982430,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,867086999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,450228760,785789381,0,0,370462228,0,902320154,0,0,0,445875401,0,0,
+  0,0,0,0,0,748413074,0,86993093,419984637,0,0,0,0,0,0,0,0,129423209,0,0,0,385577382,0,0,0,0,572271315,0,835615105,0,29923726,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,555629482,0,0,0,0,0,310557910,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,699693241,0,0,55267623,127221631,75959162,0,0,96303079,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,89463006,0,0,0,0,0,0,0,0,830627859,0,830087865,0,411774524,0,0,0,0,0,0,
+  0,720231947,94497767,0,0,0,0,0,0,0,157953415,57021786,0,0,0,0,0,0,0,0,0,0,439285111,0,116307316,0,0,0,926247383,0,0,0,0,0,0,0,0,0,0,0,
+  166707068,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,904813435,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,855072409,0,0,0,0,0,0,0,0,0,0,0,0,0,845544306,0,0,0,0,0,899344253,0,0,0,
+  0,0,0,952435936,0,0,0,0,0,0,0,0,0,0,0,570778803,0,0,0,0,0,0,362622375,0,201260149,0,0,0,921988232,0,0,0,0,0,0,0,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,476073558,0,0,0,0,0,0,0,704368569,0,0,0,0,0,0,0,0,0,919817702,0,0,0,
+  0,0,0,0,0,675075118,518747313,573972430,0,58305590,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,81185105,0,0,0,97749598,0,0,0,0,0,0,15922557,0,
+  0,0,825697254,321680896,0,0,0,239004046,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,952611602,0,0,0,0,0,0,0,0,0,655736680,644587061,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,288187925,0,0,0,750797768,0,0,0,0,0,0,0,0,113068432,0,10301367,371182480,0,0,8978335,0,0,0,0,0,0,377451841,
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,903334498,0,0,0,0,0,0,0,0,0,0,0,0,0,0,894899069,0,0,0,0,
+  0,0,0,0,0,0,0,0,0,0,0,0,748659058,0,0,0,201547172,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0;
+det(singular1*singular1*singular1*singular1*singular1);
+
+// and now for something more serious ...
+matrix serious1[30][30] =
+0,6408168,3086691,14610610,-144147418,97023973,1891045,66172212,48611143,77812860,58243967,3436409,52218327,28981425,82144220,-168696325,96891780,-52015182,-43831219,83412200,99895289,0,0,56746301,68870123,67781041,71033065,14143367,-123642174,-171399908,
+-55403228,15110694,2548230,31288158,44966384,5166989,76213065,72532690,82660661,-96672080,66962132,52008016,-93895075,-17221781,-131896390,15965196,77734045,15869514,5218625,80366898,0,74866836,57233024,54514544,-26696912,-70127754,94279999,73016513,3224351,98487378,
+-64181478,45840803,62051609,74654769,81046073,-80715208,0,53559379,0,67024348,-94153967,-175688166,35766706,0,72444979,16179048,0,987782,87401342,20392082,81255370,21303303,-24679950,58449795,0,75503216,0,22397738,0,36334460,
+59995961,81036496,80641043,55360219,56079301,82369982,93939100,26455513,52420146,54611421,-114717307,86271805,46683511,53082422,-10637362,0,58744831,41356008,77027312,55601310,0,-84130230,62780579,99977428,68855470,27462366,-87530262,6324788,74491739,-176442825,
+89441623,85084616,38337552,30215446,83276952,-125345395,33715289,95641443,91919610,67757669,84167074,28536089,-160245958,-95828187,9408071,20600007,99274497,15615301,6256036,26241535,89731535,54354424,50237806,0,58103244,7553770,45057616,48761548,34176488,-122373381,
+88726645,38578908,14340147,0,1031488,14671938,5974159,0,54580570,54846073,49554380,79082918,22708456,0,43085394,74821108,34488306,24267513,97534352,44329980,25651616,-65534174,40569095,82390992,45255933,6071413,-92447518,44202,-10785318,0,
+424862,0,93078766,56446250,53089874,0,61201005,58305659,-163426127,71873157,32016304,0,-18468236,50319860,64835581,76744829,19926650,-60150875,93337931,12354643,6796852,6405700,68595413,94289183,10486184,43822451,55149042,-10973126,52570897,32107260,
+99574505,99623604,-10531575,0,56535425,94000204,-53048775,80889601,0,9504342,5711430,96845538,10941134,15988479,29666186,21547720,-128449560,17925749,-66980967,29242826,71961190,12288752,83331896,79718070,25764637,12581812,32539223,39193921,28834417,4304393,
+21311842,29330887,31723316,32977334,53453153,38154654,36199344,97443488,43178126,90846538,9128739,17062162,29504900,89059801,-13880171,41861959,92457321,67712662,-13361681,-105160972,86641904,3732300,17648135,51547737,38020725,82956791,-17820736,59550656,-15452161,-144745700,
+16020951,-136653511,24997936,-36498895,-135197636,59304442,-126536326,-73418000,8057061,44374127,8223980,-148743374,84745008,72246715,66945451,92408139,0,9710889,18699971,-148440277,-71733667,19763918,0,52716500,54085735,74362780,61447362,60614086,45181953,14555972,
+0,29551465,14187585,-93828623,9404641,77130566,-125733423,63862054,81642655,22798611,24731420,44496595,-63121672,38747055,87957012,61078211,92226741,85347096,22546737,-52693098,69254535,26349139,-128631527,-28557978,52242375,-143319616,0,-111899596,38636908,422617,
+72161856,60990008,-30184143,69806743,97713426,-138422432,61092678,12672137,0,38635137,-80505865,45090093,-95088518,0,49234249,85284809,66508563,50210838,96932575,82374174,0,39781843,41819897,0,55406669,60035763,87161787,3634192,18582955,43363739,
+39873807,-86684951,5021608,73067764,53744894,-49828741,-119760890,-91501384,12867923,40939753,-87845369,37811976,60686642,84153063,-64135610,40834269,-80190648,79032499,64210365,11844800,0,52127963,88390018,0,7359016,0,88906889,7629803,8479179,30386399,
+-25407258,26304875,94475947,82142623,7216434,-40880311,-78030234,10083950,55567700,19559629,50534717,42006752,-66250047,75844728,-34801907,-58088752,25188025,81528243,944537,90917245,49854186,82282343,-165027464,80728264,0,86312422,43697413,9684081,15046498,16988324,
+90696066,36038295,17916657,31238818,-68049602,22208581,0,87546928,88466803,-27113705,56014219,-49410106,61030334,77987161,44295092,47495748,-153790979,18447009,60746891,37470727,7931961,70468892,79372272,83371971,31591623,84219706,32809315,36893325,-116111763,7073449,
+15750690,48047155,39787767,-34642575,86791260,-23957851,0,80496293,38769224,11990277,-132800233,15724513,-144430232,93739783,16850497,-19887254,42495296,91646199,-95765033,16081025,9405653,82520950,21050937,42887462,84946672,-88051035,-14880398,-9519254,73465576,75675082,
+69681891,25603920,32342721,85692841,16234355,40410493,40552873,24408407,-67646274,0,14223108,-65147293,90252738,18935932,37359867,0,87862672,28089959,39176838,-33935251,99230754,72865914,60549767,41197522,57474053,-100388679,3435001,73975761,34156429,-119692554,
+591569,70398619,70435942,2852695,0,0,12358753,46348026,-120732477,71038447,99239734,-112456241,-62968349,31935069,31291942,-120169376,-106841258,91722950,94765899,20492078,-155350886,82275303,-95982293,66612768,4335559,27783921,73169844,22950075,33235715,-2117254,
+18342534,78136703,57140534,9735126,2693054,-45591460,32065484,70925706,0,70924121,16972432,-105826281,0,85212414,-60202447,-32011526,85595193,35282586,54118725,9584531,-7168555,0,9460954,47721647,32177403,-35090026,926346,-23166272,70105630,-20650873,
+81974641,27836926,38395000,98389,0,53117226,28894643,93391602,-13454381,-57870335,47184260,0,0,44251377,60557609,45309756,7433758,2326170,19448704,88554858,92275432,7412715,-75916597,15518693,45412960,70060568,-10805320,77365518,-86243950,87154713,
+-112751650,36189057,69911037,1854211,31074979,77890633,22097971,2530944,-28389328,-114616256,76849224,18663786,36173022,83475591,0,65266063,48126973,59727824,22140603,51958611,-115345468,85725263,0,-197310938,0,-137681321,44922992,10748992,78193728,-83640257,
+64494284,26557161,34156772,91923544,81333684,96765167,97080992,43136195,78618048,73809444,41848103,32747942,96766116,-140560714,-26039792,5308362,94823998,91144480,15660746,15688487,55217324,55506484,0,-94504836,57286172,4282631,-107605593,0,7972930,57095895,
+13623035,89026338,-176578948,6460382,54496068,10150939,0,97762323,54827473,3787728,39388166,71424003,-153193816,71619542,34705705,-24202726,84935891,-110443565,0,40778748,54264701,-96935751,61833111,26517035,52252251,42176235,86619361,-54966125,79249763,69588040,
+65862085,98585421,94676351,1687346,54799864,53883831,59889736,99170493,58091960,12633064,6970195,73649684,71712591,66863462,56505831,86941161,62944165,95994190,68519360,99427398,-65389929,70957922,34010498,82140955,79952252,-63344211,0,51527628,41228860,31787117,
+61020323,0,45539594,85564859,0,0,21311304,0,0,87540318,3273907,73487562,57536433,93331605,-25288929,77327784,57398822,-20880883,174634,70882508,47395831,93453561,453096,3742875,49852510,57594144,95717277,-123625315,94668360,0,
+0,65453839,12481623,53233803,79278623,0,60569525,48297033,64868764,18756035,49249031,-188952344,46730161,3867521,17863152,52173869,6509306,5848009,-133544561,25506541,69306077,2875909,42073437,-96218772,0,30519624,72632930,43421825,75888481,83152396,
+58788983,51475384,9446314,-18583272,-48787909,-93488681,-74756985,9621516,79075755,-57473695,-67888057,0,12216870,49166486,78017003,37153193,93035237,875470,-1666280,15392468,38897950,2603498,-158544150,31824034,66722229,40545298,83928395,0,19253484,74467517,
+43120738,50375391,-119610272,44562791,38820837,44240634,35749167,-24192749,0,40578710,12068732,46265080,-5096267,39668907,41605829,-107795720,55383751,6743252,90274676,-19729287,15264361,-121677154,5516423,83839978,32849745,0,-152843497,15248362,3274932,90719614,
+13715373,87510173,-68929601,88865603,78149963,61262729,-137305741,-99114446,-51884761,47136988,28306063,92789948,90641951,34005549,-53100694,7625473,20298217,92780854,3707038,28475632,23234776,-32858313,27804908,83822430,11232047,-30563282,0,45767666,17421205,28907130,
+98343278,42122306,5651144,34313086,71701332,-84500543,0,0,64899400,0,0,2374432,5207633,45725773,84651424,85962451,58039658,40821972,22390256,-104894280,59029292,62650665,12246007,29380851,53841117,-62830911,-27357351,-91325571,94332045,855852;
+det(serious1*serious1*serious1*serious1*serious1);
+$
Index: Tst/Long/makedbm_l.tst
===================================================================
--- Tst/Long/makedbm_l.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Long/makedbm_l.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,18 @@
+LIB "tst.lib";
+LIB "makedbm.lib";
+
+tst_init();
+tst_ignore("CVS: $Id: makedbm_l.tst,v 1.1.1.1 1998-04-17 15:07:39 obachman Exp $");
+
+// ===============================================
+int i;
+create_sing_dbm();
+read_sing_dbm();
+"//////////////////////////////////////////////////////////////////////";
+
+// ===============================================
+link l="DBM: NFlist";
+dbm_read(l);
+kill l;
+i=system("sh", "/bin/rm -f NFlist.dir NFlist.pag");
+quit;
Index: Tst/Long/mpsr_l.tst
===================================================================
--- Tst/Long/mpsr_l.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Long/mpsr_l.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,382 @@
+LIB "tst.lib";
+tst_init();
+LIB "general.lib";
+
+option(noredefine);
+
+proc vcheckdump(link l, string vn)
+{
+  if (typeof(`vn`) != "proc" && typeof(`vn`) != "link")
+  {
+    write(l, `vn`);
+    read(l);
+    if (typeof(`vn`) == "ring")
+    {
+       setring `vn`;
+       rcheckdump(l, names(`vn`));
+    }
+  }
+}
+  
+proc rcheckdump(link l, list nameslist)
+{
+  int i;
+  for (i=1; i<size(nameslist); i++)
+  {
+    vcheckdump(l, nameslist[i]);
+  }
+}
+
+proc checkdump(link l)
+{
+  rcheckdump(l, names());
+}
+
+// data
+int i;
+int i1 = 1;
+int i2 = -100092;
+
+intvec iv;
+intvec iv1 = 1,2,3;
+intvec iv2 = -1,2,-3,4,-5;
+
+intmat im;
+intmat im1[2][3]=1,3,5,7,8;
+intmat im2[3][3]= -1,2,-3,4,-5;
+
+string s;
+string s1 = "Hello World";
+
+list l;
+list l1 = i,iv,im,i1,iv1,im1;
+list l2 = l1, iv2, l, im2;
+
+ring r;
+
+poly p;
+number n;
+number n1 = 2;
+number n2 = -7;
+
+poly p1 = x + y;
+poly p2 = xyz - 2x3y4z5 + 3xy -4yz + 5z;
+poly p3 = p2^4;
+
+vector v;
+vector v1 = [p1, p2];
+vector v2 = [p, p1,p2, p3] + p1*gen(5);
+
+ideal id;
+ideal id1 = p, p1, p2, p3;
+ideal id2 = p, p1+p2, p2+3, p1+p2+p3, p1, p2, p3;
+
+module mv;
+module mv1 = v, v1, v2;
+module mv2 = v1+v2, p1*v2, p2*v1, v, v1, v2;
+
+matrix m;
+matrix m1[2][3] = p, p1, p2, id1;
+matrix m2[4][4] =  p, p1, p2, p3, id1, id2;
+
+
+ideal j = std(id1);
+
+// the following does not work properly -- run it with Singularg and
+// you'll see what I mean -- debug it eventually !!!
+// qring q = j;
+poly p11 = x + y;
+poly p12 = xyz - 2x3y4z5 + 3xy -4yz + 5z;
+poly p13 = p12^4;
+
+ring rtm = 32003, (x,y,z,t), dp;
+ideal ex = t3y7z4 + 9x8 + 5t2x4y2 + 2t2xy2z3,
+2t2x5y4+7txy6+9y8 + 2t2x2yz3,  3t4x2y3z2 + 9z8, 3x2y9 +
+y9 + 5x4;
+
+ring rt0 = 0, (x,y,z,t), dp;
+ideal ex = t3y7z4 + 9x8 + 5t2x4y2 + 2t2xy2z3,
+2t2x5y4+7txy6+9y8 + 2t2x2yz3,  3t4x2y3z2 + 9z8, 3x2y9 +
+y9 + 5x4;
+
+
+ring rr = 32003,(a,b),dp;
+map f = r, a,b,a+b;
+map g   = rr,a2,b2;
+map phi = g(f);
+
+
+ring r0 = 0, x, lp;
+number n;
+number n1 = 29734481274863241234589;
+number n2 = n1/(n1-6);
+
+poly p;
+poly p1 = n1*x + n2*x^4 + 7/3*x^2*x^5 - 6;
+poly p2 = x*x*x - 2*x^3*x^4*x^5 + 3*x*x -4*x*x + 5*x^2 + p1;
+poly p3 = p2*p2;
+
+vector v;
+vector v1 = [p1, p2];
+vector v2 = [p, p1,p2, p3] + p1*gen(5);
+
+ideal id;
+ideal id1 = p, p1, p2, p3;
+ideal id2 = p, p1+p2, p2+3, p1+p2+p3, p1, p2, p3;
+
+module mv;
+module mv1 = v, v1, v2;
+module mv2 = v1+v2, p1*v2, p2*v1, v, v1, v2;
+
+matrix m;
+matrix m1[2][3] = p, p1, p2, id1;
+matrix m2[4][4] =  p, p1, p2, p3, id1, id2;
+
+
+ring r1 = 0, x(1..10), ls;
+
+number n;
+number n1 = 29734481274863241234589;
+number n2 = n1/(n1-6);
+
+poly p;
+poly p1 = n1*x(1) + n2*x(5)^4 + 7/3*x(3)^2*x(4)^5 - 6;
+poly p2 = x(2)*x(5)*x(6) - 2*x(7)^3*x(8)^4*x(9)^5 + 3*x(1)*x(5) -4*x(5)*x(9) +
+5*x(9)^2 + p1;
+poly p3 = p2*p2;
+
+vector v;
+vector v1 = [p1, p2];
+vector v2 = [p, p1,p2, p3] + p1*gen(5);
+
+ideal id;
+ideal id1 = p, p1, p2, p3;
+ideal id2 = p, p1+p2, p2+3, p1+p2+p3, p1, p2, p3;
+
+module mv;
+module mv1 = v, v1, v2;
+module mv2 = v1+v2, p1*v1, v1-v2, v, v1, v2;
+
+matrix m;
+matrix m1[2][3] = p, p1, p2, id1;
+matrix m2[4][4] =  p, p1, p2, p3, id1, id2;
+
+ring r2=10,(x(1..6)),(lp(2),dp(4));
+number n;
+number n1 = 29734481274863241234589;
+number n2 = n1/(n1-6);
+
+poly p;
+poly p1 = n1*x(1) + n2*x(5)^4 + 7/3*x(3)^2*x(4)^5 - 6;
+poly p2 = x(2)*x(5)*x(6) - 2*x(1)^3*x(2)^4*x(3)^5 + 3*x(1)*x(5) -4*x(5)*x(3) +
+5*x(3)^2 + p1;
+poly p3 = p2*p2;
+
+vector v;
+vector v1 = [p1, p2];
+vector v2 = [p, p1,p2, p3] + p1*gen(5);
+
+ideal id;
+ideal id1 = p, p1, p2, p3;
+ideal id2 = p, p1+p2, p2+3, p1+p2+p3, p1, p2, p3;
+
+module mv;
+module mv1 = v, v1, v2;
+module mv2 = v1+v2, p1*v2, v1-v2, v, v1, v2;
+
+matrix m;
+matrix m1[2][3] = p, p1, p2, id1;
+matrix m2[4][4] =  p, p1, p2, p3, id1, id2;
+
+ring r3=(7,a, b, c),(x,y,z),dp;
+number n;
+number n1 = 2*a^2*b*c -3*b*c + -1*a + 4;
+number n2 = n1 / (n1 - 5c)^2;
+
+poly p;
+poly p1 = x + y + a;
+poly p2 = 3*a^2*xyz*n1 - 2*n2*x3y4z5 + 3xy -4yz + n1*z;
+poly p3 = p2*p1;
+
+vector v;
+vector v1 = [p1, p2];
+vector v2 = [p, p1,p2, p3] + p1*gen(5);
+
+ideal id;
+ideal id1 = p, p1, p2, p3;
+ideal id2 = p, p1+p2, p2+3, p1+p2+p3, p1, p2, p3;
+
+module mv;
+module mv1 = v, v1, v2;
+module mv2 = v1+v2, p1*v2, v1-v2, v, v1, v2;
+
+matrix m;
+matrix m1[2][3] = p, p1, p2, id1;
+matrix m2[4][4] =  p, p1, p2, p3, id1, id2;
+
+ring r4=(7,a),(x,y,z),dp;
+minpoly=a^2+a+3;
+poly p;
+number n;
+number n1 = 2*a^2 + 3;
+number n2 = n1 / (n1 -5)^3;
+
+poly p1 = x + y + a;
+poly p2 = 3*a^2*xyz*n1 - 2*n2*x3y4z5 + 3xy -4yz + n1*z;
+poly p3 = p2^4;
+
+vector v;
+vector v1 = [p1, p2];
+vector v2 = [p, p1,p2, p3] + p1*gen(5);
+
+ideal id;
+ideal id1 = p, p1, p2, p3;
+ideal id2 = p, p1+p2, p2+3, p1+p2+p3, p1, p2, p3;
+
+module mv;
+module mv1 = v, v1, v2;
+module mv2 = v1+v2, p1*v2, v1-v2, v, v1, v2;
+
+matrix m;
+matrix m1[2][3] = p, p1, p2, id1;
+matrix m2[4][4] =  p, p1, p2, p3, id1, id2;
+
+ring r5=(49,a),(x,y,z),dp;
+poly p;
+number n;
+number n1 = 2*a^2 + 3;
+number n2 = n1 / (n1 -5)^3;
+
+poly p1 = x + y + a;
+poly p2 = 3*a^2*xyz*n1 - 2*n2*x3y4z5 + 3xy -4yz + n1*z;
+poly p3 = p2^4;
+
+vector v;
+vector v1 = [p1, p2];
+vector v2 = [p, p1,p2, p3] + p1*gen(5);
+
+ideal id;
+ideal id1 = p, p1, p2, p3;
+ideal id2 = p, p1+p2, p2+3, p1+p2+p3, p1, p2, p3;
+
+module mv;
+module mv1 = v, v1, v2;
+module mv2 = v1+v2, p1*v2, v1-v2, v, v1, v2;
+
+matrix m;
+matrix m1[2][3] = p, p1, p2, id1;
+matrix m2[4][4] =  p, p1, p2, p3, id1, id2;
+
+ring r6 = 32003, (x,y,z), wp(1,2,3);
+poly p = (xyz - 2x3y4z5 + 3xy -4yz + 5z + 2)^2;
+
+ring r7 = 32003, (x,y,z), Ws(1,2,3);
+poly p = (xyz - 2x3y4z5 + 3xy -4yz + 5z + 2)^2;
+
+ring r8 = 32003, (a,b,c,x,y,z), (dp(3), wp(1,2,3));
+poly p = (xyzabc - 2x3y4z5a2b4c3 + 3xya2 -4yzb3c2 + 5zc + 2)^2;
+
+ring r9 = 32003, (a,b,c,x,y,z), (a(1,2,3,4,5),Dp(3), ds(3));
+poly p = (xyzabc - 2x3y4z5a2b4c3 + 3xya2 -4yzb3c2 + 5zc + 2)^2;
+
+ring r10 = 32003, (x,y,z), M(1, 0, 0, 0, 1, 0, 0, 0, 1);
+poly p = (xyz - 2x3y4z5 + 3xy -4yz + 5z + 2)^2;
+
+ring r11 = 0, x(1..10), (lp(2), M(1, 2, 3, 1, 1, 1, 1, 0, 0), ds(2), ws(1,2,3));
+poly p1 = x(1) + 123399456085/(123399456085 + 1)*x(5)^4 + 7/3*x(3)^2*x(4)^5 - 6;
+poly p2 = x(2)*x(5)*x(6) - 2*x(7)^3*x(8)^4*x(9)^5 + 3*x(1)*x(5) -4*x(5)*x(9) +
+5*x(9)^2 + p1;
+
+ring r12 = 0, (x,y,z), (C,lp);
+vector v1 = [x+y2,z3+xy];
+vector v2 = [x,x,x];
+
+ring r13 = 0, (x,y,z), (lp,c);
+vector v1 = [x+y2,z3+xy];
+vector v2 = [x,x,x];
+
+ring r14 = 0, (x,y,z), (c,lp);
+vector v1 = [x+y2,z3+xy];
+vector v2 = [x,x,x];
+
+// First, make ASCII-dump of everything 
+dump(":w _dump.txt");
+killall();
+getdump("_dump.txt");
+
+// Does our version have MP?
+if (! (system("with", "MP")))
+{
+  // no -- so simply dump everything to stdout and exit
+  dump("");
+  $;
+}
+
+// Yes, so let's make an MPfile dump
+dump("MPfile: _dump.mp");
+killall();
+getdump("MPfile:r _dump.mp");
+
+// checkdump("MPfile: _dump.mp");
+
+// MPfork dump
+link ll = "MPtcp:fork"; 
+open(ll);
+if (status(ll, "openwrite", "yes"))
+{
+  write(ll, quote(getdump(mp_ll))); dump(ll); read(ll);
+  killall("not", "link");
+  write(ll, quote(dump(mp_ll))); getdump(ll); read(ll); 
+
+  checkdump(ll);
+}
+kill ll;
+
+
+// MPlaunch dump
+string sing = system("whoami");
+
+if (size(sing))
+{
+  // check whether rsh works and whether remote Singular can be executed
+  if (system("sh","rsh `hostname` -n test -x "+sing+" 1>/dev/null 2>&1"))
+  { 
+    if (system("sh","remsh `hostname` -n test -x "+sing+" 1>/dev/null 2>&1"))
+    {
+      if (system("sh","ssh `hostname` -f test -x "+sing+" 1>/dev/null 2>&1"))
+      {
+        sing = "";
+      }
+    }
+  }
+  
+  if (size(sing))
+  {
+    link ll = "MPtcp:launch"; 
+    open(ll);
+    if (status(ll, "openwrite", "yes"))
+    {
+      kill sing;
+      write(ll, quote(getdump(mp_ll))); dump(ll); read(ll);
+      killall("not", "link");
+      write(ll, quote(dump(mp_ll))); getdump(ll); read(ll); 
+
+      checkdump(ll);
+    }
+    kill ll;
+  }
+}
+
+if (defined(sing))
+{
+  kill sing;
+}
+tst_ignore(system("sh", "rm -rf _dump.*"));
+
+killall("proc");
+dump("");
+$
+
+
+  
+
Index: Tst/Long/primdec_l.tst.sv
===================================================================
--- Tst/Long/primdec_l.tst.sv	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Long/primdec_l.tst.sv	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,137 @@
+LIB "tst.lib";
+tst_init();
+
+LIB"primdec.lib";
+option(prot);
+
+ring r=32003,(a,b,c,d,e,f,g,h,j),(C,dp);
+ideal i=
+a+2b+c-d+g,
+f2gh-a,
+efg-c,
+fg2j-b,
+a+b+c+f+g-1,
+3ad+3bd+2cd+df+dg-a-2b-c-g;
+
+list pr1=minAssPrimes(i);
+ideal i1=radical(i);
+ideal i2=equiRadical(i);
+list pr2= primdecGTZ(i);
+list pr3=min_ass_prim_charsets(i,1);
+list pr4=primdecSY(i,1);
+matrix m=char_series(i);
+pr1;
+i1;
+i2;
+pr2;
+pr3;
+pr4;
+m;
+testPrimary(pr2,i);
+kill r;
+
+ring r=32003,(b,s,t,u,v,w,x,y,z),(C,dp);
+ideal i=
+bv+su,
+bw+tu,
+sw+tv,
+by+sx,
+bz+tx,
+sz+ty,
+uy+vx,
+uz+wx,
+vz+wy;
+
+list pr1=minAssPrimes(i);
+ideal i1=radical(i);
+ideal i2=equiRadical(i);
+list pr2= primdecGTZ(i);
+list pr3=min_ass_prim_charsets(i,1);
+list pr4=primdecSY(i,1);
+matrix m=char_series(i);
+pr1;
+i1;
+i2;
+pr2;
+pr3;
+pr4;
+m;
+testPrimary(pr2,i);
+kill r;
+ring r=0,(b,s,t,u,v,w,x,y,z),(C,dp);
+ideal i=
+bv+su,
+bw+tu,
+sw+tv,
+by+sx,
+bz+tx,
+sz+ty,
+uy+vx,
+uz+wx,
+vz+wy;
+
+list pr1=minAssPrimes(i);
+ideal i1=radical(i);
+ideal i2=equiRadical(i);
+list pr2= primdecGTZ(i);
+list pr3=min_ass_prim_charsets(i,1);
+list pr4=primdecSY(i,1);
+matrix m=char_series(i);
+pr1;
+i1;
+i2;
+pr2;
+pr3;
+pr4;
+m;
+testPrimary(pr2,i);
+kill r;
+
+ring r= 32003,(x,y,z),(C,dp);
+ideal i=
+17y6+49y5-9y4+41x2z+12y3+33y2+11y+73,
+42y5+33y4+21x2y+17x2z+63y3+11xy+77y2+91y+1,
+26y2+44xz+12y+9;
+
+list pr1=minAssPrimes(i);
+ideal i1=radical(i);
+ideal i2=equiRadical(i);
+list pr2= primdecGTZ(i);
+list pr3=min_ass_prim_charsets(i,1);
+list pr4=primdecSY(i,1);
+matrix m=char_series(i);
+pr1;
+i1;
+i2;
+pr2;
+pr3;
+pr4;
+m;
+testPrimary(pr2,i);
+kill r;
+
+ring r =32003,(a,b,c,d,e,h),(C,dp);
+ideal i=
+a+b+c+d+e,
+de+1cd+1bc+1ae+1ab,
+cde+1bcd+1ade+1abe+1abc,
+bcde+1acde+1abde+1abce+1abcd,
+abcde-h5;
+
+list pr1=minAssPrimes(i);
+ideal i1=radical(i);
+ideal i2=equiRadical(i);
+list pr2= primdecGTZ(i);
+list pr3=min_ass_prim_charsets(i,1);
+list pr4=primdecSY(i,1);
+matrix m=char_series(i);
+pr1;
+i1;
+i2;
+pr2;
+pr3;
+pr4;
+m;
+testPrimary(pr2,i);
+kill r;
+$
Index: Tst/Long/resultantp_l.tst
===================================================================
--- Tst/Long/resultantp_l.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Long/resultantp_l.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,205 @@
+// $Id: resultantp_l.tst,v 1.1.1.1 1998-04-17 15:07:39 obachman Exp $
+
+//
+// resultantp_l.tst - long tests for resultant calculations mod p.
+//
+// All univariate non-trivial examples come from gcdUnivP.fex or
+// gcdUnivPAlpha.fex.  Most of the examples have a non-trivial gcd, so we
+// compute always an disturbed example, too.
+//
+// The examples involving a transcendental variable are the same as the
+// examples with algebraic variables.
+//
+// To Do:
+//
+// o multivariate resultant calculations
+//
+
+LIB "tst.lib";
+tst_init();
+tst_ignore("CVS ID  : $Id: resultantp_l.tst,v 1.1.1.1 1998-04-17 15:07:39 obachman Exp $");
+
+//
+// - ring r1=32003,x,dp.
+//
+
+tst_ignore( "ring r1=32003,x,dp;" );
+ring r1=32003,x,dp;
+
+poly f;
+poly g;
+
+f=106*x^13-583*x^12-1060*x^11+8056*x^10+1696*x^9-327*x^8+12508*x^7+8277*x^6+5609*x^5-12879*x^4+13144*x^3-2544*x^2;
+g=11118*x^14-5404*x^13-908*x^12-13908*x^11+3188*x^10-8818*x^9+10439*x^8-14811*x^7+15530*x^6-4891*x^5+6322*x^4+15829*x^3-13686*x^2;
+
+resultant(f, g, x);
+resultant(f, g+1, x);
+
+f=-14613*x^17+2235*x^16-298*x^15+4540*x^14+7214*x^13+5494*x^12-3122*x^11-4720*x^10+8300*x^9-6582*x^8-9908*x^7-15983*x^6-5802*x^5-8634*x^4+7899*x^3+10556*x^2+6931*x+11063;
+g=-10168*x^20+6674*x^19+3004*x^18+13113*x^17+9449*x^16+9097*x^15-6420*x^14+50*x^13+434*x^12-15226*x^11+3727*x^10-14065*x^9-9751*x^8-15792*x^7+6004*x^6-5059*x^5+2479*x^4-12504*x^3-11328*x^2-11338*x-8280;
+
+resultant(f, g, x);
+resultant(f, g+1, x);
+
+f=3812*x^22-6874*x^21+12586*x^20+3003*x^19-9568*x^18+11117*x^17 +7524*x^16+11138*x^15-9743*x^14+1892*x^13+12485*x^12-569*x^11-8265*x^10-5991*x^9+13701*x^8+2644*x^7-3936*x^6-15875*x^5+1289*x^4+3956*x^3-10099*x^2-6616*x+5401;
+g=10652*x^20-4144*x^19-11810*x^18+8237*x^17-8675*x^16+6545*x^15-3601*x^14+14559*x^13+8090*x^12-8378*x^11+14255*x^10+8767*x^9-13932*x^8+11602*x^7-10751*x^6-4899*x^5+8637*x^4+14084*x^3-11583*x^2+5882*x+885;
+
+resultant(f, g, x);
+resultant(f, g+1, x);
+
+f=3812*x^22-6874*x^21+12586*x^20+3003*x^19-9568*x^18+11117*x^17+7524*x^16+11138*x^15-9743*x^14+1892*x^13+12485*x^12-569*x^11-8265*x^10-5991*x^9+13701*x^8+2644*x^7-3936*x^6-15875*x^5+1289*x^4+3956*x^3-10099*x^2-6616*x+5401;
+
+g=10652*x^20-4144*x^19-11810*x^18+8237*x^17-8675*x^16+6545*x^15-3601*x^14+14559*x^13+8090*x^12-8378*x^11+14255*x^10+8767*x^9-13932*x^8+11602*x^7-10751*x^6-4899*x^5+8637*x^4+14084*x^3-11583*x^2+5882*x+885;
+
+resultant(f, g, x);
+resultant(f, g+1, x);
+
+f=-7448*x^36+7714*x^35-13927*x^34+3932*x^33+3682*x^32-10010*x^31+5268*x^30+13873*x^29+13357*x^28-833*x^27-184*x^26+15676*x^25+13250*x^24-1501*x^23+4047*x^22-12971*x^21+1837*x^20-95*x^19+13420*x^18+6133*x^17+1202*x^16-10228*x^15+15007*x^14-5205*x^13+5458*x^12+11076*x^11-488*x^10-9898*x^9+7409*x^8+13329*x^7-11898*x^6-7619*x^5-8536*x^4+12785*x^3+11896*x^2-12853*x+2549;
+
+g=5104*x^34-12263*x^33-1609*x^32-6796*x^31-2994*x^30+7028*x^29-3014*x^28-1266*x^27-12321*x^26+14482*x^25+3663*x^24-3726*x^23+6983*x^22+1260*x^21-4850*x^20-2975*x^19+11044*x^18-14330*x^17-6739*x^16-11849*x^15+1213*x^14+3785*x^13+4837*x^12-11046*x^11+13804*x^10+8188*x^9+8122*x^8+10487*x^7+6814*x^6+9533*x^5-11550*x^4-10878*x^3-699*x^2-14751*x+3845;
+
+resultant(f, g, x);
+resultant(f, g+1, x);
+
+f=-11183*x^46+8215*x^45-14295*x^44+8289*x^43-7550*x^42+12650*x^41+10826*x^40-2442*x^39+6380*x^38-1209*x^37+1942*x^36+2715*x^35+15876*x^34+15415*x^33+6777*x^32-12712*x^31+12435*x^30-3063*x^29+10219*x^28-11110*x^27+7832*x^26-5236*x^25-12353*x^24+5050*x^23-1811*x^22+6642*x^21-3090*x^20-7071*x^19-12500*x^18+12953*x^17-10539*x^16+12938*x^15+8080*x^14+8451*x^13-9123*x^12-4021*x^11+4501*x^10-4506*x^9-407*x^8+12356*x^7-2074*x^6+690*x^5-14676*x^4-15971*x^3-1813*x^2+7707*x+1079;
+
+g=183*x^45+5561*x^44-1043*x^43+12612*x^42+1596*x^41-9268*x^40+4858*x^39-13517*x^38+14465*x^37-12452*x^36-15117*x^35-5775*x^34-8520*x^33-13105*x^32-12192*x^31-4843*x^30-5194*x^29-2000*x^28+13734*x^27-4211*x^26+6154*x^25+3930*x^24+11156*x^23+5575*x^22+12497*x^21+3708*x^20-13561*x^19+6457*x^18+7867*x^17+11794*x^16-13102*x^15+3546*x^14+11013*x^13+6443*x^12+9411*x^11-5881*x^10-11560*x^9+13919*x^8-2613*x^7+10716*x^6+10107*x^5-7507*x^4-14638*x^3-9884*x^2-4890*x-2671;
+
+resultant(f, g, x);
+resultant(f, g+1, x);
+
+f=2229*x^56+11515*x^55+5449*x^54-2102*x^53+10553*x^52+4459*x^51 -10713*x^50-10483*x^49+12815*x^48+1371*x^47+13136*x^46+13474*x^45 +15930*x^44-3951*x^43+3632*x^42+5483*x^41+15429*x^40+11158*x^39 +11618*x^38-11397*x^37+373*x^36+12655*x^35-14103*x^34-9976*x^33 -4906*x^32+10959*x^31-6889*x^30-4713*x^29-9677*x^28-12594*x^27 +6918*x^26-12226*x^25+3225*x^24+9437*x^23-9869*x^22-10191*x^21 -2477*x^20+11187*x^19+5746*x^18-15428*x^17+4405*x^16-1631*x^15 -13687*x^14-6654*x^13+8104*x^12+12147*x^11-4629*x^10+5415*x^9 +5461*x^8+14494*x^7-2563*x^6+9079*x^5+12571*x^4-3643*x^3-10904*x^2 -7490*x-6782;
+
+g=2877*x^61-351*x^60-12672*x^59-7991*x^58-2499*x^57-9709*x^56 +1219*x^55+5355*x^54-13710*x^53+3347*x^52-12542*x^51+12524*x^50 +8280*x^49+15488*x^48+13565*x^47+14659*x^46+9784*x^45+3738*x^44 +13042*x^43-2627*x^42-15378*x^41+7650*x^40-827*x^39-7590*x^38 +2687*x^37+15016*x^36+12855*x^35-8645*x^34+3930*x^33+1837*x^32 +335*x^31-11981*x^30-4414*x^29-7074*x^28+2715*x^27+3314*x^26-44*x^25 +8932*x^24+15583*x^23-2036*x^22-9074*x^21+9396*x^20+13732*x^19 -6178*x^18+2091*x^17+14186*x^16-7830*x^15+12864*x^14-583*x^13 -3809*x^12-5495*x^11+15730*x^10-9216*x^9+15330*x^8-12277*x^7-2666*x^6 -786*x^5-11567*x^4-6166*x^3-3486*x^2-3245*x-3393;
+
+resultant(f, g, x);
+resultant(f, g+1, x);
+
+//
+// - ring r2=(32003,a),x,dp.
+//
+
+tst_ignore( "ring r2=(32003,a),x,dp;" );
+ring r2=(32003,a),x,dp;
+minpoly=a^4+8734*a^3+a^2+11817*a+1;
+
+poly f;
+poly g;
+
+// first, some of the above examples
+
+f=3812*x^22-6874*x^21+12586*x^20+3003*x^19-9568*x^18+11117*x^17+7524*x^16+11138*x^15-9743*x^14+1892*x^13+12485*x^12-569*x^11-8265*x^10-5991*x^9+13701*x^8+2644*x^7-3936*x^6-15875*x^5+1289*x^4+3956*x^3-10099*x^2-6616*x+5401;
+
+g=10652*x^20-4144*x^19-11810*x^18+8237*x^17-8675*x^16+6545*x^15-3601*x^14+14559*x^13+8090*x^12-8378*x^11+14255*x^10+8767*x^9-13932*x^8+11602*x^7-10751*x^6-4899*x^5+8637*x^4+14084*x^3-11583*x^2+5882*x+885;
+
+resultant(f, g, x);
+resultant(f, g+1, x);
+
+f=-7448*x^36+7714*x^35-13927*x^34+3932*x^33+3682*x^32-10010*x^31+5268*x^30+13873*x^29+13357*x^28-833*x^27-184*x^26+15676*x^25+13250*x^24-1501*x^23+4047*x^22-12971*x^21+1837*x^20-95*x^19+13420*x^18+6133*x^17+1202*x^16-10228*x^15+15007*x^14-5205*x^13+5458*x^12+11076*x^11-488*x^10-9898*x^9+7409*x^8+13329*x^7-11898*x^6-7619*x^5-8536*x^4+12785*x^3+11896*x^2-12853*x+2549;
+
+g=5104*x^34-12263*x^33-1609*x^32-6796*x^31-2994*x^30+7028*x^29-3014*x^28-1266*x^27-12321*x^26+14482*x^25+3663*x^24-3726*x^23+6983*x^22+1260*x^21-4850*x^20-2975*x^19+11044*x^18-14330*x^17-6739*x^16-11849*x^15+1213*x^14+3785*x^13+4837*x^12-11046*x^11+13804*x^10+8188*x^9+8122*x^8+10487*x^7+6814*x^6+9533*x^5-11550*x^4-10878*x^3-699*x^2-14751*x+3845;
+
+resultant(f, g, x);
+resultant(f, g+1, x);
+
+// now, examples involving the algebraic variable
+
+f=(4338*a^3*x^22+30273*a^2*x^22+23626*a*x^22+28673*x^22+2688*a^3*x^21+18069*a^2*x^21+615*a*x^21+11551*x^21+23638*a^3*x^20+20268*a^2*x^20+20021*a*x^20+6060*x^20+15921*a^3*x^19+10779*a^2*x^19+5367*a*x^19+13257*x^19+23678*a^3*x^18+21957*a^2*x^18+22070*a*x^18+13372*x^18+22158*a^3*x^17+22426*a^2*x^17+27501*a*x^17+8746*x^17+13959*a^3*x^16+6774*a^2*x^16+2671*a*x^16+7421*x^16+14110*a^3*x^15+28074*a^2*x^15+31056*a*x^15+9720*x^15+25856*a^3*x^14+27097*a^2*x^14+11589*a*x^14+9779*x^14+28980*a^3*x^13+31376*a^2*x^13+24496*a*x^13+2505*x^13+5276*a^3*x^12+643*a^2*x^12+25052*a*x^12+2373*x^12+5591*a^3*x^11+20901*a^2*x^11+25344*a*x^11+28303*x^11+10490*a^3*x^10+11510*a^2*x^10+30069*a*x^10+26527*x^10+23272*a^3*x^9+6872*a^2*x^9+20576*a*x^9+26446*x^9+20162*a^3*x^8+6455*a^2*x^8+13121*a*x^8+3588*x^8+6763*a^3*x^7+9099*a^2*x^7+13479*a*x^7+31228*x^7+12100*a^3*x^6+8734*a^2*x^6+17132*a*x^6+11923*x^6);
+
+g=(21796*a^3*x^21+23013*a^2*x^21+19320*a*x^21+16794*x^21+15777*a^3*x^20+10745*a^2*x^20+18575*a*x^20+14270*x^20+21816*a^3*x^19+8096*a^2*x^19+22632*a*x^19+2859*x^19+11970*a^3*x^18+13157*a^2*x^18+21826*a*x^18+17544*x^18+22237*a^3*x^17+23414*a^2*x^17+28069*a*x^17+21121*x^17+20441*a^3*x^16+23414*a^2*x^16+17132*a*x^16+19928*x^16+4814*a^3*x^15+31789*a^2*x^15+26593*a*x^15+20904*x^15+2605*a^3*x^14+24991*a^2*x^14+19457*a*x^14+27354*x^14+7054*a^3*x^13+13551*a^2*x^13+8720*a*x^13+11331*x^13+20837*a^3*x^12+25525*a^2*x^12+12680*a*x^12+23860*x^12+17788*a^3*x^11+16365*a^2*x^11+20606*a*x^11+8950*x^11+5879*a^3*x^10+11444*a^2*x^10+8086*a*x^10+28735*x^10+10518*a^3*x^9+21493*a^2*x^9+13526*a*x^9+5403*x^9+4629*a^3*x^8+26419*a^2*x^8+2255*a*x^8+29703*x^8+21943*a^3*x^7+22203*a^2*x^7+10505*a*x^7+31699*x^7+25572*a^3*x^6+1423*a^2*x^6+25883*a*x^6+11415*x^6);
+
+resultant(f, g, x);
+resultant(f, g+1, x);
+
+f=(30402*a^2*x^11+18403*a^3*x^10+1601*a*x^10+7960*a^3*x^9+5100*a^2*x^9+12917*a*x^9+23503*x^9+19710*a^3*x^8+19683*a^2*x^8+5001*a*x^8+13321*x^8+8701*a^3*x^7+4852*a^2*x^7+7827*a*x^7+19791*x^7+31927*a^3*x^6+5410*a^2*x^6+5467*a*x^6+16037*x^6+17185*a^3*x^5+8307*a^2*x^5+19811*a*x^5+10473*x^5+19945*a^3*x^4+21657*a^2*x^4+10273*a*x^4+23983*x^4);
+
+g=(21403*a^3*x^22+7448*a^2*x^22+10810*a*x^22+21081*x^22+704*a^3*x^21+5272*a^2*x^21+17829*a*x^21+16706*x^21+10892*a^3*x^20+1510*a^2*x^20+15586*a*x^20+2137*x^20+11244*a^3*x^19+10003*a^2*x^19+3058*a*x^19+19748*x^19+12837*a^3*x^18+8949*a^2*x^18+2293*a*x^18+23488*x^18+29674*a^3*x^17+3512*a^2*x^17+18761*a*x^17+23333*x^17+22922*a^3*x^16+25227*a^2*x^16+12018*a*x^16+16378*x^16+8276*a^3*x^15+11474*a^2*x^15+976*a*x^15+5711*x^15+28827*a^3*x^14+562*a^2*x^14+14734*a*x^14+1896*x^14+21302*a^3*x^13+5155*a^2*x^13+10181*a*x^13+11503*x^13+10353*a^3*x^12+8770*a^2*x^12+16539*a*x^12+21667*x^12+4499*a^3*x^11+28026*a^2*x^11+3189*a*x^11+6258*x^11+27740*a^3*x^10+29513*a^2*x^10+19135*a*x^10+31028*x^10+10383*a^3*x^9+1093*a^2*x^9+10434*a*x^9+9615*x^9+8069*a^3*x^8+8198*a^2*x^8+24314*a*x^8+31073*x^8+2167*a^3*x^7+4389*a^2*x^7+3275*a*x^7+31051*x^7+12541*a^3*x^6+19566*a^2*x^6+2389*a*x^6+25016*x^6);
+
+resultant(f, g, x);
+resultant(f, g+1, x);
+
+f=(6932*a^3*x^30+8805*a^2*x^30+5025*a*x^30+10521*x^30+13279*a^3*x^29+23946*a^2*x^29+27819*a*x^29+10032*x^29+2815*a^3*x^28+8075*a^2*x^28+10956*a*x^28+6853*x^28+14883*a^3*x^27+24295*a^2*x^27+2927*a*x^27+4389*x^27+23314*a^3*x^26+16933*a^2*x^26+10692*a*x^26+26362*x^26+9650*a^3*x^25+25794*a^2*x^25+31656*a*x^25+5294*x^25+4194*a^3*x^24+22900*a^2*x^24+219*a*x^24+7145*x^24+30606*a^3*x^23+1584*a^2*x^23+20182*a*x^23+19601*x^23+2310*a^3*x^22+16413*a^2*x^22+22745*a*x^22+23328*x^22+6311*a^3*x^21+16014*a^2*x^21+29004*a*x^21+3675*x^21+22006*a^3*x^20+19717*a^2*x^20+31090*a*x^20+15989*x^20+27117*a^3*x^19+29878*a^2*x^19+29895*a*x^19+10204*x^19+3117*a^3*x^18+1944*a^2*x^18+29310*a*x^18+10935*x^18+10617*a^3*x^17+16150*a^2*x^17+13962*a*x^17+29419*x^17+16368*a^3*x^16+27265*a^2*x^16+11482*a*x^16+2769*x^16+26177*a^3*x^15+19647*a^2*x^15+19994*a*x^15+5812*x^15+21191*a^3*x^14+2344*a^2*x^14+8122*a*x^14+18768*x^14+31816*a^3*x^13+22070*a^2*x^13+21686*a*x^13+9954*x^13+5285*a^3*x^12+28355*a^2*x^12+21554*a*x^12+15017*x^12+20844*a^3*x^11+22880*a^2*x^11+29139*a*x^11+10198*x^11+22187*a^3*x^10+1845*a^2*x^10+124*a*x^10+20875*x^10+23655*a^3*x^9+27689*a^2*x^9+462*a*x^9+9921*x^9+27553*a^3*x^8+4227*a^2*x^8+14891*a*x^8+28692*x^8+15422*a^3*x^7+18364*a^2*x^7+6643*a*x^7+9238*x^7);
+
+g=(10159*a^3*x^31+16131*a^2*x^31+13528*a*x^31+23305*x^31+16104*a^3*x^30+31322*a^2*x^30+15822*a*x^30+15332*x^30+6117*a^3*x^29+22754*a^2*x^29+22263*a*x^29+15247*x^29+21262*a^3*x^28+21290*a^2*x^28+22581*a*x^28+19917*x^28+11941*a^3*x^27+14500*a^2*x^27+752*a*x^27+22628*x^27+20010*a^3*x^26+2870*a^2*x^26+4997*a*x^26+31196*x^26+435*a^3*x^25+10675*a^2*x^25+19556*a*x^25+8954*x^25+6160*a^3*x^24+8179*a^2*x^24+13464*a*x^24+5133*x^24+10300*a^3*x^23+16922*a^2*x^23+10977*a*x^23+8282*x^23+26357*a^3*x^22+29916*a^2*x^22+6574*a*x^22+27270*x^22+2454*a^3*x^21+18575*a^2*x^21+14149*a*x^21+19814*x^21+5816*a^3*x^20+25575*a^2*x^20+6813*a*x^20+7745*x^20+25535*a^3*x^19+29450*a^2*x^19+8899*a*x^19+29544*x^19+26603*a^3*x^18+8490*a^2*x^18+28259*a*x^18+19936*x^18+28599*a^3*x^17+9111*a^2*x^17+1453*a*x^17+29481*x^17+18730*a^3*x^16+6899*a^2*x^16+28194*a*x^16+23953*x^16+31494*a^3*x^15+2138*a^2*x^15+15148*a*x^15+22737*x^15+25852*a^3*x^14+10731*a^2*x^14+16293*a*x^14+13075*x^14+15602*a^3*x^13+11381*a^2*x^13+28493*a*x^13+27161*x^13+7432*a^3*x^12+20270*a^2*x^12+13437*a*x^12+313*x^12+12468*a^3*x^11+29981*a^2*x^11+28662*a*x^11+24642*x^11+11738*a^3*x^10+21558*a^2*x^10+20076*a*x^10+27087*x^10+18698*a^3*x^9+31594*a^2*x^9+3443*a*x^9+9974*x^9+9534*a^3*x^8+13115*a^2*x^8+11104*a*x^8+552*x^8+6650*a^3*x^7+20291*a^2*x^7+26968*a*x^7+14024*x^7+23978*a^3*x^6+20409*a^2*x^6+19489*a*x^6+30389*x^6);
+
+resultant(f, g, x);
+resultant(f, g+1, x);
+
+f=(3942*a^3*x^23+29103*a^2*x^23+12041*a*x^23+25126*x^23+20894*a^3*x^22+28895*a^2*x^22+11505*a*x^22+17368*x^22+13062*a^3*x^21+2762*a^2*x^21+21062*a*x^21+4750*x^21+23462*a^3*x^20+20870*a^2*x^20+2409*a*x^20+29192*x^20+11569*a^3*x^19+16322*a^2*x^19+11901*a*x^19+8892*x^19+9555*a^3*x^18+15798*a^2*x^18+2183*a*x^18+28858*x^18+10484*a^3*x^17+29114*a^2*x^17+7236*a*x^17+23244*x^17+14649*a^3*x^16+23659*a^2*x^16+18881*a*x^16+7039*x^16+5085*a^3*x^15+1172*a^2*x^15+24012*a*x^15+6392*x^15+29778*a^3*x^14+20684*a^2*x^14+13249*a*x^14+6939*x^14+28402*a^3*x^13+20158*a^2*x^13+11735*a*x^13+15324*x^13+16418*a^3*x^12+13712*a^2*x^12+28773*a*x^12+10656*x^12+27721*a^3*x^11+31296*a^2*x^11+5580*a*x^11+19101*x^11+20442*a^3*x^10+24260*a^2*x^10+22045*a*x^10+15747*x^10+16325*a^3*x^9+23879*a^2*x^9+6065*a*x^9+17821*x^9+10614*a^3*x^8+18747*a^2*x^8+19984*a*x^8+31361*x^8+2092*a^3*x^7+12565*a^2*x^7+16373*a*x^7+22666*x^7+16051*a^3*x^6+5112*a^2*x^6+3568*a*x^6+31215*x^6+7049*a^3*x^5+3561*a^2*x^5+23340*a*x^5+7954*x^5);
+
+g=(7790*a^3*x^31+10495*a^2*x^31+3298*a*x^31+22265*x^31+17500*a^3*x^30+10225*a^2*x^30+31566*a*x^30+912*x^30+5002*a^3*x^29+3880*a^2*x^29+5880*a*x^29+27490*x^29+10868*a^3*x^28+31164*a^2*x^28+29132*a*x^28+719*x^28+629*a^3*x^27+21530*a^2*x^27+28414*a*x^27+5748*x^27+18413*a^3*x^26+22024*a^2*x^26+2681*a*x^26+26497*x^26+29395*a^3*x^25+14381*a^2*x^25+23428*a*x^25+6567*x^25+15793*a^3*x^24+9976*a^2*x^24+31655*a*x^24+24728*x^24+22812*a^3*x^23+26206*a^2*x^23+6912*a*x^23+7265*x^23+17258*a^3*x^22+30267*a^2*x^22+25929*a*x^22+16493*x^22+12895*a^3*x^21+15734*a^2*x^21+29806*a*x^21+20282*x^21+14651*a^3*x^20+12822*a^2*x^20+12802*a*x^20+31183*x^20+51*a^3*x^19+25722*a^2*x^19+26227*a*x^19+27737*x^19+14804*a^3*x^18+255*a^2*x^18+24186*a*x^18+14659*x^18+10845*a^3*x^17+27841*a^2*x^17+15018*a*x^17+15319*x^17+22625*a^3*x^16+17940*a^2*x^16+13545*a*x^16+29977*x^16+12035*a^3*x^15+11966*a^2*x^15+20021*a*x^15+6*x^15+28097*a^3*x^14+6249*a^2*x^14+14666*a*x^14+22252*x^14+24456*a^3*x^13+12304*a^2*x^13+1870*a*x^13+26782*x^13+16348*a^3*x^12+25937*a^2*x^12+21062*a*x^12+9052*x^12+20170*a^3*x^11+14401*a^2*x^11+4713*a*x^11+9405*x^11+18164*a^3*x^10+292*a^2*x^10+9410*a*x^10+25268*x^10+2490*a^3*x^9+6288*a^2*x^9+28090*a*x^9+9720*x^9+13228*a^3*x^8+22541*a^2*x^8+19371*a*x^8+15795*x^8+1988*a^3*x^7+22172*a^2*x^7+14147*a*x^7+22800*x^7+11858*a^3*x^6+21917*a^2*x^6+21057*a*x^6+4514*x^6+97*a^3*x^5+14373*a^2*x^5+18053*a*x^5+6456*x^5);
+
+resultant(f, g, x);
+resultant(f, g+1, x);
+
+f=(30992*a^3*x^58+22948*a^2*x^58+10015*a*x^58+1073*x^58+18314*a^3*x^57+20073*a^2*x^57+22488*a*x^57+9402*x^57+17300*a^3*x^56+14831*a^2*x^56+26887*a*x^56+4935*x^56+26115*a^3*x^55+12934*a^2*x^55+20509*a*x^55+918*x^55+2507*a^3*x^54+5388*a^2*x^54+1772*a*x^54+28695*x^54+10945*a^3*x^53+4883*a^2*x^53+10536*a*x^53+24376*x^53+27275*a^3*x^52+14030*a^2*x^52+22660*a*x^52+21483*x^52+26646*a^3*x^51+10827*a^2*x^51+5408*a*x^51+17539*x^51+28027*a^3*x^50+2173*a^2*x^50+2283*a*x^50+11199*x^50+21879*a^3*x^49+29075*a^2*x^49+27564*a*x^49+26453*x^49+12193*a^3*x^48+23514*a^2*x^48+26819*a*x^48+19138*x^48+2586*a^3*x^47+3548*a^2*x^47+4181*a*x^47+31616*x^47+1166*a^3*x^46+4516*a^2*x^46+28352*a*x^46+11078*x^46+6154*a^3*x^45+31935*a^2*x^45+5097*a*x^45+12528*x^45+12919*a^3*x^44+25456*a^2*x^44+22681*a*x^44+8896*x^44+31045*a^3*x^43+24933*a^2*x^43+31089*a*x^43+4350*x^43+8333*a^3*x^42+22706*a^2*x^42+13*a*x^42+27625*x^42+1543*a^3*x^41+12183*a^2*x^41+6605*a*x^41+8748*x^41+4405*a^3*x^40+12876*a^2*x^40+6643*a*x^40+6818*x^40+23398*a^3*x^39+7637*a^2*x^39+17594*a*x^39+28548*x^39+9946*a^3*x^38+26913*a^2*x^38+12163*a*x^38+12432*x^38+20206*a^3*x^37+28123*a^2*x^37+27122*a*x^37+714*x^37+8552*a^3*x^36+4912*a^2*x^36+28324*a*x^36+10002*x^36+20129*a^3*x^35+3836*a^2*x^35+8003*a*x^35+28851*x^35+31693*a^3*x^34+28313*a^2*x^34+28756*a*x^34+866*x^34+16979*a^3*x^33+1241*a^2*x^33+13541*a*x^33+15837*x^33+11228*a^3*x^32+20746*a^2*x^32+29871*a*x^32+8014*x^32+421*a^3*x^31+25890*a^2*x^31+17989*a*x^31+12752*x^31+2877*a^3*x^30+27001*a^2*x^30+27903*a*x^30+10401*x^30+26701*a^3*x^29+26470*a^2*x^29+18273*a*x^29+15917*x^29+27051*a^3*x^28+25885*a^2*x^28+5757*a*x^28+22254*x^28+16901*a^3*x^27+15683*a^2*x^27+494*a*x^27+8580*x^27+9662*a^3*x^26+31031*a^2*x^26+6613*a*x^26+28791*x^26+14952*a^3*x^25+22011*a^2*x^25+159*a*x^25+30050*x^25+15689*a^3*x^24+11636*a^2*x^24+16643*a*x^24+11419*x^24+23851*a^3*x^23+6932*a^2*x^23+26864*a*x^23+22734*x^23+8225*a^3*x^22+7001*a^2*x^22+15435*a*x^22+19011*x^22+5589*a^3*x^21+31994*a^2*x^21+15741*a*x^21+7547*x^21+23329*a^3*x^20+2414*a^2*x^20+19361*a*x^20+8871*x^20+16038*a^3*x^19+27673*a^2*x^19+31205*a*x^19+28802*x^19+503*a^3*x^18+16146*a^2*x^18+11951*a*x^18+27659*x^18+5568*a^3*x^17+20655*a^2*x^17+10175*a*x^17+7756*x^17);
+
+g=(9770*a^3*x^59+23847*a^2*x^59+6476*a*x^59+6123*x^59+8421*a^3*x^58+1072*a^2*x^58+22097*a*x^58+29093*x^58+117*a^3*x^57+16911*a^2*x^57+18234*a*x^57+927*x^57+23772*a^3*x^56+22082*a^2*x^56+31256*a*x^56+20032*x^56+31604*a^3*x^55+2212*a^2*x^55+26550*a*x^55+21031*x^55+27901*a^3*x^54+9601*a^2*x^54+27259*a*x^54+26967*x^54+10891*a^3*x^53+9321*a^2*x^53+16017*a*x^53+11268*x^53+19635*a^3*x^52+22384*a^2*x^52+26394*a*x^52+9188*x^52+30422*a^3*x^51+7923*a^2*x^51+4253*a*x^51+27959*x^51+29878*a^3*x^50+31200*a^2*x^50+3950*a*x^50+5908*x^50+21728*a^3*x^49+17068*a^2*x^49+12530*a*x^49+27968*x^49+8548*a^3*x^48+14100*a^2*x^48+3133*a*x^48+14435*x^48+9732*a^3*x^47+25047*a^2*x^47+6513*a*x^47+8842*x^47+2627*a^3*x^46+9720*a^2*x^46+16557*a*x^46+14683*x^46+528*a^3*x^45+19121*a^2*x^45+9027*a*x^45+26620*x^45+30387*a^3*x^44+9802*a^2*x^44+3749*a*x^44+13517*x^44+2453*a^3*x^43+14699*a^2*x^43+19919*a*x^43+21225*x^43+28310*a^3*x^42+4499*a^2*x^42+3955*a*x^42+7682*x^42+26192*a^3*x^41+3875*a^2*x^41+18658*a*x^41+14678*x^41+23520*a^3*x^40+20042*a^2*x^40+10533*a*x^40+23098*x^40+3162*a^3*x^39+9685*a^2*x^39+15412*a*x^39+10106*x^39+8206*a^3*x^38+29658*a^2*x^38+17362*a*x^38+25937*x^38+12646*a^3*x^37+11011*a^2*x^37+28535*a*x^37+5519*x^37+3154*a^3*x^36+4244*a^2*x^36+28825*a*x^36+5374*x^36+28302*a^3*x^35+1136*a^2*x^35+16491*a*x^35+12998*x^35+30512*a^3*x^34+22305*a^2*x^34+26506*a*x^34+16012*x^34+17373*a^3*x^33+17704*a^2*x^33+24901*a*x^33+2583*x^33+3047*a^3*x^32+15647*a^2*x^32+20674*a*x^32+12458*x^32+17540*a^3*x^31+9355*a^2*x^31+19841*a*x^31+2413*x^31+3035*a^3*x^30+16099*a^2*x^30+20919*a*x^30+24963*x^30+6799*a^3*x^29+31086*a^2*x^29+11471*a*x^29+4081*x^29+423*a^3*x^28+7304*a^2*x^28+4181*a*x^28+16071*x^28+16654*a^3*x^27+19898*a^2*x^27+8695*a*x^27+29767*x^27+12283*a^3*x^26+30100*a^2*x^26+1878*a*x^26+21685*x^26+19555*a^3*x^25+19749*a^2*x^25+10671*a*x^25+17764*x^25+21311*a^3*x^24+16481*a^2*x^24+3963*a*x^24+6023*x^24+31590*a^3*x^23+22987*a^2*x^23+13610*a*x^23+23584*x^23+16875*a^3*x^22+23911*a^2*x^22+27572*a*x^22+27474*x^22+8657*a^3*x^21+18438*a^2*x^21+31480*a*x^21+16007*x^21+10748*a^3*x^20+19771*a^2*x^20+12922*a*x^20+25108*x^20+10465*a^3*x^19+25448*a^2*x^19+1174*a*x^19+13826*x^19+26840*a^3*x^18+31447*a^2*x^18+18936*a*x^18+17117*x^18+1648*a^3*x^17+22711*a^2*x^17+21403*a*x^17+24208*x^17+7784*a^3*x^16+3055*a^2*x^16+11088*a*x^16+13963*x^16);
+
+resultant(f, g, x);
+resultant(f, g+1, x);
+
+//
+// - ring r3=(32003,t),x,dp.
+//
+
+tst_ignore( "ring r3=(32003,t),x,dp;" );
+ring r3=(32003,t),x,dp;
+
+poly f;
+poly g;
+
+// first, some of the above examples
+
+f=3812*x^22-6874*x^21+12586*x^20+3003*x^19-9568*x^18+11117*x^17+7524*x^16+11138*x^15-9743*x^14+1892*x^13+12485*x^12-569*x^11-8265*x^10-5991*x^9+13701*x^8+2644*x^7-3936*x^6-15875*x^5+1289*x^4+3956*x^3-10099*x^2-6616*x+5401;
+
+g=10652*x^20-4144*x^19-11810*x^18+8237*x^17-8675*x^16+6545*x^15-3601*x^14+14559*x^13+8090*x^12-8378*x^11+14255*x^10+8767*x^9-13932*x^8+11602*x^7-10751*x^6-4899*x^5+8637*x^4+14084*x^3-11583*x^2+5882*x+885;
+
+resultant(f, g, x);
+resultant(f, g+1, x);
+
+f=-7448*x^36+7714*x^35-13927*x^34+3932*x^33+3682*x^32-10010*x^31+5268*x^30+13873*x^29+13357*x^28-833*x^27-184*x^26+15676*x^25+13250*x^24-1501*x^23+4047*x^22-12971*x^21+1837*x^20-95*x^19+13420*x^18+6133*x^17+1202*x^16-10228*x^15+15007*x^14-5205*x^13+5458*x^12+11076*x^11-488*x^10-9898*x^9+7409*x^8+13329*x^7-11898*x^6-7619*x^5-8536*x^4+12785*x^3+11896*x^2-12853*x+2549;
+
+g=5104*x^34-12263*x^33-1609*x^32-6796*x^31-2994*x^30+7028*x^29-3014*x^28-1266*x^27-12321*x^26+14482*x^25+3663*x^24-3726*x^23+6983*x^22+1260*x^21-4850*x^20-2975*x^19+11044*x^18-14330*x^17-6739*x^16-11849*x^15+1213*x^14+3785*x^13+4837*x^12-11046*x^11+13804*x^10+8188*x^9+8122*x^8+10487*x^7+6814*x^6+9533*x^5-11550*x^4-10878*x^3-699*x^2-14751*x+3845;
+
+resultant(f, g, x);
+resultant(f, g+1, x);
+
+// now, examples involving the transcendental variable
+
+f=(4338*t^3*x^22+30273*t^2*x^22+23626*t*x^22+28673*x^22+2688*t^3*x^21+18069*t^2*x^21+615*t*x^21+11551*x^21+23638*t^3*x^20+20268*t^2*x^20+20021*t*x^20+6060*x^20+15921*t^3*x^19+10779*t^2*x^19+5367*t*x^19+13257*x^19+23678*t^3*x^18+21957*t^2*x^18+22070*t*x^18+13372*x^18+22158*t^3*x^17+22426*t^2*x^17+27501*t*x^17+8746*x^17+13959*t^3*x^16+6774*t^2*x^16+2671*t*x^16+7421*x^16+14110*t^3*x^15+28074*t^2*x^15+31056*t*x^15+9720*x^15+25856*t^3*x^14+27097*t^2*x^14+11589*t*x^14+9779*x^14+28980*t^3*x^13+31376*t^2*x^13+24496*t*x^13+2505*x^13+5276*t^3*x^12+643*t^2*x^12+25052*t*x^12+2373*x^12+5591*t^3*x^11+20901*t^2*x^11+25344*t*x^11+28303*x^11+10490*t^3*x^10+11510*t^2*x^10+30069*t*x^10+26527*x^10+23272*t^3*x^9+6872*t^2*x^9+20576*t*x^9+26446*x^9+20162*t^3*x^8+6455*t^2*x^8+13121*t*x^8+3588*x^8+6763*t^3*x^7+9099*t^2*x^7+13479*t*x^7+31228*x^7+12100*t^3*x^6+8734*t^2*x^6+17132*t*x^6+11923*x^6);
+
+g=(21796*t^3*x^21+23013*t^2*x^21+19320*t*x^21+16794*x^21+15777*t^3*x^20+10745*t^2*x^20+18575*t*x^20+14270*x^20+21816*t^3*x^19+8096*t^2*x^19+22632*t*x^19+2859*x^19+11970*t^3*x^18+13157*t^2*x^18+21826*t*x^18+17544*x^18+22237*t^3*x^17+23414*t^2*x^17+28069*t*x^17+21121*x^17+20441*t^3*x^16+23414*t^2*x^16+17132*t*x^16+19928*x^16+4814*t^3*x^15+31789*t^2*x^15+26593*t*x^15+20904*x^15+2605*t^3*x^14+24991*t^2*x^14+19457*t*x^14+27354*x^14+7054*t^3*x^13+13551*t^2*x^13+8720*t*x^13+11331*x^13+20837*t^3*x^12+25525*t^2*x^12+12680*t*x^12+23860*x^12+17788*t^3*x^11+16365*t^2*x^11+20606*t*x^11+8950*x^11+5879*t^3*x^10+11444*t^2*x^10+8086*t*x^10+28735*x^10+10518*t^3*x^9+21493*t^2*x^9+13526*t*x^9+5403*x^9+4629*t^3*x^8+26419*t^2*x^8+2255*t*x^8+29703*x^8+21943*t^3*x^7+22203*t^2*x^7+10505*t*x^7+31699*x^7+25572*t^3*x^6+1423*t^2*x^6+25883*t*x^6+11415*x^6);
+
+resultant(f, g, x);
+resultant(f, g+1, x);
+
+f=(30402*t^2*x^11+18403*t^3*x^10+1601*t*x^10+7960*t^3*x^9+5100*t^2*x^9+12917*t*x^9+23503*x^9+19710*t^3*x^8+19683*t^2*x^8+5001*t*x^8+13321*x^8+8701*t^3*x^7+4852*t^2*x^7+7827*t*x^7+19791*x^7+31927*t^3*x^6+5410*t^2*x^6+5467*t*x^6+16037*x^6+17185*t^3*x^5+8307*t^2*x^5+19811*t*x^5+10473*x^5+19945*t^3*x^4+21657*t^2*x^4+10273*t*x^4+23983*x^4);
+
+g=(21403*t^3*x^22+7448*t^2*x^22+10810*t*x^22+21081*x^22+704*t^3*x^21+5272*t^2*x^21+17829*t*x^21+16706*x^21+10892*t^3*x^20+1510*t^2*x^20+15586*t*x^20+2137*x^20+11244*t^3*x^19+10003*t^2*x^19+3058*t*x^19+19748*x^19+12837*t^3*x^18+8949*t^2*x^18+2293*t*x^18+23488*x^18+29674*t^3*x^17+3512*t^2*x^17+18761*t*x^17+23333*x^17+22922*t^3*x^16+25227*t^2*x^16+12018*t*x^16+16378*x^16+8276*t^3*x^15+11474*t^2*x^15+976*t*x^15+5711*x^15+28827*t^3*x^14+562*t^2*x^14+14734*t*x^14+1896*x^14+21302*t^3*x^13+5155*t^2*x^13+10181*t*x^13+11503*x^13+10353*t^3*x^12+8770*t^2*x^12+16539*t*x^12+21667*x^12+4499*t^3*x^11+28026*t^2*x^11+3189*t*x^11+6258*x^11+27740*t^3*x^10+29513*t^2*x^10+19135*t*x^10+31028*x^10+10383*t^3*x^9+1093*t^2*x^9+10434*t*x^9+9615*x^9+8069*t^3*x^8+8198*t^2*x^8+24314*t*x^8+31073*x^8+2167*t^3*x^7+4389*t^2*x^7+3275*t*x^7+31051*x^7+12541*t^3*x^6+19566*t^2*x^6+2389*t*x^6+25016*x^6);
+
+resultant(f, g, x);
+resultant(f, g+1, x);
+
+f=(6932*t^3*x^30+8805*t^2*x^30+5025*t*x^30+10521*x^30+13279*t^3*x^29+23946*t^2*x^29+27819*t*x^29+10032*x^29+2815*t^3*x^28+8075*t^2*x^28+10956*t*x^28+6853*x^28+14883*t^3*x^27+24295*t^2*x^27+2927*t*x^27+4389*x^27+23314*t^3*x^26+16933*t^2*x^26+10692*t*x^26+26362*x^26+9650*t^3*x^25+25794*t^2*x^25+31656*t*x^25+5294*x^25+4194*t^3*x^24+22900*t^2*x^24+219*t*x^24+7145*x^24+30606*t^3*x^23+1584*t^2*x^23+20182*t*x^23+19601*x^23+2310*t^3*x^22+16413*t^2*x^22+22745*t*x^22+23328*x^22+6311*t^3*x^21+16014*t^2*x^21+29004*t*x^21+3675*x^21+22006*t^3*x^20+19717*t^2*x^20+31090*t*x^20+15989*x^20+27117*t^3*x^19+29878*t^2*x^19+29895*t*x^19+10204*x^19+3117*t^3*x^18+1944*t^2*x^18+29310*t*x^18+10935*x^18+10617*t^3*x^17+16150*t^2*x^17+13962*t*x^17+29419*x^17+16368*t^3*x^16+27265*t^2*x^16+11482*t*x^16+2769*x^16+26177*t^3*x^15+19647*t^2*x^15+19994*t*x^15+5812*x^15+21191*t^3*x^14+2344*t^2*x^14+8122*t*x^14+18768*x^14+31816*t^3*x^13+22070*t^2*x^13+21686*t*x^13+9954*x^13+5285*t^3*x^12+28355*t^2*x^12+21554*t*x^12+15017*x^12+20844*t^3*x^11+22880*t^2*x^11+29139*t*x^11+10198*x^11+22187*t^3*x^10+1845*t^2*x^10+124*t*x^10+20875*x^10+23655*t^3*x^9+27689*t^2*x^9+462*t*x^9+9921*x^9+27553*t^3*x^8+4227*t^2*x^8+14891*t*x^8+28692*x^8+15422*t^3*x^7+18364*t^2*x^7+6643*t*x^7+9238*x^7);
+
+g=(10159*t^3*x^31+16131*t^2*x^31+13528*t*x^31+23305*x^31+16104*t^3*x^30+31322*t^2*x^30+15822*t*x^30+15332*x^30+6117*t^3*x^29+22754*t^2*x^29+22263*t*x^29+15247*x^29+21262*t^3*x^28+21290*t^2*x^28+22581*t*x^28+19917*x^28+11941*t^3*x^27+14500*t^2*x^27+752*t*x^27+22628*x^27+20010*t^3*x^26+2870*t^2*x^26+4997*t*x^26+31196*x^26+435*t^3*x^25+10675*t^2*x^25+19556*t*x^25+8954*x^25+6160*t^3*x^24+8179*t^2*x^24+13464*t*x^24+5133*x^24+10300*t^3*x^23+16922*t^2*x^23+10977*t*x^23+8282*x^23+26357*t^3*x^22+29916*t^2*x^22+6574*t*x^22+27270*x^22+2454*t^3*x^21+18575*t^2*x^21+14149*t*x^21+19814*x^21+5816*t^3*x^20+25575*t^2*x^20+6813*t*x^20+7745*x^20+25535*t^3*x^19+29450*t^2*x^19+8899*t*x^19+29544*x^19+26603*t^3*x^18+8490*t^2*x^18+28259*t*x^18+19936*x^18+28599*t^3*x^17+9111*t^2*x^17+1453*t*x^17+29481*x^17+18730*t^3*x^16+6899*t^2*x^16+28194*t*x^16+23953*x^16+31494*t^3*x^15+2138*t^2*x^15+15148*t*x^15+22737*x^15+25852*t^3*x^14+10731*t^2*x^14+16293*t*x^14+13075*x^14+15602*t^3*x^13+11381*t^2*x^13+28493*t*x^13+27161*x^13+7432*t^3*x^12+20270*t^2*x^12+13437*t*x^12+313*x^12+12468*t^3*x^11+29981*t^2*x^11+28662*t*x^11+24642*x^11+11738*t^3*x^10+21558*t^2*x^10+20076*t*x^10+27087*x^10+18698*t^3*x^9+31594*t^2*x^9+3443*t*x^9+9974*x^9+9534*t^3*x^8+13115*t^2*x^8+11104*t*x^8+552*x^8+6650*t^3*x^7+20291*t^2*x^7+26968*t*x^7+14024*x^7+23978*t^3*x^6+20409*t^2*x^6+19489*t*x^6+30389*x^6);
+
+resultant(f, g, x);
+resultant(f, g+1, x);
+
+f=(3942*t^3*x^23+29103*t^2*x^23+12041*t*x^23+25126*x^23+20894*t^3*x^22+28895*t^2*x^22+11505*t*x^22+17368*x^22+13062*t^3*x^21+2762*t^2*x^21+21062*t*x^21+4750*x^21+23462*t^3*x^20+20870*t^2*x^20+2409*t*x^20+29192*x^20+11569*t^3*x^19+16322*t^2*x^19+11901*t*x^19+8892*x^19+9555*t^3*x^18+15798*t^2*x^18+2183*t*x^18+28858*x^18+10484*t^3*x^17+29114*t^2*x^17+7236*t*x^17+23244*x^17+14649*t^3*x^16+23659*t^2*x^16+18881*t*x^16+7039*x^16+5085*t^3*x^15+1172*t^2*x^15+24012*t*x^15+6392*x^15+29778*t^3*x^14+20684*t^2*x^14+13249*t*x^14+6939*x^14+28402*t^3*x^13+20158*t^2*x^13+11735*t*x^13+15324*x^13+16418*t^3*x^12+13712*t^2*x^12+28773*t*x^12+10656*x^12+27721*t^3*x^11+31296*t^2*x^11+5580*t*x^11+19101*x^11+20442*t^3*x^10+24260*t^2*x^10+22045*t*x^10+15747*x^10+16325*t^3*x^9+23879*t^2*x^9+6065*t*x^9+17821*x^9+10614*t^3*x^8+18747*t^2*x^8+19984*t*x^8+31361*x^8+2092*t^3*x^7+12565*t^2*x^7+16373*t*x^7+22666*x^7+16051*t^3*x^6+5112*t^2*x^6+3568*t*x^6+31215*x^6+7049*t^3*x^5+3561*t^2*x^5+23340*t*x^5+7954*x^5);
+
+g=(7790*t^3*x^31+10495*t^2*x^31+3298*t*x^31+22265*x^31+17500*t^3*x^30+10225*t^2*x^30+31566*t*x^30+912*x^30+5002*t^3*x^29+3880*t^2*x^29+5880*t*x^29+27490*x^29+10868*t^3*x^28+31164*t^2*x^28+29132*t*x^28+719*x^28+629*t^3*x^27+21530*t^2*x^27+28414*t*x^27+5748*x^27+18413*t^3*x^26+22024*t^2*x^26+2681*t*x^26+26497*x^26+29395*t^3*x^25+14381*t^2*x^25+23428*t*x^25+6567*x^25+15793*t^3*x^24+9976*t^2*x^24+31655*t*x^24+24728*x^24+22812*t^3*x^23+26206*t^2*x^23+6912*t*x^23+7265*x^23+17258*t^3*x^22+30267*t^2*x^22+25929*t*x^22+16493*x^22+12895*t^3*x^21+15734*t^2*x^21+29806*t*x^21+20282*x^21+14651*t^3*x^20+12822*t^2*x^20+12802*t*x^20+31183*x^20+51*t^3*x^19+25722*t^2*x^19+26227*t*x^19+27737*x^19+14804*t^3*x^18+255*t^2*x^18+24186*t*x^18+14659*x^18+10845*t^3*x^17+27841*t^2*x^17+15018*t*x^17+15319*x^17+22625*t^3*x^16+17940*t^2*x^16+13545*t*x^16+29977*x^16+12035*t^3*x^15+11966*t^2*x^15+20021*t*x^15+6*x^15+28097*t^3*x^14+6249*t^2*x^14+14666*t*x^14+22252*x^14+24456*t^3*x^13+12304*t^2*x^13+1870*t*x^13+26782*x^13+16348*t^3*x^12+25937*t^2*x^12+21062*t*x^12+9052*x^12+20170*t^3*x^11+14401*t^2*x^11+4713*t*x^11+9405*x^11+18164*t^3*x^10+292*t^2*x^10+9410*t*x^10+25268*x^10+2490*t^3*x^9+6288*t^2*x^9+28090*t*x^9+9720*x^9+13228*t^3*x^8+22541*t^2*x^8+19371*t*x^8+15795*x^8+1988*t^3*x^7+22172*t^2*x^7+14147*t*x^7+22800*x^7+11858*t^3*x^6+21917*t^2*x^6+21057*t*x^6+4514*x^6+97*t^3*x^5+14373*t^2*x^5+18053*t*x^5+6456*x^5);
+
+resultant(f, g, x);
+resultant(f, g+1, x);
+
+f=(30992*t^3*x^58+22948*t^2*x^58+10015*t*x^58+1073*x^58+18314*t^3*x^57+20073*t^2*x^57+22488*t*x^57+9402*x^57+17300*t^3*x^56+14831*t^2*x^56+26887*t*x^56+4935*x^56+26115*t^3*x^55+12934*t^2*x^55+20509*t*x^55+918*x^55+2507*t^3*x^54+5388*t^2*x^54+1772*t*x^54+28695*x^54+10945*t^3*x^53+4883*t^2*x^53+10536*t*x^53+24376*x^53+27275*t^3*x^52+14030*t^2*x^52+22660*t*x^52+21483*x^52+26646*t^3*x^51+10827*t^2*x^51+5408*t*x^51+17539*x^51+28027*t^3*x^50+2173*t^2*x^50+2283*t*x^50+11199*x^50+21879*t^3*x^49+29075*t^2*x^49+27564*t*x^49+26453*x^49+12193*t^3*x^48+23514*t^2*x^48+26819*t*x^48+19138*x^48+2586*t^3*x^47+3548*t^2*x^47+4181*t*x^47+31616*x^47+1166*t^3*x^46+4516*t^2*x^46+28352*t*x^46+11078*x^46+6154*t^3*x^45+31935*t^2*x^45+5097*t*x^45+12528*x^45+12919*t^3*x^44+25456*t^2*x^44+22681*t*x^44+8896*x^44+31045*t^3*x^43+24933*t^2*x^43+31089*t*x^43+4350*x^43+8333*t^3*x^42+22706*t^2*x^42+13*t*x^42+27625*x^42+1543*t^3*x^41+12183*t^2*x^41+6605*t*x^41+8748*x^41+4405*t^3*x^40+12876*t^2*x^40+6643*t*x^40+6818*x^40+23398*t^3*x^39+7637*t^2*x^39+17594*t*x^39+28548*x^39+9946*t^3*x^38+26913*t^2*x^38+12163*t*x^38+12432*x^38+20206*t^3*x^37+28123*t^2*x^37+27122*t*x^37+714*x^37+8552*t^3*x^36+4912*t^2*x^36+28324*t*x^36+10002*x^36+20129*t^3*x^35+3836*t^2*x^35+8003*t*x^35+28851*x^35+31693*t^3*x^34+28313*t^2*x^34+28756*t*x^34+866*x^34+16979*t^3*x^33+1241*t^2*x^33+13541*t*x^33+15837*x^33+11228*t^3*x^32+20746*t^2*x^32+29871*t*x^32+8014*x^32+421*t^3*x^31+25890*t^2*x^31+17989*t*x^31+12752*x^31+2877*t^3*x^30+27001*t^2*x^30+27903*t*x^30+10401*x^30+26701*t^3*x^29+26470*t^2*x^29+18273*t*x^29+15917*x^29+27051*t^3*x^28+25885*t^2*x^28+5757*t*x^28+22254*x^28+16901*t^3*x^27+15683*t^2*x^27+494*t*x^27+8580*x^27+9662*t^3*x^26+31031*t^2*x^26+6613*t*x^26+28791*x^26+14952*t^3*x^25+22011*t^2*x^25+159*t*x^25+30050*x^25+15689*t^3*x^24+11636*t^2*x^24+16643*t*x^24+11419*x^24+23851*t^3*x^23+6932*t^2*x^23+26864*t*x^23+22734*x^23+8225*t^3*x^22+7001*t^2*x^22+15435*t*x^22+19011*x^22+5589*t^3*x^21+31994*t^2*x^21+15741*t*x^21+7547*x^21+23329*t^3*x^20+2414*t^2*x^20+19361*t*x^20+8871*x^20+16038*t^3*x^19+27673*t^2*x^19+31205*t*x^19+28802*x^19+503*t^3*x^18+16146*t^2*x^18+11951*t*x^18+27659*x^18+5568*t^3*x^17+20655*t^2*x^17+10175*t*x^17+7756*x^17);
+
+g=(9770*t^3*x^59+23847*t^2*x^59+6476*t*x^59+6123*x^59+8421*t^3*x^58+1072*t^2*x^58+22097*t*x^58+29093*x^58+117*t^3*x^57+16911*t^2*x^57+18234*t*x^57+927*x^57+23772*t^3*x^56+22082*t^2*x^56+31256*t*x^56+20032*x^56+31604*t^3*x^55+2212*t^2*x^55+26550*t*x^55+21031*x^55+27901*t^3*x^54+9601*t^2*x^54+27259*t*x^54+26967*x^54+10891*t^3*x^53+9321*t^2*x^53+16017*t*x^53+11268*x^53+19635*t^3*x^52+22384*t^2*x^52+26394*t*x^52+9188*x^52+30422*t^3*x^51+7923*t^2*x^51+4253*t*x^51+27959*x^51+29878*t^3*x^50+31200*t^2*x^50+3950*t*x^50+5908*x^50+21728*t^3*x^49+17068*t^2*x^49+12530*t*x^49+27968*x^49+8548*t^3*x^48+14100*t^2*x^48+3133*t*x^48+14435*x^48+9732*t^3*x^47+25047*t^2*x^47+6513*t*x^47+8842*x^47+2627*t^3*x^46+9720*t^2*x^46+16557*t*x^46+14683*x^46+528*t^3*x^45+19121*t^2*x^45+9027*t*x^45+26620*x^45+30387*t^3*x^44+9802*t^2*x^44+3749*t*x^44+13517*x^44+2453*t^3*x^43+14699*t^2*x^43+19919*t*x^43+21225*x^43+28310*t^3*x^42+4499*t^2*x^42+3955*t*x^42+7682*x^42+26192*t^3*x^41+3875*t^2*x^41+18658*t*x^41+14678*x^41+23520*t^3*x^40+20042*t^2*x^40+10533*t*x^40+23098*x^40+3162*t^3*x^39+9685*t^2*x^39+15412*t*x^39+10106*x^39+8206*t^3*x^38+29658*t^2*x^38+17362*t*x^38+25937*x^38+12646*t^3*x^37+11011*t^2*x^37+28535*t*x^37+5519*x^37+3154*t^3*x^36+4244*t^2*x^36+28825*t*x^36+5374*x^36+28302*t^3*x^35+1136*t^2*x^35+16491*t*x^35+12998*x^35+30512*t^3*x^34+22305*t^2*x^34+26506*t*x^34+16012*x^34+17373*t^3*x^33+17704*t^2*x^33+24901*t*x^33+2583*x^33+3047*t^3*x^32+15647*t^2*x^32+20674*t*x^32+12458*x^32+17540*t^3*x^31+9355*t^2*x^31+19841*t*x^31+2413*x^31+3035*t^3*x^30+16099*t^2*x^30+20919*t*x^30+24963*x^30+6799*t^3*x^29+31086*t^2*x^29+11471*t*x^29+4081*x^29+423*t^3*x^28+7304*t^2*x^28+4181*t*x^28+16071*x^28+16654*t^3*x^27+19898*t^2*x^27+8695*t*x^27+29767*x^27+12283*t^3*x^26+30100*t^2*x^26+1878*t*x^26+21685*x^26+19555*t^3*x^25+19749*t^2*x^25+10671*t*x^25+17764*x^25+21311*t^3*x^24+16481*t^2*x^24+3963*t*x^24+6023*x^24+31590*t^3*x^23+22987*t^2*x^23+13610*t*x^23+23584*x^23+16875*t^3*x^22+23911*t^2*x^22+27572*t*x^22+27474*x^22+8657*t^3*x^21+18438*t^2*x^21+31480*t*x^21+16007*x^21+10748*t^3*x^20+19771*t^2*x^20+12922*t*x^20+25108*x^20+10465*t^3*x^19+25448*t^2*x^19+1174*t*x^19+13826*x^19+26840*t^3*x^18+31447*t^2*x^18+18936*t*x^18+17117*x^18+1648*t^3*x^17+22711*t^2*x^17+21403*t*x^17+24208*x^17+7784*t^3*x^16+3055*t^2*x^16+11088*t*x^16+13963*x^16);
+
+resultant(f, g, x);
+resultant(f, g+1, x);
+
+$
Index: Tst/Long/std_l.tst
===================================================================
--- Tst/Long/std_l.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Long/std_l.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,340 @@
+// $Id: std_l.tst,v 1.1.1.1 1998-04-17 15:07:35 obachman Exp $
+
+// std_l.tst -- long tests for std
+// uses rcyclic examples from ISSAC'98 paper
+
+LIB "tst.lib";
+tst_init();
+
+proc msetring(int charac, int nv, string ordering)
+{
+  execute "ring r = " + string(charac) + ",x(1.." + string(nv) + "), " +
+  ordering + ";"; 
+  keepring r;
+}
+
+proc ecyclic_i(int i, int comps)
+{
+  int j, k, l;
+  poly p, q;
+
+  for (j=1; j<=comps; j++)
+  {
+    q = 1;
+    l = j;
+    for (k=1; k<=i; k++)
+    {
+      q = q *var(l);
+      l = l + comps;
+    }
+    p = p + q;
+  }
+  return (p);
+}
+  
+proc rcyclic_i(int i, int vars, int comps)
+{
+  int j, k, l;
+  poly p, q;
+
+  for (j=1; j<=comps; j++)
+  {
+    q = 1;
+    l = j;
+    for (k=1; k<=i; k++)
+    {
+      q = q *var(l);
+      if (l == vars)
+      {
+        l = 1;
+      }
+      else
+      {
+        l = l + 1;
+      }
+    }
+    p = p + q;
+  }
+  return (p);
+}
+
+proc rcyclic_g(int vars, int comps)
+{
+  ideal id;
+  int i;
+  
+  for (i=1; i<vars; i++)
+  {
+    id[i] = rcyclic_i(i, vars, comps);
+  }
+
+  return (id);
+}
+
+proc gcyclic(int vars, list #)
+{
+  if (vars < 1)
+  {
+    vars = 2;
+  }
+  int comps = vars;
+  string kind = "n";
+
+  if (size(#) > 0)
+  {
+    if (typeof(#[1]) == "string")
+    {
+      if (#[1] == "r" || #[1] == "h")
+      {
+        kind = #[1];
+      }
+      if (size(#) > 1)
+      {
+        if (typeof(#[2]) == "int" && #[2] > 1 && #[2] < vars)
+        {
+          comps = #[2];
+        }
+      }
+    }
+    else
+    {
+      if (typeof(#[1]) == "int")
+      {
+        if (#[1] > 1 && #[1] < vars)
+        {
+          comps = #[1];
+        }
+        if (size(#) > 1)
+        {
+          if (#[2] == "r" || #[2] == "h")
+          {
+            kind = #[2];
+          }
+        }
+      }
+    }
+  }
+
+  if (kind != "h")
+  {
+    msetring(global_char, vars, global_ordering);
+  }
+  else
+  {
+    msetring(global_char, vars+1, global_ordering);
+  }
+
+  keepring basering;
+
+  ideal id = rcyclic_g(vars, comps);
+  poly p = 1;
+  int i;
+
+  if (kind == "h" || kind == "n")
+  {
+    for (i=1; i<=vars; i++)
+    {
+      p = p * var(i);
+    }
+    id[vars] = p;
+    if (kind == "h")
+    {
+      id[vars] = id[vars] - var(vars+1)^vars;
+    }
+    else
+    {
+      id[vars] = id[vars] -1;
+    }
+  }
+
+  return (id);
+}
+
+proc generate_weight_str(int j)
+{
+  int i;
+  string res_str = "(";
+  
+  for (i=1; i<j; i++)
+  {
+    res_str = res_str + string(i) + ",";
+  }
+  return (res_str + string(j) + ")");
+}
+
+proc extend_orderings(list olist, int j)
+{
+  int i;
+  int c1;
+  int c2;
+  string o1;
+  string o2;
+  string o3;
+  list nl;
+  string weight_string = generate_weight_str(j);
+  o1 = olist[1];
+  if (size(olist) > 1)
+  {
+    o2 = olist[2];
+    if (size(olist) > 2)
+    {
+      o3 = olist[3];
+    }
+    else
+    {
+      o3 = olist[2];
+    }
+  }
+  else
+  {
+    o2 = o1;
+    o3 = o1;
+  }
+      
+  // add weight orderings 
+  olist = olist + list("Wp" + weight_string, "wp" + weight_string);
+
+    
+  for (i=1; i<=size(olist); i++)
+  {
+    nl = nl + list(olist[i], "(C," + olist[i] + ")", "(c," + olist[i] + ")",
+                   "(" + olist[i] + ",C)", "(" + olist[i] + ",c)");
+  }
+
+  // add product orderings
+  if (j > 1)
+  {
+    c1 = j / 2;
+    if (c1 + c1 == j)
+    {
+      c2 = c1;
+    }
+    else
+    {
+      c2 = c1 + 1;
+    }
+    nl = nl + list("(" + o1 + "(" + string(c1) + "),"+ o2 + "(" + string(c2) + "))", "(" + o1 + "(" + string(c1) + "),"+ o3 + "(" + string(c2) + "))");
+    // and, extra weight vector
+    nl = nl + list("(a" + weight_string + "," + o2 + "(" + string(c1) + "),"+ o3 + "(" + string(c2) + "))", "(a" + generate_weight_str(j-1)+ "," + o3 + "(" + string(c1) + "),"+ o1 + "(" + string(c2) + "))");
+  }
+
+  return (nl);
+
+}
+
+proc mystd
+{
+  int t1 = timer;
+  def id_res = std(#[1]);
+  t1 = timer - t1;
+  int i;
+  def id_poly = id_res[1];
+  for (i=1; i<=size(id_res); i++)
+  {
+    id_poly = id_poly + id_res[i];
+    if (size(id_res[i]) > 2)
+    {   
+      lead(id_res[i]), lead(id_res[i] - lead(id_res[i])), size(id_res[i]);
+    }
+    else
+    {
+      id_res[i];
+    }
+  }
+  id_poly;
+  tst_ignore(t1, "time");
+  tst_ignore(memory(1), "memory");
+}
+
+proc gencopy
+{
+  def id = #[1];
+  int n = #[2];
+  int i, j;
+  module m;
+  
+  
+  for (i=1; i<=size(id); i++)
+  {
+    m[i] = id[i];
+    for (j=1; j<=n; j++)
+    {
+      m[i] = m[i] + gen(j) *  id[i];
+    }
+  }
+  return (m);
+}
+  
+
+proc std_extended_range(int from, int to, int charac, list orderings)
+{
+  int k, j;
+  list olist = orderings;
+  global_char = charac;
+
+  for (k=from; k<=to; k++)
+  {
+    olist = extend_orderings(orderings, k);
+    for (j=1; j <= size(olist); j++)
+    {
+      global_ordering = olist[j];
+      def id = gcyclic(k, 3, "r");
+      mystd(id);
+      mystd(gencopy(id, 2));
+      kill basering;
+
+      if (k>1)
+      {
+        def id = gcyclic(k-1, 3, "h");
+        mystd(id);
+        mystd(gencopy(id, 2));
+        kill basering;
+      }
+    }
+  }
+}
+
+proc std_range(int from, int to, int charac, list orderings)
+{
+  int k, j;
+  list olist = orderings;
+  global_char = charac;
+  
+  for (k=from; k<=to; k++)
+  {
+    for (j=1; j <= size(olist); j++)
+    {
+      global_ordering = olist[j];
+      def id = gcyclic(k, 3, "r");
+      mystd(id);
+      kill basering;
+
+      if (k>1)
+      {
+        def id = gcyclic(k-1, 3, "h");
+        mystd(id);
+        kill basering;
+      }
+    }
+  }
+}
+
+int global_char = 32003;
+string global_ordering = "dp";
+
+option(prot);
+option(noredefine);
+
+list global_orderings = "dp", "lp", "Dp", "ls", "ds", "Ds";
+
+
+std_extended_range(2, 6, 32003, global_orderings);
+ 
+std_extended_range(7, 9, 32003, list("dp"));
+  
+std_range(10,15, 32003, list("dp"));
+
+std_range(2,6, 0, global_orderings);
+
+std_range(7,12, 0,list("dp"));
+$
Index: Tst/Long/tst_l.tst
===================================================================
--- Tst/Long/tst_l.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Long/tst_l.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,6 @@
+LIB "tst.lib";
+tst_init();
+
+example tst_system;
+example tst_ignore;
+$
Index: Tst/Old/README
===================================================================
--- Tst/Old/README	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/README	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,31 @@
+To install:
+- put the Singular binary to test into the current directory
+
+To run universal tests (i.e. those with no memory or timing output)
+- run "perl ./regress.cmd universal.lst"
+
+To run specific tests:
+- run "./test.cmd" <basename of test1> ... <basename of test n>
+
+Results:
+- produced output is compared with the output of corresponding *.res
+  file 
+- progress reports and diffs (there should be none) go to stdout
+- if a test fails 
+  (i.e. there are differences between the output and 
+  the corresponding .res file),
+  the name of unsuccessfull test file go to stderr
+
+To compare two versions of Singular do:
+
+"perl compare_tst.cmd Singular1 Singular2 f1.tst f2.tst ...."
+
+- Compares output of Singular1 with that of Singular2 when both are
+  run with input fi.tst Measures time and memory consumption ---
+  reports differences, as well.
+
+
+"perl compare_lst.cmd Singular1 Singular2 exampleList_file.lst"
+
+- Compares output of Singular1 with that of Singular2 when both are
+  run with scripts specified in exampleList_file.lst
Index: Tst/Old/aa.tst
===================================================================
--- Tst/Old/aa.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/aa.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,42 @@
+pagelength = 1000;
+pagewidth=80;
+ring r= 32003,(x,y,z),lp;
+ideal i = x,y,z,x2z,yxz;
+i;
+i[2..3] = 3,4;
+i;
+matrix m[2][2] = i;
+m;
+m[1..2,1] = 1,2;
+m;
+matrix mm[5][5];
+mm[2..4,2..4] = 1,1,1,1,1,1,1,1,1;
+LIB "lib";
+formmat(mm);
+$;
+i = m;
+i;
+m[1,3] = 5;
+$;
+i;
+i[5-6] = 3;
+i;
+$;
+matrix m[2][2] = x,y,z;
+m;
+ideal i = m;
+i;
+$;
+m;
+pause;
+i[2] = y2;
+m[1,2] = 4;
+i;
+m;
+pause;
+m = i;
+m;
+$;
+i = m;
+i;
+$;
Index: Tst/Old/agnes.tst
===================================================================
--- Tst/Old/agnes.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/agnes.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,2289 @@
+LIB "elim.lib";
+ring T=(5,a),(x,y,z,y(1),y(2),y(3)),(dp(3),dp(3));
+minpoly=a2+2;
+matrix M[24][95]=
+(1),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^2+(-1)*y^2+y(1),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*z^2+y(2),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^6+y^6+y(3),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+x+(-2*a)*y,
+(2*a)*x,
+(2)*y^2,
+0,
+0,
+(-2)*y*z,
+(-1)*y^2,
+0,
+0,
+0,
+0,
+0,
+0,
+z,
+(2*a)*x*z+(-1)*y*z,
+(-1*a)*x*z+y*z,
+0,
+0,
+0,
+(-1)*y^2*z,
+0,
+0,
+0,
+(-1)*x^2+(-1)*y^2+y(1),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*z^2+y(2),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^6+y^6+y(3),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(2)*x,
+0,
+0,
+z,
+(-1*a)*y*z,
+(1*a)*y^2,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^2+(-1)*y^2+y(1),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*z^2+y(2),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^6+y^6+y(3),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*y,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+x,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^2+(-1)*y^2+y(1),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*z^2+y(2),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^6+y^6+y(3),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1),
+(-2*a)*y,
+0,
+(-2*a)*y^2,
+0,
+(-2)*y^3,
+0,
+0,
+0,
+0,
+(-1*a)*y,
+(-1)*x+(-1*a)*y,
+(2*a)*x*y+(-2)*y^2,
+0,
+0,
+(2)*x*y+(-2*a)*y^2,
+(2)*x*y^2+(1*a)*y^3,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^2+(-1)*y^2+y(1),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*z^2+y(2),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^6+y^6+y(3),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1),
+(-1*a),
+x+(-1*a)*y,
+(1*a)*y^3,
+0,
+0,
+x+(1*a)*y,
+(-2)*x*z+(-1*a)*y*z,
+(-2)*x*y+(2*a)*y^2,
+0,
+(-2)*y^3,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^2+(1*a)*x*y,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^2+(-1)*y^2+y(1),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*z^2+y(2),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^6+y^6+y(3),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(2)*y^2,
+0,
+0,
+0,
+0,
+0,
+(-1),
+0,
+0,
+(-2*a)*y^2,
+0,
+0,
+0,
+(-1*a)*x*y^2+(2)*y^3,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^2+(-1)*y^2+y(1),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*z^2+y(2),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^6+y^6+y(3),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-2),
+0,
+(-1)*y^3,
+0,
+0,
+0,
+(2)*y*z,
+(2)*y^2,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^2+(-1)*y^2+y(1),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*z^2+y(2),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^6+y^6+y(3),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(1*a),
+0,
+(-2)*x+(-2*a)*y,
+0,
+y^2,
+0,
+(2*a)*y^3,
+0,
+0,
+0,
+0,
+0,
+0,
+(1*a)*y^3,
+0,
+0,
+(-1)*x*y^3+(-2*a)*y^4,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^2+(-1)*y^2+y(1),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*z^2+y(2),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^6+y^6+y(3),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(2*a)*y^2,
+0,
+0,
+(-1*a),
+(2*a)*z,
+0,
+0,
+y^2,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^2+(-1)*y^2+y(1),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*z^2+y(2),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^6+y^6+y(3),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(2),
+0,
+0,
+0,
+(-1*a)*y^2,
+0,
+0,
+0,
+0,
+(-1),
+0,
+(2)*x+(1*a)*y,
+0,
+(2*a)*x*y^2+(2)*y^3,
+(-1*a)*x+(2)*y,
+(-1*a)*x*y+(-2)*y^2,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^2+(-1)*y^2+y(1),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*z^2+y(2),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^6+y^6+y(3),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-2),
+y^2,
+0,
+0,
+(1),
+(-2)*z,
+0,
+0,
+(-1*a)*y^2,
+0,
+y^3,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^2+(-1)*y^2+y(1),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*z^2+y(2),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^6+y^6+y(3),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(2*a),
+0,
+(2)*y,
+0,
+(-1*a)*y^2,
+0,
+0,
+0,
+0,
+0,
+0,
+(2*a)*y^2,
+(-1*a),
+0,
+(-2)*x*y^2+(1*a)*y^3,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^2+(-1)*y^2+y(1),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*z^2+y(2),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^6+y^6+y(3),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+x+(1*a)*y,
+0,
+0,
+0,
+0,
+(-1*a),
+0,
+(2)*y,
+0,
+(2*a)*x^2+(-1)*x*y+(-1*a)*y^2,
+0,
+0,
+0,
+0,
+(-2),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^2+(-1)*y^2+y(1),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*z^2+y(2),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^6+y^6+y(3),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-2),
+0,
+0,
+0,
+(-2)*y^2,
+0,
+0,
+0,
+0,
+(2*a),
+0,
+0,
+0,
+(1*a)*x+(-2)*y,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^2+(-1)*y^2+y(1),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*z^2+y(2),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^6+y^6+y(3),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+y,
+0,
+0,
+0,
+0,
+(-2),
+0,
+0,
+0,
+(-2)*y^2,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^2+(-1)*y^2+y(1),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*z^2+y(2),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^6+y^6+y(3),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1),
+0,
+(-2*a)*y,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1*a)*y,
+0,
+0,
+x*y+(2*a)*y^2,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^2+(-1)*y^2+y(1),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*z^2+y(2),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^6+y^6+y(3),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-2*a),
+0,
+0,
+0,
+0,
+0,
+0,
+(-1),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^2+(-1)*y^2+y(1),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*z^2+y(2),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^6+y^6+y(3),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(1*a),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-2*a)*x+(-2)*y,
+0,
+(-2),
+(-1)*y^2,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^2+(-1)*y^2+y(1),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*z^2+y(2),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^6+y^6+y(3),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1),
+0,
+0,
+0,
+0,
+0,
+0,
+(1*a),
+0,
+(-1)*y,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^2+(-1)*y^2+y(1),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*z^2+y(2),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^6+y^6+y(3),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(1*a),
+0,
+0,
+0,
+0,
+0,
+0,
+(-2*a),
+0,
+0,
+(2)*x+(-1*a)*y,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^2+(-1)*y^2+y(1),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*z^2+y(2),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^6+y^6+y(3),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(2),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^2+(-1)*y^2+y(1),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*z^2+y(2),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^6+y^6+y(3),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(2),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^2+(-1)*y^2+y(1),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*z^2+y(2),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^6+y^6+y(3),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(1),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^2+(-1)*y^2+y(1),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*z^2+y(2),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^6+y^6+y(3)
+;
+matrix N=std(M);
+N=elim(N,1,3);
+print(N);
+$
Index: Tst/Old/alex1.tst
===================================================================
--- Tst/Old/alex1.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/alex1.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,21 @@
+test(0);
+"========= Beipiel Alex1 =============";
+"=== elem 43, dim 1, mult 899 ========";
+//=== 15: 1 min
+//=== 17:  1 min 12 sec
+//=== -,11,12: 48 sec
+//=== 3 15: 38 sec
+//=== 3 17: 37 sec
+
+ring a1=32003,(t, x, y, z),dp;
+ideal i=9x8+y7t3z4+5x4y2t2+2xy2z3t2,
+        9y8+7xy6t+2x5y4t2+2x2yz3t2,
+        9z8+3x2y3z2t4;
+ideal i0=std(i);
+;
+";elem:",size(i0);
+degree(i0);
+i0;
+kill i,i0;
+kill a1;
+$
Index: Tst/Old/alex2.tst
===================================================================
--- Tst/Old/alex2.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/alex2.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,96 @@
+option(prot);
+"========= Beipiel Alex2 ============";
+"=== elem 97, dim 2, mult 13 ========";
+//=== 15: 4 min 33 sec
+//=== 17  4 min 54 sec
+//=== -,11,12: 4 min 29  sec
+//=== 3 15: 4 min 28 sec
+//=== 3 17: 4 min 42 sec
+
+ring a2=32003,(t, x, y, z),dp;
+ideal i=2t3x5y2z+x2t5y+2x2y,
+        2y3z2x+3z2t6x2y+9y2t3z,
+        2t5z+y3x2t+z2t3y2x5;
+ideal i0=std(i);
+";elem:",size(i0);
+degree(i0);
+i0;
+kill i,i0;
+kill a2;
+
+"========= Beipiel Alex3 ===========";
+"=== elem 119, dim 2, mult 1 =======";
+//=== 15: 1 min 31 sec
+//=== 17  1 min 35 sec
+//=== -,11,12: 1 min 32  sec
+//=== 3 15: 1 min 22 sec
+//=== 3 17: 1 min 23 sec
+
+ring a3=32003,(t, x, y, z),dp;
+ideal i=5t3x8y2z+x2t5y+2x2y+5t,
+        7y6z2x+6x2y+9y2t3z+4t6x,
+        4t6z+8y3x5t+2t3y2x3+3x;
+ideal i0=std(i);
+";elem:",size(i0);
+degree(i0);
+i0;
+kill i,i0;
+kill a3;
+
+"========= Beipiel Alex4 =========";
+"=== elem 80, dim 2, mult 67 =====";
+//=== 15: 26 sec
+//=== 17  27 sec
+//=== -,11,12: 25  sec
+//=== 3 15: 24 sec
+//=== 3 17: 22  sec
+//=== 13 19:   sec
+ring a4=32003,(t, x, y, z),dp;
+ideal i=4t4z3y+6z4x3t5+5x5z7,
+        5t6z3y3x+5x2z4t3y7+4x5t5y,
+        6z7t5y+6z3y2t4+2t8z6;
+ideal i0=std(i);
+";elem:",size(i0);
+degree(i0);
+i0;
+kill i,i0;
+kill a4;
+
+"========= Beipiel Alex5 ========";
+"=== elem 37, dim 1, mult 44 ====";
+//=== 15: 39 sec
+//=== 17   39 sec
+//=== -,11,12: 37  sec
+//=== 3 15: 42 sec
+//=== 3 17: 33 sec
+//=== 13 19:   sec
+ring a5=32003,(t, x, y, z),dp;
+ideal i=4t2z+6z3t+3z2,
+        5t2z7y3x+5x2z4t3y+3t,
+        6zt2y+2x+6z2y2t+2y;
+ideal i0=std(i);
+";elem:",size(i0);
+degree(i0);
+i0;
+kill i,i0;
+kill a5;
+
+"========= Beipiel Alex6 =======";
+"=== elem 28, dim 1, mult 55 ===";
+//=== 15: 1 min 47 sec
+//=== 17   2 min 14 sec
+//=== -,11,12: 1 min 40  sec
+//=== 3 15: 1 min 19 sec
+//=== 3 17: 1 min 20 sec
+//=== 13 19:   sec
+ring a6=32003,(t, x, y, z),dp;
+ideal i=4t2z+6z3t+3z2tx+3z,
+        5t7yx+5x2z4t3y+3t,
+        6zt2y+2x+6z2y2t+2y;
+ideal i0=std(i);
+";elem:",size(i0);
+degree(i0);
+i0;
+kill i,i0;
+kill a6;
+$
Index: Tst/Old/algmap.tst
===================================================================
--- Tst/Old/algmap.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/algmap.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,40 @@
+ring r0=(0,a,b),(x,y,z),dp;
+ideal i0=
+(3a2b-2b5)*x2z+(1000b+a20)*xy2,
+(20b5+a4b2)*xz3+x2yz,
+xy3+x3y,
+(20b10)*xyz2+yz4,
+xyz+(a+b)*z2;
+i0;
+
+ring r1=0,(x,y,z,a,b),dp;
+ideal i=a,b;
+ideal j=x,y,z;
+ideal i1=system("algmap",r0,i0,i,j);
+i1;
+
+i1=system("algfetch",r0,i0);
+i1;
+
+ring r2=(0,a),(x,y,z,b),dp;
+ideal i=a,b;
+ideal j=x,y,z;
+ideal i1=system("algmap",r0,i0,i,j);
+i1;
+
+i1=system("algfetch",r0,i0);
+i1;
+kill r2;
+
+ring r2=(0,a,b,z),(x,y),dp;
+ideal i=a,b;
+ideal j=x,y,z;
+ideal i1=system("algmap",r0,i0,i,j);
+i1;
+
+i1=system("algfetch",r0,i0);
+i1;
+kill r2;
+
+$
+
Index: Tst/Old/algnorm.tst
===================================================================
--- Tst/Old/algnorm.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/algnorm.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,33 @@
+ring r=(0,a),x,dp;
+poly p=1/a*x+1;
+cleardenom (p);
+p=2/(2a+1)*x+1/(2a+1);
+p;
+cleardenom (p);
+p=2/(2*a2/3+1)*x+(2/3)/(2a+1);
+p;
+cleardenom (p);
+ring R=(0,a,b),(x,y),dp;
+poly p=(a/(1/2*b+1))/((b+5)/(2*(a+b)))*x+1/2*y;
+p;
+cleardenom(p);
+ring r=(32003,a),x,dp;
+poly p=1/a*x+1;
+cleardenom (p);
+p=2/(2a+1)*x+1/(2a+1);
+p;
+cleardenom (p);
+p=2/(2*a2/3+1)*x+(2/3)/(2a+1);
+p;
+cleardenom (p);
+ring R=(32003,a,b),(x,y),dp;
+poly p=(a/(1/2*b+1))/((b+5)/(2*(a+b)))*x+1/2*y;
+p;
+cleardenom(p);
+ring r3=(7,a, b, c),(x,y,z),dp;
+number n;
+number n1 = 2*a^2*b*c -3*b*c + -1*a + 4;
+number n2 = n1 / (n1 - 5c)^2;
+n2;
+$
+$
Index: Tst/Old/altern.tst
===================================================================
--- Tst/Old/altern.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/altern.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,26 @@
+//
+// test script for alternating command
+//
+pagelength = 10000;
+ring r = 0,(x,y,z),dp;
+r;
+"--------------------------------";
+alternating=1;
+poly s=xy;
+s;
+"-------------------------------";
+listvar(all);
+kill r;
+//
+// test script for dring command
+//
+pagelength = 10000;
+ring r1 = 0,(x,y,z),dp;
+r1;
+"------------------------------";
+dring d1=0,(x,d,h),dp;
+d1;
+"----------------------------";
+listvar(all);
+kill r1;
+$;
Index: Tst/Old/barei.tst
===================================================================
--- Tst/Old/barei.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/barei.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,90 @@
+//
+// test script for bareiss command
+//
+pagelength = 10000;
+LIB "lib0";
+ring r = 32003,(x,y,z),dp;
+r;
+matrix m1[3][3]=1,2,3,2,3,4,1,3,2;
+m1;
+matrix mm1[3][3]=bareiss(m1);
+mm1;
+mm1[3,3]-det(m1);
+"------------------------------------";
+//
+matrix m2[5][6]=0,2,1,-3,12,-9,1,2,5,3,6,-1,2,4,10,6,12,-2,-3,2,1;
+m2;
+matrix mm2[5][6]=bareiss(m2);
+mm2;
+"------------------------------------";
+//
+matrix m3[3][4]=xy,0,x2z,1,z2y,y2z21,0,1,zx3,1,0,z3y3;
+m3;
+matrix mm3[3][4]=bareiss(m3);
+mm3;
+"-------------------------------------";
+ //
+poly s1 = 2x3y2+23x5y+104xy6+56z2x;
+poly s2 = 3/2x3y2-2/3z6y4+12x2z4;
+poly s3 = -2x4y5+x4z5;
+poly s4 = 7/8x7y3z-1;
+poly s5 = 4x2y3-2x2y2;
+poly s6 = 1/2y2x3+4x2z2;
+poly s7 = x+y+z;
+poly s8 = x2+y2+z2;
+poly s9 = xz+xy+yz;
+matrix m4[3][3]=s1,0,s3,1,s5,0,s7,s8,s9;
+m4;
+matrix mm4[3][3]=bareiss(m4);
+mm4;
+mm4[3,2]-det(m4);
+"---------------------------------------";
+//
+matrix m5[3][2]=s8,s7,s9,s6,s5,0;
+m5;
+matrix mm5[3][2]=bareiss(m5);
+mm5;
+"-------------------------------------";
+ring r1=0,(x(1..9)),(dp);
+matrix m6[3][3]=maxideal(1);
+pmat(m6);
+matrix mm6=bareiss(m6);
+pmat(mm6);
+mm6[3,3]-det(m6);
+"--------------------------------------";
+ring r2=0,(x(1..12)),ds;
+matrix m7[3][4]= maxideal(1);
+pmat(m7);
+m7=bareiss(m7);
+pmat(m7,8);
+matrix m77=m7;
+m77[1,1]=x(1)^2;
+m77;
+m77=bareiss(m77);
+m77;
+"--------------------------------------";
+matrix m8[4][3]=maxideal(1);
+pmat(m8);
+m8=bareiss(m8);
+pmat(m8,8);
+"--------------------------------------";
+matrix m9[4][4]=maxideal(2);
+pmat(m9);
+m9=bareiss(m9);
+pmat(m9,8);
+"------------------------------------";
+matrix m10[4][4]=maxideal(1);
+pmat(m10);
+m10=bareiss(m10);
+pmat(m10,8);
+"------------------------------------";
+matrix m11[5][5]=maxideal(1),maxideal(1);
+pmat(m11);
+matrix mm11=bareiss(m11);
+mm11;
+pmat(mm11,8);
+mm11[2,2]-det(m11);
+"-------------------------------------";
+listvar(all);
+kill r,r1,r2;
+$;
Index: Tst/Old/bett.tst
===================================================================
--- Tst/Old/bett.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/bett.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,15 @@
+//
+// test script for betti command
+//
+pagelength = 10000;
+ring r1=32003,(x,y,z),dp;
+r1;
+"-------------------------------";
+ideal i1=xy-yz,x3-y2z,z3-xy2;
+i1;
+list T=mres(i1,0);
+print(betti(T),"betti");
+"------------------------------";
+listvar(all);
+kill r1;
+$;
Index: Tst/Old/betti.tst
===================================================================
--- Tst/Old/betti.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/betti.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,24 @@
+ring r=32003,(a,b,c,d),(c,dp);
+ideal j=bc-ad,b3-a2c,c3-bd2,ac2-b2d;
+list T=mres(j,0);
+print(betti(T),"betti");
+ring R;
+matrix A[4][1];
+module M = A;
+betti(res(M,0));
+betti(mres(M,0));
+betti(sres(M,0));
+M=0*gen(1);
+betti(res(M,0));
+betti(mres(M,0));
+betti(sres(M,0));
+M =gen(2),A;
+betti(res(M,0));
+betti(mres(M,0));
+betti(sres(M,0));
+matrix A[4][2]=0,0,1;
+M=A;
+betti(res(M,0));
+betti(mres(M,0));
+betti(sres(M,0));
+$
Index: Tst/Old/binomial.tst
===================================================================
--- Tst/Old/binomial.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/binomial.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,32 @@
+proc fak2
+{
+  if (#[1] <= #[2]) { return(#[2]); }
+  return (#[1] * fak2(#[1] -1,#[2]));
+}
+
+proc fak
+{
+  return (fak2(#[1],1));
+}
+
+proc binom
+{
+  if (#[2] == 0) { return(1); }
+  return ( fak2(#[1],#[1]-#[2]+1) / fak(#[2]) );
+}
+// -------------------------------------------------------
+
+int i;
+int j;
+string b;
+for (i=1; i<=5; i=i+1)
+{
+  b = "binomial coefficients " + string(i) + " ";
+  for (j=0; j<=i; j=j+1)
+  {
+    b = b + " " + string(binom(i,j));
+  }
+  b;
+}
+listvar(all);
+$;
Index: Tst/Old/bluff.tst
===================================================================
--- Tst/Old/bluff.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/bluff.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,7 @@
+ring r;
+poly f=x;poly g=y;
+ideal i=f,g;
+kill f,g;
+poly h=2x2+3y3+4z4;
+i;
+$;
Index: Tst/Old/bma.lst
===================================================================
--- Tst/Old/bma.lst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/bma.lst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,144 @@
+;test bareiss
+barei
+;test betti
+bett
+;test char
+ch
+;test coef????????????????
+;coeff
+;test  ncols
+col
+;test HC
+corner
+;test defined
+def
+;test deg?????????????????????????????
+;degr
+;test degre
+degre
+;test dim
+dimens
+;test execute, read
+execut
+; test fetch
+fetch
+;test freemodule
+freemod
+;test gen
+generat
+;test hilb
+hilbert
+;test homog
+homo
+;test ideal
+idea
+;test lead
+initial
+;test int
+integ
+;test interred
+interred
+;test intersect
+intersec
+;test jacob
+jacobi
+;test jet
+jett
+;test kbase
+kbas
+;test kill
+kil
+;test lift
+lif
+;test liftstd
+liftstan
+;test list
+liste
+;test map
+mapp
+;test matrix
+matr
+;test maxdegr
+maxdegr
+;test maxideal
+maxid
+;test memory
+mem
+;test minbase
+minbas
+;test minor
+mino
+;test module
+modu
+;test mres
+mre
+;test multiplicity
+mult
+;test nameof
+;namof???????????????????????????????????????????????????
+;test reduce
+normalf
+;test nvars
+numvar
+;test option
+opt
+;test ord
+order
+;test diff
+part
+;test poly
+pol
+;test preimage
+preim
+;test prime
+prim
+;test qring
+qrin
+;test rank
+rang
+;test res
+re
+;test regularity
+regul
+;test ring
+ringdef
+;test nrow
+row
+;test rvar
+rvari
+;test setring
+setrin
+;test short
+shor
+;test size
+siz
+;test sres
+sre
+;test substring
+sstring
+;test subst
+substit
+;test syz
+syzygy
+;test test
+teste
+;test timer
+time
+;test trace
+;trac????????????????????????????????????????????????????????
+;test transp
+trans
+;test type
+typ
+;test typeof
+typof
+;test var
+va
+;test vdim
+vdimen
+;test vector
+vec
+;test wedge
+wedg
+;test write
+;writ
Index: Tst/Old/bugs.lst
===================================================================
--- Tst/Old/bugs.lst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/bugs.lst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,7 @@
+;;; here are those from universal.lst which are still buggy
+minbas
+mino
+hilb
+matrix
+moralex
+m89si
Index: Tst/Old/ch.tst
===================================================================
--- Tst/Old/ch.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/ch.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,27 @@
+//
+// test script for char command
+//
+pagelength = 10000;
+ring r1 = 32003,(x,y,z),dp;
+r1;
+int k1;
+k1=char(r1);
+k1;
+"-----------------------------------";
+ring r2 = 0,(x,y,z,a,b,c),(ds(3),dp);
+int k2;
+k2=char(r2);
+k2;
+"------------------------------------";
+ring r3 = 10,(x(1..6)),(lp(2),dp(4));
+int k3;
+k3=char(r3);
+k3;
+"------------------------------------";
+ring r4 =  0,(x,y,z),(c,dp);
+int k4;
+k4=char(r4);
+k4;
+listvar(all);
+kill r1,r2,r3,r4,k1,k2,k3,k4;
+$
Index: Tst/Old/cmp.tst
===================================================================
--- Tst/Old/cmp.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/cmp.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,54 @@
+proc generate_polys (int n, string ostring)
+{
+  string ringstr = "ring r = 32003,x(1.." + string(n) + ")," + ostring + ";";
+  string polystr = "poly p = ";
+  int i;
+
+  for (i=1; i<=n; i++)
+  {
+    polystr = polystr + "x(" + string(i) + ") + ";
+  }
+  polystr = polystr + "1;";
+  ringstr;
+  polystr;
+  execute ringstr;
+  execute polystr;
+  p;
+  p^2 + p;
+  (p^2+p)*(gen(2) + gen(3));
+  (p^2+p)*(gen(2) + gen(3))+ p^2 + p;
+  kill r;
+}
+
+proc check_ordering(int n, string ostring)
+{
+  generate_polys(n, ostring);
+  generate_polys(n, "(C," + ostring + ")");
+  generate_polys(n, "(c," + ostring + ")");
+  generate_polys(n, "(" + ostring + ",C)");
+  generate_polys(n, "(" + ostring + ",c)");
+}
+
+list orderings = "lp", "dp", "Dp", "ls", "ds", "Ds";
+
+list l = "dp";
+
+proc check_comp(int n, list olist)
+{
+  int i;
+  int j;
+  for (i=1; i<=size(olist); i++)
+  {
+    for (j=1; j<=n; j++)
+    {
+      check_ordering(j, olist[i]);
+    }
+  }
+}
+
+check_comp(9, orderings);
+
+quit;
+  
+  
+
Index: Tst/Old/coef.tst
===================================================================
--- Tst/Old/coef.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/coef.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,18 @@
+//---------------------------------------------
+// an error of 0.8.8f (duco)
+ring  r11=5,(s,x(1..5),y(1..5)),(dp(1),dp(10));
+short=1;
+map taylor=r11,s,1+s*x(1),1+s*x(2),1+s*x(3),1+s*x(4),1+s*x(5),1+s*y(1),1+s*y(2),1+s*y(3),1+s*y(4),1+s*y(5);
+poly form=x(1)*x(2)*x(3)*x(4)*x(5)-y(1)*y(2)*y(3)*y(4)*y(5);
+poly ontw=taylor(form);
+ontw;
+matrix ce=coef(ontw,s);
+ce;  //ergebnis ist falsch; mit char=7 aber richtig.
+kill r11;
+//-------------------------------------------------
+//an error of 0.8.8c (martin)
+ring r=32003,(x,y),ds;
+poly f=1+444x+xy+x3y;
+coef(f,x);
+kill r;
+$
Index: Tst/Old/coeff.tst
===================================================================
--- Tst/Old/coeff.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/coeff.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,21 @@
+//
+// test script for coef command
+//
+pagelength = 10000;
+ring r1 = 32003,(x,y,z),(c,dp);
+r1;
+"-------------------------------";
+poly s1=5x2y7+12z6-3y6z5;
+s1;
+coef(s1,y);
+"-----------------------------";
+coef(s1,xy);
+"------------------------------";
+coef(s1,xyz);
+"------------------------------";
+poly s2=3;
+coef(s2,x);
+"--------------------------------";
+listvar(all);
+kill r1;
+$;
Index: Tst/Old/col.tst
===================================================================
--- Tst/Old/col.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/col.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,34 @@
+//
+// test script for cols command
+//
+pagelength = 10000;
+ring r = 32003,(x,y,z),dp;
+r;
+matrix m1[3][3];
+int c1;
+c1=ncols(m1);
+c1;
+"------------------------------------";
+matrix m2[2][4];
+int c2;
+c2=ncols(m2);
+c2;
+"------------------------------------";
+matrix m3[1][1];
+int c3;
+c3=ncols(m3);
+c3;
+"-------------------------------------";
+int n=6;
+matrix m4[1][n];
+int c4;
+c4=ncols(m4);
+c4;
+"-------------------------------------";
+matrix m5[100][1];
+int c5;
+c5=ncols(m5);
+c5;
+listvar(all);
+kill r;
+$;
Index: Tst/Old/comp.tst
===================================================================
--- Tst/Old/comp.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/comp.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,22 @@
+ring r=0,x,dp;
+poly(1)>poly(2);
+poly(1)<poly(2);
+poly(1)>=poly(2);
+poly(1)<=poly(2);
+poly(1)!=poly(2);
+poly(2)>poly(1);
+poly(2)<poly(1);
+poly(2)>=poly(1);
+poly(2)<=poly(1);
+poly(2)!=poly(1);
+poly(0)>poly(1);
+poly(0)<poly(1);
+poly(0)>=poly(1);
+poly(0)<=poly(1);
+poly(0)!=poly(1);
+poly(2)>poly(0);
+poly(2)<poly(0);
+poly(2)>=poly(0);
+poly(2)<=poly(0);
+poly(2)!=poly(0);
+$
Index: Tst/Old/corner.tst
===================================================================
--- Tst/Old/corner.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/corner.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,26 @@
+//
+// test script for maxdeg command
+//
+pagelength = 10000;
+ring r1 = 32003,(x,y,z),(c,ds);
+option(prot);
+r1;
+"-------------------------------";
+poly s1=x3y2+21328x5y+10667x2y4+21328x2yz3+10666xy6+10667y9;
+poly s2=x2y2z2+3z8;
+poly s3=5x4y2+4xy5+2x2y2z3+y7+11x10;
+ideal i1=s1,s2,s3;
+test(27);
+ideal i2=std(i1);
+maxdeg;
+"--------------------------------";
+poly s4=x6+y6+z6;
+poly s5=xy5+z7+xz8;
+poly s6=yz8+x4y4+x8z8;
+ideal i3=s4,s5,s6;
+ideal i4=std(i3);
+maxdeg;
+"--------------------------------";
+listvar(all);
+kill r1;
+$;
Index: Tst/Old/cring.tst
===================================================================
--- Tst/Old/cring.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/cring.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,24 @@
+int i;
+ring r;
+"allocating a lot of memory, that is never freed";
+for (i=1; i<20; i=i+1)
+{
+  poly rp(i) = x^i;
+}
+ring rr;
+for (i=1; i<100; i=i+1)
+{
+  poly rrp(i) = y^i;
+}
+setring r;
+rp(10);
+setring rr;
+rrp(10);
+kill r;
+ring r;
+for (i=1; i<100; i=i+1)
+{
+  poly rp(i) = y^i;
+}
+listvar(all);
+$
Index: Tst/Old/curve.tst
===================================================================
--- Tst/Old/curve.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/curve.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,10 @@
+// resolution of a space curve ...
+ring r=0,(t,x,y,z,l),(dp,c);
+ideal i=z2+lx4z-x5y,y2+l3x2z-xz-2lx5-l2x3y,yz+l2x3z-x6-lx4y;
+ideal i2=std(i);
+list resii=sres(i2,0);
+list resi=minres(resii);
+resi[1];
+resi[2];
+print(betti(resi),"betti");
+$
Index: Tst/Old/cyclic.tst
===================================================================
--- Tst/Old/cyclic.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/cyclic.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,37 @@
+option(prot,sugarCrit);
+" ============= cyclic_roots_5(isol) + ==========================";
+ring r4 = 0,(a,b,c,d,e),dp;
+r4;
+poly s1=a+b+c+d+e;
+poly s2=de+1cd+1bc+1ae+1ab;
+poly s3=cde+1bcd+1ade+1abe+1abc;
+poly s4=bcde+1acde+1abde+1abce+1abcd;
+poly s5=abcde+1;
+ideal i=s1,s2,s3,s4,s5;
+ideal j=std(i);
+"dim: "+ string(dim(j)) +",  mult: "+ string(mult(j)) +",  elem: "
+                                                        + string(size(j));
+kill r4;
+"====================  standard char0  =============================";
+//      H7 l, char 0, test0,11,1: 61/31 ohne vollst; Reduktion
+ring r=
+0,(x,y),lp;
+poly f=x5+y11+xy9+x3y9;
+ideal i=jacob(f);
+ideal j=std( i);
+size(j);
+kill r;
+" ============= cyclic_roots_6(homog) dp ==========================";
+ring r6 = 0,(a,b,c,d,e,f),dp;
+poly s1=a+b+c+d+e+f;
+poly s2=ab+bc+cd+de+ef+fa;
+poly s3=abc+bcd+cde+edf+efa+fab;
+poly s4=abcd+bcde+cdef+defa+efab+fabc;
+poly s5=abcde+bcdef+cdefa+defab+efabc+fabcd;
+poly s6=abcdef+1;
+ideal i=s1,s2,s3,s4,s5,s6;
+ideal j=std(i);
+"dim: "+ string(dim(j)) +",  mult: "+ string(mult(j)) +",  elem: "
+                                                        + string(size(j));
+kill r6;
+$
Index: Tst/Old/def.tst
===================================================================
--- Tst/Old/def.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/def.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,30 @@
+//
+// test script for defined command
+//
+pagelength = 10000;
+ring r = 32003,(x,y,z),dp;
+r;
+matrix m1[3][3];
+int c1;
+poly s1=3xz+zy4;
+poly s2=5zx2;
+intvec iv1=12,2,4,0,1,0;
+ideal i1=s1,s2-s1,s2*s1;
+"defined(r)";
+defined(r);
+"-----------------------------";
+"defined(s6)";
+defined(s6);
+"-----------------------------";
+"defined(s1) and defined(i1)";
+defined(s1) and defined(i1);
+"-------------------------------";
+"defined(s2) and defined(s3)";
+defined(s2) and defined(s3);
+"-------------------------------";
+"defined(m1) or defined(m3)";
+defined(m1) or defined(m3);
+listvar(all);
+kill r;
+$;
+// fur proc?
Index: Tst/Old/deformlb.tst
===================================================================
--- Tst/Old/deformlb.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/deformlb.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,6 @@
+LIB "deform.lib";
+example versal;
+example mod_versal;
+example lift_rel_kb;
+example lift_kbase;
+$
Index: Tst/Old/deg.tst
===================================================================
--- Tst/Old/deg.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/deg.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,38 @@
+//
+// test script for deg command
+//
+ring r1 = 0,(x,y,z),ds;
+r1;
+"--------------------------------";
+ideal i1=x2,y2,z2;
+degree(i1);
+"--------------------------------";
+vector v1=[x4,y2,z8];
+v1;
+deg(v1);
+"----------------------------------";
+ring r2=3,(x,y),wp(2,4);
+r2;
+poly s2=x2-y2;
+s2;
+deg(s2);
+"----------------------------";
+ring r3=3,(x,y),ws(2,4);
+r3;
+poly s3=x2+y2;
+s3;
+deg(s3);
+"------------------------------";
+vector v2=[x3,y];
+v2;
+deg(v2);
+"------------------------------";
+deg(0);
+"-----------------------------";
+poly s4=0;
+s4;
+deg(s4);
+"--------------------------------";
+listvar(all);
+kill r1;
+$;
Index: Tst/Old/degre.tst
===================================================================
--- Tst/Old/degre.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/degre.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,39 @@
+//
+// test script for degree command
+//
+pagelength = 10000;
+ring r1=32003,(x,y,z),ds;
+"------------------------------";
+poly s1=x11+y12+z13+x8y6+x4y6z8;
+s1;
+ideal i1=jacob(s1);
+ideal i2=std(i1);
+i2;
+degree(i2);
+"------------------------------";
+poly s2=x9+y6+z8+xy4+xz7+yz9+xyz3+xy6z+x5yz;
+s2;
+ideal i3=jacob(s2);
+ideal i4=std(i3);
+i4;
+degree(i4);
+"--------------------------------";
+ideal i5=0,0,0;
+i5;
+degree(i5);
+"-------------------------------";
+ideal i6=1,1,1;
+i6;
+degree(i6);
+"-----------------------------";
+listvar(all);
+kill r1;
+"-----s92a/c-------------------";
+ring r=32003,(t,x,y,z),dp;
+ideal ii=
+t2xyz,tx2yz,t3yz,x3yz;
+ii=std(ii);
+degree(ii);
+$
+
+$;
Index: Tst/Old/det.tst
===================================================================
--- Tst/Old/det.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/det.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,10 @@
+ring r=(0,a),x,dp;
+minpoly=a10+a9+a8+a7+a6+a5+a4+a3+a2+a+1;
+matrix m[5][5]=a;
+m[2,2]=a4;
+m[3,3]=a9;
+m[4,4]=a5;
+m[5,5]=a3;
+print(m);
+det(m);
+$
Index: Tst/Old/dimens.tst
===================================================================
--- Tst/Old/dimens.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/dimens.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,41 @@
+//
+// test script for dim command
+//
+pagelength = 10000;
+ring r1 = 32003,(x,y,z),(dp,c);
+r1;
+"------------------------------";
+ideal i1=x2,xz,y4;
+i1;
+ideal i11=std(i1);
+dim(i11);
+"------------------------------";
+ideal i2=x6,y6x6,x6z6;
+i2;
+dim(i2);
+"-------------------------------";
+vector v1=[x6,y3,z6];
+poly s1=xyz2;
+module m1=v1,s1*v1;
+m1;
+module m11=std(m1);
+dim(m11);
+"------------------------------";
+vector v2=[s1,x3y4z5,x,y6z12];
+poly s2=12xyz;
+module m2=v1,v2,s2*v2;
+m2;
+dim(m2);
+"-------------------------------";
+ideal i3=0,0,0;
+i3;
+dim(i3);
+"---------------------------";
+ideal i4=1,1,1;
+i4;
+dim(i4);
+"--------------------------";
+listvar(all);
+kill r1;
+$;
+
Index: Tst/Old/dups.tst
===================================================================
--- Tst/Old/dups.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/dups.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,18 @@
+int i = 9;
+ring r;
+diff(r,x);
+poly i = x;
+poly r = x;
+diff(i,x);
+diff(i,a);
+diff(i+x,x);
+poly p = xy;
+ring rr;
+int p = 9;
+listvar(all);
+diff(p,x);
+listvar(all);
+setring r;
+"poly p is shadowed by int p!!";
+diff(p,x);
+$
Index: Tst/Old/ech.tst
===================================================================
--- Tst/Old/ech.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/ech.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,16 @@
+//
+// test script for echo command
+//
+ring r = 0,(x,y,z),dp;
+r;
+"--------------------------------";
+echo=1;
+int i=echo;
+i;
+"--------------------------------";
+echo=2;
+int j=echo;
+"-------------------------------";
+listvar(all);
+kill r;
+$;
Index: Tst/Old/echo.tst
===================================================================
--- Tst/Old/echo.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/echo.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,11 @@
+proc tt
+{
+  "echo inside a proc",echo;
+  "(voice is:",voice,")";
+  return(0);
+}
+"t1:echo=",echo;
+tt();
+<"echo1.tst";
+"t1:echo=",echo, voice;
+$
Index: Tst/Old/echo1.tst
===================================================================
--- Tst/Old/echo1.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/echo1.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,5 @@
+"START echo1";
+"t2:echo=",echo;
+<"echo2.tst";
+"t2:echo=",echo;
+"END echo1";
Index: Tst/Old/echo2.tst
===================================================================
--- Tst/Old/echo2.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/echo2.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,14 @@
+"START echo 2";
+"t3:echo=",echo;
+if (1)
+{
+  "echo inside if:",echo;
+}
+tt();
+//proc tt
+//{
+//  "echo inside proc",echo;
+//  return("NIL");
+//}
+//tt();
+"END echo 2";
Index: Tst/Old/elimlib.tst
===================================================================
--- Tst/Old/elimlib.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/elimlib.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,13 @@
+help elim.lib;
+LIB "elim.lib";
+
+example blowup0; newline;
+example elim; newline;
+example elim1; newline;
+example nselect; newline;
+example sat; newline;
+example select; newline;
+kmemory();
+$
+
+
Index: Tst/Old/err1.tst
===================================================================
--- Tst/Old/err1.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/err1.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,23 @@
+// v 0.9.2a, G. Pfister
+ring r1=0,(y(1..3)),dp;
+ring r=0,(x,y,z,u),dp;
+ideal null;
+ideal su=y2,y3,0;
+map phi=r1,su;
+setring r1;
+ideal ker=preimage(r,phi,null);
+ker;
+kill r,r1;
+// v 0.9.2c, A. Heydtmann
+ring r=0,(x,y,z),dp;
+ideal i=x2+y2;
+ideal si=std(i);
+qring Qring=si;
+x2+y2==0;       // sollte diese Abfrage nicht auch mal '1' liefern?
+setring r;
+ring Q=si;
+// Ja hier kommt eine Fehlermeldung
+qring Q=si;
+x2+y2==0;
+// Aber das duerfte doch Singular nicht so durcheinander bringen?
+$
Index: Tst/Old/err2.tst
===================================================================
--- Tst/Old/err2.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/err2.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,21 @@
+// testing the input of long integers and the conversion to poly
+int i=12345678901234567890;
+listvar(all);
+12345678901234567890;
+ring r=0,x,dp;
+12345678901234567890;
+typeof(123);
+typeof(12345678901234567890);
+kill r;
+ring r=32003,x,dp;
+12345678901234567890;
+typeof(123);
+typeof(12345678901234567890);
+kill r;
+// testing input of "difficult" zeros and conversion to number
+ring r=11,t,dp;
+poly f=2678962/25;
+f;
+kill r;
+$
+
Index: Tst/Old/err3.tst
===================================================================
--- Tst/Old/err3.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/err3.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,94 @@
+//-------------------------------------------------
+//an error of 0.8.5b: donati@hera.unice.fr
+ring r = 0, (x,y), ds;
+poly f = x4+y5+x2y3;
+ideal i = jacob(f);
+ideal j = std(i);
+j;
+//j[1]=2x3+1xy3
+//j[2]=3x2y2+5y4
+//j[3]=10xy4
+//j[4]=1y6
+
+reduce(x4+y5+x2y3, j);
+//-----------------------------------------------
+//an error of 0.8.6: (ralf) div by zero -> abort
+random(5,5);
+//------------------------------------------------
+//an error of 0.8.6: (gerik) result was false:
+f=0;
+f==0;
+//------------------------------------------------
+//an error of 0.8.7: (hgrass) core dump
+matrix a[2][2]=1,2,3,4;
+matrix b[1][0];
+b; // could not display strange matrices
+a=b; //could not assign strange matrices
+listvar(all);
+//-----------------------------------------------
+//an error of 0.8.7d (hannes) ordering a incorrect
+ring hs=0,(x,y),(c,a(5,3),dp);
+hs;
+poly f=x2+y3;
+f;
+ord(f);
+deg(f);
+//----------------------------------------------
+//an error of 0.8.7d (gmg) jump to undefined address
+ring r=0,(x,y),a(2,3);
+poly f=x,y;
+f;
+//---------------------------------------------
+//an error of 0.8.8c (thomas) (last entry missing)
+ring r;
+ideal i1=x,0,y;
+ideal i2;
+i1+i2;
+kill r;
+//---------------------------------------------
+//an error of 0.8.8c (greuel) result was 0y
+ring r0=0,(x,y),dp;
+poly f=100x+101y;
+subst(f,x,0);
+//---------------------------------------------
+//an error of 0.8.8d (greuel) result was totally wrong
+// for mixed orderings
+ring r3 = 32003,(t,x,y),(lp(1),ds);
+ideal i = x-t3-t5, y-t10;
+ideal is = std(i);
+is;
+//---------------------------------------------
+//an error of 0.8.8.f (greuel) segmentation fault
+ring r4 = 31,(t,x,y,z),dp;
+poly tau=(1/2)*(1+6);
+poly alpha=(1/4)*(2*tau+1);
+ideal pencil = (tau^6-1)*x2y2z2-tau^4*(x4y2+y4z2+z4x2)+tau^2*(x2y4+y2z4+z2x4),
+	       -t2*(x2+y2+z2-t2)*2;
+matrix ppar[2][1] = 1, alpha;
+ideal f = minor(ppar*matrix(pencil),1);
+module jf = module(jacob(f));
+module kf =std(jf);
+dim(kf);
+mult(kf);
+degree(kf);
+kill r4;
+//---------------------------------------------
+//an error of 0.9.2d (gmg) input not a resolvente
+LIB "matrix.lib";LIB "homolog.lib";
+
+
+int n=5;             
+int m=3;
+int N=n*(n+1)/2;       //Anz. der Variablen
+ring R=32003,x(1..N),dp;
+matrix X=symmat(n);    //aus matrix.lib
+ideal J=minor(X,m+1);
+J=std(J);
+module D=J*freemodule(N)+transpose(jacob(J)); // der Differentialmodul
+D = transpose(D);
+ncols(D); nrows(D);
+option(prot);    
+
+module E=Ext(2,D,J);
+
+$
Index: Tst/Old/err4.tst
===================================================================
--- Tst/Old/err4.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/err4.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,132 @@
+//an error of 0.8.9a (intersect in char 0)
+//(kreusler)
+ring r=0,(x,y,z),(c,lp);
+vector v(1)=[xy+y2,x,1];
+vector v(2)=[x2+z2,x-y,0,1];
+vector v(3)=[xz,y,0,0,1];
+module M=v(1),v(2),v(3);
+module Ms=std(M);
+Ms;
+module N=gen(3),gen(4),gen(5);
+intersect(Ms,N);
+kill r;
+//--------------------------------------------------------------
+//an error of 0.8.9a (undefined names output for block C)
+ring r=0,x,(dp,C);
+r;
+kill r;
+//--------------------------------------------------------------
+//an error of 0.8.9a (crash: deg(0) was undefined)
+// (B.Martin)
+ring r=0,x,(dp,C);
+poly f;
+deg(f);
+kill r;
+//--------------------------------------------------------------
+//an error of 0.8.9a (crash for gmp/i386/-O2)
+// (B.Martin)
+ring r=0,(x,y,z),(dp);
+poly f=(x+y)^11;
+subst(f,x,2);
+kill r;
+//---------------------------------------------------------------
+//an error of 0.8.9b (incorrect) and 0.8.9c (crash)
+// (H.S.)
+ring r;
+ideal i=1;
+degree(i);
+dim(i);
+mult(i);
+i=0;
+degree(i);
+dim(i);
+mult(i);
+//---------------------------------------------------------------
+//an error of 0.8.9c (crash)
+// (Cottbus)
+//
+// test script for var command
+//
+pagelength = 10000;
+ring r4=0,(x(1..10),y(1..9),z(1..8)),dp;
+r4;
+varstr(r4,28);
+kill r4;
+// -----------------------------------------------------------
+//an error of 0.8.9c (crash/undef output)
+// (Cottbus)
+//
+// test script for nameof command
+//
+int i=9;
+string st=nameof(i+1);
+st;
+// -----------------------------------------------------------
+//an error of 0.8.9c (crash for det of nonsquare)
+// GMG
+ring r;
+ideal I =x,y,z,zy;
+matrix m =jacob(I);
+det(m);
+kill r;
+// -----------------------------------------------------------
+//an error of 0.8.9c (crash if proc paramter is a ring)
+// GMG
+ring r;
+r;
+r;
+proc t
+{
+listvar(all);
+;
+}
+t(r);
+listvar(all);
+r;
+kill r;kill t;
+// -----------------------------------------------------------
+// test automatic set of options for various rings
+// GP/HS
+option();
+option(intStrategy);
+option();
+option(nointStrategy);
+option();
+ring r=32003,x,dp;
+r;
+option();
+option(intStrategy);
+option();
+option(nointStrategy);
+option();
+kill r;
+ring r=0,x,dp;
+r;
+option();
+option(intStrategy);
+option();
+option(nointStrategy);
+option();
+kill r;
+ring r=(0,a),x,dp;
+r;
+option();
+option(intStrategy);
+option();
+option(nointStrategy);
+option();
+kill r;
+ring r=(7,a),x,dp;
+r;
+option();
+option(intStrategy);
+option();
+option(nointStrategy);
+option();
+kill r;
+// -----------------------------------------------------------
+// could not display number from lists (sleftv::String())
+// OB/HS
+ring r=0,x,dpi;list l=1/2;l[1];
+$
+
Index: Tst/Old/err5.tst
===================================================================
--- Tst/Old/err5.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/err5.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,39 @@
+//From:    Trond St|len Gustavsen <stolen@math.uio.no>
+
+ring r = 0, (x(1..5)), ds;
+matrix m[2][4]= x(1), x(2), x(3), x(4), x(2), x(3), x(4), x(5);
+
+ideal j = minor(m, 2);
+ideal i = std(j);
+
+mres(i, 2, ires);
+matrix jaco = jacob(ires(1));
+qring s = i;
+s;
+matrix mat = matrix(fetch(r,ires(2)));
+matrix imat = transpose(mat);
+matrix jac = fetch(r, jaco);
+
+res(module(imat),3,imatres);
+
+matrix T = lift(imatres(2), module(jac));
+
+module P=std(module(T))+std(imatres(3));
+
+module Q=std(P);
+Q;
+kbase(Q);
+vdim(Q);
+degree(Q);
+
+//When executing the kbase(Q) gives 4 elements in Q, but vdim returns -1.
+//----------------------------------------------------------------------------
+// incorrect kbase and vdim (0.8.9f) (anne)
+ring rr=32003,(x,y),dp;
+module i=
+1*gen(1),
+x*gen(2),
+y^3*gen(2);
+vdim(i);
+kbase(i);
+$
Index: Tst/Old/err6.tst
===================================================================
--- Tst/Old/err6.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/err6.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,9 @@
+// an error of 0.8.9e (pfister): febase crashed on buffer increases >4K
+ring r=0,x,dp;
+poly z=1024;
+z=z^10; // 2^100
+z=z^10; // 2^1000
+z=z^10; // 2^10000
+z=z^10; // 2^100000
+z;
+$
Index: Tst/Old/err7.tst
===================================================================
--- Tst/Old/err7.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/err7.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,33 @@
+proc t
+{
+ring r;
+listvar();
+"returning";
+}
+t();
+listvar();
+kill t;
+// error of 0.9.3a (pfister): mapping of zero mons
+ring r1=0,s,dp;
+poly te=s+3;
+ring r=3,s,dp;
+poly te=imap(r1,te);
+te;
+kill r;
+// error of 0.9.3a (pfister): power of binoms in char p
+ring r=3,(s,t),dp;
+(s+t)^13;
+poly p=(s+t)^13;p;
+p=p*1;
+p;
+kill r;
+// error of 0.9.3b (pfister): incorrect impl. for finding alg*pp
+ring rq=(32003,p,q,s),(t,u,v,w,x,y,z),dp;
+ideal ser;
+kill rq;
+// error of 0.9.3b (hannes): 0-monomial
+ring r=0,(x,y),dp;
+ideal i=ideal(0,x);
+size(i[1]);// must be 0, was 1
+quit;
+$
Index: Tst/Old/examples.lst
===================================================================
--- Tst/Old/examples.lst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/examples.lst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,20 @@
+;examples.tex
+m1ex
+m2ex
+m3ex
+m4ex
+m5ex
+m6ex
+m7ex
+m8ex
+m9ex
+m10ex
+m11ex
+m12ex
+m13ex
+m14ex
+m15ex
+m16ex
+m17ex
+m18ex
+m19ex
Index: Tst/Old/execut.tst
===================================================================
--- Tst/Old/execut.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/execut.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,18 @@
+//
+// test script for execute command
+//
+pagelength = 10000;
+ring r1=32003,(x,y,z),dp;
+r1;
+"-------------------------------";
+ideal j=x+y,z4+23y;
+system("sh","/bin/rm -f save_j");
+write("save_j",j);
+ring r2=0,(x,y,z),Dp;
+string s="ideal k="+read("save_j")+";";
+execute s;
+k;
+"-------------------------------";
+listvar(all);
+kill r1,r2;
+$;
Index: Tst/Old/factor.tst
===================================================================
--- Tst/Old/factor.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/factor.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,29 @@
+ring s=0,(b,c,d,e,f,g,u,v,w,x,y),dp;
+poly p=(2*f*x^2*y)*w^5+(-1*e*v*x^2+8*f*u*y^3-8*f*v*x*y^2)*w^4
++(-4*e*u*v*y^2+4*e*v^2*x*y-8*f*u^2*y^2+12*f*u*v*x*y+4*f*v^2*x^2)*w^3
++(4*e*u^2*v*y-6*e*u*v^2*x+2*f*u^3*y+32*f*u*v^2*y^2-32*f*v^3*x*y)*w^2
++(-1*e*u^3*v-8*e*u*v^3*y+8*e*v^4*x-16*f*u^2*v^2*y+24*f*u*v^3*x)*w
++(4*f*u^3*v^2+32*f*u*v^4*y-32*f*v^5*x);
+factorize(p);
+factorize(p,0);
+factorize(p,1);
+factorize(p,2);
+ring C=(32003,i),x,dp;
+minpoly=i2+1;
+poly p=x2+1;
+factorize(p);
+factorize(p,0);
+factorize(p,1);
+factorize(p,2);
+kill s,C;
+ring r=3,(x,y,u,s,t),dp;
+poly p=
+s^85+(t)*s^84+(t^2)*s^83+(-1*t^18)*s^67+(-1*t^19)*s^66+(t^20)*s^65
++(t^21)*s^64+(t^22)*s^63+(-1*t^24)*s^61+(-1*t^25)*s^60+(t^29)*s^56
++(t^38)*s^47+(-1*t^39)*s^46+(-1*t^40)*s^45+(-1*t^42)*s^43+(-1*t^43)*s^42
++(-1*t^45)*s^40+(-1*t^46)*s^39+(t^47)*s^38+(t^56)*s^29+(-1*t^60)*s^25
++(-1*t^61)*s^24+(t^63)*s^22+(t^64)*s^21+(t^65)*s^20+(-1*t^66)*s^19
++(-1*t^67)*s^18+(t^83)*s^2+(t^84)*s+(t^85);
+factorize(p);
+$
+
Index: Tst/Old/fak.tst
===================================================================
--- Tst/Old/fak.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/fak.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,42 @@
+pagelength = 1000;
+proc sum
+{
+  if (#[1] <= 1) { return(#[1]); }
+  return (#[1] + sum(#[1] -1));
+}
+proc fak
+{
+  if (#[1] <= 1) { return(1); }
+  return (#[1] * fak(#[1] -1));
+}
+proc binom
+{
+  return (fak(#[1]) / (fak(#[1]-#[2]) * fak(#[2])));
+}
+"nesting too deep for fak(30)!!!!";fak(30);
+int i;
+int j;
+//for (i = 2; i<=10; i=i+1)
+//{
+//  i, "sum", sum(i), "fak", fak(i);
+//}
+//"binom(5,1)", binom(5,1);
+//$;
+string b;
+for (i=1; i<=16; i=i+1)
+{
+  b = "binoms " + string(i) + " ";
+  for (j=0; j<=i; j=j+1)
+  {
+    b = b + " " + string(binom(i,j));
+  }
+  b;
+}
+$;
+"binom(5,0)", binom(5,0);
+"binom(5,1)", binom(5,1);
+"binom(5,2)", binom(5,2);
+"binom(5,3)", binom(5,3);
+"binom(5,4)", binom(5,4);
+"binom(5,5)", binom(5,5);
+$;
Index: Tst/Old/fastelim.tst
===================================================================
--- Tst/Old/fastelim.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/fastelim.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,51 @@
+//124. Beispiel mit Produktordnung, wo Macaulay ca 10 mal schneller ist:
+// ca 43 sec auf PB 520c
+// Macaulay hat 2 sec (ohne set autodegree, autocalc)
+//option(mem);
+//option(prot);
+
+ring P6 = 31991,(s,t,x,y,a,b,c,d,e,f,g),dp;
+ideal i= -6s5x+a, -5s4tx-1s5y+b, -4s3t2x-2s4ty+c,
+-3s2t3x-3s3t2y+d, -2st4x-4s2t3y+e, -1t5x-5st4y+f, -6t5y+g;
+
+;ideal j= eliminate(i,stxy);
+j;
+
+// andere Ringordnung:
+ring Pa6 = 31991,(s,t,x,y,a,b,c,d,e,f,g),(a(1,1,1,1,6,6,6,6,6,6,6),dp(4),dp(7))
+;
+ideal i= -6s5x+a, -5s4tx-1s5y+b, -4s3t2x-2s4ty+c,
+-3s2t3x-3s3t2y+d, -2st4x-4s2t3y+e, -1t5x-5st4y+f, -6t5y+g;
+;ideal j=std(i);
+LIB "elim.lib";
+j=nselect(j,1,4);
+j;
+$
+==============
+Macaulay input:
+==============
+ring R
+
+11
+stxya-g
+1:4 6
+4 6
+ideal i
+7
+- -6s5x+a
+- -5s4tx-1s5y+b
+- -4s3t2x-2s4ty+c
+- -3s2t3x-3s3t2y+d
+- -2st4x-4s2t3y+e
+- -1t5x-5st4y+f
+- -6t5y+g
+std i j
+- -> 6[126k]7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23.24.25.26.27.
+- -> 28.29.30.31.
+- -> computation complete after degree 31
+- -> elapsed time :  2 seconds
+
+
+------- End of Forwarded Message
+
+
Index: Tst/Old/fetch.tst
===================================================================
--- Tst/Old/fetch.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/fetch.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,132 @@
+proc generate_ring_str(int n, string r_name, string ostring)
+{
+  return ("ring "+r_name+" = 32003,x(1.." + string(n) + ")," + ostring + ";");
+}
+
+proc generate_polys_str(int n)
+{
+  string polystr = "poly p = ";
+  int i;
+
+  for (i=1; i<=n; i = i + (i / 10) + 1)
+  {
+    polystr = polystr + "x(" + string(i) + ") + ";
+  }
+  return (polystr + "1; poly p1 = p^2+p; vector p2 = (p^2+p)*(gen(2) + gen(3)); vector p3 = (p^2+p)*(gen(2) + gen(3))+ p^2 + p; vector p4 = p3 + p^3;p; p1; p2; p3; p4");
+}
+
+proc generate_weight_str(int j)
+{
+  int i;
+  string res_str = "(";
+  
+  for (i=1; i<j; i++)
+  {
+    res_str = res_str + string(i) + ",";
+  }
+  return (res_str + string(j) + ")");
+}
+
+
+list orderings = "lp", "dp", "Dp", "ls", "ds", "Ds";
+
+list l = "dp";
+
+proc extend_orderings(list olist, int j)
+{
+  int i;
+  int c1;
+  int c2;
+  string o1;
+  string o2;
+  string o3;
+  list nl;
+  string weight_string = generate_weight_str(j);
+  o1 = olist[1];
+  if (size(olist) > 1)
+  {
+    o2 = olist[2];
+    if (size(olist) > 2)
+    {
+      o3 = olist[3];
+    }
+    else
+    {
+      o3 = olist[2];
+    }
+  }
+  else
+  {
+    o2 = o1;
+    o3 = o1;
+  }
+      
+  // add weight orderings 
+  olist = olist + list("Wp" + weight_string, "wp" + weight_string);
+
+    
+  for (i=1; i<=size(olist); i++)
+  {
+    nl = nl + list(olist[i], "(C," + olist[i] + ")", "(c," + olist[i] + ")",
+                   "(" + olist[i] + ",C)", "(" + olist[i] + ",c)");
+  }
+
+  // add product orderings
+  if (j > 1)
+  {
+    c1 = j / 2;
+    if (c1 + c1 == j)
+    {
+      c2 = c1;
+    }
+    else
+    {
+      c2 = c1 + 1;
+    }
+    nl = nl + list("(" + o1 + "(" + string(c1) + "),"+ o2 + "(" + string(c2) + "))", "(" + o1 + "(" + string(c1) + "),"+ o3 + "(" + string(c2) + "))");
+    // and, extra weight vector
+    nl = nl + list("(a" + weight_string + "," + o2 + "(" + string(c1) + "),"+ o3 + "(" + string(c2) + "))", "(a" + generate_weight_str(j-1)+ "," + o3 + "(" + string(c1) + "),"+ o1 + "(" + string(c2) + "))");
+  }
+
+  // and, last but not least, a Matrix ordering
+  nl = nl + list("M(m)");
+  
+  return (nl);
+
+}
+    
+proc check_fetch(int n, list olist)
+{
+  int i;
+  int j;
+  list e_olist;
+  
+  for (j=1; j<=n; j = j + (j / 10) + 1)
+  {
+    e_olist = extend_orderings(olist, j);
+    execute generate_ring_str(j, "r", e_olist[1]);
+    execute generate_polys_str(j);
+    intmat m[j][j];
+    m = m + 1;
+    for (i=1; i<=size(e_olist); i++)
+    {
+      execute generate_ring_str(j, "r1", e_olist[i]);
+      fetch(r, p);
+      fetch(r, p1);
+      fetch(r, p2);
+      fetch(r, p3);
+      fetch(r, p4);
+      r1;
+      kill r1;
+    }
+    kill r;
+    kill m;
+  }
+}
+
+check_fetch(15, orderings);
+
+quit;
+  
+  
+
Index: Tst/Old/file2.tst
===================================================================
--- Tst/Old/file2.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/file2.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,6 @@
+"list1 file2.tst"; listvar(all);
+int i = 9;
+i;
+int @i = 2;
+< "file3.tst";
+"list2 file2.tst"; listvar(all);
Index: Tst/Old/file3.tst
===================================================================
--- Tst/Old/file3.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/file3.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,6 @@
+"list1 file3.tst"; listvar(all);
+int i = 9;
+i;
+int @i = 3;
+< "file4.tst";
+"list2 file3.tst"; listvar(all);
Index: Tst/Old/file4.tst
===================================================================
--- Tst/Old/file4.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/file4.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,5 @@
+"list1 file4.tst"; listvar(all);
+int i = 9;
+i;
+int @i = 4;
+"list2 file4.tst"; listvar(all);
Index: Tst/Old/filenest.tst
===================================================================
--- Tst/Old/filenest.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/filenest.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,7 @@
+"list1 filenest.tst"; listvar(all);
+int i = 9;
+i;
+int @i = 1;
+< "file2.tst";
+"list2 filenest.tst"; listvar(all);
+$
Index: Tst/Old/firsts.tst
===================================================================
--- Tst/Old/firsts.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/firsts.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,18 @@
+proc firsts
+{
+  string @ss = #[3] + #[3];
+  string @s;
+  int @i;
+  for (int @j = 1; @j<=#[2]; @j=@j+1)
+  {
+    @s = "poly " + #[1] + string(@j) + "=";
+    for (@i=1; @i <=size(#[3]); @i = @i + 1)
+    {
+      @s = @s + @ss[@i,@j] + "+";
+    }
+    @s = @s[1,size(@s)-1] + ";";
+    @s;
+  }
+}
+firsts("s",6,"abcdefg");
+$;
Index: Tst/Old/formmat.tst
===================================================================
--- Tst/Old/formmat.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/formmat.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,73 @@
+pagelength = 1000;
+proc mrows
+{
+  string @rc;
+  for (int @i = 1; @i<=ncols(#[1]); @i=@i+1)
+  {
+    @rc = @rc + "m[" + string(#[2]) + "," + string(@i) + "],";
+  }
+  @rc = @rc[1,size(@rc)-1] + ";";
+  execute "return (@rc);";
+}
+ring r= 32003,(x,y,z),lp;
+matrix m[3][3] = 0;
+m[1,1] = 4x;
+m[1,2] = y5x;
+m[3,2] = y5x + 4xyz;
+m;
+string ss;
+for (int ii=1; ii<=nrows(m); ii=ii+1)
+{
+  ss;
+  ss = "ideal id(" + string(ii),")=";
+  ss;
+  ss = ss +  string(mrows(m,ii));
+  ss;
+  execute ss;
+  id(ii);
+}
+listvar(all);
+"id(1) : ";id(1);
+"elem 2 of id(1) : ";id(1)[2];
+id(1)[3] = (2*id(1)[2])^4;
+id(1);
+string(id(1)[3]);
+proc formmat
+{
+  int @elems = 0;
+  int @mlen  = 0;
+  int @slen  = 0;
+  int @c;
+  for (int @r=1; @r<=nrows(#[1]); @r=@r+1)
+  {
+    for (@c=1; @c<=ncols(#[1]); @c=@c+1)
+    {
+      @elems = @elems + 1;
+      string @s(@elems) = string(#[1][@r,@c]);
+      @slen = size(@s(@elems));
+      if (@slen > @mlen) { @mlen = @slen; }
+    }
+  }
+  @elems = 0;
+  string @aus;
+  string @fill = "                                                ";
+  string @sep = " ";
+  pagewidth = 30;
+  if (@mlen * ncols(#[1]) >= pagewidth)
+  {
+    @sep = NL;
+  }
+  for (@r=1; @r<=nrows(#[1]); @r=@r+1)
+  {
+    @aus = "";
+    for (@c=1; @c<=ncols(#[1]); @c=@c+1)
+    {
+      @elems = @elems + 1;
+      @slen = size(@s(@elems));
+      @aus = @aus + @s(@elems) + @fill[1,@mlen-@slen+1] + @sep;
+    }
+    @aus;
+  }
+}
+formmat(m);
+$
Index: Tst/Old/freemod.tst
===================================================================
--- Tst/Old/freemod.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/freemod.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,11 @@
+//
+// test script for freemodule command
+//
+pagelength = 10000;
+ring r1 = 32003,(x,y,z),(c,dp);
+r1;
+"-------------------------------";
+freemodule(3);
+listvar(all);
+kill r1;
+$;
Index: Tst/Old/general.tst
===================================================================
--- Tst/Old/general.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/general.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,16 @@
+LIB "general.lib";
+example A_Z;
+example binomial;
+example factorial;
+example fibonacci;
+example kmemory;
+example number_e;
+example number_pi;
+example primes;
+example product;
+example ringweights;
+example sort;
+example sum;
+
+example killall;
+$
Index: Tst/Old/generat.tst
===================================================================
--- Tst/Old/generat.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/generat.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,28 @@
+//
+// test script for gen command
+//
+pagelength = 10000;
+ring r1 = 32003,(x,y,z),(c,dp);
+r1;
+"-------------------------------";
+vector v1=gen(6);
+v1;
+poly f=xyz;
+v1=v1+f*gen(4);
+v1;
+gen(2);
+"--------------------------------";
+vector v2=gen(36);
+v2;
+poly f1=x2;
+poly f2=y2;
+poly f3=z2;
+v2=v2+f1*gen(1);
+v2;
+v2=v2+f2*gen(5);
+v2;
+v2=v2+f3*gen(36);
+v2;
+listvar(all);
+kill r1;
+$;
Index: Tst/Old/gm.tst
===================================================================
--- Tst/Old/gm.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/gm.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,198 @@
+//Testserie fuer std im Mora-Fall
+"              Testbeispiele Mora ";
+//timer=1;
+//test(0);
+" ";
+" ============= standard d - ==========================";
+"elem 19, dim 0, mult 312 ";
+";Sing 1.93 (test 3 4 15):4s, (test 3 10 15):6s; Quadra (test4 15): 1 sec";
+ring r1 = 32003,(z,y,x),ds;
+r1;
+poly s1=1x3y2+21328x5y+10667x2y4+21328x2yz3+10666xy6+10667y9;
+poly s2=1x2y2z2+3z8;
+poly s3=5x4y2+4xy5+2x2y2z3+1y7+11x10;
+ideal i=s1,s2,s3;
+ideal j=std(i);
+"dim: "+ string(dim(j)) +",  mult: "+ string(mult(j)) +",  elem: "
+                                                + string(size(j));
+j;
+kill r1;
+" ============= (19,19,4) d - ==========================";
+"elem 28, dim 0, mult1040
+//Sing1/93, (10,15):60s, Quadra (10,15): 22s";
+ring r2 = 32003,(x,y,z),ds;
+r2;
+int a=19; int b=19; int c=4; int t=1;
+"a b c t = ",a,b,c,t;
+poly f=x^a+y^b+z^(3*c)+x^(c+2)*y^(c-1)+x^(c-1)*y^(c-1)*z3+x^(c-2)*y^c*(y2+t*x)^2;
+f;
+ideal i=diff(f,x),diff(f,y),diff(f,z);
+ideal j=std(i);
+"dim: "+ string(dim(j)) +",  mult: "+ string(mult(j)) +",  elem: "
+                                                        + string(size(j));
+j;
+kill a,b,c,t,r2;
+" =========== (a,b,c,d,e,t) min=(9,9,15,5,6) d - =================";
+"elem 17, dim 0, mult 154 ?
+//Sing1/93, (test 10,15):60s, Quadra (test 10,15): 22s";
+ring r3 = 32003,(x,y,z),ds;
+r3;
+int a=9; int b=9; int c=13; int d=5; int e=5; int t=1;
+"a b c d e t = ",a,b,c,d,e,t;
+poly
+f=x^a+y^b+z^c+x^d*y^(e-5)+x^(d-2)*y^(e-3)+x^(d-3)*y^(e-4)*z^2+x^(d-4)*y^(e-4)*(y^2+t*x)^2;
+f;
+ideal i=diff(f,x),diff(f,y),diff(f,z);
+ideal j=std(i);
+"dim: "+ string(dim(j)) +",  mult: "+ string(mult(j)) +",  elem: "
+                                                        + string(size(j));
+j;
+kill a,b,c,e,d,t,r3;
+" ============= cyclic_roots_5(isol) + ==========================";
+"deg 131, dim 0, elem 30, Ende im Grad 12
+//Macaulay 20 sec (SE/30), Quadra (4 10 15):5 sec";
+//Sing1/93:19 sec (test 4 12) (SE/30), 12sec (PowerBook)
+ring r4 = 32003,(a,b,c,d,e),ds;
+r4;
+int n=10;
+poly s1=a+b+c+d+e;
+poly s2=de+1cd+1bc+1ae+1ab;
+poly s3=cde+1bcd+1ade+1abe+1abc;
+poly s4=bcde+1acde+1abde+1abce+1abcd;
+poly s5=abcde;
+ideal i=s1,s2,s3,s4,s5,a^n,b^n,c^n,d^n,e^n;
+i;
+ideal j=std(i);
+"dim: "+ string(dim(j)) +",  mult: "+ string(mult(j)) +",  elem: "
+                                                        + string(size(j));
+j;
+kill r4,n;
+" ============= cyclic_roots_6(homog) d- ==========================";
+"deg 120, dim 1, elem 38, Ende im Grad 14
+//Macaulay 17 sec (SE/30), 13 sec (PowerBook)
+//Sing1/93 10sec (test 4 12) SE/30, 7sec (PowerBook)";
+ring r5 = 32003,(a,b,c,d,e,f),ds;
+r5;
+poly s1=a+b+c+d+e;
+poly s2=de+1cd+1bc+1ae+1ab;
+poly s3=cde+1bcd+1ade+1abe+1abc;
+poly s4=bcde+1acde+1abde+1abce+1abcd;
+poly s5=f^5+1abcde;
+ideal i=s1,s2,s3,s4,s5;
+ideal j=std(i);
+"dim: "+ string(dim(j)) +",  mult: "+ string(mult(j)) +",  elem: "
+                                                        + string(size(j));
+j;
+kill r5;
+" ============= standardzyx(homog) l1 d3- ==========================";
+"deg 720, dim 1, elem 109, Ende im Grad 53
+//Macaulay 11;48 min (SE/30)
+//Sing1/93c: 9;58min (test 4 12) (SE/30)";
+ring r7 = 32003,(t,z,y,x),(ls(1),ds(3));
+r7;
+poly s1=1x3y2t4+21328x5yt3+10667x2y4t3+21328x2yz3t3+10666xy6t2+10667y9;
+poly s2=1x2y2z2t2+3z8;
+poly s3=5x4y2t4+4xy5t4+2x2y2z3t3+1y7t3+11x10;
+ideal i=s1,s2,s3;
+i;
+ideal j=std(i);
+"dim: "+ string(dim(j)) +",  mult: "+ string(mult(j)) +",  elem: "
+                                                        + string(size(j));
+j;
+kill r7;
+"=================  NF w:1 1 1  -  ==================";
+//elem 5, dim 1, mult 4, Quadra (4 10 15):2 sec
+//Sing1;93, (10,15):0s,##elem2##, (3,10,15):16s (Powerbook)
+ring r10=32003,(x,y,z),(ws(1,1,1));
+poly s1=x2-y2;
+poly s2=y3;
+poly s3=y2-zyx;
+poly s4=xy2z;
+ideal i=s1,s3,s4;
+ideal j=std(i);
+//size(j);
+degree (j);
+reduce(s2,j);
+kill r10;
+"====================  parametric curves l -   ==================";
+//Zeit: (l,test 0) H7 0/59, W 26/53
+ring a1=32003,(x,y,z,t),ls;
+ideal i=
+x31-x6-x-y,
+x8-z,
+x10-t;
+ideal j=std (i);
+//size(j);
+degree (j);
+j;
+kill a1;
+"====================  standard char0  =============================";
+//      H7 l, char 0, test0,11,1: 61/31 ohne vollst; Reduktion
+ring r=
+0,(x,y),ls;
+poly f=x5+y11+xy9+x3y9;
+ideal i=jacob(f);
+ideal j=std( i);
+j;
+degree (j);
+//size(j);
+kill r;
+"=============== integer-programming2  l1 d8 - =================";
+//elem 26, dim 6, mult 4191
+//Sing 1;93 (4 15):2s, (3 4 15):2s (SE/30)
+ring a3=32003,(t,a,b,c,d,e,x,y,z),(ls(1),ds(8));
+ideal i=
+-y82a+x32z23,
+x45-y13z21b,
+y33z12-z41c,
+-y33z12d+x22,
+x5y17z22e,
+xyzt;
+i;
+ideal j=std (i);
+j;
+degree (j);
+//size(j);
+kill a3;
+"================ entartet d- =================";
+ring r=32003,(x,y,z),ds;
+int s=1;
+int t=1;
+int u=1;
+poly f=(xyz+s*xy+t*yz+u*xz)*(x+y+z)^2 +x12+y12+z12;
+ideal i=jacob(f);
+ideal j=std(i);
+degree(j);
+j;
+kill r;
+"====================  omega2 d -   ==================";
+ring M=32003,(x,y,z),ds;
+int o=167;
+int m=167;
+poly f1=xy+z^(o-1);
+poly f2=xz+y^(m-1)+yz2;
+poly fx=diff(f1,x);
+poly fy=diff(f1,y);
+poly fz=diff(f1,z);
+poly gx=diff(f2,x);
+poly gy=diff(f2,y);
+poly gz=diff(f2,z);
+module i=
+[f1,0,0],
+[0,f1,0],
+[0,0,f1],
+[f2,0,0],
+[0,f2,0],
+[0,0,f2],
+[fy,fz,0],
+[fx,0,-fz],
+[0,fx,fy],
+[gy,gz,0],
+[gx,0,-gz],
+[0,gx,gy];
+module j=std (i);
+j;
+//size(j)
+"dimension of omega 2 =";
+degree(j);
+$
Index: Tst/Old/h4.tst
===================================================================
--- Tst/Old/h4.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/h4.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,34 @@
+ring h4=32003,(t,x,y,z,w),dp;
+ideal j=
+4t4z3y+6z4x3t5+5x5z7,
+5t6z3y3x+5x2z4t3y7+4x5t5y,
+6z7t5y+6z3y2t4+2t8z6;
+ideal i=j;
+ideal i=homog(j,w);
+ideal i0=std( i);
+size(i0);
+degree (i0);
+i0;
+kill h4;
+ring rh8=32003,(w,x,y,z),dp;
+int a =15;
+int b =10;
+int c =3;
+int t =1;
+poly f= x^a+y^b+z^(3*c)+x^(c+2)*y^(c-1)+x^(c-1)*y^(c-1)*z3+x^(c-2)*y^c*(y2+t*x)^2;
+ideal k= jacob(f);
+a =10;
+b= 11;
+c= 3;
+t= 1;
+f=x^a+y^b+z^(3*c)+x^(c+2)*y^(c-1)+x^(c-1)*y^(c-1)*z3+x^(c-2)*y^c*(y2+t*x)^2;
+ideal j= jacob(f);
+j =j+k;
+ideal i=homog(j,w);
+ideal i0=std( i);
+
+size(i0);
+degree (i0);
+i0;
+kill rh8,a,b,c,t;
+$
Index: Tst/Old/hilb.tst
===================================================================
--- Tst/Old/hilb.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/hilb.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,73 @@
+ring r1=32003,x,ds;
+module m=gen(1),gen(5);
+dim(m);
+mult(m);
+degree(m);
+vdim(m);
+kbase(m);
+hilb(m);
+m=m,x2*gen(2),x4*gen(2),x3*gen(3),x*gen(4);
+dim(m);
+mult(m);
+degree(m);
+vdim(m);
+kbase(m);
+hilb(m);
+kill r1;
+
+ring r2=32003,(x,y,z,w),dp;
+module m0=
+[x2y+yz2,0],
+[yzw+w3,0],
+[xyzw-1,0],
+[0,x3+yzw],
+[0,y3+xzw],
+[0,w2+z2];
+module m=std(m0);
+dim(m);
+mult(m);
+degree(m);
+hilb(m);
+ideal i=maxideal(5);
+hilb(i);
+kbase(i);
+vdim(i);
+kill r2;
+
+int n=2;
+ring r3=32003,(x(1..16)),dp;
+ideal i0=
+x(1)+x(2)+x(3)+x(4),
+x(1)^2*x(2)^2+x(2)*x(3)*x(5)*x(6),
+x(3)*x(4)*x(9)*x(10)+x(4)*x(5)*x(13)*x(14),
+x(1)*x(2)^2*x(3)+x(2)*x(3)*x(6)*x(7),
+x(3)*x(4)*x(11)*x(12)+x(4)*x(5)*x(15)*x(16),
+x(7)*x(8)*x(9)*x(10)+x(8)*x(9)*x(13)*x(14),
+x(7)*x(8)*x(11)*x(12)+x(8)*x(9)*x(15)*x(16),
+x(1)*x(2)*x(9)*x(10)+x(5)*x(6)*x(10)*x(11),
+x(2)*x(3)*x(9)*x(10)+x(6)*x(7)*x(10)*x(11),
+x(11)*x(12)*x(15)*x(16)+x(1)*x(15)*x(16)^2,
+x(4)*x(5)*x(13)*x(14)+x(8)*x(9)*x(14)*x(15)+x(12)*x(13)*x(15)*x(16)+
+x(1)^2*x(16)^2,
+x(1)^n,x(2)^n,x(3)^n,x(4)^n,x(5)^n,x(6)^n,x(7)^n,x(8)^n,
+x(9)^n,x(10)^n,x(11)^n,x(12)^n,x(13)^n,x(14)^n,x(15)^n,x(16)^n;
+ideal k0=std(i0);
+dim(k0);
+degree(k0);
+hilb(k0);
+mult(k0);
+vdim(k0);
+kill r3;
+
+ring r4=32003,(x(1..6)),ds;
+ideal i0=
+x(1)+x(2)+x(3)+x(4),
+x(1)^2*x(2)^2+x(2)*x(3)*x(5)*x(6),
+x(1)*x(2)^2*x(3)+x(2)*x(3)*x(6)^2;
+module m=syz(i0);
+dim(m);
+mult(m);
+degree(m);
+vdim(m);
+hilb(m);
+$
Index: Tst/Old/hilbert.tst
===================================================================
--- Tst/Old/hilbert.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/hilbert.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,22 @@
+//
+// test script for degree command
+//
+pagelength = 10000;
+ring r1=32003,(x,y,z),ds;
+"------------------------------";
+ideal i1=x2,y2,z2;
+i1;
+ideal i2=std(i1);
+i2;
+hilb(i2);
+"-----------------------------";
+module m=[x2,0],[0,y2],[0,z2];
+m;
+module m1=std(m);
+m1;
+hilb(m1);
+"-----------------------------";
+listvar(all);
+kill r1;
+$;
+
Index: Tst/Old/homo.tst
===================================================================
--- Tst/Old/homo.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/homo.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,22 @@
+//
+// test script for homog command
+//
+pagelength = 10000;
+ring r1 = 32003,(x,y,z),(c,ds);
+r1;
+"-------------------------------";
+poly s1=x2y3+45x6y3+68x4z5+80y6x8;
+poly s2=6x5+3y6+8z6;
+poly s3=12xyz3+2y3z6;
+ideal i1=s1,s2,s3;
+homog(s2,z);
+"--------------------------------";
+homog(i1,z);
+"--------------------------------";
+homog(s1,y);
+"--------------------------------";
+homog(i1,x);
+"----------------------------------";
+listvar(all);
+kill r1;
+$;
Index: Tst/Old/homtest.tst
===================================================================
--- Tst/Old/homtest.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/homtest.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,475 @@
+// standard examples for homogeneous ideals
+
+//==== elem 30, dim 0, mult 131;
+//==== Macaulay 1 sec
+//=== 0.54 sec
+
+ring b1=32003,(a,b,c,d,e),dp;
+int n =10;
+poly s1=a+b+c+d+e;
+poly s2=de+1cd+1bc+1ae+1ab;
+poly s3=cde+1bcd+1ade+1abe+1abc;
+poly s4=bcde+1acde+1abde+1abce+1abcd;
+poly s5=abcde;
+ideal i=s1,s2,s3,s4,s5,a^n,b^n,c^n,d^n,e^n;
+ideal i0=std( i);
+size(i0);
+degree (i0);
+kill n ,b1;
+
+//==== 9 9 9 homog
+//==== elem 83, dim 1, mult 512;
+//=== Macaulay 0 sec
+//=== 0.24 sec
+ring s2=32003,(t,x,y,z),dp;
+ideal i=
+9x8+y7t+5x4y2t2+2xy2z3t2,
+9y8+7xy6t+2x5yt2+2x2yz3t2,
+9z8+3x2y2z2t2;
+ideal i0=std( i);
+size(i0);
+degree (i0);
+kill s2;
+
+//========= Beipiel Alex1 homog
+//===== elem 95, dim 3, mult 18
+//==== Macaulay 5  sec
+//=== 3.39 sec
+
+ring h1=32003,(w,x,t,y,z),dp;
+ideal j=
+9x8+y7t3z4+5x4y2t2+2xy2z3t2,
+9y8+7xy6t+2x5y4t2+2x2yz3t2,
+9z8+3x2y3z2t4;
+ideal i=homog(j,w);
+ideal i0=std( i);
+size(i0);
+degree (i0);
+kill h1;
+
+//========= Beipiel Alex2 homog
+//=== elem 158, dim 3, mult 52
+//==== Macaulay 5 min 0 sec
+//=== 122.43 sec
+
+ring h2=32003,(t,x,y,z,w),dp;
+ideal j=
+2t3x5y2z+x2t5y+2x2y,
+2y3z2x+3z2t6x2y+9y2t3z,
+2t5z+y3x2t+z2t3y2x5;
+ideal i=homog(j,w);
+ideal i0=std( i);
+size(i0);
+degree (i0);
+kill h2;
+
+//========= Beipiel Alex3 homog
+//=== elem 211, dim 3 , mult 7
+//==== Macaulay 27 sec
+//=== 19.43 sec
+
+ring h3=32003,(t,x,y,z,w),dp;
+ideal j=
+5t3x8y2z+x2t5y+2x2y+5t,
+7y6z2x+6x2y+9y2t3z+4t6x,
+4t6z+8y3x5t+2t3y2x3+3x;
+ideal i=homog(j,w);
+ideal i0=std( i);
+size(i0);
+degree (i0);
+kill h3;
+
+//========= Beipiel Alex4 homog
+//=== elem 116, dim 3, mult 87
+//==== Macaulay 5 sec
+//=== 4.72 sec
+
+//========= Beipiel Alex5 homog
+//=== elem 52, dim 3, mult 8
+//=== Macaulay 17 sec
+//=== 6.99 sec
+
+ring h5=32003,(t,x,y,z,w),dp;
+ideal j=
+4t2z+6z3t+3z2,
+5t2z7y3x+5x2z4t3y+3t,
+6zt2y+2x+6z2y2t+2y;
+ideal i=homog(j,w);
+ideal i0=std( i);
+size(i0);
+degree (i0);
+kill h5;
+
+//========= Beipiel Alex6 homog
+//=== elem 49, dim 3, mult 5
+//=== Macaulay 27 sec
+//=== 18.14 sec
+
+ring h6=32003,(t,x,y,z,w),dp;
+ideal j=
+4t2z+6z3t+3z2tx+3z,
+5t7yx+5x2z4t3y+3t,
+6zt2y+2x+6z2y2t+2y;
+ideal i=homog(j,w);
+ideal i0=std( i);
+size(i0);
+degree (i0);
+kill h6;
+
+//==== Beispiel Behnke
+//==== elem 149, dim 1, mult 120
+//==== Macaulay 5 sec
+//=== 3.82 sec
+
+ring be=32003,(a,b,c,d,e),dp;
+ideal i=
+a5-b5,
+b5-c5,
+c5-d5,
+d5-e5,
+a4b+b4c+c4d+d4e+e4a;
+test(15);
+ideal i0=std( i);
+size(i0);
+degree (i0);
+test(-15);
+kill be;
+
+//==== elem 82, dim 3, mult 3
+//==== Macaulay 1 min 11 sec
+//=== 17.50 sec
+
+ring rh1=32003,(w,t,x,y,z),dp;
+ideal j=
+5t3x2z+2t2y3x5,
+7y+4x2y+y2x+2zt,
+3tz+3yz2+2yz4;
+ideal i=homog(j,w);
+ideal i0=std( i);
+size(i0);
+degree (i0);
+kill rh1;
+
+//==== elem 68, dim 1, mutl 720
+//==== Macaulay 3 sec
+//=== 1.27 sec
+
+ring rh2=32003,(w,x,y,z),dp;
+poly p1 = 1x3y2+21328x5y+10667x2y4+21328x2yz3+10666xy6+10667y9;
+poly p2 = 1x2y2z2+3z8;
+poly p3 = 5x4y2+4xy5+2x2y2z3+1y7+11x10;
+ideal j= p1,p2,p3;
+ideal i=homog(j,w);
+ideal i0=std( i);
+size(i0);
+degree (i0);
+kill rh2;
+
+//==== elem 75, dim 1, mult 720
+//==== Macaulay 3 sec
+//=== 1.53 sec
+
+ring rh3=32003,(w,x,y,z),dp;
+int a =11;
+int b =10;
+int c =3;
+int t =1;
+
+poly f= x^a+y^b+z^(3*c)+x^(c+2)*y^(c-1)+x^(c-1)*y^(c-1)*z3+x^(c-2)*y^c*(y2+t*x)^2;
+ideal j= jacob(f);
+ideal i=homog(j,w);
+ideal i0=std( i);
+size(i0);
+degree (i0);
+kill rh3;
+
+//=== elem 41, dim 1, mult 125
+//==== Macaulay 4 sec
+//=== 1.60 sec
+
+ring rh4=32003,(w,x,y,z),dp;
+int a=6;
+poly f =xyz*(x+y+z)^2 +(x+y+z)^3 +x^a+y^a+z^a;
+ideal j= jacob(f);
+ideal i=homog(j,w);
+ideal i0=std( i);
+size(i0);
+degree (i0);
+kill rh4;
+
+//=== elem 44, dim 1, mult 216
+//==== Macaulay 4 sec
+//=== 1.69 sec
+
+ring rh5=32003,(w,x,y,z),dp;
+int a =7;
+poly f=xyz*(x+y+z)^2 +(x+y+z)^3 +x^a+y^a+z^a;
+ideal j= jacob(f);
+ideal i=homog(j,w);
+ideal i0=std( i);
+size(i0);
+degree (i0);
+kill rh5;
+
+//=== elem 117, dim 1, mult 107
+//==== Macaulay 3 sec
+//=== 2.85 sec
+
+ring rh6=32003,(w,x,y,z),dp;
+int a= 6;
+int b= 8;
+int c =10;
+int alpha=5;
+int beta= 5;
+int t=0;
+poly f= x^a+y^b+z^c+x^alpha*y^(beta-5)+x^(alpha-2)*y^(beta-3)+x^(alpha-3)*y^(beta-4)*z^2+x^(alpha-4)*y^(beta-4)*(y^2+t*x)^2;
+ideal j= jacob(f);
+j=j,(f);
+ideal i=homog(j,w);
+ideal i0=std( i);
+size(i0);
+degree (i0);
+kill a, b, c, alpha ,beta, t, rh6;
+
+//=== elem 66, dim 1, mult 315
+//==== Macaulay 4 sec
+//=== 1.79 sec
+
+ring rh7=32003,(u,x,y,z),dp;
+int a= 6;
+int b= 8;
+int c =10;
+int alpha=5;
+int beta= 5;
+int t=0;
+poly f =x^a+y^b+z^c+x^alpha*y^(beta-5)+x^(alpha-2)*y^(beta-3)+x^(alpha-3)*y^(beta-4)*z^2+x^(alpha-4)*y^(beta-4)*(y^2+t*x)^2;
+ideal j =jacob(f);
+ideal i=homog(j,u);
+ideal i0=std( i);
+size(i0);
+degree (i0);
+kill a, b, c, alpha ,beta, t, rh7;
+
+//=== elem 169, dim 1, mult 251
+//==== Macaulay 6 sec
+//=== 3.65
+
+ring rh9=32003,(w,x,y,z),dp;
+int a =11;
+int b =10;
+int c =3;
+int t =1;
+
+poly f= x^a+y^b+z^(3*c)+x^(c+2)*y^(c-1)+x^(c-1)*y^(c-1)*z3+x^(c-2)*y^c*(y2+t*x)^2;
+ideal j= jacob(f);
+j=j,(f);
+ideal i=homog(j,w);
+ideal i0=std( i);
+size(i0);
+degree (i0);
+kill b,c,t,a,rh9;
+
+//=== elem 75, dim 1, mult 44
+//==== Macaulay 2 sec
+//=== 1.71 sec
+
+ring rh10=32003,(w,x,y,z),dp;
+int a =6;
+poly f =xyz*(x+y+z)^2 +(x+y+z)^3 +x^a+y^a+z^a;
+ideal j= jacob(f);
+j=j,(f);
+ideal i=homog(j,w);
+ideal i0=std( i);
+size(i0);
+degree (i0);
+
+kill a,rh10;
+
+//=== elem 61, dim 1, mult 67
+//==== Macaulay 1 sec
+//=== 0.78 sec
+
+ring rh11=32003,(w,x,y,z),dp;
+int a =7;
+poly f =xyz*(x+y+z)^2 +(x+y+z)^3 +x^a+y^a+z^a;
+ideal j= jacob(f);
+j=j,(f);
+ideal i=homog(j,w);
+ideal i0=std( i);
+size(i0);
+degree (i0);
+kill a,rh11;
+
+//=== elem 83, dim 2, mult 26400
+//==== Macaulay 1 sec
+//=== 0.46 sec
+
+ring rh12=32003,(t,x,y,z,w),dp;
+ideal j=x2-z10-z20,xy3-z10-z30,y6-xy3w40;
+ideal i=homog(j,w);
+ideal i0=std( i);
+size(i0);
+degree (i0);
+kill rh12;
+
+//=== elem 23, dim 1, mult 380
+//==== Macaulay 4 sec
+//=== 1.81 sec
+
+ring rh13=32003,(w,x,y),dp;
+poly f=(x+y)^20 +y21+(x+y)^10 +x9y9+x3y15+x2y11+x4y4+(x+y)^17;
+ideal j= jacob(f);
+ideal i=homog(j,w);
+ideal i0=std( i);
+size(i0);
+degree (i0);
+kill rh13;
+
+//=== elem 254, dim 1, mult 56
+//==== Macaulay 44 sec
+//=== 23.08 sec
+
+ring rh14=32003,(w,x,y),dp;
+poly f=(x+y)^20 +y21+(x+y)^10 +x9y9+x3y15+x2y11+x4y4+(x+y)^17;
+ideal j= jacob(f);
+j=j,(f);
+ideal i=homog(j,w);
+ideal i0=std( i);
+size(i0);
+degree (i0);
+kill rh14;
+
+//=== elem 143, dim 1, mult 194
+//==== Macaulay 11 sec
+//===  2.05 sec
+
+ring rh17=32003,(w,x,y,z),dp;
+ideal j=
+1x3+1y4+2xz3+1z5+32000x4y2+2z6+3z7,
+1xz3+32001x4y2+1z6+2z7,
+9x3z2+18x2z5+31998z7+12x4y2z2+42x2z6+40x3y2z4+7z9+24x3y2z5,
+31999y3z3+31991x6y+32x3y5+32001x4yz3,
+12xy3z2+6x5yz2+24y3z5+20x4yz4+56y3z6+12x4yz5;
+ideal i=homog(j,w);
+ideal i0=std( i);
+size(i0);
+degree (i0);
+kill rh17;
+
+//=== elem 22, dim 2, mult 416
+//==== Macaulay 4 sec
+//===  0.77 sec
+
+ring rh18=32003,(w,t,x,y,z),dp;
+ideal j=
+4t2z+6z3t+3z3+tz,
+5t2z7y3x+5x2z4t3y+3t7,
+6zt2y+2x8+6z2y2t+2y5;
+ideal i=homog(j,w);
+ideal i0=std( i);
+size(i0);
+degree (i0);
+kill rh18;
+
+//===== elem 111,dim 1, mult 3564
+//==== Macaulay 15 sec
+//===  9.11 sec
+
+ring rh19=32003,(w,x,y,z),dp;
+int a =19;
+int b =19;
+int c =4;
+int t =1;
+
+poly f= x^a+y^b+z^(3*c)+x^(c+2)*y^(c-1)+x^(c-1)*y^(c-1)*z3+x^(c-2)*y^c*(y2+t*x)^2;
+ideal j= jacob(f);
+ideal i=homog(j,w);
+ideal i0=std( i);
+size(i0);
+degree (i0);
+kill b,c,t,a,rh19;
+
+//==== elem 278,dim 1, mult 8602
+//==== Macaulay 6 min 9 sec
+//===  239.13 sec (3 min 59.13 sec)
+
+ring rh20=32003,(w,x,y,z),dp;
+int a =24;
+int b =23;
+int c =6;
+int t =1;
+
+poly f= x^a+y^b+z^(3*c)+x^(c+2)*y^(c-1)+x^(c-1)*y^(c-1)*z3+x^(c-2)*y^c*(y2+t*x)^2;
+ideal j= jacob(f);
+ideal i=homog(j,w);
+ideal i0=std( i);
+size(i0);
+degree (i0);
+kill b,c,t,a,rh20;
+
+//=== elem 103, dim 1, mult 729
+//=== Macaulay 4 min 33 sec
+//=== 144.50 sec (2 min 24.50 sec)
+
+ring testh1=32003,(w,x,y,z),dp;
+int a =10;
+poly f=(xyz+xy+yz+xz)*(x+y+z)^2 +x^a+y^a+z^a;
+ideal j= jacob(f);
+ideal i=homog(j,w);
+ideal i0=std( i);
+size(i0);
+degree (i0);
+kill a,testh1;
+
+//==== elem 443, dim 2, mult 392
+//==== Macaulay 29 min 17 sec
+//===  1019.78 sec (16 min 59.78 sec)
+
+ring testh2=32003,(a,b,c,d,e,f,g,h),dp;
+ideal i=
+a+b+c+d+e+f+g,
+ab+bc+cd+de+ef+fg+ga,
+abc+bcd+cde+d*ef+efg+fga+gab,
+abcd+bcde+cdef+defg+efga+fgab+gabc,
+abcde+bcdef+cdefg+defga+efgab+fgabc+gabcd,
+abcdef+bcdefg+cdefga+defgab+efgabc+fgabcd+gabcde,
+abcdefg+h^7;
+ideal i0=std(i);
+size(i0);
+degree (i0);
+kill testh2;
+
+//===  elem 767, dim 2 mult 86
+//== Macaulay 42 min 0 sec
+//=== 1616.59 sec (26 min 56.59 sec)
+
+ring rh15=32003,(w,x,y,z),dp;
+poly p1= x2y *(47x5y7z3+28xy5z8+63+91x5y3z7);
+poly p2= xyz *(57y6+21x2yz9+51y2z2+15x2z4);
+poly p3= xy4z *(74y+32x6z7+53x5y2z+17x2y3z);
+poly p4= y3z *(21x2z6+32x10y6z5+23x5y5z7+27y2);
+poly p5= xz *(36y2z2+81x9y10+19x2y5z4+79x4z6);
+ideal j= p1,p2,p3,p4,p5;
+ideal i=homog(j,w);
+ideal i0=std( i);
+size(i0);
+degree (i0);
+kill rh15;
+
+//=== elem  ,dim 0, mult 90
+//=== Macaulay 3 sec
+//===  2.21
+
+ring testh4 = 31991,(u,v,w,x,y,z),dp;
+
+ideal i = xy+y2+uz-wz-xz+yz, x2-y2+uz-wz-xz+z2, wy, wx-uz+yz, w2-y2+uz-z2, vz-yz-z2,
+vy-y2-wz+xz+yz+z2, vx-y2+uz+yz-z2, vw-y2+uz+yz-z2, v2+y2+uz-xz-yz-z2, uy+y2+yz,
+ux-y2+wz-xz-z2, uw-y2+uz+yz-z2, uv-y2-xz+yz, u2+yz;
+
+ideal i3 = i^2;
+ideal j = std(i3);
+size(j);
+degree(j);
+
+kill testh4;
+$
Index: Tst/Old/idea.tst
===================================================================
--- Tst/Old/idea.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/idea.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,28 @@
+//
+// test script for ideal command
+//
+pagelength = 10000;
+ring r1 = 0,(x,y,z),ds;
+r1;
+"------------------------------";
+poly s1=12x2y4+34xyz5-78x2y4z2;
+poly s2=3*x^2*y^3+6*x^3*y^2*z^4;
+int i=2;
+int j=6;
+int k=45;
+poly s3=i*x^k*y^j+k*x^(i+j)*z^k;
+poly s4=7/9x3z7;
+poly s5=12;
+poly s6;
+ideal i1=s1,s1+s2,s3-s1,s4*s3,s5^6;
+i1;
+"--------------------------------";
+ideal i2=i1^2;
+i2;
+"--------------------------------";
+ideal i3=i1*i2;
+i3;
+"----------------------------";
+listvar(all);
+kill r1;
+$;
Index: Tst/Old/ideal.tst
===================================================================
--- Tst/Old/ideal.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/ideal.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,19 @@
+ring r= 32003,(x,y,z),lp;
+ideal id = x,y,z;
+id;
+ideal id2 = 3, id;
+id2;
+ideal id3 = id[1], id[2], id[3];
+id3;
+id;
+matrix m[3][2] = id;
+m;
+ideal id4=id+id;
+id4;
+ideal id5=id+id2;
+id5;
+ideal id6=id*id;
+id6;
+ideal id7=maxideal(10);
+id7;
+$;
Index: Tst/Old/idealop.tst
===================================================================
--- Tst/Old/idealop.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/idealop.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,21 @@
+ring r=181,(x,y,z),(c,ls);
+ideal id1=maxideal(3);
+id1;
+ideal id2=x2+xyz,y2-z3y,z3+y5xz;
+id2;
+ideal id3=intersect(id1,id2);
+id3;
+ideal id4=id1+id2;
+id4;
+ideal id5=minbase(id4);
+id5;
+ideal id6=quotient(id1,id2);
+id6;
+ideal id7=quotient(id2,id1);
+id7;
+ring rr=32003 ,(x, y),dp;
+ideal i=x;
+ideal j=y;
+ideal k=intersect(i,j);
+k;
+$
Index: Tst/Old/if.tst
===================================================================
--- Tst/Old/if.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/if.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,130 @@
+if (1)
+{
+"if branch if(1)";
+}
+else
+{
+"else branch if(1)";
+};
+// ====================================================
+if (1)
+{
+"if branch if(1) without else";
+}
+int i;
+else
+{
+"else branch without if";
+};
+// ====================================================
+if (0)
+{
+"if branch if(0)";
+}
+else
+{
+"else branch if(0)";
+};
+// ====================================================
+if (0)
+{
+"if branch if(0) without else";
+}
+int j;
+else
+{
+"else branch without if";
+};
+// ====================================================
+if(0)
+{
+  if(0)
+  {
+     "wrong 0 0: if if";
+  }
+  else
+  {
+     "wrong 0 0: if else";
+   };
+}
+else
+{
+  if(0)
+  {
+     "wrong 0 0: else if";
+  }
+  else
+  {
+     "nested if 0 0";
+  };
+};
+// ====================================================
+if(0)
+{
+  if(1)
+  {
+     "wrong 0 1: if else";
+  }
+  else
+  {
+     "wrong 0 1: if if";
+   };
+}
+else
+{
+  if(1)
+  {
+     "nested if 0 1";
+  }
+  else
+  {
+     "wrong 0 1: else else";
+   };
+}
+// ====================================================
+if(1)
+{
+  if(0)
+  {
+     "wrong 1 0: if if";
+  }
+  else
+  {
+     "nested if 1 0";
+  };
+}
+else
+{
+  if(0)
+  {
+     "wrong 1 0: else if";
+  }
+  else
+  {
+     "wrong 1 0: else else";
+   };
+}
+// ====================================================
+if(1)
+{
+  if(1)
+  {
+     "nested if 1 1";
+  }
+  else
+  {
+     "wrong 1 1: if else";
+   };
+}
+else
+{
+  if(1)
+  {
+     "wrong 1 1: else if";
+  }
+  else
+  {
+     "wrong 1 1: else else";
+   };
+}
+$
Index: Tst/Old/imap.tst
===================================================================
--- Tst/Old/imap.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/imap.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,9 @@
+ring r1=0,(x,y,a,b,z,c),dp;
+poly f=x+2y+3z+4a+5b+6c+11x2+12xy+13xz+14xa+15xb+16xc+25y2b3;
+f;
+ring r2=0,(x,z,y),dp;
+imap(r1,f);
+poly f=imap(r1,f);
+f;
+listvar(all);
+$
Index: Tst/Old/index.tst
===================================================================
--- Tst/Old/index.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/index.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,28 @@
+intvec iv=1,2,3,4;
+iv;
+iv[1];
+iv[2];
+iv[2..3];
+string s="12345";
+s;
+s[1];
+s[2];
+s[2..4];
+s[2,2];
+ring r;
+ideal i=1,2,3,4,5;
+i;
+i[1];
+i[2];
+i[2..4];
+matrix m[2][3]=1,2,3,4,5,6;
+m;
+m[1,1];
+m[2,1];
+m[1,2];
+m[2,2];
+m[1..2,1];
+m[1,1..2];
+m[1..2,2..3] ;
+listvar(all);
+$
Index: Tst/Old/initial.tst
===================================================================
--- Tst/Old/initial.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/initial.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,28 @@
+//
+// test script for lead command
+//
+pagelength = 10000;
+ring r1 = 32003,(x,y,z),(c,ds);
+r1;
+"-------------------------------";
+poly s1=x2y3+45x6y3+68x4z5+80y6x8;
+poly s2=6x5+3y6+8z6;
+poly s3=12xyz3+2y3z6;
+ideal i1=s1,s2,s3;
+vector v=[x8,s1];
+module m=v,s1*(v);
+lead(s1);
+"-------------------------------";
+lead(v);
+"---------------------------------";
+lead(i1);
+"--------------------------------";
+lead(m);
+"--------------------------------";
+lead(s2);
+"---------------------------------";
+lead(s3);
+"---------------------------------";
+listvar(all);
+kill r1;
+$;
Index: Tst/Old/inoutlib.tst
===================================================================
--- Tst/Old/inoutlib.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/inoutlib.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,16 @@
+help inout.lib;
+LIB "inout.lib";
+
+example allprint;newline;
+example dbpri;newline;
+example lprint;newline;
+example pmat;newline;
+example rMacaulay; newline;
+example show;newline;
+example split;newline;
+example tab;newline;
+example writelist;
+LIB "lib0.lib";
+example kmemory;newline;
+$
+
Index: Tst/Old/integ.tst
===================================================================
--- Tst/Old/integ.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/integ.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,17 @@
+//
+// test script for int command
+//
+pagelength = 10000;
+ring r1 = 0,(x,y,z),dp;
+r1;
+"--------------------------------";
+int i=10;
+int j=i+3;
+j;
+"-------------------------------";
+int k;
+k;
+"------------------------------";
+listvar(all);
+kill r1;
+$;
Index: Tst/Old/integers.tst
===================================================================
--- Tst/Old/integers.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/integers.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,300 @@
+int i; i;
+i = i + 8; i;
+int j = 9; j;
+j = -i -9; j;
+int k1 = 1,2;
+int l1 = 2147483647; l1; // max integer representation
+int k3 = k3+1; k3;       // k3 is initialize to 0 and then incremented;
+int ll = l1 + 1;ll;
+listvar(all);
+// --------- some help variables
+ring r;
+poly p = x23+y+z12;
+matrix m[2][3] = 1,2,3,4;
+ideal id = x,y,z;
+ideal sid = std(id);
+string st = "ab cde fghi";
+// ---------------- int operations
+"20 + 4 =", 20 + 4;
+"20 - 4 =", 20 - 4;
+"20 * 4 =", 20 * 4;
+"20 / 4 =", 20 / 4;
+"20 ^ 4 =", 20 ^ 4;
+"20 % 4 =", 20 % 4;
+"20 > 4 =", 20 > 4;
+"20 < 4 =", 20 < 4;
+"20 & 4 =", 20 & 4;
+"20 | 4 =", 20 | 4;
+"20 <> 4 =", 20 <> 4;
+"20 == 4 =", 20 == 4;
+"20 <= 4 =", 20 <= 4;
+"20 >= 4 =", 20 >= 4;
+"20 and 4 =", 20 and 4;
+"20 or 4 =", 20 or 4;
+"-(20 + 4) =", -(20 + 4);
+i;i++;
+"i++ = setting i!!!";
+i;i--;
+"i-- = setting i!!!";
+i;
+// ---------------- int commands
+i = char(r); "char r", i;
+i = ncols(m); "cols m 3", i;
+i = nrows(m); "rows m 2", i;
+i = vdim(sid); "vdim std(id)",i;
+i = dim(sid); "dim std(id)",i;
+i = mult(sid); "mult std(id)",i;
+i = size(id); "size id 3",i;
+i = size(p); "size p 3",i;
+i = size("aaaaaaaaaaaaaaaaaaa"); "size ...19", i;
+i = size(st); "size st 11", i;
+i = echo; "echo",i;
+i = pagelength; "pagelength",i;
+i = pagewidth; "pagewidth", i;
+i = timer; "timer", i;
+i = TRACE;"TRACE", i;
+i = voice;"voice 1", i;
+i = rvar(x); "is x a ringvar ",i;
+i = rvar(y); "is y a ringvar ",i;
+i = rvar(q); "is q a ringvar ",i;
+i = rvar(r); "is r a ringvar ",i;
+i = random(3,80);"this is random and should differ",i-i;
+i = defined(i);"is i defined ", i;
+i = ord(x);"ord x ", i;
+i = ord(p^5);"ord p^5 ", i;
+i = prime(28);"next prime <= 28 is ", i;
+
+"------------- errors ---------------";
+
+int i;
+int k =;
+int k = 1 2;
+int k = 1..2;
+int k = [1,2];
+int long1 = 12333333333333333333;
+int long2 = 2147483648;
+
+int ir1 = r;
+int ir2 = p;
+int ir3 = m;
+int ir4 = "aaaaaaaaaaa";
+listvar(all);
+// ---------------- wrong int commands
+i;
+i = char(id);
+i = ncols(p);
+i = nrows(p);
+i = vdim(m);
+i = dim(r);
+i = mult(p);
+i = size(r);
+i = random(3);
+i = random(3,55,555);
+i = defined();
+i = defined(r,m);
+i = defined(r,);
+i = defined(,r);
+i = ord();
+i = ord(r);
+i = ord(i);
+i = prime(28,5);
+prime(-28);
+prime();
+prime(1);
+prime(r);
+prime(2,r);
+" ---------------- wrong int operations";
+20 + ;
+20 - ;
+20 * ;
+20 / ;
+20 ^ ;
+20 % ;
+20 > ;
+20 < ;
+20 & ;
+20 | ;
+20 <> ;
+20 == ;
+20 <= ;
+20 >= ;
+20 and ;
+20 or ;
+-(20 + 4;
+// matrix operations -----------------------------------
+20 + m;
+20 - m;
+20 * m;
+20 / m;
+20 ^ m;
+20 % m;
+20 > m;
+20 < m;
+20 & m;
+20 | m;
+20 <> m;
+20 == m;
+20 <= m;
+20 >= m;
+20 and m;
+20 or m;
+-(20 + m);
+m + 20;
+m - 20;
+m * 20;
+m / 20;
+m ^ 20;
+m % 20;
+m > 20;
+m < 20;
+m & 20;
+m | 20;
+m <> 20;
+m == 20;
+m <= 20;
+m >= 20;
+m and 20;
+m or 20;
+-(m + 20);
+// string operations -----------------------------------
+20 + st;
+20 - st;
+20 * st;
+20 / st;
+20 ^ st;
+20 % st;
+20 > st;
+20 < st;
+20 & st;
+20 | st;
+20 <> st;
+20 == st;
+20 <= st;
+20 >= st;
+20 and st;
+20 or st;
+-(20 + st);
+st + 20;
+st - 20;
+st * 20;
+st / 20;
+st ^ 20;
+st % 20;
+st > 20;
+st < 20;
+st & 20;
+st | 20;
+st <> 20;
+st == 20;
+st <= 20;
+st >= 20;
+st and 20;
+st or 20;
+-(st + 20);
+// poly operations -----------------------------------
+20 + p;
+20 - p;
+20 * p;
+//20 / p;
+20 / x;
+20 ^ p;
+20 % p;
+20 > p;
+20 < p;
+20 & p;
+20 | p;
+20 <> p;
+20 == p;
+20 <= p;
+20 >= p;
+20 and p;
+20 or p;
+-(20 + p);
+p + 20;
+p - 20;
+p * 20;
+p / 20;
+p ^ 20;
+p % 20;
+p > 20;
+p < 20;
+p & 20;
+p | 20;
+p <> 20;
+p == 20;
+p <= 20;
+p >= 20;
+p and 20;
+p or 20;
+-(p + 20);
+// ring operations -----------------------------------
+20 + r;
+20 - r;
+20 * r;
+20 / r;
+20 ^ r;
+20 % r;
+20 > r;
+20 < r;
+20 & r;
+20 | r;
+20 <> r;
+20 == r;
+20 <= r;
+20 >= r;
+20 and r;
+20 or r;
+-(20 + r);
+r + 20;
+r - 20;
+r * 20;
+r / 20;
+r ^ 20;
+r % 20;
+r > 20;
+r < 20;
+r & 20;
+r | 20;
+r <> 20;
+r == 20;
+r <= 20;
+r >= 20;
+r and 20;
+r or 20;
+-(r + 20);
+// ideal operations -----------------------------------
+20 + id;
+20 - id;
+20 * id;
+20 / id;
+20 ^ id;
+20 % id;
+20 > id;
+20 < id;
+20 & id;
+20 | id;
+20 <> id;
+20 == id;
+20 <= id;
+20 >= id;
+20 and id;
+20 or id;
+-(20 + id);
+id + 20;
+id - 20;
+id * 20;
+id / 20;
+id ^ 20;
+id % 20;
+id > 20;
+id < 20;
+id & 20;
+id | 20;
+id <> 20;
+id == 20;
+id <= 20;
+id >= 20;
+id and 20;
+id or 20;
+-(id + 20);
+$
Index: Tst/Old/interred.tst
===================================================================
--- Tst/Old/interred.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/interred.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,21 @@
+//
+// test script for interred command
+//
+pagelength = 10000;
+ring r1 = 32003,(x,y,z),(c,dp);
+r1;
+"-------------------------------";
+poly s1=x2y3+45x6y3+68x4z5+80y6x8;
+poly s2=6x5+3y6+8z6;
+poly s3=12xyz3+2y3z6;
+ideal i1=s1,s2,s3;
+interred(i1);
+"--------------------------------";
+vector v1=[2x3y2,4xyz2];
+vector v2=[11xy4,6xz3];
+module m=v1,v2;
+interred(m);
+"--------------------------------";
+listvar(all);
+kill r1;
+$;
Index: Tst/Old/intersec.tst
===================================================================
--- Tst/Old/intersec.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/intersec.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,44 @@
+//
+// test script for intersect command
+//
+pagelength = 10000;
+ring r1 = 32003,(x,y,z),(c,ds);
+r1;
+"-------------------------------";
+poly s1=x2y3+45x6y3+68x4z5+80y6x8;
+poly s2=6x5+3y6+8z6;
+poly s3=12xyz3+2y3z6;
+ideal i1=s1,s2,s3;
+ideal i2=s1+s2,s2,s1;
+vector v1=[s1,s2,s2*s3]+s1*gen(5);
+vector v2=[s1-s2,s3,s2]+s1*gen(5);
+module m1=v1,v2;
+module m2=v2,2*v1;
+intersect(i1,i2);
+"-------------------------";
+intersect(m1,m2);
+"-------------------------";
+listvar(all);
+kill r1;
+"--------------------------";
+ring r1=0,(x,y,z),(c,ds);
+poly s1=x2y3+45x6y3+68x4z5+80y6x8;
+poly s2=6x5+3y6+8z6;
+poly s3=12xyz3+2y3z6;
+ideal i1=s1,s2,s3;
+ideal i2=s1+s2,s2,s1;
+vector v1=[s1,s2,s2*s3]+s1*gen(5);
+vector v2=[s1-s2,s3,s2]+s1*gen(5);
+module m1=v1,v2;
+module m2=v2,2*v1;
+intersect(i1,i2);
+"-------------------------";
+intersect(m1,m2);
+"-------------------------";
+listvar(all);
+intersect(x,y,z);
+intersect(ideal(x),ideal(y),ideal(z2),ideal(z));
+intersect(x,y,z2,z);
+kill r1;
+$;
+//bsp mit char 0
Index: Tst/Old/intmat.tst
===================================================================
--- Tst/Old/intmat.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/intmat.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,53 @@
+//
+// intmat.tst
+//
+
+intvec iv = 1,3,5;
+intmat m[4][3];
+m=iv,1,2,3,4,5,6,iv;
+m;
+m*iv;
+intmat n[4][3];
+n=1,2,3,4,5,7,iv,iv;
+n*transpose(m);
+n*m;
+n+m;
+n-m;
+trace(m*transpose(n));
+m[1,2..3];
+m[3..4,2];
+intmat sub[2][2];
+intvec i1=2,4;
+intvec i2=1,3;
+sub=n[i1,i2];
+sub;
+kill iv,n,m,i1,i2,sub;
+
+intmat i[2][3];
+i=1,2,3,4,5,0,1;
+intmat j;
+listvar(all);
+size(i);
+nrows(i);
+ncols(i);
+i;
+j;
+i[2,1];
+i[0,3];
+i[20];
+j=i;
+j;
+listvar(all);
+i + 2;
+i - 2;
+i * 2;
+i / 2;
+i == 2;
+intvec t=i;
+intmat t=i;
+i==t;
+i + i;
+i*j;
+transpose(j)*j;
+trace(transpose(j)*j);
+$
Index: Tst/Old/intvec.tst
===================================================================
--- Tst/Old/intvec.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/intvec.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,56 @@
+//
+// intvec.tst
+//
+
+intvec iv = 1,3,5;
+iv;
+iv[1];
+iv[1] + iv[2] + iv[3];
+iv[2] = 42;
+iv;
+intvec ivv = 4, iv;
+ivv;
+iv[iv[1]+1] + ivv[2];
+iv+ivv;
+iv-ivv;
+intmat m=transpose(ivv);
+m;
+intmat n=m+ivv;
+kill iv,ivv,m;
+
+intvec i;
+listvar(all);
+intvec j=1,2,3,4,5,0;
+listvar(all);
+i;
+j;
+j[2];
+j[0];
+j[20];
+i=j;
+i;
+listvar(all);
+i=1..10;
+i;
+i=2,3,6;
+j[i];
+
+intvec i = 1 .. 5;
+i;
+size(i);
+ncols(i);
+nrows(i);
+i + 2;
+i - 2;
+i * 2;
+i / 2;
+i == 2;
+intvec t=i;
+i==t;
+i;
+i + i;
+i;
+i*j;
+transpose(j)*j;
+trace(j);
+$
Index: Tst/Old/jacobi.tst
===================================================================
--- Tst/Old/jacobi.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/jacobi.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,42 @@
+//
+// test script for jacob command
+//
+pagelength = 10000;
+ring r1 = 32003,(x,y,z),(c,ds);
+r1;
+LIB "lib0";
+"-------------------------------";
+int a=12;
+int b=10;
+int c=4;
+int d=1;
+poly s1=x^a+y^b+z^c+x^(c+3)*y^(d+3)+z^(a-3)*y^(d-1);
+poly s2=6x5+3y6+8z6;
+poly s3=12xyz3+2y3z6;
+ideal i1=jacob(s1);
+i1;
+"-------------------------";
+ideal i2=jacob(s2);
+i2;
+"--------------------------";
+ideal i3=jacob(s3);
+i3;
+"-------------------------";
+matrix m1[3][3]=jacob(i1);
+pmat(m1);
+"---------------------------";
+ideal i10=std(i1);
+i10;
+degree(i10);
+"--------------------------";
+ideal i20=std(i2);
+i20;
+degree(i20);
+"---------------------------";
+ideal i30=std(i3);
+i30;
+degree(i30);
+listvar(all);
+kill r1;
+$;
+// jacob von ideal - matrix mit pmat
Index: Tst/Old/jet.tst
===================================================================
--- Tst/Old/jet.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/jet.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,35 @@
+// Test for the jet command
+ring r=32003,(x,y,z),(dp,c);
+jet(1+x+x2+x3+x4,3);
+poly f=1+x+y+z+x2+xy+xz+y2+x3+y3+z4z4;
+jet(f,1);
+jet(f,2);
+jet(f,3);
+jet(f,4);
+// the part of f with (total) degree >3
+f-jet(f,3);
+// the homogeneous part of f of degree 2:
+jet(f,2)-jet(f,1);
+// the absolute term of f:
+jet(f,0);
+// now for other types:
+jet(maxideal(2),2);
+jet(maxideal(2),1);
+jet(maxideal(2),3);
+ideal i=f,f,f*f;
+jet(i,1);
+jet(i,2);
+vector v=[f,1,f];
+jet(v,1);
+jet(v,0);
+module m=v,v,[1,x2,z3,0,1];
+jet(m,2);
+ring rr=32003,(x,y,z),(c,dp);
+module m=fetch(r,m);
+vector v=fetch(r,v);
+v;
+jet(v,1);
+jet(v,0);
+m;
+jet(m,2);
+$
Index: Tst/Old/jett.tst
===================================================================
--- Tst/Old/jett.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/jett.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,40 @@
+//
+// test script for jet command
+//
+pagelength = 10000;
+ring r1 = 32003,(x,y,z),(c,dp);
+r1;
+"-------------------------------";
+poly s1=x2+xyz;
+poly s2=x5z+y6z+xz3;
+poly s3=xy+xz+yz;
+ideal i1=x2+xyz,y2-z3y,z3+y5xz;
+ideal i2=maxideal(3)+i1;
+s1;
+jet(s1,1);
+jet(s1,2);
+jet(s1,3);
+s1-jet(s1,3);
+jet(s1,3)-jet(s1,2);
+"---------------------------------";
+i1;
+jet(i1,1);
+jet(i1,2);
+//jet(i1,3)-jet(i1,1);
+"-------------------------------";
+vector v1=[s1,s2-s1,s3-s1]+s1*gen(5);
+vector v2=[s1,s2,s3]+s2*gen(5);
+vector v3=[s1,s2-s1,s3]+s1*gen(5);
+module m=v1,v2,v3;
+v1;
+jet(v1,1);
+jet(v1,2);
+"-----------------------------";
+m;
+jet(m,1);
+jet(m,2);
+jet(m,8);
+"-----------------------------";
+listvar(all);
+kill r1;
+$;
Index: Tst/Old/kbas.tst
===================================================================
--- Tst/Old/kbas.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/kbas.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,25 @@
+//
+// test script for kbase command
+//
+pagelength = 10000;
+ring r1 = 32003,(x,y,z),(c,dp);
+r1;
+"-------------------------------";
+poly s1=x2+xyz;
+poly s2=x5z+y6z+xz3;
+poly s3=xy+xz+yz;
+ideal i1=x2,y2,z2;
+ideal i2=maxideal(2)+i1;
+i1;
+kbase(i1);
+"---------------------------------";
+i2;
+kbase(i2);
+"-------------------------------";
+module m=freemodule(3);
+m;
+kbase(m);
+"-----------------------------";
+listvar(all);
+kill r1;
+$;
Index: Tst/Old/kil.tst
===================================================================
--- Tst/Old/kil.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/kil.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,15 @@
+//
+// test script for kill command
+//
+pagelength = 10000;
+ring r1=32003,(x,y,z),dp;
+r1;
+"-----------------------";
+int i=34;
+kill i;
+i;
+"--------------------------";
+listvar(all);
+kill r1;
+$;
+
Index: Tst/Old/koszul.tst
===================================================================
--- Tst/Old/koszul.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/koszul.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,28 @@
+proc isComplex (list c)
+{
+  int i;
+  module @test;
+  for (i=1;i<=size(c)-1;i=i+1)
+  {
+    @test=c[i]*c[i+1];
+    if (size(@test)!=0)
+    {
+      @test;
+      "argument is not a complex at position",i;
+      return(0);
+    }
+  }
+  "argument is a complex";
+  return(1);
+}
+
+ring r;
+ideal i=maxideal(2);
+matrix A=matrix(i);
+A=x*A+y*A+z*A;
+i=ideal(A);
+i;
+list c=koszul(0,i),koszul(1,i),koszul(2,i),koszul(3,i),koszul(4,i);
+c;
+isComplex(c);
+$
Index: Tst/Old/lamm.tst
===================================================================
--- Tst/Old/lamm.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/lamm.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,13 @@
+   LIB "hnoether.lib";
+   ring r=0,(x,y),dp;
+"0,2 <Return> 1,1 <Return> 3,0 <Return><Return>";
+   reddevelop(x2-y2+x3);
+$
+//
+//Der gleiche Fehler tritt auf bei reddevelop((y-x)*(y-2x)*(y-3x+x2));
+//  (Newtonpolygon 0,3  2,1  4,0 eingeben),
+//er tritt aber nicht auf z.B. bei 
+// reddevelop((y2-x3)*(y2-x3-x4));     (nichts mehr einzugeben)  oder
+// reddevelop((y2-x3-x4)*(y2+x3+x4));  ( 0,2  2,1  6,0 eingeben)
+//
+//(Singular92j produziert uebrigens das gleiche Ergebnis wie Singular93b)
Index: Tst/Old/lib
===================================================================
--- Tst/Old/lib	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/lib	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,202 @@
+//
+// lib with useful ? procs
+//
+proc prideal (ideal id)
+{
+  "// ideal";
+  for (int @i=1; @i<=nrows(id); @i=@i+1)
+  {
+    "//id[" +  string(@i) + "] : "+  string(id[@i]);
+  }
+  "// dim  :", dim(id);
+  "// mult :", multiplicity(id);
+  return();
+}
+
+proc formmat (matrix m)
+{
+  int @elems = 0;
+  int @mlen  = 0;
+  int @slen  = 0;
+  int @c;
+  for (int @r=1; @r<=nrows(m); @r=@r+1)
+  {
+    for (@c=1; @c<=ncols(m); @c=@c+1)
+    {
+      @elems = @elems + 1;
+      string @s(@elems) = string(m[@r,@c]);
+      @slen = size(@s(@elems));
+      if (@slen > @mlen)
+      {
+        @mlen = @slen;
+      }
+    }
+  }
+  @elems = 0;
+  string @aus = "";
+  string @sep = " ";
+  if (@mlen * ncols(m) >= pagewidth)
+  {
+    @sep = newline;
+  }
+  for (@r=1; @r<=nrows(m); @r=@r+1)
+  {
+    for (@c=1; @c<=ncols(m); @c=@c+1)
+    {
+      @elems = @elems + 1;
+      @slen = size(@s(@elems));
+      @aus = @aus + @s(@elems)[1,@mlen] + @sep;
+    }
+    @aus = @aus + newline;
+//    @aus = "";
+  }
+  return(@aus);
+}
+proc fixmat (matrix m,int l)
+{
+  string @aus;
+  string @tmp;
+  int @ll;
+  int @c;
+  for (int @r=1; @r<=nrows(m); @r=@r+1)
+  {
+    @aus = "";
+    for (@c=1; @c<=ncols(m); @c=@c+1)
+    {
+      @tmp = string(m[@r,@c]);
+      @aus = @aus + @tmp[1,l] + " ";
+    }
+    @aus;
+  }
+}
+proc stransp (int r, int c, list #)
+{
+  // transpose a submatrix
+  matrix @m[r][c];
+  int @ii = 1;
+  int @j;
+  for (int @i = 1; @i<=r; @i=@i+1)
+  {
+    for (@j = 1; @j<=c; @j=@j+1)
+    {
+      @m[@i,@j] = #[@ii];
+      @ii=@ii+1;
+    }
+  }
+  return(transpose(@m));
+}
+proc unitmat (int r, list #)
+{
+  // create an unit matrix, # is optional
+  poly @p = 1;
+  if (size(#) == 1)
+  {
+    @p = #[1];
+  }
+  matrix @m[r][r];
+  return (@m + @p);
+}
+//
+// declare a ring with a different dialog
+// using defaults etc;
+//
+
+proc permute (int n, list #)
+{
+  //if (#ARGS == 2)
+  //{
+  //  string @actionstring = #action +"();";
+  //}
+  if (defined(PERMUTE_DATA) or defined(PERMUTE_WORK))
+  {
+    "permute: PERMUTE_WORK/DATA already defined, please kill them!";
+    return();
+  }
+  //
+  // initialize global data
+  //
+  intvec PERMUTE_DATA = n;  // must be global
+  intvec PERMUTE_WORK = 1;   // must be global
+  export PERMUTE_DATA, PERMUTE_WORK;
+  for (int @i=#n-1; @i>0; @i=@i-1)
+  {
+    PERMUTE_DATA = PERMUTE_DATA, @i;
+    PERMUTE_WORK = PERMUTE_WORK, 1;
+  }
+  int @done = 0;
+  while (@done == 0)
+  {
+    "permute", PERMUTE_DATA;  // this could be an action call
+    //if (#ARGS == 2)
+    //{
+    //  execute @actionstring;
+    //}
+    @done = next_permute(n);
+  }
+  kill PERMUTE_DATA, PERMUTE_WORK;
+  return ("-----------");
+}
+
+proc next_permute (int n)
+{
+  int @rc = 1;
+  if (n > 1)
+  {
+    if(PERMUTE_WORK[n] < n)
+    {
+      PERMUTE_DATA[PERMUTE_WORK[n]] = PERMUTE_DATA[PERMUTE_WORK[n] + 1];
+      PERMUTE_DATA[PERMUTE_WORK[n] + 1] = n;
+      PERMUTE_WORK[n] = PERMUTE_WORK[n] + 1;
+      return(0);
+    }
+    @rc = next_permute(n-1);
+    for(int @i=n-1; @i>=1; @i=@i-1)
+    {
+      PERMUTE_DATA[@i+1] = PERMUTE_DATA[@i];
+    }
+    PERMUTE_DATA[1] = n;
+    PERMUTE_WORK[n] = 1;
+    return(@rc);
+  }
+  return (@rc);
+}
+//
+// permutations as described in:
+//   data structures, algorithms, and program style using c
+//   james f. korsh
+//   leonard j. garrett
+//   pp. 162
+//
+proc permute1 (int n)
+{
+  int @done = 0;
+  while (@done == 0)
+  {
+    "permute", all;  // this could be an action call
+    @done = next(n);
+  }
+  return ("-----------");
+}
+proc next (int n)
+{
+  int @rc = 1;
+  if (n > 1)
+  {
+    if(l[n] < n)
+    {
+      all[l[n]] = all[l[n] + 1];
+      all[l[n] + 1] = n;
+      l[n] = l[n] + 1;
+      return(0);
+    }
+    @rc = next(n-1);
+    for(int @i=n-1; @i>=1; @i=@i-1)
+    {
+      all[@i+1] = all[@i];
+    }
+    all[1] = n;
+    l[n] = 1;
+    return(@rc);
+  }
+  return (@rc);
+}
Index: Tst/Old/lib0
===================================================================
--- Tst/Old/lib0	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/lib0	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,956 @@
+//===========================================================================//
+// LIBRARY:  lib0           library of some general procedures               //
+//           type lib0();   to list the procedures                           //
+//                          7/94 GMG+BM                                      //
+//===========================================================================//
+
+proc A_Z (string s,int n)
+USAGE:    A_Z("a",n);  a any letter, n integer (-26<= n <=26, !=0)
+RETURN:   string of n small (if a is small) or capital (if a is capital)
+          letters, comma seperated, beginning with a, in alphabetical
+          order (or revers alphabetical order if n<0)
+EXAMPLE:  example A_Z; shows an example
+{
+  if (n>=-26 and n<=26 and n!=0 )
+  {
+    string @alpha =
+      "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,"+
+      "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";
+    int @ii; int @aa;
+    for (@ii=1; @ii<=51; @ii=@ii+2)
+    {
+      if ( @alpha[@ii] ==  s )
+      {
+        @aa = @ii;
+      }
+    }
+    if ( @aa == 0)
+    {
+      for (@ii=105; @ii<=155; @ii=@ii+2)
+      {
+        if ( @alpha[@ii] ==  s )
+        {
+          @aa = @ii;
+        }
+     }
+    }
+  }
+  if ( @aa != 0)
+  {
+    string @out;
+    if (n > 0)
+    {
+      @out = @alpha[@aa,2*(n)-1];
+      return (@out);
+    }
+    string @beta =
+      "z,y,x,w,v,u,t,s,r,q,p,o,n,m,l,k,j,i,h,g,f,e,d,c,b,a,"+
+      "z,y,x,w,v,u,t,s,r,q,p,o,n,m,l,k,j,i,h,g,f,e,d,c,b,a,"+
+      "Z,Y,X,W,V,U,T,S,R,Q,P,O,N,M,L,K,J,I,H,G,F,E,D,C,B,A,"+
+      "Z,Y,X,W,V,U,T,S,R,Q,P,O,N,M,L,K,J,I,H,G,F,E,D,C,B,A";
+    if ( @aa < 52 )
+    {
+      @aa=52-@aa;
+    }
+    if ( @aa > 104 )
+    {
+      @aa=260-@aa;
+    }
+    @out = @beta[@aa,2*(-n)-1];
+    return (@out);
+  }
+}
+example
+{
+//--------------------------------- EXAMPLE ----------------------------------
+  "EXAMPLE:";
+  "   A_Z(\"c\",5);";                                        A_Z("c",5);
+  "   A_Z(\"Z\",-5);";                                       A_Z("Z",-5);
+  "   string sR = \"ring R = (0,\"+A_Z(\"A\",6)+\"),(\"+A_Z(\"a\",10)+\"),dp;\" ";
+    string @sR = "ring R = (0,"+A_Z("A",6)+"),("+A_Z("a",10)+"),dp;";
+  "   sR;";                                                  @sR;
+  "   execute sR;";                                          execute @sR;
+  "   R;";                                                   R;
+  "   kill R;";                                              kill R;
+}
+///////////////////////////////////////////////////////////////////////////////
+proc bin (int n,int m)
+USAGE:    bin(n,m);   n, m integers
+RETURN:   n choose m  of type <int>, limited size (machine integers)!
+NOTE:     Use proc binom and ring of characteristic 0 for bigger integers
+{
+  int @r;
+  if ( m < 0 or m > n )
+  {
+    return(@r);
+  }
+  @r=1;
+  if (m == 0)
+  {
+    return(@r);
+  }
+  if (m >= n-m)
+  {
+    m=n-m;
+  }
+  for (int @l=1 ; @l<=m ; @l=@l+1 )
+  {
+    @r=@r*(n+1-@l) / @l;
+  }
+  return (@r);
+}
+example
+{
+  "EXAMPLE:";
+  " bin(7,3);";                   bin(7,3);
+  " int n=10; int m=7;";          int @n=10; int @m=7;
+  " int b=bin(n,m); b;";          int @b=bin(@n,@m); @b;
+  kill @n,@m,@b;
+}
+///////////////////////////////////////////////////////////////////////////////
+
+proc binom
+{
+   if (#ARGS !=1 and #ARGS !=2)
+   {
+//=============================================================================
+  " USAGE:   binom(n,k); n, k integers";
+  " RETURN:  n choose k  of type <poly>, uses characteristic of basering";
+  " NOTE:    needs a basering(!), result is computed in corresponding char,";
+  "          for small integers you may use procedure bin;";
+  " EXAMPLE: binom(\"ex\"); shows an example";
+//=============================================================================
+      return();
+   }
+
+   parameter = "n", "k";
+   if( #ARGS ==2 and defined(basering) )
+   {
+      if ( typeof(#1) == "int" and typeof(#2) == "int" )
+      {
+         poly @r;
+         if (#k < 0)
+         {
+            return(@r);
+         }
+         if (#k > #n)
+         {
+         return(@r);
+         }
+         @r=1;
+         if (#k == 0)
+         {
+            return(@r);
+         }
+         if (#k >= #n-#k)
+         {
+            #k = #n-#k;
+         }
+         int @l;
+         string @st;
+         for (@l=1 ; @l<=#k ; @l=@l+1 )
+         {
+            @r=@r*(#n+1-@l);
+            @st="@r=@r*(1/"+string(@l)+");";
+            execute(@st);
+         }
+         return (@r);
+      }
+   }
+//--------------------------------- EXAMPLE -----------------------------------
+   if (( typeof(#1) == "string" ) and ( #1 == "ex" ))
+   {
+      "EXAMPLE:";
+      " ring r1=0,x,ls;";             ring @r1=0,x,ls;
+      " binom(37,17);";               binom(37,17);
+      " ring r2=31,x,dp;";            ring @r2=31,x,dp;
+      " poly p = binom(37,17);p;";    poly @p = binom(37,17);@p;
+      return();
+   }
+   " USAGE:   binom(n,k); n, k integers";
+   " RETURN:  n choose k  of type <poly>, uses characteristic of basering";
+   " NOTE:    needs a basering(!), result is computed in corresponding char,";
+   "          for small integers you may use procedure bin;";
+   " EXAMPLE: binom(\"ex\"); shows an example";
+}
+///////////////////////////////////////////////////////////////////////////////
+
+proc fac
+{
+   if ( #ARGS !=1 )
+   {
+//=============================================================================
+  " USAGE:   fac(n);  (n integer)";
+  " RETURN:  n!, of type <poly>, uses characteristic of basering";
+  " NOTE:    needs a basering(!), result is computed in corresponding char,";
+  " EXAMPLE: fac(\"ex\"); shows an example";
+//=============================================================================
+      return();
+   }
+
+   parameter = "n";
+   if( typeof(#1) == "int" and defined(basering) )
+   {
+      poly @p=1;
+      int @i;
+      for ( @i=1; @i<=#n; @i=@i+1)
+      {
+         @p=@p*@i;
+      }
+      return(@p);
+   }
+//--------------------------------- EXAMPLE -----------------------------------
+   if (( typeof(#1) == "string" ) and ( #1 == "ex" ))
+   {
+      "EXAMPLE:";
+      " ring r1=0,x,ls;";             ring @r1=0,x,ls;
+      " fac(37);";                    fac(37);
+      " ring r2=17,x,dp;";            ring @r2=17,x,dp;
+      " poly p = fac(37);p;";         poly @p = fac(37);@p;
+      return();
+   }
+   " USAGE:   fac(n);  (n integer)";
+   " RETURN:  n!, of type <poly>, uses characteristic of basering";
+   " NOTE:    needs a basering(!), result is computed in corresponding char,";
+   " EXAMPLE: fac(\"ex\"); shows an example";
+}
+///////////////////////////////////////////////////////////////////////////////
+
+proc koszul1
+{
+   if (#ARGS != 1 and #ARGS != 2)
+   {
+//=============================================================================
+" USAGE:    koszul1(<ideal>,n); n integer";
+" RETURN:   <matrix>:= n-th koszul1 matrix of <ideal>";
+" EXAMPLE:  koszul1(\"ex\"); shows an example";
+//=============================================================================
+     return();
+   }
+
+   if (#ARGS == 2)
+   {
+      if (typeof(#1) == "ideal" and typeof(#2) == "int")
+      {
+//-------------------------- compare_index(iv,iv) -----------------------------
+ proc compare_ind
+ {
+   parameter="v1","v2";
+   int @q=size(#v1);
+   intvec @res;
+   int @a;int @b;int @c=1;int @d;
+   for (@a=1; @a<=@q; @a=@a+1)
+   {
+      @b=@b+1;
+      if (#v1[@a] != #v2[@b])
+      {
+         @d=@d+1;
+         if (@d>1)
+         {
+            @res=0,1;
+            return(@res);
+         }
+         @res=#v2[@b],@c;
+         @a=@a-1;
+      }
+      @c=-@c;
+      if (@d == 0)
+      {
+         @res=#v2[@q+1],@c;
+      }
+   }
+   return(@res);
+ }
+//--------------------------- next_ind(#iv,#n,#p) -----------------------------
+ proc next_ind
+ {
+    parameter="v","n","p";
+    int @l;int @q;int @s;intvec @res=#v;
+    for ( @l=#p; @l>0; @l=@l-1 )
+    {
+       @s=#v[@l]-#n+#p-@l;
+       if (@s<0)
+       {
+          @s=#v[@l];
+          for (@q=@l; @q<=#p; @q=@q+1 )
+          {
+             @res[@q]=@s+@q-@l+1;
+          }
+          return(@res);
+       }
+    }
+    return(0);
+ }
+//------------------------------ alt_ind(#n,#p) -------------------------------
+ proc alt_ind
+ {
+   parameter="n","p";
+   int @m=bin(#n,#p);int @a;
+   intvec ind(1)=1..#p;
+   for (  @a=2; @a<=@m; @a=@a+1 )
+   {
+     intvec ind(@a)=next_ind(ind(@a-1),#n,#p);
+   }
+   return();
+ }
+//------------------------------- end_ind(#m) ---------------------------------
+ proc end_ind
+ {
+   parameter="m";
+   int @n;
+   for (@n=1; @n<=#m; @n=@n+1)
+   {
+      kill ind(@n);
+   }
+   return();
+ }
+//------------------------------ koszul1(id,nr) --------------------------------
+      int @t;
+      int @w;
+      int @e;
+      int @n=ncols(#1);
+      int @p=#2;
+      ideal @id=#1;
+      intvec @zz;
+      if ((@p>@n) or (@p<=0))
+      {
+         kill compare_ind; kill next_ind; kill alt_ind; kill end_ind;
+         return("#2 out of range");
+      }
+      int @c=bin(@n,@p);
+      int @r=bin(@n,@p-1);
+      matrix @res[@r][@c];
+      alt_ind(@n,@p);
+      intvec @riv=1..@p-1;
+      for (@t=1; @t<=@n-@p+1; @t=@t+1)
+      {
+         @res[1,@t]=@id[@t+@p-1];
+         if (@p-2*(@p/2)==0)
+         {
+            @res[1,@t]=-@res[1,@t];
+         }
+      }
+      for (@e=2; @e<=@r; @e=@e+1)
+      {
+         @riv=next_ind(@riv,@n,@p-1);
+         for (@w=1; @w<=@c; @w=@w+1)
+         {
+            @zz=compare_ind(@riv,ind(@w));
+            if (@zz[1] != 0)
+            {
+               @res[@e,@w]=@id[@zz[1]]*@zz[2];
+            }
+         }
+      }
+      end_ind(@c);
+      kill compare_ind; kill next_ind; kill alt_ind; kill end_ind;
+      return(@res);
+   }
+   }
+//--------------------------------- EXAMPLE -----------------------------------
+   if (( typeof(#1)=="string") and (#1 == "ex"))
+   {
+      "EXAMPLE:";
+      " ring r=200,(a,b,c,d),ds;"; ring @r=200,(a,b,c,d),ds;
+      " ideal i=a,b,c,d;";         ideal @i=a,b,c,d;
+      " pmat(koszul1(i,2));";       pmat(koszul1(@i,2));
+      return();
+   }
+   " USAGE:    koszul1(<id>,<int>);";
+   " RETURN:   <mat>:= i-th koszul1 matrix of <id>";
+   " EXAMPLE:  koszul1(\"ex\"); shows an example";
+}
+///////////////////////////////////////////////////////////////////////////////
+
+proc mem
+{
+   if ( #ARGS !=1 )
+   {
+//=============================================================================
+  " USAGE:   mem(n);  n integer ";
+  " RETURNS: mem(0) = memory used by active variables";
+  "          mem(1) = total memory used";
+//=============================================================================
+      return();
+   }
+
+   parameter = "n";
+   if (typeof(#n) == "int")
+   {
+      if (#n == 0)
+      {
+         string @m =
+         "//memory used by active variables: ",string((memory(0)+1023)/1024),"k";
+         return(@m);
+      }
+      if (#n != 0)
+      {
+         string @m =
+         "//total memory used: ",string((memory(1)+1023)/1024),"k";
+         return(@m);
+      }
+   }
+//--------------------------------- EXAMPLE -----------------------------------
+   if ( typeof(#1) == "string" )
+   {  if ( #1 == "ex" )
+      {
+         "EXAMPLE:";
+         " mem(0);";                         mem(0);
+         " string s=mem(1); s;";             string @s=mem(1); @s;
+         return();
+       }
+   }
+   " USAGE:   mem(n);  n integer ";
+   " RETURNS: mem(0) = memory used by active variables";
+   "          mem(1) = total memory used";
+             return();
+}
+///////////////////////////////////////////////////////////////////////////////
+
+proc multiply
+{
+   if (#ARGS !=1 and #ARGS !=2)
+   {
+//=============================================================================
+  " USAGE1:  multiply(<ideal/poly>,<module>);";
+  " RETURN:  module <ideal/poly>*<module>";
+  " USAGE2:  multiply(<ideal>,<matrix>);";
+  " RETURN:  ideal <ideal>*<matrix> (consider <ideal> as row vector)";
+  " USAGE3:  multiply(<poly>,<matrix>);";
+  " RETURN:  matrix <poly>*<matrix> (mult. each entry of <matrix> with <poly>)";
+  " USAGE4:  multiply(<matrix>,<vector>);";
+  " RETURN:  vector <matrix>*<vector> (consider <vector> as column vector)";
+  " EXAMPLE: multiply(\"ex\"); shows an example";
+//=============================================================================
+      return();
+   }
+
+   parameter = "i", "m";
+   if ( #ARGS == 2 )
+   {
+      int @ii; int @jj;
+//-------------------------- <ideal/poly>*<module> ----------------------------
+      if ((typeof(#i)=="ideal" or typeof(#i)=="poly") and typeof(#m)=="module")
+      {
+         ideal @i = #i;
+         module @m; module @mo;
+         for ( @ii=1; @ii<=size(@i); @ii=@ii+1 )
+         {
+            for ( @jj=1; @jj<=size(#m); @jj=@jj+1 )
+            {
+               @m = @m,@i[@ii]*#m[@jj];
+            }
+         }
+         return(@m+@mo);
+      }
+//----------------------------- <ideal>*<matrix> ------------------------------
+      if ( typeof(#i) == "ideal" and typeof(#m) == "matrix" )
+      {
+         if ( nrows(#m) != ncols(#i) )
+         {
+         "//size not compatible: ncols(<ideal>) != nrows(<matrix>)";
+         return();
+         }
+         return(ideal(matrix(#i)*#m));
+      }
+//----------------------------- <poly>*<matrix> -------------------------------
+      if ( typeof(#i) == "poly" and typeof(#m) == "matrix")
+      {
+         matrix @m[nrows(#m)][ncols(#m)];
+         for ( @ii=1; @ii<=nrows(#m); @ii=@ii+1 )
+         {
+            for ( @jj=1; @jj<=ncols(#m); @jj=@jj+1 )
+            {
+               @m[@ii,@jj] = #1*#m[@ii,@jj];
+            }
+         }
+         return(@m);
+      }
+//----------------------------- <matrix>*<vector> -----------------------------
+      if ( typeof(#i) == "matrix" and typeof(#m) == "vector" )
+      {
+         module @m=#m;
+         matrix @a=matrix(@m);
+         if ( nrows(@a) != ncols(#i) )
+         {
+         "//size not compatible: ncols(<matrix>) != nrows(<vector>)";
+         return();
+         }
+         module @i = module(#i*@a);
+         vector @v = @i[1];
+         return(@v);
+      }
+   }
+//--------------------------------- EXAMPLE -----------------------------------
+   if (( typeof(#1) == "string" ) and ( #1 == "ex" ))
+   {
+      "EXAMPLE:";
+      " ring r=0,(x,y,z),(c,dp);";          ring @r=0,(x,y,z),(c,dp);
+      " ideal i = xy,xz,yz;";               ideal @i = xy,xz,yz;
+      " poly f = xyz;";                     poly @f = xyz;
+      " module m = [1,2,3],[x,y,z];";       module @m = [1,2,3],[x,y,z];
+      " vector v = [xy,xz,yz];";            vector @v = [xy,xz,yz];
+      " matrix M[2][3] = 1,2,3,x,y,z;";     matrix @M[2][3] =1,2,3,x,y,z;
+      " pmat(M);";                          pmat(@M);
+      " multiply(i,m);";                    multiply(@i,@m);
+      " multiply(f,m);";                    multiply(@f,@m);
+      " multiply(i,transpose(M));";         multiply(@i,transpose(@M));
+      " pmat(multiply(f,M));";              pmat(multiply(@f,@M));
+      " multiply(M,v);";                    multiply(@M,@v);
+      return();
+   }
+   " USAGE1:  multiply(<ideal/poly>,<module>);";
+   " RETURN:  module <ideal/poly>*<module>";
+   " USAGE2:  multiply(<ideal>,<matrix>);";
+   " RETURN:  ideal <ideal>*<matrix> (consider <ideal> as row vector)";
+   " USAGE3:  multiply(<poly>,<matrix>);";
+   " RETURN:  matrix <poly>*<matrix> (mult. each entry of <matrix> with <poly>)";
+   " USAGE4:  multiply(<matrix>,<vector>);";
+   " RETURN:  vector <matrix>*<vector> (consider <vector> as column vector)";
+   " EXAMPLE: multiply(\"ex\"); shows an example";
+}
+///////////////////////////////////////////////////////////////////////////////
+
+proc pmat (matrix m,list #)
+USAGE:    pmat(<matrix>,[n]);  n integer
+RETURNS:  <matrix> in array format if it fits into pagewidth. If n is
+          given, only the first n characters of each colum are shown
+{
+  if ( size(#) == 0)
+  {
+//------------- main case: input is a matrix, no second argument---------------
+    int @elems;
+    int @mlen;
+    int @slen;
+    int @c;
+    int @r;
+//-------------- count maximal size of each column, and sum up ----------------
+
+    for ( @c=1; @c<=ncols(m); @c=@c+1)
+    {  int @len(@c);
+      for (@r=1; @r<=nrows(m); @r=@r+1)
+      {
+        @elems = @elems + 1;
+        string @s(@elems) = string(m[@r,@c])+",";
+        @slen = size(@s(@elems));
+        if (@slen > @len(@c))
+        {
+          @len(@c) = @slen;
+        }
+      }
+      @mlen = @mlen + @len(@c);
+    }
+//---------------------- print all - except last - rows -----------------------
+
+    string @aus;
+    string @sep = " ";
+    if (@mlen >= pagewidth)
+    {
+      @sep = newline;
+    }
+
+    for (@r=1; @r<nrows(m); @r=@r+1)
+    {
+      @elems = @r;
+      @aus = "";
+      for (@c=1; @c<=ncols(m); @c=@c+1)
+      {
+        @aus = @aus + @s(@elems)[1,@len(@c)] + @sep;
+        @elems = @elems + nrows(m);
+      }
+      @aus;
+    }
+//--------------- print last row (no comma after last entry) ------------------
+
+    @aus = "";
+    @elems = nrows(m);
+    for (@c=1; @c<ncols(m); @c=@c+1)
+    {
+      @aus = @aus + @s(@elems)[1,@len(@c)] + @sep;
+      @elems = @elems + nrows(m);
+    }
+    @aus = @aus + string(m[nrows(m),ncols(m)]);
+    @aus;
+    return();
+  }
+//--------- second case: input is a matrix, second argument is given ----------
+
+  if ( size(#) == 1 )
+  {
+    if ( typeof(#[1]) == "int" )
+    {
+      string @aus;
+      string @tmp;
+      int @ll;
+      int @c;
+      int @r;
+      for ( @r=1; @r<=nrows(m); @r=@r+1)
+      {
+        @aus = "";
+        for (@c=1; @c<=ncols(m); @c=@c+1)
+        {
+          @tmp = string(m[@r,@c]);
+          @aus = @aus + @tmp[1,#[1]] + " ";
+        }
+        @aus;
+      }
+    }
+  }
+}
+example
+{
+//--------------------------------- EXAMPLE ----------------------------------
+  " EXAMPLE:";
+  " ring r=0,(x,y,z),ls;";     ring @r=0,(x,y,z),ls;
+  " ideal i= x,z+3y,x+y,z;";   ideal @i= x,z+3y,x+y,z;
+  " matrix m[3][3] =i^2;";     matrix @m[3][3]=@i^2;
+  " pmat(m);";                 pmat(@m);
+  " pmat(m,3);";               pmat(@m,3);
+  kill @r;
+}
+///////////////////////////////////////////////////////////////////////////////
+
+proc randommat
+{
+   if (#ARGS != 1 and #ARGS != 3 and #ARGS != 5)
+   {
+//=============================================================================
+  " USAGE:   randommat(n,m,d[,u,o]);  n,m,d,u,o integers";
+  " RETURNS: nxm matrix with entries homogeneous polynomials of degree d";
+  "          [and coefficients between u and o]";
+  " NOTE:    For performance reasons try small bounds u and o in char 0";
+  " EXAMPLE: randommat(\"ex\"); shows an example";
+//=============================================================================
+      return();
+   }
+
+   parameter="n","m","d","u","o";
+   if (#ARGS == 3)
+   {
+      int #u=-30000;
+      int #o= 30000;
+      #ARGS=5;
+   }
+   if (#ARGS == 5)
+   {
+      if ( typeof(#n)=="int" and typeof(#m)=="int" and
+         typeof(#d)=="int" and typeof(#u)=="int" and typeof(#o)=="int" )
+      {
+         int @g =size(maxideal(#d));
+         matrix @m = matrix(maxideal(#d));
+         matrix @col[@g][1];
+         matrix @random[#n][#m];
+         int @k; int @l; int @ii;
+         for ( @k=#n; @k>0; @k=@k-1)
+         {
+            for ( @l=#m; @l>0; @l=@l-1)
+            {
+               for ( @ii=1; @ii<=@g; @ii=@ii+1)
+               {
+                  @col[@ii,1] = random(#u,#o);
+               }
+               @random[@k,@l]=(@m*@col)[1,1];
+            }
+         }
+         return(@random);
+      }
+   }
+//--------------------------------- EXAMPLE -----------------------------------
+   if (( typeof(#1) == "string" ) and  ( #1 == "ex" ))
+   {
+      "EXAMPLE:";
+      " ring r=0,(x,y,z),dp;";            ring @r=0,(x,y,z),dp;
+      " matrix A=randommat(3,3,2,-9,9);"; matrix @A=randommat(3,3,2,-9,9);
+      " A; pmat(A);";                     @A; pmat(@A);
+      return();
+   }
+   " USAGE:   randommat(n,m,d[,u,o]);  n,m,d,u,o integers";
+   " RETURNS: nxm matrix with entries homogeneous polynomials of degree d";
+   "          [and coefficients between u and o]";
+   " NOTE:    For performance reasons try small bounds u and o in char 0";
+   " EXAMPLE: randommat(\"ex\"); shows an example";
+}
+///////////////////////////////////////////////////////////////////////////////
+
+proc shift
+{
+   if ( #ARGS != 1 and #ARGS != 2 )
+   {
+//=============================================================================
+  " USAGE:    shift(<ideal>,n);  n integer";
+  " RETURN:   module <ideal>*gen(n), n-th component generated by <ideal>";
+  " EXAMPLE:  shift(\"ex\"); shows an example";
+//=============================================================================
+      return();
+   }
+
+   parameter = "i","n";
+   if (#ARGS == 2)
+   {
+      if (typeof(#1) == "ideal" and typeof(#2) == "int")
+      {
+         module @m=#i[1]*gen(#n);
+         for (int @n=2; @n<=ncols(#i) ; @n=@n+1 )
+         {
+            @m=@m,#i[@n]*gen(#n);
+         }
+         return(@m);
+      }
+   }
+//--------------------------------- EXAMPLE ----------------------------------
+   if (( typeof(#1) == "string" ) and ( #1 == "ex" ))
+   {
+      "EXAMPLE:";
+      " ring r = 0,(x,y,z),(c,dp);";        ring @r= 0,(x,y,z),(c,dp);
+      " ideal i = xy,xz,yz;";               ideal @i= xy,xz,yz;
+      " module m = shift(i,2)+shift(i,4);"; module @m=shift(@i,2)+shift(@i,4);
+      " m;";                                @m;
+      return();
+   }
+   " USAGE:    shift(<ideal>,n);  n integer";
+   " RETURN:   module <ideal>*gen(n), n-th component generated by <ideal>";
+   " EXAMPLE:  shift(\"ex\"); shows an example";
+   return();
+}
+///////////////////////////////////////////////////////////////////////////////
+
+proc sum
+{
+   if ( #ARGS !=1 )
+   {
+//=============================================================================
+  " USAGE:    sum(v);  v vector or intvec";
+  " RETURN:   <poly> or <int> = sum of components of v";
+  " EXAMPLE:  sum(\"ex\"); shows an example";
+//=============================================================================
+      return();
+   }
+
+   if ( #ARGS ==1 )
+   {
+      if ( typeof(#1) == "vector" )
+      {
+         poly @v;
+         module @m = #1;
+         matrix @mat=matrix(@m);
+         for ( int @n=1 ; @n<=nrows(@mat); @n=@n+1)
+         {
+            @v=@v+@mat[@n,1];
+         }
+         return(@v);
+      }
+      if ( typeof(#1) == "intvec" )
+      {
+         int @v;
+         for (int @n=1 ; @n<=size(#1); @n=@n+1)
+         {
+            @v=@v+#1[@n];
+         }
+         return(@v);
+      }
+   }
+//--------------------------------- EXAMPLE ----------------------------------
+   if (( typeof(#1) == "string" ) and ( #1 == "ex" ))
+   {
+      "EXAMPLE:";
+      " ring r = 0,(x,y,z),dp;";            ring @r= 0,(x,y,z),dp;
+      " vector v = [xy,xz,yz];";            vector @pv = [xy,xz,yz];
+      " sum(v);";                           sum(@pv);
+      " intvec iv = 1,2,3,4,5;";            intvec @iv = 1,2,3,4,5;
+      " sum(iv);";                          sum(@iv);
+      return();
+   }
+   " USAGE:    sum(v);  v vector or intvec";
+   " RETURN:   <poly> or <int> = sum of components of v";
+   " EXAMPLE:  sum(\"ex\"); shows an example";
+   return();
+}
+///////////////////////////////////////////////////////////////////////////////
+
+proc trmod
+{
+   if (#ARGS != 1)
+   {
+//=============================================================================
+  " USAGE:    trmod(<module>);";
+  " RETURNS:  transposed (dual) module";
+  " EXAMPLE:  trmod(\"ex\"); shows an example";
+//=============================================================================
+      return();
+   }
+
+   if (typeof(#1) == "module")
+   {
+      matrix @mat=matrix(#1);
+      module @mod=module(transpose(@mat));
+      return(@mod);
+    }
+//--------------------------------- EXAMPLE ----------------------------------
+   if (( typeof(#1) == "string" ) and ( #1 == "ex" ))
+   {
+      "EXAMPLE:";
+      " ring r = 0,(x,y,z),(c,dp);";        ring @r= 0,(x,y,z),(c,dp);
+      " module m = [xy,xz,yz]; m;";         module m = [xy,xz,yz]; m;
+      " m = trmod(m); m;";                  m=trmod(m); m;
+      return();
+   }
+   " USAGE:    trmod(<module>);";
+   " RETURNS:  transposed (dual) module";
+   " EXAMPLE:  trmod(\"ex\"); shows an example";
+   return();
+}
+///////////////////////////////////////////////////////////////////////////////
+
+proc tab
+USAGE:    tab(n);  (n integer)
+RETURNS:  string of n space tabs
+EXAMPLE:  example tab; shows an example
+{
+  if (#ARGS == 1)
+  {
+    if (typeof(#1) == "int")
+    {
+      if (#1 == 0)
+      {
+        return("");
+      }
+      string @s=" ";
+      return(@s[1,#1]);
+    }
+  }
+}
+example
+{
+  "EXAMPLE:";
+  " for(int n=0; n<=5; n=n+1)";
+  " { tab(5-n)+\"*\"+tab(n)+\"+\"+tab(n)+\"*\"; }";
+  for(int @n=0; @n<=5; @n=@n+1)
+  {
+     tab(5-@n)+"*"+tab(@n)+"+"+tab(@n)+"*";
+  }
+  kill @n;
+}
+///////////////////////////////////////////////////////////////////////////////
+
+proc primes
+{
+   if ( #ARGS !=2 and #ARGS != 1)
+   {
+//=============================================================================
+ " USAGE:   primes(n,m);  n,m integers ";
+ " RETURNS: intvec, consisting of all primes p, prime(n)<=p<=m, in increasing";
+ "          order if n<m, resp. prime(m)<=p<=n, in decreasing order if m<n";
+ " EXAMPLE: primes(\"ex\"); shows an example";
+//=============================================================================
+      return();
+   }
+
+   parameter = "n", "m";
+   if ( #ARGS ==2 )
+   {
+      if ( typeof(#n)=="int" and typeof(#m)=="int" )
+      {
+         int @n = #n; int @m = #m;
+         if (#n>#m)
+         {
+            @n=#m ; @m= #n;
+         }
+         int @q = prime(@m);
+         int @p = prime(@n);
+         intvec @v = @q;
+         @q = @q-1;
+         if ( #n>#m )
+         {
+            while ( @q>=@p )
+            {
+               @q = prime(@q);
+               @v = @v,@q;
+               @q = @q-1;
+            }
+            return(@v);
+         }
+         while ( @q>=@p )
+         {
+            @q = prime(@q);
+            @v = @q,@v;
+            @q = @q-1;
+         }
+         return(@v) ;
+      }
+   }
+//--------------------------------- EXAMPLE -----------------------------------
+   if (( typeof(#1) == "string" ) and ( #1 == "ex" ))
+   {
+      "EXAMPLE:";
+      "primes(50,100);";                primes(50,100);
+      "intvec v=primes(37,1); v;";      intvec @v = primes(37,1); @v;
+      return();
+   }
+   " USAGE:   primes(n,m);  n,m integers ";
+   " RETURNS: intvec, consisting of all primes p, prime(n)<=p<=m, in increasing";
+   "          order if n<m (resp. prime(m)<=p<=n, in decreasing order if m<n)";
+   " EXAMPLE: primes(\"ex\"); shows an example";
+}
+///////////////////////////////////////////////////////////////////////////////
+
+proc split
+{
+   if ( #ARGS!=1 and #ARGS!=2 )
+   {
+//=============================================================================
+  " USAGE:    split(s,n); s string, n integer ";
+  " RETURNS:  same string, split into lines of length n separated by \\";
+  " EXAMPLE:  split(\"ex\"); shows an example";
+//=============================================================================
+      return();
+   }
+
+   parameter = "s","n";
+   if ( #ARGS == 2 )
+   {
+      if ( typeof(#s) == "string" and typeof(#n) == "int" )
+      {
+         string @line;
+         string @res="";
+         int @l=size(#s);
+         int @p;
+         int @i;
+         if ( #s[@l,1] != newline )
+         {
+             #s=#s+newline;
+         }
+         while (1)
+         {
+            @l=find(#s,newline);
+            @line=#s[1,@l];
+            @p=1;
+            while ( @l>=#n )
+            {
+               @res=@res+@line[@p,#n-1]+"\\"+newline;
+               @p=@p+#n-1;
+               @l=@l-#n+1;
+            }
+            @res=@res+@line[@p,@l];
+            @l=size(@line);
+            if ( @l>=size(#s)) break;
+            #s=#s[@l+1,size(#s)-@l];
+         }
+         return (@res);
+      }
+   }
+//--------------------------------- EXAMPLE ----------------------------------
+   if (( typeof(#1) == "string" ) and ( #1 == "ex" ))
+   {
+      "EXAMPLE:";
+      " ring r = 0,(x,y,z),ds;";       ring @r= 0,(x,y,z),ds;
+      " poly f = (x+y+z)^9;";          poly @f = (x+y+z)^9;
+      " split(string(f),40);";         split(string(@f),40);
+      return();
+   }
+   " USAGE:    split(s,n); s string, n integer ";
+   " RETURNS:  same string, split into lines of length n separated by \\";
+   " EXAMPLE:  split(\"ex\"); shows an example";
+}
+///////////////////////////////////////////////////////////////////////////////
Index: Tst/Old/lib0.lib
===================================================================
--- Tst/Old/lib0.lib	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/lib0.lib	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,1068 @@
+// $Id: lib0.lib,v 1.1.1.1 1998-04-17 15:06:54 obachman Exp $
+//system("random",787422842);
+//(GMG)
+///////////////////////////////////////////////////////////////////////////////
+
+LIBRARY:  lib0.lib       PROCEDURES OF GENERAL TYPE
+
+ A_Z("a",n);             string of n comma seperated letters starting with a
+ binomial(n,m[,int/str]);n choose m (type int), [type string/type number]
+ changechar(r,"c","R");  makes a copy R of ring r with new char c the basering
+ changeord(r,"ord","R"); makes a copy R of ring r with new ord the basering
+ changevar(r,"vars","R");same as copyring
+ copyring(r,"vars","R"); makes a copy R of ring r with new vars the basering
+ copyring1(r,"vars","R");string to make a copy R of ring r with new variables
+ defrings(n[,p]);        define ring Sn in n vars, char 32003 [or p], ds
+ defringp(n[,p]);        define ring Pn in n vars, char 32003 [or p], dp
+ factorial(n[,int/str]); n factorial (=n!) (type int), [type string/number]
+ fetchall(R[,str]);      fetch all objects of ring R to basering
+ fibonacci(n[,p]);       nth Fibonacci number [char p]
+ ishomog(poly/...);      int, =1 resp. =0 if input is homogeneous resp. not
+ kmemory();              int = active memory (kilobyte)
+ killall();              kill all user-defined variables
+ imapall(R [,str]);      imap all objects of ring R to basering
+ mapall(R,i[,str]);      map all objects of ring R via ideal i to basering
+ maxcoef(poly/...);      maximal length of coefficient occuring in poly/...
+ maxdeg(poly/...);       int/intmat = degree/s of terms of maximal order
+ mindeg(poly/...);       int/intmat = degree/s of terms of minimal order
+ normalize(poly/...);    normalize poly/... such that leading coefficient is 1
+ primes(n,m);            intvec of primes p, n<=p<=m
+ product(vector/..[,v]); multiply components of vector/ideal/...[indices v]
+ ringsum(s,t,..."r");    create a ring r from existing rings s,t,...
+ ringweights(r);         intvec of weights of ring variables of ring r
+ sort(ideal/module);     sort generators according to monomial ordering
+ sum(vector/id/..[,v]);  add components of vector/ideal/...[with indices v]
+           (parameters in square brackets [] are optional)
+
+LIB "inout.lib";
+///////////////////////////////////////////////////////////////////////////////
+
+proc A_Z (string s,int n)
+USAGE:   A_Z("a",n);  a any letter, n integer (-26<= n <=26, !=0)
+RETURN:  string of n small (if a is small) or capital (if a is capital)
+         letters, comma seperated, beginning with a, in alphabetical
+         order (or revers alphabetical order if n<0)
+EXAMPLE: example A_Z; shows an example
+{
+  if ( n>=-26 and n<=26 and n!=0 )
+  {
+    string alpha =
+    "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,"+
+    "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";
+    int ii; int aa;
+    for(ii=1; ii<=51; ii=ii+2)
+    {
+       if( alpha[ii]==s ) { aa=ii; }
+    }
+    if ( aa==0)
+    {
+      for(ii=105; ii<=155; ii=ii+2)
+      {
+        if( alpha[ii]==s ) { aa=ii; }
+      }
+    }
+    if( aa!=0 )
+    {
+      string out;
+      if (n > 0) { out = alpha[aa,2*(n)-1];  return (out); }
+      if (n < 0)
+      {
+        string beta =
+        "z,y,x,w,v,u,t,s,r,q,p,o,n,m,l,k,j,i,h,g,f,e,d,c,b,a,"+
+        "z,y,x,w,v,u,t,s,r,q,p,o,n,m,l,k,j,i,h,g,f,e,d,c,b,a,"+
+        "Z,Y,X,W,V,U,T,S,R,Q,P,O,N,M,L,K,J,I,H,G,F,E,D,C,B,A,"+
+        "Z,Y,X,W,V,U,T,S,R,Q,P,O,N,M,L,K,J,I,H,G,F,E,D,C,B,A";
+        if ( aa < 52 ) { aa=52-aa; }
+        if ( aa > 104 ) { aa=260-aa; }
+        out = beta[aa,2*(-n)-1]; return (out);
+      }
+    }
+  }
+}
+example
+{ "EXAMPLE:"; echo = 2;
+   A_Z("c",5);
+   A_Z("Z",-5);
+   string sR = "ring R = (0,"+A_Z("A",6)+"),("+A_Z("a",10)+"),dp;";
+   sR;
+   execute sR;
+   R;
+}
+///////////////////////////////////////////////////////////////////////////////
+
+proc binomial (int n, int k, list #)
+USAGE:   binomial(n,k[,p/s]); n,k,p integers, s string
+RETURN:  binomial(n,k);    binomial coefficient n choose k of type int
+                           (machine integer, limited size! )
+         binomial(n,k,p);  n choose k in char p of type string
+         binomial(n,k,s);  n choose k of type number (s any string), computed
+                           in char of basering if a basering is defined
+EXAMPLE: example binomial; shows an example
+{
+   if ( size(#)==0 ) { int rr=1; }
+   if ( typeof(#[1])=="int") { ring bin = #[1],x,dp; number rr=1; }
+   if ( typeof(#[1])=="string") { number rr=1; }
+   if ( size(#)==0 or typeof(#[1])=="int" or typeof(#[1])=="string" )
+   {
+      def r = rr;
+      if ( k<=0 or k>n ) { return((k==0)*r); }
+      if ( k>=n-k ) { k = n-k; }
+      int l;
+      for (l=1 ; l<=k ; l++ )
+      {
+         r=r*(n+1-l)/l;
+      }
+      if ( typeof(#[1])=="int" ) { return(string(r)); }
+      return(r);
+   }
+}
+example
+{ "EXAMPLE:"; echo = 2;
+   int b1 = binomial(10,7); b1;
+   binomial(37,17,0);
+   ring t = 31,x,dp;
+   number b2 = binomial(37,17,""); b2;
+}
+///////////////////////////////////////////////////////////////////////////////
+
+proc changechar (r, string c, string newr)
+USAGE:   changechar(r,c,newr);  r=ring/qring, c,newr=strings
+CREATE:  creates a new ring with name `newr` and makes it the basering if r is
+         an existing ring/qring.
+         The new ring differs from the old ring only in the characteristic. If,
+         say, (c,newr) = ("0,A","R") and the ring r exists, the new basering
+         will have name R characteristic 0 and one parameter A.
+RETURN:  No return value
+NOTE:    //*** Buggy for qrings
+EXAMPLE: example changechar; shows an example
+{
+   setring r;
+   ideal i = ideal(r); int q = size(i);
+   if( q!=0 )
+      { string s = "newr1"; }
+   else
+      { string s = newr; }
+   string newring = s+"=("+c+"),("+varstr(r)+"),("+ordstr(r)+");";
+   execute("ring "+newring);
+   if( q!=0 )
+   {
+      map phi = r,maxideal(1);
+      ideal i = phi(i);
+      attrib(i,"isSB",1);         //*** attrib funktioniert ?
+      execute("qring "+newr+"=i;");
+   }
+   export(`newr`);
+   keepring(`newr`);
+   return();
+}
+example
+{  "EXAMPLE:"; echo = 2;
+   ring r=0,(x,y,u,v),(dp(2),ds);
+   show(r);
+   changechar(r,"2,A","R");
+   show(R);
+   kill R;
+}
+///////////////////////////////////////////////////////////////////////////////
+
+proc changeord (r, string o, string newr)
+USAGE:   changeord(r,o,newr);  r=ring/qring, o,newr=strings
+CREATE:  creates a new ring with name `newr` and makes it the basering if r is
+         an existing ring/qring.
+         The new ring differs from the old ring only in the ordering. If, say,
+         (o,newr) = ("wp(2,3),dp","R") and the ring r exists and has >=3
+         variables, the new basering will have name R and ordering wp(2,3),dp.
+RETURN:  No return value
+EXAMPLE: example changeord; shows an example
+{
+   setring r;
+   ideal i = ideal(r); int q = size(i);
+   if( q!=0 )
+      { string s = "newr1"; }
+   else
+      { string s = newr; }
+   string newring = s+"=("+charstr(r)+"),("+varstr(r)+"),("+o+");";
+   execute("ring "+newring);
+   if( q!=0 )
+   {
+      map phi = r,maxideal(1);
+      ideal i = phi(i);
+      attrib(i,"isSB",1);         //*** attrib funktioniert ?
+      execute("qring "+newr+"=i;");
+   }
+   export(`newr`);
+   keepring(`newr`);
+   return();
+}
+example
+{  "EXAMPLE:"; echo = 2;
+   ring r=0,(x,y,u,v),(dp(2),ds);
+   changeord(r,"wp(2,3),dp","R");
+   show(R);
+   ideal i = x^2,y^2-u^3,v;
+   qring Q = std(i);
+   changeord(Q,"lp","Q'");
+   show(Q');
+   kill R,Q,Q';
+}
+///////////////////////////////////////////////////////////////////////////////
+
+proc changevar (r, string vars, string newr)
+USAGE:   changevar(r,vars,newr);  r=ring/qring, vars,newr=strings
+CREATE:  creates a new ring with name `newr` and makes it the basering if r is
+         an existing ring/qring.
+NOTE:    This procedure is the same as copyring
+EXAMPLE: example changevar; shows an example
+{
+   copyring(r,vars,newr);
+}
+example
+{  "EXAMPLE:"; echo = 2;
+   ring r=0,(x,y,u,v),(dp(2),ds);
+   changevar(r,"A()","R");
+   show(R);
+   ideal i = x^2,y^2-u^3,v;
+   qring Q = std(i);
+   changevar(Q,"a,b,c,d","Q'");
+   show(Q');
+   kill R,Q,Q';
+}
+///////////////////////////////////////////////////////////////////////////////
+
+proc copyring (r, string vars, string newr)
+USAGE:   copyring(r,vars,newr);  r ring/qring, vars, newr strings
+CREATE:  creates a new ring with name `newr` and makes it the basering if r is
+         an existing ring/qring.
+         The new ring differs from the old ring only in the variables. If, say,
+         (vars,newr) = ("t()","R") and the ring r exists and has n variables,
+         the new basering will have name R and variables t(1),...,t(n).
+         If vars = "a,b,c,d", the new ring will have the variables a,b,c,d.
+RETURN:  No return value
+NOTE:    This procedure is useful in connection with the procedure ringsum,
+         when a conflict between variable names must be avoided. See proc
+         copyring1 for an alternative
+EXAMPLE: example copyring; shows an example
+{
+   setring r;
+   ideal i = ideal(r); int q = size(i);
+   if( q!=0 )
+      { string s = "newr1"; }
+   else
+      { string s = newr; }
+   string newring = s+"=("+charstr(r)+"),(";
+   if( vars[size(vars)-1]=="(" and vars[size(vars)]==")" )
+   {
+      newring = newring+vars[1,size(vars)-2]+"(1.."+string(nvars(r))+")";
+   }
+   else { newring = newring+vars; }
+   newring = newring+"),("+ordstr(r)+");";
+   execute("ring "+newring);
+   if( q!=0 )
+   {
+      map phi = r,maxideal(1);
+      ideal i = phi(i);
+      attrib(i,"isSB",1);         //*** attrib funktioniert ?
+      execute("qring "+newr+"=i;");
+   }
+   export(`newr`);
+   keepring(`newr`);
+   return();
+}
+example
+{  "EXAMPLE:"; echo = 2;
+   ring r=0,(x,y,u,v),(dp(2),ds);
+   copyring(r,"A()","R");
+   type R;
+   ideal i = A(1)^2,A(2)^2-A(3)^3,A(4);
+   qring Q = std(i);
+   copyring(Q,"a,b,c,d","Q'");
+   type Q';
+   kill R,Q,Q';
+}
+///////////////////////////////////////////////////////////////////////////////
+
+proc copyring1 (r, string vars, string newr)
+USAGE:   copyring1(r,vars,newr);  r ring, vars, newr strings
+RETURN:  a string which can be executed to define a new ring with name equal
+         to `newr` if r is an existing ring name.
+         The new ring differs from the old ring only in the variables. If, say,
+         (vars,newr) = ("t()","R") and the ring r exists and has n variables,
+         the new basering will have name R and variables t(1),...,t(n).
+         If vars = "a,b,c,d", the new ring will have the variables a,b,c,d.
+NOTE:    This procedure differs from copyring that it returns the string to
+         create newring, but does not execute this string. Contrary to
+         copyring this procedure does not work for a qring
+EXAMPLE: example copyring1; shows an example
+{
+   string newring = "ring "+newr+"=("+charstr(r)+"),(";
+   if( vars[size(vars)-1]=="(" and vars[size(vars)]==")" )
+        { string v = vars[1,size(vars)-2]+"(1.."+string(nvars(r))+")"; }
+   else { string v = vars; }
+   return(newring+v+"),("+ordstr(r)+");");
+}
+example
+{  "EXAMPLE:"; echo = 2;
+   ring r=0,(x,y,u,v),(dp(2),ds);
+   string s=copyring1(r,"A()","R");s;
+   execute(s);
+   type R;
+   execute(copyring1(R,"a,b,c,d,e","r'"));
+   type r';
+   kill R,r';
+}
+///////////////////////////////////////////////////////////////////////////////
+
+proc defring (string s1, string s2, int n, string s3, string s4)
+USAGE:   defring(s1,s2,n,s3,s4);  s1..s4=strings, n=integer
+CREATE:  Defines a ring with name 's1', characteristic 's2', ordering 's4' and
+         n variables with names derived from s3: if s3 is a single letter, say
+         s3="a", and if n<=26 then a and the following n-1 letters from the
+         alphabeth (cyclic order) are taken as variables. If n>26 or if s3 is
+         a single letter followed by (, say s3="T(", the variables are
+         T(1),...,T(n).
+RETURN:  No return value
+EXAMPLE: example defring; shows an example
+{
+   string newring = "ring "+s1+"=("+s2+"),(";
+   if( n>26 or s3[2]=="(" ) { string v = s3[1]+"(1.."+string(n)+")"; }
+   else { string v = A_Z(s3,n); }
+   newring=newring+v+"),("+s4+");";
+   execute(newring);
+   export(basering);
+   keepring(`s1`);
+   if (voice==2) { "// basering is now:",s1; }
+   return();
+}
+example
+{ "EXAMPLE:"; echo = 2;
+   defring("r","0",5,"u","ls"); r;
+   defring("R","2,A",10,"x(","dp(3),ws(1,2,3),ds"); R;
+   kill r,R;
+}
+///////////////////////////////////////////////////////////////////////////////
+
+proc defrings (int n, list #)
+USAGE:   defrings(n,[p]);  n,p integers
+CREATE:  Defines a ring with name Sn, characteristic p, ordering ds and n
+         variables x,y,z,a,b,...if n<=26 (resp. x(1..n) if n>26) and makes it
+         the basering (default: p=32003)
+RETURN:  No return value
+EXAMPLE: example defrings; shows an example
+{
+   int p;
+   if (size(#)==0) { p=32003; }
+   else { p=#[1]; }
+   if (n >26)
+   {
+      string s="ring S"+string(n)+"="+string(p)+",x(1.."+string(n)+"),ds;";
+   }
+   else
+   {
+      string s="ring S"+string(n)+"="+string(p)+",("+A_Z("x",n)+"),ds;";
+   }
+   execute(s);
+   export basering;
+   execute("keepring S"+string(n)+";");
+   if (voice==2) { "// basering is now:",s; }
+}
+example
+{ "EXAMPLE:"; echo = 2;
+   defrings(5,0); S5;
+   defrings(30); S30;
+   kill S5, S30;
+}
+///////////////////////////////////////////////////////////////////////////////
+
+proc defringp (int n,list #)
+USAGE:   defringp(n,[p]);  n,p=integers
+CREATE:  defines a ring with name Pn, characteristic p, ordering dp and n
+         variables x,y,z,a,b,...if n<=26 (resp. x(1..n) if n>26) and makes it
+         the basering (default: p=32003)
+RETURN:  No return value
+EXAMPLE: example defringp; shows an example
+{
+   int p;
+   if (size(#)==0) { p=32003; }
+   else { p=#[1]; }
+   if (n >26)
+   {
+      string s="ring P"+string(n)+"="+string(p)+",x(1.."+string(n)+"),dp;";
+   }
+   else
+   {
+     string s="ring P"+string(n)+"="+string(p)+",("+A_Z("x",n)+"),dp;";
+   }
+   execute(s);
+   export basering;
+   execute("keepring P"+string(n)+";");
+   //the next comment is only shown if defringp is not called by another proc
+   if (voice==2) { "// basering is now:",s; }
+}
+example
+{ "EXAMPLE:"; echo = 2;
+   defringp(5,0); P5;
+   defringp(30); P30;
+   kill P5, P30;
+}
+///////////////////////////////////////////////////////////////////////////////
+
+proc factorial (int n, list #)
+USAGE:   factorial(n[,string]);  n integer
+RETURN:  factorial(n); string of n! in char 0
+         factorial(n,s);  n! of type number (s any string), computed in char of
+         basering if a basering is defined
+EXAMPLE: example factorial; shows an example
+{
+   if ( size(#)==0 ) { ring R = 0,x,dp; poly r=1; }
+   if ( typeof(#[1])=="string" ) { number r=1; }
+   if ( size(#)==0 or typeof(#[1])=="string" )
+   {
+      int l;
+      for (l=2; l<=n; l++)
+      {
+         r=r*l;
+      }
+      if ( size(#)==0 ) { return(string(r)); }
+      return(r);
+   }
+}
+example
+{ "EXAMPLE:"; echo = 2;
+   factorial(37);
+   ring r1 = 32003,(x,y,z),ds;
+   number p = factorial(37,""); p;
+}
+///////////////////////////////////////////////////////////////////////////////
+
+proc fetchall (R, list #)
+USAGE:   fetchall(R[,s]);  R=ring/qring, s=string
+CREATE:  fetch all objects of ring R (of type poly, ideal, vector, module,
+         number, matrix) into the basering.
+         If no 3rd argument is present, the names are the same as in R. If, say,
+         f is a poly in R and the 3rd argument is the string "R", then f is
+         maped to f_R etc.
+RETURN:  no return value
+NOTE:    As fetch, this procedure maps the 1st, 2nd, ... variable of R to the
+         1st, 2nd, ... variable of the basering.
+         The 3rd argument is useful in order to avoid conflicts of names, the
+         empty string is allowed
+CAUTION: fetchall does not work inside a procedure
+         //***at the moment it does not work if R contains a map
+EXAMPLE: example fetchall; shows an example
+{
+   list @L@=names(R);
+   int @ii@; string @s@;
+   if( size(#) > 0 ) { @s@=@s@+"_"+#[1]; }
+   for( @ii@=size(@L@); @ii@>0; @ii@=@ii@-- )
+   {
+         execute("def "+@L@[@ii@]+@s@+"=fetch(R,`@L@[@ii@]`);");
+         execute("export "+@L@[@ii@]+@s@+";");
+   }
+   return();
+}
+example
+{  "EXAMPLE:";
+"// This example is not executed since fetchall does not work in a procedure";
+"// (and hence not in the example procedure). Just try the following commands:";
+"   ring R=0,(x,y,z),dp;";
+"   ideal j=x,y2,z2;";
+"   matrix M[2][3]=1,2,3,x,y,z;";
+"   j; print(M);";
+"   ring S=0,(a,b,c),ds;";
+"   fetchall(R);           // map from R to S: x->a, y->b, z->c";
+"   names(S);";
+"   j; print(M);";
+"   fetchall(S,\"1\");       // identity map of S: copy objects, change names";
+"   names(S);";
+"   kill R,S;";
+}
+///////////////////////////////////////////////////////////////////////////////
+
+proc fibonacci (int n, list #)
+USAGE:   fibonacci(n[,string]);  (n integer)
+RETURN:  fibonacci(n); string of nth Fibonacci number,
+            f(0)=f(1)=1, f(i+1)=f(i-1)+f(i)
+         fibonacci(n,s);  nth Fibonacci number of type number (s any string),
+         computed in characteristic of basering if a basering is defined
+EXAMPLE: example fibonacci; shows an example
+{
+   if ( size(#)==0 ) { ring fibo = 0,x,dp; number f=1; }
+   if ( typeof(#[1])=="string" ) { number f=1; }
+   if ( size(#)==0 or typeof(#[1])=="string" )
+   {
+      number g,h = 1,1; int ii;
+      for (ii=3; ii<=n; ii++)
+      {
+         h = f+g; f = g; g = h;
+      }
+      if ( size(#)==0 ) { return(string(h)); }
+      return(h);
+   }
+}
+example
+{ "EXAMPLE:"; echo = 2;
+   fibonacci(37);
+   ring r = 17,x,dp;
+   number b = fibonacci(37,""); b;
+}
+///////////////////////////////////////////////////////////////////////////////
+
+proc ishomog (id)
+USAGE:   ishomog(id);  id  poly/ideal/vector/module/matrix
+RETURN:  integer which is 1 if input is homogeneous (resp. weighted homogeneous
+         if the monomial ordering consists of one block of type ws,Ws,wp or Wp,
+         assuming that all weights are positive) and 0 otherwise
+NOTE:    A vector is homogeneous, if the components are homogeneous of same
+         degree, a module/matrix is homogeneous if all column vectors are
+         homogeneous
+         //*** ergaenzen, wenn Matrizen Spalten Gewichte haben
+EXAMPLE: example ishomog; shows an example
+{
+   module M = module(matrix(id));
+   M = simplify(M,2);                        // remove 0-columns
+   intvec v = ringweights(basering);
+   int i,j=1,1;
+   for (i=1; i<=ncols(M); i++)
+   {
+      if( M[i]!=jet(M[i],deg(lead(M[i])),v)-jet(M[i],deg(lead(M[i]))-1,v))
+      { return(0); }
+   }
+   return(1);
+}
+example
+{ "EXAMPLE:"; echo = 2;
+   ring r = 0,(x,y,z),wp(1,2,3);
+   ishomog(x5-yz+y3);
+   ideal i = x6+y3+z2, x9-z3;
+   ishomog(i);
+   ring s = 0,(a,b,c),ds;
+   vector v = [a2,0,ac+bc];
+   vector w = [a3,b3,c4];
+   ishomog(v);
+   ishomog(w);
+}
+///////////////////////////////////////////////////////////////////////////////
+
+proc kmemory ()
+USAGE:   kmemory();
+RETURN:  memory used by active variables, of type int (in kilobyte)
+EXAMPLE: example kmemory; shows an example
+{
+  if ( voice==2 ) { "// memory used by active variables (kilobyte):"; }
+   return ((memory(0)+1023)/1024);
+}
+example
+{ "EXAMPLE:"; echo = 2;
+   kmemory();
+}
+///////////////////////////////////////////////////////////////////////////////
+
+proc killall ()
+USAGE:   killall(); (no parameter)
+CREATE:  kill all user-defined variables but not loaded procedures
+RETURN:  no return value
+NOTE:    killall should never be used inside a procedure
+EXAMPLE: example killall; shows an example AND KILLS ALL YOUR VARIABLES
+{
+   list L=names(); int joni=size(L);
+   for ( ; joni>0; joni-- )
+   {
+      if( L[joni]!="LIB" and typeof(`L[joni]`)!="proc" ) { kill `L[joni]`; }
+   }
+}
+example
+{ "EXAMPLE:"; echo = 2;
+   ring rtest; ideal i=x,y,z; number n=37; string str="hi";
+   export rtest,i,n,str;     //this makes the local variables global
+   listvar(all);
+   killall();
+   listvar(all);
+}
+///////////////////////////////////////////////////////////////////////////////
+
+proc imapall (R, list #)
+USAGE:   imapall(R[,s]);  R=ring/qring, s=string
+CREATE:  map all objects of ring R (of type poly, ideal, vector, module, number,
+         matrix) into the basering, by applying imap to all objects of R.
+         If no 3rd argument is present, the names are the same as in R. If, say,
+         f is a poly in R and the 3rd argument is the string "R", then f is
+         maped to f_R etc.
+RETURN:  no return value
+NOTE:    As imap, this procedure maps the variables of R to the variables with
+         the same name in the basering, the other variables are maped to 0.
+         The 3rd argument is useful in order to avoid conflicts of names, the
+         empty string is allowed
+CAUTION: imapall does not work inside a procedure
+         //***at the moment it does not work if R contains a map
+EXAMPLE: example imapall; shows an example
+{
+   list @L@=names(R);
+   int @ii@; string @s@;
+   if( size(#) > 0 ) { @s@=@s@+"_"+#[1]; }
+   for( @ii@=size(@L@); @ii@>0; @ii@=@ii@-- )
+   {
+         execute("def "+@L@[@ii@]+@s@+"=imap(R,`@L@[@ii@]`);");
+         execute("export "+@L@[@ii@]+@s@+";");
+   }
+   return();
+}
+example
+{  "EXAMPLE:";
+"// This example is not executed since imapall does not work in a procedure";
+"// (and hence not in the example procedure). Just try the following commands:";
+"   ring R=0,(x,y,z,u),dp;";
+"   ideal j=x,y,z,u2+ux+z;";
+"   matrix M[2][3]=1,2,3,x,y,uz;";
+"   j; print(M);";
+"   ring S=0,(a,b,c,x,z,y),ds;";
+"   imapall(R);           // map from R to S: x->x, y->y, z->z, u->0";
+"   names(S);";
+"   j; print(M);";
+"   imapall(S,\"1\");       // identity map of S: copy objects, change names";
+"   names(S);";
+"   kill R,S;";
+}
+///////////////////////////////////////////////////////////////////////////////
+
+proc mapall (R, ideal i, list #)
+USAGE:   mapall(R,i[,s]);  R=ring/qring, i=ideal of basering, s=string
+CREATE:  map all objects of ring R (of type poly, ideal, vector, module, number,
+         matrix, map) into the basering, by mapping the jth variable of R to
+         the jth generator of the ideal i. If no 3rd argument is present, the
+         names are the same as in R. If, say, f is a poly in R and the 3rd
+         argument is the string "R", then f is maped to f_R etc.
+RETURN:  no return value
+NOTE:    This procedure has the same effect as defining a map, say psi, by
+         map psi=R,i; and then applying psi to all objects of R. In particular,
+         maps from R to some ring S are composed with psi, creating thus a map
+         from the basering to S.
+         mapall may be combined with copyring to change vars for all objects.
+         The 3rd argument is useful in order to avoid conflicts of names, the
+         empty string is allowed
+CAUTION: mapall does not work inside a procedure
+EXAMPLE: example mapall; shows an example
+{
+   list @L@=names(R); map @psi@ = R,i;
+   int @ii@; string @s@;
+   if( size(#) > 0 ) { @s@=@s@+"_"+#[1]; }
+   for( @ii@=size(@L@); @ii@>0; @ii@=@ii@-- )
+   {
+      execute("def "+@L@[@ii@]+@s@+"=@psi@(`@L@[@ii@]`);");
+      execute("export "+@L@[@ii@]+@s@+";");
+   }
+   return();
+}
+example
+{  "EXAMPLE:";
+"// This example is not executed since mapall does not work in a procedure";
+"// (and hence not in the example procedure). Just try the following commands:";
+"   ring R=0,(x,y,z),dp;";
+"   ideal j=x,y,z;";
+"   matrix M[2][3]=1,2,3,x,y,z;";
+"   map phi=R,x2,y2,z2; ";
+"   ring S=0,(a,b,c),ds;";
+"   ideal i=c,a,b;";
+"   mapall(R,i);             // map from R to S: x->c, y->a, z->b";
+"   names(S);";
+"   j; print(M); phi;        // phi is a map from R to S: x->c2, y->a2, z->b2";
+"   ideal i1=a2,a+b,1;";
+"   mapall(R,i1,\"\");         // map from R to S: x->a2, y->a+b, z->1";
+"   names(S);";
+"   j_; print(M_); phi_;";
+"   copyring(S,\"x()\",\"T\");";
+"   mapall(R,maxideal(1));   // identity map from R to T";
+"   names(T);";
+"   j; print(M); phi;";
+"   kill R,S,T;";
+}
+///////////////////////////////////////////////////////////////////////////////
+
+proc maxcoef (f)
+USAGE:   maxcoef(f);  f  poly/ideal/vector/module/matrix
+RETURN:  maximal length of coefficient of f of type int (by counting the
+         length of the string of each coefficient)
+EXAMPLE: example maxcoef; shows an example
+{
+   int max,s,ii,jj; string t;
+   ideal i = ideal(matrix(f));
+   i = simplify(i,6);         //* delete 0's and keep first of equal elements
+   poly m = var(1); matrix C;
+   for (ii=2;ii<=nvars(basering);ii++) { m = m*var(ii); }
+   for (ii=1; ii<=size(i); ii++)
+   {
+      C = coef(i[ii],m);
+      for (jj=1; jj<=ncols(C); jj++)
+      {
+         t = string(C[2,jj]);  s = size(t);
+         if ( t[1] == "-" ) { s = s - 1; }
+         if ( s > max ) { max = s; }
+      }
+   }
+   return(max);
+}
+example
+{ "EXAMPLE:"; echo = 2;
+   ring r= 0,(x,y,z),ds;
+   poly g = 345x2-1234567890y+7/4z;
+   maxcoef(g);
+   ideal i = g,10/1234567890;
+   maxcoef(i);
+   // since i[2]=1/123456789
+}
+///////////////////////////////////////////////////////////////////////////////
+
+proc maxdeg (id)
+USAGE:   maxdeg(id);  id  poly/ideal/vector/module/matrix
+RETURN:  maximal degree/s of monomials of id independent of ring ordering
+         (maxdeg of each variable is 1)
+         of type int if id is of type poly, of type intmat else
+EXAMPLE: example maxdeg; shows an example
+{
+//------------------- find maximal degree of given component ------------------
+   proc findmaxdeg
+   {
+      poly c = #[1];
+      if (c==0) { return(-1); }
+   //--- guess upper 'o' and lower 'u' bound, in case of negative weights -----
+      int d = (deg(c)>=0)*deg(c)-(deg(c)<0)*deg(c);
+      int i = d;
+      while ( c-jet(c,i) != 0 ) { i = 2*(i+1); }
+      int o = i-1;
+      int u = (d != i)*((i/ 2)-1);
+   //----------------------- "quick search" for maxdeg ------------------------
+      while ( (c-jet(c,i)==0)*(c-jet(c,i-1)!=0) == 0)
+      {
+         i = (o+1+u)/ 2;
+         if (c-jet(c,i)!=0) { u = i+1; }
+         else { o = i-1; }
+      }
+      return(i);
+   }
+//------------------------------ main program ---------------------------------
+   matrix M = matrix(id);
+   int r,c = nrows(M), ncols(M); int i,j;
+   intmat m[r][c];
+   for (i=r; i>0; i--)
+   {
+      for (j=c; j>0; j--) { m[i,j] = findmaxdeg(M[i,j]); }
+   }
+   if( typeof(id)=="poly" ) { return(m[1,1]); }
+   return(m);
+}
+example
+{ "EXAMPLE:"; echo = 2;
+   ring r = 0,(x,y,z),wp(-1,-2,-3);
+   poly f = x+y2+z3;
+   deg(f);               //deg returns weighted degree (in case of 1 block)!
+   maxdeg(f);
+   matrix m[2][2]=f+x10,1,0,f^2;
+   maxdeg(m);
+}
+///////////////////////////////////////////////////////////////////////////////
+
+proc mindeg (id)
+USAGE:   mindeg(id);  id  poly/ideal/vector/module/matrix
+RETURN:  minimal degree/s of monomials of id independent of ring ordering
+         (mindeg of each variable is 1)
+         of type int if id is of type poly, of type intmat else
+EXAMPLE: example mindeg; shows an example
+{
+//------------------- find minimal degree of given component ------------------
+   proc findmindeg
+   {
+      poly c = #[1];
+      if (c==0) { return(-1); }
+   //--- guess upper 'o' and lower 'u' bound, in case of negative weights -----
+      int d = (ord(c)>=0)*ord(c)-(ord(c)<0)*ord(c);
+      int i = d;
+      while ( jet(c,i) == 0 ) { i = 2*(i+1); }
+      int o = i-1;
+      int u = (d != i)*((i/ 2)-1);
+//----------------------- "quick search" for mindeg --------------------------
+      while ( (jet(c,u)==0)*(jet(c,o)!=0) )
+      {
+         i = (o+u)/ 2;
+         if (jet(c,i)==0) { u = i+1; }
+         else { o = i-1; }
+      }
+      if (jet(c,u)!=0) { return(u); }
+      else { return(o+1); }
+   }
+//------------------------------ main program ---------------------------------
+   matrix M = matrix(id);
+   int r,c = nrows(M), ncols(M); int i,j;
+   intmat m[r][c];
+   for (i=r; i>0; i--)
+   {
+      for (j=c; j>0; j--) { m[i,j] = findmindeg(M[i,j]); }
+   }
+   if (typeof(id)=="poly") { return(m[1,1]); }
+   return(m);
+}
+example
+{ "EXAMPLE:"; echo = 2;
+   ring r = 0,(x,y,z),ls;
+   poly f = x5+y2+z3;
+   ord(f);                // ord returns weighted order of leading term!
+   mindeg(f);
+   matrix m[2][2]=x10,1,0,f^2;
+   mindeg(m);
+}
+///////////////////////////////////////////////////////////////////////////////
+
+proc normalize (id)
+USAGE:   normalize(id);  id=poly/vector/ideal/module
+RETURN:  object of same type with leading coefficient equal to 1
+EXAMPLE: example normalize; shows an example
+{
+   return(simplify(id,1));
+}
+example
+{  "EXAMPLE:"; echo = 2;
+   ring r = 0,(x,y,z),ls;
+   poly f = 2x5+3y2+4z3;
+   normalize(f);
+   module m=[9xy,0,3z3],[4z,6y,2x];
+   show(normalize(m));
+   ring s = 0,(x,y,z),(c,ls);
+   module m=[9xy,0,3z3],[4z,6y,2x];
+   show(normalize(m));
+   normalize(matrix(m));  // by automatic type conversion to module!
+}
+///////////////////////////////////////////////////////////////////////////////
+
+proc primes (int n, int m)
+USAGE:   primes(n,m);  n,m integers
+RETURN:  intvec, consisting of all primes p, prime(n)<=p<=m, in increasing
+         order if n<=m, resp. prime(m)<=p<=n, in decreasing order if m<n
+NOTE:    prime(n); returns the biggest prime number <= n (if n>=2, else 2)
+EXAMPLE: example primes; shows an example
+{  int change;
+   if ( n>m ) { change=n; n=m ; m=change; change=1; }
+   int q,p = prime(m),prime(n); intvec v = q; q = q-1;
+   while ( q>=p ) { q = prime(q); v = q,v; q = q-1; }
+   if ( change==1 ) { v = v[size(v)..1]; }
+   return(v);
+}
+example
+{  "EXAMPLE:"; echo = 2;
+   primes(50,100);
+   intvec v = primes(37,1); v;
+}
+///////////////////////////////////////////////////////////////////////////////
+
+proc product (id, list #)
+USAGE:    product(id[,v]); id=ideal/vector/module/matrix
+          resp.id=intvec/intmat, v=intvec (e.g. v=1..n, n=integer)
+RETURN:   poly resp. int which is the product of all entries of id, with index
+          given by v (default: v=1..number of entries of id)
+NOTE:     id is treated as a list of polys resp. integers. A module m is
+          identified with corresponding matrix M (columns of M generate m)
+EXAMPLE:  example product; shows an example
+{
+   int n,j;
+   if( typeof(id)=="poly" or typeof(id)=="ideal" or typeof(id)=="vector"
+       or typeof(id)=="module" or typeof(id)=="matrix" )
+   {
+      ideal i = ideal(matrix(id));
+      if( size(#)!=0 ) { i = i[#[1]]; }
+      n = ncols(i); poly f=1;
+   }
+   if( typeof(id)=="int" or typeof(id)=="intvec" or typeof(id)=="intmat" )
+   {
+      intmat S = intmat(id);
+      intvec i = S[1..nrows(S),1..ncols(S)];
+      if( size(#)!=0 ) { i = i[#[1]]; }
+      n = size(i); int f=1;
+   }
+   for( j=1; j<=n; j++ ) { f=f*i[j]; }
+   return(f);
+}
+example
+{  "EXAMPLE:"; echo = 2;
+   ring r= 0,(x,y,z),dp;
+   ideal m = maxideal(1);
+   product(m);
+   matrix M[2][3] = 1,x,2,y,3,z;
+   product(M);
+   intvec v=2,4,6;
+   product(M,v);
+   intvec iv = 1,2,3,4,5,6,7,8,9;
+   v=1..5,7,9;
+   product(iv,v);
+   intmat A[2][3] = 1,1,1,2,2,2;
+   product(A,3..5);
+}
+///////////////////////////////////////////////////////////////////////////////
+
+proc ringsum (list #)
+USAGE:   ringsum(r1,r2,...,s); r1,r2,... rings, s string (name of result ring)
+CREATE:  A new base ring with name equal to s if r1,r2,... are existing rings.
+         If, say, s = "R" and the rings r1,r2,... exist, the new ring will
+         have name R, variables from all rings r1,r2,... and as monomial
+         ordering the block (product) ordering of r1,r2,.... Mathematically, R
+         is the tensor product of the rings r1,r2,... with ordering matrix
+         equal to the direct sum of the ordering matrices of r1,r2,...
+RETURN:  no return value
+NOTE:    The characteristic of the new ring will be that of r1. The names of
+         variables in the rings r1,r2,... should differ (if a name, say x,
+         occurs in r1 and r2, then, in the new ring r, x always refers to the
+         variable with name x in r1, there is no access to x in r2).
+         The procedure works also for quotient rings.
+EXAMPLE: example ringsum; shows an example
+{
+   int ii,q;
+   int n = size(#);
+   string vars,order,oi,s;
+   for(ii=1; ii<=n-1; ii++)
+   {
+      if( ordstr(#[ii])[1]=="C" or ordstr(#[ii])[1]=="c" )
+           { oi=ordstr(#[ii])[3,size(ordstr(#[ii]))-2]; }
+      else { oi=ordstr(#[ii])[1,size(ordstr(#[ii]))-2]; }
+      vars = vars+varstr(#[ii])+",";
+      order= order+oi+",";
+      def r(ii)=#[ii];
+      setring r(ii);
+      ideal i(ii)=ideal(r(ii));
+      int q(ii)=size(i(ii));
+      q=q+q(ii);
+   }
+   if( q!=0 ) { s = "newr"; }
+   else {  s = #[size(#)]; }
+   string newring ="=("+charstr(#[1])+"),("+vars[1,size(vars)-1]+"),("
+                  +order[1,size(order)-1]+");";
+   execute("ring "+s+newring);
+   if( q!=0 )
+   {
+      ideal i;
+      for(ii=1; ii<=n-1; ii++)
+      {
+         if( q(ii)!=0 )
+         {
+            map phi = r(ii),maxideal(1);
+            i = i+phi(i(ii));
+            kill phi;
+         }
+      }
+      i=std(i);
+      execute("qring "+#[size(#)]+"=i;");
+   }
+   export(`#[size(#)]`);
+   keepring(`#[size(#)]`);
+   return();
+}
+example
+{ "EXAMPLE:"; echo = 2;
+   ring r=0,(x,y,u,v),dp;
+   ring s=32003,(a,b,c),wp(1,2,3);
+   ring t=37,x(1..5),(c,ls);
+   ringsum(r,s,t,"R");
+   type R;
+   setring s;
+   ideal i = a2+b3+c5; i=std(i);
+   qring qs =i;
+   setring s; qring qt=i;
+   ringsum(r,qs,t,qt,"Q");
+   type Q;
+   kill R,Q;
+}
+///////////////////////////////////////////////////////////////////////////////
+
+proc ringweights (r)
+USAGE:   ringweights(r); r ring
+RETURN:  intvec of weights of ring variables. If, say, x(1),...,x(n) are the
+         variables of the ring r, in this order, the resulting intvec is
+         deg(x(1)),...,deg(x(n)) where deg denotes the weighted degree if
+         the monomial ordering of r has only one block of type ws,Ws,wp or Wp.
+NOTE:    In all other cases, in particular if there is more than one block,
+         the resulting intvec is 1,...,1
+EXAMPLE: example ringweights; shows an example
+{
+   int i; intvec v; setring r;
+   for (i=1; i<=nvars(basering); i++) { v[i] = deg(var(i)); }
+   return(v);
+}
+example
+{ "EXAMPLE:"; echo = 2;
+   ring r1=32003,(x,y,z),wp(1,2,3);
+   ring r2=32003,(x,y,z),Ws(1,2,3);
+   ring r=0,(x,y,u,v),lp;
+   intvec vr=ringweights(r1); vr;
+   ringweights(r2);
+   ringweights(r);
+}
+///////////////////////////////////////////////////////////////////////////////
+
+proc sort
+USAGE:    sort(id); id ideal or module
+RETURN:   ideal with generators of id sorted with respect to monomial ordering
+          of the basering (generators with smaller leading term come first)
+EXAMPLE:  example sort; shows an example
+{
+  intvec v = sortvec(#[1]);
+  int s    = size(v);
+  def m    = #[1];
+  for (int jj=1;jj<=s;jj++) { m[jj] = #[1][v[jj]]; }
+  return(m);
+}
+example
+{  "EXAMPLE:"; echo = 2;
+   ring r0 = 0,(x,y,z),lp;
+   ideal i = x3,y3,z3,x2z,x2y,y2z,y2x,z2y,z2x,xyz;
+   sort(i);
+   ring r1  = 0,t,ls;
+   ideal i = t47,t14,t6;
+   ideal j = i;
+   int ii;
+   for (ii=1;ii<=8;ii=ii+1) { j=simplify(jet(j+i^ii,50),6); }
+   print (matrix(j));
+   print (matrix(sort(j)));
+}
+///////////////////////////////////////////////////////////////////////////////
+
+proc sum (id, list #)
+USAGE:    sum(id[,v]); id=ideal/vector/module/matrix resp. id=intvec/intmat,
+                       v=intvec (e.g. v=1..n, n=integer)
+RETURN:   poly resp. int which is the sum of all entries of id, with index
+          given by v (default: v=1..number of entries of id)
+NOTE:     id is treated as a list of polys resp. integers. A module m is
+          identified with corresponding matrix M (columns of M generate m)
+EXAMPLE:  example sum; shows an example
+{
+   if( typeof(id)=="poly" or typeof(id)=="ideal" or typeof(id)=="vector"
+       or typeof(id)=="module" or typeof(id)=="matrix" )
+   {
+      ideal i = ideal(matrix(id));
+      if( size(#)!=0 ) { i = i[#[1]]; }
+      matrix Z = matrix(i);
+      intvec v; v[ncols(Z)]=0; v=v+1;
+   }
+   if( typeof(id)=="int" or typeof(id)=="intvec" or typeof(id)=="intmat" )
+   {
+      intmat S = intmat(id);
+      intvec v = S[1..nrows(S),1..ncols(S)];
+      if( size(#)!=0 ) { v = v[#[1]]; }
+      intvec z; z[size(v)]=0; z=z+1;
+      intmat Z=transpose(z);
+   }
+   return((Z*v)[1,1]);
+}
+example
+{  "EXAMPLE:"; echo = 2;
+   ring r= 0,(x,y,z),dp;
+   vector pv = [xy,xz,yz,x2,y2,z2];
+   sum(pv);
+   sum(pv,2..5);
+   matrix M[2][3] = 1,x,2,y,3,z;
+   sum(M);
+   intvec v=2,4,6;
+   sum(M,v);
+   intvec iv = 1,2,3,4,5,6,7,8,9;
+   v=1..5,7,9;
+   sum(iv,v);
+   intmat m[2][3] = 1,1,1,2,2,2;
+   sum(m,3..4);
+}
+///////////////////////////////////////////////////////////////////////////////
Index: Tst/Old/lib0.test
===================================================================
--- Tst/Old/lib0.test	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/lib0.test	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,1072 @@
+// $Id: lib0.test,v 1.1.1.1 1998-04-17 15:06:54 obachman Exp $
+//system("random",787422842);
+//(GMG)
+///////////////////////////////////////////////////////////////////////////////
+
+LIBRARY:  lib0.lib       PROCEDURES OF GENERAL TYPE
+
+ A_Z("a",n);             string of n comma seperated letters starting with a
+ binomial(n,m[,int/str]);n choose m (type int), [type string/type number]
+ changechar(r,"c","R");  makes a copy R of ring r with new char c the basering
+ changeord(r,"ord","R"); makes a copy R of ring r with new ord the basering
+ changevar(r,"vars","R");same as copyring
+ copyring(r,"vars","R"); makes a copy R of ring r with new vars the basering
+ copyring1(r,"vars","R");string to make a copy R of ring r with new variables
+ defrings(n[,p]);        define ring Sn in n vars, char 32003 [or p], ds
+ defringp(n[,p]);        define ring Pn in n vars, char 32003 [or p], dp
+ factorial(n[,int/str]); n factorial (=n!) (type int), [type string/number]
+ fetchall(R[,str]);      fetch all objects of ring R to basering
+ fibonacci(n[,p]);       nth Fibonacci number [char p]
+ ishomog(poly/...);      int, =1 resp. =0 if input is homogeneous resp. not
+ kmemory();              int = active memory (kilobyte)
+ killall();              kill all user-defined variables
+ imapall(R [,str]);      imap all objects of ring R to basering
+ mapall(R,i[,str]);      map all objects of ring R via ideal i to basering
+ maxcoef(poly/...);      maximal length of coefficient occuring in poly/...
+ maxdeg(poly/...);       int/intmat = degree/s of terms of maximal order
+ mindeg(poly/...);       int/intmat = degree/s of terms of minimal order
+ normalize(poly/...);    normalize poly/... such that leading coefficient is 1
+ primes(n,m);            intvec of primes p, n<=p<=m
+ product(vector/..[,v]); multiply components of vector/ideal/...[indices v]
+ ringsum(s,t,..."r");    create a ring r from existing rings s,t,...
+ ringweights(r);         intvec of weights of ring variables of ring r
+ sort(ideal/module);     sort generators according to monomial ordering
+ sum(vector/id/..[,v]);  add components of vector/ideal/...[with indices v]
+           (parameters in square brackets [] are optional)
+
+LIB "inout.lib";
+///////////////////////////////////////////////////////////////////////////////
+
+proc A_Z (string s,int n)
+USAGE:   A_Z("a",n);  a any letter, n integer (-26<= n <=26, !=0)
+RETURN:  string of n small (if a is small) or capital (if a is capital)
+         letters, comma seperated, beginning with a, in alphabetical
+         order (or revers alphabetical order if n<0)
+EXAMPLE: example A_Z; shows an example
+{
+  if ( n>=-26 and n<=26 and n!=0 )
+  {
+    string alpha =
+    "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,"+
+    "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";
+    int ii; int aa;
+    for(ii=1; ii<=51; ii=ii+2)
+    {
+       if( alpha[ii]==s ) { aa=ii; }
+    }
+    if ( aa==0)
+    {
+      for(ii=105; ii<=155; ii=ii+2)
+      {
+        if( alpha[ii]==s ) { aa=ii; }
+      }
+    }
+    if( aa!=0 )
+    {
+      string out;
+      if (n > 0) { out = alpha[aa,2*(n)-1];  return (out); }
+      if (n < 0)
+      {
+        string beta =
+        "z,y,x,w,v,u,t,s,r,q,p,o,n,m,l,k,j,i,h,g,f,e,d,c,b,a,"+
+        "z,y,x,w,v,u,t,s,r,q,p,o,n,m,l,k,j,i,h,g,f,e,d,c,b,a,"+
+        "Z,Y,X,W,V,U,T,S,R,Q,P,O,N,M,L,K,J,I,H,G,F,E,D,C,B,A,"+
+        "Z,Y,X,W,V,U,T,S,R,Q,P,O,N,M,L,K,J,I,H,G,F,E,D,C,B,A";
+        if ( aa < 52 ) { aa=52-aa; }
+        if ( aa > 104 ) { aa=260-aa; }
+        out = beta[aa,2*(-n)-1]; return (out);
+      }
+    }
+  }
+}
+example
+{ "EXAMPLE:"; echo = 2;
+   A_Z("c",5);
+   A_Z("Z",-5);
+   string sR = "ring R = (0,"+A_Z("A",6)+"),("+A_Z("a",10)+"),dp;";
+   sR;
+   execute sR;
+   R;
+}
+///////////////////////////////////////////////////////////////////////////////
+
+proc binomial (int n, int k, list #)
+USAGE:   binomial(n,k[,p/s]); n,k,p integers, s string
+RETURN:  binomial(n,k);    binomial coefficient n choose k of type int
+                           (machine integer, limited size! )
+         binomial(n,k,p);  n choose k in char p of type string
+         binomial(n,k,s);  n choose k of type number (s any string), computed
+                           in char of basering if a basering is defined
+EXAMPLE: example binomial; shows an example
+{
+   if ( size(#)==0 ) { int rr=1; }
+   if ( typeof(#[1])=="int") { ring bin = #[1],x,dp; number rr=1; }
+   if ( typeof(#[1])=="string") { number rr=1; }
+   if ( size(#)==0 or typeof(#[1])=="int" or typeof(#[1])=="string" )
+   {
+      def r = rr;
+      if ( k<=0 or k>n ) { return((k==0)*r); }
+      if ( k>=n-k ) { k = n-k; }
+      int l;
+      for (l=1 ; l<=k ; l++ )
+      {
+         r=r*(n+1-l)/l;
+      }
+      if ( typeof(#[1])=="int" ) { return(string(r)); }
+      return(r);
+   }
+}
+example
+{ "EXAMPLE:"; echo = 2;
+   int b1 = binomial(10,7); b1;
+   binomial(37,17,0);
+   ring t = 31,x,dp;
+   number b2 = binomial(37,17,""); b2;
+}
+///////////////////////////////////////////////////////////////////////////////
+
+proc changechar (r, string c, string newr)
+USAGE:   changechar(r,c,newr);  r=ring/qring, c,newr=strings
+CREATE:  creates a new ring with name `newr` and makes it the basering if r is
+         an existing ring/qring.
+         The new ring differs from the old ring only in the characteristic. If,
+         say, (c,newr) = ("0,A","R") and the ring r exists, the new basering
+         will have name R characteristic 0 and one parameter A.
+RETURN:  No return value
+NOTE:    //*** Buggy for qrings
+EXAMPLE: example changechar; shows an example
+{
+   setring r;
+   ideal i = ideal(r); int q = size(i);
+   if( q!=0 )
+      { string s = "newr1"; }
+   else
+      { string s = newr; }
+   string newring = s+"=("+c+"),("+varstr(r)+"),("+ordstr(r)+");";
+   execute("ring "+newring);
+   if( q!=0 )
+   {
+      map phi = r,maxideal(1);
+      ideal i = phi(i);
+      attrib(i,"isSB",1);         //*** attrib funktioniert ?
+      execute("qring "+newr+"=i;");
+   }
+   export(`newr`);
+   keepring(`newr`);
+   return();
+}
+example
+{  "EXAMPLE:"; echo = 2;
+   ring r=0,(x,y,u,v),(dp(2),ds);
+   show(r);
+   changechar(r,"2,A","R");
+   show(R);
+   kill R;
+}
+///////////////////////////////////////////////////////////////////////////////
+
+proc changeord (r, string o, string newr)
+USAGE:   changeord(r,o,newr);  r=ring/qring, o,newr=strings
+CREATE:  creates a new ring with name `newr` and makes it the basering if r is
+         an existing ring/qring.
+         The new ring differs from the old ring only in the ordering. If, say,
+         (o,newr) = ("wp(2,3),dp","R") and the ring r exists and has >=3
+         variables, the new basering will have name R and ordering wp(2,3),dp.
+RETURN:  No return value
+EXAMPLE: example changeord; shows an example
+{
+   setring r;
+   ideal i = ideal(r); int q = size(i);
+   if( q!=0 )
+      { string s = "newr1"; }
+   else
+      { string s = newr; }
+   string newring = s+"=("+charstr(r)+"),("+varstr(r)+"),("+o+");";
+   execute("ring "+newring);
+   if( q!=0 )
+   {
+      map phi = r,maxideal(1);
+      ideal i = phi(i);
+      attrib(i,"isSB",1);         //*** attrib funktioniert ?
+      execute("qring "+newr+"=i;");
+   }
+   export(`newr`);
+   keepring(`newr`);
+   return();
+}
+example
+{  "EXAMPLE:"; echo = 2;
+   ring r=0,(x,y,u,v),(dp(2),ds);
+   changeord(r,"wp(2,3),dp","R");
+   show(R);
+   ideal i = x^2,y^2-u^3,v;
+   qring Q = std(i);
+   changeord(Q,"lp","Q'");
+   show(Q');
+   kill R,Q,Q';
+}
+///////////////////////////////////////////////////////////////////////////////
+
+proc changevar (r, string vars, string newr)
+USAGE:   changevar(r,vars,newr);  r=ring/qring, vars,newr=strings
+CREATE:  creates a new ring with name `newr` and makes it the basering if r is
+         an existing ring/qring.
+NOTE:    This procedure is the same as copyring
+EXAMPLE: example changevar; shows an example
+{
+   copyring(r,vars,newr);
+}
+example
+{  "EXAMPLE:"; echo = 2;
+   ring r=0,(x,y,u,v),(dp(2),ds);
+   changevar(r,"A()","R");
+   show(R);
+   ideal i = x^2,y^2-u^3,v;
+   qring Q = std(i);
+   changevar(Q,"a,b,c,d","Q'");
+   show(Q');
+   kill R,Q,Q';
+}
+///////////////////////////////////////////////////////////////////////////////
+
+proc copyring (r, string vars, string newr)
+USAGE:   copyring(r,vars,newr);  r ring/qring, vars, newr strings
+CREATE:  creates a new ring with name `newr` and makes it the basering if r is
+         an existing ring/qring.
+         The new ring differs from the old ring only in the variables. If, say,
+         (vars,newr) = ("t()","R") and the ring r exists and has n variables,
+         the new basering will have name R and variables t(1),...,t(n).
+         If vars = "a,b,c,d", the new ring will have the variables a,b,c,d.
+RETURN:  No return value
+NOTE:    This procedure is useful in connection with the procedure ringsum,
+         when a conflict between variable names must be avoided. See proc
+         copyring1 for an alternative
+EXAMPLE: example copyring; shows an example
+{
+   setring r;
+   ideal i = ideal(r); int q = size(i);
+   if( q!=0 )
+      { string s = "newr1"; }
+   else
+      { string s = newr; }
+   string newring = s+"=("+charstr(r)+"),(";
+   if( vars[size(vars)-1]=="(" and vars[size(vars)]==")" )
+   {
+      newring = newring+vars[1,size(vars)-2]+"(1.."+string(nvars(r))+")";
+   }
+   else { newring = newring+vars; }
+   newring = newring+"),("+ordstr(r)+");";
+   execute("ring "+newring);
+   if( q!=0 )
+   {
+      map phi = r,maxideal(1);
+      ideal i = phi(i);
+      attrib(i,"isSB",1);         //*** attrib funktioniert ?
+      execute("qring "+newr+"=i;");
+   }
+   export(`newr`);
+   keepring(`newr`);
+   return();
+}
+example
+{  "EXAMPLE:"; echo = 2;
+   ring r=0,(x,y,u,v),(dp(2),ds);
+   copyring(r,"A()","R");
+   type R;
+   ideal i = A(1)^2,A(2)^2-A(3)^3,A(4);
+   qring Q = std(i);
+   copyring(Q,"a,b,c,d","Q'");
+   type Q';
+   kill R,Q,Q';
+}
+///////////////////////////////////////////////////////////////////////////////
+
+proc copyring1 (r, string vars, string newr)
+USAGE:   copyring1(r,vars,newr);  r ring, vars, newr strings
+RETURN:  a string which can be executed to define a new ring with name equal
+         to `newr` if r is an existing ring name.
+         The new ring differs from the old ring only in the variables. If, say,
+         (vars,newr) = ("t()","R") and the ring r exists and has n variables,
+         the new basering will have name R and variables t(1),...,t(n).
+         If vars = "a,b,c,d", the new ring will have the variables a,b,c,d.
+NOTE:    This procedure differs from copyring that it returns the string to
+         create newring, but does not execute this string. Contrary to
+         copyring this procedure does not work for a qring
+EXAMPLE: example copyring1; shows an example
+{
+   string newring = "ring "+newr+"=("+charstr(r)+"),(";
+   if( vars[size(vars)-1]=="(" and vars[size(vars)]==")" )
+        { string v = vars[1,size(vars)-2]+"(1.."+string(nvars(r))+")"; }
+   else { string v = vars; }
+   return(newring+v+"),("+ordstr(r)+");");
+}
+example
+{  "EXAMPLE:"; echo = 2;
+   ring r=0,(x,y,u,v),(dp(2),ds);
+   string s=copyring1(r,"A()","R");s;
+   execute(s);
+   type R;
+   execute(copyring1(R,"a,b,c,d,e","r'"));
+   type r';
+   kill R,r';
+}
+///////////////////////////////////////////////////////////////////////////////
+
+proc defring (string s1, string s2, int n, string s3, string s4)
+USAGE:   defring(s1,s2,n,s3,s4);  s1..s4=strings, n=integer
+CREATE:  Defines a ring with name 's1', characteristic 's2', ordering 's4' and
+         n variables with names derived from s3: if s3 is a single letter, say
+         s3="a", and if n<=26 then a and the following n-1 letters from the
+         alphabeth (cyclic order) are taken as variables. If n>26 or if s3 is
+         a single letter followed by (, say s3="T(", the variables are
+         T(1),...,T(n).
+RETURN:  No return value
+EXAMPLE: example defring; shows an example
+{
+   string newring = "ring "+s1+"=("+s2+"),(";
+   if( n>26 or s3[2]=="(" ) { string v = s3[1]+"(1.."+string(n)+")"; }
+   else { string v = A_Z(s3,n); }
+   newring=newring+v+"),("+s4+");";
+   execute(newring);
+   export(basering);
+   keepring(`s1`);
+   if (voice==2) { "// basering is now:",s1; }
+   return();
+}
+example
+{ "EXAMPLE:"; echo = 2;
+   defring("r","0",5,"u","ls"); r;
+   defring("R","2,A",10,"x(","dp(3),ws(1,2,3),ds"); R;
+   kill r,R;
+}
+///////////////////////////////////////////////////////////////////////////////
+
+proc defrings (int n, list #)
+USAGE:   defrings(n,[p]);  n,p integers
+CREATE:  Defines a ring with name Sn, characteristic p, ordering ds and n
+         variables x,y,z,a,b,...if n<=26 (resp. x(1..n) if n>26) and makes it
+         the basering (default: p=32003)
+RETURN:  No return value
+EXAMPLE: example defrings; shows an example
+{
+   int p;
+   if (size(#)==0) { p=32003; }
+   else { p=#[1]; }
+   if (n >26)
+   {
+      string s="ring S"+string(n)+"="+string(p)+",x(1.."+string(n)+"),ds;";
+   }
+   else
+   {
+      string s="ring S"+string(n)+"="+string(p)+",("+A_Z("x",n)+"),ds;";
+   }
+   execute(s);
+   export basering;
+   execute("keepring S"+string(n)+";");
+   if (voice==2) { "// basering is now:",s; }
+}
+example
+{ "EXAMPLE:"; echo = 2;
+   defrings(5,0); S5;
+   defrings(30); S30;
+   kill S5, S30;
+}
+///////////////////////////////////////////////////////////////////////////////
+
+proc defringp (int n,list #)
+USAGE:   defringp(n,[p]);  n,p=integers
+CREATE:  defines a ring with name Pn, characteristic p, ordering dp and n
+         variables x,y,z,a,b,...if n<=26 (resp. x(1..n) if n>26) and makes it
+         the basering (default: p=32003)
+RETURN:  No return value
+EXAMPLE: example defringp; shows an example
+{
+   int p;
+   if (size(#)==0) { p=32003; }
+   else { p=#[1]; }
+   if (n >26)
+   {
+      string s="ring P"+string(n)+"="+string(p)+",x(1.."+string(n)+"),dp;";
+   }
+   else
+   {
+     string s="ring P"+string(n)+"="+string(p)+",("+A_Z("x",n)+"),dp;";
+   }
+   execute(s);
+   export basering;
+   execute("keepring P"+string(n)+";");
+   //the next comment is only shown if defringp is not called by another proc
+   if (voice==2) { "// basering is now:",s; }
+}
+example
+{ "EXAMPLE:"; echo = 2;
+   defringp(5,0); P5;
+   defringp(30); P30;
+   kill P5, P30;
+}
+///////////////////////////////////////////////////////////////////////////////
+
+proc factorial (int n, list #)
+USAGE:   factorial(n[,string]);  n integer
+RETURN:  factorial(n); string of n! in char 0
+         factorial(n,s);  n! of type number (s any string), computed in char of
+         basering if a basering is defined
+EXAMPLE: example factorial; shows an example
+{
+   if ( size(#)==0 ) { ring R = 0,x,dp; poly r=1; }
+   if ( typeof(#[1])=="string" ) { number r=1; }
+   if ( size(#)==0 or typeof(#[1])=="string" )
+   {
+      int l;
+      for (l=2; l<=n; l++)
+      {
+         r=r*l;
+      }
+      if ( size(#)==0 ) { return(string(r)); }
+      return(r);
+   }
+}
+example
+{ "EXAMPLE:"; echo = 2;
+   factorial(37);
+   ring r1 = 32003,(x,y,z),ds;
+   number p = factorial(37,""); p;
+}
+///////////////////////////////////////////////////////////////////////////////
+
+proc fetchall (R, list #)
+USAGE:   fetchall(R[,s]);  R=ring/qring, s=string
+CREATE:  fetch all objects of ring R (of type poly, ideal, vector, module,
+         number, matrix) into the basering.
+         If no 3rd argument is present, the names are the same as in R. If, say,
+         f is a poly in R and the 3rd argument is the string "R", then f is
+         maped to f_R etc.
+RETURN:  no return value
+NOTE:    As fetch, this procedure maps the 1st, 2nd, ... variable of R to the
+         1st, 2nd, ... variable of the basering.
+         The 3rd argument is useful in order to avoid conflicts of names, the
+         empty string is allowed
+CAUTION: fetchall does not work inside a procedure
+         //***at the moment it does not work if R contains a map
+EXAMPLE: example fetchall; shows an example
+{
+   list @L@=names(R);
+   int @ii@; string @s@;
+   if( size(#) > 0 ) { @s@=@s@+"_"+#[1]; }
+   for( @ii@=size(@L@); @ii@>0; @ii@=@ii@-- )
+   {
+         execute("def "+@L@[@ii@]+@s@+"=fetch(R,`@L@[@ii@]`);");
+         execute("export "+@L@[@ii@]+@s@+";");
+   }
+   return();
+}
+example
+{  "EXAMPLE:";
+"// This example is not executed since fetchall does not work in a procedure";
+"// (and hence not in the example procedure). Just try the following commands:";
+"   ring R=0,(x,y,z),dp;";
+"   ideal j=x,y2,z2;";
+"   matrix M[2][3]=1,2,3,x,y,z;";
+"   j; print(M);";
+"   ring S=0,(a,b,c),ds;";
+"   fetchall(R);           // map from R to S: x->a, y->b, z->c";
+"   names(S);";
+"   j; print(M);";
+"   fetchall(S,\"1\");       // identity map of S: copy objects, change names";
+"   names(S);";
+"   kill R,S;";
+}
+///////////////////////////////////////////////////////////////////////////////
+
+proc fibonacci (int n, list #)
+USAGE:   fibonacci(n[,string]);  (n integer)
+RETURN:  fibonacci(n); string of nth Fibonacci number,
+            f(0)=f(1)=1, f(i+1)=f(i-1)+f(i)
+         fibonacci(n,s);  nth Fibonacci number of type number (s any string),
+         computed in characteristic of basering if a basering is defined
+EXAMPLE: example fibonacci; shows an example
+{
+   if ( size(#)==0 ) { ring fibo = 0,x,dp; number f=1; }
+   if ( typeof(#[1])=="string" ) { number f=1; }
+   if ( size(#)==0 or typeof(#[1])=="string" )
+   {
+      number g,h = 1,1; int ii;
+      for (ii=3; ii<=n; ii++)
+      {
+         h = f+g; f = g; g = h;
+      }
+      if ( size(#)==0 ) { return(string(h)); }
+      return(h);
+   }
+}
+example
+{ "EXAMPLE:"; echo = 2;
+   fibonacci(37);
+   ring r = 17,x,dp;
+   number b = fibonacci(37,""); b;
+}
+///////////////////////////////////////////////////////////////////////////////
+
+proc ishomog (id)
+USAGE:   ishomog(id);  id  poly/ideal/vector/module/matrix
+RETURN:  integer which is 1 if input is homogeneous (resp. weighted homogeneous
+         if the monomial ordering consists of one block of type ws,Ws,wp or Wp,
+         assuming that all weights are positive) and 0 otherwise
+NOTE:    A vector is homogeneous, if the components are homogeneous of same
+         degree, a module/matrix is homogeneous if all column vectors are
+         homogeneous
+         //*** ergaenzen, wenn Matrizen Spalten Gewichte haben
+EXAMPLE: example ishomog; shows an example
+{
+   module M = module(matrix(id));
+   M = simplify(M,2);                        // remove 0-columns
+   intvec v = ringweights(basering);
+   int i,j=1,1;
+   for (i=1; i<=ncols(M); i++)
+   {
+      if( M[i]!=jet(M[i],deg(lead(M[i])),v)-jet(M[i],deg(lead(M[i]))-1,v))
+      { return(0); }
+   }
+   return(1);
+}
+example
+{ "EXAMPLE:"; echo = 2;
+   ring r = 0,(x,y,z),wp(1,2,3);
+   ishomog(x5-yz+y3);
+   ideal i = x6+y3+z2, x9-z3;
+   ishomog(i);
+   ring s = 0,(a,b,c),ds;
+   vector v = [a2,0,ac+bc];
+   vector w = [a3,b3,c4];
+   ishomog(v);
+   ishomog(w);
+}
+///////////////////////////////////////////////////////////////////////////////
+
+proc kmemory ()
+USAGE:   kmemory();
+RETURN:  memory used by active variables, of type int (in kilobyte)
+EXAMPLE: example kmemory; shows an example
+{
+  if ( voice==2 ) { "// memory used by active variables (kilobyte):"; }
+   return ((memory(0)+1023)/1024);
+}
+example
+{ "EXAMPLE:"; echo = 2;
+   kmemory();
+}
+///////////////////////////////////////////////////////////////////////////////
+
+proc killall ()
+USAGE:   killall(); (no parameter)
+CREATE:  kill all user-defined variables but not loaded procedures
+RETURN:  no return value
+NOTE:    killall should never be used inside a procedure
+EXAMPLE: example killall; shows an example AND KILLS ALL YOUR VARIABLES
+{
+   list L=names(); int joni=size(L);
+   for ( ; joni>0; joni-- )
+   {
+      joni,L[joni],typeof(`L[joni]`),
+      L[joni]!="LIB",
+      typeof(`L[joni]`)!="proc",
+      L[joni]!="LIB" and typeof(`L[joni]`)!="proc";
+      if( L[joni]!="LIB" and typeof(`L[joni]`)!="proc" ) { joni;"kill"+L[joni];kill `L[joni]`; }
+   }
+}
+example
+{ "EXAMPLE:"; echo = 2;
+   ring rtest; ideal i=x,y,z; number n=37; string str="hi";
+   export rtest,i,n,str;     //this makes the local variables global
+   listvar(all);
+   killall();
+   listvar(all);
+}
+///////////////////////////////////////////////////////////////////////////////
+
+proc imapall (R, list #)
+USAGE:   imapall(R[,s]);  R=ring/qring, s=string
+CREATE:  map all objects of ring R (of type poly, ideal, vector, module, number,
+         matrix) into the basering, by applying imap to all objects of R.
+         If no 3rd argument is present, the names are the same as in R. If, say,
+         f is a poly in R and the 3rd argument is the string "R", then f is
+         maped to f_R etc.
+RETURN:  no return value
+NOTE:    As imap, this procedure maps the variables of R to the variables with
+         the same name in the basering, the other variables are maped to 0.
+         The 3rd argument is useful in order to avoid conflicts of names, the
+         empty string is allowed
+CAUTION: imapall does not work inside a procedure
+         //***at the moment it does not work if R contains a map
+EXAMPLE: example imapall; shows an example
+{
+   list @L@=names(R);
+   int @ii@; string @s@;
+   if( size(#) > 0 ) { @s@=@s@+"_"+#[1]; }
+   for( @ii@=size(@L@); @ii@>0; @ii@=@ii@-- )
+   {
+         execute("def "+@L@[@ii@]+@s@+"=imap(R,`@L@[@ii@]`);");
+         execute("export "+@L@[@ii@]+@s@+";");
+   }
+   return();
+}
+example
+{  "EXAMPLE:";
+"// This example is not executed since imapall does not work in a procedure";
+"// (and hence not in the example procedure). Just try the following commands:";
+"   ring R=0,(x,y,z,u),dp;";
+"   ideal j=x,y,z,u2+ux+z;";
+"   matrix M[2][3]=1,2,3,x,y,uz;";
+"   j; print(M);";
+"   ring S=0,(a,b,c,x,z,y),ds;";
+"   imapall(R);           // map from R to S: x->x, y->y, z->z, u->0";
+"   names(S);";
+"   j; print(M);";
+"   imapall(S,\"1\");       // identity map of S: copy objects, change names";
+"   names(S);";
+"   kill R,S;";
+}
+///////////////////////////////////////////////////////////////////////////////
+
+proc mapall (R, ideal i, list #)
+USAGE:   mapall(R,i[,s]);  R=ring/qring, i=ideal of basering, s=string
+CREATE:  map all objects of ring R (of type poly, ideal, vector, module, number,
+         matrix, map) into the basering, by mapping the jth variable of R to
+         the jth generator of the ideal i. If no 3rd argument is present, the
+         names are the same as in R. If, say, f is a poly in R and the 3rd
+         argument is the string "R", then f is maped to f_R etc.
+RETURN:  no return value
+NOTE:    This procedure has the same effect as defining a map, say psi, by
+         map psi=R,i; and then applying psi to all objects of R. In particular,
+         maps from R to some ring S are composed with psi, creating thus a map
+         from the basering to S.
+         mapall may be combined with copyring to change vars for all objects.
+         The 3rd argument is useful in order to avoid conflicts of names, the
+         empty string is allowed
+CAUTION: mapall does not work inside a procedure
+EXAMPLE: example mapall; shows an example
+{
+   list @L@=names(R); map @psi@ = R,i;
+   int @ii@; string @s@;
+   if( size(#) > 0 ) { @s@=@s@+"_"+#[1]; }
+   for( @ii@=size(@L@); @ii@>0; @ii@=@ii@-- )
+   {
+      execute("def "+@L@[@ii@]+@s@+"=@psi@(`@L@[@ii@]`);");
+      execute("export "+@L@[@ii@]+@s@+";");
+   }
+   return();
+}
+example
+{  "EXAMPLE:";
+"// This example is not executed since mapall does not work in a procedure";
+"// (and hence not in the example procedure). Just try the following commands:";
+"   ring R=0,(x,y,z),dp;";
+"   ideal j=x,y,z;";
+"   matrix M[2][3]=1,2,3,x,y,z;";
+"   map phi=R,x2,y2,z2; ";
+"   ring S=0,(a,b,c),ds;";
+"   ideal i=c,a,b;";
+"   mapall(R,i);             // map from R to S: x->c, y->a, z->b";
+"   names(S);";
+"   j; print(M); phi;        // phi is a map from R to S: x->c2, y->a2, z->b2";
+"   ideal i1=a2,a+b,1;";
+"   mapall(R,i1,\"\");         // map from R to S: x->a2, y->a+b, z->1";
+"   names(S);";
+"   j_; print(M_); phi_;";
+"   copyring(S,\"x()\",\"T\");";
+"   mapall(R,maxideal(1));   // identity map from R to T";
+"   names(T);";
+"   j; print(M); phi;";
+"   kill R,S,T;";
+}
+///////////////////////////////////////////////////////////////////////////////
+
+proc maxcoef (f)
+USAGE:   maxcoef(f);  f  poly/ideal/vector/module/matrix
+RETURN:  maximal length of coefficient of f of type int (by counting the
+         length of the string of each coefficient)
+EXAMPLE: example maxcoef; shows an example
+{
+   int max,s,ii,jj; string t;
+   ideal i = ideal(matrix(f));
+   i = simplify(i,6);         //* delete 0's and keep first of equal elements
+   poly m = var(1); matrix C;
+   for (ii=2;ii<=nvars(basering);ii++) { m = m*var(ii); }
+   for (ii=1; ii<=size(i); ii++)
+   {
+      C = coef(i[ii],m);
+      for (jj=1; jj<=ncols(C); jj++)
+      {
+         t = string(C[2,jj]);  s = size(t);
+         if ( t[1] == "-" ) { s = s - 1; }
+         if ( s > max ) { max = s; }
+      }
+   }
+   return(max);
+}
+example
+{ "EXAMPLE:"; echo = 2;
+   ring r= 0,(x,y,z),ds;
+   poly g = 345x2-1234567890y+7/4z;
+   maxcoef(g);
+   ideal i = g,10/1234567890;
+   maxcoef(i);
+   // since i[2]=1/123456789
+}
+///////////////////////////////////////////////////////////////////////////////
+
+proc maxdeg (id)
+USAGE:   maxdeg(id);  id  poly/ideal/vector/module/matrix
+RETURN:  maximal degree/s of monomials of id independent of ring ordering
+         (maxdeg of each variable is 1)
+         of type int if id is of type poly, of type intmat else
+EXAMPLE: example maxdeg; shows an example
+{
+//------------------- find maximal degree of given component ------------------
+   proc findmaxdeg
+   {
+      poly c = #[1];
+      if (c==0) { return(-1); }
+   //--- guess upper 'o' and lower 'u' bound, in case of negative weights -----
+      int d = (deg(c)>=0)*deg(c)-(deg(c)<0)*deg(c);
+      int i = d;
+      while ( c-jet(c,i) != 0 ) { i = 2*(i+1); }
+      int o = i-1;
+      int u = (d != i)*((i/ 2)-1);
+   //----------------------- "quick search" for maxdeg ------------------------
+      while ( (c-jet(c,i)==0)*(c-jet(c,i-1)!=0) == 0)
+      {
+         i = (o+1+u)/ 2;
+         if (c-jet(c,i)!=0) { u = i+1; }
+         else { o = i-1; }
+      }
+      return(i);
+   }
+//------------------------------ main program ---------------------------------
+   matrix M = matrix(id);
+   int r,c = nrows(M), ncols(M); int i,j;
+   intmat m[r][c];
+   for (i=r; i>0; i--)
+   {
+      for (j=c; j>0; j--) { m[i,j] = findmaxdeg(M[i,j]); }
+   }
+   if( typeof(id)=="poly" ) { return(m[1,1]); }
+   return(m);
+}
+example
+{ "EXAMPLE:"; echo = 2;
+   ring r = 0,(x,y,z),wp(-1,-2,-3);
+   poly f = x+y2+z3;
+   deg(f);               //deg returns weighted degree (in case of 1 block)!
+   maxdeg(f);
+   matrix m[2][2]=f+x10,1,0,f^2;
+   maxdeg(m);
+}
+///////////////////////////////////////////////////////////////////////////////
+
+proc mindeg (id)
+USAGE:   mindeg(id);  id  poly/ideal/vector/module/matrix
+RETURN:  minimal degree/s of monomials of id independent of ring ordering
+         (mindeg of each variable is 1)
+         of type int if id is of type poly, of type intmat else
+EXAMPLE: example mindeg; shows an example
+{
+//------------------- find minimal degree of given component ------------------
+   proc findmindeg
+   {
+      poly c = #[1];
+      if (c==0) { return(-1); }
+   //--- guess upper 'o' and lower 'u' bound, in case of negative weights -----
+      int d = (ord(c)>=0)*ord(c)-(ord(c)<0)*ord(c);
+      int i = d;
+      while ( jet(c,i) == 0 ) { i = 2*(i+1); }
+      int o = i-1;
+      int u = (d != i)*((i/ 2)-1);
+//----------------------- "quick search" for mindeg --------------------------
+      while ( (jet(c,u)==0)*(jet(c,o)!=0) )
+      {
+         i = (o+u)/ 2;
+         if (jet(c,i)==0) { u = i+1; }
+         else { o = i-1; }
+      }
+      if (jet(c,u)!=0) { return(u); }
+      else { return(o+1); }
+   }
+//------------------------------ main program ---------------------------------
+   matrix M = matrix(id);
+   int r,c = nrows(M), ncols(M); int i,j;
+   intmat m[r][c];
+   for (i=r; i>0; i--)
+   {
+      for (j=c; j>0; j--) { m[i,j] = findmindeg(M[i,j]); }
+   }
+   if (typeof(id)=="poly") { return(m[1,1]); }
+   return(m);
+}
+example
+{ "EXAMPLE:"; echo = 2;
+   ring r = 0,(x,y,z),ls;
+   poly f = x5+y2+z3;
+   ord(f);                // ord returns weighted order of leading term!
+   mindeg(f);
+   matrix m[2][2]=x10,1,0,f^2;
+   mindeg(m);
+}
+///////////////////////////////////////////////////////////////////////////////
+
+proc normalize (id)
+USAGE:   normalize(id);  id=poly/vector/ideal/module
+RETURN:  object of same type with leading coefficient equal to 1
+EXAMPLE: example normalize; shows an example
+{
+   return(simplify(id,1));
+}
+example
+{  "EXAMPLE:"; echo = 2;
+   ring r = 0,(x,y,z),ls;
+   poly f = 2x5+3y2+4z3;
+   normalize(f);
+   module m=[9xy,0,3z3],[4z,6y,2x];
+   show(normalize(m));
+   ring s = 0,(x,y,z),(c,ls);
+   module m=[9xy,0,3z3],[4z,6y,2x];
+   show(normalize(m));
+   normalize(matrix(m));  // by automatic type conversion to module!
+}
+///////////////////////////////////////////////////////////////////////////////
+
+proc primes (int n, int m)
+USAGE:   primes(n,m);  n,m integers
+RETURN:  intvec, consisting of all primes p, prime(n)<=p<=m, in increasing
+         order if n<=m, resp. prime(m)<=p<=n, in decreasing order if m<n
+NOTE:    prime(n); returns the biggest prime number <= n (if n>=2, else 2)
+EXAMPLE: example primes; shows an example
+{  int change;
+   if ( n>m ) { change=n; n=m ; m=change; change=1; }
+   int q,p = prime(m),prime(n); intvec v = q; q = q-1;
+   while ( q>=p ) { q = prime(q); v = q,v; q = q-1; }
+   if ( change==1 ) { v = v[size(v)..1]; }
+   return(v);
+}
+example
+{  "EXAMPLE:"; echo = 2;
+   primes(50,100);
+   intvec v = primes(37,1); v;
+}
+///////////////////////////////////////////////////////////////////////////////
+
+proc product (id, list #)
+USAGE:    product(id[,v]); id=ideal/vector/module/matrix
+          resp.id=intvec/intmat, v=intvec (e.g. v=1..n, n=integer)
+RETURN:   poly resp. int which is the product of all entries of id, with index
+          given by v (default: v=1..number of entries of id)
+NOTE:     id is treated as a list of polys resp. integers. A module m is
+          identified with corresponding matrix M (columns of M generate m)
+EXAMPLE:  example product; shows an example
+{
+   int n,j;
+   if( typeof(id)=="poly" or typeof(id)=="ideal" or typeof(id)=="vector"
+       or typeof(id)=="module" or typeof(id)=="matrix" )
+   {
+      ideal i = ideal(matrix(id));
+      if( size(#)!=0 ) { i = i[#[1]]; }
+      n = ncols(i); poly f=1;
+   }
+   if( typeof(id)=="int" or typeof(id)=="intvec" or typeof(id)=="intmat" )
+   {
+      intmat S = intmat(id);
+      intvec i = S[1..nrows(S),1..ncols(S)];
+      if( size(#)!=0 ) { i = i[#[1]]; }
+      n = size(i); int f=1;
+   }
+   for( j=1; j<=n; j++ ) { f=f*i[j]; }
+   return(f);
+}
+example
+{  "EXAMPLE:"; echo = 2;
+   ring r= 0,(x,y,z),dp;
+   ideal m = maxideal(1);
+   product(m);
+   matrix M[2][3] = 1,x,2,y,3,z;
+   product(M);
+   intvec v=2,4,6;
+   product(M,v);
+   intvec iv = 1,2,3,4,5,6,7,8,9;
+   v=1..5,7,9;
+   product(iv,v);
+   intmat A[2][3] = 1,1,1,2,2,2;
+   product(A,3..5);
+}
+///////////////////////////////////////////////////////////////////////////////
+
+proc ringsum (list #)
+USAGE:   ringsum(r1,r2,...,s); r1,r2,... rings, s string (name of result ring)
+CREATE:  A new base ring with name equal to s if r1,r2,... are existing rings.
+         If, say, s = "R" and the rings r1,r2,... exist, the new ring will
+         have name R, variables from all rings r1,r2,... and as monomial
+         ordering the block (product) ordering of r1,r2,.... Mathematically, R
+         is the tensor product of the rings r1,r2,... with ordering matrix
+         equal to the direct sum of the ordering matrices of r1,r2,...
+RETURN:  no return value
+NOTE:    The characteristic of the new ring will be that of r1. The names of
+         variables in the rings r1,r2,... should differ (if a name, say x,
+         occurs in r1 and r2, then, in the new ring r, x always refers to the
+         variable with name x in r1, there is no access to x in r2).
+         The procedure works also for quotient rings.
+EXAMPLE: example ringsum; shows an example
+{
+   int ii,q;
+   int n = size(#);
+   string vars,order,oi,s;
+   for(ii=1; ii<=n-1; ii++)
+   {
+      if( ordstr(#[ii])[1]=="C" or ordstr(#[ii])[1]=="c" )
+           { oi=ordstr(#[ii])[3,size(ordstr(#[ii]))-2]; }
+      else { oi=ordstr(#[ii])[1,size(ordstr(#[ii]))-2]; }
+      vars = vars+varstr(#[ii])+",";
+      order= order+oi+",";
+      def r(ii)=#[ii];
+      setring r(ii);
+      ideal i(ii)=ideal(r(ii));
+      int q(ii)=size(i(ii));
+      q=q+q(ii);
+   }
+   if( q!=0 ) { s = "newr"; }
+   else {  s = #[size(#)]; }
+   string newring ="=("+charstr(#[1])+"),("+vars[1,size(vars)-1]+"),("
+                  +order[1,size(order)-1]+");";
+   execute("ring "+s+newring);
+   if( q!=0 )
+   {
+      ideal i;
+      for(ii=1; ii<=n-1; ii++)
+      {
+         if( q(ii)!=0 )
+         {
+            map phi = r(ii),maxideal(1);
+            i = i+phi(i(ii));
+            kill phi;
+         }
+      }
+      i=std(i);
+      execute("qring "+#[size(#)]+"=i;");
+   }
+   export(`#[size(#)]`);
+   keepring(`#[size(#)]`);
+   return();
+}
+example
+{ "EXAMPLE:"; echo = 2;
+   ring r=0,(x,y,u,v),dp;
+   ring s=32003,(a,b,c),wp(1,2,3);
+   ring t=37,x(1..5),(c,ls);
+   ringsum(r,s,t,"R");
+   type R;
+   setring s;
+   ideal i = a2+b3+c5; i=std(i);
+   qring qs =i;
+   setring s; qring qt=i;
+   ringsum(r,qs,t,qt,"Q");
+   type Q;
+   kill R,Q;
+}
+///////////////////////////////////////////////////////////////////////////////
+
+proc ringweights (r)
+USAGE:   ringweights(r); r ring
+RETURN:  intvec of weights of ring variables. If, say, x(1),...,x(n) are the
+         variables of the ring r, in this order, the resulting intvec is
+         deg(x(1)),...,deg(x(n)) where deg denotes the weighted degree if
+         the monomial ordering of r has only one block of type ws,Ws,wp or Wp.
+NOTE:    In all other cases, in particular if there is more than one block,
+         the resulting intvec is 1,...,1
+EXAMPLE: example ringweights; shows an example
+{
+   int i; intvec v; setring r;
+   for (i=1; i<=nvars(basering); i++) { v[i] = deg(var(i)); }
+   return(v);
+}
+example
+{ "EXAMPLE:"; echo = 2;
+   ring r1=32003,(x,y,z),wp(1,2,3);
+   ring r2=32003,(x,y,z),Ws(1,2,3);
+   ring r=0,(x,y,u,v),lp;
+   intvec vr=ringweights(r1); vr;
+   ringweights(r2);
+   ringweights(r);
+}
+///////////////////////////////////////////////////////////////////////////////
+
+proc sort
+USAGE:    sort(id); id ideal or module
+RETURN:   ideal with generators of id sorted with respect to monomial ordering
+          of the basering (generators with smaller leading term come first)
+EXAMPLE:  example sort; shows an example
+{
+  intvec v = sortvec(#[1]);
+  int s    = size(v);
+  def m    = #[1];
+  for (int jj=1;jj<=s;jj++) { m[jj] = #[1][v[jj]]; }
+  return(m);
+}
+example
+{  "EXAMPLE:"; echo = 2;
+   ring r0 = 0,(x,y,z),lp;
+   ideal i = x3,y3,z3,x2z,x2y,y2z,y2x,z2y,z2x,xyz;
+   sort(i);
+   ring r1  = 0,t,ls;
+   ideal i = t47,t14,t6;
+   ideal j = i;
+   int ii;
+   for (ii=1;ii<=8;ii=ii+1) { j=simplify(jet(j+i^ii,50),6); }
+   print (matrix(j));
+   print (matrix(sort(j)));
+}
+///////////////////////////////////////////////////////////////////////////////
+
+proc sum (id, list #)
+USAGE:    sum(id[,v]); id=ideal/vector/module/matrix resp. id=intvec/intmat,
+                       v=intvec (e.g. v=1..n, n=integer)
+RETURN:   poly resp. int which is the sum of all entries of id, with index
+          given by v (default: v=1..number of entries of id)
+NOTE:     id is treated as a list of polys resp. integers. A module m is
+          identified with corresponding matrix M (columns of M generate m)
+EXAMPLE:  example sum; shows an example
+{
+   if( typeof(id)=="poly" or typeof(id)=="ideal" or typeof(id)=="vector"
+       or typeof(id)=="module" or typeof(id)=="matrix" )
+   {
+      ideal i = ideal(matrix(id));
+      if( size(#)!=0 ) { i = i[#[1]]; }
+      matrix Z = matrix(i);
+      intvec v; v[ncols(Z)]=0; v=v+1;
+   }
+   if( typeof(id)=="int" or typeof(id)=="intvec" or typeof(id)=="intmat" )
+   {
+      intmat S = intmat(id);
+      intvec v = S[1..nrows(S),1..ncols(S)];
+      if( size(#)!=0 ) { v = v[#[1]]; }
+      intvec z; z[size(v)]=0; z=z+1;
+      intmat Z=transpose(z);
+   }
+   return((Z*v)[1,1]);
+}
+example
+{  "EXAMPLE:"; echo = 2;
+   ring r= 0,(x,y,z),dp;
+   vector pv = [xy,xz,yz,x2,y2,z2];
+   sum(pv);
+   sum(pv,2..5);
+   matrix M[2][3] = 1,x,2,y,3,z;
+   sum(M);
+   intvec v=2,4,6;
+   sum(M,v);
+   intvec iv = 1,2,3,4,5,6,7,8,9;
+   v=1..5,7,9;
+   sum(iv,v);
+   intmat m[2][3] = 1,1,1,2,2,2;
+   sum(m,3..4);
+}
+///////////////////////////////////////////////////////////////////////////////
Index: Tst/Old/lib2
===================================================================
--- Tst/Old/lib2	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/lib2	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,36 @@
+//===========================================================================//
+// LIBRARY:  lib2           procedures for elimination and saturation        //
+//           type lib2();   to list the procedures                           //
+//                          7/94 GMG+BM                                      //
+// version for the regression test
+//===========================================================================//
+///////////////////////////////////////////////////////////////////////////////
+
+proc sat (ideal i,ideal j)
+USAGE:   sat(<i>,<j>);  i,j ideals
+RETURNS: ideal, union_(k=1...) of i:j^k
+{
+  ideal @i;
+  int @ii;
+  while ( @ii<=size(@i))
+  {
+    @i=quotient(i,j);
+    for ( @ii=1; @ii <= size(@i); @ii=@ii+1)
+    {
+      if (NF(@i[@ii],i)!=0)
+        break;
+    }
+    i=@i;
+  }
+  return (@i);
+}		
+example
+{  "EXAMPLE:";
+   " ring r=2,(x,y,z),dp;";            ring @r=2,(x,y,z),dp;
+   " poly F=x5+y5+(x-y)^2*xyz;";       poly @F=x5+y5+(x-y)^2*xyz;
+   " ideal j=jacob(F);";               ideal @j= jacob(@F);
+   " sat(j,maxideal(1));";             sat(@j,maxideal(1));
+   kill @r;
+}
+///////////////////////////////////////////////////////////////////////////////
+
Index: Tst/Old/libs.lst
===================================================================
--- Tst/Old/libs.lst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/libs.lst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,15 @@
+; KL-libs:
+lib0lib
+inoutlib
+elimlib
+matrixlb
+randomlb
+singlib
+homlib
+general
+polylib
+ringlib
+; BMA
+deformlb
+; HNoether
+lamm
Index: Tst/Old/lif.tst
===================================================================
--- Tst/Old/lif.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/lif.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,32 @@
+//
+// test script for lift command
+//
+pagelength = 10000;
+ring r1 = 32003,(x,y,z),(c,dp);
+r1;
+"-------------------------------";
+poly s1=y7+x3+xyz+z2;
+ideal i1=jacob(s1);
+ideal i2=std(i1);
+ideal i=3x2+yz,7y6+2x2y+5xz;
+i;
+i1;
+i2;
+s1;
+matrix T=lift(i2,i);
+T;
+matrix(i)-matrix(i2)*T;
+"-----------------------------";
+poly s2=x4+y3+z6+2xyz;
+ideal i3=jacob(s2);
+ideal i4=std(i3);
+s2;
+i3;
+i4;
+matrix T1=lift(i4,i);
+T1;
+matrix(i)-matrix(i4)*T1;
+"-------------------------------";
+listvar(all);
+kill r1;
+$;
Index: Tst/Old/liftstan.tst
===================================================================
--- Tst/Old/liftstan.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/liftstan.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,25 @@
+//
+// test script for liftstd command
+//
+pagelength = 10000;
+ring r1 = 32003,(x,y,z),(c,ls);
+r1;
+LIB "lib0";
+"-------------------------------";
+ideal i1=maxideal(3);
+ideal i2=x6,y4,z5,xy,yz,xz;
+i2;
+matrix m1[3][3]=x,y,z,xz,yx,12zx,0,y2,3xy2;
+pmat(m1);
+liftstd(i2,m1);
+"---------------------------------";
+vector v1=[x4,y2,xz2];
+vector v2=[y3,x8,2z4];
+module m=v1,v2;
+m;
+pmat(m1);
+liftstd(m,m1);
+"--------------------------------";
+listvar(all);
+kill r1;
+$;
Index: Tst/Old/liste.tst
===================================================================
--- Tst/Old/liste.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/liste.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,26 @@
+//
+// test script for listvar command
+//
+pagelength = 10000;
+ring r1=32003,(x,y,z),dp;
+r1;
+"-----------------------";
+poly s2=12x2+3y2;
+int i=34;
+ring r2=0,(x,y,z),ds;
+poly s1=x4+y2;
+ideal i1=x2,y2,z2;
+listvar();
+"--------------------------";
+listvar(r2);
+"--------------------------";
+listvar(ring);
+"----------------------------";
+listvar(poly);
+"----------------------------";
+listvar(i1); 
+"--------------------------";
+listvar(all);
+kill r1,r2;
+$;
+
Index: Tst/Old/lists.tst
===================================================================
--- Tst/Old/lists.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/lists.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,26 @@
+list l1=1,2,3;
+list l2="aa","bb",list();
+list l3=list(list(list()));
+l1;
+l2;
+l3;
+list l=l1,l2,l3,list();
+l;
+insert(l1,"-------",1);
+insert(l1,"-------",2);
+insert(l1,"-------",3);
+insert(l1,"-------",4);
+insert(l1,"-------",0);
+list L;
+list L1 = 1,2,3;
+L[1]= L1;
+L[1][2];  
+L[1][2] = 0;
+L[1][2];  
+L;
+L[1][1] = 0;
+L;
+L[1][1];
+L;
+$
+$
Index: Tst/Old/long.lst
===================================================================
--- Tst/Old/long.lst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/long.lst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,18 @@
+;all the time consuming things
+; bba
+alex2
+cyclic
+; tangent cone
+mora2
+; homog things
+;homtest
+; optimal weights
+weight2
+; res
+res2
+; memory and matrixop
+;matrix2
+; char0
+zahlen0
+; factory
+factor
Index: Tst/Old/longalg.tst
===================================================================
--- Tst/Old/longalg.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/longalg.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,222 @@
+ring r=(32003,a),x,dp;
+poly f=a;
+f;
+f;
+f+f;
+f=1;
+f;
+f-f;
+f=a;
+f+1-1;
+f=a^2+1;
+f;
+f;
+poly g=f;
+g;
+f=a2-a^2+3a4;
+f;
+r;
+minpoly=a^2+1;
+r;
+f;
+f=f+0;
+f;
+f=f+1-1;
+f;
+ring rr=(0,a),x,dp;
+poly f=a;
+f;
+f;
+f+f;
+f=1;
+f;
+f=a^2+1;
+f;
+f;
+poly g=f;
+g;
+f=a2-a^2+3a4;
+f;
+rr;
+minpoly=a^2-1;
+rr;
+f;
+f=f+0;
+f;
+f=f+1-1;
+f;
+kill rr;
+ring rr=(0,a,b),x,dp;
+poly f=a2b;
+f;
+f=b2a;
+f;
+f=a2b2-b2a2+a^2*b^2-a^2*b2;
+f;
+kill rr;
+ring r=(32003,a),x,dp;
+short=1;
+poly f=a;
+f;
+f;
+f+f;
+f=1;
+f;
+f-f;
+f=a;
+f+1-1;
+f=a^2+1;
+f;
+f;
+poly g=f;
+g;
+f=a2-a^2+3a4;
+f;
+r;
+minpoly=a^2-1;
+r;
+f;
+f=f+0;
+f;
+f=f+1-1;
+f;
+ring rr=(0,a),x,dp;
+short=1;
+poly f=a;
+f;
+f;
+f+f;
+f=1;
+f;
+f=a^2+1;
+f;
+f;
+poly g=f;
+g;
+f=a2-a^2+3a4;
+f;
+rr;
+minpoly=a^2-1;
+rr;
+f;
+f=f+0;
+f;
+f=f+1-1;
+f;
+kill rr;
+ring rr=(0,a,b),x,dp;
+short=1;
+poly f=a2b;
+f;
+f=b2a;
+f;
+f=a2b2-b2a2+a^2*b^2-a^2*b2;
+f;
+
+kill rr,r;
+//-----------------------------------------------------------
+ring s1=(0,a),(x,y,z,w),dp;
+ideal i0=(a2-1)*x2-z10-z20,(a+1)*xy3-z10-z30,y6-(a+1)*xy3w40;
+ideal i = std(i0);
+i;
+
+ring s2=(0,a),(x,y,z,w),dp;
+minpoly=8a4+1;
+ideal j0=(a2-1)*x2-z10-z20,(a+1)*xy3-z10-z30,y6-(a+1)*xy3w40;
+ideal j = std(j0);
+j;
+
+ring s3=(32003,a),(x,y,z,w),dp;
+ideal k0=(a2-1)*x2-z10-z20,(a+1)*xy3-z10-z30,y6-(a+1)*xy3w40;
+ideal k = std(k0);
+k;
+
+ring s4=(32003,a),(x,y,z,w),dp;
+minpoly=8a4+1;
+ideal l0=(a2-1)*x2-z10-z20,(a+1)*xy3-z10-z30,y6-(a+1)*xy3w40;
+ideal l = std(l0);
+l;
+
+kill s1,s2,s3,s4;
+
+ring r1=(0,a),(x,y,z),dp;
+minpoly=4a4+1;
+poly f0=3a2-3;
+poly g0=2a+2;
+poly h=4a4+3a3+2a2+a;
+poly f=f0*h;
+poly g=g0*h;
+poly f1=f/g;
+poly g1=g/f;
+f;
+g;
+f1;
+g1;
+(3/2*a-3/2)*(-8/15*a^3-8/15*a^2-8/15*a-8/15);
+newline;
+
+ring r2=(0,a),(x,y,z),dp;
+poly f0=3a2-3;
+poly g0=2a+2;
+poly h=4a4+3a3+2a2+a;
+poly f=f0*h;
+poly g=g0*h;
+poly f1=f/g;
+poly g1=g/f;
+f;
+g;
+f1;
+g1;
+g/(0*a);
+newline;
+
+ring r3=(32003,a),(x,y,z),dp;
+poly f0=3a2-3;
+poly g0=2a+2;
+poly h=4a4+3a3+2a2+a;
+poly f=f0*h;
+poly g=g0*h;
+poly f1=f/g;
+poly g1=g/f;
+f;
+g;
+f1;
+g1;
+newline;
+
+ring r4=(32003,a),(x,y,z),dp;
+minpoly=4a4+1;
+poly f0=3a2-3;
+poly g0=2a+2;
+poly h=4a4+3a3+2a2+a;
+poly f=f0*h;
+poly g=g0*h;
+poly f1=f/g;
+poly g1=g/f;
+f;
+g;
+f1;
+g1;
+(-16000*a+16000)*(2133*a^3+2133*a^2+2133*a+2133);
+newline;
+
+kill r1,r2,r3,r4;
+
+ring w2=(0,i),(u,v),dp;
+poly g=(i-1/3)^10;
+ring w1=(0,i),(x,y),dp;
+minpoly=i2+1;
+poly f=(i-1/3)^10;
+map q=w2,x,y;
+poly h=q(g);
+h=h*(1);
+f;
+h;
+h-f;
+poly f1=(6i+8)^10;
+poly f2=(6i-8)^10;
+f2*f1;
+newline;
+
+kill w2;
+$
Index: Tst/Old/lpowers.tst
===================================================================
--- Tst/Old/lpowers.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/lpowers.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,12 @@
+pagelength = -1;
+ring r = 0,L,lp;
+poly q;
+for (int i = 2; i<1000; i=i+50)
+{
+  i;
+  q = 2L^i;
+}
+2L^2000;
+2L^5000;
+2L^10000;
+$.
Index: Tst/Old/m100si.tst
===================================================================
--- Tst/Old/m100si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m100si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,3 @@
+  ring r=23,(x,a(1..7)),ls;
+  nvars(r);
+$
Index: Tst/Old/m101si.tst
===================================================================
--- Tst/Old/m101si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m101si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,9 @@
+  ring r=7,(x,y),wp(2,3);
+  poly f=x2+y3;
+  ord(f);
+  ring R=7,(x,y),ws(2,3);
+  poly f=x2+y3;
+  ord(f);
+  vector v=[x2,y];
+  ord(v);
+$
Index: Tst/Old/m102si.tst
===================================================================
--- Tst/Old/m102si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m102si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,3 @@
+  ring r=7,(x,y),wp(2,3);
+  ordstr(r);
+$
Index: Tst/Old/m103si.tst
===================================================================
--- Tst/Old/m103si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m103si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,3 @@
+  ring r=(0,a,b,c),(x,y,z),dp;
+  par(2);
+$
Index: Tst/Old/m104si.tst
===================================================================
--- Tst/Old/m104si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m104si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,3 @@
+  ring r=(0,a,b,c),(x,y,z),dp;
+  pardeg(a^2*b);
+$
Index: Tst/Old/m105si.tst
===================================================================
--- Tst/Old/m105si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m105si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,5 @@
+  ring r=(7,a,b,c),(x,y),wp(2,3);
+  parstr(r);
+  parstr(2);
+  parstr(r,3);
+$
Index: Tst/Old/m106si.tst
===================================================================
--- Tst/Old/m106si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m106si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,9 @@
+  ring r1=32003,(x,y,z,w),lp;
+  ring r=32003,(x,y,z),dp;
+  ideal i=x,y,z;
+  ideal i1=x,y;
+  map f=r1,i;
+  setring r1;
+  ideal i1=preimage(r,f,i1);
+  i1;
+$
Index: Tst/Old/m107si.tst
===================================================================
--- Tst/Old/m107si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m107si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,3 @@
+  prime(32004);
+  prime(-1);
+$
Index: Tst/Old/m108si.tst
===================================================================
--- Tst/Old/m108si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m108si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,5 @@
+  ring r=0,(x,y,z),dp;
+  module m=gen(1),gen(3),[x,y,0,z],[x+y,0,0,0,1];
+  print(m);
+  print(prune(m));
+$
Index: Tst/Old/m109si.tst
===================================================================
--- Tst/Old/m109si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m109si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,4 @@
+  ring h1=32003,(t,x,y,z),dp;
+  ideal i=x4+y3+z2;
+  qhweight(i);
+$
Index: Tst/Old/m10ex.tst
===================================================================
--- Tst/Old/m10ex.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m10ex.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,29 @@
+  LIB "homolog.lib";
+  ring R=0,(x,y),ds;
+  ideal i=x2-y3;
+  qring q = std(i);          // defines the quotient ring Loc_k[x,y]/(x2-y3)
+  ideal m = maxideal(1);
+  module T1K = Ext(1,m,m);   // computes Ext^1(R/m,R/m)
+  print(T1K);
+  printlevel=2;              // gives more explanation
+  module T2K=Ext(2,m,m);     // computes Ext^2(R/m,R/m)
+  print(std(T2K));
+  printlevel=0;
+  module E = Ext(1,syz(m),syz(m));
+  print(std(E));               
+  //We see from the matrices that T2K and E are isomorphic
+  //as it should be; but both are differently presented
+  //-------------------------------------------
+  ring R=0,(x,y,z),dp;
+  ideal  i = x2y,y2z,z3x;
+  module E = Ext_R(2,i);
+  print(E);
+  // if a 3-rd argument is given (of any type)
+  // a list of Ext^k(R/i,R), a SB of Ext^k(R/i,R) and a vector space basis
+  // is returned:
+  list LE = Ext_R(3,i,"");
+  LE;
+  print(LE[2]);
+  print(kbase(LE[2]));
+  killall();
+$
Index: Tst/Old/m10si.tst
===================================================================
--- Tst/Old/m10si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m10si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,10 @@
+  string s="Hi";
+  string s1="a string with new line at the end"+newline;
+  string s2="another string with new line at the end
+  ";
+  s;s1;s2;
+  ring r; ideal i=std(ideal(x,y^3));
+  "dimension of i =",dim(i),", multiplicity of i =",mult(i);
+  "dimension of i = "+string(dim(i))+", multiplicity of i = "+string(mult(i));
+  "a"+"b","c";
+$
Index: Tst/Old/m110si.tst
===================================================================
--- Tst/Old/m110si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m110si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,7 @@
+ring r=181,(x,y,z),(c,ls);
+ideal id1=maxideal(3);
+ideal id2=x2+xyz,y2-z3y,z3+y5xz;
+ideal id6=quotient(id1,id2);
+id6;
+quotient(id2,id1);
+$
Index: Tst/Old/m111si.tst
===================================================================
--- Tst/Old/m111si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m111si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,3 @@
+  random(1,1000);
+  random(1,2,3);
+$
Index: Tst/Old/m112si.tst
===================================================================
--- Tst/Old/m112si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m112si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,12 @@
+  ring r=32003,(x,y,z),dp;
+  ideal i=x+y,z3+22y;
+  // write the ideal i to the file save_i
+  write(":w save_i",i);
+  // @dots{}
+  ring r0=0,(x,y,z),Dp;
+  // create an ideal k equal to the content
+  // of the file save_i
+  string s="ideal k="+read("save_i")+";";
+  execute s;
+  k;
+$
Index: Tst/Old/m113si.tst
===================================================================
--- Tst/Old/m113si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m113si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,9 @@
+  ring r1 = 0,(z,y,x),ds;
+  poly s1=2x5y+7x2y4+3x2yz3;
+  poly s2=1x2y2z2+3z8;
+  poly s3=4xy5+2x2y2z3+11x10;
+  ideal i=s1,s2,s3;
+  ideal j=std(i);
+  reduce(3z3yx2+7y4x2+yx5+z12y2x2,j);
+  reduce(3z3yx2+7y4x2+yx5+z12y2x2,j,1);
+$
Index: Tst/Old/m114si.tst
===================================================================
--- Tst/Old/m114si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m114si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,6 @@
+  ring rh3=32003,(w,x,y,z),(dp,C);
+  poly f= x11+y10+z9+x5*y2+x2*y2*z3+x*y^3*(y2+x)^2;
+  ideal j= homog(jacob(f),w);
+  list jj=res(j,0);
+  regularity(jj);
+$
Index: Tst/Old/m115si.tst
===================================================================
--- Tst/Old/m115si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m115si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,6 @@
+  ring r  = 31991,(t,x,y,z,w),ls;
+  ideal M = t2x2+tx2y+x2yz,t2y2+ty2z+y2zw,
+            t2z2+tz2w+xz2w,t2w2+txw2+xyw2;
+  list L  = res(M,0);
+  size(L);
+$
Index: Tst/Old/m116si.tst
===================================================================
--- Tst/Old/m116si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m116si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,3 @@
+  reservedName("ring");
+  reservedName("xyz");
+$
Index: Tst/Old/m117si.tst
===================================================================
--- Tst/Old/m117si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m117si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,5 @@
+  ring r=32003,(x,y,z),dp;
+  poly f=3*(x+2)^3+y;
+  poly g=x+y+z;
+  resultant(f,g,x);
+$
Index: Tst/Old/m118si.tst
===================================================================
--- Tst/Old/m118si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m118si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,7 @@
+  ring r=29,(x,y,z),lp;
+  rvar(x);
+  rvar(r);
+  rvar(y);
+  rvar(var(3));
+  rvar("x");
+$
Index: Tst/Old/m119si.tst
===================================================================
--- Tst/Old/m119si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m119si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,8 @@
+  ring r=0,(x,y,z),(c,dp);
+  simplify(2x,1);
+  simplify([4x,2y],1);
+  ideal i=x,0,2y,0,3z;
+  simplify(i,1+2);
+  matrix A[2][3]=x,0,2x,y,0,2y;
+  simplify(A,2+8); // by automatic conversion to module
+$
Index: Tst/Old/m11ex.tst
===================================================================
--- Tst/Old/m11ex.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m11ex.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,73 @@
+  LIB "elim.lib";
+  LIB "sing.lib";
+  // Affine polar curve:
+  ring R = 0,(x,z,t),dp;              // global ordering dp
+  poly f = z5+xz3+x2-tz6;
+  dim_slocus(f);                      // dimension of singular locus
+  ideal j = diff(f,x),diff(f,z);
+  dim(std(j));                        // dim V(j)
+  dim(std(j+ideal(f)));               // V(j,f) also 1-dimensional
+  // j defines a curve, but to get the polar curve we must remove the
+  // branches contained in f=0 (they exist since dim V(j,f) = 1). This
+  // gives the polar curve set theoretically. But for the structure we
+  // may take either j:f or j:f^k for k sufficiently large. The first is
+  // just the ideal quotient, the second the iterated ideal quotient
+  // or saturation. In our case both is the same.
+  ideal q = quotient(j,ideal(f));     // ideal quotient
+  ideal qsat = sat(j,f)[1];           // saturation, proc from elim.lib
+  ideal sq = std(q);
+  dim(sq);
+  // 1-dimensional, hence
+  // q defines the affine polar curve
+  //
+  // to check that q and qsat are the same, we show both inclusions, i.e.
+  // both reductions must give the 0-ideal
+  size(reduce(qsat,sq));
+  size(reduce(q,std(qsat)));
+  qsat;
+  // We see that the affine polar curve does not pass through the origin,
+  // hence we expect the local polar "curve" to be empty
+  // ------------------------------------------------
+  // Local polar curve:
+  ring r = 0,(x,z,t),ds;              // local ordering ds
+  poly f = z5+xz3+x2-tz6;
+  dim_slocus(f);                      // dimension of singular locus
+  ideal j = diff(f,x),diff(f,z);
+  dim(std(j));                        // V(j) 1-dimensional
+  dim(std(j+ideal(f)));               // V(j,f) also 1-dimensional
+  ideal q = quotient(j,ideal(f));     // ideal quotient
+  q;
+  // The local polar "curve" is empty, i.e V(j) is contained in V(f)
+  // ------------------------------------------------
+  // Projective polar curve: (we need "sing.lib" and "elim.lib")
+  ring P = 0,(x,z,t,y),dp;            // global ordering dp
+  poly f = z5+xz3+x2-tz6;
+  f = z5y+xz3y2+x2y4-tz6;             // homogenize f with respect to y
+                                      // but consider t as parameter
+  dim_slocus(f);              // projective 1-dimensional singular locus
+  ideal j = diff(f,x),diff(f,z);
+  dim(std(j));                        // V(j), projective 1-dimensional
+  dim(std(j+ideal(f)));               // V(j,f) also projective 1-dimensional
+  ideal q = quotient(j,ideal(f));
+  ideal qsat = sat(j,f)[1];           // saturation, proc from elim.lib
+  dim(std(qsat));
+  // projective 1-dimensional, hence q and/or qsat define the projective
+  // polar curve. In this case, q and qsat are not the same, we needed
+  // 2 quotients.
+  // Let us check both reductions:
+  size(reduce(qsat,std(q)));
+  size(reduce(q,std(qsat)));
+  // Hence q is contained in qsat but not conversely
+  q;
+  qsat;
+  //
+  // Now consider again the affine polar curve,
+  // homogenize it with respect to y (deg t=0) and compare:
+  // affine polar curve:
+  ideal qa = 12zt+3z-10,5z2+12xt+3x,-144xt2-72xt-9x-50z;
+  // homogenized:
+  ideal qh = 12zt+3z-10y,5z2+12xyt+3xy,-144xt2-72xt-9x-50z;
+  size(reduce(qh,std(qsat)));
+  size(reduce(qsat,std(qh)));
+  // both ideals coincide
+$
Index: Tst/Old/m11si.tst
===================================================================
--- Tst/Old/m11si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m11si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,9 @@
+  string s="abcde";
+  s[2];
+  s[3,2];
+  ">>"+s[1,10]+"<<";
+  s[2]="BC"; s;
+  intvec v=1,3,5;
+  s=s[v]; s;
+  s="123456"; s=s[3..5]; s;
+$
Index: Tst/Old/m120si.tst
===================================================================
--- Tst/Old/m120si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m120si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,16 @@
+  string s="hello";
+  size(s);
+  intvec iv=1,2;
+  size(iv);
+  ring r=0,(x,y,z),lp;
+  poly f=x+y+z;
+  size(f);
+  vector v=[x+y,0,1];
+  size(v);
+  ideal i=f,y;
+  size(i);
+  module m=v,[0,1],[0,0,1],2*v;
+  size(m);
+  matrix mm[2][2];
+  size(mm);
+$
Index: Tst/Old/m121si.tst
===================================================================
--- Tst/Old/m121si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m121si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,4 @@
+  ring r=0,(x,y,z),dp;
+  ideal I=x,y,z,x3,xz;
+  sortvec(I);
+$
Index: Tst/Old/m122si.tst
===================================================================
--- Tst/Old/m122si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m122si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,7 @@
+  ring r  = 31991,(t,x,y,z,w),ls;
+  ideal M = t2x2+tx2y+x2yz,t2y2+ty2z+y2zw,
+            t2z2+tz2w+xz2w,t2w2+txw2+xyw2;
+  M       = std(M);
+  list L  = sres(M,0);
+  size(L);
+$
Index: Tst/Old/m123si.tst
===================================================================
--- Tst/Old/m123si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m123si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,6 @@
+  link l=":w example.txt";
+  status(l,"write");
+  open(l);
+  status(l,"write");
+  close(l);
+$
Index: Tst/Old/m124si.tst
===================================================================
--- Tst/Old/m124si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m124si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,8 @@
+  ring r = 32003, (x,y,z), ds;
+  poly s1  = 1x3y2 + 151x5y + 169x2y4 + 151x2yz3 + 186xy6 + 169y9;
+  poly s2  = 1x2y2z2 + 3z8;
+  poly s3  = 5x4y2 + 4xy5 + 2x2y2z3 + 1y7 + 11x10;
+  ideal i = s1, s2, s3;
+  // compute standard basis j
+  ideal j = std(i);
+$
Index: Tst/Old/m125si.tst
===================================================================
--- Tst/Old/m125si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m125si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,7 @@
+  ring r=0,(x,y,z),dp;
+  poly f=x2+y2+z2+x+y+z;
+  subst(f,x,3/2);
+  int a=1;
+  subst(f,y,a);
+  subst(f,y,z);
+$
Index: Tst/Old/m126si.tst
===================================================================
--- Tst/Old/m126si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m126si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,4 @@
+  ring R=0,(x,y),(c,dp);
+  ideal i=x,y;
+  syz(i);
+$
Index: Tst/Old/m127si.tst
===================================================================
--- Tst/Old/m127si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m127si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,5 @@
+  ring R=0,x,dp;
+  matrix m[2][3]=1,2,3,4,5,6;
+  print(m);
+  print(transpose(m));
+$
Index: Tst/Old/m128si.tst
===================================================================
--- Tst/Old/m128si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m128si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,4 @@
+  intmat m[2][2]=1,2,3,4;
+  print(m);
+  trace(m);
+$
Index: Tst/Old/m129si.tst
===================================================================
--- Tst/Old/m129si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m129si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,5 @@
+  int i = 9;
+  string s = typeof(i);
+  s;
+  typeof(s);
+$
Index: Tst/Old/m12ex.tst
===================================================================
--- Tst/Old/m12ex.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m12ex.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,29 @@
+  LIB "matrix.lib"; LIB "sing.lib";
+  int n = 4;
+  int m = 3;
+  int N = n*(n+1)/2;           // will become number of variables
+  ring R = 32003,x(1..N),dp;
+  matrix X = symmat(n);        // proc from matrix.lib
+                               // creates the symmetric generic nxn matrix
+  print(X);
+  ideal J = minor(X,m);
+  J=std(J);
+  // Kaehler differentials D_k(R)
+  // of R=k[x1..xn]/J:
+  module D = J*freemodule(N)+transpose(jacob(J));
+  ncols(D);
+  nrows(D);
+  //
+  // Note: D is a submodule with 110 generators of a free module
+  // of rank 10 over a polynomial ring in 10 variables.
+  // Compute a full resolution of D with sres.
+  // This takes about 17 sec on a Mac PB 520c and 2 sec an a HP 735
+  int time = timer;
+  module sD = std(D);
+  list Dres = sres(sD,0);                // the full resolution
+  timer-time;                            // time used for std + sres
+  intmat B = betti(Dres);
+  print(B,"betti");
+  N-ncols(B)+1;                          // the desired depth
+  killall();
+$
Index: Tst/Old/m12si.tst
===================================================================
--- Tst/Old/m12si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m12si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,7 @@
+  int j=1;
+  ring r;
+  int i=dim(std(ideal(x,y)));// dimension of factor ring defined by (x,y)
+                 // (i.e. R/(x,y)) if it is given by a standard basis
+  int compare = i<j;
+  compare;      // 0 (FALSE) if i >= j, 1 (TRUE) if i<j
+$
Index: Tst/Old/m130si.tst
===================================================================
--- Tst/Old/m130si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m130si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,3 @@
+  ring r=0,(x,y,z),dp;
+  var(2);
+$
Index: Tst/Old/m131si.tst
===================================================================
--- Tst/Old/m131si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m131si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,5 @@
+  ring r=0,(x,y,z),dp;
+  varstr(r);
+  varstr(r,1);
+  varstr(2);
+$
Index: Tst/Old/m132si.tst
===================================================================
--- Tst/Old/m132si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m132si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,5 @@
+  ring r=0,(x,y),ds;
+  ideal i=x2+y2,x2-y2;
+  ideal j=std(i);
+  vdim(j);
+$
Index: Tst/Old/m133si.tst
===================================================================
--- Tst/Old/m133si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m133si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,5 @@
+  ring r;
+  matrix m[2][3] = x,y,y,z,z,x;
+  print(m);
+  print(wedge(m,2));
+$
Index: Tst/Old/m134si.tst
===================================================================
--- Tst/Old/m134si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m134si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,11 @@
+  ring h1=32003,(t,x,y,z),dp;
+  ideal i=
+  9x8+y7t3z4+5x4y2t2+2xy2z3t2,
+  9y8+7xy6t+2x5y4t2+2x2yz3t2,
+  9z8+3x2y3z2t4;
+  intvec e=weight(i);
+  e;
+  ring r=32003,(a,b,c,d),wp(e);
+  map f=h1,a,b,c,d;
+  ideal i0=std(f(i));
+$
Index: Tst/Old/m135si.tst
===================================================================
--- Tst/Old/m135si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m135si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,4 @@
+  ring r=0,(x,y,z),dp;
+  ideal I=std(maxideal(2));
+  attrib(I);
+$
Index: Tst/Old/m136si.tst
===================================================================
--- Tst/Old/m136si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m136si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,7 @@
+  ring r=0,(x,y,z),dp;
+  ideal I=std(maxideal(2));
+  attrib(I,"isSB");
+  // although maxideal(2) is a standard basis,
+  // Singular does not know it:
+  attrib(maxideal(2), "isSB");
+$
Index: Tst/Old/m137si.tst
===================================================================
--- Tst/Old/m137si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m137si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,6 @@
+  ring r=0,(x,y,z),dp;
+  ideal I=std(maxideal(2));
+  vdim(I);
+  attrib(I,"isSB",0);  // the standard basis attribute is set to 0
+  vdim(I);
+$
Index: Tst/Old/m138si.tst
===================================================================
--- Tst/Old/m138si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m138si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,6 @@
+  int debug=0;
+  intvec i=1,2,3;
+  dbprint(debug,i);
+  debug=1;
+  dbprint(debug,i);
+$
Index: Tst/Old/m139si.tst
===================================================================
--- Tst/Old/m139si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m139si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,3 @@
+  int i=3;
+  dump("");
+$
Index: Tst/Old/m13ex.tst
===================================================================
--- Tst/Old/m13ex.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m13ex.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,16 @@
+  // The powers of 2:
+  int  n;
+  for (n = 2; n <= 128; n = n * 2)
+  {"n = " + string (n);}
+  // The powers of 2 in a nice format
+  int j;
+  string space = "";
+  for (n = 2; n <= 128; n = n * 2)
+  {
+    space = "";
+    for (j = 1; j <= 5 - size (string (n)); j = j+1)
+    { space = space + " "; }
+    "n =" + space + string (n);
+  }
+  kill n,j;
+$
Index: Tst/Old/m13si.tst
===================================================================
--- Tst/Old/m13si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m13si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,11 @@
+  ring r=0,x,dp;
+  // using the type cast number for a greater allowed range
+  number(11)*13*17*100*200*2000*503*1111*222222;
+  // Note: 11*13*17*100*200*2000*503*1111*222222
+  // would return a machine integer:
+  11*13*17*100*200*2000*503*1111*222222;
+  int i;
+  i+2;
+  intvec v=i..i+3;
+  v;
+$
Index: Tst/Old/m140si.tst
===================================================================
--- Tst/Old/m140si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m140si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,9 @@
+  ring r=32003,(x,y,z),dp;
+  ideal i=x+y,z3+22y;
+  write(">save_i",i);
+  ring r0=0,(x,y,z),Dp;
+  string s="ideal k="+read("save_i")+";";
+  s;
+  execute s; // define the ideal k
+  k;
+$
Index: Tst/Old/m141si.tst
===================================================================
--- Tst/Old/m141si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m141si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,6 @@
+  int i=3;
+  dump(":w example.txt");
+  kill i;
+  getdump("example.txt");
+  i;
+$
Index: Tst/Old/m142si.tst
===================================================================
--- Tst/Old/m142si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m142si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,8 @@
+  int i=3;
+  ring r= 0,x,dp;
+  poly p;
+  listvar();
+  kill i,r;
+  i;
+  listvar();
+$
Index: Tst/Old/m143si.tst
===================================================================
--- Tst/Old/m143si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m143si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,7 @@
+  ring r= 32003,(x,y),lp;
+  ideal i=maxideal(1);
+  attrib(i,"isSB",1);
+  attrib(i);
+  killattrib(i,"isSB");
+  attrib(i);
+$
Index: Tst/Old/m144si.tst
===================================================================
--- Tst/Old/m144si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m144si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,7 @@
+  monitor("doe.tmp");
+  ring r;
+  poly f=x+y+z;
+  int i=7;
+  ideal I=f,x,y;
+  monitor("");
+$
Index: Tst/Old/m145si.tst
===================================================================
--- Tst/Old/m145si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m145si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,16 @@
+  option(prot);
+  option();
+  option(notSugar);
+  option();
+  option(noprot);
+  option();
+  option(none);
+  option();
+  ring r=0,x,dp;
+  degBound=22;
+  option();
+  intvec i=option(get);i;
+  option(none);
+  option(set,i);
+  option();
+$
Index: Tst/Old/m146si.tst
===================================================================
--- Tst/Old/m146si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m146si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,7 @@
+  ring r=0,(x,y,z),dp;
+  module m=[1,y],[0,x+z];
+  m;
+  print(m);  // the columns generate m
+  intmat M=betti(mres(m,0));
+  print(M,"betti");
+$
Index: Tst/Old/m147si.tst
===================================================================
--- Tst/Old/m147si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m147si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,4 @@
+  int i=3;
+  i;
+  type i;
+$
Index: Tst/Old/m148si.tst
===================================================================
--- Tst/Old/m148si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m148si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,5 @@
+  //(Q[i]/(i^2+1))[x,y,z]:
+  ring Cxyz=(0,i),(x,y,z),dp;
+  minpoly=i^2+1;
+  i2;
+$
Index: Tst/Old/m149si.tst
===================================================================
--- Tst/Old/m149si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m149si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,7 @@
+  ring R=32003,(x,y,z),ds;
+  ideal i=x2+y^12,y13;
+  std(i);
+  noether = x^11;
+  std(i);
+  noether = 0;//disables noether
+$
Index: Tst/Old/m14ex.tst
===================================================================
--- Tst/Old/m14ex.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m14ex.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,16 @@
+  ring r =32003,(a,b,c,d,e),lp;
+  ideal i=a+b+c+d, ab+bc+cd+ae+de, abc+bcd+abe+ade+cde,
+          abc+abce+abde+acde+bcde, abcde-1;
+  int t=timer;
+  ideal j1=stdfglm(i); 
+  timer-t;    
+  size(j1);   // size (no. of polys) in computed GB
+  t=timer;
+  ideal j2=stdhilbert(i);
+  timer-t;    
+  size(j2);   // size (no. of polys) in computed GB
+  // usual Groebner basis computation for lex ordering
+  t=timer;
+  ideal j0 =std(i); 
+  timer-t;    
+$
Index: Tst/Old/m14si.tst
===================================================================
--- Tst/Old/m14si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m14si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,4 @@
+  int i=1;
+  i++; i ; i--; i; // ++ and -- will not return a value as in C
+  i+2, 2-i, 5^2, 5 div 2, 8%3, 1<2, 2<=2;
+$
Index: Tst/Old/m150si.tst
===================================================================
--- Tst/Old/m150si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m150si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,5 @@
+  printlevel=0;
+  dbprint(1);
+  printlevel=voice;
+  dbprint(1);
+$
Index: Tst/Old/m151si.tst
===================================================================
--- Tst/Old/m151si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m151si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,8 @@
+  ring r=23,x,dp;
+  int save=short;
+  short = 1;
+  2x2,x2;
+  short = 0;
+  2x2,x2;
+  short=save;//resets short to the previous value
+$
Index: Tst/Old/m152si.tst
===================================================================
--- Tst/Old/m152si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m152si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,8 @@
+  timer = 1; // The time of each command is printed
+  int t=timer;
+  ring r=0,(x,y,z),dp;
+  poly p=(x+2y+3z+4xy+5xz+6yz)^20;
+  // timer as int_expression:
+  timer-t;  // returns the time used in sec
+            // since t was set to timer
+$
Index: Tst/Old/m153si.tst
===================================================================
--- Tst/Old/m153si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m153si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,4 @@
+  TRACE = 1;
+  LIB "general.lib";
+  sum(1..100);
+$
Index: Tst/Old/m154si.tst
===================================================================
--- Tst/Old/m154si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m154si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,2 @@
+  voice;
+$
Index: Tst/Old/m15ex.tst
===================================================================
--- Tst/Old/m15ex.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m15ex.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,25 @@
+  LIB "invar.lib";
+  int n=5;
+  int i;
+  ring s=32003,(x(1..n)),wp(1,2,3,4,5);
+  // definition of the vectorfield m=sum m[i,1]*d/dx(i)
+  matrix m[n][1];
+  for (i=1;i<=n-1;i=i+1)
+  {
+     m[i+1,1]=x(i);
+  }
+  // computation of the ring of invariants
+  ideal in=invariantRing(m,x(2),x(1));
+  in;   //invariant ring is generated by 5 invariants
+  kill n,i,s;
+  ring q=32003,(x,y,z,u,v,w),dp;
+  matrix m[6][1];
+  m[2,1]=x;
+  m[3,1]=y;
+  m[5,1]=u;
+  m[6,1]=v;
+  // the vectorfield is: xd/dy+yd/dz+ud/dv+vd/dw
+  ideal in=invariantRing(m,y,x);
+  in; //invariant ring is generated by 6 invariants
+  kill q;
+$
Index: Tst/Old/m15si.tst
===================================================================
--- Tst/Old/m15si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m15si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,6 @@
+  intvec iv=1,2,5,7;
+  iv;
+  iv[3];
+  iv[7]=1;
+  iv;
+$
Index: Tst/Old/m16ex.tst
===================================================================
--- Tst/Old/m16ex.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m16ex.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,24 @@
+  LIB "finvar.lib";
+  ring R=0,(x,y,z),dp;
+  matrix A[3][3]=0,1,0,-1,0,0,0,0,-1;
+  // the group G is generated by A in Gl(3,Q);
+  print(A);     
+  // the fourth power of A is 1:
+  print(A*A*A*A); // the fourth power of A is 1   
+  // Use the first method to compute the invariants of G:       
+  matrix B(1..3);
+  B(1..3)=invariant_ring(A);
+  // Singular returns 2 matrices, the first containing 
+  // primary invariants and the second secondary 
+  // invariants, i.e. module generators over a Noetherian
+  // normalization
+  // the third result are the irreducible secondary invariants
+  // if the Molien series was available
+  print(B(1));
+  print(B(2));
+  print(B(3));
+  // Use the second method,
+  // with using random numbers between -1 and 1:       
+  B(1..3)=invariant_ring_random(A,1);
+  print(B(1..3));
+$
Index: Tst/Old/m16si.tst
===================================================================
--- Tst/Old/m16si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m16si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,18 @@
+  intvec iv=1,3,5,7,8;
+  iv=iv,iv;           // concatenation
+  iv+1;               // add 1 to each entry
+  iv*2;
+  iv;
+  iv-10;
+  iv=iv,0;
+  iv;
+  iv/2;
+  iv+iv;              // componentwise addition
+  iv[size(iv)-1];     // last-1 entry
+  intvec iw=2,3,4,0;
+  iv==iw;             // comparision
+  intmat im[2][4];
+  im=2,3,4,0,1,0,0,0;
+  iv=im*iw;
+  iv;
+$
Index: Tst/Old/m17ex.tst
===================================================================
--- Tst/Old/m17ex.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m17ex.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,14 @@
+  ring r =0,(x,y),dp;
+  poly f = 9x16-18x13y2-9x12y3+9x10y4-18x11y2+36x8y4
+         +18x7y5-18x5y6+9x6y4-18x3y6-9x2y7+9y8;
+  // = 9 * (x5-1y2)^2 * (x6-2x3y2-1x2y3+y4)
+  factorize(f);
+  // returns factors and multiplicities, 
+  // first factor is a constant.
+  poly g = (y4+x8)*(x2+y2);
+  factorize(g);
+  // The same in charcteristic 2:
+  ring r =2,(x,y),dp;
+  poly g = (y4+x8)*(x2+y2);
+  factorize(g);
+$
Index: Tst/Old/m17si.tst
===================================================================
--- Tst/Old/m17si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m17si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,3 @@
+  intmat m[2][3]=1,2,3,4,5,6;
+  m;
+$
Index: Tst/Old/m18ex.tst
===================================================================
--- Tst/Old/m18ex.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m18ex.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,32 @@
+  LIB "hnoether.lib";
+  // ======== The irreducible case ========
+  ring s = 0,(x,y),ds;
+  poly f = y4-2x3y2-4x5y+x6-x7;
+  list hn = develop(f);
+  show(hn[1]);     // Hamburger-Noether matrix
+  displayHNE(hn);  // Hamburger-Noether developement 
+  setring s;
+  displayInvariants(hn);
+  // invariants(hn); will return the invariants as list
+  param(hn);       // partial parametrization of f
+                   // param takes the first variable as 
+                   // except the ring has >2 variables
+  ring extring=0,(x,y,t),ds;
+  poly f=x3+2xy2+y2;
+  list hn=develop(f,-1);
+  param(hn);       // partial parametrization of f
+  list hn1=develop(f,6);  
+  param(hn1);     // a better parametrization
+  // instead or recomputing you may extend the developement:
+  list hn2=extdevelop(hn,12);
+  param(hn2);     // a still better parametrization
+  // ======== The reducible case ========
+  ring r = 0,(x,y),dp;
+  poly f=x11-2y2x8-y3x7-y2x6+y4x5+2y4x3+y5x2-y6;
+  // = (x5-1y2) * (x6-2x3y2-1x2y3+y4)
+  list hn=reddevelop(f);
+  show(hn[1][1]);     // Hamburger-Noether matrix of 1st brach
+  displayInvariants(hn);
+  param(hn[2]);      // parametrization of 2nd branch
+  // extended parametrization of 1st
+$
Index: Tst/Old/m18si.tst
===================================================================
--- Tst/Old/m18si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m18si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,13 @@
+  intmat m[2][3]=1,0,2,4,5,1;
+  m+1;             // adds unit intmat to m
+  m[2,1];          // entry at 2,1
+  intmat m1[3][2]=1,0,2,4,0,1;
+  m1*10;           // multiply each entry with 10
+  m*m1;
+  m+transpose(m1);
+  intvec v1=1,2,4;
+  intvec v2=5,7,8;
+  m=v1,v2;         // overwrite M with v1 and v2
+  m;
+  trace(m);
+$
Index: Tst/Old/m19ex.tst
===================================================================
--- Tst/Old/m19ex.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m19ex.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,32 @@
+  LIB "primdec.lib";
+  ring r = 0,(x,y,z,t,w),dp; 
+  ideal i=
+     x2+2y2+2z2+2t2-x, 
+     2xy+2yz+2zt-y, 
+     y2+2xz+2yt-z, 
+     x+2y+2z+2t-1;
+  decomp(i);
+  // We consider now the ideal J of the base space of the 
+  // miniversal deformation of the cone over the rational
+  // normal curve computed in section *11* and compute 
+  // its primary decomposition.
+  ring R = 0,(A,B,C,D),dp;
+  ideal J = CD, BD+D2, AD;
+  decomp(J);
+  // We see that there are two components which are both
+  // prime, even linear subspaces, one 3-dimensional,
+  // the other 1-dimensional
+  // (This is Pinkhams example and was the first found 
+  // surface singularity with two components of 
+  // different dimensions)
+  //
+  // Let us now produce an embedded component in the last
+  // example, compute the minimal associated primes and
+  // the radical. We use the Characteristic set methods
+  // from prim_dec.lib.
+  J = intersect(J,maxideal(3));
+  primdecSY(J,1);    //shows that the maximal ideal is
+                    //embedded (takes a few seconds)
+  min_ass_prim_charsets(J,1);  
+  radical(J);
+$
Index: Tst/Old/m19si.tst
===================================================================
--- Tst/Old/m19si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m19si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,3 @@
+  ring r=32003,(x,y,z),dp;
+  poly f=x3+y5+z2;
+$
Index: Tst/Old/m1ex.tst
===================================================================
--- Tst/Old/m1ex.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m1ex.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,23 @@
+  option(prot);
+  ring r1 = 32003,(x,y,z),ds;
+  r1;
+  int a,b,c,t=11,5,3,0;
+  poly f = x^a+y^b+z^(3*c)+x^(c+2)*y^(c-1)+x^(c-1)*y^(c-1)*z3+
+           x^(c-2)*y^c*(y^2+t*x)^2;
+  f;
+  ideal i=jacob(f);
+  i;
+  ideal j=std(i);
+  "The Milnor number of f(11,5,3) for t=0 is", vdim(j);
+  j=i+f;    // overwrite j
+  j=std(j);
+  vdim(j);  // compute the Tjurina number for t=0
+  t=1;
+  f=x^a+y^b+z^(3*c)+x^(c+2)*y^(c-1)+x^(c-1)*y^(c-1)*z3
+    +x^(c-2)*y^c*(y^2+t*x)^2;
+  ideal i1=jacob(f);
+  ideal j1=std(i1);
+  "The Milnor number of f(11,5,3) for t=1:",vdim(j1);
+  vdim(std(j1+f));   // compute the Tjurina number for t=1
+  option(noprot);
+$
Index: Tst/Old/m1si.tst
===================================================================
--- Tst/Old/m1si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m1si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,6 @@
+  int i=3;
+  typeof(i); // type
+  nameof(i); // name
+  i;         // value
+  attrib(i); //attributes
+$
Index: Tst/Old/m1st.tst
===================================================================
--- Tst/Old/m1st.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m1st.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,10 @@
+  ring r;
+  ideal i=x2+y3,y3+z4,y5+z2;
+  std(i);
+  ideal k=_;
+  k;
+  ideal kk=_+_*x;
+  kk;
+  LIB "general.lib";
+  write("", which("Singular"));;
+$
Index: Tst/Old/m20si.tst
===================================================================
--- Tst/Old/m20si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m20si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,6 @@
+  ring R=0,(x,y),dp;
+  x+y;
+  x<=y;
+  (x+y+x^2)[2]; // the 2nd biggest monomial
+  (x+y)/x;
+$
Index: Tst/Old/m21si.tst
===================================================================
--- Tst/Old/m21si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m21si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,9 @@
+  ring r0=32003,x,dp;
+  number n=2/3; n;
+  ring r1=0,x,dp;
+  number n=2/3; n;
+  ring r2=(0,a),(x,y,z),dp;
+  number n=2/3; n;
+  n=a+a^2;
+  poly f=n*x+2;f;
+$
Index: Tst/Old/m22si.tst
===================================================================
--- Tst/Old/m22si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m22si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,8 @@
+  // ordering gives priority to components:
+  ring rr=0,(x,y,z),(c,dp);
+  vector v=[x2+y3,2,0,x*y]+gen(6)*x6;
+  v;
+  vector w=[z3-x,3y];
+  v-w;
+  v*(z+x);
+$
Index: Tst/Old/m23si.tst
===================================================================
--- Tst/Old/m23si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m23si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,4 @@
+  ring R=0,(x,y),(c,dp);
+  [x,y]-[1,x];
+  [1,2,x,4][3];
+$
Index: Tst/Old/m24si.tst
===================================================================
--- Tst/Old/m24si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m24si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,22 @@
+  ring r=32003,(x,y,z),dp;
+  link l=":w example.txt";     // type is Ascii, mode is overwrite
+  l;
+  status(l, "name");           // name is example.txt
+  status(l, "open", "yes");    // link is not yet opened
+  ideal i=maxideal(2);
+  write (l,1,";",2,";","ideal i=",i,";");
+  status(l, "open", "yes");    // now link is open
+  status(l, "mode");           // for writing 
+  write("example.txt","int j=5;");// data is appended to file
+  read("example.txt");         // data is returned as string
+  close(l);                    // link is closed
+  execute read(l);             // read string is executed
+  status(l, "open", "yes");    // now link is open
+  status(l, "mode");           // in read mode
+  close(l);                    // link is closed
+  // dump vars overwriting previous file content:
+  dump(":w example.txt");
+  kill r;
+  getdump("example.txt");      // get dump from file
+  dump("");                    // dump to stdout
+$
Index: Tst/Old/m25si.tst
===================================================================
--- Tst/Old/m25si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m25si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,23 @@
+  ring r;
+  link l="MPfile:w example.mp"; // type=MPfile, mode=overwrite
+  l;
+  status(l, "name"); // name is example.mp; link is not yet opened
+  ideal i=maxideal(2);
+  write (l,1, i, "hello world");// write three expressions
+  status(l, "open", "yes");     // now link is open
+  status(l, "mode");            // in write mode
+  write(l,4);                   // append one more expression
+  close(l);                     // link is closed
+  read(l);                      // only first expression is read
+  status(l, "open", "yes");     // now link is open
+  status(l, "mode");            // for reading
+  kill r;
+  def i = read(l);              // second expression
+  listvar();                    // notice that current ring was set
+  def s = read(l);              // third expression
+  close(l);                     // link is closed
+  dump("MPfile:w example.mp");  // dump everything to example.mp
+  kill basering, s; listvar();  // kill all vars
+  getdump("MPfile: example.mp");// get dump from file
+  dump("");                     // dump to stdout
+$
Index: Tst/Old/m27si.tst
===================================================================
--- Tst/Old/m27si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m27si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,23 @@
+  // create an empty date base:
+  system("sh","rm -f example.dir example.pag");
+  system("sh","touch example.dir example.pag");
+  link dbmLink="DBM:rw example";
+  write(dbmLink,"1","abc");
+  write(dbmLink,"3","XYZ");
+  write(dbmLink,"2","ABCc");
+  dbmLink;
+  close(dbmLink);
+  // read all keys (till empty string):
+  read(dbmLink);
+  read(dbmLink);
+  read(dbmLink);
+  read(dbmLink);
+  // read data corresponding to key "1"
+  read(dbmLink,"1");
+  // read all data:
+  read(dbmLink,read(dbmLink));
+  read(dbmLink,read(dbmLink));
+  read(dbmLink,read(dbmLink));
+  // close
+  close(dbmLink);
+$
Index: Tst/Old/m28si.tst
===================================================================
--- Tst/Old/m28si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m28si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,10 @@
+  ring r;
+  poly f=x2-y3;
+  int i=37;
+  string s1="abc";
+  string s2="def";
+  string s=s1,s2; // typecast from expression list to string
+  s;
+  s1,s2;
+  f,i,s;
+$
Index: Tst/Old/m29si.tst
===================================================================
--- Tst/Old/m29si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m29si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,10 @@
+  ring r=0,x,(c,dp);
+  number(3x);
+  number(poly(3));
+  ideal i=1,2,3,4,5,6;
+  print(matrix(i));
+  print(matrix(i,3,2));
+  vector v=[1,2];
+  print(matrix(v));
+  module(matrix(i,3,2));
+$
Index: Tst/Old/m2ex.tst
===================================================================
--- Tst/Old/m2ex.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m2ex.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,13 @@
+  ring r1 = 32003,(x,y,z),ds;
+  int a,b,c,t=11,5,3,0;
+  poly f = x^a+y^b+z^(3*c)+x^(c+2)*y^(c-1)+x^(c-1)*y^(c-1)*z3+
+           x^(c-2)*y^c*(y^2+t*x)^2;
+  option (prot);
+  timer=1;
+  ring r2 = 32003,(x,y,z),dp;
+  poly f=fetch(r1,f);
+  ideal j=jacob(f);
+  vdim(std(j));
+  vdim(std(j+f));
+  timer=0;  // reset timer
+$
Index: Tst/Old/m2si.tst
===================================================================
--- Tst/Old/m2si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m2si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,4 @@
+  int i=2; i;
+  type i;              // name [ level ] type value
+  print(i);
+$
Index: Tst/Old/m30si.tst
===================================================================
--- Tst/Old/m30si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m30si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,6 @@
+  int i=3;
+  i=i+1;        // overwriting
+  i;
+  int i=i+1;   // redefinition
+  i;
+$
Index: Tst/Old/m31si.tst
===================================================================
--- Tst/Old/m31si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m31si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,6 @@
+  int i = 42;
+  int j = i + 3; j;
+  i = i * 3 - j; i;
+  int k;   // assigning the default value 0 to k
+  k;
+$
Index: Tst/Old/m32si.tst
===================================================================
--- Tst/Old/m32si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m32si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,6 @@
+  string s1="Now I know";
+  string s2="how to encode a \" in a string...";
+  string s=s1+" "+s2; // concatenation of 3 strings
+  s;
+  s1,s2;   // 2 strings, separated by a blank in the output:
+$
Index: Tst/Old/m33si.tst
===================================================================
--- Tst/Old/m33si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m33si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,5 @@
+  intvec iv=1,3,5,7,8;
+  iv;
+  iv[4];
+  iv[3..size (iv)];
+$
Index: Tst/Old/m34si.tst
===================================================================
--- Tst/Old/m34si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m34si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,4 @@
+  intmat im[2][3]=1,3,5,7,8;
+  im;
+  im[2,2];
+$
Index: Tst/Old/m35si.tst
===================================================================
--- Tst/Old/m35si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m35si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,12 @@
+  ring r = 32003,(x,y,z),dp;
+  number n = 4/6;
+  n;
+  ring r0 = 0,x,dp;
+  number n = 4/6;
+  n;
+  ring R=real,x,dp;
+  number n=4/6;
+  n;
+  n=0.25e+2;
+  n;
+$
Index: Tst/Old/m36si.tst
===================================================================
--- Tst/Old/m36si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m36si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,12 @@
+  ring r=0,(x,y,z),dp;
+  poly s1 = x2;
+  poly s2 = y3;
+  poly s3 = z;
+  ideal i =  s1, s2-s1, s2*s3, s3^4;
+  i;
+  ideal j = i^2;
+  // generators i[k]*i[l], 1<=k<=l<=size(i);
+  ideal IJ = i*j;
+  // generators i[k]*j[l], 1<=k<=size(i), 1<=l<=size(j)
+  size(j), size(IJ);
+$
Index: Tst/Old/m37si.tst
===================================================================
--- Tst/Old/m37si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m37si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,8 @@
+  ring r=0,(x,y,z),(c,dp);
+  poly s1 = x2;
+  poly s2 = y3;
+  poly s3 = z;
+  vector v = [s1, s2-s1, s3-s1]+ s1*gen(5);
+  // v is a vector in the free module of rank 5
+  v;
+$
Index: Tst/Old/m38si.tst
===================================================================
--- Tst/Old/m38si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m38si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,9 @@
+  ring r=0,(x,y,z),(c,dp);
+  vector s1 = [x2,y3,z];
+  vector s2 = [xy,1,0];
+  vector s3 = [0,x2-y2,z];
+  poly   f  = xyz;
+  module m = s1, s2-s1,f*(s3-s1);
+  // show m in the matrix format (columns generate m)
+  print(m);
+$
Index: Tst/Old/m39si.tst
===================================================================
--- Tst/Old/m39si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m39si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,12 @@
+  int ro = 3;
+  ring r = 32003,(x,y,z),dp;
+  poly f=xyz;
+  poly g=z*f;
+  ideal i=f,g,g^2;
+  matrix m[ro][3] = 1x3y4, 0, i, f ; // a 3 x 3 matrix
+  m;
+  print(m);
+  matrix A;   // the 1 x 1 zero matrix
+  matrix C=m; // defines C as a 3 x 3 matrix equal to m
+  print(C);
+$
Index: Tst/Old/m3ex.tst
===================================================================
--- Tst/Old/m3ex.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m3ex.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,13 @@
+  LIB "elim.lib";         // loading library elim.lib
+  // you should get the information that elim.lib has been loaded
+  // together with some other libraries which are needed by it
+  option(noprot);         // no protocol
+  ring r2 = 32003,(x,y,z),dp;
+  poly f = x^11+y^5+z^(3*3)+x^(3+2)*y^(3-1)+x^(3-1)*y^(3-1)*z3+
+    x^(3-2)*y^3*(y^2)^2;
+  ideal j=jacob(f);
+  sat(j+f,maxideal(1));
+  // list and kill the variables defined so far:
+  listvar();
+  kill r2;
+$
Index: Tst/Old/m3si.tst
===================================================================
--- Tst/Old/m3si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m3si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,7 @@
+  ring R;
+  int jindex=3;
+  ideal j(3);
+  ideal j(jindex);     // is equivalent with the above
+  ideal j(2)=x;
+  j(2..3);
+$
Index: Tst/Old/m40si.tst
===================================================================
--- Tst/Old/m40si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m40si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,17 @@
+  ring r1=32003,(x,y,z),dp;
+  ideal i=x,y,z;
+  ring r2=32003,(a,b),dp;
+  map f=r1,a,b,a+b;
+  // maps from r1 to r2,
+  // x to a, y to b and z to a+b
+  f(i);
+  // operations like f(i[1]) or f(i*i) are not allowed
+  ideal i=f(i);
+  // objects in different rings may have the same name
+  map g   = r2,a2,b2;
+  map phi = g(f);
+  // composition of map f and g
+  // maps from r1 to r2,
+  // x to a2, y to b2, z to a2+b2
+  phi(i);
+$
Index: Tst/Old/m41si.tst
===================================================================
--- Tst/Old/m41si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m41si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,6 @@
+  ring r1=32003,(x,y,z),dp;
+  ideal i=std(ideal(x,y));
+  qring q=i;
+  basering;
+  std(ideal(x+y,x+y+z,z));
+$
Index: Tst/Old/m42si.tst
===================================================================
--- Tst/Old/m42si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m42si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,8 @@
+  list l=1,"str";
+  l[1];
+  l[2];
+  ring r;
+  ideal i = x^2, y^2 + z^3;
+  l[3] = i;
+  l;
+$
Index: Tst/Old/m43si.tst
===================================================================
--- Tst/Old/m43si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m43si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,3 @@
+  def i=2;
+  typeof(i);
+$
Index: Tst/Old/m44si.tst
===================================================================
--- Tst/Old/m44si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m44si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,7 @@
+  ring r2=0,(x(1..12)),ds;
+  matrix m[5][5]=maxideal(1),maxideal(1);
+  print(m);
+  m=bareiss(m);
+  print(m);
+  m[3,2];
+$
Index: Tst/Old/m45si.tst
===================================================================
--- Tst/Old/m45si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m45si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,11 @@
+  ring r=32003,(a,b,c,d),dp;
+  ideal j=bc-ad,b3-a2c,c3-bd2,ac2-b2d;
+  list T=mres(j,0); // 0 forces a full resolution
+  print(T[1]); // a minimal set of generators for j
+  print(T[2]); // the first syzygy module (minimal generating set)
+  print(T[3]); // the second syzygy module (minimal generating set)
+  print(T[4]);
+  betti(T);
+  // most useful for reading off the graded Betti numbers:
+  print(betti(T),"betti");
+$
Index: Tst/Old/m46si.tst
===================================================================
--- Tst/Old/m46si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m46si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,3 @@
+  ring r= 32003,(x,y),dp;
+  char(r);
+$
Index: Tst/Old/m47si.tst
===================================================================
--- Tst/Old/m47si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m47si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,3 @@
+  ring r= 32003,(x,y,z),dp;
+  print(char_series(ideal(xyz,xz,y)));
+$
Index: Tst/Old/m48si.tst
===================================================================
--- Tst/Old/m48si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m48si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,6 @@
+  ring R= 0,(x,y,z,u),dp;
+  ideal i=-3zu+y2-2x+2,
+          -3x2u-4yz-6xz+2y2+3xy,
+          -3z2u-xu+y2z+y;
+  print(char_series(i));
+$
Index: Tst/Old/m49si.tst
===================================================================
--- Tst/Old/m49si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m49si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,4 @@
+  ring r= (32003,a),(x,y),dp;
+  char(r);
+  charstr(r);
+$
Index: Tst/Old/m4ex.tst
===================================================================
--- Tst/Old/m4ex.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m4ex.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,9 @@
+  ring Rt = (0,t),(x,y),lp;
+  Rt;
+  poly f = x5+y11+xy9+x3y9;
+  ideal i = jacob(f);
+  ideal j	= i,i[1]*i[2]+t*x5y8;  // deformed ideal
+  j;
+  vdim(std(j));
+  kill Rt;
+$
Index: Tst/Old/m4si.tst
===================================================================
--- Tst/Old/m4si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m4si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,5 @@
+  ring r = 0, (x,y,z), ds;
+  // the same as ring r = 0, (x,y,z), (ds, C);
+  [x+y2,z3+xy];
+  [x,x,x];
+$
Index: Tst/Old/m50si.tst
===================================================================
--- Tst/Old/m50si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m50si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,5 @@
+  ring r=0,(x,y,z),dp;
+  poly f=(3x+6y)^5;
+  f;
+  cleardenom(f);
+$
Index: Tst/Old/m51si.tst
===================================================================
--- Tst/Old/m51si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m51si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,13 @@
+  ring r=32003,(x,y,z),dp;
+  poly f=x5+5x4y+10x2y3+y5;
+  matrix m=coef(f,y);
+  print(m);
+  f=x^20+xy+x2y;
+  print(coef(f,xy));
+  vector v=[f,zy+77+xy];
+  print(v);
+  matrix mc;matrix mm;
+  coef(v,y,mc,mm);
+  print(mc);
+  print(mm);
+$
Index: Tst/Old/m52si.tst
===================================================================
--- Tst/Old/m52si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m52si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,7 @@
+  ring r;
+  poly f=(x+y)^5;
+  matrix M=coeffs(f,y);
+  print(M);
+  ideal i=f,xyz+z^10*y^7;
+  print(coeffs(i,y));
+$
Index: Tst/Old/m53si.tst
===================================================================
--- Tst/Old/m53si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m53si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,5 @@
+  ring r=0,(a,b,c,d),dp;
+  ideal I=a2,a2+bc,abc;
+  ideal J=a2-bc,abcd;
+  print(contract(I,J));
+$
Index: Tst/Old/m54si.tst
===================================================================
--- Tst/Old/m54si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m54si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,5 @@
+  ring r= 0,(x,y),dp;
+  matrix m[5][6]= x,y,1,2,0,x+y;
+  defined(mm);
+  defined(r) and defined(m);
+$
Index: Tst/Old/m55si.tst
===================================================================
--- Tst/Old/m55si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m55si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,11 @@
+  ring r=0,(x,y,z),lp;
+  deg(x3+y4+xyz3);
+  ring r=7,(x,y),wp(2,3);
+  poly f=x2+y3;
+  deg(f);
+  ring R=7,(x,y),ws(2,3);
+  poly f=x2+y3;
+  deg(f);
+  vector v=[x2,y];
+  deg(v);
+$
Index: Tst/Old/m56si.tst
===================================================================
--- Tst/Old/m56si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m56si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,4 @@
+  list l="a","b","c";
+  list l1=delete(l,2);l1;
+  l;
+$
Index: Tst/Old/m57si.tst
===================================================================
--- Tst/Old/m57si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m57si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,4 @@
+  ring r=7,(x,y),wp(2,3);
+  matrix m[3][3]=1,2,3,4,5,6,7,8,x;
+  det(m);
+$
Index: Tst/Old/m58si.tst
===================================================================
--- Tst/Old/m58si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m58si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,10 @@
+  ring r= 0,(x,y,z),dp;
+  poly f=2*x^3*y+3*z^5;
+  diff(f,x);
+  diff(f,z);
+  vector v=[f,y2+z];
+  diff(v,z);
+  ideal i=x2,x2+yz,xyz;
+  ideal j=x2-yz,xyz;
+  print(diff(i,j));
+$
Index: Tst/Old/m59si.tst
===================================================================
--- Tst/Old/m59si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m59si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,4 @@
+  ring r=32003,(x,y,z),dp;
+  ideal I=std(ideal(x2,xy,y5));
+  dim(I);
+$
Index: Tst/Old/m5ex.tst
===================================================================
--- Tst/Old/m5ex.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m5ex.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,34 @@
+  LIB "sing.lib";
+  ring R=32003,(x,y,z),ds;
+  // ---------------------------------------
+  // hypersurface case (from series T[p,q,r]):
+  int p,q,r = 3,3,4;
+  poly f = x^p+y^q+z^r+xyz;
+  tjurina(f);
+  kbase(Tjurina(f));
+  // Tjurina number = 8
+  // ---------------------------------------
+  // complete intersection case (from series P[k,l]):
+  int k,l =3,2;
+  ideal j=xy,x^k+y^l+z2;
+  dim(std(j));          // Krull dimension
+  size(minbase(j));     // minimal number of generators
+  tjurina(j);           // Tjurina number
+  module T=Tjurina(j);
+  kbase(T);             // a sparse output of the k-basis of T1
+  print(kbase(T));      // columns of matrix are a k-basis of T1
+  // ---------------------------------------
+  // general case (cone over rational normal curve of degree 4):
+  ring r1=0,(x,y,z,u,v),ds;
+  matrix m[2][4]=x,y,z,u,y,z,u,v;
+  ideal i=minor(m,2);   // 2x2 minors of matrix m
+  module M=T1(i);       // a presentation matrix of T1
+  vdim(M);              // Tjurina number
+  hilb(M);              // display of both Hilbert series
+  intvec v1=hilb(M,1);  // first Hilbert series as intvec
+  intvec v2=hilb(M,2);  // second Hilbert series as intvec
+  v1;
+  v2;
+  v1[3];                // 3-rd coefficient of the 1-st Hilbert series
+  module N=T2(i);
+$
Index: Tst/Old/m5si.tst
===================================================================
--- Tst/Old/m5si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m5si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,4 @@
+  ring r = 0, (x,y,z), (C,lp);
+  [x+y2,z3+xy];
+  [x,x,x];
+$
Index: Tst/Old/m60si.tst
===================================================================
--- Tst/Old/m60si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m60si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,9 @@
+  ring r=32003,(x,y,z),dp;
+  ideal i=x2,xy,y5;
+  eliminate(i,x);
+  ring R=0,(x,y,t,s,z),dp;
+  ideal i=x-t,y-t2,z-t3,s-x+y3;
+  eliminate(i,ts);
+  intvec v=hilb(std(i),1);
+  eliminate(i,ts,v);
+$
Index: Tst/Old/m61si.tst
===================================================================
--- Tst/Old/m61si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m61si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,4 @@
+  extgcd(2,3);
+  ring r=0,(x,y),lp;
+  extgcd((x2+x3)*(x2-x3),(x2+x5)*(x2+x3));
+$
Index: Tst/Old/m62si.tst
===================================================================
--- Tst/Old/m62si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m62si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,5 @@
+  ring r= 32003,(x,y,z),(c,dp);
+  ideal I=xyz,x2z;
+  facstd(I);
+  facstd(I,x);
+$
Index: Tst/Old/m63si.tst
===================================================================
--- Tst/Old/m63si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m63si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,5 @@
+  ring r=32003,(x,y,z),dp;
+  factorize(9*(x-1)^2*(y+z));
+  factorize(9*(x-1)^2*(y+z),1);
+  factorize(9*(x-1)^2*(y+z),2);
+$
Index: Tst/Old/m64si.tst
===================================================================
--- Tst/Old/m64si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m64si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,20 @@
+  ring r=0,(x,y,z),dp;
+  ideal i=maxideal(3);
+  ideal j=std(i);
+  poly f=x+y2+z3;
+  vector v=[f,1];
+  qring q=j;
+  poly f=fetch(r,f);
+  f;
+  vector v=fetch(r,v);
+  v;
+  ideal i=fetch(r,i);
+  i;
+  ring rr=0,(a,b,c),lp;
+  poly f=fetch(q,f);
+  f;
+  vector v=fetch(r,v);
+  v;
+  ideal k=fetch(q,i);
+  k;
+$
Index: Tst/Old/m65si.tst
===================================================================
--- Tst/Old/m65si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m65si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,9 @@
+  ring r=0,(x,y,z),Dp;
+  ideal i=y3+x2, x2y+x2, x3-x2, z4-x2-y;
+  option(redSB);   // force the computation of a reduced SB
+  i=std(i);
+  vdim(i);
+  ring s=0,(z,x,y),lp;
+  ideal j=fglm(r,i);
+  j;
+$
Index: Tst/Old/m66si.tst
===================================================================
--- Tst/Old/m66si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m66si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,6 @@
+  find("Aac","a");
+  find("abab","a"+"b");
+  find("abab","a"+"b",2);
+  find("abab","ab",3);
+  find("0123","abcd");
+$
Index: Tst/Old/m67si.tst
===================================================================
--- Tst/Old/m67si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m67si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,3 @@
+  ring r= 32003,(x,y),(c,dp);
+  freemodule(3);
+$
Index: Tst/Old/m68si.tst
===================================================================
--- Tst/Old/m68si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m68si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,4 @@
+  gcd(2,3);
+  ring r=0,(x,y,z),lp;
+  gcd(3x2*(x+y),9x*(y2-x2));
+$
Index: Tst/Old/m69si.tst
===================================================================
--- Tst/Old/m69si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m69si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,8 @@
+  ring r= 32003,(x,y,z),(c,dp);
+  gen(3);
+  vector v=gen(5);
+  poly f= xyz;
+  v=v+f*gen(4); v;
+  ring rr= 32003,(x,y,z),dp;
+  fetch(r,v);
+$
Index: Tst/Old/m6ex.tst
===================================================================
--- Tst/Old/m6ex.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m6ex.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,49 @@
+  LIB "deform.lib";
+  ring R=32003,(x,y,z),ds;
+  //----------------------------------------------------
+  // hypersurface case (from series T[p,q,r]):
+  int p,q,r = 3,3,4;
+  poly f = x^p+y^q+z^r+xyz;
+  print(deform(f));
+  // the miniversal deformation of f=0 is the projection from the
+  // miniversal total space to the miniversal base space:
+  // { (A,B,C,D,E,F,G,H,x,y,z) | x3+y3+xyz+z4+A+Bx+Cxz+Dy+Eyz+Fz+Gz2+Hz3 =0 }
+  //  --> { (A,B,C,D,E,F,G,H) }
+  //----------------------------------------------------
+  // complete intersection case (from series P[k,l]):
+  int k,l =3,2;
+  ideal j=xy,x^k+y^l+z2;
+  print(deform(j));
+  versal(j);                  // using default names
+  setring Px;
+  show(Px);                   // show is a procedure from inout.lib
+  listvar(ideal);
+  // ___ Equations of miniversal base space ___:
+  Js;
+  // ___ Equations of miniversal total space ___:
+  Fs;
+  // the miniversal deformation of V(j) is the projection from the
+  // miniversal total space to the miniversal base space:
+  // { (A,B,C,D,E,F,x,y,z) | xy+A+Bz=0, y2+z2+x3+C+Dx+Ex2+Fy=0 }
+  //  --> { (A,B,C,D,E,F) }
+  //----------------------------------------------------
+  // general case (cone over rational normal curve of degree 4):
+  ring r1=0,(x,y,z,u,v),ds;
+  matrix m[2][4]=x,y,z,u,y,z,u,v;
+  ideal i=minor(m,2);                 // 2x2 minors of matrix m
+  int time=timer;
+  // Def_r will be the name of the miniversal base space with
+  // parameters A(1),...,A(4)
+  versal(i,0,"Def_r","A(");
+  "// used time:",timer-time,"sec";   // time for miniversal
+  // the miniversal deformation of V(i) is the projection from the
+  // miniversal total space to the miniversal base space:
+  // { (A(1..4),x,y,z,u,v) |
+  //         -y^2+x*z+A(2)*x-A(3)*y=0, -y*z+x*u-A(1)*x-A(3)*z=0,
+  //         -y*u+x*v-A(3)*u-A(4)*z=0, -z^2+y*u-A(1)*y-A(2)*z=0,
+  //         -z*u+y*v-A(2)*u-A(4)*u=0, -u^2+z*v+A(1)*u-A(4)*v=0 }
+  //  --> { A(1..4) |
+  //         -A(1)*A(4) = A(3)*A(4) = -A(2)*A(4)-A(4)^2 = 0 }
+  //----------------------------------------------------
+  killall(); // proc from general.lib, kills all user-defined variables
+$
Index: Tst/Old/m6si.tst
===================================================================
--- Tst/Old/m6si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m6si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,4 @@
+  ring r = 0, (x,y,z), (lp,c);
+  [x+y2,z3+xy];
+  [x,x,x];
+$
Index: Tst/Old/m70si.tst
===================================================================
--- Tst/Old/m70si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m70si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,7 @@
+  ring R=32003,(x,y,z),dp;
+  ideal i=x2,y2,z2;
+  ideal s=std(i);
+  hilb(s);
+  hilb(s,1);
+  hilb(s,2);
+$
Index: Tst/Old/m71si.tst
===================================================================
--- Tst/Old/m71si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m71si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,10 @@
+  ring r=32003,(x,y,z),ds;
+  poly s1=x3y2+x5y+3y9;
+  poly s2=x2y2z2+3z8;
+  poly s3=5x4y2+4xy5+2x2y2z3+y7+11x10;
+  ideal i=s1,s2,s3;
+  homog(s2,z);
+  homog(i,z);
+  homog(i);
+  homog(homog(i,z));
+$
Index: Tst/Old/m72si.tst
===================================================================
--- Tst/Old/m72si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m72si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,6 @@
+  ring r=0,(x,y,z),dp;
+  ideal i=x,y+z,2xz;
+  ring R=0,(a,b,x,y,c),lp;
+  ideal i=imap(r,i);
+  i;
+$
Index: Tst/Old/m73si.tst
===================================================================
--- Tst/Old/m73si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m73si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,5 @@
+  ring r=32003,(x,y,z),dp;
+  ideal I=xy,xz,yz;
+  indepSet(std(I));
+  eliminate(I,yz);
+$
Index: Tst/Old/m74si.tst
===================================================================
--- Tst/Old/m74si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m74si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,4 @@
+  list L=1,2;
+  insert(L,4,2);
+  insert(L,4);
+$
Index: Tst/Old/m75si.tst
===================================================================
--- Tst/Old/m75si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m75si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,7 @@
+  ring r=0,(x,y,z),dp;
+  ideal i=x2+z,z,2z;
+  interred(i);
+  ring R=0,(x,y,z),ds;
+  ideal i=zx+y3,z+y3,z+xy;
+  interred(i);
+$
Index: Tst/Old/m76si.tst
===================================================================
--- Tst/Old/m76si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m76si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,10 @@
+  ring R=0,(x,y),dp;
+  ideal i=x;
+  ideal j=y;
+  intersect(i,j);
+  ring r=181,(x,y,z),(c,ls);
+  ideal id1=maxideal(3);
+  ideal id2=x2+xyz,y2-z3y,z3+y5xz;
+  ideal id3=intersect(id1,id2,ideal(x,y));
+  id3;
+$
Index: Tst/Old/m77si.tst
===================================================================
--- Tst/Old/m77si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m77si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,6 @@
+  ring R;
+  poly f=x^2+y^3+z^5;
+  jacob(f);
+  ideal i=jacob(f);
+  print(jacob(i));
+$
Index: Tst/Old/m78si.tst
===================================================================
--- Tst/Old/m78si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m78si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,22 @@
+  ring r=32003,(x,y,z),(c,dp);
+  jet(1+x+x2+x3+x4,3);
+  poly f=1+x+y+z+x2+xy+xz+y2+x3+y3+z4;
+  jet(f,3);
+  intvec iv=2,1,1;
+  jet(f,3,iv);
+  // the part of f with (total) degree >3:
+  f-jet(f,3);
+  // the homogeneous part of f of degree 2:
+  jet(f,2)-jet(f,1);
+  // the absolute term of f:
+  jet(f,0);
+  // now for other types:
+  ideal i=f,x,f*f;
+  jet(i,2);
+  vector v=[f,1,x];
+  jet(v,1);
+  jet(v,0);
+  v=[f,1,0];
+  module m=v,v,[1,x2,z3,0,1];
+  jet(m,2);
+$
Index: Tst/Old/m79si.tst
===================================================================
--- Tst/Old/m79si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m79si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,4 @@
+  ring r=32003,(x,y,z),ds;
+  ideal i=x2,y2,z;
+  kbase(std(i));
+$
Index: Tst/Old/m7ex.tst
===================================================================
--- Tst/Old/m7ex.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m7ex.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,69 @@
+  int p=3;  int n=3;  int d=5; int k=2;
+  ring rp = p,(x(1..n)),dp;
+  int s = size(maxideal(d));
+  s;
+  // create a dense homogeneous ideal m, all generators of degree d, with
+  // generic (random) coefficients:
+  ideal m = maxideal(d)*random(p,s,n-2);
+  m;
+  // look for zeroes on the torus by checking all points (with no component 0)
+  // of the affine n-space over the field with p elements :
+  ideal mt;
+  int i(1..n);                    // initialize integers i(1),...,i(n)
+  int l;
+  s=0;
+  for (i(1)=1;i(1)<p;i(1)=i(1)+1)
+  {
+    for (i(2)=1;i(2)<p;i(2)=i(2)+1)
+    {
+      for (i(3)=1;i(3)<p;i(3)=i(3)+1)
+      {
+        mt=m;
+        for (l=1;l<=n;l=l+1)
+        {
+          mt=subst(mt,x(l),i(l));
+        }
+        if (size(mt)==0)
+        {
+          "solution:",i(1..n);
+          s=s+1;
+        }
+      }
+    }
+  }
+  "//",s,"solutions over GF("+string(p)+")";
+  // Now go to the field with p^3 elements:
+  // As long as there is no map from Z/p to the field with p^3 elements
+  // implemented, use the folowing trick: convert the ideal to be maped
+  // to the new ring to a string and then execute that string in the
+  // new ring
+  string ms="ideal m="+string(m)+";";
+  ms;
+  // define a ring rpk with p^k elements, call the primitive element z. Hence
+  // 'solution exponent: 0 1 5' means that (z^0,z^1,z^5) is a solution
+  ring rpk=(p^k,z),(x(1..n)),dp;
+  rpk;
+  execute ms;
+  s=0;
+  ideal mt;
+  for (i(1)=0;i(1)<p^k-k;i(1)=i(1)+1)
+  {
+    for (i(2)=0;i(2)<p^k-k;i(2)=i(2)+1)
+    {
+      for (i(3)=0;i(3)<p^k-k;i(3)=i(3)+1)
+      {
+        mt=m;
+        for (l=1;l<=n;l=l+1)
+        {
+          mt=subst(mt,x(l),z^i(l));
+        }
+        if (size(mt)==0)
+        {
+          "solution exponent:",i(1..n);
+          s=s+1;
+        }
+      }
+    }
+  }
+  "//",s,"solutions over GF("+string(p^k)+")";
+$
Index: Tst/Old/m7si.tst
===================================================================
--- Tst/Old/m7si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m7si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,4 @@
+  ring r = 0, (x,y,z), (c,lp);
+  [x+y2,z3+xy];
+  [x,x,x];
+$
Index: Tst/Old/m80si.tst
===================================================================
--- Tst/Old/m80si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m80si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,7 @@
+  ring r=32003,(x,y,z),dp;
+  print(koszul(3,2));
+  ideal I=xz2+yz2+z3,xyz+y2z+yz2,xy2+y3+y2z;
+  print(koszul(1,I));
+  print(koszul(2,I));
+  print(koszul(2,I)*koszul(3,I));
+$
Index: Tst/Old/m81si.tst
===================================================================
--- Tst/Old/m81si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m81si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,10 @@
+  ring r=32003,(x,y,z),(c,ds);
+  poly f=x2+y+z3;
+  vector v=[x^10,f];
+  ideal i=f,z;
+  module m=v,[0,0,1+x];
+  lead(f);
+  lead(v);
+  lead(i);
+  lead(m);
+$
Index: Tst/Old/m82si.tst
===================================================================
--- Tst/Old/m82si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m82si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,6 @@
+  ring r=32003,(x,y,z),ds;
+  poly f=x2+y+z3;
+  vector v=[2*x^10,f];
+  leadcoef(f);
+  leadcoef(v);
+$
Index: Tst/Old/m83si.tst
===================================================================
--- Tst/Old/m83si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m83si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,6 @@
+  ring r=32003,(x,y,z),(c,ds);
+  poly f=x2+y+z3;
+  vector v=[2*x^10,f];
+  leadexp(f);
+  leadexp(v);
+$
Index: Tst/Old/m84si.tst
===================================================================
--- Tst/Old/m84si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m84si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,7 @@
+  ring r;
+  ideal m=3x2+yz,7y6+2x2y+5xz;
+  poly f=y7+x3+xyz+z2;
+  ideal i=jacob(f);
+  matrix T=lift(i,m);
+  matrix(m)-matrix(i)*T;
+$
Index: Tst/Old/m85si.tst
===================================================================
--- Tst/Old/m85si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m85si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,9 @@
+  ring R=0,(x,y,z),dp;
+  poly f=x3+y7+z2+xyz;
+  ideal i=jacob(f);
+  matrix T;
+  ideal sm=liftstd(i,T);
+  sm;
+  print(T);
+  matrix(sm)-matrix(i)*T;
+$
Index: Tst/Old/m86si.tst
===================================================================
--- Tst/Old/m86si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m86si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,3 @@
+  ring r=32003,(x,y,z),dp;
+  maxideal(2);
+$
Index: Tst/Old/m87si.tst
===================================================================
--- Tst/Old/m87si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m87si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,3 @@
+  "Objects of Singular use (at the moment) ",memory(0)," bytes,"+newline+
+  "allocated from system (at the moment):", memory(1), "bytes";
+$
Index: Tst/Old/m88si.tst
===================================================================
--- Tst/Old/m88si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m88si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,6 @@
+  ring r=181,(x,y,z),(c,ls);
+  ideal id2=x2+xyz,y2-z3y,z3+y5xz;
+  ideal id4=maxideal(3)+id2;
+  id4;
+  minbase(id4);
+$
Index: Tst/Old/m89si.tst
===================================================================
--- Tst/Old/m89si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m89si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,6 @@
+  ring r = 0, (x(1..5)), ds;
+  matrix m[2][4]= x(1), x(2), x(3), x(4), x(2), x(3), x(4), x(5);
+  print(m);
+  ideal j = minor(m, 2);
+  j;
+$
Index: Tst/Old/m8ex.tst
===================================================================
--- Tst/Old/m8ex.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m8ex.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,64 @@
+  // Two transversal cusps in (k^3,0):
+  ring r1 = 0,(t,x,y,z),ls;
+  ideal i1 = x-t2,y-t3,z;        // parametrization of the first branch
+  ideal i2 = y-t2,z-t3,x;        // parametrization of the second branch
+  ideal j1 = eliminate(i1,t);
+  j1;                            // equations of the first branch
+  ideal j2 = eliminate(i2,t);
+  j2;                            // equations of the second branch
+  // Now map to a ring with only x,y,z as variables and compute the
+  // intersection of j1 and j2 there:
+  ring r2 = 0,(x,y,z),ds;
+  ideal j1= imap(r1,j1);         // imap is a convenient ringmap for
+  ideal j2= imap(r1,j2);         // inclusions and projections of rings
+  ideal i = intersect(j1,j2);
+  i;                             // equations of both branches
+  intvec v= qhweight(i);         // compute weights
+  v;
+  //----------------------------------------------------
+  // The tangent developable of a projective variety given parametrically
+  // by F=(f1,...,fn) : P^r --> P^n is the union of all tangent spaces
+  // of the image. The tangent space at a smooth point F(t1,...,tr)
+  // is given as the image of the tangent space at (t1,...,tr) under
+  // the tangent map
+  //   T(t1,...,tr): (y1,...,yr) --> jacob(f)*transpose((y1,...,yr))
+  // where jacob(f) denotes the jacobian matrix of f with respect to the
+  // t's evaluated at the point (t1,...,tr).
+  // Hence we have to create the graph of this map and then to eliminate
+  // the t's and y's.
+  // The rational normal curve in P^4 is given as the image of
+  //        F(s,t) = (s4,s3t,s2t2,st3,t4)
+  // each component being homogeneous of degree 4.
+  ring P = 0,(s,t,x,y,a,b,c,d,e),dp;
+  ideal M = maxideal(1);
+  ideal F = M[1..2];     // take the 1-st two generators of M
+  F=F^4;
+  // simplify(...,2); deletes 0-columns
+  matrix jac = simplify(jacob(F),2);
+  ideal T = x,y;
+  ideal J = jac*transpose(T);
+  ideal H = M[5..9];
+  ideal i = H-J;         // this is tricky: difference between two
+                         // ideals is not defined, but between two
+                         // matrices. By automatic type conversion
+                         // the ideals are converted to matrices,
+                         // subtracted and afterwards converted
+                         // to an ideal. Note that '+' is defined
+                         // and adds (concatenates) two ideals
+  i;
+  // Now we define a ring with product ordering and weights 4
+  // for the variables a,...,e.
+  // Then we map i from P to P1 and eliminate s,t,x,y from i.
+  ring P1 = 0,(s,t,x,y,a,b,c,d,e),(dp(4),wp(4,4,4,4,4));
+  ideal i = fetch(P,i);
+  ideal j= eliminate(i,stxy);    // equations of tangent developable
+  j;
+  // We can use the product ordering to eliminate s,t,x,y from i
+  // by a std-basis computation.
+  // We need proc 'nselect' from elim.lib.
+  LIB "elim.lib";
+  j = std(i);                    // compute a std basis j
+  j = nselect(j,1,4);            // select generators from j not
+  j;                             // containing variable 1,...,4
+  killall();
+$
Index: Tst/Old/m8si.tst
===================================================================
--- Tst/Old/m8si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m8si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,4 @@
+  ring r = 0, (x,y,z), M(1, 0, 0,
+                         0, 1, 0,
+                         0, 0, 1);
+$
Index: Tst/Old/m90si.tst
===================================================================
--- Tst/Old/m90si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m90si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,8 @@
+  ring r=31991,(t,x,y,z,w),ls;
+  ideal T=t2x2+tx2y+x2yz,t2y2+ty2z+y2zw,
+    t2z2+tz2w+xz2w,t2w2+txw2+xyw2;
+  list R3=sres(std(T),0);
+  size(R3);
+  list R4=minres(R3);
+  size(R4);
+$
Index: Tst/Old/m91si.tst
===================================================================
--- Tst/Old/m91si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m91si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,6 @@
+  ring r;
+  ideal h1 = x,y,z;
+  ideal h2 = x;
+  module m=modulo(h1,h2);
+  print(m);
+$
Index: Tst/Old/m92si.tst
===================================================================
--- Tst/Old/m92si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m92si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,6 @@
+  ring r= 32003,(x,y),ds;
+  poly f = (x^3+y^5)^2+x^2*y^7;
+  ideal i = std(jacob(f));
+  mult(i);
+  mult(std(f));
+$
Index: Tst/Old/m93si.tst
===================================================================
--- Tst/Old/m93si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m93si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,7 @@
+  ring r  = 31991,(t,x,y,z,w),ls;
+  ideal M = t2x2+tx2y+x2yz,t2y2+ty2z+y2zw,
+            t2z2+tz2w+xz2w,t2w2+txw2+xyw2;
+  list L  = mres(M,0);
+  size(L);
+  // projective dimension of M is 4
+$
Index: Tst/Old/m94si.tst
===================================================================
--- Tst/Old/m94si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m94si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,6 @@
+  ring r=0,(x,y,z,t),dp;
+  poly f=x3+y4+z6+xyz;
+  ideal j=jacob(f),f;
+  j=homog(j,t);j;
+  mstd(j);
+$
Index: Tst/Old/m95si.tst
===================================================================
--- Tst/Old/m95si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m95si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,6 @@
+  int i = 9;
+  string s = nameof(i);
+  s;
+  nameof(s);
+  nameof(i+1); //gives the empty string:
+$
Index: Tst/Old/m96si.tst
===================================================================
--- Tst/Old/m96si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m96si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,6 @@
+  int i = 9;
+  ring r;
+  poly f;
+  names();
+  names(r);
+$
Index: Tst/Old/m97si.tst
===================================================================
--- Tst/Old/m97si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m97si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,7 @@
+  ring r;
+  matrix m[5][6];
+  ncols(m);
+  ideal i=x,0,y;
+  ncols(i);
+  size(i);
+$
Index: Tst/Old/m98si.tst
===================================================================
--- Tst/Old/m98si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m98si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,4 @@
+  ring r=(23,t,v),(x,a(1..7)),lp;
+  // the parameters are t,v
+  npars(r);
+$
Index: Tst/Old/m99si.tst
===================================================================
--- Tst/Old/m99si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m99si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,8 @@
+  ring R;
+  matrix M[2][3];
+  nrows(M);
+  nrows(freemodule(4));
+  module m=[0,0,1];
+  nrows(m);
+  nrows([0,x,0]);
+$
Index: Tst/Old/m9ex.tst
===================================================================
--- Tst/Old/m9ex.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m9ex.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,26 @@
+  // Two transversal cusps in (k^3,0):
+  ring r2 =0,(x,y,z),ds;
+  ideal i =z2-1y3+x3y,xz,-1xy2+x4,x3z;
+  list resi=mres(i,0);       // computes a minimal resolution
+  print(resi[1]);            // the 1-st module is i minimized
+  print(resi[2]);            // the 1-st syzygy module of i
+  resi[3];                   // the 2-nd syzygy module of i
+  ideal j=minor(resi[2],2);
+  reduce(j,std(i));          // check whether j is contained in i
+  size(reduce(i,std(j)));    // check whether i is contained in j
+  // size(<ideal>) counts the non-zero generators
+  // ---------------------------------------------
+  // The tangent developable of the rational normal curve in P^4:
+  ring P = 0,(a,b,c,d,e),dp;
+  ideal j= 3c2-4bd+ae, -2bcd+3ad2+3b2e-4ace,
+           8b2d2-9acd2-9b2ce+9ac2e+2abde-1a2e2;
+  list L=mres(j,0);
+  print(L[2]);
+  // create an intmat with graded betti numbers
+  intmat B=betti(L);
+  // this gives a nice output of betti numbers
+  print(B,"betti");
+  // the user has acess to all betti numbers
+  // the 2-nd column of B:
+  B[1..4,2];
+$
Index: Tst/Old/m9si.tst
===================================================================
--- Tst/Old/m9si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/m9si.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,5 @@
+  intmat m[3][3]=1, 0, 0, 0, 1, 0, 0, 0, 1;
+  m;
+  ring r = 0, (x,y,z), M(m);
+  r;
+$
Index: Tst/Old/map.tst
===================================================================
--- Tst/Old/map.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/map.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,28 @@
+ring r;
+ideal i=y,x;
+map F=r,i;
+map g=F(F);
+g;
+F;
+map h=F;
+h;
+F;
+type F;
+kill F;
+type g;
+type h;
+kill g;
+type h;
+//timer=1;
+map F=r,x+y+z3,y+z+x2z3,z+1+xyz;
+poly f=(x+y+z+xz)^3;
+poly ff=F(f);
+F(ff);
+matrix m=f;
+matrix mm=F(m);
+F(mm);
+ring r1=0,(x,y,a,b,z,c),dp;
+poly f=x+2y+3z+4a+5b+6c+11x2+12xy+13xz+14xa+15xb+16xc+25y2b3;
+ring r2=0,(x,z,y),dp;
+imap(r1,f);
+$
Index: Tst/Old/mapp.tst
===================================================================
--- Tst/Old/mapp.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/mapp.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,23 @@
+//
+// test script for map command
+//
+pagelength = 10000;
+ring r1 = 32003,(x,y,z),dp;
+r1;
+ideal i=x,y,z;
+ring r2=32003,(a,b),dp;
+r2;
+map m=r1,a,b,a+b;
+m(i);
+"------------------------------";
+ring r3=0,(x,y,z),dp;
+r3;
+ideal i1=x2,y2,z2;
+ring r4=0,(a,b),dp;
+r4;
+map m1=r3,a,b,a-b;
+m1(i1);
+"------------------------------";
+listvar(all);
+kill r1,r2,r3,r4;
+$;
Index: Tst/Old/matr.tst
===================================================================
--- Tst/Old/matr.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/matr.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,31 @@
+//
+// test script for matrix command
+//
+pagelength = 10000;
+ring r1 = 0,(x,y,z),ds;
+r1;
+LIB "lib0";
+"------------------------------";
+poly s1=12x2y4;
+poly s2=3*x^2*y^3+x^3;
+poly s4=7/9x3z7;
+poly s5=12;
+poly s6;
+matrix m1[2][2]=1,2,3,4;
+pmat(m1);
+"-----------------------------";
+matrix m2[2][3]=x2,y3,z2,zx,4xy,yz;
+pmat(m2);
+"-------------------------------";
+matrix m3[3][2]=s1,s2,s4,s5,s6,x2;
+pmat(m3);
+"--------------------------------";
+matrix m4;
+pmat(m4);
+"--------------------------------";
+matrix m5=m3;
+pmat(m5);
+"----------------------------";
+listvar(all);
+kill r1;
+$;
Index: Tst/Old/matrix.tst
===================================================================
--- Tst/Old/matrix.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/matrix.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,120 @@
+pagelength = -1;
+LIB "lib";
+ring r;
+poly p1 = 1x2yz;
+poly p2 = 3x2yz5;
+poly p3 = p2;
+poly p4 =  (2x2yz5)^2;
+poly p5 =  (2x2yz5)^2 - 1x;
+poly p6 =  (2x2yz5)^2 - p2;
+matrix m[2][2] = p1,p2,p3,p6;
+fixmat(m,30);
+" ";
+matrix mm[2][2] = p6,p1,p2,p3;
+fixmat(mm,30);
+" ";
+fixmat(m+mm,30);
+" ";
+fixmat(m-mm,30);
+" ";
+"-------------";
+m = 1,0,0,1;
+fixmat(m,30);
+" ";
+fixmat(m*mm,30);
+matrix t[2][2] = 1x,0,1x,1y;
+fixmat(t,30);
+fixmat(t*m,30);
+//fehler bei Matrix Multiplikation
+ring r;
+matrix a[9][6]=
+-1z,
+0,
+0,
+0,
+0,
+0,
+0,
+-1z,
+0,
+0,
+0,
+0,
+0,
+0,
+-1z,
+0,
+0,
+0,
+0,
+0,
+-1y,
+0,
+0,
+0,
+0,
+0,
+0,
+-1z,
+0,
+0,
+0,
+0,
+0,
+0,
+-1z,
+0,
+0,
+0,
+0,
+0,
+-1y,
+0,
+0,
+0,
+0,
+0,
+0,
+-1z,
+0,
+0,
+0,
+0,
+0,
+-1y,
+0,
+0,
+0,
+0,
+0,
+-1x;
+matrix b[6][1]=
+1z2,
+1yz,
+1y2,
+1xz,
+1xy,
+1x2;
+a*b;
+// found by GMG (0.8.9g): crash
+int k = 6;
+ring r6(k) = 32003,v(1..6),ds;
+
+ideal i =
+v(4)*v(1)-v(2)^2,
+v(4)*v(2)-v(3)^2-v(1)^(k-4),
+
+v(5)*v(1)-v(3)*v(2),
+v(5)*v(2)-v(4)*v(3),
+v(5)*v(3)-v(4)^2+v(2)*v(1)^(k-5),
+
+v(6)*v(1)-v(4)*v(2),
+v(6)*v(2)-v(4)^2,
+v(6)*v(3)-v(5)*v(4),
+v(6)*v(4)-v(5)^2-v(2)^2*v(1)^(k-6);
+
+matrix M = jacob(i);
+M;
+ideal m = minor(M,4);
+m;
+$;
Index: Tst/Old/matrix2.tst
===================================================================
--- Tst/Old/matrix2.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/matrix2.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,45 @@
+pagelength = -1;
+LIB "lib";
+ring r;
+poly p1 = 1x2yz;
+poly p2 = 3x2yz5;
+poly p3 = p2;
+poly p4 =  (2x2yz5)^2;
+poly p5 =  (2x2yz5)^2 - 1x;
+poly p6 =  (2x2yz5)^2 - p2;
+matrix m[3][2] = p1,p2,p3,p6;
+fixmat(m,30);
+"-----------------";
+m[1..3,2] = 1,2,3;
+fixmat(m,30);
+"-----------------";
+matrix sm[2][2] = m[2..3,1..2];
+fixmat(sm,30);
+"-----decls-------";
+sm[1..2,1];
+"errors";
+matrix m[3][2];
+matrix mm[m][2];
+matrix mm[2];
+matrix mm;
+matrix mm[1][2][3];
+matrix mm[1][2..3];
+matrix mm[-1][2];
+matrix mm[0][2];
+matrix mm[m[1,2]][2];
+matrix m m[3][2];
+matrix mm[100001111111111111111111][10000];
+matrix mm[100000][100000];
+matrix mm[10000][10000];
+matrix mm[123 * 10][10000];
+"----values-----------------";
+matrix m1[3][2] = 1..6;
+matrix m2[3][2] = [1..6];
+matrix m3[3][2] = r;
+matrix m4[3][2] = i;
+matrix m5[3][2] = 1,i;
+int j = 999999999;
+matrix m6[3][2] = j,j..4;
+matrix m7[3][2] = ,;
+matrix m8[3][2] = ,4;
+$
Index: Tst/Old/matrixlb.tst
===================================================================
--- Tst/Old/matrixlb.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/matrixlb.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,27 @@
+system("random",71234567);
+help matrix.lib;
+LIB "matrix.lib";newline;
+
+example compress; newline;
+example concat; newline;
+example diag; newline;
+example dsum; newline;
+example flatten; newline;
+example genericmat;
+example is_complex;
+example outer; newline;
+example skewmat; newline;
+example submat; newline;
+example symmat; newline;
+example tensor; newline;
+example unitmat; newline;
+example gauss_col;
+example gauss_row;
+example addcol; newline;
+example addrow; newline;
+example multcol; newline;
+example multrow; newline;
+example permcol; newline;
+example permrow; newline;
+kmemory();
+$
Index: Tst/Old/matrows.tst
===================================================================
--- Tst/Old/matrows.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/matrows.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,20 @@
+proc mrows
+{
+  string @rc;
+  for (int @i = 1; @i<=ncols(#[1]); @i=@i+1)
+  {
+    @rc = @rc + "m[" + string(#[2]) + "," + string(@i) + "],";
+  }
+  @rc = @rc[1,size(@rc)-1] + ";";
+  return (@rc);
+}
+ring r= 32003,(x,y,z),lp;
+matrix m[3][3] = 0;
+m[1,1] = 4x;
+m[1,2] = y5x;
+m;
+for (int ii=1; ii<=nrows(m); ii=ii+1)
+{
+  execute mrows(m,ii);
+}
+$;
Index: Tst/Old/maxdegr.tst
===================================================================
--- Tst/Old/maxdegr.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/maxdegr.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,17 @@
+//
+// test script for maxdeg command
+//
+pagelength = 10000;
+ring r = 0,(x,y,z),dp;
+r;
+"---------------------------";
+ideal i1=x6y5,x8+z9+y7,xyz6+xz9;
+i1;
+degBound=10;
+test(24);
+ideal i2=std(i1);
+i2;
+"--------------------------";
+listvar(all);
+kill r;
+$;
Index: Tst/Old/maxid.tst
===================================================================
--- Tst/Old/maxid.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/maxid.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,28 @@
+//
+// test script for maxideal command
+//
+pagelength = 10000;
+ring r1 = 32003,(x,y,z),(c,dp);
+r1;
+LIB "lib0";
+"-------------------------------";
+matrix m1[3][3]=maxideal(2);
+pmat(m1);
+"---------------------------------";
+ring r2=0,(x(1..9)),(dp);
+matrix m2[3][3]=maxideal(1);
+pmat(m2);
+"-------------------------------";
+matrix m5[3][3]=maxideal(4);
+pmat(m5);
+"---------------------------------";
+ring r3=0,(x(1..64)),ds;
+matrix m3[8][8]= maxideal(1);
+pmat(m3);
+"----------------------------------";
+matrix m4[8][8]=maxideal(3);
+pmat(m4);
+"----------------------------------";
+listvar(all);
+kill r1,r2,r3;
+$;
Index: Tst/Old/mem.tst
===================================================================
--- Tst/Old/mem.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/mem.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,7 @@
+//
+// test script for memory command
+//
+pagelength = 10000;
+"Objects of SINGULAR use ",memory(0) ," bytes,",newline;
+"allocated from system:", memory(1) , "bytes";
+$;
Index: Tst/Old/minbas.tst
===================================================================
--- Tst/Old/minbas.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/minbas.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,37 @@
+//
+// test script for minbase command
+//
+pagelength = 10000;
+ring r1 = 32003,(x,y,z),(c,ls);
+r1;
+"-------------------------------";
+ideal i1=x2+xyz,y2-z3y,z3+y5xz;
+ideal i2=maxideal(3)+i1;
+i2;
+minbase(i2);
+"-------------------------------";
+i1;
+minbase(i1);
+"-------------------------------";
+ring r2=0,(x,y,z),(c,ds);
+r2;
+"-------------------------------";
+ideal i3=x4+y4z,y2+xz2,z2+yz2;
+ideal i4=maxideal(2)+i3;
+i4;
+minbase(i4);
+"---------------------------------";
+i3;
+minbase(i3);
+"--------------------------------";
+ring r3=0,(x(1..8)),ds;
+r3;
+"-------------------------------";
+matrix m[4][4]=maxideal(3);
+ideal i5=maxideal(2)+minor(m,2);
+i5;
+minbase(i5);
+"---------------------------------";
+listvar(all);
+kill r1,r2,r3;
+$;
Index: Tst/Old/mino.tst
===================================================================
--- Tst/Old/mino.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/mino.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,29 @@
+//
+// test script for minor command
+//
+pagelength = 10000;
+ring r1 = 32003,(x,y,z),(c,dp);
+r1;
+LIB "lib0";
+"-------------------------------";
+matrix m1[3][3]=maxideal(2);
+pmat(m1);
+minor(m1,3);
+"---------------------------------";
+ring r2=0,(x(1..9)),(dp);
+matrix m2[3][3]=maxideal(1);
+pmat(m2);
+minor(m2,2);
+"---------------------------------";
+ring r3=0,(x(1..64)),ds;
+matrix m3[8][8]= maxideal(1);
+pmat(m3);
+minor(m3,1);
+"----------------------------------";
+matrix m4[8][8]=maxideal(2);
+pmat(m4);
+minor(m4,1);
+"----------------------------------";
+listvar(all);
+kill r1,r2,r3;
+$;
Index: Tst/Old/modu.tst
===================================================================
--- Tst/Old/modu.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/modu.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,28 @@
+//
+// test script for module command
+//
+pagelength = 10000;
+ring r1 = 0,(x,y,z),ds;
+r1;
+"------------------------------";
+poly s1=12x2y4+34xyz5-78x2y4z2;
+poly s2=3*x^2*y^3+6*x^3*y^2*z^4;
+int i=2;
+int j=6;
+int k=45;
+poly s3=i*x^k*y^j+k*x^(i+j)*z^k;
+poly s4=7/9x3z7;
+poly s5=12;
+poly s6;
+vector v=[s1,s3-s2,s4-s1]+s5*gen(5);
+vector v1=[x2,y2];
+vector v2=[1,0];
+module m1=v1,v2-v1,s5*(v2-v1);
+m1;
+"------------------------------";
+module m2=[x2,0],[0,y2],[0,z6];
+m2;
+"-------------------------------";
+listvar(all);
+kill r1;
+$;
Index: Tst/Old/modul.tst
===================================================================
--- Tst/Old/modul.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/modul.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,11 @@
+ring r= 32003,(x,y,z),(c,lp);
+matrix m[2][2] = x,y,x2,y2;
+m;
+module mo = [x,y],[x2,y2];
+mo;
+vector v=[x,0,1];
+v;
+v=0;
+v=1; ;
+listvar(all);
+$;
Index: Tst/Old/modul1.tst
===================================================================
--- Tst/Old/modul1.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/modul1.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,57 @@
+//test modul oprations, wrong in 0.8.2, 0.8.2a
+ring r=32003,(x,y,z),(c,dp);
+module m1=[x];
+module m2=[y];
+m1+m2;
+m1*m2;
+//
+poly f=z;
+f+m1;
+f*m2;
+//
+typeof(f);
+typeof(m1);
+typeof(m1+m2);
+typeof(m1[1]);
+typeof(0);
+m1[1]=0;
+typeof(m1[1]);
+// intersect for modules
+m1[1]=[x];
+intersect(m1,m2);
+listvar(all);
+// ideal sum: idCompactify is wrong
+m1+m2;
+ideal i1=x;
+ideal i2=y;
+i1+i2;
+//
+intersect(i1,i2);
+// lead-command
+f=x+z;
+lead(f);
+m1[3]=[f];
+lead(m1);
+lead(m1[1]);
+lead(i1);
+lead(i1+i2);
+vector v=[f,1];
+lead(v);
+// homog-command
+homog(f,z);
+f=f+1;
+homog(f,z);
+homog(v,z);
+m1[1]=v;
+m1[2]=[f];
+homog(m1,z);
+i1=f,z+1;
+homog(i1,z);
+// accessing an ideal/modul as an "open" array
+i1=1,2,3;
+i1;
+i1[15]=15;
+i1;
+m1[5]=[15];
+m1;
+$;
Index: Tst/Old/modulo.tst
===================================================================
--- Tst/Old/modulo.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/modulo.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,14 @@
+//------------------------------------------
+ring r;
+matrix A[3][4]=1;
+module ma=module(A);
+ma;
+module mi=x*gen(1);
+module ml=lift(ma,mi);
+ma;
+//------------------------------------------
+matrix A[3][4]=1;
+matrix B[3][2]=0,x,y;
+modulo(A,B);
+syz(A)+module(lift(A,intersect(A,B)));
+$
Index: Tst/Old/mora1.tst
===================================================================
--- Tst/Old/mora1.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/mora1.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,38 @@
+//=== f:=f(11,10,3,1)//i:=fx,fy,fz
+
+ring r3=32003,(x,y,z),ds;
+int a =11;
+int b =10;
+int c =3;
+int t =1;
+poly f =x^a+y^b+z^(3*c)+x^(c+2)*y^(c-1)+x^(c-1)*y^(c-1)*z3+x^(c-2)*y^c*(y2+t*x)^2;
+ideal i= jacob(f);
+ideal i0=std( i);
+size(i0);
+degree(i0);
+test(10);
+i0=std( i);
+size(i0);
+degree(i0);
+test(-10,9);
+i0=std( i);
+size(i0);
+degree(i0);
+test(8);
+i0=std( i);
+size(i0);
+degree(i0);
+test(3);
+i0=std( i);
+size(i0);
+degree(i0);
+test(5);
+i0=std( i);
+size(i0);
+degree(i0);
+test(-5,-8);
+i0=std( i);
+size(i0);
+degree(i0);
+i0;
+$
Index: Tst/Old/mora2.tst
===================================================================
--- Tst/Old/mora2.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/mora2.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,45 @@
+" ============= cyclic_roots_7(homog) d- ==========================";
+"deg 60, dim 2, elem 99, Ende im Grad 17
+//Macaulay 3.55 min (SE/30), 2.45 sec (PowerBook)
+//Sing1/93 (test 4 12) 3.01 min SE/30, 2.45 (PowerBook)";
+ring r6 = 32003,(a,b,c,d,e,f,g),ds;
+r6;
+poly s1=a+b+c+d+e+f;
+poly s2=ab+bc+cd+de+ef+fa;
+poly s3=abc+bcd+cde+edf+efa+fab;
+poly s4=abcd+bcde+cdef+defa+efab+fabc;
+poly s5=abcde+bcdef+cdefa+defab+efabc+fabcd;
+poly s6=abcdef+g^6;
+ideal i=s1,s2,s3,s4,s5,s6;
+ideal j=std(i);
+"dim: "+ string(dim(j)) +",  mult: "+ string(mult(j)) +",  elem: "
+                                                        + string(size(j));
+j;
+kill r6;
+" ============= standard(homog) l1 d3- ==========================";
+"deg 720, dim 1, elem 68
+// Sing1/93c:39sec (4 12)  (PowerBook)";
+ring r8 = 32003,(t,x,y,z),(ls(1),ds(3));
+r8;
+poly s1=1x3y2t4+21328x5yt3+10667x2y4t3+21328x2yz3t3+10666xy6t2+10667y9;
+poly s2=1x2y2z2t2+3z8;
+poly s3=5x4y2t4+4xy5t4+2x2y2z3t3+1y7t3+11x10;
+ideal i=s1,s2,s3;
+ideal j=std(i);
+"dim: "+ string(dim(j)) +",  mult: "+ string(mult(j)) +",  elem: "
+                                                        + string(size(j));
+j;
+kill r8;
+" ============= 3 Puiseux-Paare ==========================";
+"deg , dim, elem ";
+listvar(all);
+ring p2=32003,(t, x, y),ls;
+poly s1=x-t72;
+poly s2=y-t84-t111-t160;
+ideal i=s1,s2;
+ideal j=std(i);
+"dim: "+ string(dim(j)) +",  mult: "+ string(mult(j)) +",  elem: "
+                                                        + string(size(j));
+j;                                                        
+kill p2;
+$
Index: Tst/Old/moralex.tst
===================================================================
--- Tst/Old/moralex.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/moralex.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,33 @@
+ring sr=0,(x,y,z),(c,ls);
+ideal j=x2+y2+z2,x4+y5+z6;
+sr;
+// std von jacob(j) klemmte
+proc mi
+{
+ ideal @id=#[1];
+ string @s;
+ int @n=size(@id);
+ matrix @mat[1][@n]=@id;
+ int @mnr;
+ matrix @ff[1][@n]=@mat;
+ ideal @tid;
+ ideal @tmod;
+ matrix @tmat[1][1];
+ for (int @l=@n; @l>0; @l=@l-1)
+ {
+    @tid=@ff;
+    @tmat=jacob(@tid);
+    @tmod=minor(@tmat,@l);
+    @ff[1,@l]=0;
+    @tmod=@tmod,@ff;
+    "jetzt kommt std von";
+    @tmod;
+    @tmod=std(@tmod);
+    "geschafft";
+    vdim(@tmod);
+    @mnr=vdim(@tmod)-@mnr;
+    return(@tmod);
+ }
+}
+mi(j);
+$
Index: Tst/Old/mptest.tst
===================================================================
--- Tst/Old/mptest.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/mptest.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,306 @@
+proc mptest (lv)
+{
+  print(lv);
+  write("MPfile:w /tmp/t.mp", lv);
+  return(lv == read("MPfile: /tmp/t.mp"));
+};
+
+proc mpt(lv)
+{
+  lv;
+  write("MPfile:w /tmp/t.mp", lv);
+  def r = read("MPfile: /tmp/t.mp");
+  r;
+};
+
+int i;
+int i1 = 1;
+int i2 = -100092;
+
+intvec iv;
+intvec iv1 = 1,2,3;
+intvec iv2 = -1,2,-3,4,-5;
+
+intmat im;
+intmat im1[2][3]=1,3,5,7,8;
+intmat im2[3][3]= -1,2,-3,4,-5;
+
+string s;
+string s1 = "Hello World";
+
+list l;
+list l1 = i,iv,im,i1,iv1,im1;
+list l2 = l1, iv2, l, im2;
+
+ring r;
+
+poly p;
+number n;
+number n1 = 2;
+number n2 = -7;
+
+poly p1 = x + y;
+poly p2 = xyz - 2x3y4z5 + 3xy -4yz + 5z;
+poly p3 = p2^4;
+
+vector v;
+vector v1 = [p1, p2];
+vector v2 = [p, p1,p2, p3] + p1*gen(5);
+
+ideal id;
+ideal id1 = p, p1, p2, p3;
+ideal id2 = p, p1+p2, p2+3, p1+p2+p3, p1, p2, p3;
+
+module mv;
+module mv1 = v, v1, v2;
+module mv2 = v1+v2, p1*v2, p2*(v1-v2), v, v1, v2;
+
+matrix m;
+matrix m1[2][3] = p, p1, p2, id1;
+matrix m2[4][4] =  p, p1, p2, p3, id1, id2;
+
+
+ideal j = std(id1);
+
+qring q = j;
+poly p11 = x + y;
+poly p12 = xyz - 2x3y4z5 + 3xy -4yz + 5z;
+poly p13 = p12^4;
+
+ring rtm = 32003, (x,y,z,t), dp;
+ideal ex = t3y7z4 + 9x8 + 5t2x4y2 + 2t2xy2z3,
+2t2x5y4+7txy6+9y8 + 2t2x2yz3,  3t4x2y3z2 + 9z8, 3x2y9 +
+y9 + 5x4;
+
+ring rt0 = 0, (x,y,z,t), dp;
+ideal ex = t3y7z4 + 9x8 + 5t2x4y2 + 2t2xy2z3,
+2t2x5y4+7txy6+9y8 + 2t2x2yz3,  3t4x2y3z2 + 9z8, 3x2y9 +
+y9 + 5x4;
+
+
+ring rr = 32003,(a,b),dp;
+map f = r, a,b,a+b;
+map g   = rr,a2,b2;
+map phi = g(f);
+
+
+ring r0 = 0, x, lp;
+number n;
+number n1 = 29734481274863241234589;
+number n2 = n1/(n1-6);
+
+poly p;
+poly p1 = n1*x + n2*x^4 + 7/3*x^2*x^5 - 6;
+poly p2 = x*x*x - 2*x^3*x^4*x^5 + 3*x*x -4*x*x + 5*x^2 + p1;
+poly p3 = p2*p2;
+
+vector v;
+vector v1 = [p1, p2];
+vector v2 = [p, p1,p2, p3] + p1*gen(5);
+
+ideal id;
+ideal id1 = p, p1, p2, p3;
+ideal id2 = p, p1+p2, p2+3, p1+p2+p3, p1, p2, p3;
+
+module mv;
+module mv1 = v, v1, v2;
+module mv2 = v1+v2, p1*v2, p2*(v1-v2), v, v1, v2;
+
+matrix m;
+matrix m1[2][3] = p, p1, p2, id1;
+matrix m2[4][4] =  p, p1, p2, p3, id1, id2;
+
+
+ring r1 = 0, x(1..10), ls;
+
+number n;
+number n1 = 29734481274863241234589;
+number n2 = n1/(n1-6);
+
+poly p;
+poly p1 = n1*x(1) + n2*x(5)^4 + 7/3*x(3)^2*x(4)^5 - 6;
+poly p2 = x(2)*x(5)*x(6) - 2*x(7)^3*x(8)^4*x(9)^5 + 3*x(1)*x(5) -4*x(5)*x(9) +
+5*x(9)^2 + p1;
+poly p3 = p2*p2;
+
+vector v;
+vector v1 = [p1, p2];
+vector v2 = [p, p1,p2, p3] + p1*gen(5);
+
+ideal id;
+ideal id1 = p, p1, p2, p3;
+ideal id2 = p, p1+p2, p2+3, p1+p2+p3, p1, p2, p3;
+
+module mv;
+module mv1 = v, v1, v2;
+module mv2 = v1+v2, p1*v2, p2*(v1-v2), v, v1, v2;
+
+matrix m;
+matrix m1[2][3] = p, p1, p2, id1;
+matrix m2[4][4] =  p, p1, p2, p3, id1, id2;
+
+ring r2=10,(x(1..6)),(lp(2),dp(4));
+number n;
+number n1 = 29734481274863241234589;
+number n2 = n1/(n1-6);
+
+poly p;
+poly p1 = n1*x(1) + n2*x(5)^4 + 7/3*x(3)^2*x(4)^5 - 6;
+poly p2 = x(2)*x(5)*x(6) - 2*x(1)^3*x(2)^4*x(3)^5 + 3*x(1)*x(5) -4*x(5)*x(3) +
+5*x(3)^2 + p1;
+poly p3 = p2*p2;
+
+vector v;
+vector v1 = [p1, p2];
+vector v2 = [p, p1,p2, p3] + p1*gen(5);
+
+ideal id;
+ideal id1 = p, p1, p2, p3;
+ideal id2 = p, p1+p2, p2+3, p1+p2+p3, p1, p2, p3;
+
+module mv;
+module mv1 = v, v1, v2;
+module mv2 = v1+v2, p1*v2, p2*(v1-v2), v, v1, v2;
+
+matrix m;
+matrix m1[2][3] = p, p1, p2, id1;
+matrix m2[4][4] =  p, p1, p2, p3, id1, id2;
+
+ring r3=(7,a, b, c),(x,y,z),dp;
+number n;
+number n1 = 2*a^2*b*c -3*b*c + -1*a + 4;
+number n2 = n1 / (n1 - 5c)^2;
+
+poly p;
+poly p1 = x + y + a;
+poly p2 = 3*a^2*xyz*n1 - 2*n2*x3y4z5 + 3xy -4yz + n1*z;
+poly p3 = p2*p1;
+
+vector v;
+vector v1 = [p1, p2];
+vector v2 = [p, p1,p2, p3] + p1*gen(5);
+
+ideal id;
+ideal id1 = p, p1, p2, p3;
+ideal id2 = p, p1+p2, p2+3, p1+p2+p3, p1, p2, p3;
+
+module mv;
+module mv1 = v, v1, v2;
+module mv2 = v1+v2, p1*v2, p2*(v1-v2), v, v1, v2;
+
+matrix m;
+matrix m1[2][3] = p, p1, p2, id1;
+matrix m2[4][4] =  p, p1, p2, p3, id1, id2;
+
+ring r4=(7,a),(x,y,z),dp;
+minpoly=a^2+a+3;
+poly p;
+number n;
+number n1 = 2*a^2 + 3;
+number n2 = n1 / (n1 -5)^3;
+
+poly p1 = x + y + a;
+poly p2 = 3*a^2*xyz*n1 - 2*n2*x3y4z5 + 3xy -4yz + n1*z;
+poly p3 = p2^4;
+
+vector v;
+vector v1 = [p1, p2];
+vector v2 = [p, p1,p2, p3] + p1*gen(5);
+
+ideal id;
+ideal id1 = p, p1, p2, p3;
+ideal id2 = p, p1+p2, p2+3, p1+p2+p3, p1, p2, p3;
+
+module mv;
+module mv1 = v, v1, v2;
+module mv2 = v1+v2, p1*v2, p2*(v1-v2), v, v1, v2;
+
+matrix m;
+matrix m1[2][3] = p, p1, p2, id1;
+matrix m2[4][4] =  p, p1, p2, p3, id1, id2;
+
+ring r5=(49,a),(x,y,z),dp;
+poly p;
+number n;
+number n1 = 2*a^2 + 3;
+number n2 = n1 / (n1 -5)^3;
+
+poly p1 = x + y + a;
+poly p2 = 3*a^2*xyz*n1 - 2*n2*x3y4z5 + 3xy -4yz + n1*z;
+poly p3 = p2^4;
+
+vector v;
+vector v1 = [p1, p2];
+vector v2 = [p, p1,p2, p3] + p1*gen(5);
+
+ideal id;
+ideal id1 = p, p1, p2, p3;
+ideal id2 = p, p1+p2, p2+3, p1+p2+p3, p1, p2, p3;
+
+module mv;
+module mv1 = v, v1, v2;
+module mv2 = v1+v2, p1*v2, p2*(v1-v2), v, v1, v2;
+
+matrix m;
+matrix m1[2][3] = p, p1, p2, id1;
+matrix m2[4][4] =  p, p1, p2, p3, id1, id2;
+
+ring r6 = 32003, (x,y,z), wp(1,2,3);
+poly p = (xyz - 2x3y4z5 + 3xy -4yz + 5z + 2)^2;
+
+ring r7 = 32003, (x,y,z), Ws(1,2,3);
+poly p = (xyz - 2x3y4z5 + 3xy -4yz + 5z + 2)^2;
+
+ring r8 = 32003, (a,b,c,x,y,z), (dp(3), wp(1,2,3));
+poly p = (xyzabc - 2x3y4z5a2b4c3 + 3xya2 -4yzb3c2 + 5zc + 2)^2;
+
+ring r9 = 32003, (a,b,c,x,y,z), (a(1,2,3,4,5),Dp(3), ds(3));
+poly p = (xyzabc - 2x3y4z5a2b4c3 + 3xya2 -4yzb3c2 + 5zc + 2)^2;
+
+ring r10 = 32003, (x,y,z), M(1, 0, 0, 0, 1, 0, 0, 0, 1);
+poly p = (xyz - 2x3y4z5 + 3xy -4yz + 5z + 2)^2;
+
+ring r11 = 0, x(1..10), (lp(2), M(1, 2, 3, 1, 1, 1, 1, 0, 0), ds(2), ws(1,2,3));
+poly p1 = x(1) + 123399456085/(123399456085 + 1)*x(5)^4 + 7/3*x(3)^2*x(4)^5 - 6;
+poly p2 = x(2)*x(5)*x(6) - 2*x(7)^3*x(8)^4*x(9)^5 + 3*x(1)*x(5) -4*x(5)*x(9) +
+5*x(9)^2 + p1;
+
+ring r12 = 0, (x,y,z), (C,lp);
+vector v1 = [x+y2,z3+xy];
+vector v2 = [x,x,x];
+
+ring r13 = 0, (x,y,z), (lp,c);
+vector v1 = [x+y2,z3+xy];
+vector v2 = [x,x,x];
+
+ring r14 = 0, (x,y,z), (c,lp);
+vector v1 = [x+y2,z3+xy];
+vector v2 = [x,x,x];
+
+dump(":w /tmp/mptest");
+LIB "general.lib";
+killall();
+killall("proc");
+getdump("/tmp/mptest");
+
+dump("MPfile:w /tmp/mptest");
+LIB "general.lib";
+killall();
+killall("proc");
+getdump("MPfile: /tmp/mptest");
+
+//link ll = "MPtcp:";
+//open(ll);
+//write(ll, quote(getdump(mp_ll)));
+//dump(ll);
+//read(ll);
+//LIB "general.lib";
+//killall(typeof(ll));
+//killall("proc");
+//write(ll, quote(dump(mp_ll)));
+//getdump(ll);
+//read(ll);
+//close(ll);
+dump("");
+quit();
+
Index: Tst/Old/mre.tst
===================================================================
--- Tst/Old/mre.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/mre.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,25 @@
+//
+// test script for mres command
+//
+pagelength = 10000;
+option(prot);
+ring r1=32003,(x,y,z),dp;
+r1;
+"-----------------------";
+ideal i=x2,y2,z2;
+i;
+mres(i,0); 
+"--------------------------";
+module m=[x2,0],[0,y4];
+m;
+mres(m,0);
+"-------------------------------";
+ring r2=31991,(t,x,y,z,w),ls;
+ideal j=t2x2+tx2y+x2yz,t2y2+ty2z+y2zw,t2z2+tz2w+xz2w,t2w2+txw2+xyw2;
+j;
+mres(j,0);
+"-------------------------";
+listvar(all);
+kill r1;
+$;
+
Index: Tst/Old/msect.tst
===================================================================
--- Tst/Old/msect.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/msect.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,42 @@
+//
+// test script for intersect command
+//
+pagelength = 10000;
+ring r1 = 32003,(x,y,z),(c,ds);
+r1;
+"-------------------------------";
+poly s1=x2y3+45x6y3+68x4z5+80y6x8;
+poly s2=6x5+3y6+8z6;
+poly s3=12xyz3+2y3z6;
+ideal i1=s1,s2,s3;
+ideal i2=s1+s2,s2,s1;
+vector v1=[s1,s2,s2*s3]+s1*gen(5);
+vector v2=[s1-s2,s3,s2]+s1*gen(5);
+module m1=v1,v2;
+module m2=v2,2*v1;
+intersect(i1,i2,1);
+"-------------------------";
+intersect(m2,freemodule(5),m1);
+intersect(m2);
+"-------------------------";
+listvar(all);
+kill r1;
+"--------------------------";
+ring r1=0,(x,y,z),(c,ds);
+poly s1=x2y3+45x6y3+68x4z5+80y6x8;
+poly s2=6x5+3y6+8z6;
+poly s3=12xyz3+2y3z6;
+ideal i1=s1,s2,s3;
+ideal i2=s1+s2,s2,s1;
+vector v1=[s1,s2,s2*s3]+s1*gen(5);
+vector v2=[s1-s2,s3,s2]+s1*gen(5);
+module m1=v1,v2;
+module m2=v2,2*v1;
+intersect(1,i1,i2);
+"-------------------------";
+intersect(m1,m2,freemodule(5));
+"-------------------------";
+listvar(all);
+kill r1;
+$;
+//bsp mit char 0
Index: Tst/Old/mult.tst
===================================================================
--- Tst/Old/mult.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/mult.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,18 @@
+//
+// test script for multiplicity command
+//
+pagelength = 10000;
+ring r1 = 32003,(x,y,z),(c,ds);
+r1;
+"-------------------------------";
+ideal i=3x2+yz,7y6+2x2y+5xz;
+i;
+multiplicity(i);
+"-----------------------------";
+module m=[x2,y2],[xy,xz],[x4,z8];
+m;
+multiplicity(m);
+"-----------------------------";
+listvar(all);
+kill r1;
+$;
Index: Tst/Old/namof.tst
===================================================================
--- Tst/Old/namof.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/namof.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,20 @@
+//
+// test script for nameof command
+//
+pagelength = 10000;
+ring r1 = 32003,(x,y,z),(c,dp);
+r1;
+LIB "lib0";
+"-------------------------------";
+int i=9;
+string s=nameof(i);
+s;
+"---------------------------------";
+string t=nameof(s);
+t;
+"------------------------------";
+string s1=nameof(1);
+"-----------------------------";
+listvar(all);
+kill r1;
+$;
Index: Tst/Old/nofile.tst
===================================================================
--- Tst/Old/nofile.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/nofile.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,4 @@
+"script nofile";
+<"nicht.da";
+"wirklich nicht da!";
+$
Index: Tst/Old/normalf.tst
===================================================================
--- Tst/Old/normalf.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/normalf.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,31 @@
+//
+// test script for reduce command
+//
+pagelength = 10000;
+ring r1 = 32003,(x,y,z),(c,ds);
+r1;
+"-------------------------------";
+poly s1=x2+xyz;
+poly s2=x5z+y6z+xz3;
+poly s3=xy+xz+yz;
+ideal i1=x2+xyz,y2-z3y,z3+y5xz;
+ideal i2=maxideal(3)+i1;
+reduce(s1,i1);
+"---------------------------------";
+reduce(s2,i1);
+"-------------------------------";
+reduce(s3,i2);
+"-------------------------------";
+vector v1=[s1,s2-s1,s3-s1]+s1*gen(5);
+vector v2=[s1,s2,s3]+s2*gen(5);
+vector v3=[s1,s2-s1,s3]+s1*gen(5);
+module m=v1,v2,v3;
+reduce(v1,m);
+"-----------------------------";
+reduce(v2,m);
+"------------------------------";
+reduce(v3,m);
+"-----------------------------";
+listvar(all);
+kill r1;
+$;
Index: Tst/Old/null.tst
===================================================================
--- Tst/Old/null.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/null.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,32 @@
+//
+// test script for nullspace command
+//
+pagelength = 10000;
+ring r1 = 32003,(x,y,z),(c,ds);
+r1;
+LIB "lib0";
+"--------------------------------";
+matrix m4[2][2]=1,2,2,4;
+pmat(m4);
+nullspace(m4);
+"-------------------------------";
+matrix m1[4][4]=1,0;
+pmat(m1);
+nullspace(m1);
+//mistake
+"-------------------------------";
+int k=7;
+matrix m2[k][5];
+pmat(m2);
+nullspace(m2);
+//mistake
+"------------------------------";
+int k=7;
+matrix m3[k+3][9]=1,2,3,4,5,6,0,0,4,5;
+pmat(m3);
+nullspace(m3);
+//mistake
+"--------------------------------";
+listvar(all);
+kill r1;
+$;
Index: Tst/Old/numvar.tst
===================================================================
--- Tst/Old/numvar.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/numvar.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,23 @@
+//
+// test script for nvars command
+//
+pagelength = 10000;
+ring r1 = 32003,(x,y,z),(c,ds);
+r1;
+nvars(r1);
+"--------------------------------";
+ring r2=23,(x(1..36)),ds;
+r2;
+nvars(r2);
+"-------------------------------";
+ring r3=0,(x,y,z(1..18)),ds;
+r3;
+nvars(r3);
+"------------------------------";
+ring r4=0,(x(1..6),y(1..7),z(1..8),a),ds;
+r4;
+nvars(r4);
+"--------------------------------";
+listvar(all);
+kill r1,r2,r3,r4;
+$;
Index: Tst/Old/opt.tst
===================================================================
--- Tst/Old/opt.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/opt.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,48 @@
+//
+// test script for option command
+//
+pagelength = 10000;
+ring r1=32003,(x,y,z),dp;
+r1;
+"-----------------------";
+test(24);
+option(prot);
+"------------------------";
+option();
+"--------------------------";
+option(notSugar);
+"-------------------------";
+option();
+"----------------------";
+option(noprot);
+"--------------------------";
+option();
+"---------------------------";
+option(none);
+"--------------------------";
+option();
+"-------------------------";
+option(redSB);
+"-------------------------------";
+option();
+"--------------------------";
+option(interrupt);
+"--------------------------";
+option();
+"------------------------";
+option(sugarCrit);
+"------------------------";
+option();
+"-----------------------";
+option(morePairs);
+"----------";
+option();
+"-------------------------";
+option(fastHC);
+"--------------------------";
+option();
+"-------------------------";
+listvar(all);
+kill r1;
+$;
+
Index: Tst/Old/ord.tst
===================================================================
--- Tst/Old/ord.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/ord.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,113 @@
+ring r=32003,(x,y,z),dp;
+poly f=x+y+z;
+poly g=1+f+f^2+f^3+f^4;
+f;
+g;
+[f,1];
+[f,x^5];
+ring r1=32003,(x,y,z),(c,dp);
+poly f=fetch(r,f);
+poly g=fetch(r,g);
+f;
+g;
+[f,1];
+[f,x^5];
+// module orders
+ring r2=0,x,(ds,c);
+matrix m[2][3]=1,2,3,4,5;
+print(module(transpose(m)));
+"-------";
+ring r3=0,x,(dp,c);
+matrix m=fetch(r2,m);
+print(module(transpose(m)));
+"-------";
+ring r4=0,x,(Dp,c);
+matrix m=fetch(r2,m);
+print(module(transpose(m)));
+"-------";
+ring r5=0,x,(Ds,c);
+matrix m=fetch(r2,m);
+print(module(transpose(m)));
+"-------";
+ring r6=0,x,(ls,c);
+matrix m=fetch(r2,m);
+print(module(transpose(m)));
+"-------";
+ring r7=0,x,(lp,c);
+matrix m=fetch(r2,m);
+print(module(transpose(m)));
+"-------";
+ring r8=0,x,(ds,C);
+matrix m=fetch(r2,m);
+print(module(transpose(m)));
+"-------";
+ring r9=0,x,(dp,C);
+matrix m=fetch(r2,m);
+print(module(transpose(m)));
+"-------";
+ring r10=0,x,(Dp,C);
+matrix m=fetch(r2,m);
+print(module(transpose(m)));
+"-------";
+ring r11=0,x,(Ds,C);
+matrix m=fetch(r2,m);
+print(module(transpose(m)));
+"-------";
+ring r12=0,x,(ls,C);
+matrix m=fetch(r2,m);
+print(module(transpose(m)));
+"-------";
+ring r13=0,x,(lp,C);
+matrix m=fetch(r2,m);
+print(module(transpose(m)));
+
+"-------";
+ring R2=0,x,(c,ds);
+matrix m=fetch(r2,m);
+print(module(transpose(m)));
+"-------";
+ring R3=0,x,(c,dp);
+matrix m=fetch(r2,m);
+print(module(transpose(m)));
+"-------";
+ring R4=0,x,(c,Dp);
+matrix m=fetch(r2,m);
+print(module(transpose(m)));
+"-------";
+ring R5=0,x,(c,Ds);
+matrix m=fetch(r2,m);
+print(module(transpose(m)));
+"-------";
+ring R6=0,x,(c,ls);
+matrix m=fetch(r2,m);
+print(module(transpose(m)));
+"-------";
+ring R7=0,x,(c,lp);
+matrix m=fetch(r2,m);
+print(module(transpose(m)));
+"-------";
+ring R8=0,x,(C,ds);
+matrix m=fetch(r2,m);
+print(module(transpose(m)));
+"-------";
+ring R9=0,x,(C,dp);
+matrix m=fetch(r2,m);
+print(module(transpose(m)));
+"-------";
+ring R10=0,x,(C,Dp);
+matrix m=fetch(r2,m);
+print(module(transpose(m)));
+"-------";
+ring R11=0,x,(C,Ds);
+matrix m=fetch(r2,m);
+print(module(transpose(m)));
+"-------";
+ring R12=0,x,(C,ls);
+matrix m=fetch(r2,m);
+print(module(transpose(m)));
+"-------";
+ring R13=0,x,(C,lp);
+matrix m=fetch(r2,m);
+print(module(transpose(m)));
+
+$
Index: Tst/Old/order.tst
===================================================================
--- Tst/Old/order.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/order.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,29 @@
+//
+// test script for ord command
+//
+pagelength = 10000;
+ring r1 = 32003,(x,y,z),wp(2,3,2);
+r1;
+poly s1=x2+y2+z2;
+s1;
+ord(s1);
+"--------------------------------";
+ring r2=23,(x,y,z),ws(2,3,2);
+r2;
+poly s1=x2+y2+z2;
+s1;
+ord(s1);
+"-------------------------------";
+ring r3=0,(x,y,z(1..18)),ws(4,2,3,4,5,2,3,1,5,3,2,2,2,3,3,3,4,5,3,1);
+r3;
+poly s2=x2+y2+z(1)^8+z(12)^18;
+s2;
+ord(s2);
+"------------------------------";
+vector v=[x3,y2,z(15)^2,z(2)^2];
+v;
+ord(v);
+"--------------------------------";
+listvar(all);
+kill r1,r2,r3;
+$;
Index: Tst/Old/palg.tst
===================================================================
--- Tst/Old/palg.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/palg.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,2292 @@
+LIB "elim.lib";
+ring T=(5,a),(x,y,z,y(1),y(2),y(3)),(dp(3),dp(3));
+minpoly=a2+2;
+matrix M[24][95]=
+(1),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^2+(-1)*y^2+y(1),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*z^2+y(2),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^6+y^6+y(3),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+x+(-2*a)*y,
+(2*a)*x,
+(2)*y^2,
+0,
+0,
+(-2)*y*z,
+(-1)*y^2,
+0,
+0,
+0,
+0,
+0,
+0,
+z,
+(2*a)*x*z+(-1)*y*z,
+(-1*a)*x*z+y*z,
+0,
+0,
+0,
+(-1)*y^2*z,
+0,
+0,
+0,
+(-1)*x^2+(-1)*y^2+y(1),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*z^2+y(2),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^6+y^6+y(3),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(2)*x,
+0,
+0,
+z,
+(-1*a)*y*z,
+(1*a)*y^2,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^2+(-1)*y^2+y(1),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*z^2+y(2),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^6+y^6+y(3),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*y,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+x,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^2+(-1)*y^2+y(1),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*z^2+y(2),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^6+y^6+y(3),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1),
+(-2*a)*y,
+0,
+(-2*a)*y^2,
+0,
+(-2)*y^3,
+0,
+0,
+0,
+0,
+(-1*a)*y,
+(-1)*x+(-1*a)*y,
+(2*a)*x*y+(-2)*y^2,
+0,
+0,
+(2)*x*y+(-2*a)*y^2,
+(2)*x*y^2+(1*a)*y^3,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^2+(-1)*y^2+y(1),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*z^2+y(2),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^6+y^6+y(3),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1),
+(-1*a),
+x+(-1*a)*y,
+(1*a)*y^3,
+0,
+0,
+x+(1*a)*y,
+(-2)*x*z+(-1*a)*y*z,
+(-2)*x*y+(2*a)*y^2,
+0,
+(-2)*y^3,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^2+(1*a)*x*y,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^2+(-1)*y^2+y(1),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*z^2+y(2),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^6+y^6+y(3),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(2)*y^2,
+0,
+0,
+0,
+0,
+0,
+(-1),
+0,
+0,
+(-2*a)*y^2,
+0,
+0,
+0,
+(-1*a)*x*y^2+(2)*y^3,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^2+(-1)*y^2+y(1),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*z^2+y(2),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^6+y^6+y(3),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-2),
+0,
+(-1)*y^3,
+0,
+0,
+0,
+(2)*y*z,
+(2)*y^2,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^2+(-1)*y^2+y(1),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*z^2+y(2),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^6+y^6+y(3),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(1*a),
+0,
+(-2)*x+(-2*a)*y,
+0,
+y^2,
+0,
+(2*a)*y^3,
+0,
+0,
+0,
+0,
+0,
+0,
+(1*a)*y^3,
+0,
+0,
+(-1)*x*y^3+(-2*a)*y^4,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^2+(-1)*y^2+y(1),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*z^2+y(2),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^6+y^6+y(3),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(2*a)*y^2,
+0,
+0,
+(-1*a),
+(2*a)*z,
+0,
+0,
+y^2,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^2+(-1)*y^2+y(1),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*z^2+y(2),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^6+y^6+y(3),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(2),
+0,
+0,
+0,
+(-1*a)*y^2,
+0,
+0,
+0,
+0,
+(-1),
+0,
+(2)*x+(1*a)*y,
+0,
+(2*a)*x*y^2+(2)*y^3,
+(-1*a)*x+(2)*y,
+(-1*a)*x*y+(-2)*y^2,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^2+(-1)*y^2+y(1),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*z^2+y(2),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^6+y^6+y(3),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-2),
+y^2,
+0,
+0,
+(1),
+(-2)*z,
+0,
+0,
+(-1*a)*y^2,
+0,
+y^3,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^2+(-1)*y^2+y(1),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*z^2+y(2),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^6+y^6+y(3),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(2*a),
+0,
+(2)*y,
+0,
+(-1*a)*y^2,
+0,
+0,
+0,
+0,
+0,
+0,
+(2*a)*y^2,
+(-1*a),
+0,
+(-2)*x*y^2+(1*a)*y^3,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^2+(-1)*y^2+y(1),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*z^2+y(2),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^6+y^6+y(3),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+x+(1*a)*y,
+0,
+0,
+0,
+0,
+(-1*a),
+0,
+(2)*y,
+0,
+(2*a)*x^2+(-1)*x*y+(-1*a)*y^2,
+0,
+0,
+0,
+0,
+(-2),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^2+(-1)*y^2+y(1),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*z^2+y(2),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^6+y^6+y(3),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-2),
+0,
+0,
+0,
+(-2)*y^2,
+0,
+0,
+0,
+0,
+(2*a),
+0,
+0,
+0,
+(1*a)*x+(-2)*y,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^2+(-1)*y^2+y(1),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*z^2+y(2),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^6+y^6+y(3),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+y,
+0,
+0,
+0,
+0,
+(-2),
+0,
+0,
+0,
+(-2)*y^2,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^2+(-1)*y^2+y(1),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*z^2+y(2),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^6+y^6+y(3),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1),
+0,
+(-2*a)*y,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1*a)*y,
+0,
+0,
+x*y+(2*a)*y^2,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^2+(-1)*y^2+y(1),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*z^2+y(2),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^6+y^6+y(3),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-2*a),
+0,
+0,
+0,
+0,
+0,
+0,
+(-1),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^2+(-1)*y^2+y(1),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*z^2+y(2),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^6+y^6+y(3),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(1*a),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-2*a)*x+(-2)*y,
+0,
+(-2),
+(-1)*y^2,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^2+(-1)*y^2+y(1),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*z^2+y(2),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^6+y^6+y(3),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1),
+0,
+0,
+0,
+0,
+0,
+0,
+(1*a),
+0,
+(-1)*y,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^2+(-1)*y^2+y(1),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*z^2+y(2),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^6+y^6+y(3),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(1*a),
+0,
+0,
+0,
+0,
+0,
+0,
+(-2*a),
+0,
+0,
+(2)*x+(-1*a)*y,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^2+(-1)*y^2+y(1),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*z^2+y(2),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^6+y^6+y(3),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(2),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^2+(-1)*y^2+y(1),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*z^2+y(2),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^6+y^6+y(3),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(2),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^2+(-1)*y^2+y(1),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*z^2+y(2),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^6+y^6+y(3),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(1),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^2+(-1)*y^2+y(1),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*z^2+y(2),
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+0,
+(-1)*x^6+y^6+y(3)
+;
+matrix N=std(M);
+N=elim(N,1,3);
+N;
+module(N);
+
+print(N);
+$
Index: Tst/Old/part.tst
===================================================================
--- Tst/Old/part.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/part.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,48 @@
+//
+// test script for diff command
+//
+pagelength = 10000;
+ring r1 = 32003,(x,y,z),(c,dp);
+r1;
+poly s1=3x2y4-5xyz3;
+s1;
+"==============================";
+diff(s1,x);
+diff(s1,y);
+diff(s1,z);
+"------------------------------";
+poly s2=5/3x4y2z6+1/5x2zy3-6xzy12;
+s2;
+"==============================";
+diff(s2,x);
+diff(s2,y);
+diff(s2,z);
+"--------------------------------";
+vector v1=[s1,x2+z4];
+v1;
+"=================================";
+diff(v1,x);
+diff(v1,y);
+diff(v1,z);
+"--------------------------------";
+vector v2=[s2,x2z2,s1,y2z];
+v2;
+"==================================";
+diff(v2,x);
+diff(v2,y);
+diff(v2,z);
+"---------------------------------";
+module m1=v1,v2;
+diff(m1,z);
+"--------------------------------";
+ideal i=s1,s2,s1+s2;
+diff(i,y);
+"------------------------------";
+matrix m[2][2]=x2,x+y3,0,12;
+diff(m,x);
+diff(m,y);
+diff(m,z);
+"-----------------------------";
+listvar(all);
+kill r1;
+$;
Index: Tst/Old/permutat.tst
===================================================================
--- Tst/Old/permutat.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/permutat.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,5 @@
+LIB "lib";
+intvec all = 5,4,3,2,1;
+intvec l = 1,1,1,1,1;
+permute1(5);
+$
Index: Tst/Old/pol.tst
===================================================================
--- Tst/Old/pol.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/pol.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,31 @@
+//
+// test script for poly command
+//
+pagelength = 10000;
+ring r1 = 0,(x,y,z),ds;
+r1;
+"------------------------------";
+poly s1=12x2y4+34xyz5-78x2y4z2;
+s1;
+"------------------------------";
+poly s2=3*x^2*y^3+6*x^3*y^2*z^4;
+s2;
+"----------------------------";
+int i=2;
+int j=6;
+int k=45;
+poly s3=i*x^k*y^j+k*x^(i+j)*z^k;
+s3;
+"---------------------------";
+poly s4=7/9x3z7+7/9*x^5+z^5;
+s4;
+"---------------------------";
+poly s5=12;
+s5;
+"------------------------------";
+poly s6;
+s6;
+"----------------------------";
+listvar(all);
+kill r1;
+$;
Index: Tst/Old/poly.tst
===================================================================
--- Tst/Old/poly.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/poly.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,109 @@
+pagelength = 30000;
+ring r= 32003,(x,y,z),lp;
+
+proc printid
+{
+  int @usage = size(#) != 2;
+  if (@usage == 0)
+  {
+    @usage = typeof(#[1]) != "ideal";
+    if (@usage)
+    {
+      typeof(#[1]), " not allowed for printid";
+    }
+  }
+  if (@usage) {
+    "usage : printid(ideal,prefix)",newline,
+    "        prints nonzero elements, w/ or w/o pref";
+    return();
+  }
+
+  #[2], size(#[1]);
+  int @i;
+  for (@i=1; @i<=size(#[1]); @i=@i+1)
+  {
+    if (#[2] != "")
+    {
+      #[2] , "(", @i, ") ", #[1][@i];
+    }
+    if (#[2] == "")
+    {
+      #[1][@i];
+    }
+  }
+}
+
+poly px = x;
+px;
+poly p1 = 1x2;
+p1;
+
+poly p2 = 3x2yz5;
+p2;
+
+poly p3 =  3 * 1x2yz5;
+p3;
+
+poly p4 =  (2x2yz5)^2;
+p4;
+
+poly p5 =  (2x2yz5)^2 - 1x;
+p5;
+
+poly p6 =  (2x2yz5)^2 - p3;
+p6;
+
+poly p6 =  x;
+p6;
+kill p6;
+poly p6 =  x;
+p6;
+
+1a 2x;
+1y 2x;
+y 2x;
+1y2x;
+
+"p1", p1;
+"p2", p2;
+"p3", p3;
+"p4", p4;
+matrix m[2][2] = p1,p2,p3,p4;
+m;
+kill m;
+matrix m[2][2] = p1,p2,p3,p4;
+m;
+m[1,2];
+"-------------------------------------";
+ideal id = m, xy3;
+id;
+
+ideal sid = std(id);
+sid;
+
+sid[3]+0 == 0;
+sid;
+".....................";
+sid[2] == 1x4y2z10;
+sid[2] == x2;
+sid;
+sid[2] = x2z;
+sid;
+"-------------------";
+printid("?");
+printid(sid,"; ");
+sid;
+printid(sid,"");
+sid;
+printid(m,"");
+listvar(all);
+// lamm@mathematik.uni-kl.de (0.9.2e):
+poly null;
+ord(null);
+"-------------------";
+ring R = 0,x,dp;
+poly f = (x+3)*(x+2);
+poly q = (x+2)^2;
+poly h = 20x + 40;
+(f*q)/h;
+$;
Index: Tst/Old/polylib.tst
===================================================================
--- Tst/Old/polylib.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/polylib.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,12 @@
+LIB "poly.lib";
+example cyclic;
+example freerank;
+example is_homog; 
+example is_zero;
+example maxcoef;
+example maxdeg;
+example maxdeg1;
+example mindeg;
+example mindeg1;
+example normalize;
+$
Index: Tst/Old/preim.tst
===================================================================
--- Tst/Old/preim.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/preim.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,28 @@
+//
+// test script for preimage command
+//
+pagelength = 10000;
+ring r1 = 32003,(x,y,z),dp;
+r1;
+ideal i1=x,y,z;
+ring r2=32003,(a,b),dp;
+r2;
+map f=r1,a,b,a+b;
+f(i1);
+ideal i2=a2,b2,a+b;
+preimage(r2,f,i2);
+"-------------------------------";
+map f1=r1,a2,a2-b2,a+b;
+f1(i1);
+ideal i3=a2,(a+b)^2,b2;
+preimage(r2,f1,i3);
+"--------------------------------";
+preimage(r2,f1,i2);
+"---------------------------------";
+map f2=r1,6a2,4b3,a+b;
+f2(i1);
+preimage(r2,f2,i3);
+"-------------------------------";
+listvar(all);
+kill r1,r2,r3;
+$;
Index: Tst/Old/preimage.tst
===================================================================
--- Tst/Old/preimage.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/preimage.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,31 @@
+ring r;
+type r;
+ring r1=32003,(x,y,z,w),lp;
+type r1;
+setring r;
+ideal i=x,y,z;
+ideal ii=x2+y2,xy,z3;
+map f=r1,i;
+map ff=r1,ii;
+type f;
+type ff;
+ideal j1=0;
+ideal j2=maxideal(2);
+ideal j3=x2+yz,y2+zx,z2+xy;
+setring r1;
+ideal i1=preimage(r,f,i);
+type i1;
+ideal i2=preimage(r,ff,i);
+type i2;
+ideal ii1=preimage(r,f,ii);
+type ii1;
+ideal ii2=preimage(r,ff,ii);
+type ii2;
+ideal j1=preimage(r,ff,j1);
+type j1;
+ideal j2=preimage(r,ff,j2);
+type j2;
+ideal j3=preimage(r,ff,j3);
+type j3;
+$
+
Index: Tst/Old/prim.tst
===================================================================
--- Tst/Old/prim.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/prim.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,20 @@
+//
+// test script for prime command
+//
+pagelength = 10000;
+ring r1 = 32003,(x,y,z),dp;
+r1;
+"-------------------------------";
+prime(277);
+"-------------------------------";
+prime(32004);
+"------------------------------";
+prime(-12);
+"-----------------------------";
+prime(0);
+"------------------------------";
+prime(32111);
+"---------------------------------";
+listvar(all);
+kill r1;
+$;
Index: Tst/Old/proc.tst
===================================================================
--- Tst/Old/proc.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/proc.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,38 @@
+proc p1
+{
+  "in p1";
+  p2();
+  "again in p1";
+  return ();
+}
+proc p2
+{
+  "in p2";
+  listvar(all);
+  listvar(proc);
+  "again in p2";
+  return ();
+}
+proc rec
+{
+  "in rec",#[1];
+  if (#[1] >0)
+  {
+    rec(#[1]-1);
+  }
+  if (#[1]==0)
+  {
+    listvar(all);
+    listvar(proc);
+  }
+  "again in rec",#[1];
+  return ();
+}
+"call p1";
+p1();
+"call p2";
+p2();
+"call rec(3)";
+rec(3);
+"end";
+$
Index: Tst/Old/qhw.tst
===================================================================
--- Tst/Old/qhw.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/qhw.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,23 @@
+int a=11;
+int b=12;
+int c=13;
+ring r;
+ideal i1=x3+xyz+z3,y4+y2z2+z4,x5+x2y2z+y5;
+ideal i2=x3+xyz;
+ideal i3=x3+xyz+z3,y4+y2z2+z4,x5+x2y2z+y5,x6+x4y2+y2x2z2+z4x2+z6+y4z2+y6;
+ideal i4=x3+xyz+z3,y4+y2z2+z4,x5+x2y2z+y5,x6+x4y2+y2x2z2+z4x2+z6+y4z3+y6;
+ideal j=x^a,y^b,z^c;
+map f=r,j;
+ideal ii1=f(i1);
+ideal ii2=f(i2);
+ideal ii3=f(i3);
+ideal ii4=f(i4);
+intvec I1=qhweight(ii1);
+intvec I2=qhweight(ii2);
+intvec I3=qhweight(ii3);
+intvec I4=qhweight(ii4);
+intvec IW=weight(ii1);
+I1;I2;I3;I4;
+" ";
+IW;
+$
Index: Tst/Old/qrin.tst
===================================================================
--- Tst/Old/qrin.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/qrin.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,29 @@
+//
+// test script for qring command
+//
+pagelength = 10000;
+ring r1 = 32003,(x,y,z),dp;
+r1;
+"------------------------------";
+poly s4=x;
+poly s5=y;
+poly s6=z;
+ideal i1=s4,s5,s6;
+ideal j1=std(i1);
+j1;
+qring q1=j1;
+basering;
+"----------------------------";
+ring r2=32003,(x,y,z),ds;
+poly s1=x3y4+123x7y+34x2yz6+23y6z4;
+poly s2=34x8y6z4+9z9;
+poly s3=9xz7+89xy7z8;
+ideal i2=s1,s2,s3;
+ideal j2=std(i2);
+j2;
+qring q2=j2;
+basering;
+"----------------------------";
+listvar(all);
+kill r1;
+$;
Index: Tst/Old/qring.tst
===================================================================
--- Tst/Old/qring.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/qring.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,26 @@
+ring r=32003,(x,y,z),(C,dp);;
+ideal q=maxideal(2);
+qring qr=q;
+ideal i=maxideal(1);
+std(i);
+i=x3,y2,z;
+std(i);
+module m=[x],[y],[z],[0,x],[0,y],[0,z],[0,0,x],[0,0,z],[0,0,y];
+std(m);
+m=[x],[0,y],[0,0,z];
+std(m);
+setring r;
+kill qr;
+q=x2-1;
+qring qr=q;
+ideal i=maxideal(3);
+std(i);
+module m=[x3,x,1],[y2+x2,x2y];
+std(m);
+i=0;
+std(i);
+setring r;
+q=0;
+qring qq=q;
+std(maxideal(1));
+$
Index: Tst/Old/qring1.tst
===================================================================
--- Tst/Old/qring1.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/qring1.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,13 @@
+ring r=32003,(x,y,z),(c,dp);
+ideal q=x2,y2;
+qring qr=q;
+ideal i=x;
+syz(i);
+i=x,y,z;
+syz(i);
+mres(i,3,ii);
+ii(1);
+ii(2);
+ii(3);
+$
+
Index: Tst/Old/quot.tst
===================================================================
--- Tst/Old/quot.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/quot.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,20 @@
+//
+// test script for quotient command
+//
+ring r1 = 32003,(x,y,z),(c,ls);
+r1;
+"-------------------------------";
+ideal i1=maxideal(3);
+ideal i2=x2+xyz,y2-z4y,z3+y6x2z;
+ideal i3=quotient(i1,i2);
+i3;
+"---------------------------------";
+ideal i4=quotient(i2,i1);
+i4;
+"---------------------------------";
+ideal i5=quotient(i2,maxideal(2));
+i5;
+"--------------------------------";
+listvar(all);
+kill r1;
+$;
Index: Tst/Old/randomlb.tst
===================================================================
--- Tst/Old/randomlb.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/randomlb.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,13 @@
+system("random",71234567);
+help random.lib;
+LIB "random.lib";
+
+example genericid;newline;
+example randomid;newline;
+example randommat;newline;
+example sparseid;newline;
+example sparsemat;newline;
+example sparsepoly;newline;
+example sparsetriag;newline;
+example kmemory;
+$
Index: Tst/Old/rang.tst
===================================================================
--- Tst/Old/rang.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/rang.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,20 @@
+//
+// test script for nrows command
+//
+pagelength = 10000;
+ring r1 = 32003,(x,y,z),(c,dp);
+r1;
+"-------------------------------";
+ncols(freemodule(6));
+"--------------------------------";
+module m1=[0,0,0,1,0];
+nrows(m1);
+"-------------------------------";
+vector v1=[x2,y2,z2];
+vector v2=[x,y,z];
+module m2=v1,v2;
+nrows(m2);
+"------------------------------";
+listvar(all);
+kill r1;
+$;
Index: Tst/Old/re.tst
===================================================================
--- Tst/Old/re.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/re.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,23 @@
+//
+// test script for res command
+//
+pagelength = 10000;
+//option(prot);
+ring r1=32003,(a,b,x,y,z),ls;
+r1;
+"-------------------------";
+ideal i=a2x2+ax2y+x2yz,a2y2+ay2z+y2zb,a2z2+az2b+xz2b,a2b2+axb2+xyb2;
+i;
+ideal i1=std(i);
+i1;
+res(i1,4,T);
+"------------------------";
+module m=[x2y,0],[1,x2z3];
+m;
+module m1=std(m);
+m1;
+res(m1,0,M);
+"-----------------------";
+listvar(all);
+kill r1;
+$;
Index: Tst/Old/redtail.tst
===================================================================
--- Tst/Old/redtail.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/redtail.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,97 @@
+//Tests fuer std  mit redtail
+"              Testbeispiele mit redtail, char=0";
+//timer=1;
+//test(0);
+int m,n;
+
+ring r1 = 0,(z,y,x),ds;
+poly s1=2x5y+7x2y4+3x2yz3;
+poly s2=1x2y2z2+3z8;
+poly s3=4xy5+2x2y2z3+11x10;
+ideal i=s1,s2,s3;
+ideal j=std(i);
+hilb(j,1);
+option(redSB);
+ideal j1=std(i);
+hilb(j1,1);
+option(redTail);
+ideal j2=std(i);
+hilb(j2,1);
+
+n=size(j);
+number x1,x2;
+for(m=1;m<=n;m=m+1)
+{
+x1=leadcoef(j1[m]);
+x2=leadcoef(j2[m]);
+NF(x2*j1[m]-x1*j2[m],j);
+NF(j[m],j1);
+NF(j1[m],j);
+}
+j2;
+kill r1;
+
+ring r4 =0,(a,b,c,d,e),ds;
+n=6;
+poly s1=a+b+c+d+ea;
+poly s2=de+1cd+1bc+1ae+1ab;
+poly s3=cde+1bcd+1ade+1abe+1abc;
+poly s4=bcde+1acde+1abde+1abce+1abcd;
+poly s5=abcde;
+ideal i=s1,s2,s3,s4,s5,b^n,c^n,d^n,e^n;
+ideal j=std(i);
+option(redTail);
+ideal j1=std(i);
+option(redSB);
+ideal j2=std(i);
+
+n=size(j);
+number x1,x2;
+for(m=1;m<=n;m=m+1)
+{
+x1=leadcoef(j1[m]);
+x2=leadcoef(j2[m]);
+x1*lead(j2[m])-x2*lead(j1[m]);
+x2=leadcoef(j[m]);
+x1*lead(j[m])-x2*lead(j1[m]);
+NF(j[m],j2);
+NF(j2[m],j);
+}
+j2;
+kill r4;
+
+option(redSB);
+ring r=
+0,(x,y,z),ls;
+poly f=x5+y11+xy9+x3y9+z6-z2x2y2;
+ideal i=jacob(f);
+ideal j=std( i);
+j;
+hilb(j);
+ring r1 = 0,(z,y,x),dp;
+ideal i = x4y4,y4z4;
+i=std(i);
+qring s=i;
+poly s1=2x5y+7x2y3;
+poly s2=1x2y2+3z7;
+poly s3=4xy5+2x2yz3;
+poly s4=x6+y6+z6;
+module M=
+s1*gen(1)+s4*gen(2),s2*gen(2)+s3*gen(3),
+s2*gen(1)+s1*gen(2),s3*gen(2)-s4*gen(3),
+s3*gen(1)+s2*gen(2),s1*gen(1)-s4*gen(3);
+option(redSB);
+module m1=std(M);
+option(redTail);
+option(noredSB);
+module m2=std(M);
+int cc;
+for(cc=1;cc<47;cc=cc+1)
+{
+leadcoef(m2[cc])*lead(m1[cc])-leadcoef(m1[cc])*lead(m2[cc]);
+NF(m1[cc],m2);
+NF(m2[cc],m1);
+}
+
+$
+
Index: Tst/Old/regr1.tst
===================================================================
--- Tst/Old/regr1.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/regr1.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,22 @@
+// -----------
+// normalform etc
+// -----------
+ring r= 32003,(x,y,z),lp;
+ideal i = x,y;
+poly p = x2y + z;
+poly noe = noether;
+noether = noe;
+// noe;
+
+"differentials from ", p;
+"d/dx:", diff(p,x);
+"d/dxdy:", diff(diff(p,x),y);
+"d/dy:", diff(p,y);
+"d/dz:", diff(p,z);
+
+newline; "normalform:";
+reduce(p,i);
+
+newline; "lead ?";
+lead(p);
+$
Index: Tst/Old/regress.lst
===================================================================
--- Tst/Old/regress.lst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/regress.lst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,123 @@
+; some general interpreter tests
+aa
+formmat
+if
+; buchberger algorithm, will take some time
+alex1
+; betti numbers
+betti
+; recursive proc and int  operations
+binomial
+; identifier handling
+bluff
+; ring changes
+cring
+curve
+ord
+cmp
+; coef command
+coef
+coeff
+; handling duplicate identifiers
+dups
+; the echo variable
+echo
+ech
+; fixed errors
+err1
+err2
+err3
+err4
+err5
+err6
+err7
+sat
+; recursive proc: will take some time
+fak
+; nested scripts
+filenest
+firsts
+; mora algorithm: very long script
+gm
+; homogeneous variant
+h4
+; hilbert function, degree, etc.
+hilb
+; ideal/module oprations
+ideal
+idealop
+modul
+modul1
+modulo
+quot
+fastelim
+; integer oprations
+integers
+; intvec operations
+intvec
+intmat
+index
+; the jet command
+jet
+; list type
+lists
+; coefficient arithmetics: will take some time
+longalg
+lpowers
+palg
+algmap
+algnorm
+det
+; ring maps
+map
+imap
+; matrix operations
+matrix
+matrows
+; mora algorithm, part 2
+mora1
+moralex
+; handling files
+nofile
+; poly operations
+poly
+deg
+comp
+;altern
+; proc, intvec, ... 
+permutat
+;
+preimage
+;
+proc
+; qring
+qring
+qring1
+; lead, diff
+regr1
+;
+ring
+rings
+; int, string
+smm
+;
+std1
+std_test
+stdhilb
+redtail
+;
+string
+namof
+; substructs of ideal, matrix
+subexpr
+subexpr1
+; syzygies and resolutions
+koszul
+res
+sres
+syzygies
+; variable argument lists
+varlist
+; weights etc.
+qhw
+weight
Index: Tst/Old/regul.tst
===================================================================
--- Tst/Old/regul.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/regul.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,27 @@
+//
+// test script for regularity command
+//
+pagelength = 10000;
+ring r1 = 31991,(t,x,y,z,w),(c,ls);
+r1;
+"-------------------------------";
+ideal i=t2x2+tx2y+x2yz,t2y2+ty2z+y2zw,t2z2+tz2w+xz2w,t2w2+txw2+xyw2;
+i;
+list t3=mres(i,0);
+t3;
+
+"------------------------------";
+regularity(t3);
+"------------------------------";
+listvar(all);
+kill r1;
+ring R=0,(r,s,t,v,w,x,y,z),dp;
+//
+ideal I = v-r9, w-r7st, x-r3s2t4, y-r9-s3t6, z-s6r3;
+//
+ideal J = eliminate( I, rst);
+J = std(J);
+list R1=res(J,0);
+print( R1);
+regularity( R1);
+$;
Index: Tst/Old/res.tst
===================================================================
--- Tst/Old/res.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/res.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,90 @@
+option(prot);
+//option(notRegularity);
+//ring r=31991,(t,x,y,z,w),(c,ls);
+//ideal i=x2+y2yz,y2+z2zw,t2+x2xy,x3+y3+t3,xyz;
+//ideal ii=x3+yzw,y3+zwt,z3+wtx,w3+txy,t2+xy;
+//ideal iii=x3+yzw,y3+zwt,z3+wtx,w2+txy,t2+xy;
+//ideal tt=t2x2+tx2y+x2yz,t2y2+ty2z+y2zw,t2z2+tz2w+xz2w,t2w2+txw2+xyw2;
+//test(17);
+//ideal T=std(tt);
+//timer = 1;
+//res(T,0,t1);
+//sres(T,0,t2);
+//mres(T,0,t3);
+//--------------------------------------------------------------
+ring an=32003,(w,x,y,z),(dp,C);
+ideal i=
+1w2xy+1w2xz+1w2yz+1wxyz+1x2yz+1xy2z+1xyz2,
+1w4x+1w4z+1w3yz+1w2xyz+1wx2yz+1x2y2z+1xy2z2,
+1w6+1w5z+1w4xz+1w3xyz+1w2xy2z+1wx2y2z+1x2y2z2;
+ideal j=std(i);
+list jres=sres(j,0);
+list jmin=minres(jres);
+print(betti(jmin),"betti");
+list jres1=mres(i,0);
+print(betti(jres1),"betti");
+list jres2=res(i,0);
+list jmin2=minres(jres2);
+print(betti(jmin2),"betti");
+kill an;
+//--------------------------------------------------------------
+ring pa2=32003,(w,t,u,x,y,z),(dp,C);
+ideal i=
+1w10t2u2-2w5tu2x6-2w5tu2y6+2w5tu2z6+1u2x12+2u2x6y6-2u2x6z6+1u2y12-2u2y6z6+1u2z12,
+-1w5t5u-1w5tux4-1w5tuy4-1w5tuz4+1t4ux6+1t4uy6-1t4uz6+1ux10+1ux6y4+1ux6z4
++1ux4y6-1ux4z6+1uy10+1uy6z4-1uy4z6-1uz10,
+1t8+2t4x4+2t4y4+2t4z4+1x8+2x4y4+2x4z4+1y8+2y4z4+1z8,
+1w5t3u-1w5tux2-1w5tuy2+1w5tuz2-1t2ux6-1t2uy6+1t2uz6+1ux8+1ux6y2-1ux6z2
++1ux2y6-1ux2z6+1uy8-1uy6z2-1uy2z6+1uz8,
+-1t6+1t4x2+1t4y2-1t4z2-1t2x4-1t2y4-1t2z4+1x6+1x4y2-1x4z2+1x2y4+1x2z4+1y6
+-1y4z2+1y2z4-1z6,
+1t4-2t2x2-2t2y2+2t2z2+1x4+2x2y2-2x2z2+1y4-2y2z2+1z4;
+ideal j=std(i);
+list jres=sres(j,0);
+list jmin=minres(jres);
+print(betti(jmin),"betti");
+list jres1=mres(i,0);
+print(betti(jres1),"betti");
+list jres2=res(i,0);
+list jmin2=minres(jres2);
+print(betti(jmin2),"betti");
+kill pa2;
+//--------------------------------------------------------------
+ring sw5=32003,(a,b,c,d,e,h),(dp,C);
+ideal i=
+-1ab-1b2-2de-2ch,
+-1ac-2bc-1e2-2dh,
+-1c2-1ad-2bd-2eh,
+-2cd-1ae-2be-1h2,
+-1d2-2ce-1ah-2bh;
+ideal j=std(i);
+list jres=sres(j,0);
+list jmin=minres(jres);
+print(betti(jmin),"betti");
+list jres1=mres(i,0);
+print(betti(jres1),"betti");
+list jres2=res(i,0);
+list jmin2=minres(jres2);
+print(betti(jmin2),"betti");
+kill sw5;
+//--------------------------------------------------------------
+ring r=32003,(t,x,y,z,w),(dp,C);
+ideal i=
+x2w+y2z,
+y2x+z2w,
+t2w+x2y,
+x3+y3+t3;
+ideal j=std(i);
+list jres=sres(j,0);
+list jmin=minres(jres);
+print(betti(jmin),"betti");
+list jres1=mres(i,0);
+print(betti(jres1),"betti");
+list jres2=res(i,0);
+list jmin2=minres(jres2);
+print(betti(jmin2),"betti");
+kill r;
+//--------------------------------------------------------------
+
+$
+
Index: Tst/Old/res2.tst
===================================================================
--- Tst/Old/res2.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/res2.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,27 @@
+// betti wrong after minres (0.8.9f) (pfister)
+ring rh3=32003,(w,x,y,z),(dp,C);
+int a =11;
+int b =10;
+int c =3;
+int t =1;
+poly f= x^a+y^b+z^(3*c)+x^(c+2)*y^(c-1)+x^(c-1)*y^(c-1)*z3+x^(c-2)*y^c*(y2+t*x)^2;
+ideal j= jacob(f);
+ideal i=homog(j,w);
+//timer=1;
+ideal j1=std(i);
+ideal j0;
+int k;
+int l=size(j1);
+for (k=1;k<=l;k=k+1)
+{
+   j0[k]=j1[l-k+1];
+}
+j0;
+attrib(j0,"isSB",1);
+list jres=sres(j0,0);
+jres[3];
+list jmin=minres(jres);
+jmin[3];
+betti(jmin);
+kill a,b,c,t,rh3;
+$   
Index: Tst/Old/ring.tst
===================================================================
--- Tst/Old/ring.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/ring.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,92 @@
+//
+// test script for ring command
+//
+pagelength = 10000;
+
+ring r = 32003,(x,y,z),lp;
+r;
+poly f=xy;
+f;
+
+poly p = x;
+listvar(all);
+
+kill r;
+ring r1= 2,(x,y,z),lp;
+r1;
+poly f=x3y;
+f;
+ring r2= 3,(a,y,z),lp;
+r2;
+poly f=x3y;
+f;
+listvar(all);
+
+kill r2;
+listvar(all);
+
+ring r3 ;
+listvar(all);
+kill r3;
+listvar(all);
+"---------------------------";
+ring r3 =,3;
+r3;
+listvar(all);
+kill r3;
+
+ring r3 = ,3,x y z;
+listvar(all);
+
+ring r3 = ,3,x y z,l;
+listvar(all);
+
+ring r3= 32003,(x,y,z),l,a;
+listvar(all);
+
+ring r3= 32003,(x,y,z),qql,a;
+listvar(all);
+
+ring r3= 32003,(x,y,z),qql,a;
+listvar(all);
+
+"dot dot notation for ring vars";
+ring r= 5,(v..z),lp;
+r;
+kill r;
+
+"dot dot notation for indexed ring vars";
+ring r= 7,(x(1..5)),lp;
+r;
+poly f=x(1)*x(2)^3;
+f;
+kill r;
+kill r1;
+ring r = 32003,(x,y,z,a,b,c,d),(lp(2),dp,wp(8));
+r;
+poly f=xy;
+f;
+ring r2 = 32003,(x,y,z,a,b,c,d),(lp(2),dp,wp(4,3,2,1));
+r2;
+ring r3 = 32003,(x,y,z,a,b,c,d),(lp(2),dp,3wp(4,3,2,1));
+ring r3 = 32003,(x,y,z,a,b,c,d),(lp(2),dp,lp(4,3,2,1));
+ring r3 = 32003,(x,y,z,a,b,c,d),(lp(2),dp,lp(4,3,2,1));
+ring r3 = 32003,(x,y,z,a,b,c,d),(lp(2),dp,x(4,3,2,1));
+ring r3 = 32003,(x,y,z,a,b,c,d),(lp(2),dp,x);
+listvar(all);
+ring r=0,(x,y,z),(dp(3),dp);
+ring r=0,(x,y,z),(dp(7),dp);
+ring r=(0,a),x,dp;
+ordstr(r);
+varstr(r);
+charstr(r);
+ring r=(0,a,b,c),(x(1..20)),(dp(2),ls(3),wp(1,2,3),M(6,7,8,9),ds);
+r;
+ordstr(r);
+varstr(r);
+charstr(r);
+ring r;
+ordstr(r);
+varstr(r);
+charstr(r);
+$
Index: Tst/Old/ringdef.tst
===================================================================
--- Tst/Old/ringdef.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/ringdef.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,19 @@
+//
+// test script for string command
+//
+pagelength = 10000;
+ring r1 = 0,(x,y,z),ds;
+r1;
+"------------------------------";
+ring r2=12,(x(1..7)),(lp(2),dp(6));
+r2;
+"------------------------------";
+ring r3=32003,(x,y,z,a,b,c,d),(ds(3),dp(3));
+r3;
+"-----------------------------";
+ring r4=0,(x,y,z),(c,dp);
+r4;
+"----------------------------";
+listvar(all);
+kill r1,r2,r3,r4;
+$;
Index: Tst/Old/ringlib.tst
===================================================================
--- Tst/Old/ringlib.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/ringlib.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,13 @@
+LIB "ring.lib";
+example changechar;
+example changeord;
+example changevar;
+example defring;
+example defrings;
+example defringp;
+example extendring;
+example fetchall;
+example imapall;
+example mapall;
+example ringtensor;
+$
Index: Tst/Old/rings.tst
===================================================================
--- Tst/Old/rings.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/rings.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,42 @@
+//declare different rings and show them
+ring r0;
+r0;
+ring r1=0,(x,y,z),ds;
+r1;
+ring r2=0,(x,y,z),wp(1,2,3);
+r2;
+ring r3=32003,(x,y,z),(a(1,2,3),ws(4,5,6));
+r3;
+ring r4=32003,(x,y,z),(a(1,2),ws(4,5,6));
+r4;
+ring r=32003,(x,y,z),(c,dp);
+poly f=x+z;
+f;
+f+1;
+f=f+1;
+f;
+//
+// declare a couple of rings with different characteristics
+//
+proc ringbundle
+{
+  // parameters are different characteristics
+  if (size(#) == 0)
+  {
+    "usage:ringbundle(char1, char2, ...)";
+    return ();
+  }
+  string @ex;
+  for (int @i=1; @i<=size(#); @i=@i+1)
+  {
+    @ex = "ring rb(" , string(@i) + ")  = " +  string(#[@i]) + ",(x, y, z),lp;";
+    execute @ex;
+    @ex = "export rb(" , string(@i) + ");";
+    execute @ex;
+  }
+}
+ringbundle();                 // ask for help
+ringbundle(3,5,7,11);         // create rb(1) with characteristic 3, etc
+listvar(all);
+rb(4);
+$;
Index: Tst/Old/row.tst
===================================================================
--- Tst/Old/row.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/row.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,20 @@
+//
+// test script for nrows command
+//
+pagelength = 10000;
+ring r1 = 32003,(x,y,z),(c,ds);
+r1;
+"-------------------------------";
+matrix m1[4][5];
+nrows(m1);
+"-------------------------------";
+int k=7;
+matrix m2[k][5];
+nrows(m2);
+"------------------------------";
+matrix m3[k+3][11];
+nrows(m3);
+"--------------------------------";
+listvar(all);
+kill r1;
+$;
Index: Tst/Old/rvari.tst
===================================================================
--- Tst/Old/rvari.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/rvari.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,16 @@
+//
+// test script for rvar command
+//
+pagelength = 10000;
+ring r1 = 32003,(x,y,z),dp;
+r1;
+"-------------------------------";
+rvar(y);
+"--------------------------------";
+rvar(r);
+"-----------------------------";
+rvar(r1);
+"------------------------------";
+listvar(all);
+kill r1;
+$;
Index: Tst/Old/sat.tst
===================================================================
--- Tst/Old/sat.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/sat.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,19 @@
+LIB "lib2";
+ring r3=32003,(x(1..3)),ds;
+ideal I1=x(2)^2-x(1)^4,x(3);
+ideal I2=x(2),x(3)-x(1)^3;
+ideal I=intersect(I1,I2);
+I=std(I);
+ideal J;
+I;
+for (int i=1;i<=size(I);i=i+1)
+  {
+    J=J,jet(I[i],ord(I[i]));
+  }
+J;
+//option(yacc);
+option();
+ideal Jsat = sat(std(J),maxideal(1));
+Jsat;
+$
+
Index: Tst/Old/setrin.tst
===================================================================
--- Tst/Old/setrin.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/setrin.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,16 @@
+//
+// test script for setring command
+//
+pagelength = 10000;
+//option(prot);
+ring r1=32003,(a,b,x,y,z),ls;
+r1;
+"------------------------";
+ring r2=0,(x,y,z),ds;
+r2;
+"---------------------";
+setring r1;
+"---------------------";
+listvar(all);
+kill r1,r2;
+$;
Index: Tst/Old/shor.tst
===================================================================
--- Tst/Old/shor.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/shor.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,17 @@
+//
+// test script for short command
+//
+pagelength = 10000;
+ring r = 13,x,dp;
+r;
+"---------------------------";
+int save=short;
+short=1;
+x2;
+short=0;
+x2;
+short=save;
+"--------------------------";
+listvar(all);
+kill r;
+$;
Index: Tst/Old/singlib.tst
===================================================================
--- Tst/Old/singlib.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/singlib.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,21 @@
+system("random",71234567);
+help sing.lib;
+LIB "sing.lib";
+
+example deform;newline;
+example dim_slocus;newline;
+example is_active;newline;
+example is_ci;newline;
+example is_is;newline;
+example is_reg;newline;
+example is_regs;newline;
+example milnor;newline;
+example nf_icis;newline;
+example slocus;newline;
+example Tjurina;newline;
+example tjurina;newline;
+example T1;newline;
+example T2;newline;
+example T12;newline;
+example kmemory;
+$
Index: Tst/Old/singular.lst
===================================================================
--- Tst/Old/singular.lst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/singular.lst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,154 @@
+;singular.tex
+m1si
+m2si
+m3si
+m4si
+m5si
+m6si
+m7si
+m8si
+m9si
+m10si
+m11si
+m12si
+m13si
+m14si
+m15si
+m16si
+m17si
+m18si
+m19si
+m20si
+m21si
+m22si
+m23si
+m24si
+m25si
+m27si
+m28si
+m29si
+m30si
+m31si
+m32si
+m33si
+m34si
+m35si
+m36si
+m37si
+m38si
+m39si
+m40si
+m41si
+m42si
+m43si
+m44si
+m45si
+m46si
+m47si
+m48si
+m49si
+m50si
+m51si
+m52si
+m53si
+m54si
+m55si
+m56si
+m57si
+m58si
+m59si
+m60si
+m61si
+m62si
+m63si
+m64si
+m65si
+m66si
+m67si
+m68si
+m69si
+m70si
+m71si
+m72si
+m73si
+m74si
+m75si
+m76si
+m77si
+m78si
+m79si
+m80si
+m81si
+m82si
+m83si
+m84si
+m85si
+m86si
+m87si
+m88si
+m89si
+m90si
+m91si
+m92si
+m93si
+m94si
+m95si
+m96si
+m97si
+m98si
+m99si
+m100si
+m101si
+m102si
+m103si
+m104si
+m105si
+m106si
+m107si
+m108si
+m109si
+m110si
+m111si
+m112si
+m113si
+m114si
+m115si
+m116si
+m117si
+m118si
+m119si
+m120si
+m121si
+m122si
+m123si
+m124si
+m125si
+m126si
+m127si
+m128si
+m129si
+m130si
+m131si
+m132si
+m133si
+m134si
+m135si
+m136si
+m137si
+m138si
+m139si
+m140si
+m141si
+m142si
+m143si
+m144si
+m145si
+m146si
+m147si
+m148si
+m149si
+m150si
+m151si
+m152si
+m153si
+m154si
Index: Tst/Old/siz.tst
===================================================================
--- Tst/Old/siz.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/siz.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,28 @@
+//
+// test script for size command
+//
+pagelength = 10000;
+ring r1 = 32003,(x,y,z),dp;
+r1;
+"-------------------------------";
+string s="feierabend";
+intvec iv=1,2,3;
+poly p=x+2y-z;
+vector v=[x-z,x,y,0];
+ideal i=p,z;
+module m=v,[0,1],[2,3,0],4*v;
+size(s);
+"--------------------------";
+size(iv);
+"---------------------------";
+size(p);
+"---------------------------";
+size(v);
+"-----------------------------";
+size(i);
+"-------------------------------";
+size(m);
+"------------------------------";
+listvar(all);
+kill r1;
+$;
Index: Tst/Old/smm.tst
===================================================================
--- Tst/Old/smm.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/smm.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,61 @@
+int d;
+int e;
+int n;
+int r;
+int o;
+int s;
+int y;
+int ode; int onr; int oeo; int osm;
+for (d=2; d<9; d=d+1)
+{
+  for (e=2; e<9; e=e+1)
+  {
+    if (e == d)
+    {
+      e = e + 1;
+      continue;
+    }
+    for (n=2; n<9; n=n+1)
+    {
+      if ( (n == d) or (n == e))
+      {
+        n = n + 1;
+        continue;
+      }
+      for (r=2; r<9; r=r+1)
+      {
+        if ((r == d) or (r == e) or (r == n) )
+        {
+        r = r + 1;
+        continue;
+        }
+        o = 0;
+        s = 9;
+        d, e, n, r, o, s;
+        y = d + e;
+        ode = y / 10;
+        y = y % 10;
+        if (!((n + r + ode) % 10 <> e ))
+        {
+          onr = (n + r + ode) / 10;
+          if (!( (e + o + onr) % 10 <> n ))
+          {
+            oeo = (e + o + onr) / 10;
+            if (!( (s + 1 + oeo) % 10 <> o ))
+            {
+              osm = (s + 1 + oeo) / 10;
+              if (osm == 1)
+              {
+                " "+string(s )+string(e)+string(n)+string(d);
+                " 1"+string(o)+string(r)+string(e);
+                "1"+string(o)+string(n)+string(e)+string(y);
+                $
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+}
+$
Index: Tst/Old/sre.tst
===================================================================
--- Tst/Old/sre.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/sre.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,25 @@
+//
+// test script for sres command
+//
+pagelength = 10000;
+option(prot);
+ring r1=32003,(a,b,x,y,z),ls;
+r1;
+"-------------------------";
+ideal i=a2x2+ax2y+x2yz,a2y2+ay2z+y2zb,a2z2+az2b+xz2b,a2b2+axb2+xyb2;
+i;
+ideal i1=std(i);
+i1;
+sres(i1,4,T);
+sres(i1,4);
+"------------------------";
+module m=[x2y,0],[1,x2z3];
+m;
+module m1=std(m);
+m1;
+sres(m1,0,M);
+sres(m1,0);
+"-----------------------";
+listvar(all);
+kill r1;
+$;
Index: Tst/Old/sres.tst
===================================================================
--- Tst/Old/sres.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/sres.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,10 @@
+option(prot);
+ring r;
+ideal i=x2+y3,xyz+z4+y2z2,y3+x3z;
+qring q=std(i);
+q;
+ideal i=x,y,z;
+list I=sres(i,0);
+size(I);
+I;
+$
Index: Tst/Old/sstring.tst
===================================================================
--- Tst/Old/sstring.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/sstring.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,25 @@
+//
+// test script for find command
+//
+pagelength = 10000;
+ring r1 = 32003,(x,y,z),(c,dp);
+r1;
+"-------------------------------";
+find("ABab","a");
+"-----------------------------";
+find("ABCaaB""a");
+"------------------------------";
+find("6,523",","+"5");
+"------------------------------";
+find("012","yxc");
+"-----------------------------";
+find("1231231231234","2",2);
+find("1231231231234","2",3);
+find("1231231231234","2",4);
+find("1231231231234","2",5);
+find("1231231231234","2",6);
+find("1231231231234","2",12);
+find("1231231231234","2",20);
+listvar(all);
+kill r1;
+$;
Index: Tst/Old/start.lst
===================================================================
--- Tst/Old/start.lst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/start.lst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,2 @@
+;start.tex
+m1st
Index: Tst/Old/std1.tst
===================================================================
--- Tst/Old/std1.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/std1.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,63 @@
+//
+// test script for std command
+//
+ring r= 32003,(x,y,z),ds;
+int a = 3;
+int b = 5;
+int c = 2;
+int d = 7;  // c*b+d*a > 2ab, ggt(a,b) = 1
+
+poly f = (x^a+y^b)^2+x^c*y^d;
+poly f'x = diff(f,x);
+f;
+f'x;
+poly f'y = diff(f,y);
+f'y;
+//ideal i = f'x,f'y;
+ideal i = diff(f,x), diff(f,y);
+i;
+"vdim         i:", vdim(i);
+"dim          i:", dim(i);
+"multiplicity i:", mult(i);
+i;
+option(prot);
+test(15);
+ideal j = std(i);
+//degree(j);
+"dim",dim(j);
+"multiplicity", mult(j);
+j;
+//
+"-------------------------------";
+//
+ring r1 = 32003,(x,y,z),ds;
+r1;
+ideal i1=maxideal(3);
+ideal i2=x6,y4,z5,xy,yz,xz;
+i2;
+ideal j1=std(i2);
+j1;
+//maxdeg(3);
+//test(24);
+vdim(j1);
+"---------------------------------";
+i1;
+//maxdeg(2);
+//test(24);
+ideal j2=std(i1);
+j2;
+vdim(j2);
+"---------------------------------";
+vector v1=[x4,y2,xz2];
+vector v2=[y3,x8,2z4];
+module m=v1,v2;
+m;
+//maxdeg(3);
+//test(24);
+module m1=std(m);
+m1;
+vdim(m1);
+"--------------------------------";
+listvar(all);
+kill r1;
+$;
Index: Tst/Old/std_test.tst
===================================================================
--- Tst/Old/std_test.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/std_test.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,122 @@
+proc check_ideal_std(int n, string ostring)
+{
+  string ringstr = "ring r = 32003,x(0.." + string(n-1) + ")," + ostring + ";";
+  string idealstr = "ideal j = ";
+  int i;
+
+  for (i=0; i < n-1; i++)
+  {
+    idealstr = idealstr + "x("+ string(i) + ") + ";
+  }
+  idealstr = idealstr + "x(" + string(n-1) + "),";
+
+  
+  for (i=0; i < n-1; i++)
+  {
+    idealstr = idealstr + "x("+ string(i % n) + ")*x(" + string((i+1) % n) + ") + ";
+  }
+  idealstr = idealstr + "x("+ string(i % n) + ")*x(" + string((i+1) % n) + "),";
+
+  for (i=0; i < n-1; i++)
+  {
+    idealstr = idealstr + "x("+ string(i % n) + ")*x(" + string((i+1) % n)
+      + ")*x(" + string((i+2) % n) + ")  + ";
+  }
+  idealstr = idealstr + "x("+ string(i % n) + ")*x(" + string((i+1) % n)
+    + ")*x(" + string((i+2) % n) + ");";
+
+  execute ringstr;
+  execute idealstr;
+  r;
+  j;
+  std(j);
+}
+
+  
+proc check_module_std(int n, string ostring)
+{
+  string ringstr = "ring r = 32003,x(0.." + string(n-1) + ")," + ostring + ";";
+  string modulestr = "module j = ";
+  int i;
+
+  for (i=0; i < n-1; i++)
+  {
+    modulestr = modulestr + "x("+ string(i) + ")*gen(" +  string(i+1) + ") + ";
+    modulestr = modulestr + "x("+ string(i) + ")*gen(" +  string(i+2) + ") + ";
+  }
+  modulestr = modulestr + "x(" + string(n-1) + ")*gen(" +  string(i) + "), ";
+
+  
+  for (i=0; i < n-1; i++)
+  {
+    modulestr = modulestr + "x("+ string(i % n) + ")*x(" + string((i+1) % n) +
+      ")*gen(" +  string(1) + ") + ";
+    modulestr = modulestr + "x("+ string(i % n) + ")*x(" + string((i+1) % n) +
+      ")*gen(" +  string(2) + ") + ";
+  }
+  modulestr = modulestr + "x("+ string(i % n) + ")*x(" + string((i+1) % n) +
+    ")*gen(" +  string(i) + "),";
+
+  for (i=0; i < n-1; i++)
+  {
+    modulestr = modulestr + "x("+ string(i % n) + ")*x(" + string((i+1) % n)
+      + ")*x(" + string((i+2) % n) + ")*gen(" +  string(1) + ")  + ";
+    modulestr = modulestr + "x("+ string(i % n) + ")*x(" + string((i+1) % n)
+      + ")*x(" + string((i+2) % n) + ")*gen(" +  string(2) + ")  + ";
+  }
+  modulestr = modulestr + "x("+ string(i % n) + ")*x(" + string((i+1) % n)
+    + ")*x(" + string((i+2) % n) + ")*gen(" +  string(i) + ");";
+
+  execute ringstr;
+  execute modulestr;
+  r;
+  j;
+  std(j);
+}
+
+proc check_std_all_1(int n, string ostring)
+{
+  check_ideal_std(n, ostring);
+  check_module_std(n, "(C," + ostring + ")");
+  check_module_std(n, "(c," + ostring + ")");
+  check_module_std(n, "(" + ostring + ",C)");
+  check_module_std(n, "(" + ostring + ",c)");
+}
+
+list orderings = "lp", "dp", "Dp", "ls", "ds", "Ds";
+
+list l = "dp";
+
+  
+proc check_std(int n, list olist)
+{
+  int i;
+  int j;
+  for (i=1; i<=size(olist); i++)
+  {
+    for (j=1; j<=n; j++)
+    {
+      check_ideal_std(j, olist[i]);
+    }
+  }
+}
+
+proc check_std_all(int n, list olist)
+{
+  int i;
+  int j;
+  for (i=1; i<=size(olist); i++)
+  {
+    for (j=1; j<=n; j++)
+    {
+      check_std_all_1(j, olist[i]);
+    }
+  }
+}
+
+option(prot);
+
+check_std_all(9, orderings)
+
+quit;
+
Index: Tst/Old/stdhilb.tst
===================================================================
--- Tst/Old/stdhilb.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/stdhilb.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,35 @@
+intvec hi;
+ring r0=0,(x,y,z),dp;
+module mm=
+(x2z2-xy2z)*gen(1)-(x2zy2+xyz3)*gen(3)+(xy2+xyz)*gen(2),
+(xy+yz)*gen(1)-(xz2-xyz)*gen(3)+(y+z)*gen(2),
+(x3y2z+xy3z2)*gen(1)-(x3y2+y3z2)*gen(2),
+(x3+y3+z3)*gen(1)+(x3y-y2z2)*gen(3)-(xy+yz+xz)*gen(2);
+module nn=std(mm);
+attrib(nn,"isHomog");
+intvec we=-9,-8,-10;
+hi=hilb(nn,1);
+hi;
+ring r1=0,(x,y,z),(C,lp);
+module mm=fetch(r0,mm);
+module nn=std(mm);
+module nm=std(mm,hi);
+int i;
+for(i=1;i<=size(nn);i++)
+{
+  nn[i]-nm[i];
+}
+setring r0;
+attrib(nn,"isHomog",we);
+hi=hilb(nn,1);
+hi;
+setring r1;
+mm=fetch(r0,mm);
+attrib(mm,"isHomog",we);
+nm=std(mm,hi);
+for(i=1;i<=size(nn);i++)
+{
+  nn[i]-nm[i];
+}
+$
+
Index: Tst/Old/string.tst
===================================================================
--- Tst/Old/string.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/string.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,149 @@
+//
+// test script for string command
+//
+proc last
+{
+  string @s = #[1];
+  int    @i = size(@s);
+  return (@s[@i,1]);
+}
+proc pos
+{
+  int @start;
+  if (size(#) == 2)
+  {
+    @start = 1;
+  }
+  if (size(#) == 3)
+  {
+    @start = #[3];
+  }
+  string @s = #[1];
+  int    @l = size(#[2]);
+  //"start:",@start;
+  //"end<",size(@s);
+  //"arg1:",#[1];
+  //"arg2:",#[2];
+  //"arg:",@s;
+  //"len:",@l;
+  for (int @i=@start; @i<size(@s); @i=@i+1)
+  {
+    //"test >>"+@s[@i,@l]+"<< und >>"+#[2]+"<<";
+    if (@s[@i,@l] == #[2])
+    {
+      return(@i);
+    }
+  }
+  return (0);
+}
+proc max
+{
+  if (#[1] < #[2])
+  {
+    return (#[2]);
+  }
+  return (#[1]);
+}
+"string sss = \"dum di dum\"";string sss = "dum di dum";
+"pos(sss,\"di d\")", pos(sss,"di d");
+"sss",sss;
+"\"dum di dum\"[2,6]","dum di dum"[2,6];
+"size(sss)", size(sss);
+"sss[10,1]", sss[10,1];
+"last(sss)", last(sss);
+"sss[1,size(sss)-1]",sss[1,size(sss)-1];
+"size(\"dddd sss\")",size("dddd sss");
+
+string eee =
+"1234567890",
+"1234567890",
+"12345+7890",
+"1234567890",
+"123456+890",
+"1234567890",
+"1234+67890",
+"12345+7890",
+"1234567890",
+"123456+890",
+"1234567890",
+"1234+67890",
+"12345+7890",
+"1234567890",
+"123456+890",
+"1234567890",
+"1234+67890",
+"12345+7890",
+"1234567890",
+"123456+890",
+"1234567890",
+"1234A67890",
+"12345A7890",
+"1234567890",
+"123456A890",
+"1234567890",
+"1234A67890",
+"12345A7890",
+"1234567890",
+"123456A890",
+"1234567890",
+"1234A67890",
+"1234567+90",
+"1234567890";
+eee;
+proc split
+{
+  string @s = #[1];
+  int @ipos = pos(@s,"+");
+  if ((@ipos <= 1) || (@ipos > 60))
+  {
+    @s;
+    return("");
+  }
+  if (size(@s) < 60)
+  {
+    @s;
+    return("");
+  }
+
+  int @i = 0;
+  int @j = 0;
+  while (1)
+  {
+    @i = pos(@s,"+",@j+1);
+    if ((@i>60) || (@i==0))
+    {
+      @s[1,@j], "--MM";
+      @s = split(@s[@j+1,size(@s)-@j]);
+      return("");
+    }
+    @j = @i;
+  }
+
+  return("");
+}
+eee = ".......",split(eee);
+"--------------------------------";
+string s1="He said:";
+string s2="\"It is true!\" ";
+string s3="\"It is false!\" ";
+string s4=s1+" "+s2;
+s4;
+"------------------------------";
+string s5=s1+" "+s3;
+s5;
+"------------------------------";
+s1,s2;
+"------------------------------";
+s1[0];
+s1[1];
+s1[5];
+s1[8];
+s1[9];
+s1[0]=".";
+s1[1]=".";
+s1[5]=".";
+s1[8]=".";
+s1[9]=".";
+
+listvar(all);
+$
Index: Tst/Old/subexpr.tst
===================================================================
--- Tst/Old/subexpr.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/subexpr.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,17 @@
+pagelength = 1000;
+ring r= 32003,(x,y,z),lp;
+ideal i = x,y,z,x2z,yxz;
+i;
+i[2..3] = 3,4;                         // overwrite elems 2 .. 3
+i;
+matrix m[2][2] = i;                    // four elems from i
+m;
+m[1..2,1] = 1,2;                       // overwrite m[1,1], m[2,1]
+m;
+matrix mm[5][5];
+mm[2..4,2..4] = 1,1,1,1,1,1,1,1,1;     // obvious ?
+LIB "lib";                             // make formmat available
+formmat(mm);
+kill r;
+memory(0);
+$;
Index: Tst/Old/subexpr1.tst
===================================================================
--- Tst/Old/subexpr1.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/subexpr1.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,42 @@
+//
+// examples for subexpr notation in matrices and ideals
+//
+LIB "lib";
+pagelength = 1000;
+ring r = 33,(x,y,z),lp;
+matrix mm[5][5] = x1,x2,x3,x4,x5;
+     mm[1,1..5];
+     mm[2,1..5];
+     mm[3,1..5];
+     mm[4,1..5];
+     mm[5,1..5];
+"----------------";
+mm[1..5,1] = mm[1,1..5];
+     mm[1,1..5];
+     mm[2,1..5];
+     mm[3,1..5];
+     mm[4,1..5];
+     mm[5,1..5];
+"----------------";
+3 * mm[1..5,1];
+"----------------";
+mm[1..5,1] * 4;
+mm[1..5,2] = mm[1..5,1] + 2 * mm[1..5,1];
+"----------------";
+     mm[1,1..5];
+     mm[2,1..5];
+     mm[3,1..5];
+     mm[4,1..5];
+     mm[5,1..5];
+"----------------";
+fixmat(mm,6);  // formmat(mm) would be slower !!
+mm[1..3,1..3] = stransp(3,3,mm[1..3,1..3]);
+"----------------";
+fixmat(mm,6);
+//pause;
+matrix u[8][8] = unitmat(8,4);
+"----------------";
+fixmat(u,3);
+kill r;
+memory(0);
+$
Index: Tst/Old/substit.tst
===================================================================
--- Tst/Old/substit.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/substit.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,27 @@
+//
+// test script for subst command
+//
+pagelength = 10000;
+ring r1 = 0,(x,y,z),dp;
+r1;
+"-------------------------------";
+poly s1=x2+z3+x+2y+2z;
+s1;
+subst(s1,x,2);
+"-----------------------------";
+vector v=[x2,x,0,y2];
+v;
+subst(v,y,8);
+"----------------------------";
+ideal i=s1,z3;
+i;
+subst(i,z,-2);
+"----------------------------";
+module m=v,[0,x2,y2];
+int a=4;
+m;
+subst(m,x,a);
+"-----------------------------";
+listvar(all);
+kill r1;
+$;
Index: Tst/Old/sud2.tst
===================================================================
--- Tst/Old/sud2.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/sud2.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,16 @@
+LIB "deform.lib";
+option(prot);
+ring r4=0,(w(1..9),x,y,z),(dp);
+ideal i=
+w(1)-z,w(2)-xz,w(3)-x2z,w(4)-yz,w(5)-xyz,w(6)-x2yz,w(7)-y2z,w(8)-xy2z,w(9)-y3z;
+ideal j;
+j=eliminate(i,xyz);
+ring rr=0,(w(1..9)),dp;
+ideal j=imap(r4,j);
+//a fat point!!   T1=1,T2=6;  A^2=0 ";
+int time=timer;
+miniversal(j);   
+setring Ont; 
+jetF;jetJ;
+"time";timer-time;
+$ 
Index: Tst/Old/sud3.tst
===================================================================
--- Tst/Old/sud3.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/sud3.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,16 @@
+LIB "deform.lib";
+option(prot);
+ring r4=32003,(w(1..9),x,y,z),(dp);
+ideal i=
+w(1)-z,w(2)-xz,w(3)-x2z,w(4)-yz,w(5)-xyz,w(6)-x2yz,w(7)-y2z,w(8)-xy2z,w(9)-y3z;
+ideal j;
+j=eliminate(i,xyz);
+ring rr=32003,(w(1..9)),dp;
+ideal j=imap(r4,j);
+//a fat point!!   T1=1,T2=6;  A^2=0 ";
+int time=timer;
+miniversal(j);   
+setring Ont; 
+jetF;jetJ;
+"time";timer-time;
+$ 
Index: Tst/Old/syzygies.tst
===================================================================
--- Tst/Old/syzygies.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/syzygies.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,64 @@
+test(11);
+ring r=31991,(x,y,z,w),(c,dp);
+ideal regsec1=x2+x2y+x3,y2+y2z+y3,z2+z2w+z3,w2+w2x+w3;
+ideal regsec2=x2*(1+y+yz+yzw),y2*(1+z+zw+zwx),z2*(1+w+wx+wxy);
+ideal regsec3=x3+yz4+zw4,y3+z4w+w4x,z3+wx4+xy4,w3+x4y+y4z;
+module syz1=syz(regsec1);
+matrix m1[1][1]=matrix(regsec1);
+matrix s1[1][1]=matrix(syz1);
+m1*s1;
+module syz2=syz(regsec2);
+m1=matrix(regsec2);
+s1=matrix(syz2);
+m1*s1;
+module syz3=syz(regsec3);
+m1=matrix(regsec3);
+s1=matrix(syz3);
+m1*s1;
+syz1;
+syz2;
+syz3;
+kill r;
+ring r1=31991,(x,y,z,w),(c,ls);
+test(-11,17);
+ideal regsec4=x2+x2y+x3,y2+y2z+y3,z2+z2w+z3,w2+w2x+w3;
+ideal regsec5=x2*(1+y+yz+yzw),y2*(1+z+zw+zwx),z2*(1+w+wx+wxy);
+ideal regsec6=x3+yz4+zw4,y3+z4w+w4x,z3+wx4+xy4,w3+x4y+y4z;
+module syz4=syz(regsec4);
+matrix m1[1][1]=matrix(regsec4);
+matrix s1[1][1]=matrix(syz4);
+m1*s1;
+module syz5=syz(regsec5);
+m1=matrix(regsec5);
+s1=matrix(syz5);
+m1*s1;
+module syz6=syz(regsec6);
+m1=matrix(regsec6);
+s1=matrix(syz6);
+m1*s1;
+syz4;
+syz5;
+syz6;
+kill r1;
+ring r2=0,(t,x,y,z,w),(c,dp);
+test(-17,26);
+ideal regsec7=x2+x2y+x3,y2+y2z+y3,z2+z2w+z3,w2+w2x+w3;
+ideal regsec8=x2*(1+y+yz+yzw),y2*(1+z+zw+zwx),z2*(1+w+wx+wxy);
+ideal regsec9=x3+yz4+zw4,y3+z4w+w4x,z3+wx4+xy4,w3+x4y+y4z;
+module syz7=syz(homog(regsec7,t));
+matrix m1[1][1]=matrix(homog(regsec7,t));
+matrix s1[1][1]=matrix(syz7);
+m1*s1;
+module syz8=syz(homog(regsec8,t));
+m1=matrix(homog(regsec8,t));
+s1=matrix(syz8);
+m1*s1;
+module syz9=syz(homog(regsec9,t));
+m1=matrix(homog(regsec9,t));
+s1=matrix(syz9);
+m1*s1;
+syz7;
+syz8;
+syz9;
+$
+
Index: Tst/Old/syzygy.tst
===================================================================
--- Tst/Old/syzygy.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/syzygy.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,24 @@
+//
+// test script for syz command
+//
+pagelength = 10000;
+ring r1 = 32003,(x,y,z),(c,ls);
+r1;
+"-------------------------------";
+ideal i1=maxideal(3);
+ideal i2=x6,y4,z5,xy,yz,xz;
+i2;
+syz(i2);
+"---------------------------------";
+i1;
+syz(i1);
+"----------------------------------";
+vector v1=[x4,y2,z2,2z2];
+vector v2=[yz,xy,xz,2xy];
+module m=v1,v2;
+m;
+syz(m);
+"--------------------------------";
+listvar(all);
+kill r1;
+$;
Index: Tst/Old/teste.tst
===================================================================
--- Tst/Old/teste.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/teste.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,15 @@
+//
+// test script for test command
+//
+pagelength = 10000;
+//option(prot);
+ring r1=32003,(a,b,x,y,z),ls;
+r1;
+"--------------------------";
+test(0,8,15);
+test(-15,24);
+option();
+"--------------------------";
+listvar(all);
+kill r1;
+$;
Index: Tst/Old/time.tst
===================================================================
--- Tst/Old/time.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/time.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,20 @@
+//
+// test script for timer command
+//
+pagelength = 10000;
+ring r = 13,(x,y),dp;
+r;
+"--------------------------";
+timer=1;
+poly s1=x2;
+s1;
+"------------------------";
+timer =20;
+s1;
+"-----------------------";
+timer=0;
+s1;
+"------------------------";
+listvar(all);
+kill r;
+$;
Index: Tst/Old/trac.tst
===================================================================
--- Tst/Old/trac.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/trac.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,27 @@
+//
+// test script for substring command
+//
+pagelength = 10000;
+ring r1 = 32003,(x,y,z),(c,dp);
+r1;
+"-------------------------------";
+matrix m1[2][2]=1,2,3,4;
+LIB "lib0";
+pmat(m1);
+trace(m1);
+"------------------------------";
+matrix m2[2][2]=x2,4y2,5z2,12xy;
+pmat(m2);
+trace(m2);
+"-----------------------------";
+matrix m3[2][2]=0,x2,4,y2;
+pmat(m3);
+trace(m3);
+"-----------------------------";
+matrix m4[2][3]=1,2,3,4,5,6;
+pmat(m4);
+trace(m4);
+"-------------------------------";
+listvar(all);
+kill r1;
+$;
Index: Tst/Old/trans.tst
===================================================================
--- Tst/Old/trans.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/trans.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,19 @@
+//
+// test script for transpose command
+//
+pagelength = 10000;
+ring r1 = 0,(x,y,z),dp;
+r1;
+"-------------------------------";
+matrix m1[2][3]=1,2,3,4,-1,0;
+LIB "lib0";
+pmat(m1);
+transpose(m1);
+"---------------------------------";
+matrix m2[3][2]=x2,y2,2z2,0,1,xz;
+pmat(m2);
+pmat(transpose(m2));
+"--------------------------------";
+listvar(all);
+kill r1;
+$;
Index: Tst/Old/typ.tst
===================================================================
--- Tst/Old/typ.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/typ.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,28 @@
+//
+// test script for type command
+//
+pagelength = 10000;
+//option(prot);
+ring r1=32003,(a,b,x,y,z),ls;
+r1;
+"--------------------------";
+poly s1=12;
+poly s2=x2;
+int k=10;
+ideal i=x2,y2;
+module m=[0,x2],[z4,0];
+type m;
+"---------------------------";
+type r1;
+"----------------------------";
+type s1;
+"---------------------------";
+type s2;
+"---------------------------";
+type k;
+"------------------------------";
+type i;
+"--------------------------";
+listvar(all);
+kill r1;
+$;
Index: Tst/Old/typof.tst
===================================================================
--- Tst/Old/typof.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/typof.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,16 @@
+//
+// test script for typeof command
+//
+pagelength = 10000;
+ring r1 = 0,(x,y,z),dp;
+r1;
+"--------------------------------";
+int i=10;
+string s=typeof(i);
+s;
+"--------------------------------";
+typeof(s);
+"------------------------------";
+listvar(all);
+kill r1;
+$;
Index: Tst/Old/universal.lst
===================================================================
--- Tst/Old/universal.lst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/universal.lst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,324 @@
+cmp
+barei
+bett
+ch
+col
+corner
+def
+degre
+dimens
+execut
+fetch
+freemod
+generat
+hilbert
+homo
+idea
+initial
+integ
+interred
+intersec
+jacobi
+jett
+kbas
+kil
+lif
+liftstan
+liste
+mapp
+matr
+maxdegr
+maxid
+minbas 
+mino
+modu
+mre
+mult
+normalf
+numvar
+opt
+order
+part
+pol
+preim
+prim
+qrin
+rang
+re
+regul
+ringdef
+row
+rvari
+setrin
+shor
+siz
+sre
+sstring
+substit
+syzygy
+teste
+time
+trans
+typ
+typof
+va
+vdimen
+vec
+wedg
+m1ex
+m2ex
+m3ex
+m4ex
+m5ex
+m7ex
+m8ex
+m9ex
+m10ex
+m11ex
+m13ex
+m15ex
+m16ex
+m17ex
+m18ex
+m19ex
+homlib
+polylib
+ringlib
+lamm
+alex2
+cyclic
+mora2
+weight2
+res2
+zahlen0
+aa
+formmat
+if
+alex1
+betti
+binomial
+bluff
+cring
+curve
+ord
+coef
+coeff
+dups
+echo
+ech
+err1
+err2
+err3
+err4
+err5
+err6
+err7
+sat
+fak
+filenest
+firsts
+gm
+h4
+hilb
+ideal
+idealop
+modul
+modul1
+modulo
+quot
+fastelim
+integers
+intvec
+intmat
+index
+jet
+lists
+longalg
+lpowers
+palg
+algmap
+algnorm
+det
+map
+imap
+matrix
+matrows
+mora1
+moralex
+nofile
+poly
+deg
+comp
+permutat
+preimage
+proc
+qring
+qring1
+regr1
+ring
+rings
+smm
+std1
+std_test
+stdhilb
+redtail
+string
+namof
+koszul
+res
+sres
+syzygies
+varlist
+qhw
+weight
+m1si
+m2si
+m3si
+m4si
+m5si
+m6si
+m7si
+m8si
+m9si
+m10si
+m11si
+m12si
+m13si
+m14si
+m15si
+m16si
+m17si
+m18si
+m19si
+m20si
+m21si
+m22si
+m23si
+m24si
+m25si
+m27si
+m28si
+m29si
+m30si
+m31si
+m32si
+m33si
+m34si
+m35si
+m36si
+m37si
+m38si
+m39si
+m40si
+m41si
+m42si
+m43si
+m44si
+m45si
+m46si
+m47si
+m48si
+m49si
+m50si
+m51si
+m52si
+m53si
+m54si
+m55si
+m56si
+m57si
+m58si
+m59si
+m60si
+m61si
+m62si
+m63si
+m64si
+m65si
+m66si
+m67si
+m68si
+m69si
+m70si
+m71si
+m72si
+m73si
+m74si
+m75si
+m76si
+m77si
+m78si
+m79si
+m80si
+m81si
+m82si
+m83si
+m84si
+m85si
+m86si
+m88si
+m89si
+m90si
+m91si
+m92si
+m93si
+m94si
+m95si
+m96si
+m97si
+m98si
+m99si
+m100si
+m101si
+m102si
+m103si
+m104si
+m105si
+m106si
+m107si
+m108si
+m109si
+m110si
+m111si
+m112si
+m113si
+m114si
+m115si
+m116si
+m117si
+m118si
+m119si
+m120si
+m121si
+m122si
+m123si
+m124si
+m125si
+m126si
+m127si
+m128si
+m129si
+m130si
+m131si
+m132si
+m133si
+m134si
+m135si
+m136si
+m137si
+m138si
+m139si
+m140si
+m141si
+m142si
+m143si
+m144si
+m145si
+m146si
+m147si
+m148si
+m149si
+m150si
+m151si
+m153si
+m154si
Index: Tst/Old/va.tst
===================================================================
--- Tst/Old/va.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/va.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,19 @@
+//
+// test script for var command
+//
+pagelength = 10000;
+ring r1 = 0,(x,y,z),dp;
+r1;
+varstr(r1,3);
+"-----------------------------------";
+ring r2=0,(x(1..10),y(1..9),z(1..8)),dp;
+r2;
+varstr(r2,10);
+varstr(r2,12);
+varstr(r2,22);
+varstr(basering,3);
+varstr(r2,28);
+"--------------------------------";
+listvar(all);
+kill r1;
+$;
Index: Tst/Old/varlist.tst
===================================================================
--- Tst/Old/varlist.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/varlist.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,12 @@
+proc foo
+{
+  "show all args for foo";
+  for (int @i = 1; @i<=size(#); @i=@i+1)
+  {
+    #[@i];
+  }
+  "show computed arg 4";
+  #[1000-999+3];
+}
+foo(3,4,5,6,7,8,9);
+$;
Index: Tst/Old/vdimen.tst
===================================================================
--- Tst/Old/vdimen.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/vdimen.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,26 @@
+//
+// test script for vdim command
+//
+pagelength = 10000;
+ring r1 = 0,(x,y,z),ds;
+r1;
+"--------------------------------";
+ideal i1=x2+y2,x2-y2,x2+z2,x2-z2;
+ideal j1=std(i1);
+i1;
+vdim(i1);
+lead(i1);
+j1;
+vdim(j1);
+lead(j1);
+"--------------------------------";
+vector v1=[x2+y2,y2-x2];
+vector v2=[x2,y2,z2];
+module m=v1,v2;
+vdim(m);
+module m1=std(m);
+vdim(m1);
+"--------------------------------";
+listvar(all);
+kill r1;
+$;
Index: Tst/Old/vec.tst
===================================================================
--- Tst/Old/vec.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/vec.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,28 @@
+//
+// test script for vector command
+//
+pagelength = 10000;
+ring r1 = 0,(x,y,z),ds;
+r1;
+"------------------------------";
+poly s1=12x2y4+34xyz5-78x2y4z2;
+poly s2=3*x^2*y^3+6*x^3*y^2*z^4;
+int i=2;
+int j=6;
+int k=45;
+poly s3=i*x^k*y^j+k*x^(i+j)*z^k;
+poly s4=7/9x3z7;
+poly s5=12;
+poly s6;
+vector v=[s1,s3-s2,s4-s1]+s5*gen(5);
+v;
+"------------------------------";
+vector v1=[x2,y2];
+v1;
+"----------------------------";
+vector v2=[1,0];
+v2;
+"----------------------------";
+listvar(all);
+kill r1;
+$;
Index: Tst/Old/wedg.tst
===================================================================
--- Tst/Old/wedg.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/wedg.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,24 @@
+//
+// test script for wedge command
+//
+pagelength = 10000;
+ring r1 = 0,(x,y,z),ds;
+r1;
+"--------------------------------";
+matrix m1[4][4]=1,2,3,4,-1,2,0,5,2,1,1,1,0,2,2,2;
+LIB "lib0";
+pmat(m1);
+pmat(wedge(m1,2));
+"--------------------------------";
+matrix m2[3][3]=x2,y4,z4,x4,x,y,z,0,1;
+pmat(m2);
+int a=3;
+pmat(wedge(m2,a));
+"-------------------------------";
+matrix m3[3][3]=1,1,2,2,1,1,2,2,1;
+pmat(m3);
+pmat(wedge(m3,2));
+"--------------------------------";
+listvar(all);
+kill r1;
+$;
Index: Tst/Old/weight.tst
===================================================================
--- Tst/Old/weight.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/weight.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,39 @@
+ring h1=32003,(t,x,y,z),dp;
+ideal i=
+9x8+y7t3z4+5x4y2t2+2xy2z3t2,
+9y8+7xy6t+2x5y4t2+2x2yz3t2,
+9z8+3x2y3z2t4;
+intvec E=weight(i);
+E;
+ring r1 = 32003,(a,b,c,d,e,f),dp;
+ideal i0 =
+a+b+c+d+e+f,
+ab+bc+cd+de+ef+fa,
+abc+bcd+cde+d*ef+efa+fab,
+abcd+bcde+cdef+defa+efab+fabc,
+abcde+bcdef+cdefa+defab+efabc+fabcd,
+abcdef+1;
+ring rm=32003,(g,h,l,m,n,o),dp;
+map f=r1,g,h,l3,m+n2,n,o2;
+ideal i=interred(f(i0));
+test(22);
+intvec e=weight(i);
+e;
+test(-22);
+ring sp= 32003,(t,x,y,z),dp; 
+ideal i=t18x2-t19z-t18z2,t26xy-t27z-t25z3,t38y2-t37xy; 
+intvec e=weight(i);
+e;
+test(22);
+test(9);
+ring al1=32003,(x,t,y,z),ds;
+option(weightM);
+ideal i=
+9x8+y7t3z4+5x4y2t2+2xy2z3t2,
+9y8+7xy6t+2x5y4t2+2x2yz3t2,
+9z8+3x2y3z2t4;
+ideal k=interred(i^2);
+degBound=1;
+ideal j=std(k);
+kill al1;
+$
Index: Tst/Old/weight2.tst
===================================================================
--- Tst/Old/weight2.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/weight2.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,233 @@
+ring h2=32003,(t,x,y,z),dp;
+ideal i=
+2t3x5y2z+x2t5y+2x2y,
+2y3z2x+3z2t6x2y+9y2t3z,
+2t5z+y3x2t+z2t3y2x5;
+intvec e=weight(i);
+e;
+//ring r=32003,(a,b,c,d),wp(e[1],e[2],e[3],e[4]);
+//map f=h2,a,b,c,d;
+//ideal k=f(i);
+//ideal k0=std(k);
+//"//size "+string(size(k0))+
+//", dim "+string(dim(k0))+", mult "+string(mult(k0))+
+//", lastdeg "+string(ord(k0[size(k0)])); 
+//kill r;
+kill h2,e;
+ring s6=32003,(x,y,z),dp;
+int a =6;
+int b =8;
+int c =10;
+int alpha =5;
+int beta= 5;
+int t= 0;
+poly f =x^a+y^b+z^c+x^alpha*y^(beta-5)+x^(alpha-2)*y^(beta-3);
+f=f+x^(alpha-3)*y^(beta-4)*z^2+x^(alpha-4)*y^(beta-4)*(y^2+t*x)^2;
+ideal i= jacob(f);
+i=i,f;
+intvec e=weight(i);
+e;
+//ring r=32003,(u,v,w),wp(e[1],e[2],e[3]);
+//map f=s6,u,v,w;
+//ideal k=f(i);
+//ideal k0=std(k);
+//"//size "+string(size(k0))+
+//", dim "+string(dim(k0))+", mult "+string(mult(k0))+
+//", lastdeg "+string(ord(k0[size(k0)])); 
+//kill r;
+kill s6,e,a,b,c,alpha,beta,t;
+
+ring s12=32003,(x,y,z,w),dp;
+ideal i0=x2-z10-z20,xy3-z10-z30,y6-xy3w40;
+ideal i=interred(i0^3);
+intvec e=weight(i);
+e;
+//ring r=32003,(u,v,a,b),wp(e[1],e[2],e[3],e[4]);
+//map f=s12,u,v,a,b;
+//ideal k=f(i);
+//ideal k0=std(k);
+//"//size "+string(size(k0))+
+//", dim "+string(dim(k0))+", mult "+string(mult(k0))+
+//", lastdeg "+string(ord(k0[size(k0)])); 
+//kill r;
+kill s12,e;
+
+ring pa= 32003,(k,h,g,f,e,d,c,b,a),dp;
+ideal i0= af2-f5,bg2-f4g,c3-f3gh,k-fgh3,df-fh4,ef-h5;
+ideal i=i0^2;
+intvec E=weight(i);
+E;
+//ring r=32003,(u,v,w,x,y,z,l,m,n),
+//wp(e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9]);
+//map g=pa,u,v,w,x,y,z,l,m,n;
+//ideal k0=g(i);
+//ideal j=std(k0);
+//"//size "+string(size(j))+
+//", dim "+string(dim(j))+", mult "+string(mult(j))+
+//", lastdeg "+string(ord(j[size(j)])); 
+//kill r;
+kill pa,E;
+
+ring r5=32003,(a,b,c,d,e),dp;
+ideal i =
+   47b6+94b3c2-71b3e2+91ab3-22b4+47c4+71b3d-67b3e-71c2e2-2e4+91b3+91ac2-22bc2
++71c2d-67c2e-21ae2-80be2+4de2+82e3+53a2-23ab-47b2+91c2+21ad+80bd-2d2+55ae+18be
+-82de-26e2+106a-23b+21d+55e+53,
+   -98b6-196b3c2+4b3e2-54ab3-81b4-98c4-4b3d-87b3e+4c2e2-51e4-54b3-54ac2-81bc2
+-4c2d-87c2e+22be2+102de2+92e3-28a2-53ab+70b2-54c2-22bd-51d2+86ae+27be-92de+73e2
+-56a-53b+86e-28,
+   49b6+98b3c2-49b3e2-54ab3+90b4+49c4+49b3d+57b3e-49c2e2-21e4-54b3-54ac2+90bc2
++49c2d+57c2e+18ae2-67be2+42de2-23e3+26a2-50ab+28b2-54c2-18ad+67bd-21d2-74ae+2be
++23de+58e2+52a-50b-18d-74e+26,
+   34b6+68b3c2-74b3e2-30ab3-56b4+34c4+74b3d+21b3e-74c2e2+9e4-30b3-30ac2-56bc2
++74c2d+21c2e-77ae2+66be2-18de2-26e3-69a2+38ab+26b2-30c2+77ad-66bd+9d2+50ae+29be
++26de-121e2-138a+38b+77d+50e-69,
+   -29b6-58b3c2+68b3e2+28ab3+89b4-29c4-68b3d-52b3e+68c2e2+13e4+28b3+28ac2+89bc2
+-68c2d-52c2e-17ae2+87be2-26de2+32e3-100a2-41ab-75b2+28c2+17ad-87bd+13d2+79ae-
+87be-32de+33e2-200a-41b+17d+79e-100;
+intvec E=weight(i);
+E;
+//ring r=32003,(u,v,w,x,y),wp(e[1],e[2],e[3],e[4],e[5]);
+//map g=r5,u,v,w,x,y;
+//ideal k0=g(i);
+//ideal j=std(k0);
+//"//size "+string(size(j))+
+//", dim "+string(dim(j))+", mult "+string(mult(j))+
+//", lastdeg "+string(ord(j[size(j)])); 
+//kill r;
+kill r5,E;
+
+ring p1=32003,(t,x,y,z,a,b,c,d,e),dp;
+ideal i =
+-y82a+x32z23,
+x45-y13z21b,
+y33z12-z41c,
+-y33z12d+z22,
+x5y17z22e-1,
+xyzt-1;
+intvec ew=weight(i);
+ew;
+//ring r=32003,(s,u,v,w,h,l,m,n,o),
+//wp(ew[1],ew[2],ew[3],ew[4],ew[5],ew[6],ew[7],ew[8],ew[9]);
+//map g=p1,s,u,v,w,h,l,m,n,o;
+//ideal k0=g(i);
+//ideal j=std(k0);
+//size(j);
+//ord(j[size(j)]);
+//kill r;
+kill p1,ew;
+
+test(9);
+option(weightM);
+ring vc= 32003,(x,y,z,t),ds;
+degBound=1;
+ideal i=
+49y5-9y4+41x2z+12y3+33y2+11y+73t,
+33y4+21x2y+17x2z+63y3+11xy+77y2+91y+1t,
+26y2+44xz+12y+9t;
+ideal k=i^2;
+ideal j = std(k);
+//"//size "+string(size(j))+
+//", dim "+string(dim(j))+", mult "+string(mult(j))+
+//", lastdeg "+string(ord(j[size(j)])); 
+degBound=0;
+kill vc;
+
+int N=3;
+ring ra3=32003,x(1..N),ds;  
+ideal i0= 
+  -7*x(1)^6-49*x(1)^5*x(2)+16*x(1)^4*x(2)^2+27*x(1)^3*x(2)^3-
+38*x(1)^2*x(2)^4+60*x(1)*x(2)^5+70*x(2)^6-28*x(1)^5*x(3)+85*x(1)^4*x(2)*x(3)+
+69*x(1)^3*x(2)^2*x(3)-13*x(1)^2*x(2)^3*x(3)-65*x(1)*x(2)^4*x(3)+51*x(2)^5*x(3)-
+70*x(1)^4*x(3)^2+37*x(1)^3*x(2)*x(3)^2+89*x(1)^2*x(2)^2*x(3)^2-
+82*x(1)*x(2)^3*x(3)^2+6*x(2)^4*x(3)^2-67*x(1)^3*x(3)^3+19*x(1)^2*x(2)*x(3)^3-
+12*x(1)*x(2)^2*x(3)^3-81*x(2)^3*x(3)^3+33*x(1)^2*x(3)^4-98*x(1)*x(2)*x(3)^4+
+51*x(2)^2*x(3)^4+11*x(1)*x(3)^5+11*x(2)*x(3)^5-39*x(3)^6,
+  5*x(1)^6-17*x(1)^5*x(2)-62*x(1)^4*x(2)^2+41*x(1)^3*x(2)^3-85*x(1)^2*x(2)^4+
+57*x(1)*x(2)^5-52*x(2)^6+80*x(1)^5*x(3)+19*x(1)^4*x(2)*x(3)-
+72*x(1)^3*x(2)^2*x(3)-34*x(1)^2*x(2)^3*x(3)-46*x(1)*x(2)^4*x(3)-
+6*x(2)^5*x(3)-33*x(1)^4*x(3)^2+44*x(1)^3*x(2)*x(3)^2-23*x(1)^2*x(2)^2*x(3)^2-
+60*x(1)*x(2)^3*x(3)^2+64*x(2)^4*x(3)^2+26*x(1)^3*x(3)^3-84*x(1)^2*x(2)*x(3)^3+
+35*x(1)*x(2)^2*x(3)^3-91*x(2)^3*x(3)^3-93*x(1)^2*x(3)^4+22*x(1)*x(2)*x(3)^4+
+  99*x(2)^2*x(3)^4-36*x(1)*x(3)^5+5*x(2)*x(3)^5+46*x(3)^6,
+-32*x(1)^6-73*x(1)^5*x(2)-43*x(1)^4*x(2)^2-55*x(1)^3*x(2)^3-83*x(1)^2*x(2)^4-
+50*x(1)*x(2)^5-74*x(2)^6-56*x(1)^5*x(3)+79*x(1)^4*x(2)*x(3)+
+86*x(1)^3*x(2)^2*x(3)-27*x(1)^2*x(2)^3*x(3)+28*x(1)*x(2)^4*x(3)+71*x(2)^5*x(3)+
+77*x(1)^4*x(3)^2-71*x(1)^3*x(2)*x(3)^2-63*x(1)^2*x(2)^2*x(3)^2-
+22*x(1)*x(2)^3*x(3)^2+17*x(2)^4*x(3)^2+58*x(1)^3*x(3)^3+31*x(1)^2*x(2)*x(3)^3+
+19*x(1)*x(2)^2*x(3)^3-36*x(2)^3*x(3)^3-15*x(1)^2*x(3)^4-9*x(1)*x(2)*x(3)^4+
+42*x(2)^2*x(3)^4-61*x(1)*x(3)^5-67*x(2)*x(3)^5+31*x(3)^6; 
+ring r=32003,(a,b,c),ds;
+map ff=ra3,a+b2,b2-c3,c;
+ideal i=ff(i0);
+ideal j=std(i);
+//"//size "+string(size(j))+
+//", dim "+string(dim(j))+", mult "+string(mult(j))+
+//", lastdeg "+string(ord(j[size(j)]));
+kill ra3,r,N;
+
+ring r1=32003,(t,x,y,z),ds;
+ideal i=
+5t3x2z+2t2y3x5,
+7y+4x2y+y2x+2zt,
+3tz+3yz2+2yz4;
+ideal j=std(i);
+//"//size "+string(size(j))+
+//", dim "+string(dim(j))+", mult "+string(mult(j))+
+//", lastdeg "+string(ord(j[size(j)]));
+kill r1;
+ 
+ring r2=32003,(x,y,z),ds;
+poly p1 = 1x3y2+21328x5y+10667x2y4+21328x2yz3+10666xy6+10667y9;
+poly p2 = 1x2y2z2+3z8;
+poly p3 = 5x4y2+4xy5+2x2y2z3+1y7+11x10;
+ideal i=p1,p2,p3;
+ideal j=std(i);
+//"//size "+string(size(j))+
+//", dim "+string(dim(j))+", mult "+string(mult(j))+
+//", lastdeg "+string(ord(j[size(j)]));
+kill r2;
+
+ring r12=32003,(x,y,z,w),ds;
+ideal i=x2-z10-z20,xy3-z10-z30,y6-xy3w40;
+ideal j=std(i);
+//"//size "+string(size(j))+
+//", dim "+string(dim(j))+", mult "+string(mult(j))+
+//", lastdeg "+string(ord(j[size(j)]));
+kill r12;
+
+ring r17=32003,(x,y,z),ds;
+ideal i=
+1x3+1y4+2xz3+1z5+32000x4y2+2z6+3z7,
+1xz3+32001x4y2+1z6+2z7,
+9x3z2+18x2z5+31998z7+12x4y2z2+42x2z6+40x3y2z4+7z9+24x3y2z5,
+31999y3z3+31991x6y+32x3y5+32001x4yz3,
+12xy3z2+6x5yz2+24y3z5+20x4yz4+56y3z6+12x4yz5;
+ideal j=std(i);
+//"//size "+string(size(j))+
+//", dim "+string(dim(j))+", mult "+string(mult(j))+
+//", lastdeg "+string(ord(j[size(j)]));
+kill r17;
+
+ring r18=32003,(t,x,y,z),ds;
+ideal i=
+4t2z+6z3t+3z3+tz,
+5t2z7y3x+5x2z4t3y+3t7,
+6zt2y+2x8+6z2y2t+2y5;
+ideal j=std(i);
+//"//size "+string(size(j))+
+//", dim "+string(dim(j))+", mult "+string(mult(j))+
+//", lastdeg "+string(ord(j[size(j)]));
+kill r18;
+ 
+ring r5=32003,(x,y,z),ds;
+int a=7;
+poly f =xyz*(x+y+z)^2 +(x+y+z)^3 +x^a+y^a+z^a;
+ideal i= jacob(f);
+test(-9);
+ideal j=std(i);
+//"//size "+string(size(j))+
+//", dim "+string(dim(j))+", mult "+string(mult(j))+
+//", lastdeg "+string(ord(j[size(j)]));
+kill r5;
+$
Index: Tst/Old/zahlen0.tst
===================================================================
--- Tst/Old/zahlen0.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Old/zahlen0.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,255 @@
+option(prot);
+ring cy=0,(a,b,c,d,e),dp;
+int n=5;
+
+ideal i=
+a^n+b,b^n+c,c^n+d,d^n+e,a+b+c+e;
+i=std(i);
+qring q=i;
+poly p2=de+ab;
+poly p3=cde+abc;
+poly p4=bcde+abde+abce+abcd;
+poly p5=a+b+c+d;
+
+module m1=
+p2*gen(2),
+p2*gen(1)+p3*gen(2),
+p3*gen(1)+p4*gen(2),
+p4*gen(1)+p5*gen(2),
+p5*gen(1);
+option(redSB);
+option();
+module j=std(m1);
+option(noredSB);
+option(noredTail);
+option();
+module k=std(m1);
+j;
+k;
+int h=size(j);
+h;
+size(k);
+int s;
+for(s=1;s<=h;s=s+1)
+{
+  NF(k[s],j);
+}
+for(s=1;s<=h;s=s+1)
+{
+  NF(j[s],k);
+}
+kill cy,h,s,n;
+
+ring s1=(0,a),(x,y,z,w),dp;
+ideal i0=(a2-1)*x2-z10-z20,(a+1)*xy3-z10-z30,y6-(a+1)*xy3w40;
+option();
+ideal i = std(i0);
+option(redTail);
+option();
+ideal i1 = std(i0);
+i;
+i1;
+int h=size(i);
+h;
+size(i1);
+int s;
+for(s=1;s<=h;s=s+1)
+{
+  NF(i1[s],i);
+}
+for(s=1;s<=h;s=s+1)
+{
+  NF(i[s],i1);
+}
+kill s1,h,s;
+
+
+ring s2=(0,a),(x,y,z,w),dp;
+minpoly=8a4+1;
+ideal j0=(a2-1)*x2-z10-z20,(a+1)*xy3-z10-z30,y6-(a+1)*xy3w40;
+option(noredTail);
+option();
+ideal i = std(j0);
+option(redTail);
+option();
+ideal i1 = std(j0);
+i;
+i1;
+int h=size(i);
+h;
+size(i1);
+int s;
+for(s=1;s<=h;s=s+1)
+{
+  NF(i1[s],i);
+}
+for(s=1;s<=h;s=s+1)
+{
+  NF(i[s],i1);
+}
+kill s2,h,s;
+
+
+ring s3=(32003,a),(x,y,z,w),dp;
+ideal k0=(a2-1)*x2-z10-z20,(a+1)*xy3-z10-z30,y6-(a+1)*xy3w40;
+option(noredTail);
+option();
+ideal i = std(k0);
+option(redTail);
+option();
+ideal i1 = std(k0);
+i;
+i1;
+int h=size(i);
+h;
+size(i1);
+int s;
+for(s=1;s<=h;s=s+1)
+{
+  NF(i1[s],i);
+}
+for(s=1;s<=h;s=s+1)
+{
+  NF(i[s],i1);
+}
+kill s3,h,s;
+
+
+ring s4=(32003,a),(x,y,z,w),dp;
+minpoly=8a4+1;
+ideal l0=(a2-1)*x2-z10-z20,(a+1)*xy3-z10-z30,y6-(a+1)*xy3w40;
+option(noredTail);
+option();
+ideal i = std(l0);
+option(redTail);
+option();
+ideal i1 = std(l0);
+i;
+i1;
+int h=size(i);
+h;
+size(i1);
+int s;
+for(s=1;s<=h;s=s+1)
+{
+  NF(i1[s],i);
+}
+for(s=1;s<=h;s=s+1)
+{
+  NF(i[s],i1);
+}
+kill s4,h,s;
+
+int m,n;
+ring r1 = 0,(z,y,x),ds;
+poly s1=2x5y+7x2y4+3x2yz3;
+poly s2=1x2y2z2+3z8;
+poly s3=4xy5+2x2y2z3+11x10;
+ideal i=s1,s2,s3;
+option(noredTail);
+option();
+ideal j=std(i);
+hilb(j,1);
+option(redSB);
+option();
+ideal j1=std(i);
+hilb(j1,1);
+option(redTail);
+ideal j2=std(i);
+hilb(j2,1);
+
+n=size(j);
+number x1,x2;
+for(m=1;m<=n;m=m+1)
+{
+x1=leadcoef(j1[m]);
+x2=leadcoef(j2[m]);
+if(x1 != x2)
+{
+"?????";
+j2[m]=x1*j2[m];
+j1[m]=x2*j1[m];
+}
+j1[m]-j2[m];
+NF(j[m],j1);
+NF(j1[m],j);
+}
+j2;
+option(noredSB);
+option(noredTail);
+kill r1;
+
+ring r4 =0,(a,b,c,d,e),ds;
+n=6;
+poly s1=a+b+c+d+ea;
+poly s2=de+1cd+1bc+1ae+1ab;
+poly s3=cde+1bcd+1ade+1abe+1abc;
+poly s4=bcde+1acde+1abde+1abce+1abcd;
+poly s5=abcde;
+ideal i=s1,s2,s3,s4,s5,b^n,c^n,d^n,e^n;
+ideal j=std(i);
+option(redTail);
+ideal j1=std(i);
+option(redSB);
+ideal j2=std(i);
+
+n=size(j);
+number x1,x2;
+for(m=1;m<=n;m=m+1)
+{
+x1=leadcoef(j1[m]);
+x2=leadcoef(j2[m]);
+x1*lead(j2[m])-x2*lead(j1[m]);
+x2=leadcoef(j[m]);
+x1*lead(j[m])-x2*lead(j1[m]);
+NF(j[m],j2);
+NF(j2[m],j);
+}
+j2;
+
+kill r4;
+
+option(noredTail);
+ring r=
+0,(x,y,z),ls;
+poly f=x5+y11+xy9+x3y9+z6-z2x2y2;
+ideal i=jacob(f);
+ideal j=std(i);
+option(redTail);
+ideal j1=std(i);
+n=size(j);
+number x1,x2;
+for(m=1;m<=n;m=m+1)
+{
+x1=leadcoef(j1[m]);
+x2=leadcoef(j[m]);
+x1*lead(j[m])-x2*lead(j1[m]);
+}
+option(noredSB);
+
+ring r1 = 0,(z,y,x),dp;
+ideal i = x2y2-z4,y2z2-x4;
+i=std(i);
+qring s=i;
+poly s1=2x5y+7x2y3;
+poly s2=1x2y2+3z7;
+poly s3=4xy5+2x2yz3;
+poly s4=x6+y6+z6;
+module m0=
+s1*gen(1)+s4*gen(2),s2*gen(2)+s3*gen(3),
+s2*gen(1)+s1*gen(2),s3*gen(2)-s4*gen(3);
+option(noredTail);
+module m1=std(m0);
+option(redSB);
+option(redTail);
+module m2=std(m0);
+m1;
+m2;
+int cc;
+for(cc=1;cc<31;cc=cc+1)
+{
+NF(m1[cc],m2);
+NF(m2[cc],m1);
+}
+
+$
Index: Tst/README
===================================================================
--- Tst/README	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/README	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,84 @@
+README file for Singular test-suite
+===================================
+
+This is the test-suite for Singular. This directory contains 
+
+regress.cmd	-- perl script which drives tests
+Short		-- directory containing "short" tests
+Long		-- directory containing "long" tests
+Old		-- directory containing "old" (TST) tests
+
+To run Singular test(s):
+------------------------
+1.) Put the Singular binary in this directory
+2.) cd to one of the directories above
+3.) run 
+     ../regress.cmd [*.tst] [*.lst]
+    with the desired tst (i.e., Singular test scripts) or lst (list 
+    of tst files) file(s).
+4.) For each file xx.tst, 
+      ../Singular -tqr12345678 xx.tst > xx.new.tst
+      diff xx.res xx.new.res | tee xx.diff
+    is run. 
+5.) If no diffs were found, xx.diff and xx.new.res are rm'ed and
+    xx.res is gzip'ed. Otherwise (i.e., diffs were found), xx.diff and
+    xx.new.res are kept, diffs are printed to stdout, and regress.cmd
+    exits with exit status != 0.
+
+Do also 
+   ../regress.cmd -h
+for some more details on regress.cmd.
+
+To add a new test for a library/commando to the test-suite:
+-----------------------------------------------------------
+* The following files need to be provided:
+	short/xx_s.tst : Singular code for short and basic tests 
+	long/xx_l.tst : Singular code for long and extended tests
+	short/xx_s.res : Result output of xx_s.tst
+	long/xx_l.res : Result output of xx_l.tst
+  or, alternatively:
+        short/xx.tst: Singular code for short tests, only
+	short/xx.res : Result output of xx.tst
+
+* xx_s.tst should test the essential functionality of the
+  library/commando in a relatively short time (say, in no more than
+  30s).
+
+* xx_l.tst should test the functionality of the
+  library/commando in detail so that, if possible, all relevant
+  cases/results are tested. Nevertheless, such a test should not run
+  longer than, say, 10 minutes.
+
+* If useful test do generally execute in a short time, have xx.tst,
+  only.
+
+* Rules for providing tst files:
+  1.) tst files always start with the following three commandos as
+  preamble: 
+         LIB "tst.lib";
+         tst_init();
+	 tst_ignore("CVS ID $Id:$");
+  tst_init() writes some general info to stdout (like date,
+  uname, hostname, version, etc.). The library tst.lib (appended
+  below) provides, among others, the routines tst_init() and
+  tst_ignore(). 
+
+  2.) All system-dependent output (like run-times, memory usages,
+  pathnames, dates, etc.) must be output by means of the routine
+  tst_ignore(...):
+  tst_ignore(val [, keyword]): 'val' can have arbitrary type for which
+                               a string conversion exists;
+                               if present, keyword must be one of the
+                               following strings: "time", "memory"
+  tst_ignore() outputs 'val' by prepending the following prefix:
+  no keyword --       // ignore: 
+  "time" keyword --   // ignore: time:
+  "memory" keyword -- // ignore: memory:
+  which causes automatic tests to ignore these lines when doing a diff 
+  on result files. If possible, short tests should not contain
+  system-dependent output. 
+
+* Command for generating *.res files: 
+  cd <directopry where xx.tst should reside>; ../regress.cmd -g xx.tst
+
+
Index: Tst/Short/dbm_s.tst
===================================================================
--- Tst/Short/dbm_s.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Short/dbm_s.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,70 @@
+LIB "tst.lib";
+
+tst_init();
+tst_ignore("CVS: $Id: dbm_s.tst,v 1.1.1.1 1998-04-17 15:07:41 obachman Exp $");
+
+"==============================================";
+" DBM link tests ";
+
+proc read_dbm_all (link l)
+{
+  string s="";
+  s=read(l);
+  while( s != "" ) 
+  {
+    s,"=",read(l,s);
+    s=read(l);
+  }
+}
+proc read_dbm (link l)
+{
+  string s="";
+  s=read(l);
+  if( s != "" ) { s,"=",read(l,s); }
+}
+
+link l1="DBM:rw db1";
+link l2="DBM:rw db2";
+l1;
+
+int i;
+
+for(i=1;i<=5; i++)
+{
+  write(l1,"Key"+string(i), "Value"+string(i));
+  write(l2,"Key"+string(i), "DB 2 : Value"+string(i));
+}
+read_dbm(l1);
+read_dbm(l1);
+read_dbm(l2);
+read_dbm(l1);
+"**********************************************";
+read_dbm_all(l2);
+"**********************************************";
+read_dbm_all(l1);
+"**********************************************";
+write(l1,"Key4", "NewValue4");
+read(l1,"Key4");
+write(l1,"Key2");
+read(l1,"Key2");
+l2="DBM:r db2";
+write(l2,"Key4");
+l1="DBM: db1";
+write(l1,"Key4");
+close(l1);
+close(l2);
+kill l1,l2;
+"**********************************************";
+string s="12345678901234567890123456789012345678901234567890";
+string t500=s+s+s+s+s+s+s+s+s+s;
+string t1k=t500+t500;
+link l="DBM:rw test";
+write(l,"a2",s);
+read(l,"a2");
+write(l,"a1",t1k);
+read(l,"a2");
+read(l,"a1");
+i=system("sh", "/bin/rm -f db1.dir db1.pag db2.dir db2.pag");
+i=system("sh", "/bin/rm -f test.dir test.pag");
+
+quit;
Index: Tst/Short/fetch_s.tst
===================================================================
--- Tst/Short/fetch_s.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Short/fetch_s.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,62 @@
+proc generate_ring_str(int n, string r_name, string ostring)
+{
+  return ("ring "+r_name+" = 32003,x(1.." + string(n) + ")," + ostring + ";");
+}
+
+proc generate_polys_str(int n)
+{
+  string polystr = "poly p = ";
+  int i;
+
+  for (i=1; i<=n; i = i + (i / 10) + 1)
+  {
+    polystr = polystr + "x(" + string(i) + ") + ";
+  }
+  return (polystr + "1; poly p1 = p^2+p; vector p2 = (p^2+p)*(gen(2) + gen(3)); vector p3 = (p^2+p)*(gen(2) + gen(3))+ p^2 + p; vector p4 = p3 + p^3;p; p1; p2; p3; p4");
+}
+
+proc generate_weight_str(int j)
+{
+  int i;
+  string res_str = "(";
+  
+  for (i=1; i<j; i++)
+  {
+    res_str = res_str + string(i) + ",";
+  }
+  return (res_str + string(j) + ")");
+}
+
+
+list orderings = "lp", "dp", "Dp", "ls", "ds", "Ds";
+
+proc check_fetch(int n, list olist)
+{
+  int i;
+  int j;
+  
+  for (j=1; j<=n; j = j + (j / 10) + 1)
+  {
+    execute generate_ring_str(j, "r", olist[1]);
+    execute generate_polys_str(j);
+    for (i=1; i<=size(olist); i++)
+    {
+      execute generate_ring_str(j, "r1", olist[i]);
+      fetch(r, p);
+      fetch(r, p1);
+      fetch(r, p2);
+      fetch(r, p3);
+      fetch(r, p4);
+      r1;
+      kill r1;
+    }
+    kill r;
+  }
+}
+
+check_fetch(10, orderings);
+
+quit;
+  
+  
+
Index: Tst/Short/fglm1_s.tst
===================================================================
--- Tst/Short/fglm1_s.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Short/fglm1_s.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,93 @@
+// $Id: fglm1_s.tst,v 1.1.1.1 1998-04-17 15:07:41 obachman Exp $
+
+//
+// fglm_s.tst - short tests for fglm and stdfglm
+//              fglm: reco1, omdi, cyclic5 in char 32003 and 0
+//           stdfglm: caprasse in char 32003 and 0
+//
+
+
+LIB "tst.lib";
+tst_init();
+tst_ignore("CVS: $Id: fglm1_s.tst,v 1.1.1.1 1998-04-17 15:07:41 obachman Exp $");
+
+option(redSB);
+
+// =================
+// reco1, char 32003
+ring r=32003,(x,y), dp;
+ideal i= jacob(x5+y11+xy9+x3y9);
+ideal is=std(i);
+ring s=32003,(x,y), lp;
+fglm(r,is);
+kill r,s;
+
+// =============
+// reco1, char 0
+ring r=0,(x,y), dp;
+ideal i= jacob(x5+y11+xy9+x3y9);
+ideal is=std(i);
+ring s=0,(x,y), lp;
+fglm(r,is);
+kill r,s;
+
+// ===============================================
+// omdi, char 32003, with permutation of variables
+ring r=32003,(a,b,c,u,v,w,x,y,z), dp;
+ideal i=a+c+v+2x-1, ab+cu+2vw+2xy+2xz-2/3, ab2+cu2+2vw2+2xy2+2xz2-2/5, ab3+cu3+2vw3+2xy3+2xz3-2/7, ab4+cu4+2vw4+2xy4+2xz4-2/9, vw2+2xyz-1/9, vw4+2xy2z2-1/25, vw3+xyz2+xy2z-1/15, vw4+xyz3+xy3z-1/21;
+ideal is=std(i);
+ring s=32003,(u,v,w,x,y,z,a,b,c), lp;
+fglm(r,is);
+kill r,s;
+
+// ============
+// omdi, char 0
+ring r=0,(a,b,c,u,v,w,x,y,z), dp;
+ideal i=a+c+v+2x-1, ab+cu+2vw+2xy+2xz-2/3, ab2+cu2+2vw2+2xy2+2xz2-2/5, ab3+cu3+2vw3+2xy3+2xz3-2/7, ab4+cu4+2vw4+2xy4+2xz4-2/9, vw2+2xyz-1/9, vw4+2xy2z2-1/25, vw3+xyz2+xy2z-1/15, vw4+xyz3+xy3z-1/21;
+ideal is=std(i);
+ring s=0,(a,b,c,u,v,w,x,y,z), lp;
+fglm(r,is);
+kill r,s;
+
+// ==========================================================
+// cyclic5, char 32003, with permutation of variables, Dp->lp
+ring r=32003,(a,b,c,d,e), Dp;
+ideal i=a+b+c+d+e, ab+bc+cd+ae+de, abc+bcd+abe+ade+cde, abcd+abce+abde+acde+bcde, abcde-1;
+ideal is=std(i);
+ring s=32003,(b,d,e,c,a), lp;
+fglm(r, is);
+kill r,s;
+
+// ===============
+// cyclic5, char 0
+ring r=0,(a,b,c,d,e), dp;
+ideal i=a+b+c+d+e, ab+bc+cd+ae+de, abc+bcd+abe+ade+cde, abcd+abce+abde+acde+bcde, abcde-1;
+ideal is=std(i);
+ring s=0,(a,b,c,d,e), lp;
+fglm(r, is);
+kill r,s;
+
+// =======================
+// cyclic5, char 0, Dp->dp
+ring r=0,(a,b,c,d,e), Dp;
+ideal i=a+b+c+d+e, ab+bc+cd+ae+de, abc+bcd+abe+ade+cde, abcd+abce+abde+acde+bcde, abcde-1;
+ideal is=std(i);
+ring s=0,(a,b,c,d,e), dp;
+fglm(r, is);
+kill r,s;
+
+// =======================================
+// caprasse, char 32003, lp, using stdfglm
+ring r=32003,(x,y,z,t), dp;
+ideal i= y2z+2xyt-2x-z, -x3z+4xy2z+4x2yt+2y3t+4x2-10y2+4xz-10yt+2, 2yzt+xt2-x-2z, -xz3+4yz2t+4xzt2+2yt3+4xz+4z2-10yt-10t2+2;
+stdfglm(i);
+kill r;
+
+// ===================================
+// caprasse, char 0, lp, using stdfglm
+ring r=0,(x,y,z,t), dp;
+ideal i= y2z+2xyt-2x-z, -x3z+4xy2z+4x2yt+2y3t+4x2-10y2+4xz-10yt+2, 2yzt+xt2-x-2z, -xz3+4yz2t+4xzt2+2yt3+4xz+4z2-10yt-10t2+2;
+stdfglm(i);
+kill r;
+
+quit;
Index: Tst/Short/finduni_s.tst
===================================================================
--- Tst/Short/finduni_s.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Short/finduni_s.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,30 @@
+// $Id: finduni_s.tst,v 1.1.1.1 1998-04-17 15:07:41 obachman Exp $
+
+//
+// finduni_s.tst - short tests for finduni
+//
+
+
+LIB "tst.lib";
+tst_init();
+tst_ignore("CVS: $Id: finduni_s.tst,v 1.1.1.1 1998-04-17 15:07:41 obachman Exp $");
+
+option(redSB);
+
+// ======================
+// cyclic 6 in char 32003
+ring r=32003,(a,b,c,d,x,f), dp;
+ideal i=a+b+c+d+x+f, ab+bc+cd+dx+xf+af, abc+bcd+cdx+d*xf+axf+abf, abcd+bcdx+cd*xf+ad*xf+abxf+abcf, abcdx+bcd*xf+acd*xf+abd*xf+abcxf+abcdf, abcd*xf-1;
+ideal is=std(i);
+finduni(is);
+kill r;
+
+// =================
+// walks-7 in char 0
+ring r=0,(a,b,c,d,e,f,g), dp;
+ideal i=2gb+2fc+2ed+a2+a, 2gc+2fd+e2+2ba+b, 2gd+2fe+2ca+c+b2, 2ge+f2+2da+d+2cb, 2gf+2ea+e+2db+c2, g2+2fa+f+2eb+2dc, 2ga+g+2fb+2ec+d2;
+ideal is=std(i);
+finduni(is);
+kill r;
+
+quit;
Index: Tst/Short/gcdp_s.tst
===================================================================
--- Tst/Short/gcdp_s.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Short/gcdp_s.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,104 @@
+// $Id: gcdp_s.tst,v 1.1.1.1 1998-04-17 15:07:40 obachman Exp $
+
+//
+// gcdp_s.tst - short tests for gcd calculations mod p.
+//
+// Note: gcd(0, x) fails with a SEGV signal!
+// To Do: gcd calculations over transcendental extensions of
+// finite fields.
+//
+
+LIB "tst.lib";
+tst_init();
+tst_ignore("CVS ID  : $Id: gcdp_s.tst,v 1.1.1.1 1998-04-17 15:07:40 obachman Exp $");
+
+//
+// - ring r1=32003,x,dp.
+//
+
+ring r1=32003,x,dp;
+
+poly f=-9554*x^4-12895*x^3-10023*x^2-6213*x;
+poly g;
+
+// some trivial examples
+gcd(0, 0);
+gcd(0, 3123);
+gcd(4353, 0);
+
+// these examples fail so far!!!
+// gcd(0, f);
+// gcd(f, 0);
+
+gcd(23123, f);
+gcd(f, 13123);
+
+// some less trivial examples
+f=-9554*x^4-12895*x^3-10023*x^2-6213*x;
+g=-9554*x^3-3341*x^2+6213*x;
+gcd(f, g);
+
+f=-11265*x^6+12161*x^5+10369*x^4-12161*x^3+896*x^2;
+g=10669*x^8-10673*x^7+5*x^6+8*x^5-10681*x^4+10665*x^3+7*x^2;
+gcd(f, g);
+
+f=-7918*x^9-14406*x^8-7256*x^7+2092*x^6-2198*x^5-12539*x^4-14631*x^3-7150*x^2;
+g=-14833*x^13-7011*x^12+15121*x^11-10864*x^10+12943*x^9-9871*x^8+10354*x^7-1437*x^6+6604*x^5-10394*x^4-3231*x^3-9348*x^2-2092*x;
+gcd(f, g);
+
+f=106*x^13-583*x^12-1060*x^11+8056*x^10+1696*x^9-327*x^8+12508*x^7+8277*x^6+5609*x^5-12879*x^4+13144*x^3-2544*x^2;
+g=11118*x^14-5404*x^13-908*x^12-13908*x^11+3188*x^10-8818*x^9+10439*x^8-14811*x^7+15530*x^6-4891*x^5+6322*x^4+15829*x^3-13686*x^2;
+gcd(f, g);
+
+f=-14613*x^17+2235*x^16-298*x^15+4540*x^14+7214*x^13+5494*x^12-3122*x^11-4720*x^10+8300*x^9-6582*x^8-9908*x^7-15983*x^6-5802*x^5-8634*x^4+7899*x^3+10556*x^2+6931*x+11063;
+g=-10168*x^20+6674*x^19+3004*x^18+13113*x^17+9449*x^16+9097*x^15-6420*x^14+50*x^13+434*x^12-15226*x^11+3727*x^10-14065*x^9-9751*x^8-15792*x^7+6004*x^6-5059*x^5+2479*x^4-12504*x^3-11328*x^2-11338*x-8280;
+gcd(f, g);
+
+f=3812*x^22-6874*x^21+12586*x^20+3003*x^19-9568*x^18+11117*x^17 +7524*x^16+11138*x^15-9743*x^14+1892*x^13+12485*x^12-569*x^11-8265*x^10-5991*x^9+13701*x^8+2644*x^7-3936*x^6-15875*x^5+1289*x^4+3956*x^3-10099*x^2-6616*x+5401;
+g=10652*x^20-4144*x^19-11810*x^18+8237*x^17-8675*x^16+6545*x^15-3601*x^14+14559*x^13+8090*x^12-8378*x^11+14255*x^10+8767*x^9-13932*x^8+11602*x^7-10751*x^6-4899*x^5+8637*x^4+14084*x^3-11583*x^2+5882*x+885;
+gcd(f, g);
+
+//
+// - ring r2=(32003,a),x,dp.
+//
+
+ring r2=(32003,a),x,dp;
+minpoly=a^4+8734*a^3+a^2+11817*a+1;
+
+poly f=-9554*x^4-12895*x^3-10023*x^2-6213*x;
+poly g;
+
+// first, some of the above examples
+gcd(0, 0);
+gcd(0, 3123);
+gcd(4353, 0);
+
+// these examples fail so far!!!
+// gcd(0, f);
+// gcd(f, 0);
+
+gcd(23123, f);
+gcd(f, 13123);
+
+// some less trivial examples
+f=-9554*x^4-12895*x^3-10023*x^2-6213*x;
+g=-9554*x^3-3341*x^2+6213*x;
+gcd(f, g);
+
+f=-11265*x^6+12161*x^5+10369*x^4-12161*x^3+896*x^2;
+g=10669*x^8-10673*x^7+5*x^6+8*x^5-10681*x^4+10665*x^3+7*x^2;
+gcd(f, g);
+
+// now, examples involving the algebraic variable
+f=(25836*a^3*x^6+30467*a^2*x^6+26792*a*x^6+30467*x^6+27083*a^3*x^5+30808*a^2*x^5+28163*a*x^5+292*x^5+12440*a^3*x^4+19396*a^2*x^4+19616*a*x^4+23236*x^4+25156*a^3*x^3+31764*a^2*x^3+31235*a*x^3+6459*x^3);
+g=(14670*a^3*x^6+19715*a^2*x^6+22318*a*x^6+19715*x^6+19743*a^3*x^5+28179*a^2*x^5+19715*a*x^5+7335*x^5+6379*a^3*x^4+11397*a^2*x^4+23599*a*x^4+9861*x^4+16005*a^3*x^3+31525*a^2*x^3+30467*a*x^3+12918*x^3);
+gcd(f, g);
+
+f=(21147*a^3*x^5+10147*a^3*x^4+8142*a^2*x^4+27671*a*x^4+29289*x^4+29289*a^3*x^3);
+g=(6167*a^3*x^6+1536*a^2*x^6+5211*a*x^6+1536*x^6+17534*a^3*x^5+478*a^2*x^5+1536*a*x^5+19085*x^5+3203*a^3*x^4+26578*a^2*x^4+17052*a*x^4+26770*x^4+26002*a^3*x^3+24062*a^2*x^3+192*a*x^3+6386*x^3);
+gcd(f, g);
+
+f=(2295*a^2*x^11+5897*a^3*x^10+765*a^2*x^10+27718*a^3*x^9+1283*a^2*x^9+23792*a*x^9+518*x^9+22026*a^3*x^8+11468*a^2*x^8+16834*a*x^8+24778*x^8+28460*a^3*x^7+8140*a^2*x^7+28036*a*x^7+1613*x^7+18196*a^3*x^6+13274*a^2*x^6+4638*a*x^6+31194*x^6+12206*a^3*x^5+10349*a^2*x^5+30979*a*x^5+8612*x^5);
+g=(8192*a^3*x^10+8957*a^2*x^10+9659*a^3*x^9+28672*a^2*x^9+4553*a*x^9+12288*x^9+5819*a^3*x^8+320*a^2*x^8+14380*a*x^8+12104*x^8+12047*a^3*x^7+19823*a^2*x^7+6824*a*x^7+4335*x^7+29376*a^3*x^6+22190*a^2*x^6+31239*a*x^6+22647*x^6);
+gcd(f, g);
+$
Index: Tst/Short/intdet_s.tst
===================================================================
--- Tst/Short/intdet_s.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Short/intdet_s.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,114 @@
+// $Id: intdet_s.tst,v 1.1.1.1 1998-04-17 15:07:40 obachman Exp $
+
+//
+// indet_s.tst - short tests for integer determinant.
+//
+
+LIB "tst.lib";
+tst_init();
+tst_ignore("CVS ID  : $Id: intdet_s.tst,v 1.1.1.1 1998-04-17 15:07:40 obachman Exp $");
+
+ring r=0,x,dp;
+
+// some zero matrices
+matrix zero1;
+det(zero1);
+
+matrix zero2[3][3];
+det(zero2);
+
+matrix zero3[25][25];
+det(zero3);
+
+// some singular matrices
+matrix singular1[3][3] =
+  191390,0,0,
+  0,0,2064801,
+  2835899,0,0;
+det(singular1);
+
+matrix singular2[10][10] =
+  0,7253563,0,0,0,1105209,0,8208412,0,0,
+  -2285603,0,0,0,0,0,0,-8792059,0,0,
+  0,0,4016624,0,0,0,0,0,0,9994285,
+  0,0,0,0,9038738,-1544232,0,0,0,0,
+  8713605,0,8687907,0,0,0,3753811,0,3068663,0,
+  0,0,0,0,0,0,-2273659,0,4897346,0,
+  0,-9995664,0,0,0,0,3278615,0,0,7715088,
+  0,0,0,0,0,0,1895476,8313309,0,0,
+  0,0,0,0,0,3495479,0,-4987970,0,0,
+  0,0,0,0,9433584,1495751,0,0,0,1844284;
+det(singular2);
+
+// some trivial matrices
+matrix trivial1[1][1] = 19703918739879879891231312312316;
+det(trivial1);
+
+matrix trivial2[2][2] =
+  123618723, 1823791827313183918739183,
+  -12387198372, -192369127398127391782937;
+det(trivial2);
+
+matrix trivial3[3][3] =
+  1207361935641928, 1723691827639, -127346897126347,
+  172346987123469817236498712649782, -1293684019284706304712634012364012746, 2389476102938470128417203487,
+  341523947160734697126, 0, 142374169238746912387469;
+det(trivial3);
+
+// and now for something more serious ...
+matrix serious1[20][20] =
+  -19151322,82002337,97677337,74547596,39571493,91981655,95453414,0,60289689,7724362,28448357,29421824,69121129,39985321,93199559,90939351,0,92284860,49366438,12796429,
+  49912318,82187400,16520142,99081570,81467674,6079923,16405205,46646250,60183380,6570461,69081341,81767774,17538675,34065285,44550684,49975649,0,3279524,47794049,81246336,
+  38315519,6939653,-71592522,60379542,0,68961220,20204422,86994882,46366371,30453193,67712350,78413893,26377133,237924,15402506,48907819,50035789,53014118,82929861,23186630,
+  80457056,32215516,69253008,88324506,59449492,52383416,69273830,0,0,13542327,58905201,7088935,57813196,13937011,7836257,33366653,4843636,0,86145980,0,
+  38938247,83248999,85737415,70112933,50285328,0,61405548,0,56012678,38005706,59906963,54816509,0,74720246,87667594,53095544,70183487,52063963,81296301,4079315,
+  0,37097,39066330,44890885,22660651,75141868,66571309,13369483,57624728,33305282,0,92605645,-58347268,12663150,14540809,52019925,-2848733,59935763,-14010114,44441960,
+  29569931,-18080638,5728089,6652901,19644036,29192406,30185148,25446856,61923943,36195442,90608396,-13623656,18318654,16573797,56547027,68013336,8604547,38815108,52448886,50877452,
+  96506671,-16576756,-87137678,90481797,28513336,39696509,45391763,55277489,97024172,26102999,-45651705,-63196469,0,66589716,37331956,0,10176587,24474644,33896861,83432772,
+  89968935,45451409,62313412,0,0,98943226,38020072,97773724,76163836,0,0,0,0,87664083,62473676,72178501,73570670,5614222,17482922,87843252,
+  19549705,0,50797038,71319094,58624416,44125643,64531904,0,97299336,28639252,21463574,40197656,-46992126,0,84767846,61030548,6843482,70023036,57008612,42435331,
+  -71814993,36366914,91598852,-60588681,53077369,13436915,98646027,5932300,15171472,89055454,0,12448977,13510762,33496442,99086082,98264909,62911231,43536904,95046651,41722845,
+  36420362,-27364145,0,20054449,0,391138,93988383,-53486945,-70758770,-80694620,99621155,95569044,-51889653,60786820,57594383,29109554,16412398,12907473,36582558,10547053,
+  80667898,57256138,34637076,15792656,57768737,91132135,24630164,61634283,86183247,4253192,35435529,62036971,55535883,32320042,28211340,34772554,86511543,11063266,78114621,22507853,
+  49589801,64785930,-36608788,0,0,93673252,79254998,12491001,12505756,71541898,72007970,90073334,38523104,88026009,4176051,70143757,14931984,47641482,0,0,
+  63337033,70365891,43508454,49324524,12612616,85337060,76865839,34857408,27574388,38587663,75247889,77947614,99355406,16491101,72886522,93505267,71967858,64111044,56535736,51944685,
+  14512293,-51454933,92863027,44016201,31685450,-43740381,0,75456840,0,27155152,78295361,86455055,93979434,64536986,0,82348008,65528973,81389440,0,60291185,
+  85150041,43436472,49795574,98125881,-13758849,37990541,2652022,54376293,87781434,7864362,4424447,21314663,76823266,27000905,13028854,47072602,69653974,67809815,44422694,42451738,
+  16047567,0,52520335,32303519,-71596286,46535095,74836408,-69948229,35057856,18725556,-98055204,74746586,53641412,0,85432311,14138213,46862851,29997300,24639707,34702466,
+  59277742,71473526,89728865,57228122,-90292235,3880787,76800358,89806491,67919936,0,10374803,-1046158,31867692,25033945,42492111,64796973,12052456,46134651,63571512,98627336,
+  18390024,1072107,86579476,83292043,2897247,72262229,25062518,14256741,0,30621219,-76534007,16787953,20331032,24442888,34111567,81085992,0,25604677,66473148,-24274027;
+det(serious1);
+
+matrix serious3[30][30] =
+0,6408168,3086691,14610610,-144147418,97023973,1891045,66172212,48611143,77812860,58243967,3436409,52218327,28981425,82144220,-168696325,96891780,-52015182,-43831219,83412200,99895289,0,0,56746301,68870123,67781041,71033065,14143367,-123642174,-171399908,
+-55403228,15110694,2548230,31288158,44966384,5166989,76213065,72532690,82660661,-96672080,66962132,52008016,-93895075,-17221781,-131896390,15965196,77734045,15869514,5218625,80366898,0,74866836,57233024,54514544,-26696912,-70127754,94279999,73016513,3224351,98487378,
+-64181478,45840803,62051609,74654769,81046073,-80715208,0,53559379,0,67024348,-94153967,-175688166,35766706,0,72444979,16179048,0,987782,87401342,20392082,81255370,21303303,-24679950,58449795,0,75503216,0,22397738,0,36334460,
+59995961,81036496,80641043,55360219,56079301,82369982,93939100,26455513,52420146,54611421,-114717307,86271805,46683511,53082422,-10637362,0,58744831,41356008,77027312,55601310,0,-84130230,62780579,99977428,68855470,27462366,-87530262,6324788,74491739,-176442825,
+89441623,85084616,38337552,30215446,83276952,-125345395,33715289,95641443,91919610,67757669,84167074,28536089,-160245958,-95828187,9408071,20600007,99274497,15615301,6256036,26241535,89731535,54354424,50237806,0,58103244,7553770,45057616,48761548,34176488,-122373381,
+88726645,38578908,14340147,0,1031488,14671938,5974159,0,54580570,54846073,49554380,79082918,22708456,0,43085394,74821108,34488306,24267513,97534352,44329980,25651616,-65534174,40569095,82390992,45255933,6071413,-92447518,44202,-10785318,0,
+424862,0,93078766,56446250,53089874,0,61201005,58305659,-163426127,71873157,32016304,0,-18468236,50319860,64835581,76744829,19926650,-60150875,93337931,12354643,6796852,6405700,68595413,94289183,10486184,43822451,55149042,-10973126,52570897,32107260,
+99574505,99623604,-10531575,0,56535425,94000204,-53048775,80889601,0,9504342,5711430,96845538,10941134,15988479,29666186,21547720,-128449560,17925749,-66980967,29242826,71961190,12288752,83331896,79718070,25764637,12581812,32539223,39193921,28834417,4304393,
+21311842,29330887,31723316,32977334,53453153,38154654,36199344,97443488,43178126,90846538,9128739,17062162,29504900,89059801,-13880171,41861959,92457321,67712662,-13361681,-105160972,86641904,3732300,17648135,51547737,38020725,82956791,-17820736,59550656,-15452161,-144745700,
+16020951,-136653511,24997936,-36498895,-135197636,59304442,-126536326,-73418000,8057061,44374127,8223980,-148743374,84745008,72246715,66945451,92408139,0,9710889,18699971,-148440277,-71733667,19763918,0,52716500,54085735,74362780,61447362,60614086,45181953,14555972,
+0,29551465,14187585,-93828623,9404641,77130566,-125733423,63862054,81642655,22798611,24731420,44496595,-63121672,38747055,87957012,61078211,92226741,85347096,22546737,-52693098,69254535,26349139,-128631527,-28557978,52242375,-143319616,0,-111899596,38636908,422617,
+72161856,60990008,-30184143,69806743,97713426,-138422432,61092678,12672137,0,38635137,-80505865,45090093,-95088518,0,49234249,85284809,66508563,50210838,96932575,82374174,0,39781843,41819897,0,55406669,60035763,87161787,3634192,18582955,43363739,
+39873807,-86684951,5021608,73067764,53744894,-49828741,-119760890,-91501384,12867923,40939753,-87845369,37811976,60686642,84153063,-64135610,40834269,-80190648,79032499,64210365,11844800,0,52127963,88390018,0,7359016,0,88906889,7629803,8479179,30386399,
+-25407258,26304875,94475947,82142623,7216434,-40880311,-78030234,10083950,55567700,19559629,50534717,42006752,-66250047,75844728,-34801907,-58088752,25188025,81528243,944537,90917245,49854186,82282343,-165027464,80728264,0,86312422,43697413,9684081,15046498,16988324,
+90696066,36038295,17916657,31238818,-68049602,22208581,0,87546928,88466803,-27113705,56014219,-49410106,61030334,77987161,44295092,47495748,-153790979,18447009,60746891,37470727,7931961,70468892,79372272,83371971,31591623,84219706,32809315,36893325,-116111763,7073449,
+15750690,48047155,39787767,-34642575,86791260,-23957851,0,80496293,38769224,11990277,-132800233,15724513,-144430232,93739783,16850497,-19887254,42495296,91646199,-95765033,16081025,9405653,82520950,21050937,42887462,84946672,-88051035,-14880398,-9519254,73465576,75675082,
+69681891,25603920,32342721,85692841,16234355,40410493,40552873,24408407,-67646274,0,14223108,-65147293,90252738,18935932,37359867,0,87862672,28089959,39176838,-33935251,99230754,72865914,60549767,41197522,57474053,-100388679,3435001,73975761,34156429,-119692554,
+591569,70398619,70435942,2852695,0,0,12358753,46348026,-120732477,71038447,99239734,-112456241,-62968349,31935069,31291942,-120169376,-106841258,91722950,94765899,20492078,-155350886,82275303,-95982293,66612768,4335559,27783921,73169844,22950075,33235715,-2117254,
+18342534,78136703,57140534,9735126,2693054,-45591460,32065484,70925706,0,70924121,16972432,-105826281,0,85212414,-60202447,-32011526,85595193,35282586,54118725,9584531,-7168555,0,9460954,47721647,32177403,-35090026,926346,-23166272,70105630,-20650873,
+81974641,27836926,38395000,98389,0,53117226,28894643,93391602,-13454381,-57870335,47184260,0,0,44251377,60557609,45309756,7433758,2326170,19448704,88554858,92275432,7412715,-75916597,15518693,45412960,70060568,-10805320,77365518,-86243950,87154713,
+-112751650,36189057,69911037,1854211,31074979,77890633,22097971,2530944,-28389328,-114616256,76849224,18663786,36173022,83475591,0,65266063,48126973,59727824,22140603,51958611,-115345468,85725263,0,-197310938,0,-137681321,44922992,10748992,78193728,-83640257,
+64494284,26557161,34156772,91923544,81333684,96765167,97080992,43136195,78618048,73809444,41848103,32747942,96766116,-140560714,-26039792,5308362,94823998,91144480,15660746,15688487,55217324,55506484,0,-94504836,57286172,4282631,-107605593,0,7972930,57095895,
+13623035,89026338,-176578948,6460382,54496068,10150939,0,97762323,54827473,3787728,39388166,71424003,-153193816,71619542,34705705,-24202726,84935891,-110443565,0,40778748,54264701,-96935751,61833111,26517035,52252251,42176235,86619361,-54966125,79249763,69588040,
+65862085,98585421,94676351,1687346,54799864,53883831,59889736,99170493,58091960,12633064,6970195,73649684,71712591,66863462,56505831,86941161,62944165,95994190,68519360,99427398,-65389929,70957922,34010498,82140955,79952252,-63344211,0,51527628,41228860,31787117,
+61020323,0,45539594,85564859,0,0,21311304,0,0,87540318,3273907,73487562,57536433,93331605,-25288929,77327784,57398822,-20880883,174634,70882508,47395831,93453561,453096,3742875,49852510,57594144,95717277,-123625315,94668360,0,
+0,65453839,12481623,53233803,79278623,0,60569525,48297033,64868764,18756035,49249031,-188952344,46730161,3867521,17863152,52173869,6509306,5848009,-133544561,25506541,69306077,2875909,42073437,-96218772,0,30519624,72632930,43421825,75888481,83152396,
+58788983,51475384,9446314,-18583272,-48787909,-93488681,-74756985,9621516,79075755,-57473695,-67888057,0,12216870,49166486,78017003,37153193,93035237,875470,-1666280,15392468,38897950,2603498,-158544150,31824034,66722229,40545298,83928395,0,19253484,74467517,
+43120738,50375391,-119610272,44562791,38820837,44240634,35749167,-24192749,0,40578710,12068732,46265080,-5096267,39668907,41605829,-107795720,55383751,6743252,90274676,-19729287,15264361,-121677154,5516423,83839978,32849745,0,-152843497,15248362,3274932,90719614,
+13715373,87510173,-68929601,88865603,78149963,61262729,-137305741,-99114446,-51884761,47136988,28306063,92789948,90641951,34005549,-53100694,7625473,20298217,92780854,3707038,28475632,23234776,-32858313,27804908,83822430,11232047,-30563282,0,45767666,17421205,28907130,
+98343278,42122306,5651144,34313086,71701332,-84500543,0,0,64899400,0,0,2374432,5207633,45725773,84651424,85962451,58039658,40821972,22390256,-104894280,59029292,62650665,12246007,29380851,53841117,-62830911,-27357351,-91325571,94332045,855852;
+det(serious3);
+$
Index: Tst/Short/invar.tst
===================================================================
--- Tst/Short/invar.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Short/invar.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,57 @@
+LIB "tst.lib";
+tst_init();
+
+LIB"invar.lib";
+
+  ring rw=0,(x(1..5)),dp;
+  matrix m[5][1];
+  m[3,1]=x(1);
+  m[4,1]=x(2);
+  m[5,1]=1+x(1)*x(4)+x(2)*x(3);
+  ideal in=invariantRing(m,x(3),x(1),0);
+  in;
+kill rw;
+  ring rf=0,(x(1..7)),dp;
+  matrix m[7][1];
+  m[4,1]=x(1)^3;
+  m[5,1]=x(2)^3;
+  m[6,1]=x(3)^3;
+  m[7,1]=(x(1)*x(2)*x(3))^2;
+  ideal in=invariantRing(m,x(4),x(1),6);
+  in;
+kill rf;
+  ring rd=0,(x(1..5)),dp;
+  matrix m[5][1];
+  m[3,1]=x(1);
+  m[4,1]=x(2);
+  m[5,1]=1+x(1)*x(4)^2;
+  ideal in=invariantRing(m,x(3),x(1));
+  in;
+  
+  actionIsProper(m);
+  
+  //computes the relations between the invariants
+  int z=size(in);
+  ideal null;
+  ring r1=0,(y(1..z)),dp;
+  setring rd;
+  map phi=r1,in;
+  setring r1;  
+  ideal ker=preimage(rd,phi,null); 
+  ker;
+kill rd,r1;
+  int n=5;
+  
+  ring w=0,(x(1..n)),wp(1..n);
+  
+  // definition of the vectorfield m=sum m[i]*d/dx(i)
+  matrix m[n][1];
+  int i;
+  for (i=1;i<=n-1;i=i+1)
+  {
+    m[i+1,1]=x(i);
+  }
+  ideal in=invariantRing(m,x(2),x(1),0);
+  in;
+kill w;
+$
Index: Tst/Short/mpsr_s.tst
===================================================================
--- Tst/Short/mpsr_s.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Short/mpsr_s.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,181 @@
+LIB "tst.lib";
+tst_init();
+LIB "general.lib";
+
+option(noredefine);
+
+proc vcheckdump(link l, string vn)
+{
+  if (typeof(`vn`) != "proc" && typeof(`vn`) != "link")
+  {
+    write(l, `vn`);
+    read(l);
+    if (typeof(`vn`) == "ring")
+    {
+       setring `vn`;
+       rcheckdump(l, names(`vn`));
+    }
+  }
+}
+  
+proc rcheckdump(link l, list nameslist)
+{
+  int i;
+  for (i=1; i<size(nameslist); i++)
+  {
+    vcheckdump(l, nameslist[i]);
+  }
+}
+
+proc checkdump(link l)
+{
+  rcheckdump(l, names());
+}
+
+
+  
+// data
+int i;
+int i1 = 1;
+int i2 = -100092;
+
+intvec iv;
+intvec iv1 = 1,2,3;
+intvec iv2 = -1,2,-3,4,-5;
+
+intmat im;
+intmat im1[2][3]=1,3,5,7,8;
+intmat im2[3][3]= -1,2,-3,4,-5;
+
+string s;
+string s1 = "Hello World";
+
+list l;
+list l1 = i,iv,im,i1,iv1,im1;
+list l2 = l1, iv2, l, im2;
+
+ring r;
+
+poly p;
+number n;
+number n1 = 2;
+number n2 = -7;
+
+poly p1 = x + y;
+poly p2 = xyz - 2x3y4z5 + 3xy -4yz + 5z;
+poly p3 = p2^2;
+
+vector v;
+vector v1 = [p1, p2];
+vector v2 = [p, p1,p2, p3] + p1*gen(5);
+
+ideal id;
+ideal id1 = p, p1, p2, p3;
+ideal id2 = p, p1+p2, p2+3, p1+p2+p3, p1, p2, p3;
+
+module mv;
+module mv1 = v, v1, v2;
+module mv2 = v1+v2, p1*v2, p2*v1, v, v1, v2;
+
+matrix m;
+matrix m1[2][3] = p, p1, p2, id1;
+matrix m2[4][4] =  p, p1, p2, p3, id1, id2;
+
+ring rr = 32003,(a,b),dp;
+map f = r, a,b,a+b;
+map g   = rr,a2,b2;
+map phi = g(f);
+
+
+ring r0 = 0, x, lp;
+number n;
+number n1 = 29734481274863241234589;
+number n2 = n1/(n1-6);
+
+poly p;
+poly p1 = n1*x + n2*x^4 + 7/3*x^2*x^5 - 6;
+poly p2 = x*x*x - 2*x^3*x^4*x^5 + 3*x*x -4*x*x + 5*x^2 + p1;
+poly p3 = p2*p2;
+
+
+// First, make two (preserves order of variables) ASCII-dumps of everything 
+dump(":w _dump.txt");
+killall();
+getdump("_dump.txt");
+
+// Does our version have MP?
+if (! (system("with", "MP")))
+{
+  // no -- so simply dump everything to stdout and exit
+  dump("");
+  $;
+}
+
+// Yes, so let's make an MPfile dump
+dump("MPfile: _dump.mp");
+killall();
+getdump("MPfile:r _dump.mp");
+
+// checkdump("MPfile: _dump.mp");
+
+// MPfork dump
+link ll = "MPtcp:fork"; 
+open(ll);
+if (status(ll, "openwrite", "yes"))
+{
+  write(ll, quote(getdump(mp_ll))); dump(ll); read(ll);
+  killall("not", "link");
+  write(ll, quote(dump(mp_ll))); getdump(ll); read(ll); 
+
+  checkdump(ll);
+}
+kill ll;
+
+
+// MPlaunch dump
+string sing = system("whoami");
+
+if (size(sing))
+{
+  // check whether rsh works and whether remote Singular can be executed
+  if (system("sh","rsh `hostname` -n test -x "+sing+" 1>/dev/null 2>&1"))
+  { 
+    if (system("sh","remsh `hostname` -n test -x "+sing+" 1>/dev/null 2>&1"))
+    {
+      if (system("sh","ssh `hostname` -f test -x "+sing+" 1>/dev/null 2>&1"))
+      {
+        sing = "";
+      }
+    }
+  }
+
+  if (size(sing))
+  {
+    link ll = "MPtcp:launch"; 
+    open(ll);
+    if (status(ll, "openwrite", "yes"))
+    {
+      kill sing;
+      write(ll, quote(getdump(mp_ll))); dump(ll); read(ll);
+      killall("not", "link");
+      write(ll, quote(dump(mp_ll))); getdump(ll); read(ll); 
+
+      checkdump(ll);
+    }
+    kill ll;
+  }
+}
+
+if (defined(sing))
+{
+  kill sing;
+}
+tst_ignore(system("sh", "rm -rf _dump.*"));
+
+killall("proc");
+dump("");
+$
+
+
+  
+
Index: Tst/Short/normal.tst
===================================================================
--- Tst/Short/normal.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Short/normal.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,64 @@
+LIB "tst.lib";
+tst_init();
+
+LIB"normal.lib";
+
+ring r=31991,(a,b,c,d,e),dp;
+ideal i=
+5abcde-a5-b5-c5-d5-e5,
+ab3c+bc3d+a3be+cd3e+ade3,
+a2bc2+b2cd2+a2d2e+ab2e2+c2de2,
+abc5-b4c2d-2a2b2cde+ac3d2e-a4de2+bcd2e3+abe5,
+ab2c4-b5cd-a2b3de+2abc2d2e+ad4e2-a2bce3-cde5,
+a3b2cd-bc2d4+ab2c3e-b5de-d6e+3abcd2e2-a2be4-de6,
+a4b2c-abc2d3-ab5e-b3c2de-ad5e+2a2bcde2+cd2e4,
+b6c+bc6+a2b4e-3ab2c2de+c4d2e-a3cde2-abd3e2+bce5;
+
+list pr=normal(i);
+pr;
+def r1=pr[1];
+setring r1;
+KK;
+kill r,r1;
+
+ring r=32003,(x,y,z),wp(2,3,6);
+ideal i=zy2-zx3-x6;
+list pr=normal(i);
+pr;
+def r1=pr[1];
+setring r1;
+KK;
+kill r,r1;
+
+ring r=32003,(x,y,z),dp;
+ideal i=(x-y)*(x-z)*(y-z);
+
+list pr=normal(i);
+pr;
+def r1=pr[1];
+def r2=pr[2];
+setring r1;
+KK;
+kill r,r1;
+
+ring r=32003,(b,s,t,u,v,w,x,y,z),dp;
+
+ideal k=
+wy-vz,
+vx-uy,
+tv-sw,
+su-bv,
+tuy-bvz;
+ideal j=x2y2+x2z2+y2z2;
+ideal i=mstd(intersect(j,k))[2];
+list pr=normal(i);
+pr;
+def r1=pr[1];
+def r4=pr[4];
+setring r1;
+KK;
+setring r4;
+KK;
+
+kill r,r1;
+$
Index: Tst/Short/polylib_s.tst
===================================================================
--- Tst/Short/polylib_s.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Short/polylib_s.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,41 @@
+LIB "tst.lib";
+tst_init();
+
+LIB "poly.lib";
+
+example cyclic;
+killall();
+
+exampe katsura();
+killall();
+
+example freerank;
+killall();
+
+example is_homog;
+killall();
+
+example maxcoef;
+killall();
+
+example maxdeg;
+killall();
+
+example maxdeg1;
+killall();
+
+example mindeg;
+killall();
+
+example mindeg1;
+killall();
+
+example normalize;
+killall();
+
+example rad_con;
+killall();
+
+example content;
+killall();
+$
Index: Tst/Short/primdec_s.tst
===================================================================
--- Tst/Short/primdec_s.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Short/primdec_s.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,197 @@
+LIB "tst.lib";
+tst_init();
+
+LIB "primdec.lib";
+
+ring r=32003,(a,b,c,d,e,f),(C,dp);
+ideal i=
+a2cdf2,
+b2cdf2,
+a2bdf2,
+b3df2,
+a3df2,
+ab2df2,
+a2cde,
+b2cde,
+a2bde,
+b3de,
+a3de,
+ab2de,
+a2cd2,
+b2cd2,
+a2bd2,
+b3d2,
+a3d2,
+ab2d2,
+a2c2f2,
+b2c2f2,
+a2bcf2,
+b3cf2,
+a3cf2,
+ab2cf2,
+a2b2f2,
+b4f2,
+a3bf2,
+ab3f2,
+a4f2;
+
+list pr1=minAssPrimes(i);
+ideal i1=radical(i);
+ideal i2=equiRadical(i);
+list pr2= primdecGTZ(i);
+list pr3=min_ass_prim_charsets(i,1);
+list pr4=primdecSY(i,1);
+matrix m=char_series(i);
+pr1;
+i1;
+i2;
+pr2;
+pr3;
+pr4;
+m;
+testPrimary(pr2,i);
+kill r;
+
+ring r=0,(a,b,c,d,e,f),(C,dp);
+ideal i=
+a2cdf2,
+b2cdf2,
+a2bdf2,
+b3df2,
+a3df2,
+ab2df2,
+a2cde,
+b2cde,
+a2bde,
+b3de,
+a3de,
+ab2de,
+a2cd2,
+b2cd2,
+a2bd2,
+b3d2,
+a3d2,
+ab2d2,
+a2c2f2,
+b2c2f2,
+a2bcf2,
+b3cf2,
+a3cf2,
+ab2cf2,
+a2b2f2,
+b4f2,
+a3bf2,
+ab3f2,
+a4f2;
+
+list pr1=minAssPrimes(i);
+ideal i1=radical(i);
+ideal i2=equiRadical(i);
+list pr2= primdecGTZ(i);
+list pr3=min_ass_prim_charsets(i,1);
+list pr4=primdecSY(i,1);
+matrix m=char_series(i);
+pr1;
+i1;
+i2;
+pr2;
+pr3;
+pr4;
+m;
+testPrimary(pr2,i);
+kill r;
+
+
+
+ring r=32003,(x,y,z),(C,dp);
+ideal i=
+xy2z2-1xy2z+xyz2-1xyz,
+xy3z+xy2z,
+xy4-1xy2,
+x2yz2-1x2yz,
+x2y3-1x2y2,
+x4z3-1x4z2+2x3z3-2x3z2+x2z3-1x2z2,
+x2y2z,
+x4yz+x3yz,
+2x4y2+6x3y2+6x2y2+xy3+xy2,
+x5z+x4z2+x4z+2x3z2-1x3z+x2z2-1x2z,
+x6y+3x5y+3x4y+x3y;
+
+list pr1=minAssPrimes(i);
+ideal i1=radical(i);
+ideal i2=equiRadical(i);
+list pr2= primdecGTZ(i);
+list pr3=min_ass_prim_charsets(i,1);
+list pr4=primdecSY(i,1);
+matrix m=char_series(i);
+pr1;
+i1;
+i2;
+pr2;
+pr3;
+pr4;
+m;
+testPrimary(pr2,i);
+kill r;
+
+
+ring r=0,(x,y,z),(C,dp);
+ideal i=
+xy2z2-1xy2z+xyz2-1xyz,
+xy3z+xy2z,
+xy4-1xy2,
+x2yz2-1x2yz,
+x2y3-1x2y2,
+x4z3-1x4z2+2x3z3-2x3z2+x2z3-1x2z2,
+x2y2z,
+x4yz+x3yz,
+2x4y2+6x3y2+6x2y2+xy3+xy2,
+x5z+x4z2+x4z+2x3z2-1x3z+x2z2-1x2z,
+x6y+3x5y+3x4y+x3y;
+
+list pr1=minAssPrimes(i);
+ideal i1=radical(i);
+ideal i2=equiRadical(i);
+list pr2= primdecGTZ(i);
+list pr3=min_ass_prim_charsets(i,1);
+list pr4=primdecSY(i,1);
+matrix m=char_series(i);
+pr1;
+i1;
+i2;
+pr2;
+pr3;
+pr4;
+m;
+testPrimary(pr2,i);
+kill r;
+
+ring r = 32003,(b,c,d,e,f,g,h,j,k,l),(C,dp); 
+ideal i= 
+(l-k)^9,
+(l-k)^8*(l-b),
+(l-k)^7*(l-c),
+(l-k)^6*(l-d),
+(l-k)^5*(l-e),
+(l-k)^4*(l-f),
+(l-k)^3*(l-g),
+(l-k)^2*(l-h),
+(l-k)*(l-j);
+
+list pr1=minAssPrimes(i);
+ideal i1=radical(i);
+ideal i2=equiRadical(i);
+list pr2= primdecGTZ(i);
+list pr3=min_ass_prim_charsets(i,1);
+list pr4=primdecSY(i,1);
+matrix m=char_series(i);
+pr1;
+i1;
+i2;
+pr2;
+pr3;
+pr4;
+m;
+testPrimary(pr2,i);
+kill r;
+$
Index: Tst/Short/resultantp_s.tst
===================================================================
--- Tst/Short/resultantp_s.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Short/resultantp_s.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,177 @@
+// $Id: resultantp_s.tst,v 1.1.1.1 1998-04-17 15:07:41 obachman Exp $
+
+//
+// resultantp_s.tst - short tests for resultant calculations mod p.
+//
+// All univariate non-trivial examples come from gcdUnivP.fex or
+// gcdUnivPAlpha.fex.  Most of the examples have a non-trivial gcd, so we
+// compute always an disturbed example, too.  Some extra checks are added
+// for calculation of resultants of polys of same degree.
+//
+// The examples involving a transcendental variable are the same as the
+// examples with algebraic variables.
+//
+// To Do:
+//
+// o multivariate resultant calculations
+//
+
+LIB "tst.lib";
+tst_init();
+tst_ignore("CVS ID  : $Id: resultantp_s.tst,v 1.1.1.1 1998-04-17 15:07:41 obachman Exp $");
+
+//
+// - ring r1=32003,x,dp.
+//
+
+tst_ignore( "ring r1=32003,x,dp;" );
+ring r1=32003,x,dp;
+
+poly f=-9554*x^4-12895*x^3-10023*x^2-6213*x;
+poly g;
+
+// some trivial examples
+resultant(0, 0, x);
+resultant(0, 3123, x);
+resultant(4353, 0, x);
+
+resultant(0, f, x);
+resultant(f, 0, x);
+
+resultant(23123, f, x);
+resultant(f, 13123, x);
+
+// some less trivial examples
+f=-9554*x^4-12895*x^3-10023*x^2-6213*x;
+g=-9554*x^3-3341*x^2+6213*x;
+resultant(f, g, x);
+resultant(f, g+1, x);
+resultant(f, g*x+1, x);
+
+f=-11265*x^6+12161*x^5+10369*x^4-12161*x^3+896*x^2;
+g=10669*x^8-10673*x^7+5*x^6+8*x^5-10681*x^4+10665*x^3+7*x^2;
+resultant(f, g, x);
+resultant(f, g+1, x);
+resultant(f*x^2, g+1, x);
+
+f=-7918*x^9-14406*x^8-7256*x^7+2092*x^6-2198*x^5-12539*x^4-14631*x^3-7150*x^2;
+g=-14833*x^13-7011*x^12+15121*x^11-10864*x^10+12943*x^9-9871*x^8+10354*x^7-1437*x^6+6604*x^5-10394*x^4-3231*x^3-9348*x^2-2092*x;
+resultant(f, g, x);
+resultant(f, g+1, x);
+
+f=106*x^13-583*x^12-1060*x^11+8056*x^10+1696*x^9-327*x^8+12508*x^7+8277*x^6+5609*x^5-12879*x^4+13144*x^3-2544*x^2;
+g=11118*x^14-5404*x^13-908*x^12-13908*x^11+3188*x^10-8818*x^9+10439*x^8-14811*x^7+15530*x^6-4891*x^5+6322*x^4+15829*x^3-13686*x^2;
+resultant(f, g, x);
+resultant(f, g+1, x);
+
+f=-14613*x^17+2235*x^16-298*x^15+4540*x^14+7214*x^13+5494*x^12-3122*x^11-4720*x^10+8300*x^9-6582*x^8-9908*x^7-15983*x^6-5802*x^5-8634*x^4+7899*x^3+10556*x^2+6931*x+11063;
+g=-10168*x^20+6674*x^19+3004*x^18+13113*x^17+9449*x^16+9097*x^15-6420*x^14+50*x^13+434*x^12-15226*x^11+3727*x^10-14065*x^9-9751*x^8-15792*x^7+6004*x^6-5059*x^5+2479*x^4-12504*x^3-11328*x^2-11338*x-8280;
+resultant(f, g, x);
+resultant(f, g+1, x);
+
+f=3812*x^22-6874*x^21+12586*x^20+3003*x^19-9568*x^18+11117*x^17 +7524*x^16+11138*x^15-9743*x^14+1892*x^13+12485*x^12-569*x^11-8265*x^10-5991*x^9+13701*x^8+2644*x^7-3936*x^6-15875*x^5+1289*x^4+3956*x^3-10099*x^2-6616*x+5401;
+g=10652*x^20-4144*x^19-11810*x^18+8237*x^17-8675*x^16+6545*x^15-3601*x^14+14559*x^13+8090*x^12-8378*x^11+14255*x^10+8767*x^9-13932*x^8+11602*x^7-10751*x^6-4899*x^5+8637*x^4+14084*x^3-11583*x^2+5882*x+885;
+resultant(f, g, x);
+resultant(f, g+1, x);
+
+//
+// - ring r2=(32003,a),x,dp.
+//
+
+tst_ignore( "ring r2=(32003,a),x,dp;" );
+ring r2=(32003,a),x,dp;
+minpoly=a^4+8734*a^3+a^2+11817*a+1;
+
+poly f=-9554*x^4-12895*x^3-10023*x^2-6213*x;
+poly g;
+
+// first, some of the above examples
+resultant(0, 0, x);
+resultant(0, 3123, x);
+resultant(4353, 0, x);
+
+resultant(0, f, x);
+resultant(f, 0, x);
+
+resultant(23123, f, x);
+resultant(f, 13123, x);
+
+// some less trivial examples
+f=-9554*x^4-12895*x^3-10023*x^2-6213*x;
+g=-9554*x^3-3341*x^2+6213*x;
+resultant(f, g, x);
+resultant(f, g+1, x);
+resultant(f, g*x+1, x);
+
+f=-11265*x^6+12161*x^5+10369*x^4-12161*x^3+896*x^2;
+g=10669*x^8-10673*x^7+5*x^6+8*x^5-10681*x^4+10665*x^3+7*x^2;
+resultant(f, g, x);
+resultant(f, g+1, x);
+resultant(f*x^2, g+1, x);
+
+// now, examples involving the algebraic variable
+f=(25836*a^3*x^6+30467*a^2*x^6+26792*a*x^6+30467*x^6+27083*a^3*x^5+30808*a^2*x^5+28163*a*x^5+292*x^5+12440*a^3*x^4+19396*a^2*x^4+19616*a*x^4+23236*x^4+25156*a^3*x^3+31764*a^2*x^3+31235*a*x^3+6459*x^3);
+g=(14670*a^3*x^6+19715*a^2*x^6+22318*a*x^6+19715*x^6+19743*a^3*x^5+28179*a^2*x^5+19715*a*x^5+7335*x^5+6379*a^3*x^4+11397*a^2*x^4+23599*a*x^4+9861*x^4+16005*a^3*x^3+31525*a^2*x^3+30467*a*x^3+12918*x^3);
+resultant(f, g, x);
+resultant(f, g+1, x);
+
+f=(21147*a^3*x^5+10147*a^3*x^4+8142*a^2*x^4+27671*a*x^4+29289*x^4+29289*a^3*x^3);
+g=(6167*a^3*x^6+1536*a^2*x^6+5211*a*x^6+1536*x^6+17534*a^3*x^5+478*a^2*x^5+1536*a*x^5+19085*x^5+3203*a^3*x^4+26578*a^2*x^4+17052*a*x^4+26770*x^4+26002*a^3*x^3+24062*a^2*x^3+192*a*x^3+6386*x^3);
+resultant(f, g, x);
+resultant(f, g+1, x);
+
+f=(2295*a^2*x^11+5897*a^3*x^10+765*a^2*x^10+27718*a^3*x^9+1283*a^2*x^9+23792*a*x^9+518*x^9+22026*a^3*x^8+11468*a^2*x^8+16834*a*x^8+24778*x^8+28460*a^3*x^7+8140*a^2*x^7+28036*a*x^7+1613*x^7+18196*a^3*x^6+13274*a^2*x^6+4638*a*x^6+31194*x^6+12206*a^3*x^5+10349*a^2*x^5+30979*a*x^5+8612*x^5);
+g=(8192*a^3*x^10+8957*a^2*x^10+9659*a^3*x^9+28672*a^2*x^9+4553*a*x^9+12288*x^9+5819*a^3*x^8+320*a^2*x^8+14380*a*x^8+12104*x^8+12047*a^3*x^7+19823*a^2*x^7+6824*a*x^7+4335*x^7+29376*a^3*x^6+22190*a^2*x^6+31239*a*x^6+22647*x^6);
+resultant(f, g, x);
+resultant(f, g+1, x);
+
+//
+// - ring r3=(32003,t),x,dp.
+//
+
+tst_ignore( "ring r3=(32003,t),x,dp;" );
+ring r3=(32003,t),x,dp;
+
+poly f=-9554*x^4-12895*x^3-10023*x^2-6213*x;
+poly g;
+
+// first, some of the above examples
+resultant(0, 0, x);
+resultant(0, 3123, x);
+resultant(4353, 0, x);
+
+resultant(0, f, x);
+resultant(f, 0, x);
+
+resultant(23123, f, x);
+resultant(f, 13123, x);
+
+// some less trivial examples
+f=-9554*x^4-12895*x^3-10023*x^2-6213*x;
+g=-9554*x^3-3341*x^2+6213*x;
+resultant(f, g, x);
+resultant(f, g+1, x);
+resultant(f, g*x+1, x);
+
+f=-11265*x^6+12161*x^5+10369*x^4-12161*x^3+896*x^2;
+g=10669*x^8-10673*x^7+5*x^6+8*x^5-10681*x^4+10665*x^3+7*x^2;
+resultant(f, g, x);
+resultant(f, g+1, x);
+resultant(f*x^2, g+1, x);
+
+// now, examples involving the transcendental variable
+f=(25836*t^3*x^6+30467*t^2*x^6+26792*t*x^6+30467*x^6+27083*t^3*x^5+30808*t^2*x^5+28163*t*x^5+292*x^5+12440*t^3*x^4+19396*t^2*x^4+19616*t*x^4+23236*x^4+25156*t^3*x^3+31764*t^2*x^3+31235*t*x^3+6459*x^3);
+g=(14670*t^3*x^6+19715*t^2*x^6+22318*t*x^6+19715*x^6+19743*t^3*x^5+28179*t^2*x^5+19715*t*x^5+7335*x^5+6379*t^3*x^4+11397*t^2*x^4+23599*t*x^4+9861*x^4+16005*t^3*x^3+31525*t^2*x^3+30467*t*x^3+12918*x^3);
+resultant(f, g, x);
+resultant(f, g+1, x);
+
+f=(21147*t^3*x^5+10147*t^3*x^4+8142*t^2*x^4+27671*t*x^4+29289*x^4+29289*t^3*x^3);
+g=(6167*t^3*x^6+1536*t^2*x^6+5211*t*x^6+1536*x^6+17534*t^3*x^5+478*t^2*x^5+1536*t*x^5+19085*x^5+3203*t^3*x^4+26578*t^2*x^4+17052*t*x^4+26770*x^4+26002*t^3*x^3+24062*t^2*x^3+192*t*x^3+6386*x^3);
+resultant(f, g, x);
+resultant(f, g+1, x);
+
+f=(2295*t^2*x^11+5897*t^3*x^10+765*t^2*x^10+27718*t^3*x^9+1283*t^2*x^9+23792*t*x^9+518*x^9+22026*t^3*x^8+11468*t^2*x^8+16834*t*x^8+24778*x^8+28460*t^3*x^7+8140*t^2*x^7+28036*t*x^7+1613*x^7+18196*t^3*x^6+13274*t^2*x^6+4638*t*x^6+31194*x^6+12206*t^3*x^5+10349*t^2*x^5+30979*t*x^5+8612*x^5);
+g=(8192*t^3*x^10+8957*t^2*x^10+9659*t^3*x^9+28672*t^2*x^9+4553*t*x^9+12288*x^9+5819*t^3*x^8+320*t^2*x^8+14380*t*x^8+12104*x^8+12047*t^3*x^7+19823*t^2*x^7+6824*t*x^7+4335*x^7+29376*t^3*x^6+22190*t^2*x^6+31239*t*x^6+22647*x^6);
+resultant(f, g, x);
+resultant(f, g+1, x);
+$
Index: Tst/Short/std_s.tst
===================================================================
--- Tst/Short/std_s.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Short/std_s.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,337 @@
+// $Id: std_s.tst,v 1.1.1.1 1998-04-17 15:07:41 obachman Exp $
+
+// std_s.tst -- long tests for std
+// uses rcyclic examples from ISSAC'98 paper
+
+LIB "tst.lib";
+tst_init();
+
+proc msetring(int charac, int nv, string ordering)
+{
+  execute "ring r = " + string(charac) + ",x(1.." + string(nv) + "), " +
+  ordering + ";"; 
+  keepring r;
+}
+
+proc ecyclic_i(int i, int comps)
+{
+  int j, k, l;
+  poly p, q;
+
+  for (j=1; j<=comps; j++)
+  {
+    q = 1;
+    l = j;
+    for (k=1; k<=i; k++)
+    {
+      q = q *var(l);
+      l = l + comps;
+    }
+    p = p + q;
+  }
+  return (p);
+}
+  
+proc rcyclic_i(int i, int vars, int comps)
+{
+  int j, k, l;
+  poly p, q;
+
+  for (j=1; j<=comps; j++)
+  {
+    q = 1;
+    l = j;
+    for (k=1; k<=i; k++)
+    {
+      q = q *var(l);
+      if (l == vars)
+      {
+        l = 1;
+      }
+      else
+      {
+        l = l + 1;
+      }
+    }
+    p = p + q;
+  }
+  return (p);
+}
+
+proc rcyclic_g(int vars, int comps)
+{
+  ideal id;
+  int i;
+  
+  for (i=1; i<vars; i++)
+  {
+    id[i] = rcyclic_i(i, vars, comps);
+  }
+
+  return (id);
+}
+
+proc gcyclic(int vars, list #)
+{
+  if (vars < 1)
+  {
+    vars = 2;
+  }
+  int comps = vars;
+  string kind = "n";
+
+  if (size(#) > 0)
+  {
+    if (typeof(#[1]) == "string")
+    {
+      if (#[1] == "r" || #[1] == "h")
+      {
+        kind = #[1];
+      }
+      if (size(#) > 1)
+      {
+        if (typeof(#[2]) == "int" && #[2] > 1 && #[2] < vars)
+        {
+          comps = #[2];
+        }
+      }
+    }
+    else
+    {
+      if (typeof(#[1]) == "int")
+      {
+        if (#[1] > 1 && #[1] < vars)
+        {
+          comps = #[1];
+        }
+        if (size(#) > 1)
+        {
+          if (#[2] == "r" || #[2] == "h")
+          {
+            kind = #[2];
+          }
+        }
+      }
+    }
+  }
+
+  if (kind != "h")
+  {
+    msetring(global_char, vars, global_ordering);
+  }
+  else
+  {
+    msetring(global_char, vars+1, global_ordering);
+  }
+
+  keepring basering;
+
+  ideal id = rcyclic_g(vars, comps);
+  poly p = 1;
+  int i;
+
+  if (kind == "h" || kind == "n")
+  {
+    for (i=1; i<=vars; i++)
+    {
+      p = p * var(i);
+    }
+    id[vars] = p;
+    if (kind == "h")
+    {
+      id[vars] = id[vars] - var(vars+1)^vars;
+    }
+    else
+    {
+      id[vars] = id[vars] -1;
+    }
+  }
+
+  return (id);
+}
+
+proc generate_weight_str(int j)
+{
+  int i;
+  string res_str = "(";
+  
+  for (i=1; i<j; i++)
+  {
+    res_str = res_str + string(i) + ",";
+  }
+  return (res_str + string(j) + ")");
+}
+
+proc extend_orderings(list olist, int j)
+{
+  int i;
+  int c1;
+  int c2;
+  string o1;
+  string o2;
+  string o3;
+  list nl;
+  string weight_string = generate_weight_str(j);
+  o1 = olist[1];
+  if (size(olist) > 1)
+  {
+    o2 = olist[2];
+    if (size(olist) > 2)
+    {
+      o3 = olist[3];
+    }
+    else
+    {
+      o3 = olist[2];
+    }
+  }
+  else
+  {
+    o2 = o1;
+    o3 = o1;
+  }
+      
+  // add weight orderings 
+  olist = olist + list("Wp" + weight_string, "wp" + weight_string);
+
+    
+  for (i=1; i<=size(olist); i++)
+  {
+    nl = nl + list(olist[i], "(C," + olist[i] + ")", "(c," + olist[i] + ")",
+                   "(" + olist[i] + ",C)", "(" + olist[i] + ",c)");
+  }
+
+  // add product orderings
+  if (j > 1)
+  {
+    c1 = j / 2;
+    if (c1 + c1 == j)
+    {
+      c2 = c1;
+    }
+    else
+    {
+      c2 = c1 + 1;
+    }
+    nl = nl + list("(" + o1 + "(" + string(c1) + "),"+ o2 + "(" + string(c2) + "))", "(" + o1 + "(" + string(c1) + "),"+ o3 + "(" + string(c2) + "))");
+    // and, extra weight vector
+    nl = nl + list("(a" + weight_string + "," + o2 + "(" + string(c1) + "),"+ o3 + "(" + string(c2) + "))", "(a" + generate_weight_str(j-1)+ "," + o3 + "(" + string(c1) + "),"+ o1 + "(" + string(c2) + "))");
+  }
+
+  return (nl);
+
+}
+
+proc mystd
+{
+  int t1 = timer;
+  def id_res = std(#[1]);
+  t1 = timer - t1;
+  int i;
+  def id_poly = id_res[1];
+  for (i=1; i<=size(id_res); i++)
+  {
+    id_poly = id_poly + id_res[i];
+    if (size(id_res[i]) > 2)
+    {   
+      lead(id_res[i]), lead(id_res[i] - lead(id_res[i])), size(id_res[i]);
+    }
+    else
+    {
+      id_res[i];
+    }
+  }
+  id_poly;
+  tst_ignore(t1, "time");
+  tst_ignore(memory(1), "memory");
+}
+
+proc gencopy
+{
+  def id = #[1];
+  int n = #[2];
+  int i, j;
+  module m;
+  
+  
+  for (i=1; i<=size(id); i++)
+  {
+    m[i] = id[i];
+    for (j=1; j<=n; j++)
+    {
+      m[i] = m[i] + gen(j) *  id[i];
+    }
+  }
+  return (m);
+}
+  
+
+proc std_extended_range(int from, int to, int charac, list orderings)
+{
+  int k, j;
+  list olist = orderings;
+  global_char = charac;
+
+  for (k=from; k<=to; k++)
+  {
+    olist = extend_orderings(orderings, k);
+    for (j=1; j <= size(olist); j++)
+    {
+      global_ordering = olist[j];
+      def id = gcyclic(k, 3, "r");
+      mystd(id);
+      mystd(gencopy(id, 2));
+      kill basering;
+
+      if (k>1)
+      {
+        def id = gcyclic(k-1, 3, "h");
+        mystd(id);
+        mystd(gencopy(id, 2));
+        kill basering;
+      }
+    }
+  }
+}
+
+proc std_range(int from, int to, int charac, list orderings)
+{
+  int k, j;
+  list olist = orderings;
+  global_char = charac;
+  
+  for (k=from; k<=to; k++)
+  {
+    for (j=1; j <= size(olist); j++)
+    {
+      global_ordering = olist[j];
+      def id = gcyclic(k, 3, "r");
+      mystd(id);
+      kill basering;
+
+      if (k>1)
+      {
+        def id = gcyclic(k-1, 3, "h");
+        mystd(id);
+        kill basering;
+      }
+    }
+  }
+}
+
+int global_char = 32003;
+string global_ordering = "dp";
+
+option(prot);
+option(noredefine);
+
+list global_orderings = "dp", "lp";
+
+std_extended_range(2, 5, 32003, global_orderings);
+ 
+std_range(6,10, 32003, list("dp"));
+
+std_range(2,5, 0, global_orderings);
+
+std_range(6,10, 0,list("dp"));
+$
Index: Tst/Short/tst_s.tst
===================================================================
--- Tst/Short/tst_s.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/Short/tst_s.tst	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,6 @@
+LIB "tst.lib";
+tst_init();
+
+example tst_system;
+example tst_ignore;
+$
Index: Tst/regress.cmd
===================================================================
--- Tst/regress.cmd	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
+++ Tst/regress.cmd	(revision b35b93807f117d1b5cb55df216eefd3920e0d91f)
@@ -0,0 +1,273 @@
+#!/usr/bin/perl
+
+#################################################################
+# $Id: regress.cmd,v 1.1.1.1 1998-04-17 15:06:45 obachman Exp $
+# FILE:    regress.cmd 
+# PURPOSE: Script which runs regress test of Singular
+# CREATED: 2/16/98
+# AUTHOR:  obachman@mathematik.uni-kl.de
+
+#################################################################
+# 
+# usage
+# 
+sub Usage
+{
+  print <<_EOM_
+Usage:
+regress.cmd    -- regress test of Singular
+  [-s <Singular>]  -- use <Singular> as executable to test
+  [-h]             -- print out help and exit
+  [-n]             -- do not ignore output from tst_ignore when diffing
+  [-k]             -- keep result (*.res) files, do not gzip original res file
+  [-v num]         -- set verbosity to num (used range 0..3, default: 1)
+  [-g]             -- generate result (*.res) files, only
+  [file.lst]       -- read tst files from file.lst
+  [file.tst]       -- test Singular script file.tst 
+_EOM_
+}
+
+#################################################################
+# 
+# the default settings
+#
+$singularOptions = "-tqr12345678";
+$ignore = "-I '^\/\/.*used time:' -I '^\/\/.*ignore:'";
+$keep = "no";
+$verbosity = 1;
+$generate = "no";
+$exit_code = 0;
+$singular = "./Singular";
+if ( (! (-e $singular)) || (! (-x $singular)))
+{
+  $singular = "../Singular";
+}
+
+
+#################################################################
+# 
+# used programs
+#
+$diff = "diff";
+$gunzip = "gunzip";
+$gzip = "gzip";
+$rm = "rm";
+$cp = "cp";
+
+#################################################################
+# 
+# tst_check($root)
+# 
+sub mysystem
+{
+  local($call) = $_[0];
+  local($exit_status);
+  
+  print "$call\n" if ($verbosity > 1);
+  return (system $call);
+}
+
+sub tst_check
+{
+  local($root) = $_[0];
+  local($system_call, $exit_status, $ignore_pattern);
+
+  print "--- $root\n" unless ($verbosity == 0);
+  # check for existence/readablity of tst and res file
+  if (! (-r "$root.tst"))
+  {
+    print (STDERR "Can not read $root.tst\n");
+    return (1);
+  }
+  if (! (-r "$root.res"))
+  {
+    if (! (-r "$root.res.gz"))
+    {
+      if ($generate ne "yes")
+      {
+	print (STDERR "Can not read $root.res[.gz]\n");
+	return (1);
+      }
+    }
+    else
+    {
+      $exit_status = $exit_status || & mysystem("$gunzip -f -c $root.res.gz > $root.res");
+      if ($exit_status)
+      {
+	print (STDERR "Can not $gunzip -f -c $root.res.gz > $root.res" );
+	return ($exit_status);
+      }
+    }
+  }
+  
+  # prepare Singular run
+  if ($verbosity > 2)
+  {
+    $system_call = "$singular $singularOptions $root.tst | tee $root.new.res";
+  }
+  else
+  {
+    $system_call = "$singular $singularOptions $root.tst > $root.new.res";
+  }
+  # Go Singular, Go!
+  $exit_status = & mysystem($system_call);
+  
+  #prepare diff call 
+  & mysystem("$rm -rf $root.diff");
+  if ($generate eq "yes")
+  {
+    $system_call = "$cp $root.new.res $root.res";
+  }
+  elsif ($verbosity > 0)
+  {
+    $system_call = "$diff $ignore $root.res $root.new.res | tee $root.diff";
+  }
+  else
+  {
+    $system_call = "$diff $ignore $root.res $root.new.res > $root.diff";
+  }
+    
+  $exit_status = $exit_status || & mysystem($system_call);
+  # there seems to be a bug here somewhere: even if diff reported
+  # differenceses and exited with status != 0, then system still
+  # returns exit status 0. Hence we manually need to find out whether
+  # or not differences were reported: 
+  # iff diff-file exists and has non-zero size
+  $exit_status = $exit_status || (-e "$root.diff" && -s "$root.diff");
+
+  # complain even if verbosity == 0
+  if ($exit_status && $verbosity == 0)
+  {
+    print (STDERR "---!!! $root\n");
+  }
+
+  #time to clean up
+  if ($keep eq "no" && $exit_status == 0 && $generate ne "yes")
+  {
+    & mysystem("$rm -rf $root.new.res $root.diff");
+    if (-r "$root.res.gz")
+    {
+      & mysystem("$rm -rf $root.res");
+    }
+    else
+    {
+      & mysystem("$gzip -f $root.res");
+    }
+  } 
+  elsif ($generate eq "yes")
+  {
+    & mysystem("$gzip -f $root.res");
+    if ($keep eq "yes")
+    {
+      & mysystem("mv $root.new.res $root.res");
+    }
+    else
+    {
+      & mysystem("$rm -rf $root.new.res");
+    }
+  }
+  
+  return ($exit_status);
+}
+
+
+#################################################################
+# 
+# Main program
+# 
+
+# process switches
+while ($ARGV[0] =~ /^-/)
+{
+  $_ = shift;
+  if (/^-s$/)
+  {
+    $singular = shift;
+  }
+  elsif (/^-h$/)
+  {
+    &Usage && exit (0);
+  }
+  elsif (/^-n$/)
+  {
+    $ignore = "";
+  }
+  elsif (/^-k$/)
+  {
+    $keep = "yes";
+  }
+  elsif (/^-g$/)
+  {
+    $generate = "yes";
+  }
+  elsif(/^-v$/)
+  {
+    $verbosity = shift;
+  }
+  else 
+  {
+    print (STDERR "Unrecognised option: $_\n") && &Usage && die;
+  }
+}
+
+# if no command line arguments are left, use regress.lst
+if ($#ARGV == -1)
+{
+  $ARGV[0] = "regress.lst";
+}
+
+# make sure $singular exists and is executable
+if ( ! (-e $singular))
+{
+  print (STDERR "Can not find $singular \n") && &Usage && die;
+}
+if (! (-x $singular))
+{
+  print (STDERR "Can not execute $singular \n") && Usage && die;
+}
+
+# now do the work
+foreach (@ARGV)
+{
+  # get root and extension
+  ($extension = $_) =~ s/.*\.([^\.]*)$/$1/;
+  ($root = $_) =~ s/(.*)\.[^\.]*$/$1/;
+
+  if ($extension eq "tst")
+  {
+    $exit_code = & tst_check($root) || $exit_code;
+  }
+  elsif ($extension eq "lst")
+  {
+    if (! open(LST_FILE, "<$_"))
+    {
+      print (STDERR "Can not open $_ for reading\n");
+      $exit_code = 1;
+      next;
+    }
+    while (<LST_FILE>)
+    {
+      if (/^;/)
+      {
+	print unless ($verbosity == 0);
+	next;
+      }
+      next if (/^\s*$/);
+      chop if (/\n$/);
+      ($extension = $_) =~ s/.*\.([^\.]*)$/$1/;
+      ($root = $_) =~ s/(.*)\.[^\.]*$/$1/;
+      $exit_code = & tst_check($root) || $exit_code;
+    }
+    close (LST_FILE);
+  }
+  else
+  {
+    print (STDERR "Unknown extension of $_: Need extension lst or tst\n");
+    $exit_code = 1;
+  }
+}
+
+# Und Tschuess
+exit $exit_code;
+
+
