Changeset 7ed4b9b in git


Ignore:
Timestamp:
Apr 10, 2009, 3:34:00 PM (14 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
Children:
093892a77af2a4dbecf127c9466ed0de10c63076
Parents:
6af4b1d2770833d1e8d4e66dd4c4613664220413
Message:
*laplagne: new start. in normal


git-svn-id: file:///usr/local/Singular/svn/trunk@11671 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/normal.lib

    r6af4b1 r7ed4b9b  
    11///////////////////////////////////////////////////////////////////////////////
    2 version="$Id: normal.lib,v 1.51 2009-04-07 16:18:05 seelisch Exp $";
     2version="$Id: normal.lib,v 1.52 2009-04-10 13:34:00 Singular Exp $";
    33category="Commutative Algebra";
    44info="
     
    1010
    1111MAIN PROCEDURES:
    12  normal(I[...]);     normalization of an affine ring 
     12 normal(I[...]);     normalization of an affine ring
    1313 normalP(I,[...];    normalization of an affine ring in positive characteristic
    1414 normalC(I,[...];    normalization of an affine ring through a chain of rings
    15  HomJJ(L);           presentation of the End_R(J) as affine ring, J an ideal
     15 HomJJ(L);           presentation of End_R(J) as affine ring, J an ideal
    1616 genus(I);           computes the geometric genus of a projective curve
    1717 primeClosure(L);    integral closure of R/p, p a prime ideal
     
    2222 deltaLoc(f,S);      sum of delta invariants at conjugated singular points
    2323 locAtZero(I);       checks whether the zero set of I is located at 0
    24  norTest(i,nor;)     checks whether result of normal or mormal_p was correct
     24 norTest(I,nor);     checks the output of normal, normalP, normalC
    2525";
    2626
     
    4444         Optional parameters in list choose (can be entered in any order):@*
    4545         Decomposition:@*
    46          - \"prim\" -> computes first the minimal associated primes, and then
    47          the normalization of each prime. (default)@*
    4846         - \"equidim\" -> computes first an equidimensional decomposition,
    49          and then the normalization of each component. @*
    50          - \"noDeco\" -> no preliminary decomposition is done. If the ideal is
     47         and then the normalization of each component. (default)@*
     48         - \"prim\" -> computes first the minimal associated primes, and then
     49         the normalization of each prime. @*
     50         - \"noDeco\" -> no preliminary decomposition is done. If the ideal is
    5151         not equidimensional radical, output might be wrong.@*
    52          - \"isPrim\" -> assumes that the ideal is prime. If assumption does 
     52         - \"isPrim\" -> assumes that the ideal is prime. If assumption does
    5353         not hold, output might be wrong.@*
    54          - \"noFac\" -> factorization is avoided in the computation of the 
     54         - \"noFac\" -> factorization is avoided in the computation of the
    5555         minimal associated primes;
    5656         Other:@*
     
    5959         ordering only for computing radicals and prime or equidimensional
    6060         decompositions.@*
    61          If this option is not set, changes to dp ordering and perform all
     61         If this option is not set, it changes to dp ordering and perform all
    6262         computation with respect to this ordering.@*
    6363         - \"withDelta\" (or \"wd\") -> returns also the delta invariants.
    6464         If choose is not given or empty, the default options are used.@*
    6565ASSUME:  The ideal must be radical, for non-radical ideals the output may
    66          be wrong (id=radical(id); makes id radical). However, when using 
    67          \"prim\" option the minimal associated primes of id are computed first 
    68          and hence normal computes the normalization of the radical of id.
     66         be wrong (id=radical(id); makes id radical). However, when using
     67         \"prim\" option the minimal associated primes of id are computed first
     68         and hence normal computes the normalization of the radical of id.@*
    6969         \"isPrim\" should only be used if id is known to be prime.
    70 RETURN:  a list, say nor, of size 1 (resp. 2 with option \"withDelta\").
    71 @format 
    72          The first element nor[1] is a list of r elements, where r is the
    73          number of associated primes P_i with option \"prim\" (resp. >= no 
     70RETURN:  a list, say nor, of size 2 (resp. 3 with option \"withDelta\").
     71@format
     72         * nor[1], the first element, is a list of r rings, where r is the
     73         number of associated primes P_i with option \"prim\" (resp. >= no
    7474         of equidimenensional components P_i with option \"equidim\").@*
    75          Each element of nor[1] is a list with the information on the
    76          normalization of the i-th component, i.e. the integral closure
    77          in its field of fractions (as affine ring).@*
    78          Each list nor[1][i] contains 3 elements (resp. 4 with option
    79          \"withDelta\"). @*
    80          The first two element of nor[1][i] give the normalization by
    81          module generators. The normalization is of the form
    82          1/c * U, with U = nor[1][i][1] an ideal of R / P_i and
    83          c = nor[1][i][2] a polynomial in R / P_i.@*
    84          The third element is a ring Ri=nor[1][i][3], i=1..r,
    85          which contains two ideals with given
     75         Each ring Ri:=nor[1][i], i=1..r, contains two ideals with given
    8676         names @code{norid} and @code{normap} such that @*
    87          - Ri/norid is the normalization of the i-th component.
    88          - the direct sum of the rings Ri/norid is the normalization
     77         - Ri/norid is the normalization of the i-th component, i.e. the
     78          integral closure in its field of fractions (as affine ring);
     79         - @code{normap} gives the normalization map from basering/id to
     80           Ri/norid for each i.@*
     81         - the direct sum of the rings Ri/norid, i=1,..r, is the normalization
    8982           of basering/id; @*
    90          - @code{normap} gives the normalization map from basering/id to
    91            Ri/norid for each j.@*
    92          When option \"withDelta\" is set, the forth element nor[1][i][4] is
    93          the delta invariant of the i-th component. (-1 means infinite, and 0
    94          that basering/P_i is normal)@*
    95          @*
    96          Also, When option \"withDelta\" is set the second element of the list
    97          nor, nor[2], is an integer, the total delta invariant of basering/id
    98          (-1 means infinite, and 0 that basering/id is normal).
     83         * nor[2] is a list of size r with information on the normalization of
     84         the i-th component as module over the basering:@*
     85         nor[2][i] is an ideal, say U, in the basering such that the integral
     86         closure of basering/P_i is generated as module over the basering by
     87         1/c * U, with c the last element U[size(U)] of U.@*
     88         * nor[3] (if option \"withDelta\" is set) is a list of an intvec
     89         of size r, the delta invariants of the r components, and an integer,
     90         the total delta invariant of basering/id (-1 means infinite, and 0
     91         that basering/P_i resp. basering/input is normal).
    9992@end format
    100 THEORY:  We use a general algorithm described in [G.-M. Greuel, S. Laplagne, 
    101          F. Seelisch: Normalization of Rings (2009)].
    102          The delta invariant of a reduced ring K[x1,...,xn]/id is 
     93THEORY:  We use a general algorithm described in [G.-M. Greuel, S. Laplagne,
     94         F. Seelisch: Normalization of Rings (2009)].@*
     95         The delta invariant of a reduced ring K[x1,...,xn]/id is
    10396             dim_K(normalization(K[x1,...,xn]/id) / K[x1,...,xn]/id)
    10497         We call this number also the delta invariant of id.
    105 NOTE:    To use the i-th ring type: @code{def R=nor[1][i][3]; setring R;}.
    106 @*       Increasing/decreasing printlevel displays more/less comments 
     98NOTE:    To use the i-th ring type: @code{def R=nor[1][i]; setring R;}.
     99@*       Increasing/decreasing printlevel displays more/less comments
    107100         (default: printlevel=0).
    108 @*       Implementation works also for local rings.         
     101@*       Implementation works also for local rings.
    109102@*       Not implemented for quotient rings.
    110103@*       If the input ideal id is weighted homogeneous a weighted ordering may
     
    113106EXAMPLE: example normal; shows an example
    114107"
    115 { 
     108{
    116109   intvec opt = option(get);     // Save current options
    117110
    118    int i,j;
    119    int decomp;  // Preliminar decomposition:
     111  int i,j;
     112  int decomp;   // Preliminar decomposition:
    120113                // 0 -> no decomposition (id is assumed to be prime)
    121                 // 1 -> no decomposition 
    122                 //      (id is assumed to be equidimensional radical) 
     114                // 1 -> no decomposition
     115                //      (id is assumed to be equidimensional radical)
    123116                // 2 -> equidimensional decomposition
    124117                // 3 -> minimal associated primes
    125    int noFac, useRing, withDelta;
    126    int dbg = printlevel - voice + 2;
    127    int nvar = nvars(basering);
    128    int chara  = char(basering);
    129    list result;
    130    list keepresult;
    131    list ringStruc;
    132    ideal U;
    133    poly c;
    134    
    135    // Default methods:
    136    noFac = 0;         // Use facSTD when computing minimal associated primes
    137    decomp = 3;        // Minimal associated primes
    138    useRing = 0;       // Change first to dp ordering, and perform all
    139                       // computations there.
    140    withDelta = 0;     // Do not compute the delta invariant.
    141  
    142 
    143   //--------------------------- define the method ---------------------------
     118  int noFac, useRing, withDelta;
     119  int dbg = printlevel - voice + 2;
     120  int nvar = nvars(basering);
     121  int chara  = char(basering);
     122  list result;
     123  list keepresult;
     124  list ringStruc;
     125  ideal U;
     126  poly c;
     127  int sp;            // Number of components.
     128
     129  // Default methods:
     130  noFac = 0;         // Use facSTD when computing minimal associated primes
     131  decomp = 2;        // Equidimensional decomposition
     132  useRing = 0;       // Change first to dp ordering, and perform all
     133                     // computations there.
     134  withDelta = 0;     // Do not compute the delta invariant.
     135
     136//--------------------------- define the method ---------------------------
    144137  string method;                //make all options one string in order to use
    145138                               //all combinations of options simultaneously
    146139  for ( i=1; i <= size(#); i++ )
    147   { 
    148     if ( typeof(#[i]) == "string" ) 
     140  {
     141    if ( typeof(#[i]) == "string" )
    149142    {
    150143      method = method + #[i];
     
    152145  }
    153146
    154   //--------------------------- choosen methods -----------------------
     147//--------------------------- choosen methods -----------------------
    155148  if ( find(method,"isprim") or find(method,"isPrim") )
    156149  {decomp = 0;}
    157  
     150
    158151  if ( find(method,"nodeco") or find(method,"noDeco") )
    159152  {decomp = 1;}
    160  
     153
     154  if ( find(method,"prim") )
     155  {decomp = 3;}
     156
    161157  if ( find(method,"equidim") )
    162158  {decomp = 2;}
    163  
    164   if ( find(method,"prim") )
    165   {decomp = 3;}
    166  
     159
    167160  if ( find(method,"nofac") or find(method,"noFac") )
    168161  {noFac=1;}
    169  
     162
    170163  if ( (find(method,"useRing") or find(method,"usering")) and (ordstr(basering) != "dp("+string(nvars(basering))+"),C"))
    171164  {useRing = 1;}
    172  
     165
    173166  if ( find(method,"withDelta") or find(method,"wd") or find(method,"withdelta"))
    174167  {
     
    186179  list #;
    187180
    188   //------------------------ change ring if required ------------------------
    189   // If the ordering is not global, we change to dp ordering for computing the
    190   // min ass primes.
    191   // If the ordering is global, but not dp, and useRing = 0, we also change to
    192   // dp ordering.
    193  
     181//------------------------ change ring if required ------------------------
     182// If the ordering is not global, we change to dp ordering for computing the
     183// min ass primes.
     184// If the ordering is global, but not dp, and useRing = 0, we also change to
     185// dp ordering.
     186
    194187  int isGlobal = ord_test(basering);      // Checks if the original ring has
    195188                                          // global ordering.
    196  
     189
    197190  def origR = basering;   // origR is the original ring
    198191                          // R is the ring where computations will be done
    199    
     192
    200193  if((useRing  == 1) and (isGlobal == 1)){
    201194    def globR = basering;
     
    208201    def globR = ring(rl);
    209202    setring globR;
    210     ideal id = fetch(origR, id); 
    211   }
    212 
    213   //------------------------ preliminary decomposition-----------------------
     203    ideal id = fetch(origR, id);
     204  }
     205
     206//------------------------ trivial checkings ------------------------
     207  id = groebner(id);
     208  if((size(id) == 0) or (id[1] == 1)){
     209    // The original ring R/I was normal. Nothing to do.
     210    // We define anyway a new ring, equal to R, to be able to return it.
     211    setring origR;
     212    list lR = ringlist(origR);
     213    def ROut = ring(lR);
     214    setring ROut;
     215    ideal norid = 0;
     216    ideal normap = maxideal(1);
     217    export norid;
     218    export normap;
     219    setring origR;
     220    if(withDelta){
     221      result = list(list(ideal(1), poly(1), ROut), 0);
     222    } else {
     223      result = list(list(ideal(1), poly(1), ROut));
     224    }
     225    return(result);
     226  }
     227
     228//------------------------ preliminary decomposition-----------------------
    214229  list prim;
    215230  if(decomp == 2){
     
    227242    { prim = minAssGTZ(id); }
    228243  }
    229 
    230   // if ring was not global and useRing is on, we go back to the original ring
     244  sp = size(prim);
     245  if(dbg>=1)
     246  {
     247    prim; "";
     248    "// number of components is", sp;
     249    "";
     250  }
     251
     252
     253//----------------- back to the original ring if required ------------------
     254// if ring was not global and useRing is on, we go back to the original ring
    231255  if((useRing == 1) and (isGlobal != 1)){
    232256    setring origR;
     
    240264    }
    241265  }
    242    
    243   if(dbg>=1)
    244   { 
    245     prim; "";
    246     "// number of components is", size(prim);
    247     "";
    248   }
    249    
    250   // ---------------- normalization of the components-------------------------
    251   // calls normalM to compute the normalization of each component.
     266
     267// ---------------- normalization of the components-------------------------
     268// calls normalM to compute the normalization of each component.
    252269
    253270  list norComp;       // The normalization of each component.
     
    262279  def newR;
    263280  list newRList;
    264    
     281
    265282  for(i=1; i<=size(prim); i++)
    266283  {
     
    276293      printlevel = printlevel + 1;
    277294      norComp = normalM(prim[i], decomp, withDelta);
    278       printlevel = printlevel - 1;     
     295      printlevel = printlevel - 1;
    279296      for(j = 1; j <= size(norComp); j++){
    280297        newR = norComp[j][3];
     
    290307          }
    291308        }
     309        // -- incorporate result for this component to the list of results ---
    292310        if(useRing == 0){
    293         // We go back to the original ring.
    294         setring origR;
    295         U = fetch(R, U);
    296         c = fetch(R, c);
    297         newRListO = imap(R, newRList);
    298         // We change the ordering in the new ring.
    299         if(nvars(newR) > nvars(origR)){
    300           newRListO[3]=insert(origOrd, newRListO[3][1]);
    301         } else {
    302           newRListO[3] = origOrd;
    303         }
    304         newROrigOrd = ring(newRListO);
    305         setring newROrigOrd;
    306         ideal norid = imap(newR, norid);
    307         ideal normap = imap(newR, normap);
    308         export norid;
    309         export normap;
    310         setring origR;
    311         totalComps++;
    312         result[totalComps] = list(U, c, newROrigOrd);
    313         if(withDelta){
    314           result[totalComps] = insert(result[totalComps], delt, 3);
    315         }
    316         setring R;
     311          // We go back to the original ring.
     312          setring origR;
     313          U = fetch(R, U);
     314          c = fetch(R, c);
     315          newRListO = imap(R, newRList);
     316          // We change the ordering in the new ring.
     317          if(nvars(newR) > nvars(origR)){
     318            newRListO[3]=insert(origOrd, newRListO[3][1]);
     319          } else {
     320            newRListO[3] = origOrd;
     321          }
     322          newROrigOrd = ring(newRListO);
     323          setring newROrigOrd;
     324          ideal norid = imap(newR, norid);
     325          ideal normap = imap(newR, normap);
     326          export norid;
     327          export normap;
     328          setring origR;
     329          totalComps++;
     330          result[totalComps] = list(U, c, newROrigOrd);
     331          if(withDelta){
     332            result[totalComps] = insert(result[totalComps], delt, 3);
     333          }
     334          setring R;
    317335        } else {
    318336          setring R;
     
    323341    }
    324342  }
    325  
    326   // -------------------------- delta computation ---------------------------- 
     343
     344// -------------------------- delta computation ----------------------------
    327345  if(withDelta == 1){
    328346    // Intersection multiplicities of list prim, sp=size(prim).
     
    330348    {
    331349      "// Sum of delta for all components: ", deltI;
    332     }   
     350    }
    333351    if(size(prim) > 1){
    334352      dbprint(dbg, "// Computing the sum of the intersection multiplicities of the components...");
     
    338356        deltI = -1;
    339357      } else {
    340         deltI = deltI + mul; 
     358        deltI = deltI + mul;
    341359      }
    342360      if ( dbg >= 1 )
    343361      {
    344362        "// Intersection multiplicity is : ", mul;
    345       }         
     363      }
    346364    }
    347365  }
    348  
    349   // -------------------------- prepare output ------------------------------   
     366
     367// -------------------------- prepare output ------------------------------
    350368  setring origR;
     369
     370  list RL;      // List of rings
     371  list MG;      // Module generators
     372  intvec DV;    // Vector of delta's of each component
     373  for(i = 1; i <= size(result); i++){
     374    RL[i] = result[i][3];
     375    MG[i] = lineUpLast(result[i][1], result[i][2]);
     376    if(withDelta){
     377      DV[i] = result[i][4];
     378    }
     379  }
     380  list resultNew;
     381
    351382  if(withDelta){
    352     result = result, deltI;
     383    resultNew = list(RL, MG, list(DV, deltI));
    353384  } else {
    354     result = list(result);
    355   }
    356  
     385    resultNew = list(RL, MG);
     386  }
     387
    357388  option(set, opt);
    358   return(result);
     389
     390  if ( dbg >= 0 )
     391  {
     392    "";
     393    if(!withDelta){
     394      "// 'normal' created a list, say nor, of two elements.";
     395    } else {
     396      "// 'normal' created a list, say nor, of three elements.";
     397    }
     398    "// * nor[1] is a list of", sp, "ring(s). To access the i-th ring nor[1][i], ";
     399    "// give it a name, say Ri, and type e.g. ";
     400    "     def R1 = nor[1][1]; setring R1; norid; normap;";
     401    "// For the other rings type first ";
     402    "     setring r;";
     403    "// (if r is the name of your original basering) and then continue as";
     404    "// for the first ring.";
     405    "// Ri/norid is the affine algebra of the normalization of the i-th ";
     406    "// component r/P_i (where P_i is the i-th component of a decomposition of";
     407    "// the input ideal) and normap the normalization map from r to Ri/norid.";
     408    "// * nor[2] is a list of", sp, "ideal(s) such that the integral";
     409    "// closure of basering/P_i is generated as module over the basering by";
     410    "// 1/ci * Ui, with Ui the i-th ideal of nor[2] and ci the last element";
     411    "// Ui[size(Ui)] of Ui.";
     412    if(withDelta){
     413      "// * nor[3] is a list of an intvec of size r, the delta invariants ";
     414      "// of the r components, and an integer, the total delta invariant ";
     415      "// of basering/id (-1 means infinite, and 0 that basering/P_i resp. ";
     416      "// basering/input is normal).";
     417    }
     418  }
     419  return(resultNew);
    359420}
    360 
    361421
    362422example
     
    366426  ring s = 0,(x,y),dp;
    367427  ideal i = (x2-y3)*(x2+y2)*x;
    368   list nor = normal(i, "withDelta");
    369   nor; 
     428  list nor = normal(i, "withDelta", "prim");
     429  nor;
    370430
    371431  // 2 branches have delta = 1, and 1 branch has delta = 0
    372432  // the total delta invariant is 13
    373433
    374   def R2 = nor[1][2][3];  setring R2;
     434  def R2 = nor[1][2];  setring R2;
    375435  norid; normap;
    376    
     436
    377437  echo = 0;
    378438  printlevel = printlevel-1;
     
    381441  ring r = 2,(x,y,z),dp;
    382442  ideal i = z3-xy4;
    383   list nor = normal(i, "withDelta");  nor; 
    384   // the delta invariant is infinite 
     443  list nor = normal(i, "withDelta", "prim");  nor;
     444  // the delta invariant is infinite
    385445  // xy2z/z2 and xy3/z2 generate the integral closure of r/i as r/i-module
    386446  // in its quotient field Quot(r/i)
    387447
    388   // the normalization as affine algebra over the ground field:             
    389   def R = nor[1][1][3]; setring R;
     448  // the normalization as affine algebra over the ground field:
     449  def R = nor[1][1]; setring R;
    390450  norid; normap;
    391451}
     
    423483   ideal SBid, id, J = Li[1], Li[2], Li[3];
    424484   poly p = Li[4];
     485   int noRed = 0;
     486   if(size(Li) > 4){
     487     if(Li[5] == 1){
     488       noRed = 1;
     489     }
     490   }
     491
    425492   attrib(SBid,"isSB",1);
    426493   int homo = homog(Li[2]);               //is 1 if id is homogeneous, 0 if not
     
    483550
    484551   if ( y>=1 )
    485    { 
     552   {
    486553      "//   the non-zerodivisor p:"; p;
    487554      "//   the module p*Hom(J,J) = p*J:J :"; f;
     
    492559//---------- Test: Hom(J,J) == R ?, if yes, go home ---------------------------
    493560
    494    //rf = interred(reduce(f,f2)); 
     561   //rf = interred(reduce(f,f2));
    495562   //### interred hier weggelassen, unten zugefŸgt
    496563   rf = reduce(f,f2);       //represents p*Hom(J,J)/p*R = Hom(J,J)/R
     
    558625// f2=p (i.e. ideal generated by p)
    559626
    560    //f = mstd(f)[2];              //### geŠndert GMG 04.10.08 
    561    //ideal ann = quotient(f2,f);  //### f durch rf ersetzt 
     627   //f = mstd(f)[2];              //### geŠndert GMG 04.10.08
     628   //ideal ann = quotient(f2,f);  //### f durch rf ersetzt
    562629   rf = mstd(rf)[2];              //rf = NF(f,p), hence <p,rf> = <p,f>
    563    ideal ann = quotient(f2,rf);   //p:f = p:rf 
    564  
    565    //------------- compute the contribution to delta ---------- 
     630   ideal ann = quotient(f2,rf);   //p:f = p:rf
     631
     632   //------------- compute the contribution to delta ----------
    566633   //delt=dim_K(Hom(JJ)/R (or -1 if infinite)
    567  
    568    int delt=vdim(std(modulo(f,ideal(p))));   
     634
     635   int delt=vdim(std(modulo(f,ideal(p))));
    569636
    570637   f = p,rf;          // generates pJ:J mod(p), i.e. p*Hom(J,J)/p*R as R-module
     
    588655
    589656   //map psi1 = P,maxideal(1);          //### psi1 durch fetch ersetzt
    590    //ideal SBid = psi1(SBid);       
     657   //ideal SBid = psi1(SBid);
    591658   ideal SBid = fetch(P,SBid);
    592659   attrib(SBid,"isSB",1);
     
    611678// It is a fact, that the kernel is generated by the linear and the quadratic
    612679// relations
    613 // f=p,rf, rf=reduce(f,p), generates pJ:J mod(p), 
     680// f=p,rf, rf=reduce(f,p), generates pJ:J mod(p),
    614681// i.e. p*Hom(J,J)/p*R as R-module
    615682
     
    629696      for ( jj=2; jj<=ii; jj++ )
    630697      {
    631          ff = NF(f[ii]*f[jj],std(0));       //this makes lift much faster 
     698         ff = NF(f[ii]*f[jj],std(0));       //this makes lift much faster
    632699         A = lift(pf,ff);                   //ff lin. comb. of elts of pf mod I
    633700         Quad = Quad, ideal(T(jj)*T(ii) - T*A);  //quadratic relations
     
    648715   //mstd dient nur zum verkleinern, die SB-Eigenschaft geht spaeter verloren
    649716   //da in neuen Ring abgebildet und mit id vereinigt
    650                        
     717
    651718//---------- reduce number of variables by substitution, if possible ----------
    652719   if (homo==1)
     
    659726   }
    660727
    661    ideal endid  = imap(newR,id),imap(newR,Q); 
     728   ideal endid  = imap(newR,id),imap(newR,Q);
    662729   //hier wird Q weiterverwendet, die SB-Eigenschaft wird nicht verwendet.
    663730   endid = simplify(endid,2);
    664731   ideal endphi = ideal(X(1..nvars(R)));
    665732
    666    L = substpart(endid,endphi,homo,rw);
    667 
    668    def lastRing=L[1];
    669    setring lastRing;
     733
     734  if(noRed == 0){
     735    L = substpart(endid,endphi,homo,rw);
     736    def lastRing=L[1];
     737    setring lastRing;
     738    //return(lastRing);
     739  } else {
     740    list RL = ringlist(newRing);
     741    def lastRing = ring(RL);
     742    setring lastRing;
     743    ideal endid = fetch(newRing, endid);
     744    ideal endphi = fetch(newRing, endphi);
     745    export(endid);
     746    export(endphi);
     747    //def lastRing = newRing;
     748    //setring R;
     749    //return(newR);
     750  }
     751
     752
     753
     754//   L = substpart(endid,endphi,homo,rw);
     755
     756//   def lastRing=L[1];
     757//   setring lastRing;
    670758
    671759   attrib(endid,"onlySingularAtZero",0);
     
    730818
    731819///////////////////////////////////////////////////////////////////////////////
    732 //compute intersection multiplicities as needed for delta(I) in 
     820//compute intersection multiplicities as needed for delta(I) in
    733821//normalizationPrimes and normalP:
    734822
     
    736824"USAGE:   iMult(L);  L a list of ideals
    737825RETURN:  int, the intersection multiplicity of the ideals of L;
    738          if iMult(L) is infinite, -1 is returned. 
     826         if iMult(L) is infinite, -1 is returned.
    739827THEORY:  If r=size(L)=2 then iMult(L) = vdim(std(L[1]+L[2])) and in general
    740828         iMult(L) = sum{ iMult(L[j],Lj) | j=1..r-1 } with Lj the intersection
    741829         of L[j+1],...,L[r]. If I is the intersection of all ideals in L then
    742830         we have delta(I) = delta(L[1])+...+delta(L[r]) + iMult(L) where
    743          delta(I) = vdim (normalisation(R/I)/(R/I)), R the basering. 
     831         delta(I) = vdim (normalisation(R/I)/(R/I)), R the basering.
    744832EXAMPLE: example iMult; shows an example
    745833"
     
    762850              ideal I(i) = intersect(I(i+1),prim[i+1]);
    763851              mu = vdim(std(I(i)+prim[i]));
    764               if ( mu < 0 ) 
    765               { 
    766                 break; 
     852              if ( mu < 0 )
     853              {
     854                break;
    767855              }
    768856              mul = mul + mu;
     
    783871   L = (x-y),(x3+y2),(x3-y4);
    784872   iMult(L);
    785 } 
     873}
    786874///////////////////////////////////////////////////////////////////////////////
    787875//check if I has a singularity only at zero, as needed in normalizationPrimes
     
    794882EXAMPLE: example locAtZero; shows an example
    795883"
    796 {   
     884{
    797885   int ii,jj, caz;                   //caz: conzentrated at zero
    798886   int dbp = printlevel-voice+2;
    799887   int nva = nvars(basering);
    800    int vdi = vdim(I);     
     888   int vdi = vdim(I);
    801889   if ( vdi < 0 )
    802890   {
    803       if (dbp >=1) 
    804       { "// non-isolated singularitiy";""; }         
     891      if (dbp >=1)
     892      { "// non-isolated singularitiy";""; }
    805893      return(caz);
    806894   }
     
    812900   {
    813901      caz=1;
    814       if (dbp >=1) 
    815       { "// isolated singularity and homogeneous";""; }         
     902      if (dbp >=1)
     903      { "// isolated singularity and homogeneous";""; }
    816904      return(caz);
    817905   }
     
    838926      if ( caz == 1 || pot >= vdi )
    839927      {
    840         if (dbp >=1) 
     928        if (dbp >=1)
    841929        {
    842930          "// mindeg, exponent, vdim used in 'locAtZero':", mi1,pot,vdi; "";
    843         }         
     931        }
    844932        return(caz);
    845933      }
    846934      else
    847       { 
     935      {
    848936        if ( pot^2 < vdi )
    849937        { pot = pot^2; }
     
    862950   i= std(i*ideal(x-1,y,z));
    863951   locAtZero(i);
    864 } 
     952}
    865953
    866954///////////////////////////////////////////////////////////////////////////////
    867955
    868 //The next procedure normalizationPrimes computes the normalization of an 
    869 //irreducible or an equidimensional ideal i. 
    870 //- If i is irreducuble, then the returned list, say nor, has size 2 
     956//The next procedure normalizationPrimes computes the normalization of an
     957//irreducible or an equidimensional ideal i.
     958//- If i is irreducuble, then the returned list, say nor, has size 2
    871959//with nor[1] the normalization ring and nor[2] the delta invariant.
    872 //- If i is equidimensional, than the "splitting tools" can create a 
    873 //decomposition of i and nor can have more than 1 ring. 
     960//- If i is equidimensional, than the "splitting tools" can create a
     961//decomposition of i and nor can have more than 1 ring.
    874962
    875963static proc normalizationPrimes(ideal i,ideal ihp,int delt,intvec delti,list #)
    876 "USAGE:   normalizationPrimes(i,ihp,delt[,si]);  i = equidimensional ideal, 
     964"USAGE:   normalizationPrimes(i,ihp,delt[,si]);  i = equidimensional ideal,
    877965         ihp = map (partial normalization), delt = partial delta-invariant,
    878966         si = ideal s.t. V(si) contains singular locus (optional)
     
    885973           - normap gives the normalization map from basering/id
    886974             to nor[j]/norid (for each j)
    887           nor[size(nor)] = dim_K(normalisation(P/i) / (P/i)) is the 
     975          nor[size(nor)] = dim_K(normalisation(P/i) / (P/i)) is the
    888976          delta-invariant, where P is the basering.
    889977EXAMPLE: example normalizationPrimes; shows an example
     
    911999   int depth,lauf,prdim,osaz;
    9121000   int ti=timer;
    913    
     1001
    9141002   gnirlist = ringlist(BAS);
    9151003
     
    9351023   }
    9361024
    937 //--------------- General NOTATION, compute SB of input ----------------- 
     1025//--------------- General NOTATION, compute SB of input -----------------
    9381026// SM is a list, the result of mstd(i)
    939 // SM[1] = SB of input ideal i, 
     1027// SM[1] = SB of input ideal i,
    9401028// SM[2] = (minimal) generators for i.
    9411029// We work with SM and will copy the attributes from i to SM[2]
     
    9581046//----------------- the general case, set attributes ----------------
    9591047   //Note: onlySingularAtZero is NOT preserved under the ring extension
    960    //basering --> Hom(J,J) (in contrast to isIsolatedSingularity), 
     1048   //basering --> Hom(J,J) (in contrast to isIsolatedSingularity),
    9611049   //therefore we reset it:
    962  
     1050
    9631051   attrib(i,"onlySingularAtZero",0);
    9641052
     
    10351123   }
    10361124
    1037 //-------------------- Trivial cases, in each case RETURN ------------------ 
     1125//-------------------- Trivial cases, in each case RETURN ------------------
    10381126// input ideal is the ideal of a partial normalization
    10391127
     
    10591147         return(result);
    10601148   }
    1061    
     1149
    10621150   // --- Trivial case: input ideal is zero-dimensional and homog ---
    10631151   if( (dim(SM[1])==0) && (homog(SM[2])==1) )
     
    10681156      }
    10691157      MB=maxideal(1);
    1070       intvec rw; 
    1071       list LL=substpart(MB,ihp,0,rw);     
     1158      intvec rw;
     1159      list LL=substpart(MB,ihp,0,rw);
    10721160      def newR5=LL[1];
    10731161      setring newR5;
     
    11071195   }
    11081196
    1109 //---------------------- The non-trivial cases start ------------------- 
     1197//---------------------- The non-trivial cases start -------------------
    11101198   //the higher dimensional case
    11111199   //we test first hypersurface, CohenMacaulay and complete intersection
     
    11351223   // Notation: J ideal of singular locus or (if given) containing it
    11361224   // JM = mstd(J) or maxideal(1),maxideal(1)
    1137    // JM[1] SB of singular locus, JM[2] minbasis, dimJ = dim(JM[1]) 
     1225   // JM[1] SB of singular locus, JM[2] minbasis, dimJ = dim(JM[1])
    11381226   // SM[1] SB of the input ideal i, SM[2] minbasis
    11391227   // Computation if singular locus is critical, because it determines the
     
    11561244   {
    11571245      //--- the case where an ideal #[1] is given:
    1158       if( size(#)>0 )                 
     1246      if( size(#)>0 )
    11591247      {
    11601248         J = #[1],SM[2];
     
    11851273      attrib(JM[1],"isSB",1);
    11861274      if( y>=1 )
    1187       { 
     1275      {
    11881276         "// the dimension of the singular locus is";  dimJ ; "";
    11891277      }
    1190          
     1278
    11911279      if(dim(JM[1]) <= dim(SM[1])-2)
    11921280      {
     
    12181306
    12191307      //------- extra check for onlySingularAtZero, relatively cheap ----------
    1220       //it uses the procedure 'locAtZero' from for testing 
     1308      //it uses the procedure 'locAtZero' from for testing
    12211309      //if an ideal is concentrated at 0
    12221310       if(y>=1)
     
    12241312         "// extra test for onlySingularAtZero:";
    12251313       }
    1226        if ( locAtZero(JM[1]) ) 
     1314       if ( locAtZero(JM[1]) )
    12271315       {
    12281316           attrib(SM[2],"onlySingularAtZero",1);
     
    12361324       }
    12371325   }
    1238  
     1326
    12391327  //displaying the attributes:
    12401328   if(y>=2)
    12411329   {
    1242       "// the attributes of the ideal are:"; 
     1330      "// the attributes of the ideal are:";
    12431331      "// isCohenMacaulay:", attrib(SM[2],"isCohenMacaulay");
    12441332      "// isCompleteIntersection:", attrib(SM[2],"isCompleteIntersection");
     
    12531341
    12541342   //------------- case: CohenMacaulay in codim 2, RETURN ---------------
    1255    if( (attrib(SM[2],"isRegInCodim2")==1) &&   
     1343   if( (attrib(SM[2],"isRegInCodim2")==1) &&
    12561344       (attrib(SM[2],"isCohenMacaulay")==1) )
    12571345   {
     
    12781366//---------- case: isolated singularity only at 0, RETURN ------------
    12791367   // In this case things are easier, we can use the maximal ideal as radical
    1280    // of the singular locus; 
     1368   // of the singular locus;
    12811369   // JM mstd of ideal of singular locus, SM mstd of input ideal
    12821370
     
    13071395      // Note:
    13081396      // HomJJ (ideal SBid, ideal id, ideal J, poly p) with
    1309       //        SBid = SB of id, J = radical ideal of basering  P with: 
     1397      //        SBid = SB of id, J = radical ideal of basering  P with:
    13101398      //        nonNormal(R) is in V(J), J contains the nonzero divisor p
    13111399      //        of R = P/id (J = test ideal)
     
    13561444
    13571445           printlevel=printlevel+1;
    1358            list tluser = 
    1359                 normalizationPrimes(endid,psi(ihp),delt,delti); 
    1360            //list tluser = 
    1361            //     normalizationPrimes(endid,psi(ihp),delt,delti,J); 
     1446           list tluser =
     1447                normalizationPrimes(endid,psi(ihp),delt,delti);
     1448           //list tluser =
     1449           //     normalizationPrimes(endid,psi(ihp),delt,delti,J);
    13621450           //#### ??? improvement: give also the old ideal of sing locus???
    13631451
    13641452           printlevel = printlev;             //reset printlevel
    1365            setring BAS;   
    1366            return(tluser);         
     1453           setring BAS;
     1454           return(tluser);
    13671455         }
    13681456
     
    14471535          intvec delti2 = keepresult2[size(keepresult2)][2];
    14481536
    1449           if( delt>=0 && delt1>=0 && delt2>=0 ) 
     1537          if( delt>=0 && delt1>=0 && delt2>=0 )
    14501538          {  ideal idid1=id,id1;
    14511539             int mul = vdim(std(idid1));
     
    14571545             {
    14581546               delt = -1;
    1459              }           
     1547             }
    14601548          }
    14611549         if ( y>=1 )
     
    15111599      if(y>=1)
    15121600      {
    1513         "// radical is equal to:";"";  JM[2]; 
     1601        "// radical is equal to:";"";  JM[2];
    15141602        "";
    15151603      }
     
    15351623
    15361624     RS=HomJJ(RR,y);               //most important subprocedure
    1537          
     1625
    15381626     // ------------------ the normal case, RETURN -----------------
    15391627     // RS[2]==1 means that the test for normality was positive
     
    16971785      }
    16981786      printlevel = printlevel+1;
    1699       keepresult1 = 
     1787      keepresult1 =
    17001788                  normalizationPrimes(vid,ihp,0,0);  //1st split factor
    17011789
     
    17191807      attrib(vid,"onlySingularAtZero",oSAZ);
    17201808
    1721       keepresult2 = 
     1809      keepresult2 =
    17221810                    normalizationPrimes(vid,ihp,0,0);
    17231811      list delta2 = keepresult2[size(keepresult2)];   //2nd split factor
    17241812      printlevel = printlev;                          //reset printlevel
    1725  
     1813
    17261814      setring BAS;
    17271815
     
    17941882//subst y,x: x+y+z->f(y,z)+g(z)+z eliminates only x
    17951883//HENCE: substitute vars depending on most other vars first
    1796 //However, if the sytem xi-fi is reduced then xi does not appear in any of the 
     1884//However, if the sytem xi-fi is reduced then xi does not appear in any of the
    17971885//fj and hence the order does'nt matter when substitutinp xi by fi
    17981886
     
    18021890   map phi = newRing,maxideal(1);    //identity map
    18031891   list Le = elimpart(endid);
    1804    //this proc and the next loop try to substitute as many variables as 
     1892   //this proc and the next loop try to substitute as many variables as
    18051893   //possible indices of substituted variables
    18061894
     
    19041992
    19051993proc genus(ideal I,list #)
    1906 "USAGE:   genus(I) or genus(I,1); I a 1-dimensional ideal
     1994"USAGE:   genus(i) or genus(i,1); I a 1-dimensional ideal
    19071995RETURN:  an integer, the geometric genus p_g = p_a - delta of the projective
    19081996         curve defined by i, where p_a is the arithmetic genus.
     
    19101998         i.e. dim(R'/R), R' the normalization of the local ring R of the
    19111999         singularity. @*
    1912          genus(I,1) uses the normalization to compute delta. Usually genus(i,1)
     2000         genus(i,1) uses the normalization to compute delta. Usually genus(i,1)
    19132001         is slower than genus(i) but sometimes not.
    19142002EXAMPLE: example genus; shows an example
     
    25412629"USAGE:    primeClosure(L [,c]); L a list of a ring containing a prime ideal
    25422630                                 ker, c an optional integer
    2543 RETURN:   a list L (of size n+1) consisting of rings L[1],...,L[n] such that@*
    2544           - L[1] is a copy of (not a reference to!) the input ring L[1]@*
     2631RETURN:   a list L (of size n+1) consisting of rings L[1],...,L[n] such that
     2632          - L[1] is a copy of (not a reference to!) the input ring L[1]
    25452633          - all rings L[i] contain ideals ker, L[2],...,L[n] contain ideals phi
    2546             such that L[1]/ker --> ... --> L[n]/ker are injections given by the
    2547             corresponding ideals phi, and L[n]/ker is the integral closure of
    2548             L[1]/ker in its quotient field.@*
     2634            such that
     2635                    L[1]/ker --> ... --> L[n]/ker
     2636            are injections given by the corresponding ideals phi, and L[n]/ker
     2637            is the integral closure of L[1]/ker in its quotient field.
    25492638          - all rings L[i] contain a polynomial nzd such that elements of
    25502639            L[i]/ker are quotients of elements of L[i-1]/ker with denominator
    2551             nzd via the injection phi.@*
     2640            nzd via the injection phi.
    25522641            L[n+1] is the delta invariant
    2553 NOTE:     - L is constructed by recursive calls of primeClosure itself.@*
    2554           - c determines the choice of nzd:@*
     2642NOTE:     - L is constructed by recursive calls of primeClosure itself.
     2643          - c determines the choice of nzd:
    25552644               - c not given or equal to 0: first generator of the ideal SL,
    2556                  the singular locus of Spec(L[i]/ker)@*
     2645                 the singular locus of Spec(L[i]/ker)
    25572646               - c<>0: the generator of SL with least number of monomials.
    25582647EXAMPLE:  example primeClosure; shows an example
     
    26032692      ker=simplify(interred(ker),15);
    26042693      //execute ("ring R0="+charstr(R)+",("+varstr(R)+"),("+ordstr(R)+");");
    2605       def R0 = ring(Rlist);
     2694      // Rlist may be not defined in this new ring, so we define it again.
     2695      list Rlist2 = ringlist(R);
     2696      def R0 = ring(Rlist2);
    26062697      setring R0;
    26072698      ideal ker=fetch(R,ker);
     
    26262717// locus of ker, J:=rad(ker):
    26272718
    2628    list SM=mstd(ker); 
     2719   list SM=mstd(ker);
    26292720
    26302721// In the first iteration, we have to compute the singular locus "from
    2631 // scratch". 
     2722// scratch".
    26322723// In further iterations, we can fetch it from the previous one but
    26332724// have to compute its radical
     
    26942785
    26952786  // having computed the radical J of/in the ideal of the singular locus,
    2696   // we now need to pick an element nzd of J; 
     2787  // we now need to pick an element nzd of J;
    26972788  // NOTE: nzd must be a non-zero divisor mod ker, i.e. not contained in ker
    26982789
     
    27272818
    27282819  export nzd;
    2729   list RR = SM[1],SM[2],J,nzd;
     2820  // In this case we do not eliminate variables, so that the maps
     2821  // are well defined.
     2822  list RR = SM[1],SM[2],J,nzd,1;
    27302823
    27312824  if ( dblvl >= 1 )
    27322825  {"";
    27332826     "// compute the first ring extension:";
     2827     "RR: ";
     2828     RR;
    27342829  }
    27352830
     
    28142909      {
    28152910         delt = -1;
    2816       }     
     2911      }
    28172912      L[size(L)] = delt;
    28182913
     
    29383033              maxi = maxi,maxideal(1);
    29393034              map backmap = S(k),maxi;
    2940          
     3035
    29413036              //mapstr=" map backmap = S(k),";
    29423037              //for (l=1;l<=nvars(R(k));l++)
     
    29973092///////////////////////////////////////////////////////////////////////////////
    29983093// closureGenerators is called inside proc normal (option "withGens" )
    2999 // 
    3000 
    3001 // INPUT is the output of proc primeClosure (except for the last element, the 
    3002 // delta invariant) : hence input is a list L consisting of rings 
     3094//
     3095
     3096// INPUT is the output of proc primeClosure (except for the last element, the
     3097// delta invariant) : hence input is a list L consisting of rings
    30033098// L[1],...,L[n] (denoted R(1)...R(n) below) such that
    30043099// - L[1] is a copy of (not a reference to!) the input ring L[1]
    3005 // - all rings L[i] contain ideals ker, L[2],...,L[n] contain ideals phi 
     3100// - all rings L[i] contain ideals ker, L[2],...,L[n] contain ideals phi
    30063101// such that
    30073102//                L[1]/ker --> ... --> L[n]/ker
     
    30183113// preim[size(preim)] is a non-zero divisor of basering/i.
    30193114
    3020 proc closureGenerators(list L);   
     3115proc closureGenerators(list L);
    30213116{
    3022   def Rees=basering;         // when called inside normalI (in reesclos.lib) 
     3117  def Rees=basering;         // when called inside normalI (in reesclos.lib)
    30233118                             // the Rees Algebra is the current basering
    30243119
     
    30273122  int length = nvars(L[n]);       // the number of variables of the last ring
    30283123  int j,k,l;
    3029   string mapstr;   
    3030   list preimages;                 
    3031   //Note: the empty list belongs to no ring, hence preimages can be used 
     3124  string mapstr;
     3125  list preimages;
     3126  //Note: the empty list belongs to no ring, hence preimages can be used
    30323127  //later in R(1)
    30333128  //this is not possible for ideals (belong always to some ring)
    30343129
    3035   for (int i=1; i<=n; i++) 
    3036   { 
     3130  for (int i=1; i<=n; i++)
     3131  {
    30373132     def R(i)=L[i];          //give the rings from L a name
    30383133  }
     
    30663161          map phimap=R(k-1),phi;   //phimap:R(k-1)-->R(n), k=2..n, is the map
    30673162                                   //belonging to phi in R(n)
    3068         }                             
     3163        }
    30693164
    30703165        p = p*phimap(nzd);
     
    31213216           maxi = maxi,maxideal(1);
    31223217           map backmap = S(k),maxi;
    3123          
     3218
    31243219           //mapstr=" map backmap = S(k),";
    31253220           //for (l=1;l<=nvars(R(k));l++)
     
    31523247
    31533248proc normalP(ideal id,list #)
    3154 "USAGE:   normalP(id [,choose]); id a radical ideal, choose a comma separated 
     3249"USAGE:   normalP(id [,choose]); id a radical ideal, choose a comma separated
    31553250         list of optional strings: \"withRing\" or \"isPrim\" or \"noFac\".@*
    31563251         If choose = \"noFac\", factorization is avoided during the computation
    3157          of the minimal associated primes; choose = \"isPrim\" disables the 
     3252         of the minimal associated primes; choose = \"isPrim\" disables the
    31583253         computation of the minimal associated primes (should only be used
    31593254         if the ideal is known to be prime).@*
     
    31653260         tested) otherwise the result may be wrong.
    31663261RETURN:  a list, say 'nor' of size 2 (default) or, if \"withRing\" is given,
    3167          of size 3. @*         
    3168          nor[1] (resp. nor[2] if \"withRing\" is given) is a list of ideals 
    3169          Ii, i=1..r, in the basering where r is the number of associated prime 
     3262         of size 3. @*
     3263         nor[1] (resp. nor[2] if \"withRing\" is given) is a list of ideals
     3264         Ii, i=1..r, in the basering where r is the number of associated prime
    31703265         ideals P_i (irreducible components) of id.@*
    3171          - Ii is an ideal given by polynomials g_1,...,g_k,g_k+1 such that 
     3266         - Ii is an ideal given by polynomials g_1,...,g_k,g_k+1 such that
    31723267           g_1/g_k+1,...,g_k/g_k+1 generate the integral closure of
    31733268           basering/P_i as module (over the basering) in its quotient field.@*
    3174          
    3175          nor[2] (resp. nor[3] if choose=\"withRing\") is a list of an intvec 
    3176          of size r, the delta invariants of the r components, and an integer, 
    3177          the total delta invariant of basering/id (-1 means infinite, and 0 
    3178          that basering/P_i resp. basering/input is normal). @* 
     3269
     3270         nor[2] (resp. nor[3] if choose=\"withRing\") is a list of an intvec
     3271         of size r, the delta invariants of the r components, and an integer,
     3272         the total delta invariant of basering/id (-1 means infinite, and 0
     3273         that basering/P_i resp. basering/input is normal). @*
    31793274
    31803275         If the optional string \"withRing\" is given, the ring structure of
     
    31833278         @code{norid} and @code{normap} such that @*
    31843279         - Ri/norid is the normalization of the i-th rime component P_i, i.e.
    3185            isomorphic to the integral closure of basering/P_i in its field 
     3280           isomorphic to the integral closure of basering/P_i in its field
    31863281           of fractions; @*
    3187          - the direct sum of the rings Ri/norid is the normalization 
     3282         - the direct sum of the rings Ri/norid is the normalization
    31883283           of basering/id; @*
    31893284         - @code{normap} gives the normalization map from basering/P_i to
    31903285           Ri/norid (for each i).@*
    3191 THEORY:  The delta invariant of a reduced ring K[x1,...,xn]/id is 
     3286THEORY:  The delta invariant of a reduced ring K[x1,...,xn]/id is
    31923287             dim_K(normalization(K[x1,...,xn]/id) / K[x1,...,xn]/id)
    3193          We call this number also the delta invariant of id. normalP uses 
    3194          the qth-power algorithm suggested by Leonard-Pellikaan (using the 
    3195          Frobenius) in part similair to an implementation by Singh-Swanson. 
     3288         We call this number also the delta invariant of id. normalP uses
     3289         the qth-power algorithm suggested by Leonard-Pellikaan (using the
     3290         Frobenius) in part similair to an implementation by Singh-Swanson.
    31963291NOTE:    To use the i-th ring type: @code{def R=nor[1][i]; setring R;}.
    3197 @*       Increasing/decreasing printlevel displays more/less comments 
     3292@*       Increasing/decreasing printlevel displays more/less comments
    31983293         (default: printlevel = 0).
    31993294@*       Not implemented for local or mixed orderings or quotient rings.
     
    32273322   }
    32283323
    3229 //--------------------------- define the method --------------------------- 
     3324//--------------------------- define the method ---------------------------
    32303325   string method;                //make all options one string in order to use
    32313326                                 //all combinations of options simultaneously
    32323327   for ( i=1; i<= size(#); i++ )
    3233    { 
    3234      if ( typeof(#[i]) == "string" ) 
     3328   {
     3329     if ( typeof(#[i]) == "string" )
    32353330     {
    32363331       method = method + #[i];
     
    32533348   kill #;
    32543349   list #;
    3255 //--------------------------- start computation --------------------------- 
     3350//--------------------------- start computation ---------------------------
    32563351   ideal II,K1,K2;
    32573352
     
    32783373
    32793374      if(y>=1)
    3280       { 
     3375      {
    32813376         prim;"";
    32823377         "// number of irreducible components is", size(prim);
     
    32953390         }
    32963391         if(y>=1)
    3297          {  "// compute SB of ideal"; 
     3392         {  "// compute SB of ideal";
    32983393         }
    32993394         mstdid = mstd(prim[i]);
     
    33033398      //------- 1-st main subprocedure: compute module generators ----------
    33043399         printlevel = printlevel+1;
    3305          II = normalityTest(mstdid); 
     3400         II = normalityTest(mstdid);
    33063401
    33073402      //------ compute also the ringstructure if "withRing" is given -------
     
    33253420         K1 = std(K1);
    33263421         K2 = mstdid[1]+II[1];
    3327          K2 = std(K2);       
    3328          // K1 = std(mstdid[1],II);      //### besser 
     3422         K2 = std(K2);
     3423         // K1 = std(mstdid[1],II);      //### besser
    33293424         // K2 = std(mstdid[1],II[1]);   //### besser: Hannes, fixen!
    33303425         co = codim(K1,K2);
     
    33593454     if ( wring )
    33603455     {
    3361 "// 'normalP' created a list, say nor, of three lists: 
     3456"// 'normalP' created a list, say nor, of three lists:
    33623457// nor[1] resp. nor[2] are lists of",sr,"ring(s) resp. ideal(s)
    33633458// and nor[3] is a list of an intvec and an integer.
     
    33663461// To access the i-th ring nor[1][i] give it a name, say Ri, and type e.g.
    33673462     def R1 = nor[1][1]; setring R1;  norid; normap;
    3368 // for the other rings type first setring r; (if r is the name of your 
     3463// for the other rings type first setring r; (if r is the name of your
    33693464// original basering) and then continue as for the first ring;
    3370 // Ri/norid is the affine algebra of the normalization of the i-th 
     3465// Ri/norid is the affine algebra of the normalization of the i-th
    33713466// component r/P_i (where P_i is an associated prime of the input ideal)
    33723467// and normap the normalization map from r to Ri/norid;
    33733468//    nor[2] is a list of",sr,"ideal(s), each ideal nor[2][i] consists of
    3374 // elements g1..gk of r such that the gj/gk generate the integral 
     3469// elements g1..gk of r such that the gj/gk generate the integral
    33753470// closure of r/P_i as (r/P_i)-module in the quotient field of r/P_i.
    33763471//    nor[3] shows the delta-invariant of each component and of the input
     
    33843479// closure of the i-th component as (basering/P_i)-module in the quotient
    33853480// field of basering/P_i (P_i an associated prime of the input ideal);
    3386 //    nor[2] shows the delta-invariant of each component and of the input ideal 
     3481//    nor[2] shows the delta-invariant of each component and of the input ideal
    33873482// (-1 means infinite, and 0 that r/P_i is normal).";
    33883483     }
     
    34123507// the input ideal id of normalP.
    34133508// Output is an ideal U s.t. U[i]/U[1] are module generators.
    3414  
     3509
    34153510static proc normalityTest(list mstdid)
    34163511{
     
    34363531   ideal M = minor(jacob(I),h,J); //use the command minor modulo J (hence J=0)
    34373532   M = std(M);                    //this makes M much smaller
    3438    //keep only minors which are not 0 mod I (!) this is important since we 
     3533   //keep only minors which are not 0 mod I (!) this is important since we
    34393534   //need a nzd mod I
    34403535
     
    34443539   {
    34453540      if( size(M[ii]) < size(D[1]) )
    3446       { 
    3447           D = M[ii]; 
     3541      {
     3542          D = M[ii];
    34483543      }
    34493544   }
     
    34523547   ideal F = var(1)^p;
    34533548   for(ii=2; ii<=n; ii++)
    3454    { 
    3455       F=F,var(ii)^p; 
     3549   {
     3550      F=F,var(ii)^p;
    34563551   }
    34573552
     
    34623557   if ( y >= 1)
    34633558   {  "compute module generators of integral closure";
    3464       "denominator D is:";  D; 
     3559      "denominator D is:";  D;
    34653560      pause();
    3466    } 
     3561   }
    34673562
    34683563   ii=0;
     
    34733568      if ( y >= 1)
    34743569      { "iteration", ii; }
    3475       L = U*Dp + I;             
    3476       //### L=interred(L) oder msdt(L)[2]? 
     3570      L = U*Dp + I;
     3571      //### L=interred(L) oder msdt(L)[2]?
    34773572      //Wird dadurch kleiner aber string(L) wird groesser
    34783573      K = preimage(Q,phi,L);    //### Improvement by block ordering?
     
    34843579   //---------------------------- simplify output --------------------------
    34853580      if(size(reduce(U,LK[1]))==0)  //previous U coincides with new U
    3486       {                             //i.e. we reached the integral closure 
    3487          U=simplify(reduce(U,groebner(D)),2); 
     3581      {                             //i.e. we reached the integral closure
     3582         U=simplify(reduce(U,groebner(D)),2);
    34883583         U = D,U;
    34893584         poly gg = gcd(U[1],U[size(U)]);
     
    34983593         U = simplify(U,6);
    34993594         //if ( y >= 1)
    3500          //{ "module generators are U[i]/U[1], with U:"; U; 
     3595         //{ "module generators are U[i]/U[1], with U:"; U;
    35013596         //  ""; pause(); }
    35023597         option(set,op);
     
    35133608static proc substpartSpecial(ideal endid, ideal endphi)
    35143609{
    3515    //Note: newRing is of the form (R the original basering): 
     3610   //Note: newRing is of the form (R the original basering):
    35163611   //char(R),(T(1..N),X(1..nvars(R))),(dp(N),...);
    35173612
     
    35203615   int n = nvars(basering);
    35213616
    3522    list Le = elimpart(endid); 
     3617   list Le = elimpart(endid);
    35233618   int q = size(Le[2]);                   //q variables have been substituted
    35243619//Le;"";
    3525    if ( q == 0 ) 
     3620   if ( q == 0 )
    35263621   {
    35273622      ideal normap = endphi;
     
    35463641      list g2 = gnirlist[2];             //the varlist
    35473642      list g3 = gnirlist[3];             //contains blocks of orderings
    3548       int n3 = size(g3); 
    3549    //----------------- first identify module ordering ------------------ 
     3643      int n3 = size(g3);
     3644   //----------------- first identify module ordering ------------------
    35503645      if ( g3[n3][1]== "c" or g3[n3][1] == "C" )
    35513646      {
     
    35603655         int m = 1;
    35613656      }
    3562    //---- delete variables which were substituted and weights  -------- 
     3657   //---- delete variables which were substituted and weights  --------
    35633658//gnirlist;"";
    35643659      intvec V;
     
    35703665         V = V,g3[ii][2];           //copy weights for ordering in each block
    35713666         if ( ii==1 )               //into one intvector
    3572          { 
     3667         {
    35733668            V = V[2..size(V)];
    35743669         }
     
    35983693//"newg3"; newg3;
    35993694      //newg3 = delete(newg3,1);    //delete empty list
    3600      
     3695
    36013696/*
    36023697//### neue Ordnung, 1 Block fuer alle vars, aber Gewichte erhalten;
     
    36043699//ein neuer Block) ein kuerzeres Ergebnis liefert
    36053700      kill g3;
    3606       list g3; 
     3701      list g3;
    36073702      V=0;
    36083703      for ( ii= 1; ii<=n3-1; ii++ )
     
    36133708
    36143709      if ( V==1 )
    3615       {   
     3710      {
    36163711         g3[1] = list("dp",V);
    36173712      }
    36183713      else
    36193714      {
    3620          g3[1] = lis("wp",V);         
     3715         g3[1] = lis("wp",V);
    36213716      }
    36223717      newg3 = g3;
     
    36343729         newg3 = insert(newg3,gm);
    36353730      }
    3636       gnirlist[2] = newg2;                   
     3731      gnirlist[2] = newg2;
    36373732      gnirlist[3] = newg3;
    36383733
     
    36483743      return(L);
    36493744
    3650    //Hier scheint interred gut zu sein, da es Ergebnis relativ schnell 
     3745   //Hier scheint interred gut zu sein, da es Ergebnis relativ schnell
    36513746   //verkleinert. Hier wird z.B. bei leonard1 size(norid) verkleinert aber
    36523747   //size(string(norid)) stark vergroessert, aber es hat keine Auswirkungen
    3653    //da keine map mehr folgt. 
     3748   //da keine map mehr folgt.
    36543749   //### Bei Leonard2 haengt interred (BUG)
    36553750   //mstd[2] verkleinert norid nocheinmal um die Haelfte, dauert aber 3.71 sec
     
    36623757// Assume: J[i]/J[1] are the module generators in the quotient field
    36633758// with J[1] as universal denominator.
    3664 // If option "noRed" is not given, a reduction in the number of variables is 
     3759// If option "noRed" is not given, a reduction in the number of variables is
    36653760// attempted.
    36663761static proc computeRing(ideal J, ideal I, list #)
    36673762{
    36683763  int i, ii,jj;
    3669   intvec V;                          // to be used for variable weights 
     3764  intvec V;                          // to be used for variable weights
    36703765  int y = printlevel-voice+2;
    36713766  def R = basering;
     
    36763771  string svar;
    36773772  ideal maxid = maxideal(1);
    3678  
     3773
    36793774  int noRed = 0;     // By default, we try to reduce the number of generators.
    36803775  if(size(#) > 0){
    3681     if ( typeof(#[1]) == "string" ) 
     3776    if ( typeof(#[1]) == "string" )
    36823777    {
    36833778      if (#[1] == "noRed"){noRed = 1;}
     
    36863781
    36873782  if ( y >= 1){"// computing the ring structure...";}
    3688    
     3783
    36893784  if(c==1)
    36903785  {
     
    37113806  //old variable names are not touched
    37123807
    3713   if ( find(svars,"T(") == 0 )       
     3808  if ( find(svars,"T(") == 0 )
    37143809  {
    37153810    svar = "T";
     
    37173812  else
    37183813  {
    3719     for (ii=90; ii>=65; ii--) 
     3814    for (ii=90; ii>=65; ii--)
    37203815    {
    3721       if ( find(svars,ASCII(ii)+"(") == 0 )       
     3816      if ( find(svars,ASCII(ii)+"(") == 0 )
    37223817      {
    37233818        svar = ASCII(ii);  break;
     
    37353830  }
    37363831  else
    3737   {       
     3832  {
    37383833    for ( ii=q; ii>=1; ii-- )
    37393834    {
     
    37533848  //Reihenfolge geŠndert:neue Variablen kommen zuerst, Namen ev. nicht T(i)
    37543849
    3755   def newR = ring(gnirlist);   
     3850  def newR = ring(gnirlist);
    37563851  setring newR;                //new extended ring
    37573852  ideal I = imap(R,I);
     
    37603855  if(y>=1)
    37613856  {
    3762      "// compute linear relations:"; 
     3857     "// compute linear relations:";
    37633858  }
    37643859  qring newQ = std(I);
    3765  
     3860
    37663861  ideal f = imap(R,J);
    37673862  module syzf = syz(f);
    3768   ideal pf = f[1]*f;               
     3863  ideal pf = f[1]*f;
    37693864  //f[1] is the denominator D from normalityTest, a non zero divisor of R/I
    37703865
     
    37723867  newT = 1,newT[1..q];
    37733868  //matrix T = matrix(ideal(1,T(1..q)),1,q+1);   //alt
    3774   matrix T = matrix(newT,1,q+1); 
     3869  matrix T = matrix(newT,1,q+1);
    37753870  ideal Lin = ideal(T*syzf);
    3776   //Lin=interred(Lin); 
     3871  //Lin=interred(Lin);
    37773872  //### interred reduziert ev size aber size(string(LIN)) wird groesser
    37783873
     
    37893884  if(y>=1)
    37903885  {
    3791     "// compute quadratic relations:"; 
     3886    "// compute quadratic relations:";
    37923887  }
    37933888  matrix A;
     
    38063901      if(ord_test(basering) != 1){
    38073902        A = lift(pf, ff, u);
    3808         Quad = Quad,ideal(newT[jj-1]*newT[ii-1] * u[1, 1]- T*A); 
     3903        Quad = Quad,ideal(newT[jj-1]*newT[ii-1] * u[1, 1]- T*A);
    38093904      } else {
    38103905        A = lift(pf,ff);              // ff lin. comb. of elts of pf mod I
     
    38123907      }
    38133908      //A = lift(pf, f[ii]*f[jj]);
    3814       //Quad = Quad, ideal(T(jj-1)*T(ii-1) - T*A); 
     3909      //Quad = Quad, ideal(T(jj-1)*T(ii-1) - T*A);
    38153910    }
    38163911  }
     
    38313926  //Ebenso interred, z.B. bei Leonard1 (1. Komponente von Leonard):
    38323927  //"size Q1:", size(Q1), size(string(Q1));   //75 60083
    3833   //Q1 = interred(Q1); 
     3928  //Q1 = interred(Q1);
    38343929  //"size Q1:", size(Q1), size(string(Q1));   //73 231956 (!)
    38353930  //### Speicherueberlauf bei substpartSpecial bei 'ideal norid  = phi1(endid)'
     
    38403935  ideal endphi = imap(R,maxid);
    38413936
    3842   if(noRed == 0){   
     3937  if(noRed == 0){
    38433938    list L=substpartSpecial(endid,endphi);
    38443939    def lastRing=L[1];
     
    38563951    setring R;
    38573952    return(newR);
    3858   }   
     3953  }
    38593954}
    38603955
     
    38733968// - nor[1] = U, an ideal of R.
    38743969// - nor[2] = c, an element of R.
    3875 // U and c satisfy that 1/c * U is the normalization of R / I in the 
     3970// U and c satisfy that 1/c * U is the normalization of R / I in the
    38763971// quotient field Q(R/I).
    38773972// - nor[3] = ring say T, containing two ideals norid and normap such that
     
    38813976// Details:
    38823977// --------
    3883 // Computes the ideal of the minors in the first step and then reuses it in all 
     3978// Computes the ideal of the minors in the first step and then reuses it in all
    38843979// steps.
    3885 // In step s, the denominator is D^s, where D is a nzd of the original quotient 
     3980// In step s, the denominator is D^s, where D is a nzd of the original quotient
    38863981// ring, contained in the radical of the singular locus.
    3887 // This denominator is used except when the degree of D^i is greater than the 
     3982// This denominator is used except when the degree of D^i is greater than the
    38883983// degree of a conductor.
    3889 // The nzd is taken as the smallest degree polynomial in the radical of the 
     3984// The nzd is taken as the smallest degree polynomial in the radical of the
    38903985// singular locus.
    38913986
    3892 // It assumes that the ideal I is equidimensional radical. This is not checked 
     3987// It assumes that the ideal I is equidimensional radical. This is not checked
    38933988// in the procedure!
    3894 // If decomp = 0 or decomp = 3 it assumes further that I is prime. Therefore 
    3895 // any non-zero element in the jacobian ideal is assumed to be a 
     3989// If decomp = 0 or decomp = 3 it assumes further that I is prime. Therefore
     3990// any non-zero element in the jacobian ideal is assumed to be a
    38963991// non-zerodivisor.
    38973992
    38983993// It works over the given basering.
    3899 // If it has a non-global ordering, it changes it to dp global only for 
     3994// If it has a non-global ordering, it changes it to dp global only for
    39003995// computing radical.
    39013996
    3902 // The delta invariant is only computed if withDelta = 1, and decomp = 0 or 
     3997// The delta invariant is only computed if withDelta = 1, and decomp = 0 or
    39033998// decomp = 3 (meaning that the ideal is prime).
    39043999
     
    39134008
    39144009  def R = basering;
    3915    
    3916   // ---------------- computation of the singular locus --------------------- 
     4010
     4011  // ---------------- computation of the singular locus ---------------------
    39174012  // We compute the radical of the ideal of minors modulo the original ideal.
    39184013  // This is done only in the first step.
     
    39294024  }
    39304025  int d = dim(I);
    3931  
     4026
    39324027  qring Q = I;   // We work in the quotient by the groebner base of the ideal I
    39334028  option("redSB");
     
    39404035  ideal J = minor(jacob(IMin), nvars(basering) - d, I);
    39414036  J = groebner(J);
    3942  
    3943   // -------------------- election of the conductor -------------------------   
    3944   poly condu = getSmallest(J);   // Choses the polynomial of smallest degree 
     4037
     4038  // -------------------- election of the conductor -------------------------
     4039  poly condu = getSmallest(J);   // Choses the polynomial of smallest degree
    39454040                                 // of J as universal denominator.
    39464041  if(dbg >= 1){
     
    39494044  }
    39504045
    3951   // ---------  splitting the ideal by the conductor (if possible) ----------- 
    3952   // If the ideal is equidimensional, but not necessarily prime, we check if 
     4046  // ---------  splitting the ideal by the conductor (if possible) -----------
     4047  // If the ideal is equidimensional, but not necessarily prime, we check if
    39534048  // the conductor is a non-zerodivisor of R/I.
    39544049  // If not, we split I.
    3955   if((decomp == 1) or (decomp == 2)){ 
     4050  if((decomp == 1) or (decomp == 2)){
    39564051    ideal Id1 = quotient(0, condu);
    39574052    if(size(Id1) > 0){
     
    39684063      list nor1 = normalM(Id1, decomp, withDelta)[1];
    39694064      list nor2 = normalM(Id2, decomp, withDelta)[1];
    3970       printlevel = printlevel - 1;   
     4065      printlevel = printlevel - 1;
    39714066      return(list(nor1, nor2));
    39724067    }
    39734068  }
    39744069
    3975   // --------------- computation of the first test ideal ---------------------   
     4070  // --------------- computation of the first test ideal ---------------------
    39764071  // To compute the radical we go back to the original ring.
    3977   // If we are using a non-global ordering, we must change to the global 
     4072  // If we are using a non-global ordering, we must change to the global
    39784073  // ordering.
    39794074  if(isGlobal == 1){
     
    39874082       "";
    39884083    }
    3989     J = radical(J);
     4084    // We check if the only singular point is the origin.
     4085    // If so, the radical is the maximal ideal at the origin.
     4086    J = groebner(J);
     4087    if(locAtZero(J)){
     4088      J = maxideal(1);
     4089    } else {
     4090      J = radical(J);
     4091    }
    39904092  } else {
    39914093    // We change to global dp ordering.
     
    40094111    ideal J = fetch(globR, J);
    40104112  }
    4011    
     4113
    40124114  if(dbg >= 1){
    40134115    "The radical of the original singular locus is";
     
    40164118  }
    40174119
    4018   // ---------------- election of the non zero divisor --------------------- 
     4120  // ---------------- election of the non zero divisor ---------------------
    40194121  setring Q;
    40204122  J = fetch(R, J);
    4021   J = interred(J);         
    4022   poly D = getSmallest(J);    // Chooses the poly of smallest degree as 
     4123  J = interred(J);
     4124  poly D = getSmallest(J);    // Chooses the poly of smallest degree as
    40234125                              // non-zerodivisor.
    40244126  if(dbg >= 1){
     
    40274129  }
    40284130
    4029   // ------- splitting the ideal by the non-zerodivisor (if possible) --------   
     4131  // ------- splitting the ideal by the non-zerodivisor (if possible) --------
    40304132  // If the ideal is equidimensional, but not necessarily prime, we check if D
    40314133  // is actually a non-zerodivisor of R/I.
    40324134  // If not, we split I.
    4033   if((decomp == 1) or (decomp == 2)){ 
     4135  if((decomp == 1) or (decomp == 2)){
    40344136    // We check if D is actually a non-zerodivisor of R/I.
    40354137    // If not, we split I.
     
    40394141      if(dbg >= 1){
    40404142        "A zerodivisor was found. We split the ideal. The zerodivisor is ", D;
    4041       }   
     4143      }
    40424144      setring R;
    40434145      ideal Id1 = fetch(Q, Id1), I;
     
    40484150      list nor1 = normalM(Id1, decomp, withDelta)[1];
    40494151      list nor2 = normalM(Id2, decomp, withDelta)[1];
    4050       printlevel = printlevel - 1;   
    4051       return(list(nor1, nor2));   
     4152      printlevel = printlevel - 1;
     4153      return(list(nor1, nor2));
    40524154    }
    40534155  }
    40544156
    4055   // --------------------- normalization ------------------------------------ 
     4157  // --------------------- normalization ------------------------------------
    40564158  // We call normalMEqui to compute the normalization.
    40574159  setring R;
     
    40664168
    40674169///////////////////////////////////////////////////////////////////////////////
    4068  
     4170
    40694171static proc normalMEqui(ideal I, ideal origJ, poly condu, poly D, int withDelta)
    40704172// Here is where the normalization is actually computed.
     
    40834185  int isGlobal = ord_test(basering);
    40844186  int delt;
    4085  
     4187
    40864188  def R = basering;
    40874189  poly c = D;
     
    40904192  list testOut;                 // Output of proc testIdeal
    40914193                                // (the test ideal and the ring structure)
    4092    
     4194
    40934195  qring Q = groebner(I);
    40944196  option("redSB");
    4095   option("returnSB"); 
     4197  option("returnSB");
    40964198  ideal J = imap(R, origJ);
    40974199  poly c = imap(R, c);
     
    41034205  dbprint(dbg, "Preliminar step begins.");
    41044206
    4105   // --------------------- computation of A1 ------------------------------- 
     4207  // --------------------- computation of A1 -------------------------------
    41064208  dbprint(dbg, "Computing the quotient (DJ : J)...");
    4107   ideal U = groebner(quotient(D*J, J)); 
     4209  ideal U = groebner(quotient(D*J, J));
    41084210  ideal oldU = 1;
    41094211
     
    41124214  }
    41134215
    4114   // ----------------- Grauer-Remmert criterion check ----------------------- 
     4216  // ----------------- Grauer-Remmert criterion check -----------------------
    41154217  // We check if the equality in Grauert - Remmert criterion is satisfied.
    41164218  isNormal = checkInclusions(D*oldU, U);
     
    41204222      "and U = "; U;
    41214223    }
    4122   } else {       
     4224  } else {
    41234225    // The original ring R/I was normal. Nothing to do.
    41244226    // We define anyway a new ring, equal to R, to be able to return it.
     
    41404242  }
    41414243
    4142   // ----- computation of the chain of ideals A1 c A2 c ... c An ------------ 
     4244  // ----- computation of the chain of ideals A1 c A2 c ... c An ------------
    41434245  while(isNormal == 0){
    41444246    step++;
     
    41484250    }
    41494251    dbprint(dbg, "Computing the test ideal...");
    4150    
    4151     // --------------- computation of the test ideal ------------------------ 
    4152     // Computes a test ideal for the new ring. 
     4252
     4253    // --------------- computation of the test ideal ------------------------
     4254    // Computes a test ideal for the new ring.
    41534255    // The test ideal will be the radical in the new ring of the original
    41544256    // test ideal.
     
    41584260    testOut = testIdeal(I, U, origJ, c, D);
    41594261    cJ = testOut[1];
    4160    
     4262
    41614263    setring Q;
    41624264    cJ = imap(R, cJ);
    41634265    cJ = groebner(cJ);
    4164    
     4266
    41654267    // cJ / c is now the ideal mapped back.
    4166     // We have the generators as an ideal in the new ring, 
     4268    // We have the generators as an ideal in the new ring,
    41674269    // but we want the generators as an ideal in the original ring.
    41684270    cJMod = getGenerators(cJ, U, c);
     
    41724274      cJMod;
    41734275    }
    4174    
     4276
    41754277    cJ = cJMod;
    41764278
    4177     // ------------- computation of the quotient (DJ : J)-------------------- 
     4279    // ------------- computation of the quotient (DJ : J)--------------------
    41784280    oldU = U;
    41794281    dbprint(dbg, "Computing the quotient (c*D*cJ : cJ)...");
     
    41814283    if(dbg >= 2){"The quotient is "; U;}
    41824284
    4183     // ------------- Grauert - Remmert criterion check ---------------------- 
     4285    // ------------- Grauert - Remmert criterion check ----------------------
    41844286    // We check if the equality in Grauert - Remmert criterion is satisfied.
    41854287    isNormal = checkInclusions(D*oldU, U);
    41864288
    4187     if(isNormal == 1){       
    4188       // We go one step back. In the last step we didnt get antyhing new, 
     4289    if(isNormal == 1){
     4290      // We go one step back. In the last step we didnt get antyhing new,
    41894291      // we just verified that the ring was already normal.
    41904292      dbprint(dbg, "The ring in the previous step was already normal.");
     
    41924294      U = oldU;
    41934295    } else {
    4194       // ------------- preparation for next iteration ---------------------- 
     4296      // ------------- preparation for next iteration ----------------------
    41954297      // We have to go on.
    41964298      // The new denominator is chosen.
     
    42094311  }
    42104312
    4211   // ------------------------- delta computation ---------------------------- 
    4212   if(withDelta){ 
     4313  // ------------------------- delta computation ----------------------------
     4314  if(withDelta){
    42134315    ideal UD = groebner(U);
    42144316    delt = vdim(std(modulo(UD, c)));
    42154317  }
    4216  
    4217   // -------------------------- prepare output -----------------------------   
     4318
     4319  // -------------------------- prepare output -----------------------------
    42184320  setring R;
    42194321  U = fetch(Q, U);
     
    42284330  }
    42294331  return(output);
    4230  
     4332
     4333}
     4334
     4335///////////////////////////////////////////////////////////////////////////////
     4336
     4337static proc lineUpLast(ideal U, poly c)
     4338// Sets c as the last generator of U.
     4339{
     4340  int i;
     4341  ideal newU;
     4342  for (i = 1; i <= ncols(U); i++){
     4343    if(U[i] != c){
     4344      if(size(newU) == 0){
     4345        newU = U[i];
     4346      } else {
     4347        newU = newU, U[i];
     4348      }
     4349    }
     4350  }
     4351  if(size(newU) == 0){
     4352    newU = c;
     4353  } else {
     4354    newU = newU, c;
     4355  }
     4356  return(newU);
    42314357}
    42324358
     
    42504376static proc getSmallest(ideal J){
    42514377// Computes the polynomial of smallest degree of J.
    4252 // If there are more than one, it chooses the one with smallest number 
     4378// If there are more than one, it chooses the one with smallest number
    42534379// of monomials.
    42544380  int i;
     
    42834409
    42844410  int i, j;                             // counters;
    4285   int dbg = printlevel - voice + 2;     // dbg = printlevel (default: dbg = 0) 
     4411  int dbg = printlevel - voice + 2;     // dbg = printlevel (default: dbg = 0)
    42864412  poly p;                               // The lifted polynomial
    42874413  ideal JGr = groebner(J);              // Groebner base of J
     
    43114437// Internal procedure, used in normalM.
    43124438// Computes the test ideal in the new ring.
    4313 // It takes the original test ideal and computes the radical of it in the 
     4439// It takes the original test ideal and computes the radical of it in the
    43144440// new ring.
    43154441
     
    43184444// The original ring is R / I, where R is the basering.
    43194445  int i;                                // counter
    4320   int dbg = printlevel - voice + 2;     // dbg = printlevel (default: dbg = 0) 
     4446  int dbg = printlevel - voice + 2;     // dbg = printlevel (default: dbg = 0)
    43214447  def R = basering;                      // We dont work in the quo
    43224448  ideal J = origJ;
    4323  
     4449
    43244450  // ---------- computation of the ring structure of 1/c * U ----------------
    43254451  U = lineUp(U, c);
    4326  
     4452
    43274453  if(dbg > 1){"Computing the new ring structure...";}
    43284454  list ele = computeRing(U, I, "noRed");
     
    43324458  if(dbg > 1){"The relations are"; norid;}
    43334459
    4334   // ---------------- setting the ring to work in  -------------------------- 
    4335   int isGlobal = ord_test(origEre);      // Checks if the original ring has 
     4460  // ---------------- setting the ring to work in  --------------------------
     4461  int isGlobal = ord_test(origEre);      // Checks if the original ring has
    43364462                                         // global ordering.
    43374463  if(isGlobal != 1){
     
    43404466    list newOrd = list("dp", intvec(1:nvars(origEre))), list("C", 0);
    43414467    rl[3] = newOrd;
    4342     def ere = ring(rl);     // globR is the original ring but 
     4468    def ere = ring(rl);     // globR is the original ring but
    43434469                            // with a global ordering.
    43444470    setring ere;
     
    43534479
    43544480
    4355   // ----- computation of the test ideal using the ring structure of Ai ----- 
     4481  // ----- computation of the test ideal using the ring structure of Ai -----
    43564482  option("redSB");
    43574483  option("returnSB");
     
    43604486  J = radical(J);
    43614487  if(dbg > 1){"Computing the interreduction of the radical...";}
    4362   J = groebner(J); 
     4488  J = groebner(J);
    43634489  //J = interred(J);
    43644490  if(dbg > 1){
     
    43674493    if(dbg>4){pause();}
    43684494  }
    4369  
     4495
    43704496  setring ere;
    4371  
    4372   // -------------- map from Ai to the total ring of fractions --------------- 
     4497
     4498  // -------------- map from Ai to the total ring of fractions ---------------
    43734499  // Now we must map back this ideal J to U_i / c in the total ring of
    43744500  // fractions.
    43754501  // The map sends T_j -> u_j / c.
    43764502  // The map is built by the following steps:
    4377   // 1) We compute the degree of the generators of J with respect to the 
     4503  // 1) We compute the degree of the generators of J with respect to the
    43784504  //    new variables T_j.
    43794505  // 2) For each generator, we multiply each term by a power of c, as if
     
    43814507  //    a polynomial in the old variables divided by c).
    43824508  // 3) We replace the new variables T_j by the corresponding numerator u_j.
    4383   // 4) We lift the resulting polynomial to change the denominator 
     4509  // 4) We lift the resulting polynomial to change the denominator
    43844510  //    from c^n to c.
    43854511  int nNewVars = nvars(ere) - nvars(R);      // Number of new variables
    43864512  poly c = imap(R, c);
    4387   intvec @v = 1..nNewVars;    // Vector of the new variables. 
     4513  intvec @v = 1..nNewVars;    // Vector of the new variables.
    43884514                              // They must be the first ones.
    43894515  if(dbg > 1){"The indices of the new variables are", @v;}
    43904516
    4391   // ---------------------- step 1 of the mapping --------------------------- 
     4517  // ---------------------- step 1 of the mapping ---------------------------
    43924518  intvec degs;
    43934519  for(i = 1; i<=ncols(J); i++){
     
    43984524    degs;
    43994525  }
    4400  
    4401   // ---------------------- step 2 of the mapping ---------------------------   
     4526
     4527  // ---------------------- step 2 of the mapping ---------------------------
    44024528  ideal mapJ = mapBackIdeal(J, c, @v);
    4403  
     4529
    44044530  setring R;
    44054531
    4406   // ---------------------- step 3 of the mapping --------------------------- 
     4532  // ---------------------- step 3 of the mapping ---------------------------
    44074533  ideal z;                    // The variables of the original ring in order.
    44084534  for(i = 1; i<=nvars(R); i++){
    44094535    z[i] = var(i);
    44104536  }
    4411      
     4537
    44124538  map f = ere, U[2..ncols(U)], z[1..ncols(z)]; // The map to the original ring.
    44134539  if(dbg > 1){
     
    44164542    if(dbg>4){pause();}
    44174543  }
    4418  
     4544
    44194545  if(dbg > 1){
    44204546    "Computing the map...";
    44214547  }
    4422      
     4548
    44234549  J = f(mapJ);
    44244550  if(dbg > 1){
     
    44284554  }
    44294555
    4430   // ---------------------- step 4 of the mapping ---------------------------   
     4556  // ---------------------- step 4 of the mapping ---------------------------
    44314557  qring Q = groebner(I);
    44324558  ideal J = imap(R, J);
     
    44484574  }
    44494575
    4450   // --------------------------- prepare output ----------------------------   
     4576  // --------------------------- prepare output ----------------------------
    44514577  J = groebner(J);
    4452  
     4578
    44534579  setring R;
    44544580  J = imap(Q, J);
    4455  
     4581
    44564582  return(list(J, ele[1]));
    44574583}
     
    44604586
    44614587static proc changeDenominator(ideal U1, poly c1, poly c2, ideal I){
    4462 // Given a ring in the form 1/c1 * U, it computes a new ideal U2 such that the 
     4588// Given a ring in the form 1/c1 * U, it computes a new ideal U2 such that the
    44634589// ring is 1/c2 * U2.
    44644590// The base ring is R, but the computations are to be done in R / I.
     
    44784604
    44794605static proc changeDenominatorQ(ideal U1, poly c1, poly c2){
    4480 // Given a ring in the form 1/c1 * U, it computes a new U2 st the ring 
     4606// Given a ring in the form 1/c1 * U, it computes a new U2 st the ring
    44814607// is 1/c2 * U2.
    44824608// The base ring is already a quotient ring R / I.
     
    44944620
    44954621static proc checkInclusions(ideal U1, ideal U2){
    4496 // Checks if the identity A = Hom(J, J) of Grauert-Remmert criterion is 
     4622// Checks if the identity A = Hom(J, J) of Grauert-Remmert criterion is
    44974623// satisfied.
    44984624  int dbg = printlevel - voice + 2;     // dbg = printlevel (default: dbg = 0)
    44994625  list reduction1;
    45004626  list reduction2;
    4501  
    4502   // ---------------------- inclusion Hom(J, J) c A ------------------------- 
     4627
     4628  // ---------------------- inclusion Hom(J, J) c A -------------------------
    45034629  if(dbg > 1){"Checking the inclusion Hom(J, J) c A:";}
    45044630  // This interred is used only because a bug in groebner!
     
    45074633  if(dbg > 1){reduction1[1];}
    45084634
    4509   // ---------------------- inclusion A c Hom(J, J) ------------------------- 
     4635  // ---------------------- inclusion A c Hom(J, J) -------------------------
    45104636  // The following check should always be satisfied.
    45114637  // This is only used for debugging.
     
    45234649    }
    45244650  }
    4525  
     4651
    45264652  if(size(reduction1[1]) == 0){
    45274653    // We are done! The ring computed in the last step was normal.
     
    45484674  return(d);
    45494675}
    4550    
     4676
    45514677///////////////////////////////////////////////////////////////////////////////
    45524678
    45534679static proc mapBackIdeal(ideal I, poly c, intvec @v){
    4554 // Modifies all polynomials in I so that a map x(i) -> y(i)/c can be 
     4680// Modifies all polynomials in I so that a map x(i) -> y(i)/c can be
    45554681// carried out.
    45564682
     
    45674693
    45684694static proc mapBackPoly(poly p, poly c, intvec @v){
    4569 // Multiplies each monomial of p by a power of c so that a map x(i) -> y(i)/c 
     4695// Multiplies each monomial of p by a power of c so that a map x(i) -> y(i)/c
    45704696// can be carried out.
    45714697
     
    45944720//NOTE:  We use the following attributes:
    45954721// 1     attrib(id,"isCohenMacaulay");         //--- Cohen Macaulay
    4596 // 2     attrib(id,"isCompleteIntersection");  //--- complete intersection 
    4597 // 3     attrib(id,"isHypersurface");          //--- hypersurface 
    4598 // 4     attrib(id,"isEquidimensional");       //--- equidimensional ideal 
    4599 // 5     attrib(id,"isPrim");                  //--- prime ideal 
    4600 // 6     attrib(id,"isRegInCodim2");           //--- regular in codimension 2 
    4601 // 7     attrib(id,"isIsolatedSingularity");   //--- isolated singularities 
    4602 // 8     attrib(id,"onlySingularAtZero");      //--- only singular at 0 
    4603 // 9     attrib(id,"isRadical");               //--- radical ideal 
     4722// 2     attrib(id,"isCompleteIntersection");  //--- complete intersection
     4723// 3     attrib(id,"isHypersurface");          //--- hypersurface
     4724// 4     attrib(id,"isEquidimensional");       //--- equidimensional ideal
     4725// 5     attrib(id,"isPrim");                  //--- prime ideal
     4726// 6     attrib(id,"isRegInCodim2");           //--- regular in codimension 2
     4727// 7     attrib(id,"isIsolatedSingularity");   //--- isolated singularities
     4728// 8     attrib(id,"onlySingularAtZero");      //--- only singular at 0
     4729// 9     attrib(id,"isRadical");               //--- radical ideal
    46044730//Recall: (attrib(id,"xy"),1) sets attrib xy to TRUE and
    46054731//        (attrib(id,"xy"),0) to FALSE
     
    46074733static proc getAttrib (ideal id)
    46084734"USAGE:   getAttrib(id);  id=ideal
    4609 COMPUTE: check attributes for id. If the attributes above are defined, 
    4610          take its value, otherwise define it and set it to 0 
     4735COMPUTE: check attributes for id. If the attributes above are defined,
     4736         take its value, otherwise define it and set it to 0
    46114737RETURN:  intvec of size 9, with entries 0 or 1,  values of attributes defined
    46124738         above (in this order)
     
    46164742  int isCoM,isCoI,isHy,isEq,isPr,isReg,isIso,oSAZ,isRad;
    46174743
    4618   if( typeof(attrib(id,"isCohenMacaulay"))=="int" )   
     4744  if( typeof(attrib(id,"isCohenMacaulay"))=="int" )
    46194745  {
    4620     if( attrib(id,"isCohenMacaulay")==1 ) 
     4746    if( attrib(id,"isCohenMacaulay")==1 )
    46214747    { isCoM=1; isEq=1; }
    46224748  }
     
    46244750  if( typeof(attrib(id,"isCompleteIntersection"))=="int" )
    46254751  {
    4626     if(attrib(id,"isCompleteIntersection")==1) 
     4752    if(attrib(id,"isCompleteIntersection")==1)
    46274753    { isCoI=1; isCoM=1; isEq=1; }
    46284754  }
    4629    
     4755
    46304756  if( typeof(attrib(id,"isHypersurface"))=="int" )
    46314757  {
     
    46334759    { isHy=1; isCoI=1; isCoM=1; isEq=1; }
    46344760  }
    4635    
     4761
    46364762  if( typeof(attrib(id,"isEquidimensional"))=="int" )
    46374763  {
    4638     if(attrib(id,"isEquidimensional")==1) 
     4764    if(attrib(id,"isEquidimensional")==1)
    46394765    { isEq=1; }
    46404766  }
    4641    
     4767
    46424768  if( typeof(attrib(id,"isPrim"))=="int" )
    46434769  {
    4644     if(attrib(id,"isPrim")==1) 
     4770    if(attrib(id,"isPrim")==1)
    46454771    { isPr=1; }
    46464772  }
     
    46484774  if( typeof(attrib(id,"isRegInCodim2"))=="int" )
    46494775  {
    4650     if(attrib(id,"isRegInCodim2")==1) 
     4776    if(attrib(id,"isRegInCodim2")==1)
    46514777    { isReg=1; }
    46524778  }
    4653    
     4779
    46544780  if( typeof(attrib(id,"isIsolatedSingularity"))=="int" )
    46554781  {
    4656     if(attrib(id,"isIsolatedSingularity")==1) 
     4782    if(attrib(id,"isIsolatedSingularity")==1)
    46574783    { isIso=1; }
    46584784  }
    4659  
     4785
    46604786  if( typeof(attrib(id,"onlySingularAtZero"))=="int" )
    46614787  {
     
    46664792  if( typeof(attrib(id,"isRad"))=="int" )
    46674793  {
    4668     if(attrib(id,"isRad")==1) 
     4794    if(attrib(id,"isRad")==1)
    46694795    { isRad=1; }
    46704796  }
     
    46844810{
    46854811  attrib(id,"isCohenMacaulay",atr[1]);         //--- Cohen Macaulay
    4686   attrib(id,"isCompleteIntersection",atr[2]);  //--- complete intersection 
    4687   attrib(id,"isHypersurface",atr[3]);          //--- hypersurface 
    4688   attrib(id,"isEquidimensional",atr[4]);       //--- equidimensional ideal 
    4689   attrib(id,"isPrim",atr[5]);                  //--- prime ideal 
    4690   attrib(id,"isRegInCodim2",atr[6]);           //--- regular in codimension 2 
    4691   attrib(id,"isIsolatedSingularity",atr[7]);   //--- isolated singularities 
    4692   attrib(id,"onlySingularAtZero",atr[8]);      //--- only singular at 0 
    4693   attrib(id,"isRadical",atr[9]);               //--- radical ideal 
     4812  attrib(id,"isCompleteIntersection",atr[2]);  //--- complete intersection
     4813  attrib(id,"isHypersurface",atr[3]);          //--- hypersurface
     4814  attrib(id,"isEquidimensional",atr[4]);       //--- equidimensional ideal
     4815  attrib(id,"isPrim",atr[5]);                  //--- prime ideal
     4816  attrib(id,"isRegInCodim2",atr[6]);           //--- regular in codimension 2
     4817  attrib(id,"isIsolatedSingularity",atr[7]);   //--- isolated singularities
     4818  attrib(id,"onlySingularAtZero",atr[8]);      //--- only singular at 0
     4819  attrib(id,"isRadical",atr[9]);               //--- radical ideal
    46944820
    46954821  return(id);
     
    47064832"
    47074833{
    4708   if( typeof(attrib(id1,"isCohenMacaulay"))=="int" )   
     4834  if( typeof(attrib(id1,"isCohenMacaulay"))=="int" )
    47094835  {
    47104836    if( attrib(id1,"isCohenMacaulay")==1 )
     
    47164842  {
    47174843    attrib(id,"isCohenMacaulay",0);
    4718   } 
     4844  }
    47194845
    47204846  if( typeof(attrib(id1,"isCompleteIntersection"))=="int" )
     
    47304856    attrib(id,"isCompleteIntersection",0);
    47314857  }
    4732    
     4858
    47334859  if( typeof(attrib(id1,"isHypersurface"))=="int" )
    47344860  {
     
    47444870    attrib(id,"isHypersurface",0);
    47454871  }
    4746    
     4872
    47474873  if( (typeof(attrib(id1,"isEquidimensional"))=="int") )
    47484874  {
     
    47684894    attrib(id,"isPrim",0);
    47694895  }
    4770    
     4896
    47714897  if( (typeof(attrib(id1,"isRegInCodim2"))=="int") )
    47724898  {
     
    47804906    attrib(id,"isRegInCodim2",0);
    47814907  }
    4782    
     4908
    47834909  if( (typeof(attrib(id1,"isIsolatedSingularity"))=="int") )
    47844910  {
     
    47924918    attrib(id,"isIsolatedSingularity",0);
    47934919  }
    4794  
     4920
    47954921  if( typeof(attrib(id1,"onlySingularAtZero"))=="int" )
    47964922  {
     
    48074933  if( typeof(attrib(id1,"isRad"))=="int" )
    48084934  {
    4809     if(attrib(id1,"isRad")==1) 
     4935    if(attrib(id1,"isRad")==1)
    48104936    {
    48114937      attrib(id,"isRad",1);
     
    48214947
    48224948proc normalC(ideal id, list #)
    4823 "USAGE:   normalC(id [,choose]);  id = radical ideal, choose = optional string 
     4949"USAGE:   normalC(id [,choose]);  id = radical ideal, choose = optional string
    48244950         which may be a combination of \"equidim\", \"prim\", \"withGens\",
    48254951         \"isPrim\", \"noFac\".@*
     
    48274953         If choose = \"prim\" resp. \"equidim\" normalC computes a prime resp.
    48284954         an equidimensional decomposition and then the normalization of each
    4829          component; if choose = \"noFac\" factorization is avoided in the 
     4955         component; if choose = \"noFac\" factorization is avoided in the
    48304956         computation of the minimal associated primes; @*
    4831          if choose = \"withGens\" the minimal associated primes P_i of id are 
    4832          computed and for each P_i, algebra generators of the integral closure 
     4957         if choose = \"withGens\" the minimal associated primes P_i of id are
     4958         computed and for each P_i, algebra generators of the integral closure
    48334959         of basering/P_i are computed as elements of its quotient field;@*
    48344960         \"isPrim\" disables \"equidim\" and \"prim\".@*
    48354961ASSUME:  The ideal must be radical, for non-radical ideals the output may
    4836          be wrong (id=radical(id); makes id radical). However, if choose = 
    4837          \"prim\" the minimal associated primes of id are computed first 
     4962         be wrong (id=radical(id); makes id radical). However, if choose =
     4963         \"prim\" the minimal associated primes of id are computed first
    48384964         and hence normalC computes the normalization of the radical of id.
    48394965         \"isPrim\" should only be used if id is known to be irreducible.
    4840 RETURN:  a list, say nor, of size 2 (resp. 3 if choose=\"withGens\"). 
    4841          The first list nor[1] consists of r rings, where r is the number 
    4842          of irreducible components if choose = \"prim\" (resp. >= no of 
    4843          equidimenensional components if choose =  \"equidim\"). 
    4844 @format 
     4966RETURN:  a list, say nor, of size 2 (resp. 3 if choose=\"withGens\").
     4967         The first list nor[1] consists of r rings, where r is the number
     4968         of irreducible components if choose = \"prim\" (resp. >= no of
     4969         equidimenensional components if choose =  \"equidim\").
     4970@format
    48454971         Each ring Ri=nor[1][i], i=1..r, contains two ideals with given
    48464972         names @code{norid} and @code{normap} such that @*
    4847          - Ri/norid is the normalization of the i-th component, i.e. the 
     4973         - Ri/norid is the normalization of the i-th component, i.e. the
    48484974          integral closure in its field of fractions (as affine ring);
    48494975         - the direct sum of the rings Ri/norid is the normalization
     
    48524978           Ri/norid for each j.@*
    48534979
    4854          If choose=\"withGens\", nor[2] is a list of size r of ideals Ii= 
     4980         If choose=\"withGens\", nor[2] is a list of size r of ideals Ii=
    48554981         nor[2][i] in the basering, generating the integral closure of
    48564982         basering/P_i in its quotient field, i=1..r, in two different ways:
    4857          - Ii is given by polynomials 
    4858            g_1,...,g_k,g_k+1 such that the variables T(j) of the ring Ri 
     4983         - Ii is given by polynomials
     4984           g_1,...,g_k,g_k+1 such that the variables T(j) of the ring Ri
    48594985           satisfy T(1)=g_1/g_k+1,..,T(k)=g_k/g_k+1. Hence the g_j/g_k+1
    48604986           are algebra generators of the integral closure of basering/P_i
    4861            as sub-algebra in the quotient field of basering/P_i. 
    4862  
    4863          nor[2] (resp. nor[3] if choose=\"withGens\") is a list of an intvec 
    4864          of size r, the delta invariants of the r components, and an integer, 
    4865          the total delta invariant of basering/id (-1 means infinite, and 0 
    4866          that basering/P_i resp. basering/input is normal). 
     4987           as sub-algebra in the quotient field of basering/P_i.
     4988
     4989         nor[2] (resp. nor[3] if choose=\"withGens\") is a list of an intvec
     4990         of size r, the delta invariants of the r components, and an integer,
     4991         the total delta invariant of basering/id (-1 means infinite, and 0
     4992         that basering/P_i resp. basering/input is normal).
    48674993         Return value -2 means that delta resp. delta of one of the components
    48684994         is not computed (which may happen if \"equidim\" is given) .
    48694995@end format
    4870 THEORY:  The delta invariant of a reduced ring K[x1,...,xn]/id is 
     4996THEORY:  The delta invariant of a reduced ring K[x1,...,xn]/id is
    48714997             dim_K(normalization(K[x1,...,xn]/id) / K[x1,...,xn]/id)
    48724998         We call this number also the delta invariant of id.
    4873          We use the algorithm described in [G.-M. Greuel, G. Pfister: 
    4874          A SINGULAR Introduction to Commutative Algebra, 2nd Edition. 
     4999         We use the algorithm described in [G.-M. Greuel, G. Pfister:
     5000         A SINGULAR Introduction to Commutative Algebra, 2nd Edition.
    48755001         Springer Verlag (2007)].
    48765002NOTE:    To use the i-th ring type: @code{def R=nor[1][i]; setring R;}.
    4877 @*       Increasing/decreasing printlevel displays more/less comments 
     5003@*       Increasing/decreasing printlevel displays more/less comments
    48785004         (default: printlevel=0).
    48795005@*       Not implemented for local or mixed orderings and for quotient rings.
     
    48835009EXAMPLE: example normalC; shows an example
    48845010"
    4885 { 
     5011{
    48865012   int i,j, wgens, withEqui, withPrim, isPrim, nfac;
    48875013   int y = printlevel-voice+2;
     
    48985024   }
    48995025
    4900 //--------------------------- define the method --------------------------- 
     5026//--------------------------- define the method ---------------------------
    49015027   string method;                //make all options one string in order to use
    49025028                                 //all combinations of options simultaneously
    49035029   for ( i=1; i <= size(#); i++ )
    4904    { 
    4905      if ( typeof(#[i]) == "string" ) 
     5030   {
     5031     if ( typeof(#[i]) == "string" )
    49065032     {
    49075033       method = method + #[i];
     
    49105036
    49115037   //--------------------------- choosen methods -----------------------
    4912    //we have the methods 
     5038   //we have the methods
    49135039   // "withGens": computes algebra generators for each irreducible component
    49145040   // the general case: either "equidim" or not (then applying minAssGTZ)
     
    49325058   if ( find(method,"noFac") )
    49335059   {
    4934      nfac=1;           
     5060     nfac=1;
    49355061   }
    49365062
    49375063   //------------------ default method, may be changed --------------------
    4938    //Use a prime decomposition only for small no of variables otherwise equidim 
     5064   //Use a prime decomposition only for small no of variables otherwise equidim
    49395065   //Compute delta whenever possible.
    49405066
     
    49665092         prim[1] = id;
    49675093         if( y >= 0 )
    4968          { 
     5094         {
    49695095           "";
    49705096           "// ** WARNING: result is correct if ideal is prime (not checked) **";
     
    49835109
    49845110         if(y>=1)
    4985          { 
     5111         {
    49865112            prim;"";
    49875113            "// number of irreducible components is", size(prim);
     
    50255151         gens = closureGenerators(l);         //computes algebra(!) generators
    50265152
    5027          //NOTE: gens[i]/gens[size(gens)] expresses the ith variable of resu[1] 
     5153         //NOTE: gens[i]/gens[size(gens)] expresses the ith variable of resu[1]
    50285154         //(the normalization) as fraction of elements of the basering;
    50295155         //the variables of resu[1] are algebra generators.
     
    50425168         Gens = list(gens) + Gens;
    50435169
    5044 /*       ### Da die gens Algebra-Erzeuger sind, ist reduce nach Bestimmung 
     5170/*       ### Da die gens Algebra-Erzeuger sind, ist reduce nach Bestimmung
    50455171         der Algebra-Variablen T(i) nicht zulŠssig!
    5046          for(i=1;i<=size(gens)-1;i++) 
     5172         for(i=1;i<=size(gens)-1;i++)
    50475173         {
    50485174            gens[i]= reduce(gens[i],std(gens[size(gens)]));
     
    50655191      { del = -1; }
    50665192      deli = deli[1..size(deli)-1];
    5067       Resu = resu,Gens,list(deli,del); 
     5193      Resu = resu,Gens,list(deli,del);
    50685194      int sr = size(resu);
    50695195
    50705196      if ( y >= 0 )
    50715197      {"";
    5072 "// 'normalC' created a list, say nor, of three lists: 
     5198"// 'normalC' created a list, say nor, of three lists:
    50735199// nor[1] resp. nor[2] are lists of",sr,"ring(s) resp. ideal(s)
    50745200// and nor[3] is a list of an intvec and an integer.
     
    50775203// To access the i-th ring nor[1][i] give it a name, say Ri, and type e.g.
    50785204     def R1 = nor[1][1]; setring R1;  norid; normap;
    5079 // for the other rings type first setring r; (if r is the name of your 
     5205// for the other rings type first setring r; (if r is the name of your
    50805206// original basering) and then continue as for the first ring;
    5081 // Ri/norid is the affine algebra of the normalization of the i-th 
     5207// Ri/norid is the affine algebra of the normalization of the i-th
    50825208// component r/P_i (where P_i is an associated prime of the input ideal)
    50835209// and normap the normalization map from r to Ri/norid;
    50845210//    nor[2] is a list of",sr,"ideal(s), each ideal nor[2][i] consists of
    5085 // elements g1..gk of r such that the gj/gk generate the integral 
     5211// elements g1..gk of r such that the gj/gk generate the integral
    50865212// closure of r/P_i as sub-algebra in the quotient field of r/P_i, with
    50875213// gj/gk being mapped by normap to the j-th variable of Ri;
     
    50965222// We use the following attributes:
    50975223//   attrib(id,"isCohenMacaulay");         //--- Cohen Macaulay
    5098 //   attrib(id,"isCompleteIntersection");  //--- complete intersection 
    5099 //   attrib(id,"isHypersurface");          //--- hypersurface 
    5100 //   attrib(id,"isEquidimensional",-1);    //--- equidimensional ideal 
    5101 //   attrib(id,"isPrim");                  //--- prime ideal 
    5102 //   attrib(id,"isRegInCodim2");           //--- regular in codimension 2 
    5103 //   attrib(id,"isIsolatedSingularity";    //--- isolated singularities 
    5104 //   attrib(id,"onlySingularAtZero");      //--- only singular at 0   
     5224//   attrib(id,"isCompleteIntersection");  //--- complete intersection
     5225//   attrib(id,"isHypersurface");          //--- hypersurface
     5226//   attrib(id,"isEquidimensional",-1);    //--- equidimensional ideal
     5227//   attrib(id,"isPrim");                  //--- prime ideal
     5228//   attrib(id,"isRegInCodim2");           //--- regular in codimension 2
     5229//   attrib(id,"isIsolatedSingularity";    //--- isolated singularities
     5230//   attrib(id,"onlySingularAtZero");      //--- only singular at 0
    51055231
    51065232 //------------------- first set the attributes ----------------------
    5107    if( typeof(attrib(id,"isCohenMacaulay"))=="int" )   
     5233   if( typeof(attrib(id,"isCohenMacaulay"))=="int" )
    51085234   {
    51095235      if( attrib(id,"isCohenMacaulay")==1 )
     
    51155241   {
    51165242      attrib(id,"isCohenMacaulay",0);
    5117    } 
     5243   }
    51185244
    51195245   if( typeof(attrib(id,"isCompleteIntersection"))=="int" )
     
    51295255      attrib(id,"isCompleteIntersection",0);
    51305256   }
    5131    
     5257
    51325258   if( typeof(attrib(id,"isHypersurface"))=="int" )
    51335259   {
     
    51435269      attrib(id,"isHypersurface",0);
    51445270   }
    5145    
     5271
    51465272   if( ! (typeof(attrib(id,"isEquidimensional"))=="int") )
    51475273   {
    51485274         attrib(id,"isEquidimensional",0);
    51495275   }
    5150    
     5276
    51515277   if( typeof(attrib(id,"isPrim"))=="int" )
    51525278   {
     
    51605286      attrib(id,"isPrim",0);
    51615287   }
    5162    
     5288
    51635289   if( ! (typeof(attrib(id,"isRegInCodim2"))=="int") )
    51645290   {
    51655291         attrib(id,"isRegInCodim2",0);
    51665292   }
    5167    
     5293
    51685294   if( ! (typeof(attrib(id,"isIsolatedSingularity"))=="int") )
    51695295   {
    51705296         attrib(id,"isIsolatedSingularity",0);
    51715297   }
    5172  
     5298
    51735299   if( typeof(attrib(id,"onlySingularAtZero"))=="int" )
    51745300   {
     
    51855311   //-------------- compute equidimensional decomposition --------------------
    51865312   //If the method "equidim" is given, compute the equidim decomposition
    5187    //and goto the next step (no normalization 
     5313   //and goto the next step (no normalization
    51885314   //ACHTUNG: equidim berechnet bei nicht reduzierten id die eingebetteten
    51895315   //Komponenten als niederdim Komponenten, waehrend diese bei primdecGTZ
     
    52225348        intvec opt = option(get);
    52235349        option(redSB);
    5224         for(j=1; j<=size(prim); j++)   
     5350        for(j=1; j<=size(prim); j++)
    52255351        {
    52265352           keepresult = keepresult+facstd(prim[j]);
     
    52315357          prim=ideal(0);     //Bug in facstd, liefert leere Liste bei 0-Ideal
    52325358        }
    5233        
     5359
    52345360        if(y>=1)
    52355361        {  "";
     
    52445370   //start with the computation of the minimal associated primes:
    52455371
    5246    else                                         
     5372   else
    52475373   {
    52485374    if( isPrim )
     
    53005426   //----- for each component (equidim or irred) compute normalization -----
    53015427   int sr, skr, del;
    5302    intvec deli; 
     5428   intvec deli;
    53035429   int sp = size(prim);     //size of list prim (# irred or equidim comp)
    53045430
     
    53315457      if( attrib(id,"isHypersurface")==1 )
    53325458      {
    5333          attrib(prim[i],"isHypersurface",1); 
     5459         attrib(prim[i],"isHypersurface",1);
    53345460         attrib(prim[i],"isCompleteIntersection",1);
    53355461         attrib(prim[i],"isCohenMacaulay",1);
     
    53565482      }
    53575483      else
    5358       { 
     5484      {
    53595485        attrib(prim[i],"isRegInCodim2",0);
    53605486        attrib(prim[i],"isCohenMacaulay",0);
     
    53655491      //note: for equidimensional components the "splitting tools" can
    53665492      //create further decomposition
    5367       //We now start normalizationPrimes with 
     5493      //We now start normalizationPrimes with
    53685494      //ihp = partial normalisation map = identity map = maxideal(1)
    5369       //del = partial delta invariant = 0 
     5495      //del = partial delta invariant = 0
    53705496      //deli= intvec of partial delta invariants of components
    53715497      //in normalizationPrimes all the work is done:
     
    53795505      skr = size(keepresult);
    53805506
    5381       //compute delta:             
     5507      //compute delta:
    53825508      if( del >= 0 && keepresult[skr][1] >=0 )
    53835509      {
     
    53855511      }
    53865512      else
    5387       { 
    5388          del = -1; 
     5513      {
     5514         del = -1;
    53895515      }
    53905516      deli = keepresult[skr][2],deli;
     
    53935519      {
    53945520           "// delta of component",i; keepresult[skr][1];
    5395       } 
     5521      }
    53965522   }
    53975523   sr = size(result);
     
    54065532           "// Compute intersection multiplicities of the components";
    54075533        }
    5408       }   
     5534      }
    54095535
    54105536      if ( sp > 1 )
     
    54175543        else
    54185544        {
    5419            del = del + mul; 
     5545           del = del + mul;
    54205546        }
    54215547      }
     
    54335559      def R1 = nor[1][1];  setring R1;  norid;  normap;
    54345560// and similair for the other rings nor[1][i];
    5435 // Ri/norid is the affine algebra of the normalization of the i-th component 
    5436 // r/P_i (where P_i is a prime or an equidimensional ideal of the input ideal) 
     5561// Ri/norid is the affine algebra of the normalization of the i-th component
     5562// r/P_i (where P_i is a prime or an equidimensional ideal of the input ideal)
    54375563// and normap the normalization map from the basering to Ri/norid;
    54385564//    nor[2] shows the delta-invariant of each component and of the input
     
    54515577   list nor = normalC(i);
    54525578
    5453    nor; 
     5579   nor;
    54545580   // 2 branches have delta = 1, and 1 branch has delta = 0
    54555581   // the total delta invariant is 13
     
    54575583   def R2 = nor[1][2];  setring R2;
    54585584   norid; normap;
    5459    
     5585
    54605586   echo = 0;
    54615587   printlevel = printlevel-1;
     
    54645590   ring r = 2,(x,y,z),dp;
    54655591   ideal i = z3-xy4;
    5466    nor = normalC(i);  nor; 
    5467    // the delta invariant is infinite 
     5592   nor = normalC(i);  nor;
     5593   // the delta invariant is infinite
    54685594   // xy2z/z2 and xy3/z2 generate the integral closure of r/i as r/i-module
    54695595   // in its quotient field Quot(r/i)
    54705596
    5471    // the normalization as affine algebra over the ground field:             
     5597   // the normalization as affine algebra over the ground field:
    54725598   def R = nor[1][1]; setring R;
    54735599   norid; normap;
    54745600
    5475    echo = 0; 
     5601   echo = 0;
    54765602   pause("   hit return to continue");echo = 2;
    54775603
     
    55305656// "primCl"   -> uses normalC, with option "withGens".
    55315657// "111"      -> checks the output of normalM using norTest.
    5532 // "p"        -> compares the output of norM with the output of normalP 
     5658// "p"        -> compares the output of norM with the output of normalP
    55335659//               ("normalP" option must also be set).
    5534 // "pc"       -> compares the output of norM with the output of normalC with 
     5660// "pc"       -> compares the output of norM with the output of normalC with
    55355661//               option "withGens"
    55365662//               ("primCl" option must also be set).
     5663
    55375664proc timeNormal(ideal I, list #){
    5538   //--------------------------- define the method --------------------------- 
     5665  //--------------------------- define the method ---------------------------
    55395666  int isPrim, useRing;
    55405667  int decomp = -1;
     
    55495676                                //all combinations of options simultaneously
    55505677  for ( i=1; i <= size(#); i++ )
    5551   { 
    5552     if ( typeof(#[i]) == "string" ) 
     5678  {
     5679    if ( typeof(#[i]) == "string" )
    55535680    {
    55545681      method = method + #[i];
     
    55565683  }
    55575684  if ( find(method, "normal"))
    5558   {norM = 1;} 
     5685  {norM = 1;}
    55595686  if ( find(method, "normalP") and (char(basering) > 0))
    5560   {norP = 1;} 
     5687  {norP = 1;}
    55615688  if ( find(method, "normalC"))
    5562   {norC = 1;}     
     5689  {norC = 1;}
    55635690  if ( find(method, "primCl"))
    5564   {primCl = 1;} 
     5691  {primCl = 1;}
    55655692  if ( find(method, "isprim") or find(method,"isPrim") )
    55665693  {decomp = 0;}
    55675694  if ( find(method, "p") )
    5568   {checkP = 1;} 
     5695  {checkP = 1;}
    55695696  if ( find(method, "pc") )
    5570   {checkPC = 1;} 
     5697  {checkPC = 1;}
    55715698  if ( find(method, "111") )
    5572   {check111 = 1;}   
    5573      
     5699  {check111 = 1;}
     5700
    55745701  int tt;
    55755702  if(norM){
    5576     tt = timer; 
     5703    tt = timer;
    55775704    if(decomp == 0){
    55785705      "Running normal(useRing, isPrim)...";
     
    55875714  }
    55885715  if(norP){
    5589     tt = timer; 
     5716    tt = timer;
    55905717    if(decomp == 0){
    55915718      "Running normalP(isPrim)...";
     
    55995726    "";
    56005727  }
    5601  
     5728
    56025729  if(norC){
    5603     tt = timer; 
     5730    tt = timer;
    56045731    if(decomp == 0){
    56055732      "Running normalC(isPrim)...";
     
    56135740    "";
    56145741  }
    5615  
     5742
    56165743  if(primCl){
    5617     tt = timer; 
     5744    tt = timer;
    56185745    if(decomp == 0){
    56195746      "Running normalC(withGens, isPrim)...";
     
    56215748      "Time normalC(withGens, isPrim): ", timer - tt;
    56225749    } else {
    5623       "Running normalC(withGens)...";   
     5750      "Running normalC(withGens)...";
    56245751      list a4 = normalC(I, "withGens");
    56255752      "Time normalC(withGens): ", timer - tt;
     
    56275754    "";
    56285755  }
    5629  
     5756
    56305757  if(check111 and norM){
    56315758    "Checking output with norTest...";
    56325759    "WARNING: this checking only works if the original ideal was prime.";
    5633     list norL = list(a1[1][1][3]);
    5634     norTest(I, list(norL));
     5760    norTest(I, a1);
    56355761    "";
    56365762  }
    5637  
     5763
    56385764  if(checkP and norP and norM){
    56395765    "Comparing with normalP output...";
    5640     "WARNING: this checking only works if the original ideal was prime.";
    5641     U1 = a1[1][1][1];
    5642     c1 = a1[1][1][2];
    5643     U2 = a2[1][1];
    5644     c2 = a2[1][1][size(a2[1][1])];
    5645     W = changeDenominator(U1, c1, c2, groebner(I));
    5646     qring q = groebner(I);
    5647     ideal U2 = fetch(r, U2);
    5648     ideal W = fetch(r, W);
    5649     ch = 0;
    5650     if(size(reduce(U2, groebner(W))) == 0){
    5651       "U2 c U1";
    5652       ch = 1;
    5653     }
    5654     if(size(reduce(W, groebner(U2))) == 0){
    5655       "U1 c U2";
    5656       ch = ch + 1;
    5657     }
    5658     if(ch == 2){
    5659       "Output of normalP is equal.";
     5766    if(size(a2) > 0){
     5767      "WARNING: this checking only works if the original ideal was prime.";
     5768      U1 = a1[2][1];
     5769      c1 = U1[size(U1)];
     5770      U2 = a2[1][1];
     5771      c2 = a2[1][1][size(a2[1][1])];
     5772      W = changeDenominator(U1, c1, c2, groebner(I));
     5773      qring q = groebner(I);
     5774      ideal U2 = fetch(r, U2);
     5775      ideal W = fetch(r, W);
     5776      ch = 0;
     5777      if(size(reduce(U2, groebner(W))) == 0){
     5778        "U2 c U1";
     5779        ch = 1;
     5780      }
     5781      if(size(reduce(W, groebner(U2))) == 0){
     5782        "U1 c U2";
     5783        ch = ch + 1;
     5784      }
     5785      if(ch == 2){
     5786        "Output of normalP is equal.";
     5787      } else {
     5788        "ERROR: Output of normalP is different.";
     5789      }
     5790      setring r;
     5791      kill q;
    56605792    } else {
    5661       "ERROR: Output of normalP is different.";
     5793      "normalP returned no output. Comparison is not possible.";
    56625794    }
    56635795    "";
    5664     setring r;
    5665     kill q;
    5666   } 
    5667 
    5668   if(checkPC and norM and primCl){   
     5796  }
     5797
     5798  if(checkPC and norM and primCl){
    56695799    "Comparing with primeClosure output...";
    5670     "WARNING: this checking only works if the original ideal was prime.";
    5671     // primeClosure check
    5672     U1 = a1[1][1][1];
    5673     c1 = a1[1][1][2];
    5674     U2 = a4[2][1];
    5675     c2 = a4[2][1][size(a4[2][1])];
    5676     W = changeDenominator(U1, c1, c2, groebner(I));
    5677     qring q = groebner(I);
    5678     ideal U2 = fetch(r, U2);
    5679     ideal W = fetch(r, W);
    5680     ch = 0;
    5681     if(size(reduce(U2, groebner(W))) == 0){
    5682       "U2 c U1";
    5683       ch = 1;
    5684     }
    5685     if(size(reduce(W, groebner(U2))) == 0){
    5686       "U1 c U2";
    5687       ch = ch + 1;
    5688     }
    5689     if(ch == 2){
    5690       "Output of normalC(withGens) is equal.";
     5800    if(size(a4) > 0){
     5801      "WARNING: this checking only works if the original ideal was prime.";
     5802      // primeClosure check
     5803      U1 = a1[2][1];
     5804      c1 = U1[size(U1)];
     5805      U2 = a4[2][1];
     5806      c2 = a4[2][1][size(a4[2][1])];
     5807      W = changeDenominator(U1, c1, c2, groebner(I));
     5808      qring q = groebner(I);
     5809      ideal U2 = fetch(r, U2);
     5810      ideal W = fetch(r, W);
     5811      ch = 0;
     5812      if(size(reduce(U2, groebner(W))) == 0){
     5813        "U2 c U1";
     5814        ch = 1;
     5815      }
     5816      if(size(reduce(W, groebner(U2))) == 0){
     5817        "U1 c U2";
     5818        ch = ch + 1;
     5819      }
     5820      if(ch == 2){
     5821        "Output of normalC(withGens) is equal.";
     5822      } else {
     5823        "ERROR: Output of normalC(withGens) is different.";
     5824      }
     5825      setring r;
     5826      kill q;
    56915827    } else {
    5692       "ERROR: Output of normalC(withGens) is different.";
     5828      "normalC(withGens) returned no output. Comparison is not possible.";
    56935829    }
    56945830    "";
    5695     setring r;
    5696     kill q;   
    56975831  }
    56985832}
     
    57015835proc norTest (ideal i, list nor, list #)
    57025836"USAGE:   norTest(i,nor,[n]); i=prime ideal, nor=list, n=optional integer
    5703 ASSUME:  nor is the resulting list of normal(i) (any options) or the result
    5704          of normalP(i,"withRing"). In particular, the ring nor[1][1] contains
    5705          the ideal norid and the map normap: basering/i --> nor[1][1]/norid.
     5837ASSUME:  nor is the output of normal(i) (any options) or
     5838         normalP(i,"withRing") or normalC(i) (any options).
     5839         In particular, the ring nor[1][1] contains the ideal norid
     5840         and the map normap: basering/i --> nor[1][1]/norid.
    57065841RETURN:  an intvec v such that:
    57075842@format
    57085843         v[1] = 1 if the normap is injective and 0 otherwise
    57095844         v[2] = 1 if the normap is finite and 0 otherwise
    5710          v[3] = 1 if nor[1][1]/norid is normal and 0 otherwise 
     5845         v[3] = 1 if nor[1][1]/norid is normal and 0 otherwise
    57115846@end format
    57125847         If n=1 (resp n=2) only v[1] (resp. v[2]) is computed and returned
    5713 THEORY:  The procedure can be used to test whether the computation of the 
    5714          normalization was correct: basering/i --> nor[1][1]/norid is the 
    5715          normalization of basering/i iff v=1,1,0. 
     5848THEORY:  The procedure can be used to test whether the computation of the
     5849         normalization was correct: basering/i --> nor[1][1]/norid is the
     5850         normalization of basering/i iff v=1,1,0.
    57165851NOTE:    For big examples it can be hard to fully test correctness; the
    57175852         partial test norTest(i,nor,2) is usually fast
     
    57315866
    57325867    //### make a copy of nor to have a cpoy of nor[1][1]  (not a reference to)
    5733     // in order not to overwrite norid and normap. 
     5868    // in order not to overwrite norid and normap.
    57345869    // delete nor[2] (if it contains the module generators, which are not used)
    57355870    // s.t. newnor does not belong to a ring.
    57365871
    5737     list newnor = nor;         
     5872    list newnor = nor;
    57385873    if ( size(newnor) == 3 )
    57395874    {
    57405875       newnor = delete(newnor,2);
    57415876    }
     5877    def R = newnor[1][1];
    57425878    qring QAS = std(i);
    5743    
    5744     def R = newnor[1][1];
     5879
     5880
    57455881    setring R;
    57465882    int nva = nvars(R);
     
    57585894
    57595895    //--------- check first whether variables Z(i),...,A(i) exist -----------
    5760     for (ii=90; ii>=65; ii--) 
     5896    for (ii=90; ii>=65; ii--)
    57615897    {
    5762        if ( find(svars,ASCII(ii)+"(") == 0 )       
     5898       if ( find(svars,ASCII(ii)+"(") == 0 )
    57635899       {
    57645900          svar = ASCII(ii);  break;
     
    57745910    }
    57755911    else
    5776     {       
     5912    {
    57775913        for ( ii = 1; ii <= nva; ii++ )
    57785914        {
     
    57815917        }
    57825918    }
    5783    
     5919
    57845920    if ( g3[n3][1]== "c" or g3[n3][1] == "C" )
    57855921    {
     
    58155951    //ideal qnormap = imap(R,normap);
    58165952    map Qnormap = QAS,qnormap;    //r/id --> R/norid
    5817    
     5953
    58185954    //------------------------ check injectivity ---------------------------
    58195955//"injective:";
     
    58315967
    58325968    //------------------------ check normality ---------------------------
    5833     list testnor = normal(lnorid[2],"isPrim","noFac");
    5834     //### Problem: bei mehrfachem Aufruf von norTest gibt es 
     5969    list testnor = normal(lnorid[2],"isPrim","noFac", "withDelta");
     5970    //### Problem: bei mehrfachem Aufruf von norTest gibt es
    58355971    // ** redefining norid & ** redefining normap
    58365972    //Dies produziert Fehler, da alte norid und normap ueberschrieben werden
     
    58395975
    58405976    printlevel=prl;
    5841     d = testnor[size(testnor)][2];             //d = delta
     5977
     5978    d = testnor[3][2];             //d = delta
    58425979    kill testnor;                              //### sollte ueberfluessig sein
    58435980    int d1 = (d==0);                           //d1=1 if delta=0
     
    58545991   norTest(i,nor);                //1,1,1 means that normal was correct
    58555992
     5993   nor = normalC(i);
     5994   norTest(i,nor);                //1,1,1 means that normal was correct
     5995
    58565996   ring s = 2,(x,y),dp;
    58575997   ideal i = (x-y^2)^2 - y*x^3;
    58585998   nor = normalP(i,"withRing");
    58595999   norTest(i,nor);               //1,1,1 means that normalP was correct
    5860    printlevel = prl; 
     6000   printlevel = prl;
    58616001}
    58626002
     
    58706010// options for normal:  "equidim", "prim"
    58716011//                      "noDeco", "isPrim", "noFac"
    5872 //                       (prim by default)                     
     6012//                       (prim by default)
    58736013// options for normalP: "withRing", "isPrim" or "noFac"
    5874 // options for normalC: "equidim", "prim", "withGens", 
     6014// options for normalC: "equidim", "prim", "withGens",
    58756015//                      "noDeco", "isPrim", "noFac"
    58766016
    5877 //Commands for testing 'normal' 
    5878  list nor = normal(i); nor;           
    5879  list nor = normal(i,"isPrim");nor; 
     6017//Commands for testing 'normal'
     6018 list nor = normal(i); nor;
     6019 list nor = normal(i,"isPrim");nor;
    58806020 list nor = normal(i,"equidim");nor;
    58816021 list nor = normal(i,"prim");nor;
     
    58886028 list nor = normalP(i,"isPrim"); nor;    //if i is known to be prime
    58896029
    5890 //Commands for testing 'normalC' 
    5891  list nor = normal(i); nor;           
     6030//Commands for testing 'normalC'
     6031 list nor = normal(i); nor;
    58926032 list nor = normal(i,"withGens");nor;
    5893  list nor = normal(i,"isPrim");nor; 
     6033 list nor = normal(i,"isPrim");nor;
    58946034 list nor = normal(i,"equidim");nor;
    58956035 list nor = normal(i,"prim");nor;
     
    59036043norTest(i,nor,2);     //partial test for big examples (1,1 => ok)
    59046044factorize(i[1]);      //checks for irreducibility
     6045
     6046/////////////////////////////////////////////////////////////////////////////
     6047
     6048//----------------------Examples for normal (new algorithm)------------------
     6049// Timings with Computeserver Dual AMD Opteron 242 1.60GHz.
     6050// Examples from "Normalization of Rings" paper.
     6051
     6052// Example 1
     6053// char 0 : normal = 0 secs (7 steps) - normalC = 75 secs
     6054// char 2 : normal = 0 secs (7 steps) - normalP = 0 secs - normalC = 0 secs
     6055// char 5 : normal = 1 secs (7 steps) - normalP = 71 - normalC = 1 secs
     6056// char 11 : normal = 2 secs (7 steps) - normalP = 12 secs - normalC doesn't finish
     6057// char 32003 : normal = 1 secs (7 steps) - normalP doesn't finish - normalC = 1 sec
     6058LIB"normal.lib";
     6059ring r = 2, (x, y), dp;
     6060ideal i = (x-y)*x*(y+x^2)^3-y^3*(x^3+x*y-y^2);
     6061timeNormal(i, "normal", "normalC", "normalP", "isPrim", "p");
     6062
     6063// Example 2
     6064// char 0  : normal = 1 sec (7 steps) - normalC doesn't finish
     6065// char 3 : normal = 1 secs (8 steps) - normalP = 0 secs - normalC = 4 secs
     6066// char 13 : normal = 1 sec (7 steps) - normalP doesn't finish - normalC = 13 secs
     6067// char 32003 : normal = 1 secs (7 steps) - normalP doesn't finish - normalC = 10 sec
     6068LIB"normal.lib";
     6069ring r = 13, (x, y), dp;
     6070ideal i = 55*x^8+66*y^2*x^9+837*x^2*y^6-75*y^4*x^2-70*y^6-97*y^7*x^2;
     6071timeNormal(i, "normal", "normalC", "normalP", "p", "isPrim");
     6072
     6073// Example 3
     6074// char 0 : normal = 3 secs (6 steps) - normalC doesn't finish
     6075// char 2 : normal = 1 secs (13 steps) - normalP = 0 secs - normalC doesn't finish
     6076// char 5 : normal = 0 secs (6 steps) - normalP = 8 secs - normalC doesn't finish
     6077LIB"normal.lib";
     6078ring r=5,(x, y),dp;
     6079ideal i=y9+y8x+y8+y5+y4x+y3x2+y2x3+yx8+x9;
     6080timeNormal(i, "normal", "normalC", "normalP", "isPrim");
     6081
     6082// Example 4
     6083// char 0 : normal = 0 secs (1 step) - normalC = 0 secs
     6084// char 5 : normal = 0 secs (1 step) - normalP = 3 secs - normalC = 0 secs
     6085// char 11 : normal = 0 secs (1 step) - normalP doesn't finish - normalC = 0 secs
     6086// char 32003 : normal = 0 secs (1 step) - normalP doesn't finish - normalC = 0 secs
     6087LIB"normal.lib";
     6088ring r=11,(x,y),dp;   // genus 0 4 nodes and 6 cusps im P2
     6089ideal i=(x2+y^2-1)^3 +27x2y2;
     6090timeNormal(i, "normal", "normalC", "normalP", "isPrim");
     6091
     6092// Example 5
     6093// char 0 : normal = 0 secs (1 step) - normalC = 0 secs
     6094// char 5 : normal = 1 secs (3 step) - normalP doesn't finish - normalC doesn't finish
     6095// char 11 : normal = 0 secs (1 step) - normalP 0 secs - normalC = 0 secs
     6096// char 32003 : normal = 0 secs (1 step) - normalP doesn't finish - normalC = 0 secs
     6097LIB"normal.lib";
     6098ring r=11,(x,y),dp;    //24 sing, delta 24
     6099ideal i=-x10+x8y2-x6y4-x2y8+2y10-x8+2x6y2+x4y4-x2y6-y8+2x6-x4y2+x2y4+2x4+2x2y2-y4-x2+y2-1;
     6100timeNormal(i, "normal", "normalC", "normalP", "isPrim", "p");
     6101
     6102// Example 6
     6103// char 2 : normal = 5 secs (2 steps) - normalP = 25 secs - normalC = 166 secs
     6104LIB"normal.lib";
     6105ring r=2,(v,u,z,y,x),dp;
     6106ideal i = z3+zyx+y3x2+y2x3, uyx+z2,uz+z+y2x+yx2, u2+u+zy+zx, v3+vux+vz2+vzyx+vzx+uz3+uz2y+z3+z2yx2;
     6107timeNormal(i, "normal", "normalC", "normalP", "isPrim", "p");
     6108
     6109// Example 7
     6110// char 0 : normal = 11 secs (6 steps) - normalC = 11 secs
     6111// char 2 : normal = 11 secs (6 steps) - normalP = 0 secs - normalC = 11 secs
     6112// char 5 : normal = 11 secs (6 steps) - normalP = 3 secs - normalC = 11 secs
     6113// char 11 : normal = 11 secs (6 steps) - normalP = 43 secs - normalC = 11 secs
     6114// char 32003 : normal = 11 secs (6 steps) - normalP doesn't finish - normalC = 11 secs
     6115LIB"normal.lib";
     6116ring r=11,(x,y,z,w,t),dp;   //dim 2, dim s_locus 1
     6117ideal i= x2+zw, y3+xwt, xw3+z3t+ywt2, y2w4-xy2z2t-w3t3;
     6118timeNormal(i, "normal", "normalC", "normalP", "isPrim");
     6119
     6120////////////////////////////////////////////////////////////////////////////////
     6121
     6122// Other examples with new algorithm
     6123
     6124// Example 1
     6125// char 0 : normal = 1 secs (13 steps) - normalC doesn't finish
     6126// char 2 : normal = 1 secs (13 steps) - normalP = 0 secs - normalC doesn't finish
     6127// char 5 : normal = 1 secs (13 steps) - normalP = 29 secs - normalC doesn't finish
     6128ring r=2,(x,y),dp;  //genus 35
     6129ideal i=y30+y13x+x4y5+x3*(x+1)^2;
     6130timeNormal(i, "normal", "normalC", "normalP");
     6131
     6132// Example 2
     6133// char 0 : normal = 1 secs (13 steps) - normalC doesn't finish
     6134// char 3 : normal = 2 secs (13 steps) - normalP = 0 secs - normalC doesn't finish
     6135ring r=3,(x,y),dp;  //genus 19, delta 21
     6136ideal i=y20+y13x+x4y5+x3*(x+1)^2;
     6137timeNormal(i, "normal", "normalC", "normalP");
     6138
     6139// Example 3
     6140// Very fast with all algorithms
     6141ring r = 3, (x, y), dp;
     6142ideal I = (x-y^2)^2-x*y^3;
     6143timeNormal(I, "normal", "normalC", "normalP", "primCl", "111", "p", "pc");
     6144
     6145
    59056146
    59066147//----------------------Test Example for charp -------------------
     
    59136154//### preimage verbessern (Ist imm Kern map oder imap verwendet?)
    59146155//### Gleich in Ordnung dp wechseln, ringlist verwenden
    5915 //### interred ev nur zum Schluss 
     6156//### interred ev nur zum Schluss
    59166157//    (z.B. wenn nacher std; wenn nacher minor: testen )
    59176158
     
    59226163//1. Series Fp[x,y,u,v]/(x2v-y2u)
    59236164//-------------------------------
    5924 //characteristic p   2   3    5    7    11   13   17   37   97 
     6165//characteristic p   2   3    5    7    11   13   17   37   97
    59256166//icFracP          0.04 0.03 0.04 0.04 0.04 0.05 0.05 0.13 0.59  Mac
    59266167//normalP           0   0    0    0     0    0    0    0   1    Sing
     
    593061712. Series Fp[u, v, w, x, y, z]/u2x4+uvy4+v2z4
    59316172//--------------------------------------------
    5932 //characteristic p 2    3    5    7   11 
    5933 //icFracP         0.07 0.22 9.67 143 12543 
     6173//characteristic p 2    3    5    7   11
     6174//icFracP         0.07 0.22 9.67 143 12543
    59346175//normalP          0    0    5   42  1566
    59356176//icFractions     1.16   *    *   *    *       *: > 6h
    59366177//normal            0    0    0   0    0
    59376178
    5938 //3. Series Fp[u, v, w, x, y, z]/(u2xp+uvyp+v2zp) 
     6179//3. Series Fp[u, v, w, x, y, z]/(u2xp+uvyp+v2zp)
    59396180//-----------------------------------------------
    5940 //characteristic p  2    3    5    7    11   13  17 19 23 
    5941 //icFracP          0.06 0.07 0.09 0.27 1.81 4.89 26 56 225 
     6181//characteristic p  2    3    5    7    11   13  17 19 23
     6182//icFracP          0.06 0.07 0.09 0.27 1.81 4.89 26 56 225
    59426183//normalP          0     0    0    0    1    2  6  10  27
    5943 //icFractions      0.16 1.49 75.00 4009  *    *   *  *  * 
     6184//icFractions      0.16 1.49 75.00 4009  *    *   *  *  *
    59446185//normal            0     0    2    836
    59456186//### p=7 normal braucht 807 sec in:
     
    59546195
    59556196//IRREDUCIBLE EXAMPLES:
    5956 //--------------------- 
     6197//---------------------
    59576198//timing for MacBookPro 2.2GHz Intel Core 2 Duo, 4GB Ram
    59586199//Sing. ix86Mac-darwin version 3-1-0 (3100-2008101314)  Oct 13 2008 14:46:59
     
    59616202//Apply:
    59626203list nor = normal(i,"isPrim"); nor;
    5963 list nor = normalP(i,"withRing","isPrim"); nor; 
     6204list nor = normalP(i,"withRing","isPrim"); nor;
    59646205def R=nor[1][1]; setring R; norid; normap;
    59656206setring r;
    59666207norTest(i,nor);
    59676208
    5968 int tt = timer; 
    5969 list nor = normalP(i,"withRing","isPrim"); nor; 
     6209int tt = timer;
     6210list nor = normalP(i,"withRing","isPrim"); nor;
    59706211timer-tt;
    5971 int tt = timer; 
     6212int tt = timer;
    59726213list nor = normal(i,"isPrim");
    59736214timer-tt;
    59746215
    59756216ring r=19,(x,y,u,v),dp;    //delta -1
    5976 ideal i=x2v-y2u; 
     6217ideal i=x2v-y2u;
    59776218//norTest 2 sec
    59786219
     
    59946235
    59956236ring r=5,(u,v,x,y,z),dp;   //delta -1
    5996 ideal i=u2x6+uvy6+v2z6; 
     6237ideal i=u2x6+uvy6+v2z6;
    59976238//normalP 5sec, normalC 1sec
    59986239//V5: norTest(i,nor); 45 sec bei normalP, V6 12 sec
     
    60016242ring r=5,(u,v,x,y,z),dp;   //delta -1
    60026243ideal i=u2x5+uvy5+v2z5;
    6003 //normalP 1sec, normalC 1 sec, 
    6004 //norTest lange: minor(jacob(I),h,J) 193 (308)sec, haengt dann bei M = std(M); 
     6244//normalP 1sec, normalC 1 sec,
     6245//norTest lange: minor(jacob(I),h,J) 193 (308)sec, haengt dann bei M = std(M);
    60056246//norTest(i,nor,2); verwenden!
    60066247//Sing 3.0-4 orig  >9h! hŠngt bei Q = mstd(Q)[2];
    60076248
    60086249ring r=2,(y,x),wp(12,5);  //delta 3
    6009 ideal i=y5+y2x4+y2x+yx2+x12; 
     6250ideal i=y5+y2x4+y2x+yx2+x12;
    60106251//normalP 0 sec (Test 0 sec), normalC 2 sec (Test 2 sec)
    60116252//normalC withGens (ohne interred) 0sec
     
    60166257//normalC haengt bei minor, ideal im loop wird zu gross ###
    60176258//interred bei normalC vergroeesert string um Faktor 4000!
    6018 //withGens haengt bei interred in loop 4 (> 10 h) oder 
    6019 //(nach Ausschalten von interred) bei 
     6259//withGens haengt bei interred in loop 4 (> 10 h) oder
     6260//(nach Ausschalten von interred) bei
    60206261//int delt=vdim(std(modulo(f,ideal(p)))); (>?h)
    60216262
    6022 //Leonard1: (1. Komponente von Leonard),  delta -1 
     6263//Leonard1: (1. Komponente von Leonard),  delta -1
    60236264ring r=2,(v,u,z,y,x),dp;
    60246265ideal i = z3+zyx+y3x2+y2x3, uyx+z2,uz+z+y2x+yx2, u2+u+zy+zx,
     
    60466287 +y*(x^23+x^22+x^20+x^17+x^15+x^14+x^12+x^9)
    60476288 +(x^25+x^23+x^19+x^17+x^15+x^13+x^11+x^5);
    6048 //normalP: dp 2sec withRing 8sec, 
     6289//normalP: dp 2sec withRing 8sec,
    60496290//wp 4sec, withRing:51sec Zeit in lin = subst(lin, var(ii), vip); in elimpart ),
    60506291//norTest(i,nor,2): haengt bei mstd(norid);
     
    60526293//GEFIXTES INTERRED ABWARTEN. Dann interred aktivieren
    60536294//interred(norid) haengt u. mst(norid) zu lange
    6054 //(o.interred): haengt bei  haengt bei list SM = mstd(i); 
    6055 //ideal in der Mitte zu gross 
     6295//(o.interred): haengt bei  haengt bei list SM = mstd(i);
     6296//ideal in der Mitte zu gross
    60566297//i = Ideal (size 118, 13 var) fuer die neue Normalisierung
    60576298
     
    60596300------------------
    60606301//Apply:
    6061 int tt = timer; 
     6302int tt = timer;
    60626303list nor=normalP(i,"isPrim","withRing");
    60636304timer-tt;
     
    60676308list nor = normalC(i, "withGens"); nor;
    60686309list nor = normalP(i,"withRing"); nor;
    6069 list nor = normalP(i); nor; 
     6310list nor = normalP(i); nor;
    60706311def R=nor[1][1]; setring R; norid; normap;
    60716312
     
    60806321
    60816322//----------------------Test Example for special cases -------------------
    6082 int tt = timer; 
     6323int tt = timer;
    60836324list nor=normalP(i,"withRing");nor;
    60846325//list nor=normalP(i,"withRing", "isPrim");nor;
     
    60876328setring r;
    60886329
    6089 int tt = timer; 
     6330int tt = timer;
    60906331list nor=normal(i,"isPrim");nor;
    60916332timer-tt;
     
    60986339ideal j = x,y;
    60996340ideal i = j*xy;
    6100 equidim(i);           
     6341equidim(i);
    61016342//hat eingebettete Komponente, equidim rechnet wie in Beschreibung (ok)
    6102    
     6343
    61036344ring r  = 19,(x,y),dp;
    61046345   ideal i = x3-y4;                   //delta = 3
    61056346   ideal i = y*x*(x3-y4);             //delta = 11; 0,0,3
    61066347   ideal i = (x2-y3)*(x3-y4);         //delta = 13; 1,3
    6107    ideal i = (x-y)*(x3+y2)*(x3-y4);   //delta = 23; 0,1,3     
     6348   ideal i = (x-y)*(x3+y2)*(x3-y4);   //delta = 23; 0,1,3
    61086349   ideal i = (x-1)*(x3+y2)*(x2-y3);   //delta = 16; 0,1,1
    61096350   ideal i = (x-y^2)^2 - y*x^3;       //delta = 3
    61106351   //singularities at not only at 0, hier rechnet equidim falsch
    61116352
    6112 // -------------------------- General Examples  ---------------------------//Huneke, irred., delta=2 (Version 3-0-4: < 1sec) 
     6353// -------------------------- General Examples  ---------------------------//Huneke, irred., delta=2 (Version 3-0-4: < 1sec)
    61136354//Version 3-0-6 default: 1sec, mit gens 2sec, mit delta 5 sec
    61146355//(prim,noFac):ca 7 Min, prim:ca 10 min(wg facstd)
     
    61286369//normalC: char 2, 31991: 0 sec (isPrim); char 2, equidim: 7 sec
    61296370//norTest(i,nor,2); 1sec
    6130 //normalP char 2: 1sec (isPrim) 
     6371//normalP char 2: 1sec (isPrim)
    61316372//size(norid); size(string(norid));21 1219 interred(norid): 21 1245 (0 sec)
    61326373
    6133 int tt = timer; 
     6374int tt = timer;
    61346375list nor=normalC(i);nor;
    61356376timer-tt;
     
    61386379
    61396380//Vasconcelos irred., delta -1 (dauert laenger)
    6140 //auf macbook pro = 20 sec mit alter Version, 
     6381//auf macbook pro = 20 sec mit alter Version,
    61416382//Sing 3-0-6:
    61426383// Char 32003: "equidim" 30 sec, "noFac": 30sec
     
    61606401//normalP (isPrim) char 2,19: 0sec, char 29: 1sec
    61616402
    6162 //Theo1a, CohenMacaulay regular in codim 2, dim slocus=1, delta=0 
     6403//Theo1a, CohenMacaulay regular in codim 2, dim slocus=1, delta=0
    61636404//normalC: 0 sec, normalP: haegt in K=preimage(R,phi,L);
    61646405ring r=32003,(x,y,z,u),dp;
     
    61846425T(1)^6*T(2)*T(3)+T(1)^2*T(2)^4*T(3)+T(1)^3*T(2)^2*T(4)-T(1)^2*T(2)*T(3)^2+T(4)^2;
    61856426//normalC: char 2,32003: 0  sec (isPrim)
    6186 //normalP (isPrim) char 2: 0sec, char 11 2se, char 19: 13sec 
     6427//normalP (isPrim) char 2: 0sec, char 11 2se, char 19: 13sec
    61876428//norTest 48sec in char11
    61886429//### interred verkuerzt
     
    61976438//Theo4 reducible, delta (0,0,0) -1
    61986439ring r=29,(x,y,z),dp;
    6199 ideal i=(x-y)*(x-z)*(y-z); 
    6200 //normalC: char 2,32003: 0  sec 
     6440ideal i=(x-y)*(x-z)*(y-z);
     6441//normalC: char 2,32003: 0  sec
    62016442//normalP char withRing 2, 29: 0sec, 6sec
    62026443
     
    62046445ring r=32003,(x,y,z),dp;
    62056446ideal i=x2y2+x2z2+y2z2;
    6206 //normalC: char 2,32003: 0  sec 
     6447//normalC: char 2,32003: 0  sec
    62076448//normalP char withRing 2, 29: 0sec, 4sec
    62086449
     
    62266467//alles 0 sec in char 2
    62276468//---------------------------------------------------------
    6228 int tt = timer; 
     6469int tt = timer;
    62296470list nor=normalP(i,"normalC","withRing");nor;
    62306471timer-tt;
    62316472
    6232 //St_S/Y, 3 Komponenten, 2 glatt, 1 normal 
     6473//St_S/Y, 3 Komponenten, 2 glatt, 1 normal
    62336474//charp haengt (in char 20) in K=preimage(R,phi,L);
    62346475//ring r=32003,(b,s,t,u,v,w,x,y,z),dp;
    62356476ring r=11,(b,s,t,u,v,w,x,y,z),dp;
    62366477ideal i=wy-vz,vx-uy,tv-sw,su-bv,tuy-bvz;
    6237 //normalC: char 2,32003: 0  sec 
     6478//normalC: char 2,32003: 0  sec
    62386479//normalP char withRing 2: 1sec, char 11: 40sec
    62396480
     
    62676508sux2y2-bvx2y2+sux2z2-bvx2z2+suy2z2-bvy2z2,
    62686509tux2y3-bvx2y2z+tux2yz2+tuy3z2-bvx2z3-bvy2z3;
    6269 //normalC: char 2,32003: 1 sec 
     6510//normalC: char 2,32003: 1 sec
    62706511//normalP char withRing 2: 1sec, char 11: 40sec
    62716512
    62726513//---------------------------------------------------------
    62736514//genus:
    6274 int tt = timer; 
     6515int tt = timer;
    62756516list nor=normal(i, "noFac");nor;
    62766517timer-tt;
    62776518
    6278 //Yoshihiko Sakai, irred, 0sec, delta = 8 
     6519//Yoshihiko Sakai, irred, 0sec, delta = 8
    62796520ring r=0,(x,y),dp;                    //genus 0 4 nodes and 6 cusps im P2
    62806521//ring r=7,(x,y),dp;                  //charp haengt in K = preimage(Q,phi,L)
     
    63066547//Rob Koelman
    63076548//ring r=0,(x,y,z),dp;      //dim sing = 1 (nach ca 15 min abgebrochen)
    6308 ring r=32003,(x,y,z),dp;   
     6549ring r=32003,(x,y,z),dp;
    63096550ideal i=
    63106551761328152*x^6*z^4-5431439286*x^2*y^8+2494*x^2*z^8+228715574724*x^6*y^4+
     
    63146555 506101284*x^2*z^2*y^6+47970216*x^2*z^4*y^4+660492*x^2*z^6*y^2-
    63156556 z^10-474*z^8*y^2-84366*z^6*y^4;
    6316 //normalC char 32003: 10 sec, char 0 : 
     6557//normalC char 32003: 10 sec, char 0 :
    63176558
    63186559//ring r=0,(x,y),dp;//genus 10  with 26 cusps (nach ca 4 min abgebrochen)
     
    63536594//Probleme mit normalC in char 2 und char 0
    63546595
    6355 int tt = timer; 
     6596int tt = timer;
    63566597list nor=normalC(i,"withRing");nor;
    63576598timer-tt;
     
    63656606ring r=2,(x,y),dp;  //genus 35
    63666607ideal i=y30+y13x+x4y5+x3*(x+1)^2;
    6367 //char 0 abgebrochen bei list SM = mstd(i); ### 
     6608//char 0 abgebrochen bei list SM = mstd(i); ###
    63686609//char 2 nach ca 30 min
    6369 //normalC: char 2: abgebr. bei list SM = mstd(i);  //Now the work starts' 
     6610//normalC: char 2: abgebr. bei list SM = mstd(i);  //Now the work starts'
    63706611//normalC, withGens, char 2: abgebrochen bei Q=mstd(Q)[2];
    6371 //normalP char 2 withRing: 0sec 
     6612//normalP char 2 withRing: 0sec
    63726613
    63736614ring r=0,(x,y),dp;   //irred, genus 55, delta 21
     
    63966637
    63976638//ring r=0,(x,y),dp;
    6398 ring r=32003,(x,y),dp; 
    6399 ideal i= 
    6400 x30y21+21x29y20+210x28y19+10x27y19+1330x27y18+190x26y18+5985x26y17 
    6401 +1710x25y17+20349x25y16+45x24y17+9690x24y16+54264x24y15+765x23y16 
    6402 +38760x23y15+116280x23y14+6120x22y15+116280x22y14+120x21y15 
    6403 +203490x22y13+30600x21y14+271320x21y13+1799x20y14+293930x21y12+107100x20y13 
    6404 +503880x20y12+12586x19y13+352716x20y11+278460x19y12+210x18y13+755820x19y11 
    6405 +54509x18y12+352716x19y10+556920x18y11+2723x17y12+923780x18y10+163436x17y11 
    6406 +293930x18y9+875160x17y10+16296x16y11+923780x17y9+359359x16y10+252x15y11 
    6407 +203490x17y8+1093950x16y9+59598x15y10+755820x16y8+598598x15y9+2751x14y10 
    6408 +116280x16y7+1093950x15y8+148610x14y9+503880x15y7+769197x14y8+13650x13y9 
    6409 +54264x15y6+875160x14y7+266805x13y8+210x12y9+271320x14y6+768768x13y7 
    6410 +40635x12y8+20349x14y5+556920x13y6+354816x12y7+1855x11y8+116280x13y5 
     6639ring r=32003,(x,y),dp;
     6640ideal i=
     6641x30y21+21x29y20+210x28y19+10x27y19+1330x27y18+190x26y18+5985x26y17
     6642+1710x25y17+20349x25y16+45x24y17+9690x24y16+54264x24y15+765x23y16
     6643+38760x23y15+116280x23y14+6120x22y15+116280x22y14+120x21y15
     6644+203490x22y13+30600x21y14+271320x21y13+1799x20y14+293930x21y12+107100x20y13
     6645+503880x20y12+12586x19y13+352716x20y11+278460x19y12+210x18y13+755820x19y11
     6646+54509x18y12+352716x19y10+556920x18y11+2723x17y12+923780x18y10+163436x17y11
     6647+293930x18y9+875160x17y10+16296x16y11+923780x17y9+359359x16y10+252x15y11
     6648+203490x17y8+1093950x16y9+59598x15y10+755820x16y8+598598x15y9+2751x14y10
     6649+116280x16y7+1093950x15y8+148610x14y9+503880x15y7+769197x14y8+13650x13y9
     6650+54264x15y6+875160x14y7+266805x13y8+210x12y9+271320x14y6+768768x13y7
     6651+40635x12y8+20349x14y5+556920x13y6+354816x12y7+1855x11y8+116280x13y5
    64116652+597597x12y6+80640x11y7+5985x13y4+278460x12y5+353892x11y6+7280x10y7+38760x12y4
    6412 +358358x11y5+112014x10y6+120x9y7+1330x12y3+107100x11y4+264726x10y5+16660x9y6 
    6413 +9690x11y3+162799x10y4+111132x9y5+805x8y6+210x11y2+30600x10y3+146685x9y4 
    6414 +24500x8y5+1710x10y2+54236x9y3+78750x8y4+2310x7y5+21x10y+6120x9y2+58520x8y3 
    6415 +24010x7y4+45x6y5+190x9y+12509x8y2+39060x7y3+3675x6y4+x9+765x8y+15918x7y2 
    6416 +15680x6y3+204x5y4+10x8+1786x7y+12915x6y2+3500x5y3+45x7+2646x6y+6580x5y2 
    6417 +366x4y3+119x6+2562x5y+1995x4y2+10x3y3+203x5+1610x4y+324x3y2+231x4+630x3y 
    6418 +23x2y2+175x3+141x2y+85x2+16xy+24x+y+4; 
    6419 list nor = normal(i);   
     6653+358358x11y5+112014x10y6+120x9y7+1330x12y3+107100x11y4+264726x10y5+16660x9y6
     6654+9690x11y3+162799x10y4+111132x9y5+805x8y6+210x11y2+30600x10y3+146685x9y4
     6655+24500x8y5+1710x10y2+54236x9y3+78750x8y4+2310x7y5+21x10y+6120x9y2+58520x8y3
     6656+24010x7y4+45x6y5+190x9y+12509x8y2+39060x7y3+3675x6y4+x9+765x8y+15918x7y2
     6657+15680x6y3+204x5y4+10x8+1786x7y+12915x6y2+3500x5y3+45x7+2646x6y+6580x5y2
     6658+366x4y3+119x6+2562x5y+1995x4y2+10x3y3+203x5+1610x4y+324x3y2+231x4+630x3y
     6659+23x2y2+175x3+141x2y+85x2+16xy+24x+y+4;
     6660list nor = normal(i);
    64206661//normalC: char 0: ### hŠngt in SB of singular locus JM = mstd(J);
    64216662//normalC: char 32003,"noFac","equidim": 0sec, "noFac": 1sec
     
    64246665                  //### ist das noetig?
    64256666
    6426 //Singular rechnet genus richtig, auch im Fall, dass Kurve irreduzibel, 
     6667//Singular rechnet genus richtig, auch im Fall, dass Kurve irreduzibel,
    64276668//aber nicht absolut irreduzibel ist:
    64286669ring r = 0,(x,y),dp;
Note: See TracChangeset for help on using the changeset viewer.