Changeset 9936d6 in git


Ignore:
Timestamp:
Feb 12, 2013, 6:46:45 PM (11 years ago)
Author:
Oleksandr Motsak <motsak@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'b52fc4b2495505785981d640dcf7eb3e456778ef')
Children:
31a08c219875a2199e6c67adcf1eef18ba4a3a4f
Parents:
13a431151fe0f14cbbed84bbf95df65eff7bc567
git-author:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2013-02-12 18:46:45+01:00
git-committer:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2014-05-07 04:41:47+02:00
Message:
Syzygy preprocessing + more testing/benchmarking

TODO: remote benchmarking output...
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/schreyer.lib

    r13a431 r9936d6  
    194194    {
    195195      transpose( transpose(M) * transpose(MRES) );
    196       "transpose( transpose(M) * transpose(MRES) ) != 0!!!";
    197       $
     196      "ERROR: transpose( transpose(M) * transpose(MRES) ) != 0!!!";
     197      m2_end(666);
    198198    }
    199199  }
     
    329329        "RANKS: ", @RANK;
    330330
    331         "transpose( transpose(N) * transpose(MRES) ) != 0!!!";
     331        "ERROR: transpose( transpose(N) * transpose(MRES) ) != 0!!!";
    332332        transpose( transpose(N) * transpose(MRES) );
    333333
     
    335335        transpose(N) * transpose(MRES);
    336336        DetailedPrint(module(_), 2);
    337         $
     337        m2_end(666);
    338338      }
    339339    }
     
    539539
    540540          "ERROR: MySort: wrong sorting in 'MySort': @N != @M!!!";
    541           $
     541          m2_end(666);
    542542        }
    543543      }
     
    556556static proc SSinit(def M)
    557557{
     558  rtimer, "***TIMESNAP0 for SSinit: on level: [",-1,"] :: t: ", timer, ", r: ", rtimer;
    558559  if( (typeof(M) != "module") && (typeof(M) != "ideal") )
    559560  {
     
    650651
    651652      "ERROR: wrong sorting (in SSnit): @N != M!!!";
    652       $
     653      m2_end(666);
    653654    }
    654655
     
    662663
    663664      "ERROR: wrong sorting (in SSnit): @LEAD != LEAD!!!";
    664       $
     665      m2_end(666);
    665666    }
    666667   
     
    738739      transpose( transpose(M) * transpose(MRES) );
    739740      "ERROR: transpose( transpose(M) * transpose(MRES) ) != 0!!!";
    740       $
     741      m2_end(666);
    741742    }
    742743  }
     
    782783  attrib(S, "KERCHECK", @KERCHECK);
    783784  attrib(S, "IGNORETAILS", @IGNORETAILS);
     785
     786  attrib(S, "SYZNUMBER", 0);
    784787 
    785788  if( @DEBUG )
     
    796799  export LRES;
    797800  export TRES;
     801
     802  rtimer, "***TIMESNAP1 for SSinit: on level: [",attrib(basering,"SYZNUMBER"),"] :: t: ", timer, ", r: ", rtimer;
     803 
    798804  return (S);
    799805}
     
    909915    if( (size(S) + size(SS)) > 0 )
    910916    {
    911     if( size(module(matrix(S) - matrix(SS))) > 0 )
    912     {
     917      if( size(module(matrix(S) - matrix(SS))) > 0 )
     918      {
    913919        "ERROR: SSComputeLeadingSyzygyTerms: S != SS ";
    914920
     
    925931//        DetailedPrint(_, 2);     
    926932        print(matrix(S) - matrix(SS));
    927         $
    928     }
     933        m2_end(666);
     934      }
    929935    }
    930936  }
     
    993999        transpose( transpose(SS) * transpose(L) );
    9941000        "ERROR: transpose( transpose(SS) * transpose(L) ) != 0!!!";
    995         $
     1001        m2_end(666);
    9961002      }
    9971003    }
     
    10771083          transpose( transpose(S) * transpose(L) );
    10781084          "ERROR: transpose( transpose(S) * transpose(L) ) != 0!!!";
    1079           $
     1085          m2_end(666);
    10801086        }
    10811087      }
     
    10921098      "SS: "; SS;
    10931099//      DetailedPrint(SS, 2);
    1094       $
     1100      m2_end(666);
    10951101    }   
    10961102
     
    11131119        module(matrix(lead(S)) - matrix(lead(SS)));
    11141120//        DetailedPrint(_ , 4);
    1115         $
     1121        m2_end(666);
    11161122      }
    11171123
     
    11351141//        DetailedPrint(_, 4);
    11361142        print( matrix(Tail(S)) - matrix(Tail(SS)) );
    1137         $
     1143        m2_end(666);
    11381144      }
    11391145      }
     
    11521158      type(S2);
    11531159      L;
    1154       $
     1160      m2_end(666);
    11551161    }
    11561162  } 
     
    12201226      "product: ", product, ", @@product: ", @@product;
    12211227      "ERROR: 'syzterm' results in wrong product !!!???";
    1222       $
     1228      m2_end(666);
    12231229    }
    12241230  }
     
    12871293    {
    12881294      "ERROR in FindReducer => ", my, " != nf: ", nf;
    1289       $;
     1295      m2_end(666);
    12901296    }
    12911297  }
     
    13531359      "@@m: ", @@m, ", @@t: ", @@t;
    13541360      "ERROR: 'syzterm' results in wrong m * t !!!";
    1355       $
     1361      m2_end(666);
    13561362    }
    13571363  }
     
    13921398      "syzterm: ", syzterm;
    13931399      L; T; #;
    1394       $;
     1400      m2_end(666);
    13951401    } 
    13961402  }
     
    14671473      "@tail: ", @tail;
    14681474      L; T; #;
    1469       $;
     1475      m2_end(666);
    14701476    } 
    14711477  }
     
    15521558     
    15531559      L; T; #;
    1554       $;
     1560      m2_end(666);
    15551561    }
    15561562  }
     
    15721578proc SSComputeSyzygy(def L, def T)
    15731579{
    1574   if( typeof( attrib(basering, "DEBUG") ) == "int" )
    1575   {
    1576     int @DEBUG = attrib(basering, "DEBUG");
    1577   } else
    1578   {
    1579     int @DEBUG = !system("with", "ndebug");
    1580   }
    1581 
    1582   if( typeof( attrib(basering, "KERCHECK") ) == "int" )
    1583   {
    1584     int @KERCHECK = attrib(basering, "KERCHECK");
    1585   } else
    1586   {
    1587     int @KERCHECK = @DEBUG;
    1588   }
     1580  rtimer, "***TIMESNAP0 for ComputeSyzygy(L,T): on level: [",attrib(basering,"SYZNUMBER"),"] :: t: ", timer, ", r: ", rtimer;
     1581  int @DEBUG = attrib(basering, "DEBUG");
     1582  int @KERCHECK = attrib(basering, "KERCHECK");
    15891583
    15901584  if( @DEBUG )
     
    15981592    "L: "; L;
    15991593    "T: "; T;
    1600   }
    1601 
    1602   list @res = ComputeSyzygy(L, T);
     1594  }
     1595
     1596  option(prot);
     1597  rtimer, "***TIME for ComputeSyzygy(L,T): on level: [",attrib(basering,"SYZNUMBER"),"] :: t: ", timer, ", r: ", rtimer;
     1598  list @res=ComputeSyzygy(L,T);
     1599  rtimer, "***TIME for ComputeSyzygy(L,T): on level: [",attrib(basering,"SYZNUMBER"),"] :: t: ", timer, ", r: ", rtimer;
     1600  option(noprot); // TODO: restore!
     1601
    16031602
    16041603  module @LL = @res[1]; module @TT = @res[2];
     
    17091708              {
    17101709                "ERROR in SSComputeSyzygy: could not find the 2nd syzygy term during the hybrid NF!!!";
    1711                 $
     1710                m2_end(666);
    17121711              }
    17131712            }
     
    17301729      type(LL);
    17311730      type(@LL);
    1732       $
     1731      m2_end(666);
    17331732    }
    17341733
     
    17441743      type(TT);
    17451744      type(@TT);
    1746       $
     1745      m2_end(666);
    17471746    }
    17481747   
     
    17551754      type(LL);
    17561755      type(@LL);
    1757       $
     1756      m2_end(666);
    17581757    }
    17591758
     
    17691768      type(LL);
    17701769      type(@LL);
    1771       $
     1770      m2_end(666);
    17721771    }   
    17731772   
     
    17901789  }
    17911790
     1791  rtimer, "***TIMESNAP1 for ComputeSyzygy(L,T): on level: [",attrib(basering,"SYZNUMBER"),"] :: t: ", timer, ", r: ", rtimer;
    17921792  return (@SYZ, @LL, @TT);
    17931793}
     
    17961796static proc SSstep()
    17971797{
    1798   if( typeof( attrib(basering, "DEBUG") ) == "int" )
    1799   {
    1800     int @DEBUG = attrib(basering, "DEBUG");
    1801   } else
    1802   {
    1803     int @DEBUG = !system("with", "ndebug");
    1804   }
    1805 
    1806 
    1807   if( typeof( attrib(basering, "SYZCHECK") ) == "int" )
    1808   {
    1809     int @SYZCHECK = attrib(basering, "SYZCHECK");
    1810   } else
    1811   {
    1812     int @SYZCHECK = @DEBUG;
    1813   }
     1798  rtimer, "***TIMESNAP0 for SSstep(): on level: [",attrib(basering,"SYZNUMBER"),"] :: t: ", timer, ", r: ", rtimer;
     1799 
     1800  int @DEBUG = attrib(basering, "DEBUG");
     1801  int @SYZCHECK = attrib(basering, "SYZCHECK");
    18141802
    18151803  if( @DEBUG )
     
    18711859     
    18721860  // TODO: N  = SYZ( M )!!!
    1873   module N, LL, TT;
    1874   (N, LL, TT) = SSComputeSyzygy(/*M, */L, T/*, @RANK*/);
     1861  module N, LL, TT; (N, LL, TT) = SSComputeSyzygy(/*M, */L, T/*, @RANK*/);
    18751862
    18761863  // shift syz.comp by @RANK:
     
    19031890        transpose(N) * transpose(MRES);
    19041891        // DetailedPrint(module(_), 2);
    1905         $
     1892        m2_end(666);
    19061893      }
    19071894    }
     
    19341921  }
    19351922
     1923  int ss = attrib(basering, "SYZNUMBER");
     1924  attrib(basering, "SYZNUMBER", ss + 1 );
     1925
     1926  rtimer, "***TIMESNAP1 for SSstep(): on level: [",attrib(basering,"SYZNUMBER"),"] :: t: ", timer, ", r: ", rtimer;
    19361927}
    19371928
     
    19451936"
    19461937{
     1938  rtimer, "***TIMESNAP0 for SScontinue: on level: [",attrib(basering,"SYZNUMBER"),"] :: t: ", timer, ", r: ", rtimer;
    19471939
    19481940  /// TODO!
     
    19571949    SSstep();
    19581950  }
     1951 
     1952  rtimer, "***TIMESNAP1 for SScontinue: on level: [",attrib(basering,"SYZNUMBER"),"] :: t: ", timer, ", r: ", rtimer;
     1953
    19591954}
    19601955example
     
    20472042    ERROR("Sorry: need an ideal or a module for input");
    20482043  }
    2049 
     2044  "KERCHECK: ", attrib(SSinit, "KERCHECK");
     2045  "SYZCHECK: ", attrib(SSinit, "SYZCHECK");
     2046  "DEBUG: ", attrib(SSinit, "DEBUG");
     2047  "HYBRIDNF: ", attrib(SSinit, "HYBRIDNF");
     2048  "TAILREDSYZ: ", attrib(SSinit, "TAILREDSYZ");
     2049  "LEAD2SYZ: ", attrib(SSinit, "LEAD2SYZ");
     2050
     2051 
    20502052  def SS = SSinit(M); setring SS;
     2053  "KERCHECK: ", attrib(SS, "KERCHECK");
     2054  "SYZCHECK: ", attrib(SS, "SYZCHECK");
     2055  "DEBUG: ", attrib(SS, "DEBUG");
     2056  "HYBRIDNF: ", attrib(SS, "HYBRIDNF");
     2057  "TAILREDSYZ: ", attrib(SS, "TAILREDSYZ");
     2058  "LEAD2SYZ: ", attrib(SS, "LEAD2SYZ");
     2059  "";
     2060  "IGNORETAILS: ", attrib(SS, "IGNORETAILS");
     2061  "SYZNUMBER: ", attrib(SS, "SYZNUMBER");
    20512062
    20522063  if (l == 0)
    20532064  {
    2054     l = nvars(basering) + 1; // not really an estimate...?!
     2065    l = nvars(basering) + 2; // not really an estimate...?!
    20552066  }
    20562067
     
    20592070  SScontinue(l);
    20602071
     2072  "KERCHECK: ", attrib(SS, "KERCHECK");
     2073  "SYZCHECK: ", attrib(SS, "SYZCHECK");
     2074  "DEBUG: ", attrib(SS, "DEBUG");
     2075  "HYBRIDNF: ", attrib(SS, "HYBRIDNF");
     2076  "TAILREDSYZ: ", attrib(SS, "TAILREDSYZ");
     2077  "LEAD2SYZ: ", attrib(SS, "LEAD2SYZ");
     2078  "";
     2079  "IGNORETAILS: ", attrib(SS, "IGNORETAILS");
     2080  "SYZNUMBER: ", attrib(SS, "SYZNUMBER");
     2081 
    20612082  return (SS);
    20622083}
     
    22502271}
    22512272
    2252 proc TestSSres(def M)
    2253 {
    2254   "/ ----------------------------------- : ", "options: ", attrib(SSinit, "LEAD2SYZ"), attrib(SSinit, "TAILREDSYZ"), attrib(SSinit, "HYBRIDNF"), "...";
    2255   int t = timer;
    2256   def S = SSres(M, 0);
    2257   int tt = timer;
    2258 /*
    2259   setring S;
    2260  
     2273/*static*/ proc  StartResTesting(list #)
     2274{
     2275  if( defined(@save_res_list) )
     2276  { ERROR("Sorry: existing global variable @save_res_list - run StopAddResTesting before another Start!!!"); }
     2277 
     2278  ">>>>>>>>> {{{{{{{{{ STARTING TESTING ('" + string(#) + "') :::::::::::: ";
     2279 
     2280  list @save_res_list = list();
     2281  export @save_res_list;
     2282}
     2283
     2284/*static*/ proc  StopResTesting(list #)
     2285{
     2286  if( defined(@save_opts) || defined(@save_method) || defined(@save_desc) )
     2287  { ERROR("Sorry: existing global variables - run StopAddResTest before another Start!!!"); }
     2288
     2289  if( !defined(@save_res_list) )
     2290  { ERROR("Sorry: no global variable - run StartResTesting beforehand!!!"); }
     2291 
     2292  int i, j;
     2293  int f = 0;
     2294  def m;
     2295 
     2296  for (i = size(@save_res_list); i > 0; i--)
     2297  {
     2298    "Total Time: ", @save_res_list[i][5], ", Res: ", @save_res_list[i][6], ", Minimal Betti: ", @save_res_list[i][5] - @save_res_list[i][6], ",        ", @save_res_list[i][1], "   :with:    ", @save_res_list[i][2];
     2299  }
     2300 
     2301  for (i = size(@save_res_list); i > 1; i--)
     2302  {
     2303    m = @save_res_list[i][4];
     2304   
     2305    for (j = i-1; j > 0; j--)
     2306    {
     2307      if( m != @save_res_list[j][4] )
     2308      {
     2309        "ERROR: Betti[j: ", j, "] != Betti[i: ", i, "]:";
     2310        "j: ", j;
     2311        print( @save_res_list[j][4], "betti");
     2312        print(@save_res_list[j]);
     2313       
     2314        "i: ", i;
     2315        print( @save_res_list[i][4], "betti");
     2316        print(@save_res_list[i]);
     2317
     2318        f = 1;
     2319      };
     2320 
     2321    };
     2322 
     2323  };
     2324  if( f )
     2325  {
     2326    print(@save_res_list);
     2327    "<<<<<<<<< }}}}}}}}}  STOP TESTING (", string(#),  ") !!!!!!!!!!!! ";
     2328   
     2329    "ERROR: There were some wrong betti numbers... ";
     2330    m2_end(666);   
     2331  } else
     2332  {
     2333    "BETTI: "; print( @save_res_list[1][4], "betti");   
     2334  }
     2335
     2336  kill @save_res_list;
     2337 
     2338  "<<<<<<<<< }}}}}}}}}  STOP TESTING (", string(#),  ") !!!!!!!!!!!! "; 
     2339}
     2340
     2341/*static*/ proc StartAddResTest(string method, string desc)
     2342{
     2343  if( !defined(@save_res_list) )
     2344  { ERROR("Sorry: no global variable - run StartResTesting beforehand!!!"); }
     2345
     2346  if( defined(@save_opts) || defined(@save_method) || defined(@save_desc) )
     2347  { ERROR("Sorry: existing global variables - run StopAddResTest before another Start!!!"); }
     2348 
     2349 
     2350  def @save_opts = option(get); export @save_opts;
     2351  def @save_method = method; export @save_method;
     2352  def @save_desc = desc; export @save_desc;
     2353 
     2354  "< START RES TEST{{{ ", @save_method, ", with:", @save_desc, " ... ";
     2355}
     2356
     2357
     2358/*static*/ proc StopAddResTest(def RR, intmat S, int @t, int @m)
     2359{
     2360  if( !(defined(@save_opts) && defined(@save_method) && defined(@save_desc)) )
     2361  { ERROR("Sorry: no global variables - run StartAddResTest beforehand!!!"); }
     2362
     2363  list @l = list(@save_method, @save_desc, option(get), S, @t, @m);
     2364 
     2365//  RR, 
     2366//  print(S, "betti");
     2367 
     2368  "> -STOP RES TEST}}} ", @save_method, ", with:", @save_desc, ", Timer:", @t; option();
     2369 
     2370  option(set, @save_opts); kill @save_opts;
     2371
     2372  kill @save_method; kill @save_desc;
     2373 
     2374  @save_res_list[1 + size(@save_res_list)] = @l;
     2375}
     2376
     2377
     2378/*static*/ proc SCheck(def S)
     2379{
     2380  setring S; // for checking...
     2381
     2382  module M = MRES;
     2383  if( ncols(M) < nrows(M) )
     2384  {
     2385    M[nrows(M)] = 0;
     2386  } else
     2387  {
     2388    M = transpose(M);
     2389    if( ncols(M) < nrows(M) )
     2390    {
     2391      M[nrows(M)] = 0;
     2392    }
     2393    M = transpose(M);
     2394  }
     2395
     2396  if( nrows(M) != ncols(M) )
     2397  {
     2398    "ERROR: non-square M!!!";
     2399    m2_end(666);
     2400  }
     2401
     2402  if( size(module( M*M )) > 0 )
     2403  {
     2404    "ERROR: module( M*M ) != 0!!!";
     2405    module( M*M );
     2406
     2407    "MRES': "; M; print(M);
     2408
     2409    m2_end(666);
     2410  }
     2411//  "MRES': "; M; print(M);
     2412
     2413  if( size(RES[1]) != 0 )
     2414  {
     2415    "ERROR: wrong starting zero module!!!";
     2416    m2_end(666);
     2417  }
     2418
     2419//  RES;
     2420/* 
    22612421  MRES;
    22622422  RES;
     
    22662426  TRES;
    22672427*/ 
    2268   kill S;
    2269   "  ", "options: ", attrib(SSinit, "LEAD2SYZ"), attrib(SSinit, "TAILREDSYZ"), attrib(SSinit, "HYBRIDNF"), ": ", "Time [sec]: ", tt - t;
    2270 }
    2271 
    2272 
    2273 proc TestSres(def M)
    2274 {
    2275   def opts = option(get);
     2428}
     2429//// TODO: SSres(0) fails..!!!??
     2430proc TestSSres(def I)
     2431{
     2432  def save = basering;
     2433  int @t,@m,r,rr,i;
     2434  StartAddResTest(
     2435   "SSres",
     2436   "minres + betti(,1) + mods: " +
     2437    "{LEAD2SYZ:"  +string(attrib(SSinit,"LEAD2SYZ")) +
     2438    ";TAILREDSYZ:"+string(attrib(SSinit,"TAILREDSYZ")) +
     2439    ";HYBRIDNF:"  +string(attrib(SSinit,"HYBRIDNF")) + "}"
     2440  );
     2441  option(redSB); option(redTail); 
     2442  rtimer=0;def R=SSres(I,0);@m=rtimer;setring R;module M;list @l=list();@l[size(RES)-1]=list();r=nrows(RES[1]);for(i=2;i<=size(RES);i++){M=RES[i];rr=nrows(M);if((r>0)&&(size(M)>0)&&(r<rr)){M=transpose(M);M=M[(r+1)..ncols(M)];M=transpose(M);RES[i]=M;};r=rr;@l[i-1] = M;};resolution RR=@l;RR=minres(RR);def S=betti(RR,1);@t=rtimer;
     2443  SCheck(R);
     2444  StopAddResTest(RR, S, @t,@m);
     2445  kill S, RR; setring save; kill R;
     2446}
     2447
     2448
     2449proc TestSres(def I)
     2450{
     2451  def save = basering;
     2452  int @t,r,rr,i,@m;
     2453  StartAddResTest(
     2454  "Sres",
     2455  "minres + betti(,1)"
     2456  );
     2457  option(redSB); option(redTail);
     2458  rtimer=0;def R=Sres(I,0);@m=rtimer;setring R;module M;list @l=list();@l[size(RES)-1]=list();r=nrows(RES[1]);for(i=2;i<=size(RES);i++){M=RES[i];rr=nrows(M);if((r>0)&&(size(M)>0)&&(r<rr)){M=transpose(M);M=M[(r+1)..ncols(M)];M=transpose(M);RES[i]=M;};r=rr;@l[i-1] = M;};resolution RR=@l;RR=minres(RR);def S=betti(RR,1);@t=rtimer;
     2459  SCheck(R);
     2460  StopAddResTest(RR, S, @t,@m); 
     2461  kill S, RR; setring save; kill R;
     2462}
     2463
     2464
     2465proc Testsres(def M)
     2466{
     2467  int @t,@m;
     2468  StartAddResTest("sres", "no minres + betti(,1)");
     2469  option(redSB);option(redTail);
     2470  rtimer=0;def RR=sres(groebner(M),0);@m=rtimer;def S=betti(RR,1);@t=rtimer;
     2471  StopAddResTest(RR, S, @t,@m); kill S, RR;
     2472}
     2473
     2474proc Testlres(def M)
     2475{
     2476  int @t,@m;
     2477  StartAddResTest("lres", "no minres + betti(,1)");
     2478  option(redSB);option(redTail);
     2479  rtimer=0;def RR=lres(M,0);@m=rtimer;def S=betti(RR,1);@t=rtimer;
     2480  StopAddResTest(RR, S, @t,@m); kill S, RR;
     2481
     2482  StartAddResTest("lres", "minres + betti()");
     2483  option(redSB);option(redTail);
     2484  rtimer=0;def RR=lres(M,0);@m=rtimer;def S=betti(minres(RR));@t=rtimer;
     2485  StopAddResTest(RR, S, @t,@m);
     2486  kill S, RR;
     2487}
     2488
     2489
     2490proc Testnres(def M)
     2491{
     2492  int @t,@m;
     2493  StartAddResTest("nres", "no minres + betti(,1)");
     2494 
    22762495  option(redSB); option(redTail);
    2277   "/ ----------------------------------- : Sres ...";
    2278   int t = timer;
    2279   def S = Sres(M, 0);
    2280   int tt = timer;
    2281 /*
    2282   setring S;
    2283 
    2284   MRES;
    2285   RES;
    2286   "";
    2287   LRES;
    2288   "";
    2289   TRES;
    2290 */ 
    2291   kill S;
    2292   "  Sres ", "Time [sec]: ", tt - t; 
    2293   option(set, opts);
    2294   kill opts;
    2295 }
    2296 
    2297 
    2298 proc Testsres(def M)
    2299 {
    2300   def opts = option(get);
    2301   option(redSB); option(redTail);
    2302   "/ ----------------------------------- : sres ...";
    2303   int t = timer;
    2304   def S = list(sres(groebner(M), 0));
    2305   int tt = timer;
    2306 /*
    2307   setring S;
    2308 
    2309   MRES;
    2310   RES;
    2311   "";
    2312   LRES;
    2313   "";
    2314   TRES;
    2315 */ 
    2316   kill S;
    2317   "  sres ", "Time [sec]: ", tt - t; 
    2318   option(set, opts);
    2319   kill opts;
    2320 }
    2321 
    2322 
    2323 proc Testlres(def M)
    2324 {
    2325   def opts = option(get);
    2326   option(redSB); option(redTail);
    2327   "/ ----------------------------------- : lres ...";
    2328   int t = timer;
    2329   def S = list(lres(M, 0));
    2330   int tt = timer;
    2331   kill S;
    2332   "  lres ", "Time [sec]: ", tt - t; 
    2333   option(set, opts);
    2334   kill opts;
    2335 }
    2336 
    2337 
    2338 proc Testnres(def M)
    2339 {
    2340   def opts = option(get);
    2341   option(redSB); option(redTail);
    2342   "/ ----------------------------------- : nres ...";
    2343   int t = timer;
    2344   def S = list(nres(M, 0));
    2345   int tt = timer;
    2346   kill S;
    2347   "  nres ", "Time [sec]: ", tt - t; 
    2348   option(set, opts);
    2349   kill opts;
    2350 }
    2351 
    2352 
    2353 proc TestSSresAttribs(def M)
    2354 {
     2496  rtimer=0;def RR=nres(M,0);@m=rtimer;def S=betti(RR,1);@t=rtimer;
     2497 
     2498  StopAddResTest(RR, S, @t,@m); kill S, RR;
     2499}
     2500
     2501proc TestSSresAttribs(def M, list #)
     2502{
     2503  StartResTesting(#);
     2504// simple tests...
    23552505//  M = groebner(M);  "groebner: "; M;  "";
    23562506
    2357 
    2358   // the following 2 setups are bad for AGR@101n3d002s004%1:(((
    2359 
    2360   //////////  attrib(SSinit, "LEAD2SYZ", 0); attrib(SSinit, "TAILREDSYZ", 0); attrib(SSinit, "HYBRIDNF", 0); TestSSres(M);
    2361   //////////  attrib(SSinit, "LEAD2SYZ", 0); attrib(SSinit, "TAILREDSYZ", 0); attrib(SSinit, "HYBRIDNF", 1); TestSSres(M);
    2362 
    2363   attrib(SSinit, "LEAD2SYZ", 0); attrib(SSinit, "TAILREDSYZ", 1); attrib(SSinit, "HYBRIDNF", 0); TestSSres(M);
    2364   attrib(SSinit, "LEAD2SYZ", 0); attrib(SSinit, "TAILREDSYZ", 1); attrib(SSinit, "HYBRIDNF", 1); TestSSres(M);
    2365 
    2366   attrib(SSinit, "LEAD2SYZ", 1); attrib(SSinit, "TAILREDSYZ", 0); attrib(SSinit, "HYBRIDNF", 0); TestSSres(M);
    2367   attrib(SSinit, "LEAD2SYZ", 1); attrib(SSinit, "TAILREDSYZ", 0); attrib(SSinit, "HYBRIDNF", 1); TestSSres(M);
    2368 
    2369   attrib(SSinit, "LEAD2SYZ", 1); attrib(SSinit, "TAILREDSYZ", 1); attrib(SSinit, "HYBRIDNF", 0); TestSSres(M);
    2370   attrib(SSinit, "LEAD2SYZ", 1); attrib(SSinit, "TAILREDSYZ", 1); attrib(SSinit, "HYBRIDNF", 1); TestSSres(M);
    2371 }
    2372 
    2373 
    2374 proc TestSSresAttribs2tr(def M)
    2375 {
    2376   attrib(SSinit, "LEAD2SYZ", 0); attrib(SSinit, "TAILREDSYZ", 1); attrib(SSinit, "HYBRIDNF", 0); TestSSres(M);
    2377   attrib(SSinit, "LEAD2SYZ", 0); attrib(SSinit, "TAILREDSYZ", 1); attrib(SSinit, "HYBRIDNF", 1); TestSSres(M);
    2378 
    2379   attrib(SSinit, "LEAD2SYZ", 1); attrib(SSinit, "TAILREDSYZ", 1); attrib(SSinit, "HYBRIDNF", 0); TestSSres(M);
    2380   attrib(SSinit, "LEAD2SYZ", 1); attrib(SSinit, "TAILREDSYZ", 1); attrib(SSinit, "HYBRIDNF", 1); TestSSres(M);
    2381 
    2382  
    23832507  Testlres(M); 
    23842508  Testnres(M); 
    23852509//  Testsres(M); 
    23862510//  TestSres(M); // too long for the last medium test :(
     2511
     2512
     2513//  attrib(SSinit, "LEAD2SYZ", 0); attrib(SSinit, "TAILREDSYZ", 1); attrib(SSinit, "HYBRIDNF", 0); TestSSres(M);
     2514//  attrib(SSinit, "LEAD2SYZ", 0); attrib(SSinit, "TAILREDSYZ", 1); attrib(SSinit, "HYBRIDNF", 1); TestSSres(M);
     2515
     2516//  attrib(SSinit, "LEAD2SYZ", 1); attrib(SSinit, "TAILREDSYZ", 0); attrib(SSinit, "HYBRIDNF", 0); TestSSres(M);
     2517//  attrib(SSinit, "LEAD2SYZ", 1); attrib(SSinit, "TAILREDSYZ", 0); attrib(SSinit, "HYBRIDNF", 1); TestSSres(M);
     2518
     2519  attrib(SSinit, "LEAD2SYZ", 1); attrib(SSinit, "TAILREDSYZ", 1); attrib(SSinit, "HYBRIDNF", 1); TestSSres(M);
     2520  attrib(SSinit, "LEAD2SYZ", 1); attrib(SSinit, "TAILREDSYZ", 1); attrib(SSinit, "HYBRIDNF", 0); TestSSres(M);
     2521 
     2522
     2523  // the following 2 setups are bad for AGR@101n3d002s004%1:(((
     2524//  attrib(SSinit, "LEAD2SYZ", 0); attrib(SSinit, "TAILREDSYZ", 0); attrib(SSinit, "HYBRIDNF", 0); TestSSres(M);
     2525//  attrib(SSinit, "LEAD2SYZ", 0); attrib(SSinit, "TAILREDSYZ", 0); attrib(SSinit, "HYBRIDNF", 1); TestSSres(M);
     2526
     2527  StopResTesting(#);
     2528
     2529}
     2530
     2531
     2532proc TestSSresAttribs2tr(def M, list #)
     2533{
     2534  StartResTesting(#);
     2535 
     2536  attrib(SSinit, "LEAD2SYZ", 0); attrib(SSinit, "TAILREDSYZ", 1); attrib(SSinit, "HYBRIDNF", 0); TestSSres(M);
     2537  attrib(SSinit, "LEAD2SYZ", 0); attrib(SSinit, "TAILREDSYZ", 1); attrib(SSinit, "HYBRIDNF", 1); TestSSres(M);
     2538
     2539  attrib(SSinit, "LEAD2SYZ", 1); attrib(SSinit, "TAILREDSYZ", 1); attrib(SSinit, "HYBRIDNF", 0); TestSSres(M);
     2540  attrib(SSinit, "LEAD2SYZ", 1); attrib(SSinit, "TAILREDSYZ", 1); attrib(SSinit, "HYBRIDNF", 1); TestSSres(M);
     2541
     2542 
     2543  Testlres(M); 
     2544  Testnres(M); 
     2545//  Testsres(M); 
     2546//  TestSres(M); // too long for the last medium test :(
     2547
     2548  StopResTesting(#);
    23872549}
    23882550
     
    23902552proc testSimple(list #)
    23912553{
    2392   def DEBUG = 0;
     2554  def DEBUG = 1;
    23932555  if(size(#) > 0) { DEBUG = #[1]; }
    23942556
    2395   system("--min-time", "1.0");
    2396   system("--ticks-per-sec", 1);
     2557  system("--min-time", "0.01");
     2558  system("--ticks-per-sec", 100);
     2559
     2560//  option(prot);
    23972561
    23982562  // TODO: only for now!!
    23992563  attrib(SSinit, "DEBUG", (DEBUG > 0));
    2400   attrib(SSinit, "SYZCHECK", 1);
     2564  attrib(SSinit, "SYZCHECK", (DEBUG > 0));
    24012565  attrib(SSinit, "KERCHECK", 1);
    24022566
    24032567  ring r; r; ideal M = maxideal(1); M;
    2404   TestSSresAttribs(M); 
     2568  TestSSresAttribs(M, "<" + string(M) + "> in " + string(basering));
    24052569  kill r;
    24062570
    24072571  ring r = 0, (a, b, c, d), lp; r; ideal M = maxideal(1); M;
    2408   TestSSresAttribs(M); 
     2572  TestSSresAttribs(M, "<" + string(M) + "> in " + string(basering));
    24092573  kill r;
    24102574
    24112575  ring R = 0, (w, x, y, z), dp; R;
    24122576  ideal M = w^2 - x*z,  w*x - y*z,  x^2 - w*y, x*y - z^2, y^2 - w*z; M;
    2413   TestSSresAttribs(M); 
     2577  TestSSresAttribs(M, "<" + string(M) + "> in " + string(basering));
    24142578  kill R;
    24152579
    24162580
    24172581  ring r = 0, (a, b, c, d, e, f), dp; r; ideal M = maxideal(1); M;
    2418   TestSSresAttribs(M); 
     2582  TestSSresAttribs(M, "<" + string(M) + "> in " + string(basering));
    24192583  kill r; 
    24202584 
     
    24232587  ideal M = c*d, b*d, a*d, c^2-d^2, b*c, a*c, b^2-d^2, a*b, a^2-d^2;
    24242588  M;
    2425   TestSSresAttribs(M);
     2589  TestSSresAttribs(M, "simple: AGR@101n3d002s004%1");
    24262590
    24272591  // medium: AGR@101n3d004s009%1;
    24282592  M = a*b+7*a*c-16*b*c-27*a*d+37*b*d-2*c*d, d^3, c*d^2, b*d^2, a*d^2, c^2*d, b*c*d, a*c*d, b^2*d, a^2*d, c^3, b*c^2, a*c^2, b^2*c, a^2*c, b^3, a^3;
    24292593  M;
    2430   TestSSresAttribs(M);
    2431 }
    2432 
    2433 proc testAGR()
    2434 {
    2435   system("--min-time", "1.0");
    2436   system("--ticks-per-sec", 1);
     2594  TestSSresAttribs(M, "medium: AGR@101n3d004s009%1");
     2595}
     2596
     2597proc testAGR(list #)
     2598{
     2599  def DEBUG = 0;
     2600  if(size(#) > 0) { DEBUG = #[1]; }
     2601
     2602  system("--min-time", "0.01");
     2603  system("--ticks-per-sec", 100);
    24372604
    24382605  attrib(SSinit, "DEBUG", 0);
    2439   attrib(SSinit, "SYZCHECK", 1);
     2606  attrib(SSinit, "SYZCHECK", (DEBUG > 0));
    24402607  attrib(SSinit, "KERCHECK", 0);
     2608 
     2609//  option(prot);
    24412610
    24422611  ring AGR = (101), (a, b, c, d), dp; AGR;
     
    24442613  ideal M = c^4*d^2+4*a^3*d^3+29*a^2*b*d^3-2*a*b^2*d^3+2*b^3*d^3-21*a^2*c*d^3+46*a*b*c*d^3+2*b^2*c*d^3-13*a*c^2*d^3+32*b*c^2*d^3+46*c^3*d^3-28*a^2*d^4+4*a*b*d^4+29*b^2*d^4-8*a*c*d^4+33*b*c*d^4-16*c^2*d^4+17*a*d^5-3*b*d^5-42*c*d^5+47*d^6,b*c^3*d^2+35*a^3*d^3+24*a^2*b*d^3+46*a*b^2*d^3-22*b^3*d^3-48*a^2*c*d^3+20*a*b*c*d^3-28*b^2*c*d^3-40*a*c^2*d^3-4*b*c^2*d^3+35*c^3*d^3-21*a^2*d^4+3*a*b*d^4+8*b^2*d^4-2*a*c*d^4-22*b*c*d^4+24*c^2*d^4+44*a*d^5+33*b*d^5+31*c*d^5+26*d^6,a*c^3*d^2-42*a^3*d^3+34*a^2*b*d^3-10*a*b^2*d^3+30*b^3*d^3-6*a^2*c*d^3-30*a*b*c*d^3-34*b^2*c*d^3+29*a*c^2*d^3+35*b*c^2*d^3+13*c^3*d^3+8*a^2*d^4+23*a*b*d^4-29*b^2*d^4+12*a*c*d^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d^4+47*a*b*d^4+22*b^2*d^4+2*a*c*d^4+23*b*c*d^4-47*c^2*d^4+34*a*d^5-15*b*d^5-33*c*d^5-38*d^6,a^5*b-12*a^3*d^3-38*a^2*b*d^3+46*a*b^2*d^3-32*b^3*d^3-41*a^2*c*d^3+14*a*b*c*d^3-34*b^2*c*d^3+7*a*c^2*d^3-6*b*c^2*d^3+31*c^3*d^3+30*a^2*d^4+12*a*b*d^4-17*b^2*d^4-7*a*c*d^4-45*b*c*d^4+10*c^2*d^4+29*a*d^5-28*b*d^5+34*c*d^5-15*d^6,a^6-33*a^3*d^3-45*a^2*b*d^3+19*a*b^2*d^3+39*b^3*d^3-5*a^2*c*d^3-46*a*b*c*d^3+9*b^2*c*d^3+15*a*c^2*d^3-21*b*c^2*d^3+46*c^3*d^3-39*a^2*d^4-9*a*b*d^4+50*b^2*d^4-45*a*c*d^4-39*b*c*d^4-18*c^2*d^4-4*a*d^5-19*b*d^5+12*c*d^5+39*d^6,d^7,c*d^6,b*d^6,a*d^6,c^2*d^5,b*c*d^5,a*c*d^5,b^2*d^5,a*b*d^5,a^2*d^5,c^3*d^4,b*c^2*d^4,a*c^2*d^4,b^2*c*d^4,a*b*c*d^4,a^2*c*d^4,b^3*d^4,a*b^2*d^4,a^2*b*d^4,a^3*d^4;
    24452614  M;
    2446   TestSSresAttribs2tr(M);
     2615  TestSSresAttribs2tr(M, "lengthy: AGR@101n3d008s058%3");
    24472616
    24482617  // AGR@101n3d010s010%3, a bit slower...
    24492618  M = a^2*b^5-50*a*b^6-26*a^6*c+15*a^5*b*c-42*a^4*b^2*c-2*a^3*b^3*c+40*a^2*b^4*c-20*a*b^5*c+11*b^6*c-17*a^5*c^2-4*a^4*b*c^2+13*a^3*b^2*c^2-7*a^2*b^3*c^2+13*a*b^4*c^2-46*b^5*c^2+38*a^4*c^3+32*a^3*b*c^3-49*a^2*b^2*c^3-41*a*b^3*c^3+9*b^4*c^3+17*a^3*c^4-23*a^2*b*c^4+46*a*b^2*c^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a*b^6*c+29*c^2*d^6-16*a*d^7+45*b*d^7-3*c*d^7+14*d^8,b^8+48*c^2*d^6-40*a*d^7-44*b*d^7-10*c*d^7-23*d^8,a*b^7-32*c^2*d^6-41*a*d^7-11*b*d^7+50*c*d^7+13*d^8,d^9,c*d^8,b*d^8,a*d^8,c^2*d^7;
    24502619  M;
    2451   TestSSresAttribs2tr(M); 
     2620  TestSSresAttribs2tr(M, "AGR@101n3d010s010%3, a bit slower..."); 
    24522621  kill AGR;
    24532622
    24542623  ring AGR = (101), (a,b,c,d,e,f,g,h), dp; AGR;
    2455   // AGR@101n7d005s010%2) medium: <= 2
     2624  // AGR@101n7d005s010%2, medium: <= 2
    24562625  ideal M =
    24572626f*h-g*h,e*h-g*h,d*h-g*h,c*h-g*h,b*h-g*h,a*h-g*h,e*g+48*f*g-49*g*h,d*g+5*f*g-6*g*h,c*g+49*f*g-50*g*h,b*g-7*f*g+6*g*h,a*g-50*f*g+49*g*h,e*f-20*f*g+19*g*h,d*f+40*f*g-41*g*h,c*f-12*f*g+11*g*h,b*f+45*f*g-46*g*h,a*f+4*f*g-5*g*h,d*e-f*g,c*e-30*f*g+29*g*h,b*e-39*f*g+38*g*h,a*e+10*f*g-11*g*h,c*d-41*f*g+40*g*h,b*d-23*f*g+22*g*h,a*d-20*f*g+19*g*h,b*c+17*f*g-18*g*h,a*c+6*f*g-7*g*h,a*b+28*f*g-29*g*h,g^2*h-g*h^2,f^2*g-8*f*g^2+7*g*h^2,g*h^4+50*h^5,g^5+41*h^5,f*g^4-18*h^5,f^5+29*h^5,e^5+6*h^5,d^5-23*h^5,c^5-32*h^5,
    24582627b^5+17*h^5,a^5+17*h^5,h^6;
    24592628  M;
    2460   TestSSresAttribs2tr(M);
     2629  TestSSresAttribs2tr(M, "AGR@101n7d005s010%2, medium");
    24612630/*
    24622631options:  1 1 0 :  Time:  3/10
     
    25132682b^2*c^2*e^2, a*b*c^2*e^2;
    25142683  M;
    2515   TestSSresAttribs2tr(M);
     2684  TestSSresAttribs2tr(M, "AGR101n4d007s021%4");
    25162685/*
    25172686options:  1 1 0 :  Time:  5/9/10 (35 without LCM)
     
    25262695
    25272696
    2528   // too big?
    2529   // AGR101n4d008s020%1
     2697  // AGR101n4d008s020%1, too big?
    25302698  ideal M =
    25312699c^5*d-49*a^4*d^2-36*a^3*b*d^2-a^2*b^2*d^2-26*a*b^3*d^2+2*b^4*d^2+8*a^3*c*d^2-46*a^2*b*c*d^2-43*a*b^2*c*d^2-46*b^3*c*d^2-3*a^2*c^2*d^2-43*a*b*c^2*d^2+49*b^2*c^2*d^2-10*a*c^3*d^2+35*b*c^3*d^2+20*c^4*d^2-42*a^3*d^3+45*a^2*b*d^3+32*a*b^2*d^3-45*b^3*d^3-27*a^2*c*d^3+13*a*b*c*d^3+25*b^2*c*d^3+8*a*c^2*d^3+9*b*c^2*d^3+9*c^3*d^3+45*a^2*d^4+30*a*b*d^4+39*b^2*d^4-23*a*c*d^4+2*b*c*d^4-16*c^2*d^4+32*a*d^5-34*b*d^5+39*c*d^5+12*d^6-29*a^5*e-23*a^4*b*e-29*a^3*b^2*e-a^2*b^3*e-20*a*b^4*e+42*b^5*e+20*a^4*c*e-27*a^3*b*c*e-5*a^2*b^2*c*e-14*b^4*c*e-27*a^3*c^2*e-7*a^2*b*c^2*e-25*a*b^2*c^2*e+14*b^3*c^2*e+19*a^2*c^3*e+43*a*b*c^3*e-31*b^2*c^3*e+37*a*c^4*e-34*b*c^4*e+44*c^5*e+21*a^4*d*e+22*a^3*b*d*e+14*a^2*b^2*d*e-35*a*b^3*d*e-29*b^4*d*e-9*a^3*c*d*e-41*a^2*b*c*d*e+28*a*b^2*c*d*e+35*b^3*c*d*e+48*a^2*c^2*d*e+26*a*b*c^2*d*e-47*b^2*c^2*d*e+18*a*c^3*d*e+8*b*c^3*d*e-46*c^4*d*e+50*a^3*d^2*e-46*a^2*b*d^2*e-41*a*b^2*d^2*e-44*b^3*d^2*e+7*a^2*c*d^2*e-a*b*c*d^2*e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2*e^2;
    25932761  M;
    2594   TestSSresAttribs2tr(M);
     2762  TestSSresAttribs2tr(M, "AGR101n4d008s020%1, too big?");
    25952763/*
    25962764options:  1 1 0 :  Time:  29/32/73/92 (316 without LCM)
     
    26022770  kill M;
    26032771
    2604 
    2605 }
    2606 
     2772  kill AGR;
     2773
     2774  ring AGR = (101), (a,b,c,d,e,f), dp; AGR;
     2775
     2776  // AGR@101n5d005s016%1, new, medium difficulty?
     2777  ideal M =
     2778b*d-13*c*d+7*a*e-32*b*e+31*c*e+3*d*e+46*a*f-13*b*f+22*c*f-19*d*f-33*e*f, a*d+2*c*d-42*a*e+46*b*e+7*c*e-38*d*e+31*a*f+9*b*f+27*c*f-19*d*f-24*e*f, b*c-35*c*d-34*a*e+4*b*e+33*c*e+23*d*e+4*a*f-43*b*f+43*c*f+17*d*f-13*e*f, a*c+49*c*d-28*a*e+18*b*e-23*c*e+3*d*e-5*a*f-23*b*f+2*c*f+46*d*f-40*e*f, a*b-38*c*d+a*e-49*b*e-20*c*e+32*d*e+13*a*f+25*b*f+37*c*f-27*d*f+25*e*f, f^4, e*f^3, d*f^3, c*f^3, b*f^3, a*f^3, e^2*f^2, d*e*f^2, c*e*f^2, b*e*f^2, a*e*f^2, d^2*f^2, c*d*f^2, c^2*f^2, b^2*f^2, a^2*f^2, e^3*f, d*e^2*f, c*e^2*f, b*e^2*f, a*e^2*f, d^2*e*f, d^3*f, c^3*f, b^3*f, a^3*f, e^4, d^4, c^4, b^4, a^4;
     2779M;
     2780
     2781  TestSSresAttribs(M, "AGR@101n5d005s016%1, new, medium difficulty?");
     2782/*
     2783 * ?
     2784 */
     2785 kill M;
     2786}
     2787
     2788proc testAGRhard(list #)
     2789{
     2790  def DEBUG = 0;
     2791  if(size(#) > 0) { DEBUG = #[1]; }
     2792
     2793  system("--min-time", "0.01");
     2794  system("--ticks-per-sec", 100);
     2795
     2796  attrib(SSinit, "DEBUG", 0);
     2797  attrib(SSinit, "SYZCHECK", (DEBUG > 0));
     2798  attrib(SSinit, "KERCHECK", 0);
     2799 
     2800//  option(prot);
     2801  ring AGR = (101), (a,b,c,d,e,f), dp; AGR;
     2802
     2803
     2804  // AGR@101n5d006s016%1, new, hard!?
     2805  ideal M =
     2806b*d+47*c*d-27*a*e+37*b*e+21*c*e+31*d*e-31*a*f+23*b*f+47*c*f+42*d*f+11*e*f, a*d+7*c*d+19*a*e+28*b*e-33*c*e-28*d*e+15*a*f+28*b*f+47*c*f+3*d*f+14*e*f, b*c+29*c*d-25*a*e+12*b*e+23*c*e-50*d*e-17*a*f+30*b*f-37*c*f+35*d*f-e*f, a*c+46*c*d+12*a*e+27*b*e+39*c*e+23*d*e-45*a*f+39*b*f-35*c*f+4*d*f-10*e*f, a*b+38*c*d-18*a*e-34*b*e-30*c*e+38*d*e+22*a*f+34*b*f+39*c*f+30*d*f-19*e*f, f^5, e*f^4, d*f^4, c*f^4, b*f^4, a*f^4, e^2*f^3, d*e*f^3, c*e*f^3, b*e*f^3, a*e*f^3, d^2*f^3, c*d*f^3, c^2*f^3, b^2*f^3, a^2*f^3, e^3*f^2, d*e^2*f^2, c*e^2*f^2, b*e^2*f^2, a*e^2*f^2, d^2*e*f^2, d^3*f^2, c^3*f^2, b^3*f^2, a^3*f^2, e^4*f, e^5, d^5, c^5, b^5, a^5;
     2807  TestSSresAttribs(M, "AGR@101n5d006s016%1, new, hard!?");
     2808/*
     2809 * ?
     2810 */
     2811 kill M;
     2812}
    26072813
    26082814
     
    26112817proc testAGRFrame()
    26122818{
    2613   system("--min-time", "1.0");
    2614   system("--ticks-per-sec", 1);
     2819  system("--min-time", "0.01");
     2820  system("--ticks-per-sec", 100);
    26152821
    26162822  attrib(SSinit, "DEBUG", 0);
    26172823  attrib(SSinit, "SYZCHECK", 0); // no such tests anymore with IGNORETAILS == 1!
    26182824  attrib(SSinit, "KERCHECK", 1);
    2619   attrib(SSinit, "IGNORETAILS", 1);
     2825  attrib(SSinit, "IGNORETAILS", 1);
     2826 
     2827//  option(prot);
    26202828
    26212829  ring AGR = (101), (a, b, c, d), dp; AGR;
     
    27752983  kill M;
    27762984
     2985
     2986  kill AGR;
     2987
     2988  ring AGR = (101), (a,b,c,d,e,f), dp; AGR;
     2989  ideal M = b*f+7*c*f+30*d*f-38*e*f, a*f+10*c*f-25*d*f+14*e*f, d*e-10*c*f-17*d*f+26*e*f, c*e-43*c*f+12*d*f+30*e*f, b*e+37*c*f+15*d*f+48*e*f, a*e+21*c*f+37*d*f+42*e*f, c*d+21*c*f+20*d*f-42*e*f, b*d-39*c*f+27*d*f+11*e*f, a*d-39*c*f+17*d*f+21*e*f, b*c+36*c*f+6*d*f-43*e*f, a*c+12*c*f-2*d*f-11*e*f, a*b-35*c*f+d*f+33*e*f, e*f^6+46*f^7, d*f^6-37*f^7, c*f^6+9*f^7, e^7+19*f^7, d^7+40*f^7, c^7+34*f^7, b^7+17*f^7, a^7+40*f^7;
     2990
     2991  TestSSresAttribs(M); 
     2992/*
     2993 * ?
     2994 */
     2995 kill M;
    27772996}
    27782997
  • dyn_modules/syzextra/syzextra.cc

    r13a431 r9936d6  
    3030#include <polys/monomials/p_polys.h>
    3131#include <polys/monomials/ring.h>
     32#include <polys/simpleideals.h>
    3233
    3334#include <kernel/kstd1.h>
     
    3637#include <kernel/ideals.h>
    3738
     39#include <kernel/timer.h>
    3840
    3941
     
    152154/// return a new term: leading coeff * leading monomial of p
    153155/// with 0 leading component!
    154 poly leadmonom(const poly p, const ring r)
     156poly leadmonom(const poly p, const ring r, const bool bSetZeroComp)
    155157{
    156158  poly m = NULL;
     
    164166    p_SetCoeff0(m, n_Copy(p_GetCoeff(p, r), r), r);
    165167
    166     p_SetComp(m, 0, r);
     168    if( bSetZeroComp )
     169      p_SetComp(m, 0, r);
    167170    p_Setm(m, r);
    168171
    169     assume( p_GetComp(m, r) == 0 );
     172   
    170173    assume( m != NULL );
    171174    assume( pNext(m) == NULL );
    172175    assume( p_LmTest(m, r) );
     176   
     177    if( bSetZeroComp )
     178      assume( p_GetComp(m, r) == 0 );
    173179  }
    174180
     
    225231void SchreyerSyzygyComputation::CleanUp()
    226232{
     233  extern void id_Delete (ideal*, const ring);
     234   
     235 id_Delete(const_cast<ideal*>(&m_idTails), m_rBaseRing); // TODO!!!   
     236}
    227237  /*
    228238  for( TTailTerms::const_iterator it = m_idTailTerms.begin(); it != m_idTailTerms.end(); it++ )
     
    233243  }
    234244  */
    235 }
    236 
    237 
    238 
    239 void SchreyerSyzygyComputation::SetUpTailTerms(const ideal idTails)
    240 {
     245
     246
     247
     248bool CReducerFinder::PreProcessTerm(const poly t, CReducerFinder& syzChecker) const
     249{
     250   assume( t != NULL );
     251   
     252   if( __DEBUG__ && __TAILREDSYZ__ )
     253     assume( !IsDivisible(t) ); // each input term should NOT be in <L>
     254   
     255   const ring r = m_rBaseRing;
     256
     257   
     258   if( __TAILREDSYZ__ )
     259     if( p_LmIsConstant(t, r) ) // most basic case of baing coprime with L, whatever that is...
     260       return true; // TODO: prove this...?
     261   
     262//   return false; // appears to be fine
     263
     264   const long comp = p_GetComp(t, r);
     265   
     266   CReducersHash::const_iterator itr = m_hash.find(comp);
     267   
     268   if ( itr == m_hash.end() )
     269     return true; // no such leading component!!!
     270   
     271  const bool bIdealCase = (comp == 0);   
     272  const bool bSyzCheck = syzChecker.IsNonempty(); // need to check even in ideal case????? proof?  "&& !bIdealCase"
     273   
     274//   return false;
     275   if( __TAILREDSYZ__ && (bIdealCase || bSyzCheck) )
     276   {
     277   const TReducers& v = itr->second;
     278   const int N = rVar(r);
     279   // TODO: extract exps of t beforehand?!
     280   bool coprime = true;
     281   for(TReducers::const_iterator vit = v.begin(); (vit != v.end()) && coprime; ++vit )
     282   {
     283     assume( m_L->m[(*vit)->m_label] == (*vit)->m_lt );
     284     
     285     const poly p = (*vit)->m_lt;
     286     
     287     assume( p_GetComp(p, r) == comp );
     288     
     289      // TODO: check if coprime with Leads... if __TAILREDSYZ__ !
     290     for( int var = N; var > 0; --var )
     291       if( (p_GetExp(p, var, r) != 0) && (p_GetExp(t, var, r) != 0) )
     292       {             
     293               if( __DEBUG__ || 0)
     294                 {             
     295                    PrintS("CReducerFinder::PreProcessTerm, 't' is NOT co-prime with the following leading term: \n");
     296                    dPrint(p, r, r, 1);
     297                 }
     298               coprime = false; // t not coprime with p!
     299               break;
     300       }
     301     
     302     if( bSyzCheck && coprime )
     303     {
     304        poly ss = p_LmInit(t, r);
     305        p_SetCoeff0(ss, n_Init(1, r), r); // for delete & printout only!...
     306        p_SetComp(ss, (*vit)->m_label + 1, r); // coeff?
     307        p_Setm(ss, r);
     308       
     309        coprime = ( syzChecker.IsDivisible(ss) );
     310
     311        if( __DEBUG__ && !coprime)
     312          {           
     313             PrintS("CReducerFinder::PreProcessTerm, 't' is co-prime with p but may lead to NOT divisible syz.term: \n");
     314             dPrint(ss, r, r, 1);
     315          }
     316       
     317        p_LmDelete(&ss, r); // deletes coeff as well???
     318     }
     319     
     320   }
     321     
     322   if( __DEBUG__ && coprime )
     323     PrintS("CReducerFinder::PreProcessTerm, the following 't' is 'co-prime' with all of leading terms! \n");
     324     
     325   return coprime; // t was coprime with all of leading terms!!!
     326     
     327   }
     328//   return true; // delete the term
     329   
     330   return false;
     331
     332
     333}
     334 
     335   
     336void SchreyerSyzygyComputation::SetUpTailTerms()
     337{
     338  const ideal idTails = m_idTails;
    241339  assume( idTails != NULL );
    242340  assume( idTails->m != NULL );
     341  const ring r = m_rBaseRing;
     342
     343   if( __DEBUG__ || 0)
     344   {
     345     PrintS("SchreyerSyzygyComputation::SetUpTailTerms(): Tails: \n");
     346     dPrint(idTails, r, r, 0);
     347   }
     348   
     349  unsigned long pp = 0; // count preprocessed terms...
     350
     351  for( int p = IDELEMS(idTails) - 1; p >= 0; --p )
     352    for( poly* tt = &(idTails->m[p]); (*tt) != NULL;  )
     353       {   
     354          const poly t = *tt;
     355       if( m_div.PreProcessTerm(t, m_checker) )
     356       {
     357          if( __DEBUG__ || 0)
     358          {           
     359            PrintS("SchreyerSyzygyComputation::SetUpTailTerms(): PP the following TT: \n");
     360            dPrint(t, r, r, 1);
     361          }
     362          ++pp;
     363           
     364         (*tt) = p_LmDeleteAndNext(t, r); // delete the lead and next...
     365       }   
     366       else
     367         tt = &pNext(t); // go next?
     368 
     369       }
     370
     371   if( TEST_OPT_PROT || 1)
     372     Print("**!!** SchreyerSyzygyComputation::SetUpTailTerms()::PreProcessing has eliminated %u terms!\n", pp);
     373   
     374
     375   if( __DEBUG__ || 0)
     376   {
     377     PrintS("SchreyerSyzygyComputation::SetUpTailTerms(): Preprocessed Tails: \n");
     378     dPrint(idTails, r, r, 0);
     379   }
     380}
    243381/* 
    244382  m_idTailTerms.resize( IDELEMS(idTails) );
     
    265403  }
    266404*/
    267 }
    268405
    269406
     
    568705
    569706
    570 
    571707void SchreyerSyzygyComputation::ComputeSyzygy()
    572708{
     
    581717
    582718  assume( IDELEMS(L) == IDELEMS(T) );
     719  int t, r;
    583720
    584721  if( m_syzLeads == NULL )
     722  {   
     723    if( TEST_OPT_PROT && 1)
     724    {
     725/*       initTimer();
     726       initRTimer();
     727       startTimer();
     728       startRTimer();*/
     729   
     730      t = getTimer();
     731      r = getRTimer();
     732      Print("%d **!TIME4!** SchreyerSyzygyComputation::ComputeSyzygy::ComputeLeadingSyzygyTerms: t: %d, r: %d\n", getRTimer(), t, r);
     733    }
     734     
    585735    ComputeLeadingSyzygyTerms( __LEAD2SYZ__ && !__IGNORETAILS__ ); // 2 terms OR 1 term!
     736    if( TEST_OPT_PROT && 1)
     737    {
     738      t = getTimer() - t;
     739      r = getRTimer() - r;
     740         
     741      Print("%d **!TIME4!** SchreyerSyzygyComputation::ComputeSyzygy::ComputeLeadingSyzygyTerms: t: %d, r: %d\n", getRTimer(), t, r);
     742    }
     743     
     744  }
     745     
    586746
    587747  assume( m_syzLeads != NULL );
     
    596756  if( size == 1 && LL->m[0] == NULL )
    597757    return;
    598 
     758   
     759  if(  !__IGNORETAILS__)
     760  {
     761    if( T != NULL )
     762    {
     763
     764       if( TEST_OPT_PROT && 1 )
     765         {
     766//       initTimer();
     767//       initRTimer();
     768//       startTimer();
     769//       startRTimer(); 
     770   
     771            t = getTimer();
     772            r = getRTimer();
     773          Print("%d **!TIME4!** SchreyerSyzygyComputation::ComputeSyzygy::SetUpTailTerms(): t: %d, r: %d\n", getRTimer(), t, r);
     774         }
     775
     776       SetUpTailTerms();
     777       
     778       if( TEST_OPT_PROT && 1)
     779       {
     780          t = getTimer() - t;
     781          r = getRTimer()  - r;
     782         
     783          Print("%d **!TIME4!** SchreyerSyzygyComputation::ComputeSyzygy::SetUpTailTerms(): t: %d, r: %d\n", getRTimer(), t, r);
     784       }
     785       
     786 
     787
     788    }     
     789  }
     790
     791       if( TEST_OPT_PROT && 1)
     792         {
     793//       initTimer();
     794//       initRTimer();
     795//       startTimer();
     796//       startRTimer(); 
     797   
     798            t = getTimer();
     799            r = getRTimer();
     800          Print("%d **!TIME4!** SchreyerSyzygyComputation::ComputeSyzygy::SyzygyLift: t: %d, r: %d\n", getRTimer(), t, r);
     801         }
    599802
    600803  for( int k = size - 1; k >= 0; k-- )
     
    631834
    632835  }
    633 
    634   TT->rank = id_RankFreeModule(TT, R);
     836   
     837       if( TEST_OPT_PROT && 1)
     838       {
     839          t = getTimer() - t;
     840          r = getRTimer();  - r;
     841         
     842          Print("%d **!TIME4!** SchreyerSyzygyComputation::ComputeSyzygy::SyzygyLift: t: %d, r: %d\n", getRTimer(), t, r);
     843       }
     844
     845   
     846
     847  TT->rank = id_RankFreeModule(TT, R); 
    635848}
    636849
     
    772985  assume( tail >= 0 && tail < IDELEMS(m_idTails) );
    773986
    774   const poly t = m_idTails->m[tail];
     987  const poly t = m_idTails->m[tail]; // !!!
    775988
    776989  if(t != NULL)
     
    13351548    poly lm = p_Mult_mm(leadmonom(syzterm, r), m, r);
    13361549
    1337     poly pr = p_Mult_q( p_LmInit(multiplier, r), p_LmInit(t, r), r);
     1550    poly pr = p_Mult_q( leadmonom(multiplier, r, false), leadmonom(t, r, false), r);
    13381551   
    13391552    assume( p_EqualPolys(lm, pr, r) );
     
    13941607    return q;
    13951608  }
    1396 
    1397   p_LmFree(q, r);
    1398 
    1399   return NULL;
    1400 
    1401    
    1402  
    1403    
    1404    
    1405 #if 0
     1609   
     1610/*
    14061611  const long comp = p_GetComp(t, r); assume( comp >= 0 );
    14071612  const unsigned long not_sev = ~p_GetShortExpVector(multiplier, t, r); // !
     
    14841689    return q;
    14851690  }
     1691*/
    14861692
    14871693  p_LmFree(q, r);
    14881694
    14891695  return NULL;
    1490 #endif
     1696 
    14911697}
    14921698
     
    14941700poly CReducerFinder::FindReducer(const poly product, const poly syzterm, const CReducerFinder& syz_checker) const
    14951701{
     1702  CDivisorEnumerator itr(*this, product);
     1703  if( !itr.Reset() )
     1704    return NULL;
     1705
     1706
    14961707  const ring& r = m_rBaseRing;
    14971708
     
    15221733  }
    15231734
    1524   const long comp = p_GetComp(product, r);
    1525   const unsigned long not_sev = ~p_GetShortExpVector(product, r);
    1526 
    1527   assume( comp >= 0 );
    1528 
    1529 //   for( int k = IDELEMS(L)-1; k>= 0; k-- )
    1530 //   {
    1531 //     const poly p = L->m[k];
    1532 //
    1533 //     if ( p_GetComp(p, r) != comp )
    1534 //       continue;
    1535 //
    1536 //     const unsigned long p_sev = p_GetShortExpVector(p, r); // to be stored in m_hash!!!
    1537  
    1538    // looking for an appropriate diviser p = L[k]...
    1539   CReducersHash::const_iterator it = m_hash.find(comp); // same module component
    1540 
    1541   if( it == m_hash.end() )
    1542     return NULL;
    1543 
    1544   assume( m_L != NULL );
    1545 
    1546   const TReducers& reducers = it->second;
    15471735
    15481736  const BOOLEAN to_check = (syz_checker.IsNonempty()); // __TAILREDSYZ__ &&
     
    15521740  if( __DEBUG__ )
    15531741    p_SetCoeff0(q, 0, r); // for printing q
    1554  
    1555   for(TReducers::const_iterator vit = reducers.begin(); vit != reducers.end(); vit++ )
    1556   {
    1557     const poly p = (*vit)->m_lt;
    1558 
    1559     assume( p_GetComp(p, r) == comp );
    1560 
    1561     const int k = (*vit)->m_label;
    1562 
    1563     assume( L->m[k] == p );
    1564 
    1565     const unsigned long p_sev = (*vit)->m_sev;
    1566 
    1567     assume( p_sev == p_GetShortExpVector(p, r) );     
    1568 
    1569     if( !p_LmShortDivisibleByNoComp(p, p_sev, product, not_sev, r) )
    1570       continue;     
    1571 
    1572 //     // ... which divides the product, looking for the _1st_ appropriate one!
    1573 //     if( !p_LmDivisibleByNoComp(p, product, r) ) // included inside  p_LmShortDivisibleBy!
    1574 //       continue;
    1575 
     1742
     1743  while( itr.MoveNext() )
     1744  {
     1745    const poly p = itr.Current().m_lt;
     1746    const int k  = itr.Current().m_label;
     1747     
    15761748    p_ExpVectorDiff(q, product, p, r); // (LM(product) / LM(L[k]))
    15771749    p_SetComp(q, k + 1, r);
     
    15981770        PrintS("_FindReducer::Test LS: q is divisible by LS[?] !:((: ");
    15991771      }
     1772
     1773      continue;
     1774    }
     1775
     1776    p_SetCoeff0(q, n_Neg( n_Div( p_GetCoeff(product, r), p_GetCoeff(p, r), r), r), r);
     1777   
     1778    return q;
     1779  }
     1780   
     1781   
     1782   
     1783/*   
     1784  const long comp = p_GetComp(product, r);
     1785  const unsigned long not_sev = ~p_GetShortExpVector(product, r);
     1786
     1787  assume( comp >= 0 );
     1788
     1789//   for( int k = IDELEMS(L)-1; k>= 0; k-- )
     1790//   {
     1791//     const poly p = L->m[k];
     1792//
     1793//     if ( p_GetComp(p, r) != comp )
     1794//       continue;
     1795//
     1796//     const unsigned long p_sev = p_GetShortExpVector(p, r); // to be stored in m_hash!!!
     1797 
     1798   // looking for an appropriate diviser p = L[k]...
     1799  CReducersHash::const_iterator it = m_hash.find(comp); // same module component
     1800
     1801  if( it == m_hash.end() )
     1802    return NULL;
     1803
     1804  assume( m_L != NULL );
     1805
     1806  const TReducers& reducers = it->second;
     1807
     1808  const BOOLEAN to_check = (syz_checker.IsNonempty()); // __TAILREDSYZ__ &&
     1809
     1810  const poly q = p_New(r); pNext(q) = NULL;
     1811
     1812  if( __DEBUG__ )
     1813    p_SetCoeff0(q, 0, r); // for printing q
     1814 
     1815  for(TReducers::const_iterator vit = reducers.begin(); vit != reducers.end(); vit++ )
     1816  {
     1817    const poly p = (*vit)->m_lt;
     1818
     1819    assume( p_GetComp(p, r) == comp );
     1820
     1821    const int k = (*vit)->m_label;
     1822
     1823    assume( L->m[k] == p );
     1824
     1825    const unsigned long p_sev = (*vit)->m_sev;
     1826
     1827    assume( p_sev == p_GetShortExpVector(p, r) );     
     1828
     1829    if( !p_LmShortDivisibleByNoComp(p, p_sev, product, not_sev, r) )
     1830      continue;     
     1831
     1832//     // ... which divides the product, looking for the _1st_ appropriate one!
     1833//     if( !p_LmDivisibleByNoComp(p, product, r) ) // included inside  p_LmShortDivisibleBy!
     1834//       continue;
     1835
     1836    p_ExpVectorDiff(q, product, p, r); // (LM(product) / LM(L[k]))
     1837    p_SetComp(q, k + 1, r);
     1838    p_Setm(q, r);
     1839
     1840    // cannot allow something like: a*gen(i) - a*gen(i)
     1841    if (syzterm != NULL && (k == c))
     1842      if (p_ExpVectorEqual(syzterm, q, r))
     1843      {
     1844        if( __DEBUG__ )
     1845        {
     1846          Print("_FindReducer::Test SYZTERM: q == syzterm !:((, syzterm is: ");
     1847          dPrint(syzterm, r, r, 1);
     1848        }   
     1849
     1850        continue;
     1851      }
     1852
     1853    // while the complement (the fraction) is not reducible by leading syzygies
     1854    if( to_check && syz_checker.IsDivisible(q) )
     1855    {
     1856      if( __DEBUG__ )
     1857      {
     1858        PrintS("_FindReducer::Test LS: q is divisible by LS[?] !:((: ");
     1859      }
    16001860     
    16011861      continue;
     
    16051865    return q;
    16061866  }
     1867*/
    16071868
    16081869  p_LmFree(q, r);
  • dyn_modules/syzextra/syzextra.h

    r13a431 r9936d6  
    3838BEGIN_NAMESPACE_SINGULARXX    BEGIN_NAMESPACE(SYZEXTRA)
    3939
    40 poly leadmonom(const poly p, const ring r);
     40poly leadmonom(const poly p, const ring r, const bool bSetZeroComp = true);
    4141
    4242/// return the tail of a given polynomial or vector
     
    6060
    6161/// Computation attribute storage
    62 class SchreyerSyzygyComputationFlags
    63 {
    64   public:
     62struct SchreyerSyzygyComputationFlags
     63{
    6564    SchreyerSyzygyComputationFlags(idhdl rootRingHdl);
    6665
     
    9392  /// global base ring
    9493  const ring m_rBaseRing;
    95 
    9694};
    9795
     
    160158    bool IsDivisible(const poly q) const;
    161159
    162     bool IsNonempty() const { return !m_hash.empty(); }
     160    inline bool IsNonempty() const { return !m_hash.empty(); }
     161
     162    /// is the term to be "preprocessed" as lower order term or lead to only reducible syzygies...
     163    bool PreProcessTerm(const poly t, CReducerFinder& syzChecker) const;
    163164
    164165    poly FindReducer(const poly multiplier, const poly monom, const poly syzterm, const CReducerFinder& checker) const;
     
    178179};
    179180
     181extern ideal id_Copy (const ideal, const ring);
    180182
    181183
     
    199201    SchreyerSyzygyComputation(const ideal idLeads, const ideal idTails, const SchreyerSyzygyComputationFlags setting):
    200202        SchreyerSyzygyComputationFlags(setting),
    201         m_idLeads(idLeads), m_idTails(idTails),
     203        m_idLeads(idLeads), m_idTails(id_Copy(idTails, setting.m_rBaseRing)),
    202204        m_syzLeads(NULL), m_syzTails(NULL), m_LS(NULL),
    203205        m_lcm(m_idLeads, setting), m_div(m_idLeads, setting), m_checker(NULL, setting)
    204206    {
    205       if( __TAILREDSYZ__ && !__IGNORETAILS__)
    206       {
    207         if( idTails != NULL )
    208           SetUpTailTerms(idTails);
    209       }
    210207    }
    211208
     
    213210    SchreyerSyzygyComputation(const ideal idLeads, const ideal idTails, const ideal syzLeads, const SchreyerSyzygyComputationFlags setting):
    214211        SchreyerSyzygyComputationFlags(setting),
    215         m_idLeads(idLeads), m_idTails(idTails),
     212        m_idLeads(idLeads), m_idTails(id_Copy(idTails, setting.m_rBaseRing)),
    216213        m_syzLeads(syzLeads), m_syzTails(NULL), m_LS(syzLeads),
    217214        m_lcm(m_idLeads, setting), m_div(m_idLeads, setting), m_checker(NULL, setting)
     
    221218        if (syzLeads != NULL)
    222219          m_checker.Initialize(syzLeads);
    223         if( idTails != NULL )
    224           SetUpTailTerms(idTails);
     220//        if( idTails != NULL )
     221//          SetUpTailTerms();
    225222      }
    226223    }
    227224
    228225    /// Destructor should not destruct the resulting m_syzLeads, m_syzTails.
    229     ~SchreyerSyzygyComputation(){ CleanUp(); }
     226    ~SchreyerSyzygyComputation(){ CleanUp(); } 
    230227
    231228    /// Convert the given ideal of tails into the internal representation (with reducers!)
    232     void SetUpTailTerms(const ideal idTails);
    233    
    234     void CleanUp();
    235 
     229    /// Preprocess m_idTails as well...?
     230    void SetUpTailTerms();
     231   
    236232    /// Read off the results while detaching them from this object
    237233    /// NOTE: no copy!
     
    268264    inline poly _FindReducer(const poly product, const poly syzterm) const
    269265        { return m_div.FindReducer(product, syzterm, m_checker); } 
    270    
     266 private:
     267    void CleanUp();
    271268  protected:
     269
    272270
    273271    /// just leading terms
     
    321319    TTailTerms m_idTailTerms;
    322320    */
     321
     322   
     323/// TODO: look into m_idTailTerms!!!!!!!!!!!!!!!!!!!!!!!! map? heaps???
    323324};
    324325
Note: See TracChangeset for help on using the changeset viewer.