Changeset 82716e in git


Ignore:
Timestamp:
May 14, 1998, 8:45:19 PM (26 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
68e324ca946be87c2ab75edd4cc0fd161e1f6ead
Parents:
30c91fe3835d6ff4504cc9ddeeb5866465754c2a
Message:
*hannes: typos in the info-help-string


git-svn-id: file:///usr/local/Singular/svn/trunk@1773 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
Singular/LIB
Files:
21 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/all.lib

    r30c91f r82716e  
    1 // $Id: all.lib,v 1.10 1998-05-14 18:26:51 Singular Exp $
     1// $Id: all.lib,v 1.11 1998-05-14 18:44:54 Singular Exp $
    22///////////////////////////////////////////////////////////////////////////////
    33
    4 version="$Id: all.lib,v 1.10 1998-05-14 18:26:51 Singular Exp $";
     4version="$Id: all.lib,v 1.11 1998-05-14 18:44:54 Singular Exp $";
    55info="
    66LIBRARY:  all.lib   Load all libraries
    7          
    8   classify.lib  PROCEDURES FOR THE ARNOLD-CLASSIFIER OF SINGULARITIES 
     7
     8  classify.lib  PROCEDURES FOR THE ARNOLD-CLASSIFIER OF SINGULARITIES
    99  deform.lib    PROCEDURES FOR COMPUTING MINIVERSAL DEFORMATION
    1010  elim.lib      PROCEDURES FOR ELIMINATION, SATURATION AND BLOWING UP
     
    1515  graphics.lib  PROCEDURES TO DRAW WITH MATHEMATICA
    1616  hnoether.lib  PROCEDURES FOR THE HAMBURGER-NOETHER-DEVELOPMENT
    17   homolog.lib   PROCEDURES FOR HOMOLOGICAL ALGEBRA 
     17  homolog.lib   PROCEDURES FOR HOMOLOGICAL ALGEBRA
    1818  inout.lib     PROCEDURES FOR MANIPULATING IN- AND OUTPUT
    1919  invar.lib     PROCEDURES FOR COMPUTING INVARIANTS OF (C,+)-ACTIONS
    2020  matrix.lib    PROCEDURES FOR MATRIX OPERATIONS
    2121  normal.lib    PROCEDURES FOR COMPUTING THE NORMALIZATION
    22   poly.lib      PROCEDURES FOR MANIPULATING POLYS, IDEALS, MODULES       
     22  poly.lib      PROCEDURES FOR MANIPULATING POLYS, IDEALS, MODULES
    2323  presolve.lib  PROCEDURES FOR PRE-SOLVING POLYNOMIAL EQUATIONS
    2424  primdec.lib   PROCEDURES FOR PRIMARY DECOMPOSITION
  • Singular/LIB/classify.lib

    r30c91f r82716e  
    1 // $Id: classify.lib,v 1.24 1998-05-14 12:49:29 krueger Exp $
    2 ///////////////////////////////////////////////////////////////////////////////
    3 
    4 version  =       "$Id: classify.lib,v 1.24 1998-05-14 12:49:29 krueger Exp $";
     1// $Id: classify.lib,v 1.25 1998-05-14 18:44:55 Singular Exp $
     2///////////////////////////////////////////////////////////////////////////////
     3
     4version  = "$Id: classify.lib,v 1.25 1998-05-14 18:44:55 Singular Exp $";
    55info="
    6 LIBRARY:  classify.lib  PROCEDURES FOR THE ARNOLD-CLASSIFIER OF SINGULARITIES 
     6LIBRARY:  classify.lib  PROCEDURES FOR THE ARNOLD-CLASSIFIER OF SINGULARITIES
    77
    88   A library for classifying isolated hypersurface singularities w.r.t. right
     
    1313basicinvariants(f);  computes Milnor number, determinacy-bound and corank of f
    1414classify(f);         normal form of poly f determined with Arnold's method
    15 corank(f);           computes the corank of f (i.e. of the Hessian of f) 
    16 Hcode(v);            coding of intvec v acoording to the number repetitions 
    17 init_debug([n]);     print trace and debugging information depending on int n 
    18 internalfunctions(); display names of internal procedures of this library 
     15corank(f);           computes the corank of f (i.e. of the Hessian of f)
     16Hcode(v);            coding of intvec v acoording to the number repetitions
     17init_debug([n]);     print trace and debugging information depending on int n
     18internalfunctions(); display names of internal procedures of this library
    1919milnorcode(f[,e]);   Hilbert poly of [e-th] Milnor algebra coded with Hcode
    2020morsesplit(f);       residual part of f after applying the splitting lemma
     
    5454"USAGE:    classify(f);  f=poly
    5555COMPUTE:  normal form and singularity type of f with respect to right
    56           equivalence, as given in the book \"Singularities of 
     56          equivalence, as given in the book \"Singularities of
    5757          differentiables maps, Volume I\" by V.I. Arnold, S.M. Gusein-Zade,
    5858          A.N. Varchenko
     
    6363          Updates can be found under:
    6464          URL=http://www.mathematik.uni-kl.de/~krueger/Singular/
    65 NOTE:     type init_debug(n); (0 <= n <= 10) in order to get intermediate 
     65NOTE:     type init_debug(n); (0 <= n <= 10) in order to get intermediate
    6666          information, higher values of n give more information.
    6767          The proc creates several global objects with names all starting
    68           with @, hence there should be no name conflicts 
     68          with @, hence there should be no name conflicts
    6969EXAMPLE:  example classify; shows an example"
    7070{
     
    7474  string s2;
    7575  list   v;
    76   def ring_ext = basering; 
     76  def ring_ext = basering;
    7777
    7878  init_debug();                    // initialize trace/debug mode
     
    9696
    9797//---------------- collect results and create return-value --------------------
    98   if( s2=="error!" || s2=="NoClass") { 
     98  if( s2=="error!" || s2=="NoClass") {
    9999      setring ring_ext;
    100100      return(f_in);
     
    125125static
    126126proc Klassifiziere (poly f)
    127 { 
     127{
    128128//--------------------------- initialisation ----------------------------------
    129129    string s1;
     
    131131    list   v, cstn;
    132132    map    PhiG;
    133     def ring_top = basering; 
     133    def ring_top = basering;
    134134
    135135    n = nvars(basering);    // Zahl der Variablen des aktuellen Rings.
    136136    PhiG = ring_top, maxideal(1);
    137137    cstn[4] = PhiG;
    138     if( defined(@ringdisplay) == 0) { 
     138    if( defined(@ringdisplay) == 0) {
    139139      string @ringdisplay;               // Define always 'ringdisplay' to be
    140140      export @ringdisplay;               // able to run 'Show(f)'
     
    147147
    148148//---------------------- compute basciinvariants ------------------------------
    149     if(jet(f,0) != 0 ) { 
     149    if(jet(f,0) != 0 ) {
    150150      cstn[1] = corank(f); cstn[2]=-1; cstn[3]=1;
    151151      return(printresult(1, f, "a unit", cstn, -1));
     
    162162    cstn[3] = K;
    163163
    164     if( Mu == 0) { 
     164    if( Mu == 0) {
    165165      cstn[1]=1; cstn[3]=1;
    166166      return(printresult(1, f, "A[0]", cstn, 0)); }
     
    175175    v = HKclass(milnorcode(f));
    176176    if(v[2]>0) { debug_log(0, "Guessing type via Milnorcode: ", v[1]);}
    177     else { 
     177    else {
    178178      debug_log(0, "Hilbert polynomial not recognised. Milnor code = ",
    179179                milnorcode(f));
     
    183183
    184184//------------ step 1, classification according to corank(f) ------------------
    185     if(corank_f == 0) { 
     185    if(corank_f == 0) {
    186186       return(printresult(2, f, "A["+string(Mu)+"]", cstn, 0)); }
    187     if(corank_f == 1) { 
     187    if(corank_f == 1) {
    188188       return(printresult(2, f, "A["+string(Mu)+"]", cstn, 0)); }
    189189    cstn[4] = 0;
     
    204204   string s1;
    205205   list   v_res, v_class, v, iv;
    206  
     206
    207207   corank = cstn[1];
    208208   K = cstn[3];
     
    211211//-------------------- apply morsesplit if n>corank ---------------------------
    212212   if( n > corank) {
    213      debug_log(0, 
     213     debug_log(0,
    214214      "I have to apply the splitting lemma. This will take some time....:-)");
    215215     v_res = Morse(f, K, corank, 0);
     
    223223     if(defined(RingB) != 0 ) { kill RingB; }
    224224     ring ring_rest=char(basering),(x(1..corank)),(c,ds);
    225  
     225
    226226     map MapReduce=ring_top,maxideal(1);
    227227     poly G = MapReduce(g);
    228228     map PhiG=ring_top,maxideal(1);// Konstruiere Id auf r
    229229     PhiG = MapReduce(PhiG);
    230  
     230
    231231     execute("ring RingB="+charstr(basering)+",("+A_Z("x",corank)+"),(c,ds);");
    232232     export RingB;
    233233     setring ring_rest;
    234234   }
    235    else { 
     235   else {
    236236     ring ring_rest=char(basering),(x(1..corank)),(c,ds);
    237237     map  PhiG=ring_top,maxideal(1);
    238238     poly G = PhiG(f);
    239239   }
    240  
     240
    241241//--------------------- step 1 of Arnold now finished -------------------------
    242242    map phi = ring_rest,maxideal(1);
     
    263263static
    264264proc Funktion3 (poly f, list cstn)
    265 { 
     265{
    266266//---------------------------- initialisation ---------------------------------
    267267    poly f3 = jet(f, 3);
     
    282282      if( Mult == 1) { return(printresult(5,f,"D["+string(Mu)+"]", cstn, 0)); }
    283283      if( Mult == 2) { return(Funktion6(f, cstn));}         // series E,J
    284       debug_log(0, "dimension 1 und deg != 1, 2 => error, ", 
     284      debug_log(0, "dimension 1 und deg != 1, 2 => error, ",
    285285                        "this should never occur");
    286286      return(printresult(3, f, "error!", cstn, -1));
     
    351351        if(Dim==0) { return(printresult(11,f,"J["+string(k)+",0]",cstn,k-1)); }
    352352        Mult = mult(Jf);
    353         if( Dim ==1  && Mult==1) { 
     353        if( Dim ==1  && Mult==1) {
    354354          return(printresult(12,f,"J["+string(k)+","+string(Mu - 6*k +2)+"]",
    355355                 cstn, k-1));
     
    373373static
    374374proc Funktion13 (poly f, list cstn)
    375 { 
     375{
    376376//---------------------------- initialisation ---------------------------------
    377377    poly f4;
     
    391391    Mult = mult(Jf);
    392392    if( Dim == 1) {
    393       if( Mult == 1 ) { 
    394         return(printresult(15, f, 
     393      if( Mult == 1 ) {
     394        return(printresult(15, f,
    395395              "X[1,"+string(Mu-9)+"] = T[2,4,"+string(Mu-5)+"]", cstn, 1));
    396396      }
     
    403403      }
    404404      if( Mult == 3 ) { return(Funktion25(f, cstn)); }
    405     } 
     405    }
    406406    // Should never reach this line
    407407    return(printresult(13, f, "error!", cstn, -1));
     
    441441      JetId = x(1)^3*x(2) + x(2)^(3*p+2);     // check jet x3y,y3k+2  : Z[6p+5]
    442442      fk = jet(f, 3*(3*p+2), weight(JetId));
    443       if( Coeff(fk, x(2), x(2)^(3*p+2)) != 0) { 
     443      if( Coeff(fk, x(2), x(2)^(3*p+2)) != 0) {
    444444        return(printresult(19,f, "Z["+string(6*p+5)+"]", cstn, p));
    445445      }
     
    447447      JetId = x(1)^3*x(2)+x(1)*x(2)^(2*p+2);  // check jet x3y,xy2k+2 : Z[6p+6]
    448448      fk = jet(f, 2*(3*p+2)+1, weight(JetId));
    449       if( Coeff(fk, x(1)*x(2), x(1)*x(2)^(2*p+2)) != 0) { 
     449      if( Coeff(fk, x(1)*x(2), x(1)*x(2)^(2*p+2)) != 0) {
    450450        return(printresult(20, f, "Z["+string(6*p+6)+"]", cstn, p));
    451451      }
     
    466466      Mult = mult(Jf);
    467467      if(Dim==0) { return(printresult(23,f,"Z["+string(p-1)+",0]", cstn, p)); }
    468       if( Mult == 1 ) { 
    469          return(printresult(24, f, "Z["+string(p-1)+","+string(Mu-3-6*p)+"]", 
     468      if( Mult == 1 ) {
     469         return(printresult(24, f, "Z["+string(p-1)+","+string(Mu-3-6*p)+"]",
    470470                cstn, p));
    471471      }
     
    518518      JetId = x(1)^4 + x(2)^(4*k+2);
    519519      fk    = jet(f, 2*(4*k+2), weight(JetId));
    520       if( Coeff(fk, x(2), x(2)^(4*k+2)) != 0) { 
     520      if( Coeff(fk, x(2), x(2)^(4*k+2)) != 0) {
    521521        Jf  = std(jacob(fk));
    522522        Dim = dim(Jf);
    523523        if(Dim==0) {return(printresult(30,f,"W["+string(k)+",0]",cstn,3*k-1));}
    524         if(Dim==1) { 
    525            return(printresult(32, f, 
     524        if(Dim==1) {
     525           return(printresult(32, f,
    526526                  "W#["+string(k)+","+string(Mu-12*k-2)+"]", cstn, 3*k-1));
    527527        }
     
    533533        Jf  = std(jacob(ft));
    534534        Dim = dim(Jf);
    535         if( Dim == 0 ) { 
     535        if( Dim == 0 ) {
    536536           return(printresult(31, f, "W["+string(k)+","+string(Mu-12*k-3)+"]",
    537537                  cstn, 3*k-1));
     
    560560        Mult  = mult(Jf);
    561561        if(Dim==0) {return(printresult(37,f,"X["+string(k)+",0]",cstn,3*k-1));}
    562         if(Dim==1) { 
    563           if(Mult==1) { 
     562        if(Dim==1) {
     563          if(Mult==1) {
    564564             return(printresult(38, f,"X["+string(k)+","+string(Mu-12*k+3)+"]",
    565565                    cstn, 3*k-1));
    566566          }
    567           if(Mult==2) { 
     567          if(Mult==2) {
    568568            ft  = Teile(fk, x(1)^2);
    569569            Jf  = std(jacob(ft));
     
    574574            }
    575575          }
    576           if(Mult!=3) { 
     576          if(Mult!=3) {
    577577            return(printresult(36, f, "error!", cstn, -1)); }
    578578        }
     
    618618    r   = kr-k;
    619619    setring ring_top;
    620     if( Typ == "E[6k]" ) { 
    621        return(printresult(42, f, "Z["+string(k)+","+string(12*k+6*r-1)+"]", 
     620    if( Typ == "E[6k]" ) {
     621       return(printresult(42, f, "Z["+string(k)+","+string(12*k+6*r-1)+"]",
    622622              cstn, 3*k+r-2));
    623623    }
    624     if( Typ == "E[6k+1]" ) { 
     624    if( Typ == "E[6k+1]" ) {
    625625       return(printresult(43, f, "Z["+string(k)+","+string(12*k+6*r)+"]",
    626626              cstn, 3*k+r-2));
     
    645645static
    646646proc Funktion50 (poly f, list cstn)
    647 { 
     647{
    648648//---------------------------- initialisation ---------------------------------
    649649    poly  f3;
     
    655655    if( f3 == 0 ) { return(printresult(104, f, "NoClass", cstn, -1)); }
    656656
    657     // f3 ~ 
     657    // f3 ~
    658658    Jf1  = jacob(f3);
    659659    Jf   = std(Jf1);
     
    662662    Mu   = cstn[2];
    663663
    664     if(Dim == 0) { 
     664    if(Dim == 0) {
    665665       return(printresult(51, f, "P[8] = T[3,3,3]", cstn, 1));
    666666    } // x3 + y3 + z3 + axyz
    667     if(Dim == 1) { 
     667    if(Dim == 1) {
    668668      if (Mult == 1) {
    669669        return(printresult(52, f,"P["+string(Mu)+"] = T[3,3,"+string(Mu-5)+"]",
     
    725725    M    = J1;
    726726    J2   = minor(M, 2), S;
    727  
     727
    728728    //------------------ determine coordinate named 'x' -----------------------
    729729    S  = sat(J2, maxideal(1))[1];
     
    741741    debug_log(6, "f3,s1=", Show(f3));
    742742    if( b1 != 0) {
    743       VERT=ring_top,-1*b1*x(1), -1*b2*x(1)+x(2), -1*b3*x(1) + x(3); 
     743      VERT=ring_top,-1*b1*x(1), -1*b2*x(1)+x(2), -1*b3*x(1) + x(3);
    744744      kx=1; ky=2; kz=3;
    745745    }
     
    765765    //---------------- compute f_2 such that j3f = xf_2+f_3 -------------------
    766766    debug_log(6, "1) x=", kx, "  y=", ky, "  z=", kz );
    767     matrix C = Coeffs(f3, x(kx)); 
     767    matrix C = Coeffs(f3, x(kx));
    768768    fb=C[2,1];  // Coeff von x^1
    769769    fc=C[1,1];  // Coeff von x^0
     
    776776        b = Coeff(Relation, x(kz), x(kz));
    777777        B[rvar(x(ky))] = x(ky)-b*x(kz);
    778       } 
     778      }
    779779      else {
    780780        Jfsyz = fb, diff(fb, x(kz));
     
    791791      f3 = jet(f,3);
    792792      kill Mat;
    793     } 
     793    }
    794794    else { ky,kz = swap(ky,kz); }
    795795
    796796    //------- compute tschirnhaus for 'z' and get f3=f_1(x,y,z)y^2+z^3 --------
    797     C    = Coeffs(f3, x(kx)); 
     797    C    = Coeffs(f3, x(kx));
    798798    fb   = C[2,1];  // Coeff von x^1
    799799    fc   = C[1,1];  // Coeff von x^0
     
    804804    cstn[4] = PhiG;
    805805    f3 = jet(f,3);
    806  
     806
    807807    //------------------- compute f_1 and get f3=xy^2+z^3 ---------------------
    808808    fb = (f3 - 1*(Coeffs(f3, x(kz))[4,1])*x(kz)^3)/(x(ky)^2);
     
    820820
    821821    //--------------------- permutation of x,y,z  -----------------------------
    822     if(Coeffs(f3, x(1))[4,1]!=0) { 
     822    if(Coeffs(f3, x(1))[4,1]!=0) {
    823823      kx=1;
    824824      if(Coeffs(f3, x(2))[3,1]==0) { ky=2; kz=3; }
     
    826826    }
    827827    else {
    828       if(Coeffs(f3, x(2))[4,1]!=0) { 
     828      if(Coeffs(f3, x(2))[4,1]!=0) {
    829829        kx=2;
    830830        if(Coeffs(f3, x(3))[3,1]==0) { ky=3; kz=1; }
    831831        else { ky=1; kz=3; }
    832832      }
    833       else { 
     833      else {
    834834        kx=3;
    835835        if(Coeffs(f3, x(1))[3,1]==0) { ky=1; kz=2; }
     
    902902      Mult  = mult(JetId);
    903903      if(Dim==0) { return(printresult(64, f, "Q["+string(p)+",0]", cstn, p)); }
    904       if(Dim==1) { 
     904      if(Dim==1) {
    905905        if(Mult == 1) {
    906906           return(printresult(65, f, "Q["+string(p)+","+string(Mu-(6*p+2))+"]",
    907907                  cstn, p));
    908908        }
    909         if(Mult == 2) { 
     909        if(Mult == 2) {
    910910          fk    = jet(fr, 3*w[1], w);
    911911          f_tmp = Coeffs(phi, x(1))[4,1] *x(1)^3+fk;
     
    10131013
    10141014//------------ find coordinatechange for f3 ~ x3+xz2, if possible  ------------
    1015     matrix C = coeffs(f3, x(kx)); 
     1015    matrix C = coeffs(f3, x(kx));
    10161016    if(size(C) == 3) { C = coeffs(f3, x(kz)); kx,kz=swap(kx, kz); }
    10171017    if(C[1,1] == 0 && C[3,1] == 0) { Fall = 1; }
     
    10231023      VERT=ring_top,x(kx),x(ky),x(kz);
    10241024    }
    1025     if(Fall == 2) { 
     1025    if(Fall == 2) {
    10261026       v = tschirnhaus(f3/x(kz), x(kx));
    10271027       b1, VERT = [1..2];
    10281028    }
    1029     if(Fall == 3) { 
     1029    if(Fall == 3) {
    10301030      v = tschirnhaus(f3/x(kx), x(kx));
    10311031      b1, VERT = [1..2];
     
    10411041
    10421042//------------- if f3 ~ x3+xz2 then continue with classification  -------------
    1043     C = coeffs(f3, x(1)); 
    1044     if( C[1,1] == 0 && C[2,1] != 0 && C[3,1] == 0 && C[4,1] != 0 ) { 
     1043    C = coeffs(f3, x(1));
     1044    if( C[1,1] == 0 && C[2,1] != 0 && C[3,1] == 0 && C[4,1] != 0 ) {
    10451045      return(Funktion83(f, cstn));
    10461046    }
     
    11551155      if ( Dim == 1 ) {
    11561156        if ( Mult == 4 ) {
    1157           if( fk - phi != 0) { // b!=0  und/oder b'!=0 
     1157          if( fk - phi != 0) { // b!=0  und/oder b'!=0
    11581158            if( Coeff(fk,x(1)*x(2), x(1)^2*x(2)^k) == 0 ) { // b=0 und b'!=0
    11591159              a    = (fk - Coeff(fk, x(1), x(1)^3)*x(1)^3) / x(1);
    11601160              v    = Isomorphie_s82_z(f, a, k);
    1161             } 
     1161            }
    11621162            else {
    1163               if( Coeff(fk,x(1)*x(2)*x(3), x(1)*x(2)^k*x(3)) == 0 ){ 
     1163              if( Coeff(fk,x(1)*x(2)*x(3), x(1)*x(2)^k*x(3)) == 0 ){
    11641164                        // b!=0 und b'=0
    11651165                a    = subst(fk, x(3), 0);
     
    12481248      b = Coeff(l2, x(ky), x(ky));
    12491249      if( b== 0) { ky, kz = swap(ky, kz); }
    1250  
     1250
    12511251      // Koordinaten-Transf. s.d. f=x2y
    12521252      b  = Coeff(l2, x(ky), x(ky));
     
    12601260      PhiG = VERT(PhiG);
    12611261      cstn[4] = PhiG;
    1262     } 
     1262    }
    12631263
    12641264//------------------------------- step 98 ---------------------------------
     
    13011301    Phi  = ring_top, B;
    13021302    v[1] = f;
    1303     if ( EH(b) != 0)    // pruefe ob der Koeff von x_i^hc 
     1303    if ( EH(b) != 0)    // pruefe ob der Koeff von x_i^hc
    13041304    { B[rvar(x)] = x -1*(cf[hc,1]/(hc*b));
    13051305      v[1] = Phi(f);
     
    13411341      d = Coeff(fk, x(1)*x(2), x(1)*x(2)^3);
    13421342
    1343       if( (a != 0) && (b != 0) ) { 
     1343      if( (a != 0) && (b != 0) ) {
    13441344        B = -int(Coeff(Matx[1,1], x(2), x(2)));
    13451345        C = -int(Coeff(Maty[1,1], x(1), x(1)));
     
    14021402        f    = VERT(f);
    14031403        PhiG = VERT(PhiG);
    1404       } 
     1404      }
    14051405      else {  //      "Weder b noch a sind 0";
    14061406        if(ct > 5) { v[1]=f; v[2]=PhiG; return(v); }
     
    14081408        return(Isomorphie_s17(f, fk, k, ct+1, PhiG));
    14091409      }
    1410     } 
     1410    }
    14111411    else {  // k >1
    14121412      a     = fk/x(2);
     
    14681468
    14691469    s = s +"' has 4-jet equal to zero. (F47), mu="+string(Mu);
    1470  
     1470
    14711471    s; // +"  ("+SG_Typ+")";
    14721472    return(Show(f), tp, corank);
     
    15761576static
    15771577proc Morse(poly f, int K, int corank, int ShowPhi)
    1578 { 
     1578{
    15791579//---------------------------- initialisation ---------------------------------
    15801580    poly   fc, f2, a, P, Beta, fi;
     
    15911591
    15921592    def ring_top=basering;
    1593  
     1593
    15941594    debug_log(3, "Spalte folgendes Polynom mit Bestimmtheit: ", string(K));
    15951595    debug_log(3, Show(fi));
    1596  
     1596
    15971597    for( j=1; j<=n ; j++) { Abb[j] = 0; }
    1598  
     1598
    15991599    RFlg = GetRf(fi, n);
    16001600    debug_log(2, "Reihenfolge fuer Vertauschungen:", RFlg );
    16011601    PhiG=ring_top,maxideal(1);
    1602  
     1602
    16031603//----------------- find quadratic term, if there is only one -----------------
    16041604    B = maxideal(1);
     
    16261626      }
    16271627      Phi  =ring_top,B;
    1628       fi   = Phi(fi);   
     1628      fi   = Phi(fi);
    16291629      PhiG = Phi(PhiG);
    16301630    }
    16311631    if( ShowPhi > 1) { PhiG; }
    1632  
     1632
    16331633//------------------------ compute spliting lemma -----------------------------
    16341634    fc = fi;
     
    16471647          a = Coeff(jet(fc,2), x(RFlg[i]), x(RFlg[i])^2);
    16481648          debug_log(6,"Koeffizient von x(" + string(RFlg[i]) + ")^2 ist:", a);
    1649           if( (a != 0) || (i==n) ) { 
     1649          if( (a != 0) || (i==n) ) {
    16501650            debug_log(6, "BREAK!!!!!!!!!!!!!!");
    16511651            break;
     
    16611661          j   = j + 1;
    16621662        }               // Ende while( (j<=n) || (i==n) )
    1663  
     1663
    16641664        debug_log(6, "Moegliche Verschiebung fertig!");
    16651665        PhiG = Phi(PhiG);
    16661666        if( ShowPhi > 1) { "NachVersch.:"; Phi; }
    1667  
     1667
    16681668        if( (j<=n) || (i==n)) {
    16691669          P = Coeff(fc, x(RFlg[i]), x(RFlg[i]));
     
    16931693        }               // Ende if( (j<=n) || (i==n))
    16941694      }                 // Ende if( (f2 - subst(f2, x(RFlg[i]), 0)) != 0 )
    1695  
     1695
    16961696      fi = fc;
    16971697      i  = i + 1;
     
    16991699    }
    17001700    debug_log(6, "Ende  ---------------------------------------------------");
    1701  
     1701
    17021702//--------------------------- collect results ---------------------------------
    17031703    if( ShowPhi > 0 ) {
     
    17081708      "fi     = " + Show(fi);
    17091709    }
    1710  
     1710
    17111711    Rang = 0;
    17121712    B    = maxideal(1);
     
    17241724static
    17251725proc Coeff(poly f, list #)
    1726 { 
     1726{
    17271727//---------------------------- initialisation ---------------------------------
    17281728  poly   a, term;
     
    17621762  for( i=1; i<=n; i=i+1)
    17631763  { result = subst(f,x(i), 0) - f;
    1764     if( result != 0 ) { B[rvar(x(i))] = x(Ctv); Ctv++; } 
     1764    if( result != 0 ) { B[rvar(x(i))] = x(Ctv); Ctv++; }
    17651765    else { B[rvar(x(i))] = x(Ctn); Ctn--; }
    17661766  }
     
    17871787  // check basic condition on the basering.
    17881788  if(checkring()) { return(f); }
    1789   if( f==0 ) { 
     1789  if( f==0 ) {
    17901790    "Normal form : 0";
    17911791    return(f);
    17921792  }
    1793   if( jet(f,0)!=0 ) { 
     1793  if( jet(f,0)!=0 ) {
    17941794    "Normal form : 1";
    17951795    return(f);
     
    18111811    return();
    18121812  }
    1813   if(cnt==1) { 
     1813  if(cnt==1) {
    18141814    debug_log(1,"Getting normal form from database.");
    18151815    "normal form :",A_L(Typ);
     
    18411841  ideal jf=std(jacob(f)^e);
    18421842  intvec v=hilb(jf,2);
    1843  
     1843
    18441844  return(Hcode(v));
    18451845}
     
    18991899static
    19001900proc Cubic (poly f)
    1901 { 
     1901{
    19021902//---------------------------- initialisation ---------------------------------
    19031903  poly  f3;
     
    19151915
    19161916  if(Dim == 0) { return("P[8]:smooth cubic"); } // x3 + y3 + z3 + axyz
    1917   if(Dim == 1) { 
     1917  if(Dim == 1) {
    19181918    if(Mult == 2) {
    19191919      Jf2  = wedge(jacob(Jf1),3-Dim), Jf1;
     
    19451945proc parity  (int e)
    19461946"USAGE:    parity()"
    1947 { 
     1947{
    19481948  int r = e/2;
    19491949  if( 2*r == e ) { return(0); }
     
    19591959  string SG_Typ = "";
    19601960  list   v;
    1961  
     1961
    19621962  // if trace/debug mode not set, do it!
    19631963  init_debug();
     
    19751975static
    19761976proc HKclass3 (intvec sg, string SG_Typ, int cnt)
    1977 { 
     1977{
    19781978  list v;
    19791979
     
    19861986static
    19871987proc HKclass3_teil_1 (intvec sg, string SG_Typ, int cnt)
    1988 { 
     1988{
    19891989  int  k, r, s;
    19901990  list v;
     
    19951995    if( parity(sg[2])) { // sg[2] ist ungerade
    19961996      if(sg[2]<=sg[3]) {
    1997         k = (sg[2]+1)/2; 
    1998         if(k>1) { 
     1997        k = (sg[2]+1)/2;
     1998        if(k>1) {
    19991999          cnt++;
    20002000          SG_Typ=SG_Typ+" J[k,r]=J["+string(k)+","+string(sg[3]+1-2*k)+"]";
     
    20232023static
    20242024proc HKclass5 (intvec sg, string SG_Typ, int cnt)
    2025 { 
     2025{
    20262026  list v;
    20272027
     
    20552055        r = sg[5] - sg[4];
    20562056        SG_Typ=SG_Typ +" X[k,r]=X["+string(k)+","+string(r)+"]"; cnt++;
    2057       } 
     2057      }
    20582058      if( (sg[3]==1) && (sg[4]==3) && (sg[5]>=sg[4])){    // Z[1,r]
    20592059        r = sg[5] - sg[4];
     
    20672067            SG_Typ = SG_Typ + " Z[k,r,0]=Z["+string(k)+","+string(r)+",0]";
    20682068          }
    2069         } 
     2069        }
    20702070        else {                                                // Z[k,12k+6r]
    20712071          r = (sg[4] - 2*k)/2; cnt++;
     
    21662166      }
    21672167      if(sg[4]<sg[5]) {                 // Q[k,r]
    2168         k = (sg[4]+2)/2; 
     2168        k = (sg[4]+2)/2;
    21692169        if(k>=2) {
    21702170          r=sg[5]+1-2*k; cnt++;
     
    22162216static
    22172217proc HKclass7 (intvec sg, string SG_Typ, int cnt)
    2218 { 
     2218{
    22192219  list v;
    22202220
     
    22672267///////////////////////////////////////////////////////////////////////////////
    22682268proc singularity(string typ, list #)
    2269 "USAGE:    singularity(t, l); t=string (name of singularity), 
     2269"USAGE:    singularity(t, l); t=string (name of singularity),
    22702270          l=list of integers (index/indices of singularity)
    22712271COMPUTE:  get the Singularity named by type t from the database.
     
    22912291  if(len>=3) { s = #[3]; }
    22922292  else { s = 0; }
    2293   if( k<0 || r<0 || s<0) { 
     2293  if( k<0 || r<0 || s<0) {
    22942294    "Initial condition failed: k>=0; r>=0; s>=0";
    22952295    "k="+string(k)+" r="+string(r)+"   s="+string(s);
     
    23012301  def ring_top=basering;
    23022302
    2303   if(len>=4) { a1 = #[4]; } 
     2303  if(len>=4) { a1 = #[4]; }
    23042304  else { a1=1; }
    2305   if(len>=5) { a2 = #[5]; } 
     2305  if(len>=5) { a2 = #[5]; }
    23062306  else { a2=1; }
    2307   if(len>=6) { a3 = #[6]; } 
     2307  if(len>=6) { a3 = #[6]; }
    23082308  else { a3=1; }
    2309   if(len>=7) { a4 = #[7]; } 
     2309  if(len>=7) { a4 = #[7]; }
    23102310  else { a4=1; }
    23112311
    2312   debug_log(4, "Values: len=", string(len), " k=", string(k), " r=", 
     2312  debug_log(4, "Values: len=", string(len), " k=", string(k), " r=",
    23132313        string(r));
    23142314  if(defined(RingNF) != 0 ) { kill RingNF; }
     
    23402340proc Singularitaet (string typ,int k,int r,int s,poly a,poly b,poly c,poly d)
    23412341{
    2342   list   v; 
     2342  list   v;
    23432343  string DBMPATH=system("getenv","DBMPATH");
    23442344  string DatabasePath, Database, S, Text, Tp;
     
    23532353  link dbmLink=Database;
    23542354  debug_log(2, "Opening Singalarity-database: ", newline, Database);
    2355   Tp = read(dbmLink, typ); 
     2355  Tp = read(dbmLink, typ);
    23562356  debug_log(2,"DBMread(", typ, ")=", Tp, ".");
    23572357  if( Tp != "(null)" && Tp !="" ) {
     
    23612361    execute S;
    23622362    execute read(dbmLink, Key)+";";
    2363     debug_log(1, "Polynom f=", f,  "  crk=", crk, "  Mu=", Mu, 
     2363    debug_log(1, "Polynom f=", f,  "  crk=", crk, "  Mu=", Mu,
    23642364                " MlnCd=", MlnCd);
    23652365    v = f, crk, Mu, MlnCd;
     
    24372437EXAMPLE:  example debug_log; shows an example
    24382438SEE ALSO: init_debug();"
    2439 { 
     2439{
    24402440   int len = size(#);
    24412441//   int printresult = printlevel - level +1;
     
    24452445//   else { dbprint(printresult, #[1..len]); }
    24462446   if( defined(@DeBug) == 0 ) { init_debug(); }
    2447    if(@DeBug>=level) { 
     2447   if(@DeBug>=level) {
    24482448      if(level>1) { "Debug:("+ string(level)+ "): ", #[1..len]; }
    24492449      else { #[1..len]; }
     
    24582458proc init_debug(list #)
    24592459"USAGE:    init_debug([level]);  level=int
    2460 COMPUTE:  Set the global variable @DeBug to level. The variable @DeBug is 
    2461           used by the function debug_log(level, list of strings) to know 
    2462           when to print the list of strings. init_debug() reports only 
     2460COMPUTE:  Set the global variable @DeBug to level. The variable @DeBug is
     2461          used by the function debug_log(level, list of strings) to know
     2462          when to print the list of strings. init_debug() reports only
    24632463          changes of @DeBug.
    24642464NOTE:     The procedure init_debug(n); is usefull as trace-mode. n may
    24652465          range from 0 to 10, higher values of n give more information.
    24662466EXAMPLE:  example init_debug; shows an example"
    2467 { 
     2467{
    24682468  int newDebug=0;
    24692469  if( defined(@DeBug) != 0 ) { newDebug = @DeBug; }
    24702470
    2471   if( size(#) > 0 ) { 
     2471  if( size(#) > 0 ) {
    24722472    newDebug=#[1];
    24732473  }
     
    24792479    }
    24802480  }
    2481   if( defined(@DeBug) == 0) { 
     2481  if( defined(@DeBug) == 0) {
    24822482    int @DeBug = newDebug;
    24832483    export @DeBug;
     
    25152515RETURN:   intvec: d, mu, c
    25162516EXAMPLE:  example basicinvariants; shows an example"
    2517 { 
     2517{
    25182518  intvec v;
    25192519  ideal Jfs = std(jacob(f));
     
    26152615proc GetRf (poly fi, int n)
    26162616"USAGE:    GetRf();"
    2617 { 
     2617{
    26182618//---------------------------- initialisation ---------------------------------
    26192619  int    j, k, l1, l1w;
     
    26432643static
    26442644proc Show(poly g)
    2645 { 
     2645{
    26462646  string s;
    26472647  def ring_save=basering;
     
    27212721      b = i - 12*k;
    27222722      if( b == 1 ) { s3 = "k"; }
    2723       else { 
     2723      else {
    27242724        if(b==0) { s3 = "12k"+string(b-1); }
    27252725        else { s3 = "12k+"+string(b-1); }
     
    27422742      if(r==0) { s4 = string(0); }
    27432743      if(k==0 && Typ=="Z[") { s3 = string(1); }
    2744       if(Typ[2] == "#") { 
     2744      if(Typ[2] == "#") {
    27452745        i = r+1;
    27462746        r = i/2;
    27472747        b = i - 2*r;
    2748         if( b == 1 ) { s4 = "2r"; } 
     2748        if( b == 1 ) { s4 = "2r"; }
    27492749        else { s4 = "2r-1"; }
    27502750      }
     
    27522752    }  // es kommt mindestens zwei komma vor...
    27532753    //----------------------- get third parameter -----------------------------
    2754     else { 
     2754    else {
    27552755      debug_log(8, "  Number of columns >=2");
    27562756      debug_log(2, "Y[k,r,s] / Z[k,r,s] / T[k,r,s]");
     
    27822782          the singularity given by its name.
    27832783EXAMPLE:  example A_L; shows an example"
    2784 { 
     2784{
    27852785  // if trace/debug mode not set, do it!
    27862786  init_debug();
     
    27942794    return(quickclass(#[1]));
    27952795  }
    2796  
     2796
    27972797}
    27982798example
    27992799{ "EXAMPLE:"; echo=2;
    2800   ring r=0,(a,b,c),ds; 
     2800  ring r=0,(a,b,c),ds;
    28012801  poly f=A_L("E[13]");
    28022802  f;
     
    28092809RETURN:   Arnold's normal form of singularity with name s
    28102810EXAMPLE:  example normalform; shows an example."
    2811 { 
     2811{
    28122812  string Typ;
    28132813  int    k, r, s, crk;
     
    28322832example
    28332833{ "EXAMPLE:"; echo=2;
    2834   ring r=0,(a,b,c),ds; 
     2834  ring r=0,(a,b,c),ds;
    28352835  normalform("E[13]");
    28362836}
    28372837
    28382838///////////////////////////////////////////////////////////////////////////////
    2839 proc swap 
     2839proc swap
    28402840"USAGE:    swap(a,b);
    28412841RETURN:   b,a if b,a is the input (any type)"
    28422842{
    2843   return(#[2],#[1]); 
     2843  return(#[2],#[1]);
    28442844}
    28452845example
  • Singular/LIB/deform.lib

    r30c91f r82716e  
    1 // $Id: deform.lib,v 1.10 1998-05-05 11:55:22 krueger Exp $
     1// $Id: deform.lib,v 1.11 1998-05-14 18:44:57 Singular Exp $
    22// author: Bernd Martin email: martin@math.tu-cottbus.de
    3 //(bm, last modified 4/98)   
    4 ///////////////////////////////////////////////////////////////////////////////
    5 version="$Id: deform.lib,v 1.10 1998-05-05 11:55:22 krueger Exp $";
     3//(bm, last modified 4/98)
     4///////////////////////////////////////////////////////////////////////////////
     5version="$Id: deform.lib,v 1.11 1998-05-14 18:44:57 Singular Exp $";
    66info="
    77LIBRARY:  deform.lib       PROCEDURES FOR COMPUTING MINIVERSAL DEFORMATION
     
    1010 versal(Fo[,d,any])        miniversal deformation of isolated singularity Fo
    1111 mod_versal(Mo,I,[,d,any]) miniversal deformation of module Mo modulo ideal I
    12  lift_kbase(N,M);          lifting N into standard kbase of M 
     12 lift_kbase(N,M);          lifting N into standard kbase of M
    1313 lift_rel_kb(N,M[,kbM,p])  relative lifting N into a kbase of M
    1414 kill_rings([\"prefix\"])    kills the exported rings from above
    15  
     15
    1616  SUB-PROCEDURES            used by main procedure:
    1717                  get_rings,compute_ext,get_inf_def,interact1,
     
    3333COMUPTE: miniversal deformation of Fo up to degree d (default d=100),
    3434CREATE:  Rings (exported):
    35          'my'Px = extending the basering Po by new variables given by \"A,B,..\" 
     35         'my'Px = extending the basering Po by new variables given by \"A,B,..\"
    3636                  (deformation parameters), returns as basering,
    3737                  the new variables come before the old ones,
     
    4040         'my'So = being the embedding-ring of the versal base space,
    4141         'my'Ox = Px/Js extending So/Js.   (default my=\"\")
    42       Matrices (in Px, exported): 
     42      Matrices (in Px, exported):
    4343         Js  = giving the versal base space (obstructions),
    4444         Fs  = giving the versal family of Fo,
     
    4848      Otherwise 'any' gives predefined strings: \"my\",\"param\",\"order\",\"out\"
    4949      (\"my\" prefix-string, \"param\" is a letter (e.g. \"A\")  for the name of
    50       first parameter or (e.g. \"A(\") for index parameter variables, \"order\" 
     50      first parameter or (e.g. \"A(\") for index parameter variables, \"order\"
    5151      ordering string for ring extension), \"out\" name of output-file).
    5252NOTE:   printlevel < 0        no output at all,
    53         printlevel >=0,1,2,.. informs you, what is going on;           
     53        printlevel >=0,1,2,.. informs you, what is going on;
    5454        this proc uses 'execute'.
    5555EXAMPLE:example versal; shows an example
     
    6262  int time = timer;
    6363  intvec @iv,@jv,@is_qh,@degr;
    64   d_max    = 100; 
     64  d_max    = 100;
    6565  @my = ""; @param="A"; @order="ds"; @out="no";
    6666  @size    = size(#);
    6767  if( @size>0 ) { d_max = #[1]; }
    68   if( @size>1 ) 
    69   { if(typeof(#[2])!="string") 
     68  if( @size>1 )
     69  { if(typeof(#[2])!="string")
    7070    { string @active;
    7171      @my,@param,@order,@out = interact1();
     
    8686  int    @rowR= size(Fo);
    8787  def    Po   = basering;
    88 setring  Po; 
     88setring  Po;
    8989  poly   X_s  = product(maxideal(1));
    9090//-------  reproduce T12 ------------------------------------------------------
     
    106106  @t2 = Ls[4];                                 // vdim of T2
    107107  kill Ls;
    108   t1' = @t1; 
    109   if( @t1==0) { dbprint(p,"// rigit!"); return();} 
    110   if( @t2==0) { @smooth=1; dbprint(p,"// smooth base space");}   
     108  t1' = @t1;
     109  if( @t1==0) { dbprint(p,"// rigit!"); return();}
     110  if( @t2==0) { @smooth=1; dbprint(p,"// smooth base space");}
    111111  dbprint(p,"// ready: T1 and T2");
    112112  @colR = ncols(Ro);
     
    114114  @degrees = homog_test(@is_qh,matrix(Fo),InfD);
    115115  @jv = 1..@t1;
    116   if (@degrees!="") 
     116  if (@degrees!="")
    117117  { dbprint(p-1,"// T1 is quasi-homogeneous represented with weight-vector",
    118118    @degrees);
    119119  }
    120120  if (defined(@active))
    121   { "// matrix of infinitesimal deformations:";print(InfD); 
     121  { "// matrix of infinitesimal deformations:";print(InfD);
    122122    "// weights of infinitesimal deformations (  emty ='not qhomog'):";
    123123     @degrees;
    124124     matrix dummy;
    125125     InfD,dummy,t1' = interact2(InfD,@jv);kill dummy;
    126   } 
     126  }
    127127 //---- create new rings and objects ------------------------------------------
    128128  get_rings(Fo,t1',1,@my,@order,@param);
    129129 setring `myPx`;
    130   @jv=0; @jv[t1']=0; @jv=@jv+1; @jv[nvars(basering)]=0;       
     130  @jv=0; @jv[t1']=0; @jv=@jv+1; @jv[nvars(basering)]=0;
    131131                                               //weight-vector for calculating
    132132                                               //rel-jet with resp to def-para
    133   ideal  Io   = imap(Po,Fo);               
     133  ideal  Io   = imap(Po,Fo);
    134134  ideal  J,m_J,tid;     attrib(J,"isSB",1);
    135135  matrix Fo   = matrix(Io);                   //initial equations
     
    139139  matrix homFR= concat(homR,homF);
    140140  module hom' = std(homFR);
    141   matrix Js[1][@t2]; 
    142   matrix F_R,Fs,Rs,Fn,Rn; 
    143   export Js,Fs,Rs;                         
    144   matrix Mon[t1'][1]=maxideal(1);             
     141  matrix Js[1][@t2];
     142  matrix F_R,Fs,Rs,Fn,Rn;
     143  export Js,Fs,Rs;
     144  matrix Mon[t1'][1]=maxideal(1);
    145145  Fn  = transpose(imap(Po,InfD)*Mon);         //infinitesimal deformations
    146   Fs  = Fo + Fn; 
     146  Fs  = Fo + Fn;
    147147  dbprint(p-1,"// infinitesimal deformation: Fs: ",Fs);
    148148  Rn  = (-1)*lift(Fo,Fs*Ro);                  //infinit. relations
     
    151151  tid = 0 + ideal(F_R);
    152152  if (tid[1]==0) {d_max=1;}                   //finished ?
    153  setring `myOx`; 
     153 setring `myOx`;
    154154  matrix Fs,Rs,Cup,Cup',F_R,homFR,New,Rn,Fn;
    155155  module hom';
    156   ideal  null,tid;  attrib(null,"isSB",1); 
    157  setring `myQx`;   
    158   poly X_s = imap(Po,X_s);       
    159   matrix Cup,Cup',MASS;             
     156  ideal  null,tid;  attrib(null,"isSB",1);
     157 setring `myQx`;
     158  poly X_s = imap(Po,X_s);
     159  matrix Cup,Cup',MASS;
    160160  ideal  tid,null;               attrib(null,"isSB",1);
    161   ideal  J,m_J;                  attrib(J,"isSB",1); 
     161  ideal  J,m_J;                  attrib(J,"isSB",1);
    162162                                 attrib(m_J,"isSB",1);
    163   matrix PreO = imap(Po,PreO); 
     163  matrix PreO = imap(Po,PreO);
    164164  module PreO'= imap(Po,PreO');  attrib(PreO',"isSB",1);
    165165  module PreT = imap(Po,PreT);   attrib(PreT,"isSB",1);
     
    172172   {
    173173     if( @t1==0) {break};
    174      dbprint(p,"// start computation in degree "+string(@d)+".");     
     174     dbprint(p,"// start computation in degree "+string(@d)+".");
    175175     dbprint(p-3,">>> TIME = "+string(timer-time));
    176176     dbprint(p-3,"==> memory = "+string(kmemory())+"k");
     
    178178     if (@smooth) { @noObstr=1;}
    179179     else
    180      { Cup = jet(F_R,@d,@jv); 
    181        Cup = matrix(reduce(ideal(Cup),m_J),@colR,1);   
    182        Cup = jet(Cup,@d,@jv);         
    183      }   
     180     { Cup = jet(F_R,@d,@jv);
     181       Cup = matrix(reduce(ideal(Cup),m_J),@colR,1);
     182       Cup = jet(Cup,@d,@jv);
     183     }
    184184//------- express obstructions in kbase of T2  --------------------------------
    185185     if ( @noObstr==0 )
     
    191191        }
    192192        Cup   = lift(PreO,Cup);
    193         MASS  = lift_rel_kb(Cup,PreT,kbT2,X_s); 
    194         dbprint(p-3,"// next MASSEY-products:",MASS-jet(MASS,@d-1,@jv)); 
     193        MASS  = lift_rel_kb(Cup,PreT,kbT2,X_s);
     194        dbprint(p-3,"// next MASSEY-products:",MASS-jet(MASS,@d-1,@jv));
    195195        if    (MASS==transpose(Js))
    196               { @noObstr=1;dbprint(p-1,"// no obstruction"); } 
     196              { @noObstr=1;dbprint(p-1,"// no obstruction"); }
    197197         else { @noObstr=0; }
    198198      }
     
    204204 setring `myPx`;
    205205        Js   = imap(`myQx`,Js);
    206       degBound = @d+1; 
     206      degBound = @d+1;
    207207        J    = std(ideal(Js));
    208208        m_J  = std(J*ideal(Mon));
     
    210210//--------------- obtain new base-ring ----------------------------------------
    211211        kill `myOx`;
    212   qring `myOx` = J; 
     212  qring `myOx` = J;
    213213        matrix Fs,Rs,F_R,Cup,Cup',homFR,New,Rn,Fn;
    214214        module hom';
     
    217217//---------------- lift equations F and relations R ---------------------------
    218218 setring `myOx`;
    219       Fs    = fetch(`myPx`,Fs);                 
    220       Rs    = fetch(`myPx`,Rs);   
    221       F_R   = Fs*Rs;   
    222       F_R   = matrix(reduce(ideal(F_R),null)); 
     219      Fs    = fetch(`myPx`,Fs);
     220      Rs    = fetch(`myPx`,Rs);
     221      F_R   = Fs*Rs;
     222      F_R   = matrix(reduce(ideal(F_R),null));
    223223      tid   = 0 + ideal(F_R);
    224       if (tid[1]==0) { dbprint(p-1,"// finished"); break;}   
    225       Cup   = (-1)*transpose(jet(F_R,@d,@jv)); 
    226       homFR = fetch(`myPx`,homFR); 
     224      if (tid[1]==0) { dbprint(p-1,"// finished"); break;}
     225      Cup   = (-1)*transpose(jet(F_R,@d,@jv));
     226      homFR = fetch(`myPx`,homFR);
    227227      hom'  = fetch(`myPx`,hom');  attrib(hom',"isSB",1);
    228228      Cup'  = simplify(reduce(Cup,hom'),10);
     
    238238      Rs    = Rs+Rn;
    239239      F_R   = Fs*Rs;
    240       tid   = 0+reduce(ideal(F_R),null); 
     240      tid   = 0+reduce(ideal(F_R),null);
    241241//---------------- fetch results into other rings -----------------------------
    242242  setring `myPx`;
     
    248248      m_J = fetch(`myPx`,m_J);  attrib(m_J,"isSB",1);
    249249      J   = fetch(`myPx`,J);    attrib(J,"isSB",1);
    250       Js  = fetch(`myPx`,Js); 
    251       tid = fetch(`myOx`,tid); 
    252       if (tid[1]==0) { dbprint(p-1,"// finished");break;}         
     250      Js  = fetch(`myPx`,Js);
     251      tid = fetch(`myOx`,tid);
     252      if (tid[1]==0) { dbprint(p-1,"// finished");break;}
    253253   }
    254254//---------  end loop and final output ----------------------------------------
     
    256256   if (@out!="no")
    257257   {  string out = @out+"_"+string(@d);
    258       "// writing file "+out+" with matrix Js, matrix Fs, matrix Rs ready 
     258      "// writing file "+out+" with matrix Js, matrix Fs, matrix Rs ready
    259259      for reading in rings "+myPx+" or "+myQx;
    260260      write(out,"matrix Js[1][",@t2,"]=",Js,";matrix Fs[1][",@rowR,"]=",Fs,
    261261      ";matrix Rs[",@rowR,"][",@colR,"]=",Rs,";");
    262    } 
     262   }
    263263   dbprint(p-3,">>> TIME = "+string(timer-time));
    264264   if (@is_qh != 0)
     
    266266     @degr = @degr[1..t1'];
    267267     dbprint(p-1,"// quasi-homogeneous weights of miniversal base",@degr);
    268    } 
     268   }
    269269   dbprint(p-1,
    270270   "// ___ Equations of miniversal base space ___",Js,
     
    277277   "   setring "+myPx+"; show("+myPx+");","   listvar(matrix);",
    278278   "// NOTE: rings "+myQx+", "+myPx+", "+mySo+" are alive!",
    279    "// (use 'kill_rings(\""+@my+"\");' to remove)"); 
     279   "// (use 'kill_rings(\""+@my+"\");' to remove)");
    280280   return();
    281281}
     
    286286   ring r1        = 0,(x,y,z,u,v),ds;
    287287   matrix m[2][4] = x,y,z,u,y,z,u,v;
    288    ideal Fo       = minor(m,2);   
     288   ideal Fo       = minor(m,2);
    289289                    // cone over rational normal curve of degree 4
    290290   versal(Fo);
     
    305305proc mod_versal(matrix Mo, ideal I, list #)
    306306"
    307 USAGE:   mod_versal(Mo,I[,d,any]); I=ideal, M=module, d=int, any =list 
     307USAGE:   mod_versal(Mo,I[,d,any]); I=ideal, M=module, d=int, any =list
    308308COMUPTE: miniversal deformation of coker(Mo) over Qo=Po/Io, Po=basering;
    309309CREATE:  Ringsr (exported):
     
    314314         'my'Qx  = Px/Io extending Qo (returns as basering),
    315315         'my'Ox  = Px/(Io+Js) ring of the versal deformation of coker(Ms),
    316          'my'So  = embedding-ring of the versal base space.  (default 'my'=\"\") 
     316         'my'So  = embedding-ring of the versal base space.  (default 'my'=\"\")
    317317      Matrices (in Qx, exported):
    318318         Js  = giving the versal base space (obstructions),
    319319         Ms  = giving the versal family of Mo,
    320          Ls  = giving the lifting of syzygies Lo=syz(Mo), 
     320         Ls  = giving the lifting of syzygies Lo=syz(Mo),
    321321      If d is defined (!=0), it computes up to degree d.
    322322      If 'any' is defined and any[1] is no string, interactive version.
    323323      Otherwise 'any' gives predefined strings:\"my\",\"param\",\"order\",\"out\"
    324324      (\"my\" prefix-string, \"param\" is a letter (e.g. \"A\")  for the name of
    325       first parameter or (e.g. \"A(\") for index parameter variables, \"ord\" 
     325      first parameter or (e.g. \"A(\") for index parameter variables, \"ord\"
    326326      ordering string for ringextension), \"out\" name of output-file).
    327327NOTE:   printlevel < 0        no output at all,
    328         printlevel >=0,1,2,.. informs you, what is going on,             
     328        printlevel >=0,1,2,.. informs you, what is going on,
    329329        this proc uses 'execute'.
    330330EXAMPLE:example mod_versal; shows an example
     
    337337  int time = timer;
    338338  intvec @iv,@jv,@is_qh,@degr;
    339   d_max    = 100; 
     339  d_max    = 100;
    340340  @my = ""; @param="A"; @order="ds"; @out="no";
    341341  @size = size(#);
    342342  if( @size>0 ) { d_max = #[1]; }
    343   if( @size>1 ) 
    344   { if(typeof(#[2])!="string") 
     343  if( @size>1 )
     344  { if(typeof(#[2])!="string")
    345345    { string @active;
    346346      @my,@param,@order,@out = interact1();
     
    352352      if (@size>4) {@out   = #[5];}
    353353    }
    354   } 
     354  }
    355355  string myPx = @my+"Px";
    356356  string myQx = @my+"Qx";
     
    363363//-------- compute Ext's ------------------------------------------------------
    364364         I   = std(I);
    365  qring   Qo  = I;   
     365 qring   Qo  = I;
    366366  matrix Mo  = fetch(Po,Mo);
    367   list   Lo  = compute_ext(Mo,p); 
     367  list   Lo  = compute_ext(Mo,p);
    368368         f0,f1,f2,e1,e2,ok_ann=Lo[1];
    369369  matrix Ls,kb1,lift1 = Lo[2],Lo[3],Lo[4];
     
    373373  dbprint(p,"// ready: Ext1 and Ext2");
    374374//-----  test: quasi-homogeneous, choice of inf. def.--------------------------
    375   @degrees = homog_test(@is_qh,Mo,kb1); 
     375  @degrees = homog_test(@is_qh,Mo,kb1);
    376376  e1' = e1;  @jv = 1..e1;
    377   if (@degrees != "") 
     377  if (@degrees != "")
    378378  { dbprint(p-1,"// Ext1 is quasi-homogeneous represented: "+@degrees);
    379379  }
    380380  if (defined(@active))
    381381  { "// kbase of Ext1:";
    382     print(kb1); 
     382    print(kb1);
    383383    "// weights of kbase of Ext1 ( empty = 'not qhomog')";@degrees;
    384384    kb1,lift1,e1' = interact2(kb1,@jv,lift1);
    385   } 
     385  }
    386386//-------- get new rings and objects ------------------------------------------
    387387 setring Po;
     
    392392  ideal  Io   = I_J;
    393393  matrix Mon[e1'][1] = maxideal(1);
    394   matrix Ms   = imap(Qo,Mo);             
    395   matrix Ls   = imap(Qo,Ls);       
    396   matrix Js[1][e2];           
     394  matrix Ms   = imap(Qo,Mo);
     395  matrix Ls   = imap(Qo,Ls);
     396  matrix Js[1][e2];
    397397 setring `myQx`;
    398398  ideal  J,I_J,tet,null;              attrib(null,"isSB",1);
    399399  ideal  m_J  = fetch(`myPx`,m_J);   attrib(m_J,"isSB",1);
    400400  @jv=0;  @jv[e1] = 0; @jv = @jv+1;   @jv[nvars(`myPx`)] = 0;
    401   matrix Ms   = imap(Qo,Mo);          export(Ms);       
     401  matrix Ms   = imap(Qo,Mo);          export(Ms);
    402402  matrix Ls   = imap(Qo,Ls);          export(Ls);
    403403  matrix Js[e2][1];                   export(Js);
    404   matrix MASS; 
     404  matrix MASS;
    405405  matrix Mon  = fetch(`myPx`,Mon);
    406406  matrix Mn,Ln,ML,Cup,Cup',Lift;
     
    410410  matrix D'   = imap(Qo,D');
    411411  module Do   = imap(Qo,Do);          attrib(Do,"isSB",1);
    412   matrix kb2  = imap(Qo,kb2);   
     412  matrix kb2  = imap(Qo,kb2);
    413413  matrix kb1  = imap(Qo,kb1);
    414414  matrix lift1= imap(Qo,lift1);
    415415  poly   X_s  = imap(Po,X_s);
    416   intvec intv = e1',e1,f0,f1,f2; 
    417          Ms,Ls= get_inf_def(Ms,Ls,kb1,lift1,X_s);     
     416  intvec intv = e1',e1,f0,f1,f2;
     417         Ms,Ls= get_inf_def(Ms,Ls,kb1,lift1,X_s);
    418418  kill   kb1,lift1;
    419419  dbprint(p-1,"// infinitesimal extension",Ms);
    420420//----------- start the loop --------------------------------------------------
    421421  for (@d=2;@d<=d_max;@d=@d+1)
    422   { 
     422  {
    423423    dbprint(p-3,">>> time = "+string(timer-time));
    424424    dbprint(p-3,"==> memory = "+string(memory(0)/1000)+
    425425                ",  allocated = "+string(memory(1)/1000));
    426     dbprint(p,"// start deg = "+string(@d));   
     426    dbprint(p,"// start deg = "+string(@d));
    427427//-------- get obstruction ----------------------------------------------------
    428428    Cup  = matrix(ideal(Ms*Ls),f0*f2,1);
     
    433433    Cup' = reduce(Cup,Do);
    434434    tet  = simplify(ideal(Cup'),10);
    435     if (tet[1]!=0) 
     435    if (tet[1]!=0)
    436436    { dbprint(p-4,"// *");
    437437      Cup = Cup-Cup';
     
    441441    { MASS = lift_rel_kb(Cup,ex2,kb2,X_s);}
    442442    else
    443     { MASS = reduce(Cup,ex2);}     
     443    { MASS = reduce(Cup,ex2);}
    444444    dbprint(p-3,"// next MATRIC-MASSEY-products",
    445445    MASS-jet(MASS,@d-1,@jv));
    446446    if   ( MASS==transpose(Js))
    447447         { @noObstr = 1;dbprint(p-1,"//no obstruction"); }
    448     else { @noObstr = 0; }       
     448    else { @noObstr = 0; }
    449449//-------- obtain equations of base space -------------------------------------
    450450    if (@noObstr == 0)
     
    458458     degBound=0;
    459459      I_J = Io,J;                attrib(I_J,"isSB",1);
    460 //-------- obtain new base ring ----------------------------------------------- 
     460//-------- obtain new base ring -----------------------------------------------
    461461      kill `myOx`;
    462  qring `myOx` = I_J;     
     462 qring `myOx` = I_J;
    463463      ideal null,tet;            attrib(null,"isSB",1);
    464464      matrix Ms  = imap(`myQx`,Ms);
    465465      matrix Ls  = imap(`myQx`,Ls);
    466466      matrix Mn,Ln,ML,Cup,Cup',Lift;
    467       matrix C'  = imap(Qo,C'); 
     467      matrix C'  = imap(Qo,C');
    468468      module Co  = imap(Qo,Co);   attrib(Co,"isSB",1);
    469469      module ex2 = imap(Qo,ex2);  attrib(ex2,"isSB",1);
    470470      matrix kb2 = imap(Qo,kb2);
    471471      poly   X_s = imap(Po,X_s);
    472     } 
     472    }
    473473//-------- get lifts ----------------------------------------------------------
    474474   setring `myOx`;
     
    477477    Cup = jet(Cup,@d,@jv);
    478478    Cup'= reduce(Cup,Co);
    479     tet = simplify(ideal(Cup'),10);   
    480     if (tet[1]!=0) 
     479    tet = simplify(ideal(Cup'),10);
     480    if (tet[1]!=0)
    481481    { dbprint(p-4,"// #");
    482482     Cup = Cup-Cup';
    483483    }
    484     Lift = lift(C',Cup);                 
     484    Lift = lift(C',Cup);
    485485    Mn   = matrix(ideal(Lift),f0,f1);
    486486    Ln   = matrix(ideal(Lift[f0*f1+1..nrows(Lift),1]),f1,f2);
     
    490490    dbprint(p-3,"// next extension of syz(Mo)",Ln);
    491491    ML   = reduce(ideal(Ms*Ls),null);
    492 //--------- test: finished ---------------------------------------------------- 
     492//--------- test: finished ----------------------------------------------------
    493493    tet  = simplify(ideal(ML),10);
    494494    if (tet[1]==0) { dbprint(p-1,"// finished in degree ",@d);}
     
    496496   setring `myPx`;
    497497    Ms   = fetch(`myOx`,Ms);
    498     Ls   = fetch(`myOx`,Ls); 
     498    Ls   = fetch(`myOx`,Ls);
    499499   setring `myQx`;
    500500    Ms   = fetch(`myOx`,Ms);
    501     Ls   = fetch(`myOx`,Ls); 
     501    Ls   = fetch(`myOx`,Ls);
    502502    ML   = Ms*Ls;
    503     ML   = matrix(reduce(ideal(ML),null),f0,f2); 
     503    ML   = matrix(reduce(ideal(ML),null),f0,f2);
    504504    tet  = imap(`myOx`,tet);
    505505    if (tet[1]==0) { break;}
    506   } 
    507 //------- end of loop, final output ------------------------------------------- 
     506  }
     507//------- end of loop, final output -------------------------------------------
    508508  if (@out != "no")
    509509  { string out = @out+"_"+string(@d);
    510     "// writing file '"+out+"' with matrix Js, matrix Ms, matrix Ls 
     510    "// writing file '"+out+"' with matrix Js, matrix Ms, matrix Ls
    511511    ready for reading in rings "+myPx+" or "+myQx;
    512512    write(out,"matrix Js[1][",e2,"]=",Js,";matrix Ms[",f0,"][",f1,"]=",Ms,
     
    518518    @degr = @degr[1..e1'];
    519519    dbprint(p-1,"// quasi-homogeneous weights of miniversal base",@degr);
    520   } 
     520  }
    521521  dbprint(p-1,"// Result belongs to qring "+myQx,
    522522  "// Equations of total space of miniversal deformation are in Js",
     
    540540  mod_versal(Mo,Io);
    541541  printlevel = p;
    542   kill Px,Qx,So; 
    543 }
    544 //============================================================================= 
     542  kill Px,Qx,So;
     543}
     544//=============================================================================
    545545///////////////////////////////////////////////////////////////////////////////
    546546proc kill_rings(list #)
    547547"USAGE: kill_rings([string]);
    548 Sub-procedure: kills exported rings of 'versal' and 
     548Sub-procedure: kills exported rings of 'versal' and
    549549               'mod_versal' with prefix 'string'
    550550"
     
    574574Sub-procedure: obtain Ext1 and Ext2 and other objects used by mod_versal
    575575"
    576 { 
     576{
    577577   int    l,f0,f1,f2,f3,e1,e2,ok_ann;
    578578   module Co,Do,ima,ex1,ex2;
    579    matrix M0,M1,M2,ker,kb1,lift1,kb2,A,B,C,D; 
     579   matrix M0,M1,M2,ker,kb1,lift1,kb2,A,B,C,D;
    580580//------- resM ---------------------------------------------------------------
    581    list resM = res(Mo,3);   
     581   list resM = res(Mo,3);
    582582   M0 = resM[1];
    583583   M1 = resM[2];
     
    588588   f3 = ncols(M2);
    589589//------ compute Ext^2  ------------------------------------------------------
    590    B    = kohom(M0,f3); 
     590   B    = kohom(M0,f3);
    591591   A    = kontrahom(M2,f0);
    592    D    = modulo(A,B); 
    593    Do   = std(D);   
     592   D    = modulo(A,B);
     593   Do   = std(D);
    594594   ima  = kohom(M0,f2),kontrahom(M1,f0);
    595595   ex2  = modulo(D,ima);
     
    603603   }
    604604   if (ok_ann==0)
    605    {  e2 =nrows(ex2);   
     605   {  e2 =nrows(ex2);
    606606      dbprint(p,"// Ann(Ext2) is maximal");
    607607   }
    608608//------ compute Ext^1 -------------------------------------------------------
    609    B     = kohom(M0,f2); 
     609   B     = kohom(M0,f2);
    610610   A     = kontrahom(M1,f0);
    611611   ker   = modulo(A,B);
    612    ima   = kohom(M0,f1),kontrahom(M0,f0); 
     612   ima   = kohom(M0,f1),kontrahom(M0,f0);
    613613   ex1   = modulo(ker,ima);
    614614   ex1   = std(ex1);
     
    621621//------ compute the liftings of Ext^1 ---------------------------------------
    622622   lift1 = A*kb1;
    623    lift1 = lift(B,lift1); 
     623   lift1 = lift(B,lift1);
    624624   intvec iv = f0,f1,f2,e1,e2,ok_ann;
    625625   list   L' = ex2,kb2,C,Co,D,Do;
     
    629629proc get_rings(ideal Io,int e1,int switch, list #)
    630630"
    631 Sub-procedure: creating ring-extensions 
    632 "
    633 { 
    634    def Po = basering; 
     631Sub-procedure: creating ring-extensions
     632"
     633{
     634   def Po = basering;
    635635   string my;
    636636   string my_ord = "ds";
    637    string my_var = "A"; 
     637   string my_var = "A";
    638638   if (size(#)>2)
    639639   {
     
    642642     my_var = #[3];
    643643   }
    644    string my_Px = my+"Px"; 
    645    string my_Qx = my+"Qx"; 
    646    string my_Ox = my+"Ox"; 
    647    string my_So = my+"So"; 
     644   string my_Px = my+"Px";
     645   string my_Qx = my+"Qx";
     646   string my_Ox = my+"Ox";
     647   string my_So = my+"So";
    648648  extendring(my_Px,e1,my_var,my_ord);
    649649   ideal Io  = imap(Po,Io);         attrib(Io,"isSB",1);
     
    666666proc get_inf_def(list #)
    667667"
    668 Sub-procedure: compute infinitesimal family of a module and its syzygies 
     668Sub-procedure: compute infinitesimal family of a module and its syzygies
    669669               from a kbase of Ext1 and its lifts
    670670"
     
    687687  }
    688688  return(Ms,Ls);
    689 } 
     689}
    690690//////////////////////////////////////////////////////////////////////////////
    691691proc lift_rel_kb (module N, module M, list #)
     
    695695        N, M modules of same rank,
    696696        M depending only on variables not in p and vdim(M) finite in this ring,
    697         [ kbaseM the kbase of M in the subring given by variables not in p ] 
     697        [ kbaseM the kbase of M in the subring given by variables not in p ]
    698698        warning: check that these assumtions are fulfilled!
    699699RETURN  matrix A, whose j-th columnes present the coeff's of N[j] in kbaseM,
     
    704704  poly p = product(maxideal(1));
    705705       M = std(M);
    706   matrix A; 
     706  matrix A;
    707707  if (size(#)>0) { p=#[2]; module kbaseM=#[1];}
    708   else 
     708  else
    709709  { if (vdim(M)<=0) { "// vdim(M) not finite";return(A);}
    710710    module kbaseM = kbase(M);
     
    714714  A = coeffs(N,kbaseM,p);
    715715  return(A);
    716 } 
     716}
    717717example
    718718{
     
    736736  print(kbase(std(M))*A);
    737737  print(reduce(N,std(M)));
    738 } 
     738}
    739739///////////////////////////////////////////////////////////////////////////////
    740740proc lift_kbase (N, M)
     
    769769proc interact1 ()
    770770"
    771 Sub_procedure: asking for and reading your input-strings 
     771Sub_procedure: asking for and reading your input-strings
    772772"
    773773{
     
    775775 string str,out,my_ord,my_var;
    776776 my_ord = "ds";
    777  my_var = "A"; 
     777 my_var = "A";
    778778 "INPUT: name of output-file (ENTER = no output, do not use \"my\"!)";
    779    str = read("");                                 
    780    if (size(str)>1) 
     779   str = read("");
     780   if (size(str)>1)
    781781   { out = str[1..size(str)-1];}
    782782   else
    783783   { out = "no";}
    784784 "INPUT: prefix-string of ring-extension (ENTER = '@')";
    785    str = read(""); 
    786    if ( size(str) > 1 ) 
    787    { my = str[1..size(str)-1]; }     
    788  "INPUT:parameter-string 
     785   str = read("");
     786   if ( size(str) > 1 )
     787   { my = str[1..size(str)-1]; }
     788 "INPUT:parameter-string
    789789   (give a letter corresponding to first new variable followed by the next letters,
    790790   or 'T('       - a letter + '('  - getting a string of indexed variables)
    791791   (ENTER = A) :";
    792    str = read(""); 
     792   str = read("");
    793793   if (size(str)>1) { my_var=str[1..size(str)-1]; }
    794794 "INPUT:order-string (local or weighted!) (ENTER = ds) :";
    795    str = read(""); 
    796    if (size(str)>1) { my_ord=str[1..size(str)-1]; }   
     795   str = read("");
     796   if (size(str)>1) { my_ord=str[1..size(str)-1]; }
    797797   if( find(my_ord,"s")+find(my_ord,"w") == 0 )
    798798   { "// ordering must be an local! changed into 'ds'";
     
    816816  if (size(str)>1)
    817817  { ">> Choose columnes of the matrix";
    818     ">> (Enter = all columnes)"; 
     818    ">> (Enter = all columnes)";
    819819    "INPUT (number of columnes to use as integer-list 'i_1,i_2,.. ,i_t' ):";
    820820    string columnes = read("");
     
    826826      execute("l1= "+columnes[2*l-1]+";");
    827827      B[l] = A[l1];
    828       if(flag) { C[l]=D[l1];}   
     828      if(flag) { C[l]=D[l1];}
    829829    }
    830830    A = matrix(B,nrows(A),size(B));
     
    836836proc negative_part(intvec iv)
    837837"
    838 RETURNS intvec of indices of jv having negative entries (or iv, if non) 
     838RETURNS intvec of indices of jv having negative entries (or iv, if non)
    839839"
    840840{
     
    842842   int    l,k;
    843843   for (l=1;l<=size(iv);l=l+1)
    844    { if (iv[l]<0) 
     844   { if (iv[l]<0)
    845845     {  k = k+1;
    846846        jv[k]=l;
     
    865865  matrix A    = imap(br,A);
    866866  intmat degA[@r][@c];
    867   if (homog(ideal(A))) 
     867  if (homog(ideal(A)))
    868868  { for (i=1;i<=@r;i=i+1)
    869869    { for(j=1;j<=@c;j=j+1)
     
    872872  }
    873873 setring br;
    874   kill nr; 
     874  kill nr;
    875875  return(degA);
    876876}
     
    878878proc homog_test(intvec w_vec, matrix Mo, matrix A)
    879879"
    880 Sub proc: return relative weight string of columnes of A with respect 
    881           to the given w_vec and to Mo, or \"\" if not qh 
     880Sub proc: return relative weight string of columnes of A with respect
     881          to the given w_vec and to Mo, or \"\" if not qh
    882882    NOTE: * means weight is not determined
    883883"
     
    888888  int @r = nrows(A);
    889889  int @c = ncols(A);
    890   A = concat(matrix(ideal(Mo),@r,1),A); 
    891   intmat a = find_ord(A,w_vec);     
     890  A = concat(matrix(ideal(Mo),@r,1),A);
     891  intmat a = find_ord(A,w_vec);
    892892  intmat b[@r][@c];
    893893  for (l=1;l<=@c;l=l+1)
    894   { 
     894  {
    895895    for (k=1;k<=@r;k=k+1)
    896     {  if (A[k,l+1]!=0) 
     896    {  if (A[k,l+1]!=0)
    897897       { b[k,l] = a[k,l+1]-a[k,1];}
    898898    }
    899899    tv = 0;
    900900    for (k=1;k<=@r;k=k+1)
    901     {  if (A[k,l+1]*A[k,1]!=0) 
     901    {  if (A[k,l+1]*A[k,1]!=0)
    902902       {tv = tv,b[k,l];}
    903903    }
    904904    if (size(tv)>1)
    905     { k = tv[2]; 
     905    { k = tv[2];
    906906      tv = tv[2..size(tv)]; tv = tv -k;
    907       if (tv==0) { @nv = @nv+string(-k)+",";} 
     907      if (tv==0) { @nv = @nv+string(-k)+",";}
    908908      else {return("");}
    909909    }
     
    916916proc homog_t(intvec d_vec, matrix Fo, matrix A)
    917917"
    918 Sub-procedure: Computing relative (with respect to flatten(Fo)) weight_vec 
     918Sub-procedure: Computing relative (with respect to flatten(Fo)) weight_vec
    919919               of columnes of A (return zero if Fo or A not qh)
    920920"
     
    934934   dv = dv[2..size(dv)];
    935935   dv = dv-l;
    936  setring br; 
     936 setring br;
    937937   kill nr;
    938938   return(dv);
  • Singular/LIB/factor.lib

    r30c91f r82716e  
    1 // $Id: factor.lib,v 1.5 1998-05-05 11:55:23 krueger Exp $
     1// $Id: factor.lib,v 1.6 1998-05-14 18:44:59 Singular Exp $
    22//(RS)
    33///////////////////////////////////////////////////////////////////////////////
    44
    5 version="$Id: factor.lib,v 1.5 1998-05-05 11:55:23 krueger Exp $";
     5version="$Id: factor.lib,v 1.6 1998-05-14 18:44:59 Singular Exp $";
    66info="
    77LIBRARY:  factor.lib    PROCEDURES FOR CALLING THE REDUCE FACTORIZER
     
    1616"USAGE:   delete_dollar(s);  s = string
    1717RETURN:  string, with '$' replaced by ' '
    18 EXAMPLE: example delete_dollar; shows an example 
     18EXAMPLE: example delete_dollar; shows an example
    1919"
    2020{
     
    4343NOTE:    due to a limitation of REDUCE, multivariate polynomials can only
    4444         be factorized in characteristic 0
    45              This proc runs under UNIX only
     45         This proc runs under UNIX only
    4646EXAMPLE: example reduce_factor; shows an example
    4747"
     
    6969  system( "sh", "chmod 700 " + scriptname );
    7070  system( "sh", scriptname );
    71   string resultstring = read( outname ); 
     71  string resultstring = read( outname );
    7272  if ( resultstring <> "" )
    7373  {
  • Singular/LIB/fastsolv.lib

    r30c91f r82716e  
    1 // 
    2 version="$Id: fastsolv.lib,v 1.3 1998-05-05 11:55:24 krueger Exp $";
     1//
     2version="$Id: fastsolv.lib,v 1.4 1998-05-14 18:44:59 Singular Exp $";
    33info="";
    44
  • Singular/LIB/finvar.lib

    r30c91f r82716e  
    1 // $Id: finvar.lib,v 1.10 1998-05-05 11:55:25 krueger Exp $
     1// $Id: finvar.lib,v 1.11 1998-05-14 18:45:00 Singular Exp $
    22// author: Agnes Eileen Heydtmann, email:agnes@math.uni-sb.de
    3 // last change: 3.5.98 
     3// last change: 3.5.98
    44//////////////////////////////////////////////////////////////////////////////
    5 version="$Id: finvar.lib,v 1.10 1998-05-05 11:55:25 krueger Exp $"
     5version="$Id: finvar.lib,v 1.11 1998-05-14 18:45:00 Singular Exp $"
    66info="
    77LIBRARY:  finvar.lib       LIBRARY TO CALCULATE INVARIANT RINGS & MORE
     
    383383        { if (#[size(#)-2]=="")
    384384          { "ERROR:   <string> may not be empty";
    385             return();
    386           }
     385            return();
     386          }
    387387          string newring=#[size(#)-2];
    388388          g=size(#)-3;
     
    926926      { if (#[size(#)-1]=="")
    927927        { "ERROR:   <string> may not be empty";
    928           return();
    929         }
     928          return();
     929        }
    930930        string newring=#[size(#)-1];
    931931        gen_num=size(#)-2;
  • Singular/LIB/general.lib

    r30c91f r82716e  
    1 // $Id: general.lib,v 1.7 1998-05-05 11:55:27 krueger Exp $
     1// $Id: general.lib,v 1.8 1998-05-14 18:45:03 Singular Exp $
    22//system("random",787422842);
    33//(GMG, last modified 22.06.96)
    44///////////////////////////////////////////////////////////////////////////////
    55
    6 version="$Id: general.lib,v 1.7 1998-05-05 11:55:27 krueger Exp $";
     6version="$Id: general.lib,v 1.8 1998-05-14 18:45:03 Singular Exp $";
    77info="
    88LIBRARY:  general.lib   PROCEDURES OF GENERAL TYPE
     
    2121 sort(ideal/module);    sort generators according to monomial ordering
    2222 sum(vector/id/..[,v]); add components of vector/ideal/...[with indices v]
    23  which(command);        searches for command and returns absolute
     23 which(command);        searches for command and returns absolute
    2424                        path, if found
    2525           (parameters in square brackets [] are optional)
     
    200200         killall(\"not\", \"type_name\");
    201201COMPUTE: killall(); kills all user-defined variables but not loaded procedures
    202          killall(\"type_name\"); kills all user-defined variables, of type \"type_name\" 
     202         killall(\"type_name\"); kills all user-defined variables, of type \"type_name\"
    203203         killall(\"not\", \"type_name\"); kills all user-defined
    204204         variables, except those of type \"type_name\" and except loaded procedures
     
    216216      }
    217217   }
    218    else 
     218   else
    219219   {
    220220     if( size(#)==1 )
     
    224224          for ( joni=size(L); joni>0; joni-- )
    225225          {
    226              if( L[joni]=="LIB" or typeof(`L[joni]`)=="proc" ) 
     226             if( L[joni]=="LIB" or typeof(`L[joni]`)=="proc" )
    227227               { kill `L[joni]`; }
    228228          }
    229229       }
    230        else 
     230       else
    231231       {
    232232          for ( ; joni>2; joni-- )
     
    649649   string fn = "/tmp/which_" + string(system("pid"));
    650650   string pn;
    651    if( typeof(command) != "string") 
    652    {
    653         return (pn);
     651   if( typeof(command) != "string")
     652   {
     653     return (pn);
    654654   }
    655655   i = system("sh", "which " + command + " > " + fn);
     
    665665   i = system("sh", "rm " + fn);
    666666   if (rs == 0) {return (pn);}
    667    else 
     667   else
    668668   {
    669669     print (command + " not found ");
  • Singular/LIB/hnoether.lib

    r30c91f r82716e  
    1 // $Id: hnoether.lib,v 1.6 1998-05-05 11:55:27 krueger Exp $
     1// $Id: hnoether.lib,v 1.7 1998-05-14 18:45:05 Singular Exp $
    22// author:  Martin Lamm,  email: lamm@mathematik.uni-kl.de
    33// last change:           26.03.98
    44///////////////////////////////////////////////////////////////////////////////
    55
    6 version="$Id: hnoether.lib,v 1.6 1998-05-05 11:55:27 krueger Exp $";
     6version="$Id: hnoether.lib,v 1.7 1998-05-14 18:45:05 Singular Exp $";
    77info="
    88LIBRARY:  hnoether.lib   PROCEDURES FOR THE HAMBURGER-NOETHER-DEVELOPMENT
     
    9191}
    9292///////////////////////////////////////////////////////////////////////////////
    93 proc T_Transform (poly f, int Q, int N) 
     93proc T_Transform (poly f, int Q, int N)
    9494"// returns f(y,xy^Q)/y^NQ
    9595"
     
    9999}
    100100///////////////////////////////////////////////////////////////////////////////
    101 proc T1_Transform (poly f, number d, int M) 
     101proc T1_Transform (poly f, number d, int M)
    102102"// returns f(x,y+d*x^M)
    103103"
     
    116116  int ggt=gcd(M,N);
    117117  M=M/ggt; N=N/ggt;
    118   list ts=extgcd(M,N); 
     118  list ts=extgcd(M,N);
    119119  int tau,sigma=ts[2],-ts[3];
    120120  if (sigma<0) { tau=-tau; sigma=-sigma;}
     
    144144  poly hilf;
    145145 // dividiere f so lange durch x, wie die Div. aufgeht:
    146   for (hilf=f/x; hilf*x==f; hilf=f/x) {f=hilf;} 
     146  for (hilf=f/x; hilf*x==f; hilf=f/x) {f=hilf;}
    147147  for (hilf=f/y; hilf*y==f; hilf=f/y) {f=hilf;} // gleiches fuer y
    148148  return(list(T1(f),d));
     
    156156"{
    157157  matrix mat = coeffs(coeffs(f,y)[J+1,1],x);
    158   if (size(mat) <= I) { return(0);} 
     158  if (size(mat) <= I) { return(0);}
    159159  else { return(leadcoef(mat[I+1,1]));}
    160160}
     
    198198  poly dif,g,l;
    199199  if (gcd_ok!=0) {
    200  //-------------------- Berechne f/ggT(f,df/dx,df/dy) ------------------------ 
     200 //-------------------- Berechne f/ggT(f,df/dx,df/dy) ------------------------
    201201    dif=diff(f,x);
    202202    if (dif==0) { g=f; }        // zur Beschleunigung
     
    322322  if ((leadcoef(f)<-16001) or (leadcoef(f)>16001)) {verbrecher=lead(f);}
    323323  leitexp=leadexp(f);
    324   if (( ((leitexp[1] % 32003) == 0)   and (leitexp[1]<>0)) 
     324  if (( ((leitexp[1] % 32003) == 0)   and (leitexp[1]<>0))
    325325     or ( ((leitexp[2] % 32003) == 0) and (leitexp[2]<>0)) )
    326326       {verbrecher=lead(f);}
     
    445445 string ringchar=charstr(basering);
    446446 map xytausch = basering,y,x;
    447  if ((p!=0) and (ringchar != string(p))) { 
     447 if ((p!=0) and (ringchar != string(p))) {
    448448                            // coefficient field is extension of Z/pZ
    449    execute "int n_elements="+ringchar[1,size(ringchar)-2]+";"; 
     449   execute "int n_elements="+ringchar[1,size(ringchar)-2]+";";
    450450                            // number of elements of actual ring
    451451   number generat=par(1);   // generator of the coefficient field of the ring
     
    509509    }
    510510    else {
    511       if ((str=="s") and (testerg==1)) { 
     511      if ((str=="s") and (testerg==1)) {
    512512       "(*) attention: it could be that the factor is only one in char 32003!";
    513513        f=polyhinueber(test_sqr);
     
    612612        delta = koeff(f,(M/ e)*p^l,(N/ e)*p^l*(eps-1)) / (-1*eps*c);
    613613
    614         if ((ringchar != string(p)) and (delta != 0)) { 
     614        if ((ringchar != string(p)) and (delta != 0)) {
    615615 //- coeff. field is not Z/pZ => we`ve to correct delta by taking (p^l)th root-
    616616          if (delta == generat) {exponent=1;}
     
    12041204}
    12051205example
    1206 { 
     1206{
    12071207  if (nameof(basering)=="HNEring") {
    12081208   def rettering=HNEring;
     
    13031303 }
    13041304if (size(#) != 0) {
    1305    "// basering is now 'displayring' containing ideal 'HNE'"; 
     1305   "// basering is now 'displayring' containing ideal 'HNE'";
    13061306   keepring(displayring);
    13071307   export(HNE);
     
    13731373 //- finde alle Monome auf der Geraden durch A und C (unterhalb gibt's keine) -
    13741374   hilf=jet(f,A[2]*C[1]-A[1]*C[2],intvec(A[2]-C[2],C[1]-A[1]));
    1375        
     1375
    13761376   H=leadexp(xytausch(hilf));
    13771377   D=H[2],H[1];
     
    15621562     }
    15631563     else {
    1564        execute "ring extdguenstig=("+charstr(basering)+"),(x,y),ls;";     
     1564       execute "ring extdguenstig=("+charstr(basering)+"),(x,y),ls;";
    15651565     }
    15661566  }
     
    17531753     delta = koeff(f,(M/ e)*p^l,(N/ e)*p^l*(eps-1)) / (-1*eps*c);
    17541754
    1755      if ((charstr(basering) != string(p)) and (delta != 0)) { 
     1755     if ((charstr(basering) != string(p)) and (delta != 0)) {
    17561756 //------ coefficient field is not Z/pZ => (p^l)th root is not identity -------
    17571757       delta=0;
     
    17811781"USAGE:   reddevelop(f); f poly
    17821782RETURN:  Hamburger-Noether development of f :
    1783          A list of lists in the form of develop(f); each entry contains the 
     1783         A list of lists in the form of develop(f); each entry contains the
    17841784         data for one of the branches of f.
    17851785         For more details type 'help develop;'
     
    19101910   }
    19111911   else {
    1912      if ((str=="s") and (testerg==1)) { 
     1912     if ((str=="s") and (testerg==1)) {
    19131913       "(*)attention: it could be that the factor is only one in char 32003!";
    19141914       f=polyhinueber(test_sqr);
     
    19761976 }
    19771977 //---------------------- Test, ob f teilbar durch x oder y -------------------
    1978  if (subst(f,y,0)==0) { 
     1978 if (subst(f,y,0)==0) {
    19791979   f=f/y; NullHNEy=1; }             // y=0 is a solution
    1980  if (subst(f,x,0)==0) { 
     1980 if (subst(f,x,0)==0) {
    19811981   f=f/x; NullHNEx=1; }             // x=0 is a solution
    19821982
     
    20772077}
    20782078example
    2079 { 
     2079{
    20802080  if (nameof(basering)=="HNEring") {
    20812081   def rettering=HNEring;
     
    22832283        }
    22842284        else {
    2285           " Change of basering necessary!!";
    2286           if (defined(Protokoll)) { teiler,"is not properly factored!"; }
    2287           if (needext==0) { poly zerlege=teiler; }
    2288           needext=1;
     2285          " Change of basering necessary!!";
     2286          if (defined(Protokoll)) { teiler,"is not properly factored!"; }
     2287          if (needext==0) { poly zerlege=teiler; }
     2288          needext=1;
    22892289        }
    22902290      }
     
    22932293    else { deltais=ideal(delta); eis=e;}
    22942294    if (defined(Protokoll)) {"roots of char. poly:";deltais;
    2295                              "with multiplicities:",eis;}
     2295                             "with multiplicities:",eis;}
    22962296    if (needext==1) {
    22972297 //--------------------- fuehre den Ringwechsel aus: --------------------------
    22982298      ringischanged=1;
    22992299      if ((size(parstr(basering))>0) && string(minpoly)=="0") {
    2300         " ** We've had bad luck! The HNE cannot completely be calculated!";
     2300        " ** We've had bad luck! The HNE cannot completely be calculated!";
    23012301                                   // HNE in transzendenter Erw. fehlgeschlagen
    23022302        kill zerlege;
    2303         ringischanged=0; break;    // weiter mit gefundenen Faktoren
     2303        ringischanged=0; break;    // weiter mit gefundenen Faktoren
    23042304      }
    23052305      if (parstr(basering)=="") {
    2306         EXTHNEnumber++;
    2307         splitring(zerlege,"EXTHNEring("+string(EXTHNEnumber)+")");
    2308         poly transf=0;
    2309         poly transfproc=0;
     2306        EXTHNEnumber++;
     2307        splitring(zerlege,"EXTHNEring("+string(EXTHNEnumber)+")");
     2308        poly transf=0;
     2309        poly transfproc=0;
    23102310      }
    23112311      else {
    2312         if (defined(translist)) { kill translist; } // Vermeidung einer Warnung
    2313         if (numberofRingchanges>1) {  // ein Ringwechsel hat nicht gereicht
    2314         list translist=splitring(zerlege,"",list(transf,transfproc));
    2315         poly transf=translist[1]; poly transfproc=translist[2];
     2312        if (defined(translist)) { kill translist; } // Vermeidung einer Warnung
     2313        if (numberofRingchanges>1) {  // ein Ringwechsel hat nicht gereicht
     2314        list translist=splitring(zerlege,"",list(transf,transfproc));
     2315        poly transf=translist[1]; poly transfproc=translist[2];
    23162316        }
    23172317        else {
    2318         if (defined(transfproc)) { // in dieser proc geschah schon Ringwechsel
    2319           EXTHNEnumber++;
    2320           list translist=splitring(zerlege,"EXTHNEring("
     2318        if (defined(transfproc)) { // in dieser proc geschah schon Ringwechsel
     2319          EXTHNEnumber++;
     2320          list translist=splitring(zerlege,"EXTHNEring("
    23212321               +string(EXTHNEnumber)+")",list(a,transfproc));
    2322           poly transf=translist[1];
     2322          poly transf=translist[1];
    23232323          poly transfproc=translist[2];
    2324         }
    2325         else {
    2326           EXTHNEnumber++;
    2327           list translist=splitring(zerlege,"EXTHNEring("
     2324        }
     2325        else {
     2326          EXTHNEnumber++;
     2327          list translist=splitring(zerlege,"EXTHNEring("
    23282328               +string(EXTHNEnumber)+")",a);
    2329           poly transf=translist[1];
    2330           poly transfproc=transf;
    2331         }}
     2329          poly transf=translist[1];
     2330          poly transfproc=transf;
     2331        }}
    23322332      }
    23332333 //----------------------------------------------------------------------------
     
    23952395                                  // aktualisiere Vektor mit den hqs
    23962396       if (eis[j]>1) {
    2397         transformiert=transformiert/y;
    2398         if (subst(transformiert,y,0)==0) {
     2397        transformiert=transformiert/y;
     2398        if (subst(transformiert,y,0)==0) {
    23992399 "THE TEST FOR SQUAREFREENESS WAS BAD!! The polynomial was NOT squarefree!!!";}
    2400         else {
     2400        else {
    24012401 //------ Spezialfall (###) eingetreten: Noch weitere Zweige vorhanden --------
    24022402          eis[j]=eis[j]-1;
    2403         }
     2403        }
    24042404       }
    24052405      }
     
    24332433 //-------- Bereitstellung von Speicherplatz fuer eine neue Zeile: ------------
    24342434        HNEs=set_list(HNEs,intvec(hnezaehler,zeile+zl),ideal(0));
    2435                
     2435
    24362436        M1=N1; N1=R1; R1=M1%N1; Q1=M1 / N1;
    24372437       }
  • Singular/LIB/inout.lib

    r30c91f r82716e  
    1 // $Id: inout.lib,v 1.5 1998-05-05 11:55:29 krueger Exp $
     1// $Id: inout.lib,v 1.6 1998-05-14 18:45:07 Singular Exp $
    22// system("random",787422842);
    33// (GMG/BM, last modified 22.06.96)
    44///////////////////////////////////////////////////////////////////////////////
    55
    6 version="$Id: inout.lib,v 1.5 1998-05-05 11:55:29 krueger Exp $";
     6version="$Id: inout.lib,v 1.6 1998-05-14 18:45:07 Singular Exp $";
    77info="
    88LIBRARY:  inout.lib     PROCEDURES FOR MANIPULATING IN- AND OUTPUT
     
    549549   }
    550550   newvar = newvar[2,size(newvar)-1];
    551    
     551
    552552   execute "ring newP=("+newchar+"),("+newvar+"),("+neword+");";
    553553   def id = imap(P,id);
  • Singular/LIB/invar.lib

    r30c91f r82716e  
    1 // $Id: invar.lib,v 1.6 1998-05-05 11:55:30 krueger Exp $
     1// $Id: invar.lib,v 1.7 1998-05-14 18:45:08 Singular Exp $
    22///////////////////////////////////////////////////////
    33// invar.lib
     
    77//////////////////////////////////////////////////////
    88
    9 version="$Id: invar.lib,v 1.6 1998-05-05 11:55:30 krueger Exp $";
     9version="$Id: invar.lib,v 1.7 1998-05-14 18:45:08 Singular Exp $";
    1010info="
    1111LIBRARY: invar.lib PROCEDURES FOR COMPUTING INVARIANTS OF (C,+)-ACTIONS
     
    2121  // the ring of invariants is finitey generated)
    2222  // if choose<>0 it computes invariants up to degree choose
    23    
     23
    2424  actionIsProper(matrix m)
    2525  // returns 1 if the action of the additive group defined by the
     
    5050  return(m);
    5151}
    52 example 
     52example
    5353{ "EXAMPLE:"; echo = 2;
    5454   ring q=0,(x,y,z,u,v,w),dp;
     
    6464proc der (matrix m, poly f)
    6565"USAGE:   der(m,f);  m matrix, f poly
    66 RETURN:  poly= application of the vectorfield m befined by the matrix m 
     66RETURN:  poly= application of the vectorfield m befined by the matrix m
    6767         (m[i,1] are the coefficients of d/dx(i)) to f
    68 NOTE:   
     68NOTE:
    6969EXAMPLE: example der; shows an example
    7070"
     
    7373  return(mh[1,1]);
    7474}
    75 example 
     75example
    7676{ "EXAMPLE:"; echo = 2;
    7777   ring q=0,(x,y,z,u,v,w),dp;
     
    9191"USAGE:   actionIsProper(m); m matrix
    9292RETURN:  int= 1 if is proper, 0 else
    93 NOTE:   
     93NOTE:
    9494EXAMPLE: example actionIsProper; shows an example
    9595"
     
    120120        delta=der(@m,delta);
    121121     }
    122      id=id+ideal(inv);   
     122     id=id+ideal(inv);
    123123  }
    124124  i=inSubring(@t,id)[1];
     
    126126  return(i);
    127127}
    128 example 
     128example
    129129{ "EXAMPLE:"; echo = 2;
    130130
     
    149149proc reduction(poly p, ideal dom, list #)
    150150"USAGE:   reduction(p,dom,q); p poly, dom ideal, q (optional) monomial
    151 RETURN:  poly= (p-H(f1,...,fr))/q^a, if Lt(p)=H(Lt(f1),...,Lt(fr)) for 
     151RETURN:  poly= (p-H(f1,...,fr))/q^a, if Lt(p)=H(Lt(f1),...,Lt(fr)) for
    152152               some polynomial H in r variables over the base field,
    153153               a maximal such that q^a devides p-H(f1,...,fr),
    154154               dom =(f1,...,fr)
    155 NOTE:   
     155NOTE:
    156156EXAMPLE: example reduction; shows an example
    157157"
     
    160160  int z=size(dom);
    161161  def bsr=basering;
    162  
     162
    163163  //arranges the monomial v for elimination
    164164  poly v=var(1);
     
    170170  //changes the basering bsr to bsr[@(0),...,@(z)]
    171171  execute "ring s="+charstr(basering)+",("+varstr(basering)+",@(0..z)),dp;";
    172  
     172
    173173  //costructes the ideal dom=(p-@(0),dom[1]-@(1),...,dom[z]-@(z))
    174174  ideal dom=imap(bsr,dom);
     
    178178  }
    179179  dom=lead(imap(bsr,p))-@(0),dom;
    180  
     180
    181181  //eliminates the variables of the basering bsr
    182182  //i.e. computes dom intersected with K[@(0),...,@(z)]
     
    197197        poly re=psi(h);
    198198
    199         // devides by the maximal power of #[1] 
     199        // devides by the maximal power of #[1]
    200200        if (size(#)>0)
    201201        {
     
    206206        }
    207207
    208         return(re); 
     208        return(re);
    209209     }
    210210  }
     
    212212  return(p);
    213213}
    214 example 
     214example
    215215{ "EXAMPLE:"; echo = 2;
    216216   ring q=0,(x,y,z,u,v,w),dp;
     
    224224
    225225proc completeReduction(poly p, ideal dom, list #)
    226 "USAGE:   completeReduction(p,dom,q); p poly, dom ideal, 
     226"USAGE:   completeReduction(p,dom,q); p poly, dom ideal,
    227227                                     q (optional) monomial
    228228RETURN:  poly= the polynomial p reduced with dom via the procedure
    229229               reduction as long as possible
    230 NOTE:   
     230NOTE:
    231231EXAMPLE: example completeReduction; shows an example
    232232"
     
    241241  return(p2);
    242242}
    243 example 
     243example
    244244{ "EXAMPLE:"; echo = 2;
    245245   ring q=0,(x,y,z,u,v,w),dp;
     
    256256              0,string(h(@(0),...,@(size(dom)))) :if there is only a nonlinear relation
    257257              h(p,dom[1],...,dom[size(dom)])=0.
    258 NOTE:   
     258NOTE:
    259259EXAMPLE: example inSubring; shows an example
    260260"
     
    303303  return(l);
    304304}
    305 example 
     305example
    306306{ "EXAMPLE:"; echo = 2;
    307307   ring q=0,(x,y,z,u,v,w),dp;
     
    320320               it is assumed that m(q) and h are invariant
    321321               the sum above is divided by h as much as possible
    322 NOTE:   
     322NOTE:
    323323EXAMPLE: example localInvar; shows an example
    324324"
     
    339339    return(inv);
    340340  }
    341   while (dif!=0) 
     341  while (dif!=0)
    342342  {
    343343    inv=(a*inv)+(coeff*dif);
     
    352352  return(inv);
    353353}
    354 example 
     354example
    355355{ "EXAMPLE:"; echo = 2;
    356356   ring q=0,(x,y,z),dp;
     
    372372               in the subring generated by id which are divisible by q
    373373               it is assumed that m(p) and q are invariant
    374                the elements mentioned  above are computed and divided by q 
     374               the elements mentioned  above are computed and divided by q
    375375               as much as possible
    376376               the ideal karl contains all invariants computed yet
    377 NOTE:   
     377NOTE:
    378378EXAMPLE: example furtherInvar; shows an example
    379379"
     
    394394  setring @r;
    395395  map phi=r1,su;
    396   setring r1; 
     396  setring r1;
    397397  // computes the kernel of phi
    398   execute "ideal ker=preimage(@r,phi,null)"; 
     398  execute "ideal ker=preimage(@r,phi,null)";
    399399  // defines the map psi : r1 ---> @r defined by y(i) ---> id[i]
    400400  setring @r;
     
    437437        }
    438438     }
    439    
     439
    440440  }
    441441  setring @r;
     
    443443  return(l);
    444444}
    445 example 
     445example
    446446{ "EXAMPLE:"; echo = 2;
    447447   ring r=0,(x,y,z,u),dp;
     
    461461proc invariantRing(matrix m, poly p, poly q,list #)
    462462"USAGE:   invariantRing(m,p,q); m matrix, p,q poly
    463 RETURN:  ideal= the invariants of the vectorfield m=Sum m[i,1]*d/dx(i) 
     463RETURN:  ideal= the invariants of the vectorfield m=Sum m[i,1]*d/dx(i)
    464464                p,q variables with m(p)=q invariant
    465465NOTE:
     
    474474     bou=#[1];
    475475  }
    476   int z; 
     476  int z;
    477477  ideal karl;
    478478  ideal k1=1;
     
    496496  while (size(k1)!=0)
    497497 {
    498     // test if the new invariants are already in the ring generated 
     498    // test if the new invariants are already in the ring generated
    499499    // by the invariants we constructed already
    500500    it++;
     
    512512    karl=k2[2];
    513513    k1=sortier(k1);
    514     z=size(k1);   
     514    z=size(k1);
    515515    for (i=1;i<=z;i++)
    516516    {
     
    541541  return(karl);
    542542}
    543 example 
     543example
    544544{ "EXAMPLE:"; echo = 2;
    545545
    546546  //Winkelmann: free action but Spec k[x(1),...,x(5)]---> Spec In-
    547547  //variantring is not surjective
    548  
     548
    549549  ring rw=0,(x(1..5)),dp;
    550550  matrix m[5][1];
     
    554554  ideal in=invariantRing(m,x(3),x(1),0);
    555555  in;
    556  
     556
    557557  //Deveney/Finston: The ring of invariants is not finitely generated
    558  
     558
    559559  ring rf=0,(x(1..7)),dp;
    560560  matrix m[7][1];
     
    565565  ideal in=invariantRing(m,x(4),x(1),6);
    566566  in;
    567  
    568  
     567
     568
    569569  //Deveney/Finston:Proper Ga-action which is not locally trivial
    570570  //r[x(1),...,x(5)] is not flat over the ring of invariants
    571  
     571
    572572  ring rd=0,(x(1..5)),dp;
    573573  matrix m[5][1];
     
    577577  ideal in=invariantRing(m,x(3),x(1));
    578578  in;
    579  
     579
    580580  actionIsProper(m);
    581  
     581
    582582  //computes the relations between the invariants
    583583  int z=size(in);
     
    586586  setring rd;
    587587  map phi=r1,in;
    588   setring r1; 
    589   ideal ker=preimage(rd,phi,null); 
     588  setring r1;
     589  ideal ker=preimage(rd,phi,null);
    590590  ker;
    591  
     591
    592592  //the discriminant
    593  
     593
    594594  ring r=0,(x(1..2),y(1..2),z,t),dp;
    595595  poly p=z+(1+x(1)*y(2)^2)*t+x(1)*y(1)*y(2)*t^2+(1/3)*x(1)*y(1)^2*t^3;
    596  
     596
    597597  matrix m[5][5];
    598598  m[1,1]=z;
     
    621621  m[5,4]=2*x(1)*y(1)*y(2);
    622622  m[5,5]=x(1)*y(1)^2;
    623  
     623
    624624  poly disc=9*det(m)/(x(1)^2*y(1)^4);
    625  
     625
    626626  LIB "invar.lib";
    627627  matrix n[6][1];
     
    629629  n[4,1]=y(1);
    630630  n[5,1]=1+x(1)*y(2)^2;
    631  
     631
    632632  der(n,disc);
    633  
     633
    634634  //x(1)^3*y(2)^6-6*x(1)^2*y(1)*y(2)^3*z+6*x(1)^2*y(2)^4+9*x(1)*y(1)^2*z^2-18*x(1)*y(1)*y(2)*z+9*x(1)*y(2)^2+4
    635  
    636  
     635
     636
    637637  //constructive approach to Weizenbcks theorem
    638  
     638
    639639  int n=5;
    640  
     640
    641641  ring w=0,(x(1..n)),wp(1..n);
    642  
     642
    643643  // definition of the vectorfield m=sum m[i]*d/dx(i)
    644644  matrix m[n][1];
     
    650650  ideal in=invariantRing(m,x(2),x(1),0);
    651651  in;
    652  
    653  
    654  
    655 }
     652
     653
     654
     655}
  • Singular/LIB/makedbm.lib

    r30c91f r82716e  
    1 // $Id: makedbm.lib,v 1.7 1998-05-05 11:55:31 krueger Exp $
     1// $Id: makedbm.lib,v 1.8 1998-05-14 18:45:09 Singular Exp $
    22//=========================================================================
    33//
     
    66//=============================================================================
    77
    8 version="$Id: makedbm.lib,v 1.7 1998-05-05 11:55:31 krueger Exp $";
     8version="$Id: makedbm.lib,v 1.8 1998-05-14 18:45:09 Singular Exp $";
    99info="
    1010LIBRARY:  makedbm.lib     some usefull tools needed by the Arnold-Classifier.
     
    3838  string s="";
    3939  s=read(l);
    40   while( s != "" ) 
     40  while( s != "" )
    4141  {
    4242    s,"=",read(l,s);
     
    237237
    238238proc read_sing_dbm
    239 { 
     239{
    240240  link l="DBM: NFlist";
    241241  "A[k]     = "+read(l, "A[k]");
  • Singular/LIB/matrix.lib

    r30c91f r82716e  
    1 // $Id: matrix.lib,v 1.6 1998-05-05 11:55:31 krueger Exp $
     1// $Id: matrix.lib,v 1.7 1998-05-14 18:45:10 Singular Exp $
    22// (GMG/BM, last modified 22.06.96)
    33///////////////////////////////////////////////////////////////////////////////
    44
    5 version="$Id: matrix.lib,v 1.6 1998-05-05 11:55:31 krueger Exp $";
     5version="$Id: matrix.lib,v 1.7 1998-05-14 18:45:10 Singular Exp $";
    66info="
    77LIBRARY:  matrix.lib    PROCEDURES FOR MATRIX OPERATIONS
     
    298298//---------------------------- trivial cases ----------------------------------
    299299   int ii;
    300    if( n <= 0 ) 
    301    {
    302       if( typeof(A)=="matrix" ) 
    303       { 
    304          return (unitmat(nrows(A))); 
     300   if( n <= 0 )
     301   {
     302      if( typeof(A)=="matrix" )
     303      {
     304         return (unitmat(nrows(A)));
    305305      }
    306       if( typeof(A)=="intmat" ) 
    307       { 
     306      if( typeof(A)=="intmat" )
     307      {
    308308         intmat B[nrows(A)][nrows(A)];
    309309         for( ii=1; ii<=nrows(A); ii++ )
     
    311311            B[ii,ii] = 1;
    312312         }
    313          return (B); 
     313         return (B);
    314314      }
    315315   }
  • Singular/LIB/normal.lib

    r30c91f r82716e  
    66///////////////////////////////////////////////////////////////////////////////
    77
    8 version="$Id: normal.lib,v 1.5 1998-05-05 11:55:32 krueger Exp $";
     8version="$Id: normal.lib,v 1.6 1998-05-14 18:45:10 Singular Exp $";
    99info="
    1010LIBRARY: normal.lib: PROCEDURE FOR NORMALIZATION (I)
    1111
    1212  normal(ideal I)
    13   // computes a set of rings such that their product is the 
    14   // normalization of the reduced basering/I 
     13  // computes a set of rings such that their product is the
     14  // normalization of the reduced basering/I
    1515";
    1616
    17 LIB "sing.lib"; 
     17LIB "sing.lib";
    1818LIB "primdec.lib";
    1919LIB "elim.lib";
     
    2929         p    = nonzero divisor of R
    3030RETURN:  1 if R = R:J, 0 if not
    31 EXAMPLE: example isR_HomJR;  shows an example   
     31EXAMPLE: example isR_HomJR;  shows an example
    3232"
    3333{
     
    4646   n=1;
    4747   for (ii=1; ii<=size(f); ii++ )
    48    { 
    49       if ( reduce(f[ii],lp) != 0) 
     48   {
     49      if ( reduce(f[ii],lp) != 0)
    5050      { n = 0; break; }
    5151   }
     
    7676NOTE:    This is useful when enlarging P but keeping the weights of the old
    7777         variables
    78 EXAMPLE: example extraweight;  shows an example   
     78EXAMPLE: example extraweight;  shows an example
    7979"
    8080{
     
    9292      os = osP[fi+1,find(osP,")",fi)-fi-1];
    9393      if( find(os,",") )
    94       { 
     94      {
    9595         execute "nw = "+os+";";
    9696         if( size(nw) > ii )
     
    105105      {
    106106         execute "q = "+os+";";
    107          if( q > ii ) 
    108          { 
     107         if( q > ii )
     108         {
    109109            nw = 0; nw[q-ii] = 0;
    110110            nw = nw + 1;          //creates an intvec 1,...,1 of length q-ii
     
    118118   }
    119119//-------------- adjust weight vector to length = nvars(P)  -------------------
    120    if( fo > 1 ) 
     120   if( fo > 1 )
    121121   {                                            // case when weights were found
    122       rw = rw[2..size(rw)]; 
    123       if( size(rw) > nvars(P) ) 
    124       { 
    125          rw = rw[1..nvars(P)]; 
    126       }
    127       if( size(rw) < nvars(P) ) 
    128       { 
    129          nw=0; nw[nvars(P)-size(rw)]=0; nw=nw+1; rw=rw,nw; 
    130       }
    131    }
    132    else 
     122      rw = rw[2..size(rw)];
     123      if( size(rw) > nvars(P) )
     124      {
     125         rw = rw[1..nvars(P)];
     126      }
     127      if( size(rw) < nvars(P) )
     128      {
     129         nw=0; nw[nvars(P)-size(rw)]=0; nw=nw+1; rw=rw,nw;
     130      }
     131   }
     132   else
    133133   {                                         // case when no weights were found
    134       rw[nvars(P)]= 0; rw=rw+1; 
     134      rw[nvars(P)]= 0; rw=rw+1;
    135135   }
    136136   return(rw);
     
    162162         R is the quotient ring of P modulo the standard basis SBid
    163163RETURN:  a list of two objects
    164          _[1]: a polynomial ring, containing two ideals, 'endid' and 'endphi' 
     164         _[1]: a polynomial ring, containing two ideals, 'endid' and 'endphi'
    165165               s.t. _[1]/endid = Hom_R(J,J) and
    166166               endphi describes the canonical map R -> Hom_R(J,J)
    167167         _[2]: an integer which is 1 if phi is an isomorphism, 0 if not
    168 EXAMPLE: example HomJJ;  shows an example   
     168EXAMPLE: example HomJJ;  shows an example
    169169"
    170170{
     
    185185
    186186//---- set attributes for special cases where algorithm can be simplified -----
    187    if( homo==1 ) 
    188    { 
     187   if( homo==1 )
     188   {
    189189      rw = extraweight(P);
    190190   }
     
    218218
    219219//---------- computation of p*Hom(J,J) as R-ideal -----------------------------
    220    f  = quotient(p*J,J); 
    221    if(y==1)     
    222    {               
     220   f  = quotient(p*J,J);
     221   if(y==1)
     222   {
    223223      "the module Hom(rad(J),rad(J)) presented by the values on";
    224224      "the non-zerodivisor";
     
    243243   rf = interred(reduce(f,f2));       // represents p*Hom(J,J)/p*R = Hom(J,J)/R
    244244   if ( size(rf) == 0 )
    245    { 
     245   {
    246246      if ( homog(f) && find(ordstr(basering),"s")==0 )
    247247      {
    248          ring newR1 = char(P),(X(1..nvars(P))),(a(rw),dp); 
     248         ring newR1 = char(P),(X(1..nvars(P))),(a(rw),dp);
    249249      }
    250250      else
    251251      {
    252          ring newR1 = char(P),(X(1..nvars(P))),dp; 
     252         ring newR1 = char(P),(X(1..nvars(P))),dp;
    253253      }
    254254      ideal endphi = maxideal(1);
    255       ideal endid = fetch(P,id); 
     255      ideal endid = fetch(P,id);
    256256      attrib(endid,"isCohenMacaulay",isCo);
    257257      attrib(endid,"isPrim",isPr);
     
    306306   q = size(f);
    307307   syzf = syz(f);
    308        
     308
    309309   if ( homo==1 )
    310310   {
     
    312312      for ( ii=2; ii<=q; ii++ )
    313313      {
    314          rw  = rw, deg(f[ii])-deg(f[1]);       
    315          rw1 = rw1, deg(f[ii])-deg(f[1]);       
    316       }
    317       ring newR1 = char(R),(X(1..nvars(R)),T(1..q)),(a(rw1),dp); 
     314         rw  = rw, deg(f[ii])-deg(f[1]);
     315         rw1 = rw1, deg(f[ii])-deg(f[1]);
     316      }
     317      ring newR1 = char(R),(X(1..nvars(R)),T(1..q)),(a(rw1),dp);
    318318   }
    319319   else
    320320   {
    321       ring newR1 = char(R),(X(1..nvars(R)),T(1..q)),dp; 
     321      ring newR1 = char(R),(X(1..nvars(R)),T(1..q)),dp;
    322322   }
    323323
     
    325325   ideal SBid = psi1(SBid);
    326326   attrib(SBid,"isSB",1);
    327    
     327
    328328 qring newR = std(SBid);
    329329   map psi = R,ideal(X(1..nvars(R)));
     
    336336
    337337//---------- computation of Hom(J,J) as ring ----------------------------------
    338 // determine kernel of: R[T1,...,Tq] -> J:J >-> R[1/p]=R[t]/(t*p-1), 
     338// determine kernel of: R[T1,...,Tq] -> J:J >-> R[1/p]=R[t]/(t*p-1),
    339339// Ti -> fi/p -> t*fi (p=f1=f[1]), to get ring structure. This is of course
    340340// the same as the kernel of R[T1,...,Tq] -> pJ:J >-> R, Ti -> fi.
     
    344344   pf = f[1]*f;
    345345   T = matrix(ideal(T(1..q)),1,q);
    346    Lin = ideal(T*syzf); 
     346   Lin = ideal(T*syzf);
    347347   if(y==1)
    348348   {
     
    379379   else
    380380   {
    381       ring newRing = char(R),(X(1..nvars(R)),T(2..q)),dp; 
     381      ring newRing = char(R),(X(1..nvars(R)),T(2..q)),dp;
    382382   }
    383383
     
    386386
    387387   map phi = basering,maxideal(1);
    388    list Le = elimpart(endid); 
     388   list Le = elimpart(endid);
    389389           //this proc and the next loop try to
    390390   q = size(Le[2]);                 //substitute as many variables as possible
    391    rw1 = 0;                     
     391   rw1 = 0;
    392392   rw1[nvars(basering)] = 0;
    393393   rw1 = rw1+1;
     
    400400      kill ps;
    401401
    402       for( ii=1; ii<=size(rw1); ii++ ) 
    403       { 
    404          if( Le[4][ii]==0 ) 
    405          { 
     402      for( ii=1; ii<=size(rw1); ii++ )
     403      {
     404         if( Le[4][ii]==0 )
     405         {
    406406            rw1[ii]=0;                             //look for substituted vars
    407407         }
     
    409409      Le=elimpart(endid);
    410410      q = q + size(Le[2]);
    411    }     
     411   }
    412412   endphi = phi(endphi);
    413413
     
    417417
    418418   if (homo==1 && nvars(newRing)-q >1 && size(endid) >0 )
    419    {                           
     419   {
    420420      jj=1;
    421421      for( ii=2; ii<size(rw1); ii++)
    422       { 
     422      {
    423423         jj++;
    424          if( rw1[ii]==0 ) 
    425          { 
     424         if( rw1[ii]==0 )
     425         {
    426426            rw=rw[1..jj-1],rw[jj+1..size(rw)];
    427             jj=jj-1; 
     427            jj=jj-1;
    428428         }
    429429      }
     
    435435   else
    436436   {
    437       ring lastRing = char(R),(T(1..nvars(newRing)-q)),dp; 
    438    }
    439 
    440    ideal lastmap; 
     437      ring lastRing = char(R),(T(1..nvars(newRing)-q)),dp;
     438   }
     439
     440   ideal lastmap;
    441441   q = 1;
    442442   for(ii=1; ii<=size(rw1); ii++ )
     
    444444      if ( rw1[ii]==1 ) { lastmap[ii] = T(q); q=q+1; }
    445445      if ( rw1[ii]==0 ) { lastmap[ii] = 0; }
    446    }     
     446   }
    447447   map phi = newRing,lastmap;
    448448   ideal endid  = phi(endid);
     
    495495  list L   = HomJJ(Li);
    496496  def end = L[1];      // defines ring L[1], containing ideals endid and endphi
    497   setring end;         // makes end the basering 
     497  setring end;         // makes end the basering
    498498  end;
    499499  endid;               // end/endid is isomorphic to End(r/id) as ring
     
    501501  psi;
    502502
    503   ring r   = 32003,(x,y,z),dp; 
     503  ring r   = 32003,(x,y,z),dp;
    504504  ideal id = x2-xy-xz+yz;
    505505  ideal J =y-z,x-z;
     
    508508  list L   = HomJJ(Li,0);
    509509  def end = L[1];      // defines ring L[1], containing ideals endid and endphi
    510   setring end;         // makes end the basering 
     510  setring end;         // makes end the basering
    511511  end;
    512512  endid;               // end/endid is isomorphic to End(r/id) as ring
     
    534534      if( typeof(attrib(id,"isEquidimensional"))=="int" )
    535535      {
    536         if(attrib(id,"isEquidimensional")==1) 
     536        if(attrib(id,"isEquidimensional")==1)
    537537        {
    538            attrib(prim[1],"isEquidimensional",1); 
     538           attrib(prim[1],"isEquidimensional",1);
    539539        }
    540540      }
     
    545545      if( typeof(attrib(id,"isCompleteIntersection"))=="int" )
    546546      {
    547         if(attrib(id,"isCompleteIntersection")==1) 
     547        if(attrib(id,"isCompleteIntersection")==1)
    548548        {
    549            attrib(prim[1],"isCompleteIntersection",1); 
     549           attrib(prim[1],"isCompleteIntersection",1);
    550550        }
    551551      }
     
    554554         attrib(prim[1],"isCompleteIntersection",0);
    555555      }
    556      
     556
    557557      if( typeof(attrib(id,"isPrim"))=="int" )
    558558      {
     
    565565      if( typeof(attrib(id,"isIsolatedSingularity"))=="int" )
    566566      {
    567          if(attrib(id,"isIsolatedSingularity")==1) 
     567         if(attrib(id,"isIsolatedSingularity")==1)
    568568             {attrib(prim[1],"isIsolatedSingularity",1); }
    569569      }
    570570      else
    571571      {
    572          attrib(prim[1],"isIsolatedSingularity",0);       
     572         attrib(prim[1],"isIsolatedSingularity",0);
    573573      }
    574574      if( typeof(attrib(id,"isCohenMacaulay"))=="int" )
    575575      {
    576          if(attrib(id,"isCohenMacaulay")==1) 
     576         if(attrib(id,"isCohenMacaulay")==1)
    577577           { attrib(prim[1],"isCohenMacaulay",1); }
    578578      }
    579579      else
    580580      {
    581          attrib(prim[1],"isCohenMacaulay",0);       
     581         attrib(prim[1],"isCohenMacaulay",0);
    582582      }
    583583      if( typeof(attrib(id,"isRegInCodim2"))=="int" )
     
    588588      else
    589589      {
    590           attrib(prim[1],"isRegInCodim2",0);       
     590          attrib(prim[1],"isRegInCodim2",0);
    591591      }
    592592      return(normalizationPrimes(prim[1],maxideal(1)));
     
    622622         if( typeof(attrib(id,"isEquidimensional"))=="int" )
    623623         {
    624            if(attrib(id,"isEquidimensional")==1) 
     624           if(attrib(id,"isEquidimensional")==1)
    625625           {
    626               attrib(prim[i],"isEquidimensional",1); 
     626              attrib(prim[i],"isEquidimensional",1);
    627627           }
    628628         }
     
    630630         {
    631631            attrib(prim[i],"isEquidimensional",0);
    632          }     
     632         }
    633633         if( typeof(attrib(id,"isIsolatedSingularity"))=="int" )
    634634         {
    635             if(attrib(id,"isIsolatedSingularity")==1) 
     635            if(attrib(id,"isIsolatedSingularity")==1)
    636636             {attrib(prim[i],"isIsolatedSingularity",1); }
    637637         }
    638638         else
    639639         {
    640             attrib(prim[i],"isIsolatedSingularity",0);       
     640            attrib(prim[i],"isIsolatedSingularity",0);
    641641         }
    642    
     642
    643643         keepresult=normalizationPrimes(prim[i],maxideal(1));
    644644         for(j=1;j<=size(keepresult);j++)
     
    695695         ideal PP=fetch(BAS,ihp);
    696696         export PP;
    697          export KK;     
     697         export KK;
    698698         result=newR7;
    699699         setring BAS;
     
    866866  //    if((dim(SM[1]))==depth)
    867867  //    {
    868   //    attrib(SM[2],"isCohenMacaulay",1);   
     868  //    attrib(SM[2],"isCohenMacaulay",1);
    869869  //    "it is CohenMacaulay";
    870   //    } 
     870  //    }
    871871  // }
    872    
     872
    873873   //compute the singular locus+lower dimensional components
    874874   if(((attrib(SM[2],"isIsolatedSingularity")==0)||(homog(SM[2])==0))
     
    953953            "                                  ";
    954954            maxideal(1);
    955             "                                  "; 
     955            "                                  ";
    956956            "                                  ";
    957957         }
     
    970970  //          export SB,MB;
    971971  //          result=BAS;
    972   //          return(result); 
     972  //          return(result);
    973973  //       }
    974974  //       timer-ti;
     
    979979         if(RR[2]==0)
    980980         {
    981             def newR=RR[1];     
     981            def newR=RR[1];
    982982            setring newR;
    983983            map psi=BAS,endphi;
     
    987987        //    timer-ti;
    988988            setring BAS;
    989             return(tluser); 
     989            return(tluser);
    990990         }
    991991         MB=SM[2];
     
    999999         setring BAS;
    10001000         return(result);
    1001  
     1001
    10021002       }
    10031003       else
    1004        {       
     1004       {
    10051005          ideal id=qAnn+SM[2];
    10061006
     
    10331033       }
    10341034   }
    1035    
     1035
    10361036   //test for non-normality
    10371037   //Hom(I,I)<>R
     
    10591059 //        export SB,MB;
    10601060 //        result=BAS;
    1061  //        return(result); 
     1061 //        return(result);
    10621062 //     }
    10631063 //     timer-ti;
     
    10651065 //     list  RR=SM[1],SM[2],JM[2],SL[1];
    10661066 //     ti=timer;
    1067       list RS;   
     1067      list RS;
    10681068 //   list RS=HomJJ(RR);
    10691069 //   timer-ti;
     
    10751075 //        list tluser=normalizationPrimes(SM);
    10761076 //        setring BAS;
    1077  //        return(tluser); 
     1077 //        return(tluser);
    10781078 //     }
    10791079
     
    10841084      }
    10851085//      ti=timer;
    1086      
     1086
    10871087
    10881088      if((attrib(JM[2],"isRad")==0)&&(attrib(SM[2],"isEquidimensional")==0))
     
    10901090           //J=radical(JM[2]);
    10911091          J=radical(SM[2]+ideal(SL[1]));
    1092          
     1092
    10931093          // evtl. test auf J=SM[2]+ideal(SL[1]) dann schon normal
    10941094      }
     
    11101110//    timer-ti;
    11111111
    1112       JM=J,J;       
     1112      JM=J,J;
    11131113
    11141114      //evtl. fuer SL[1] anderen Nichtnullteiler aus J waehlen
     
    11241124        //    keepresult1=insert(keepresult1,keepresult2[lauf]);
    11251125        // }
    1126         // return(keepresult1);   
     1126        // return(keepresult1);
    11271127      // }
    11281128      RR=SM[1],SM[2],JM[2],SL[1];
     
    11471147         export KK;
    11481148         setring BAS;
    1149         // return(RS[1]); 
     1149        // return(RS[1]);
    11501150         return(lastR);
    11511151      }
     
    11601160            // normalizationPrimes(endid);
    11611161      setring BAS;
    1162       return(tluser); 
     1162      return(tluser);
    11631163   }
    11641164   else
     
    11691169                      +ordstr(basering)+");";
    11701170      if(y==1)
    1171       {     
     1171      {
    11721172         "zero-divisor found";
    11731173      }
     
    11871187      }
    11881188      attrib(vid,"isCompleteIntersection",0);
    1189    
     1189
    11901190      keepresult1=normalizationPrimes(vid,ihp);
    11911191
     
    11961196      execute "ring newR2="+charstr(basering)+",("+varstr(basering)+"),("
    11971197                      +ordstr(basering)+");";
    1198  
     1198
    11991199      ideal vid=fetch(BAS,new2);
    12001200      ideal ihp=fetch(BAS,ihp);
     
    12201220         keepresult1=insert(keepresult1,keepresult2[lauf]);
    12211221      }
    1222       return(keepresult1);   
    1223    }   
     1222      return(keepresult1);
     1223   }
    12241224}
    12251225example
     
    12781278ideal i=zy2-zx3-x6;
    12791279
    1280 //Theo2 
     1280//Theo2
    12811281ring r=32003,(x,y,z),wp(3,4,12);
    12821282ideal i=z*(y3-x4)+x8;
     
    13481348
    13491349//dauert laenger
    1350 //Horrocks: 
     1350//Horrocks:
    13511351ring r=32003,(a,b,c,d,e,f),dp;
    13521352ideal i=
     
    13851385a4d-8000a3be+8001a3cf-2ae2f2;
    13861386
    1387  
     1387
    13881388ring r=32003,(b,s,t,u,v,w,x,y,z),dp;
    13891389
  • Singular/LIB/poly.lib

    r30c91f r82716e  
    1 // $Id: poly.lib,v 1.12 1998-05-05 11:55:33 krueger Exp $
     1// $Id: poly.lib,v 1.13 1998-05-14 18:45:11 Singular Exp $
    22//system("random",787422842);
    33//(GMG, last modified 22.06.96)
     
    55///////////////////////////////////////////////////////////////////////////////
    66
    7 version="$Id: poly.lib,v 1.12 1998-05-05 11:55:33 krueger Exp $";
     7version="$Id: poly.lib,v 1.13 1998-05-14 18:45:11 Singular Exp $";
    88info="
    99LIBRARY:  poly.lib      PROCEDURES FOR MANIPULATING POLYS, IDEALS, MODULES
    1010
    1111 cyclic(int);           ideal of cyclic n-roots
    12  katsura([i]);          katsura [i] ideal
     12 katsura([i]);          katsura [i] ideal
    1313 freerank(poly/...)     rank of coker(input) if coker is free else -1
    1414 is_homog(poly/...);    int, =1 resp. =0 if input is homogeneous resp. not
     
    5959
    6060proc katsura
    61 "USAGE: katsura([n]); n integer
     61"USAGE: katsura([n]); n integer
    6262RETURN: katsura(n) : n-th katsura ideal of newly created and set ring
    6363                     (32003, x(0..n), dp)
    64         katsura()  : katsura ideal of basering 
     64        katsura()  : katsura ideal of basering
    6565EXAMPLE: example katsura; shows examples
    6666"
     
    7575  int n = nvars(basering) -1;
    7676  poly p;
    77  
     77
    7878  p = -1;
    7979  for (i = -n; i <= n; i++)
     
    8282  }
    8383  s[1] = p;
    84  
     84
    8585  for (i = 0; i < n; i++)
    8686  {
     
    596596"USAGE:   lcm(i); i ideal
    597597RETURN:  poly = lcm(i[1],...,i[size(i)])
    598 NOTE:   
     598NOTE:
    599599EXAMPLE: example lcm; shows an example
    600600"
     
    656656{
    657657  return(leadcoef(f)/leadcoef(cleardenom(f)));
    658 } 
     658}
    659659example
    660660{ "EXAMPLE:"; echo = 2;
  • Singular/LIB/presolve.lib

    r30c91f r82716e  
    1 // $Id: presolve.lib,v 1.4 1998-05-05 11:55:34 krueger Exp $
     1// $Id: presolve.lib,v 1.5 1998-05-14 18:45:12 Singular Exp $
    22//system("random",787422842);
    33//(GMG), last modified 97/10/07 by GMG
    44///////////////////////////////////////////////////////////////////////////////
    55
    6 version="$Id: presolve.lib,v 1.4 1998-05-05 11:55:34 krueger Exp $";
     6version="$Id: presolve.lib,v 1.5 1998-05-14 18:45:12 Singular Exp $";
    77info="
    88LIBRARY:  presolve.lib     PROCEDURES FOR PRE-SOLVING POLYNOMIAL EQUATIONS
     
    2020 sortandmap(id,s1,s2);  map to new basering with vars sorted w.r.t. complexity
    2121 sortvars(id[n1,p1..]); sort vars w.r.t. complexity in id [different blocks]
    22  valvars(id[..]);       valuation of vars w.r.t. to their complexity in id 
     22 valvars(id[..]);       valuation of vars w.r.t. to their complexity in id
    2323           (parameters in square brackets [] are optional)
    2424";
     
    4343   {
    4444      for ( ii=1; ii<=s; ii=ii+1 )
    45       { 
    46          dpart[ii] = (jet(id[ii],d1-1)==0)*(id[ii]==jet(id[ii],d2))*id[ii]; 
     45      {
     46         dpart[ii] = (jet(id[ii],d1-1)==0)*(id[ii]==jet(id[ii],d2))*id[ii];
    4747      }
    4848   }
    4949   else
    50    { 
     50   {
    5151      for ( ii=1; ii<=s; ii=ii+1 )
    52       { 
     52      {
    5353         dpart[ii]=(jet(id[ii],d1-1,#[1])==0)*(id[ii]==jet(id[ii],d2,#[1]))*id[ii];
    5454      }
     
    5656   return(simplify(dpart,2));
    5757}
    58 example 
     58example
    5959{ "EXAMPLE:"; echo = 2;
    6060   ring r=0,(x,y,z),dp;
     
    7171RETURN:  list of of 5 objects:
    7272         [1]: (interreduced) ideal obtained from i by eliminating (sbstituting)
    73               from the first n variables those which appear in a linear part 
     73              from the first n variables those which appear in a linear part
    7474              of i, by putting this part into triangular form
    7575              (default: n = nvars(basering))
     
    7777         [3]: ideal, j-th element defines substitution of j-th var in [2]
    7878         [4]: ideal of variables of basering, eliminated ones are set to 0
    79          [5]: ideal, describing the map from the basering to itself such that 
     79         [5]: ideal, describing the map from the basering to itself such that
    8080              [1] is the image of i
    81 NOTE:    the procedure does always interreduces the ideal i internally w.r.t. 
     81NOTE:    the procedure does always interreduces the ideal i internally w.r.t.
    8282         ordering dp
    8383         // bei ** spaeter eventuell verbessern
     
    9393//--------------- replace ordering by dp-ordering if necessary ----------------
    9494   o = "dp("+string(n)+")";
    95    fi = find(ordstr(P),o); 
     95   fi = find(ordstr(P),o);
    9696   if( fi == 0 or find(ordstr(P),"a") != 0 )
    9797   {
     
    102102   ideal max,rest = maxideal(1),0;
    103103   if ( n < nvars(P) ) { rest = max[n+1..nvars(P)]; }
    104    attrib(rest,"isSB",1);   
     104   attrib(rest,"isSB",1);
    105105//-------------------- interreduce and find linear part  ----------------------
    106106// interred does the only real work. Because of ordering dp the linear part is
     
    110110// which do not contain elements not to be eliminated
    111111
    112    ideal id = interred(i);           
    113    for ( ii=1; ii<=size(id); ii++ ) 
    114    { 
     112   ideal id = interred(i);
     113   for ( ii=1; ii<=size(id); ii++ )
     114   {
    115115      if( deg(id[ii]) > 1) { break; }
    116116      k=ii;
    117117   }
    118    if( k == 0 )       { ideal lin; } 
     118   if( k == 0 )       { ideal lin; }
    119119   else               { ideal lin = id[1..k];}
    120120   if( k < size(id) ) { id = id[k+1..size(id)]; }
     
    123123   if ( n < nvars(P) )
    124124   {
    125       for ( ii=1; ii<=size(lin); ii++ ) 
    126       {
    127          if ( reduce(lead(lin[ii]),rest) == 0 ) 
    128          { 
     125      for ( ii=1; ii<=size(lin); ii++ )
     126      {
     127         if ( reduce(lead(lin[ii]),rest) == 0 )
     128         {
    129129            id=lin[ii],id;
    130             lin[ii] = 0; 
     130            lin[ii] = 0;
    131131         }
    132132      }
    133133   }
    134134   lin = simplify(lin,2);
    135    attrib(lin,"isSB",1);   
     135   attrib(lin,"isSB",1);
    136136   ideal eva = lead(lin);
    137    attrib(eva,"isSB",1);   
     137   attrib(eva,"isSB",1);
    138138   ideal neva = reduce(maxideal(1),eva);
    139139//------------------ go back to original ring end return  ----------------------
     
    153153   {
    154154      if( neva[ii] == 0 )
    155       {     
     155      {
    156156         phi[ii] = eva[k]-lin[k];
    157157         k=k+1;
     
    162162   return(L);
    163163}
    164 example 
     164example
    165165{ "EXAMPLE:"; echo = 2;
    166166   ring s=0,(x,y,z,t,u,v,w,a,b,c,d,f,e),ds;
     
    173173
    174174proc elimpart (ideal i,list #)
    175 "USAGE:   elimpart(i[,n,e]);  i=ideal, n,e=integers 
    176          consider 1-st n vars for elimination (better: substitution), 
    177          e =0: substitute from linear part of i (same as elimlinearpart) 
    178          e!=0: eliminate also by direct substitution 
     175"USAGE:   elimpart(i[,n,e]);  i=ideal, n,e=integers
     176         consider 1-st n vars for elimination (better: substitution),
     177         e =0: substitute from linear part of i (same as elimlinearpart)
     178         e!=0: eliminate also by direct substitution
    179179         (default: n = nvars(basering), e = 1)
    180180RETURN:  list of of 5 objects:
    181181         [1]: ideal obtained by substituting from the first n variables those
    182               from i which appear in the linear part of i [or, if e!=0, which 
     182              from i which appear in the linear part of i [or, if e!=0, which
    183183              can be expressed directly in the remaining vars]
    184184         [2]: ideal, variables which have been substituted
     
    188188              itself onto k[..variables fom [4]..] and [1] is the image of i
    189189         The ideal i is generated by [1] and [3] in k[x(1..m)], the map [5]
    190          maps [3] to 0, hence induceds an isomorhism 
    191                    k[x(1..m)]/i -> k[..variables fom [4]..]/[1] 
     190         maps [3] to 0, hence induceds an isomorhism
     191                   k[x(1..m)]/i -> k[..variables fom [4]..]/[1]
    192192NOTE:    If the basering has ordering (c,dp), this is faster for big ideals,
    193          since it avoids internal ring change and mapping 
     193         since it avoids internal ring change and mapping
    194194EXAMPLE: example elimpart; shows an example
    195195"
     
    210210// first find terms lin1 of pure degree 1 in each poly of lin
    211211// k1 = pure degree 1 part, k1+k2 = those polys of lin which contained a pure
    212 // degree 1 part. 
     212// degree 1 part.
    213213// Then go to ring newP with ordering c,dp(n) and create a matrix with size(k1)
    214214// colums and 2 rows, such that if [f1,f2] is a column of M then f1+f2 is one of
    215215// the polys of lin containing a pure degree 1 part and f1 is this part
    216 // interreduce this matrix (i.e. Gauss elimination on linear part, with rest 
     216// interreduce this matrix (i.e. Gauss elimination on linear part, with rest
    217217// transformed accordingly).
    218  
     218
    219219   if ( e!=0 )
    220220   {
    221       int ii,kk; 
     221      int ii,kk;
    222222      ideal k1,k2;
    223223      int l = size(lin);
     
    260260         poly p; map phi; ideal max;
    261261         for ( ii=1; ii<=n; ii++  )
    262          { 
     262         {
    263263            for (kk=1; kk<=l; kk++ )
    264264            {
    265                p = kin[kk]/var(ii); 
    266                if ( deg(p) == 0 ) 
     265               p = kin[kk]/var(ii);
     266               if ( deg(p) == 0 )
    267267               {
    268268                  eva = eva+var(ii);
     
    287287      lin[ii] = cleardenom(lin[ii]);
    288288   }
    289    if( defined(newP) ) 
     289   if( defined(newP) )
    290290   {
    291291      setring P;
     
    306306  return(L);
    307307}
    308 example 
     308example
    309309{ "EXAMPLE:"; echo = 2;
    310310   ring s=0,(x,y,z,t,u,v,w,a,b,c,d,f,e),(c,ds);
     
    318318
    319319proc elimpartanyr (ideal i, list #)
    320 "USAGE:   elimpartanyr(i[,p,e]);  i=ideal, p=product of vars to be eliminated, 
     320"USAGE:   elimpartanyr(i[,p,e]);  i=ideal, p=product of vars to be eliminated,
    321321         e=int (default: p=product of all vars, e=1)
    322322RETURN:  list of of 6 objects:
    323          [1]: (interreduced) ideal obtained by substituting from i those vars 
     323         [1]: (interreduced) ideal obtained by substituting from i those vars
    324324              appearing in p which occur in the linear part of i [or which can
    325325              be expressed directly in the remaining variables, if e!=0]
     
    332332
    333333         The ideal i is generated by [1] and [3] in k[x(1..m)], the map [5]
    334          maps [3] to 0, hence induceds an isomorhism 
    335                    k[x(1..m)]/i -> k[..variables fom [4]..]/[1] 
    336 NOTE:    the proc uses 'execute' to create a ring with ordering dp and vars 
     334         maps [3] to 0, hence induceds an isomorhism
     335                   k[x(1..m)]/i -> k[..variables fom [4]..]/[1]
     336NOTE:    the proc uses 'execute' to create a ring with ordering dp and vars
    337337         placed correctly and then applies 'elimpart';
    338338EXAMPLE: example elimpartanyr; shows an example
     
    340340{
    341341   def P = basering;
    342    int j,n,e = 0,0,1; 
     342   int j,n,e = 0,0,1;
    343343   poly p = product(maxideal(1));
    344344   if ( size(#)==1 ) { p=#[1]; }
    345345   if ( size(#)==2 ) { p=#[1]; e=#[2]; }
    346346   string a,b;
    347    for ( j=1; j<=nvars(P); j++ ) 
    348    { 
     347   for ( j=1; j<=nvars(P); j++ )
     348   {
    349349      if (deg(p/var(j))>=0) { a = a+varstr(j)+","; n = n+1; }
    350350      else { b = b+varstr(j)+","; }
     
    354354   execute "ring gnir ="+charstr(P)+",("+a+b+"),dp;";
    355355   ideal i = imap(P,i);
    356    list L = elimpart(i,n,e)+list(n); 
     356   list L = elimpart(i,n,e)+list(n);
    357357   setring P;
    358358   list L = imap(gnir,L);
    359359   return(L);
    360360}
    361 example 
     361example
    362362{ "EXAMPLE:"; echo = 2;
    363363   ring s=0,(e,f,x,y,z,t,u,v,w,a,b,c,d),dp;
     
    369369}
    370370///////////////////////////////////////////////////////////////////////////////
    371  
     371
    372372proc fastelim (ideal i, poly p, list #)
    373 "USAGE:   fastelim(i,p[h,o,a,b,e,m]); i=ideal, p=product of variables to be 
    374          eliminated; h,o,a,b,e integers 
     373"USAGE:   fastelim(i,p[h,o,a,b,e,m]); i=ideal, p=product of variables to be
     374         eliminated; h,o,a,b,e integers
    375375         (options for Hilbert-std, 'valvars', elimpart, minimizing)
    376376         - h !=0: use Hilbert-series driven std-basis computation
     
    381381         - m !=0: compute a minimal system of generators
    382382         replacing '!=' by '=' has the opposite meaning
    383          default: h,o,a,b,e,m = 0,1,0,0,0,0 
     383         default: h,o,a,b,e,m = 0,1,0,0,0,0
    384384RETURN:  ideal obtained from i by eliminating those variables which occur in p
    385385EXAMPLE: example fastelim; shows an example.
     
    394394   if ( size(#) == 5 ) { h=#[1]; o=#[2]; a=#[3]; b=#[4]; e=#[5]; }
    395395   if ( size(#) == 6 ) { h=#[1]; o=#[2]; a=#[3]; b=#[4]; e=#[5]; m=#[6]; }
    396    list L = elimpartanyr(i,p,e); 
     396   list L = elimpartanyr(i,p,e);
    397397   poly q = product(L[2]);     //product of vars which are already eliminated
    398398   if ( q==0 ) { q=1; }
     
    401401   if ( p==1 )                 //ready if no vars are left
    402402   {                           //compute minbase if 3-rd argument !=0
    403       if ( m != 0 ) { L[1]=minbase(L[1]); } 
     403      if ( m != 0 ) { L[1]=minbase(L[1]); }
    404404      return(L);
    405405   }
     
    424424   }
    425425//----------------- h==0: eliminate remaining vars directly -------------------
    426    if ( h == 0 )             
     426   if ( h == 0 )
    427427   {
    428428      L[1] = eliminate(L[1],L[2]);
    429429      def r2 = r1;
    430    } 
    431    else 
     430   }
     431   else
    432432//------- h!=0: homogenize and compute Hilbert-series using hilbvec ----------
    433    {                       
     433   {
    434434      intvec hi = hilbvec(L[1]);         // Hilbert-series of i
    435435      execute "ring r2=("+charstr(P)+"),("+varstr(basering)+",@homo),dp;";
     
    439439      L[1] = eliminate(L[1],L[2],hi);
    440440      L[1]=subst(L[1],@homo,1);          // dehomogenize by setting @homo=1
    441    }       
     441   }
    442442   if ( m != 0 )                         // compute minbase
    443    { 
    444       if ( #[1] != 0 ) { L[1] = minbase(L[1]); } 
     443   {
     444      if ( #[1] != 0 ) { L[1] = minbase(L[1]); }
    445445   }
    446446   def id = L[1];
     
    448448   return(imap(r2,id));
    449449}
    450 example 
     450example
    451451{ "EXAMPLE:"; echo = 2;
    452452   ring s=31991,(e,f,x,y,z,t,u,v,w,a,b,c,d),dp;
    453453   ideal i = w2+f2-1, x2+t2+a2-1,  y2+u2+b2-1, z2+v2+c2-1,
    454             d2+e2-1, f4+2u, wa+tf, xy+tu+ab; 
     454            d2+e2-1, f4+2u, wa+tf, xy+tu+ab;
    455455   fastelim(i,xytua);           //with valvars only
    456456   fastelim(i,xytua,1,1);       //with hilb,valvars,minbase
     
    460460
    461461proc faststd (@id,string @s1,string @s2, list #)
    462 "USAGE:   faststd(id,s1,s2[,\"hilb\",\"sort\",\"dec\",o,\"blocks\"]); 
     462"USAGE:   faststd(id,s1,s2[,\"hilb\",\"sort\",\"dec\",o,\"blocks\"]);
    463463         id=ideal/module, s1,s2=strings (names for new ring and maped id)
    464464         o = string (allowed ordstring:\"lp\",\"dp\",\"Dp\",\"ls\",\"ds\",\"Ds\")
    465465         \"hilb\",\"sort\",\"dec\",\"block\" options for Hilbert-std, sortandmap
    466 COMPUTE: create a new ring (with \"best\" ordering of vars) and compute a 
     466COMPUTE: create a new ring (with \"best\" ordering of vars) and compute a
    467467         std-basis of id (hopefully faster)
    468468         - If say, s1=\"R\" and s2=\"j\", the new basering has name R and the
    469            std-basis of the image of id in R has name j 
     469           std-basis of the image of id in R has name j
    470470         - \"hilb\"  : use Hilbert-series driven std-basis computation
    471471         - \"sort\"  : use 'sortandmap' for a best ordering of vars
     
    480480NOTE:    This proc is only useful for hard problems where other methods fail.
    481481         \"hilb\" is useful for hard orderings (as \"lp\") or for characteristic 0,
    482          it is correct for \"lp\",\"dp\",\"Dp\" (and for blockorderings combining 
     482         it is correct for \"lp\",\"dp\",\"Dp\" (and for blockorderings combining
    483483         these) but not for s-orderings or if the vars have different weights.
    484484         There seem to be only few cases in which \"dec\" is fast
     
    490490   string @o,@va,@c = ordstr(basering),"","";
    491491//-------------------- prepare ordering and set options -----------------------
    492    if ( @o[1]=="c" or @o[1]=="C") 
     492   if ( @o[1]=="c" or @o[1]=="C")
    493493      {  @o = @o[3,2]; }
    494    else 
     494   else
    495495      { @o = @o[1,2]; }
    496    if( @o[1]!="d" and @o[1]!="D" and @o[1]!="l") 
     496   if( @o[1]!="d" and @o[1]!="D" and @o[1]!="l")
    497497      { @o="dp"; }
    498498
    499    if (size(#) == 0 ) 
     499   if (size(#) == 0 )
    500500      { @s = 1; }
    501501   for ( @ii=1; @ii<=size(#); @ii++ )
    502502   {
    503       if ( typeof(#[@ii]) != "string" ) 
    504       { 
    505          "// wrong syntax! type: help faststd"; 
     503      if ( typeof(#[@ii]) != "string" )
     504      {
     505         "// wrong syntax! type: help faststd";
    506506         return();
    507507      }
     
    516516      }
    517517   }
    518    if( voice==2 ) { "// choosen options, hilb sort dec block:",@h,@s,@n,@m; } 
     518   if( voice==2 ) { "// choosen options, hilb sort dec block:",@h,@s,@n,@m; }
    519519
    520520//-------------------- nosort: create ring with new name ----------------------
    521    if ( @s==0 ) 
    522    { 
     521   if ( @s==0 )
     522   {
    523523      execute "ring "+@s1+"=("+charstr(@P)+"),("+varstr(@P)+"),("+@o+");";
    524524      def @id = imap(@P,@id);
     
    554554//------- hilb: homogenize and compute Hilbert-series using hilbvec -----------
    555555// this uses another standardbasis computation
    556    if ( @h != 0 )             
    557    { 
     556   if ( @h != 0 )
     557   {
    558558      execute "ring @Q=("+charstr(@P)+"),("+varstr(@P)+",@homo),("+@o+");";
    559559      def @id = imap(@P,@id);
    560560      kill @P;
    561561      @id = homog(@id,@homo);               // @homo = homogenizing var
    562       if ( @s != 0 ) 
     562      if ( @s != 0 )
    563563      {
    564564         bestorder(@id,@s1,@s2,@n,@o,@m,nvars(@Q)-1);
     
    569569         verbose(redefine);
    570570      }
    571       intvec @hi;                     // encoding of Hilbert-series of i 
    572       @hi = hilbvec(@id);               
     571      intvec @hi;                     // encoding of Hilbert-series of i
     572      @hi = hilbvec(@id);
    573573      //if ( @s!=0 ) { @hi = hilbvec(@id,"32003",ordstr(@Q)); }
    574       //else { @hi = hilbvec(@id); }           
     574      //else { @hi = hilbvec(@id); }
    575575//-------------------------- use Hilbert-driven std --------------------------
    576576      @id = std(@id,@hi);
     
    585585      execute "ring @P=("+charstr(@Q)+"),("+@va+"),("+@o+");";
    586586      def @id = imap(@Q,@id);
    587    }       
     587   }
    588588   def `@s1` = @P;
    589589   def `@s2` = @id;
     
    592592   kill @P;
    593593   keepring(basering);
    594    if( voice==2 ) { "// basering is now "+@s1+", std-basis has name "+@s2; } 
     594   if( voice==2 ) { "// basering is now "+@s1+", std-basis has name "+@s2; }
    595595   return();
    596596}
    597 example 
     597example
    598598{ "EXAMPLE:"; echo = 2;
    599599   ring s = 0,(e,f,x,y,z,t,u,v,w,a,b,c,d),(c,lp);
     
    601601            d2+e2-1, f4+2u, wa+tf, xy+tu+ab;
    602602  option(prot); timer=1;
    603    int time = timer; 
    604    ideal j=std(i);           
     603   int time = timer;
     604   ideal j=std(i);
    605605   timer-time;
    606606   show(R);dim(j),mult(j);
    607    int time = timer; 
     607   int time = timer;
    608608   faststd(i,"R","i");                      // use "best" ordering of vars
    609609   timer-time;
     
    633633RETURN:  ideal of variables occuring in id, if no second argument is present
    634634         list of 4 objects, if a second argument is given (of any type)
    635          -[1]: ideal of variables occuring in id 
    636          -[2]: intvec of variables occuring in id 
    637          -[3]: ideal of variables not occuring in id 
    638          -[4]: intvec of variables not occuring in id 
     635         -[1]: ideal of variables occuring in id
     636         -[2]: intvec of variables occuring in id
     637         -[3]: ideal of variables not occuring in id
     638         -[4]: intvec of variables not occuring in id
    639639EXAMPLE: example findvars; shows an example
    640640"
     
    663663   }
    664664   if ( size(f)>1 ) { f = f[2..size(f)]; }      //intvec of found vars
    665    if ( size(nf)>1 ) { nf = nf[2..size(nf)]; }  //intvec of vars not found 
     665   if ( size(nf)>1 ) { nf = nf[2..size(nf)]; }  //intvec of vars not found
    666666   if( size(#)==0 )  { return(found); }
    667667   if( size(#)!=0 )  { list L = found,f,notfound,nf; return(L); }
    668668}
    669 example 
     669example
    670670{ "EXAMPLE:"; echo = 2;
    671671   ring s  = 0,(e,f,x,y,t,u,v,w,a,d),dp;
    672    ideal i = w2+f2-1, x2+t2+a2-1; 
     672   ideal i = w2+f2-1, x2+t2+a2-1;
    673673   findvars(i);
    674    findvars(i,1); 
     674   findvars(i,1);
    675675}
    676676///////////////////////////////////////////////////////////////////////////////
     
    687687   def @P = basering;
    688688   string @c,@o = "32003", "dp";
    689    if ( size(#) == 1 ) {  @c = #[1]; } 
     689   if ( size(#) == 1 ) {  @c = #[1]; }
    690690   if ( size(#) == 2 ) {  @c = #[1]; @o = #[2]; }
    691691   string @si = typeof(@id)+" @i = "+string(@id)+";";  //** weg
     
    694694   execute @si;                   //** weg
    695695   //show(basering);
    696    @i = std(@i);     
     696   @i = std(@i);
    697697   intvec @hi = hilb(@i,1);         // intvec of 1-st Hilbert-series of id
    698698   return(@hi);
    699699}
    700 example 
     700example
    701701{ "EXAMPLE:"; echo = 2;
    702702   ring s   = 0,(e,f,x,y,z,t,u,v,w,a,b,c,d,H),dp;
    703703   ideal id = w2+f2-1, x2+t2+a2-1,  y2+u2+b2-1, z2+v2+c2-1,
    704               d2+e2-1, f4+2u, wa+tf, xy+tu+ab; 
     704              d2+e2-1, f4+2u, wa+tf, xy+tu+ab;
    705705   id = homog(id,H);
    706706   hilbvec(id);
     
    716716   return(degreepart(id,0,1));
    717717}
    718 example 
     718example
    719719{ "EXAMPLE:"; echo = 2;
    720720   ring r=0,(x,y,z),dp;
     
    727727
    728728proc tolessvars (id ,list #)
    729 "USAGE:   tolessvars(id,[s1,s2]); id poly/ideal/vector/module/matrix, 
     729"USAGE:   tolessvars(id,[s1,s2]); id poly/ideal/vector/module/matrix,
    730730         s1,s2=strings (names of: new ring, new ordering)
    731731CREATE:  nothing, if id contains all vars of the basering. Else, create
     
    735735         The name of the new ring is by default R(n), where n is the number of
    736736         variables in the new ring. If, say, s1 = \"newR\" then the new ring has
    737          name newR. In s2 a different ordering for the new ring may be given 
     737         name newR. In s2 a different ordering for the new ring may be given
    738738         as an allowed ordstring (default is \"dp\" resp. \"ds\", depending whether
    739739         the first block of the old ordering is a p- resp. an s-ordering).
     
    741741         the old ring (default)
    742742RETURN:  the original ideal id
    743 NOTE:    You must not type, say, 'ideal id=tolessvars(id);' since the ring 
     743NOTE:    You must not type, say, 'ideal id=tolessvars(id);' since the ring
    744744         to which 'id' would belong will only be defined by the r.h.s.. But you
    745          may type 'def id=tolessvars(id);' or 'list id=tolessvars(id);' 
     745         may type 'def id=tolessvars(id);' or 'list id=tolessvars(id);'
    746746         since then 'id' does not a priory belong to a ring, its type will
    747747         be defined by the right hand side. Moreover, do not use a name which
     
    760760   newvar = string(L[1]);    // string of new variables
    761761   n = size(L[1]);           // number of new variables
    762    if( n == 0 ) 
     762   if( n == 0 )
    763763   {
    764764      dbprint( pr,"","// no variable occured in "+typeof(id)+", no change of ring!");
    765765      return(id);
    766766   }
    767    if( n == nvars(P) ) 
    768    { 
     767   if( n == nvars(P) )
     768   {
    769769      dbprint( pr,"","// all variables occured in "+typeof(id)+", no change of ring!");
    770       return(id); 
     770      return(id);
    771771   }
    772772//----------------- prepare new ring, map to it and return --------------------
    773773   s1 = "R("+string(n)+")";
    774    if ( size(#) == 0 ) 
    775    { 
     774   if ( size(#) == 0 )
     775   {
    776776       fp = find(s2,"p");
    777777       fs = find(s2,"s");
    778778       if( fs==0 or (fs>=fp && fp!=0) ) { s2="dp"; }
    779        else {  s2="ds"; } 
     779       else {  s2="ds"; }
    780780   }
    781781   if ( size(#) ==1 ) { s1=#[1]; }
     
    791791   return(id);
    792792}
    793 example 
     793example
    794794{ "EXAMPLE:"; echo = 2;
    795795   ring r  = 0,(x,y,z),dp;
    796796   ideal i = y2-x3,x-3,y-2x;
    797    def j   = tolessvars(i); 
     797   def j   = tolessvars(i);
    798798   show(basering);
    799799   j;
     
    810810         form  (default) or if n=0 [non-reduced triangular form if n!=0]
    811811ASSUME:  monomial ordering is a global ordering (p-ordering)
    812 NOTE:    may be used to solve a system of linear equations 
     812NOTE:    may be used to solve a system of linear equations
    813813         see proc 'gauss_row' from 'matrix.lib' for a different method
    814 WARNING: the result is very likely to be false for 'real' coefficients, use 
     814WARNING: the result is very likely to be false for 'real' coefficients, use
    815815         char 0 instead!
    816816EXAMPLE: example solvelinearpart; shows an example
     
    819819   intvec getoption = option(get);
    820820   option(redSB);
    821    if ( size(#)!=0 ) 
    822    { 
     821   if ( size(#)!=0 )
     822   {
    823823      if(#[1]!=0) { option(noredSB); }
    824824   }
    825825   def lin = interred(degreepart(id,0,1));
    826    if ( size(#)!=0 ) 
    827    { 
    828       if(#[1]!=0) 
    829       { 
     826   if ( size(#)!=0 )
     827   {
     828      if(#[1]!=0)
     829      {
    830830         return(lin);
    831831      }
     
    834834   return(simplify(lin,1));
    835835}
    836 example 
     836example
    837837{ "EXAMPLE:"; echo = 2;
    838838   // Solve the system of linear equations:
     
    848848   ideal j= 2,1,0,3;
    849849   j = i-j;                        // difference of 1x4 matrices
    850                                    // compute reduced triangular form, setting 
     850                                   // compute reduced triangular form, setting
    851851   solvelinearpart(j);             // the RHS equal 0 gives the solutions!
    852852   solvelinearpart(j,1); "";       // triangular form, not reduced
     
    861861            14x + 10y + 6z - 7u - c,
    862862             7x +  4y + 3z - 3u - d;
    863    solvelinearpart(i);             
     863   solvelinearpart(i);
    864864}
    865865///////////////////////////////////////////////////////////////////////////////
    866866
    867867proc sortandmap (@id,string @s1,string @s2, list #)
    868 "USAGE:   sortandmap(id,s1,s2[,n1,p1,n2,p2...,o1,m1,o2,m2...]); 
     868"USAGE:   sortandmap(id,s1,s2[,n1,p1,n2,p2...,o1,m1,o2,m2...]);
    869869         id=poly/ideal/vector/module
    870870         s1,s2=strings (names for new ring and maped id)
    871871         p1,p2,...= product of vars, n1,n2,...=integers
    872          o1,o2,...= allowed ordstrings, m1,m2,...=integers 
     872         o1,o2,...= allowed ordstrings, m1,m2,...=integers
    873873         (default: p1=product of all vars, n1=0, o1=\"dp\",m1=0)
    874874         the last pi (containing the remaining vars) may be omitted
    875875CREATE:  a new ring and map id into it, the new ring has same char as basering
    876          but with new ordering and vars sorted in the following manner: 
     876         but with new ordering and vars sorted in the following manner:
    877877         - each block of vars occuring in pi is sorted w.r.t its complexity in
    878            id, ni controls the sorting in i-th block (= vars occuring in pi): 
     878           id, ni controls the sorting in i-th block (= vars occuring in pi):
    879879           ni=0 (resp.!=0) means that less (resp. more) complex vars come first
    880880         - If say, s1=\"R\" and s2=\"j\", the new basering has name R and the image
    881            of id in R has name j 
     881           of id in R has name j
    882882         - oi and mi define the monomial ordering of the i-th block:
    883883           if mi =0, oi=ordstr(i-th block)
    884884           if mi!=0, the ordering of the i-th block itself is a blockordering,
    885            each subblock having ordstr=oi, such that vars of same complexity 
     885           each subblock having ordstr=oi, such that vars of same complexity
    886886           are in one block
    887887           default: oi=\"dp\", mi=0
     
    889889RETURN:  nothing
    890890NOTE:    We define a variable x to be more complex than y (with respect to id)
    891          if val(x) > val(y) lexicographically, where val(x) denotes the 
     891         if val(x) > val(y) lexicographically, where val(x) denotes the
    892892         valuation vector of x: consider id as list of polynomials in x with
    893          coefficients in the remaining variables. Then val(x) = 
     893         coefficients in the remaining variables. Then val(x) =
    894894         (maximal occuring power of x, # of monomials in leading coefficient,
    895895          # of monomials in coefficient of next smaller power of x,...)
     
    903903//----------------- find o in # and split # into 2 lists ---------------------
    904904   # = # +list("dp",0);
    905    for ( @ii=1; @ii<=size(#); @ii++) 
    906    { 
    907       if ( typeof(#[@ii])=="string" )  break; 
     905   for ( @ii=1; @ii<=size(#); @ii++)
     906   {
     907      if ( typeof(#[@ii])=="string" )  break;
    908908   }
    909909   if ( @ii==1 ) { list @L1 = list(); }
     
    922922         for ( @jj=1; @jj<=size(@v); @jj++ )
    923923         {
    924            @o = @o+@L2[@ii/2 -1]+"("+string(@v[@jj])+"),"; 
     924           @o = @o+@L2[@ii/2 -1]+"("+string(@v[@jj])+"),";
    925925         }
    926926      }
    927       else 
    928       { 
    929          @o = @o+@L2[@ii/2 -1]+"("+string(size(@l[@ii/2]))+"),"; 
    930       } 
     927      else
     928      {
     929         @o = @o+@L2[@ii/2 -1]+"("+string(size(@l[@ii/2]))+"),";
     930      }
    931931   }
    932932   @o=@o[1..size(@o)-1];
     
    935935   def @id = imap(@P,@id);
    936936   execute "def "+ @s2+"=@id;";
    937    execute("export("+@s1+");"); 
    938    execute("export("+@s2+");"); 
     937   execute("export("+@s1+");");
     938   execute("export("+@s2+");");
    939939   keepring(basering);
    940940   return();
    941941}
    942 example 
     942example
    943943{ "EXAMPLE:"; echo = 2;
    944944   ring s = 32003,(e,f,x,y,z,t,u,v,w,a,b,c,d),dp;
     
    951951   kill R_r; setring s;
    952952   sortandmap(i,"R_r","i",1,"lp",0);
    953    show(R_r); 
     953   show(R_r);
    954954   kill R_r; setring s;
    955955   sortandmap(i,"R_r","i",1,abc,0,xyztuvw,0,"lp",0,"Dp",1);
    956    show(R_r); 
     956   show(R_r);
    957957   kill R_r;
    958958}
     
    960960
    961961proc sortvars (id, list #)
    962 "USAGE:   sortvars(id[,n1,p1,n2,p2,...]); id=poly/ideal/vector/module, 
     962"USAGE:   sortvars(id[,n1,p1,n2,p2,...]); id=poly/ideal/vector/module,
    963963         p1,p2,...= product of vars, n1,n2,...=integers
    964964         (default: p1=product of all vars, n1=0)
     
    967967RETURN:  list of two elements, an ideal and a list:
    968968         [1]: ideal, variables of basering sorted w.r.t their complexity in id
    969             ni controls the ordering in i-th block (= vars occuring in pi): 
     969            ni controls the ordering in i-th block (= vars occuring in pi):
    970970            ni=0 (resp.!=0) means that less (resp. more) complex vars come
    971             first 
     971            first
    972972         [2]: a list with 4 elements for each pi:
    973             ideal ai : vars of pi in correct order, 
    974             intvec vi: permutation vector describing the ordering in ai, 
    975             intmat Mi: valuation matrix of ai, the columns of Mi being the 
     973            ideal ai : vars of pi in correct order,
     974            intvec vi: permutation vector describing the ordering in ai,
     975            intmat Mi: valuation matrix of ai, the columns of Mi being the
    976976                       valuation vectors of the vars in ai
    977             intvec wi: 1-st,2-nd,...entry = size of 1-st,2-nd,... block of 
     977            intvec wi: 1-st,2-nd,...entry = size of 1-st,2-nd,... block of
    978978                       identically columns of Mi (vars with same valuation)
    979979NOTE:    We define a variable x to be more complex than y (w.r.t. id)
    980          if val(x) > val(y) lexicographically, where val(x) denotes the 
     980         if val(x) > val(y) lexicographically, where val(x) denotes the
    981981         valuation vector of x: consider id as list of polynomials in x with
    982          coefficients in the remaining variables. Then val(x) = 
     982         coefficients in the remaining variables. Then val(x) =
    983983         (maximal occuring power of x, # of monomials in leading coefficient,
    984984          # of monomials in coefficient of next smaller power of x,...)
     
    988988   int ii,jj,n,s;
    989989   list L = valvars(id,#);
    990    list L2, L3 = L[2], L[3]; 
     990   list L2, L3 = L[2], L[3];
    991991   list K; intmat M; intvec v1,v2,w;
    992992   ideal i = sort(maxideal(1),L[1])[1];
     
    995995      M = transpose(L3[2*ii]);
    996996      M = M[L2[ii],1..nrows(L3[2*ii])];
    997       w = 0; s = 0; 
     997      w = 0; s = 0;
    998998      for ( jj=1; jj<=nrows(M)-1; jj++ )
    999999      {
     
    10051005      K = K+sort(L3[2*ii-1],L2[ii])+list(transpose(M))+list(w);
    10061006   }
    1007    L = i,K; 
     1007   L = i,K;
    10081008   return(L);
    10091009}
    1010 example 
     1010example
    10111011{ "EXAMPLE:"; echo = 2;
    10121012   ring r=0,(a,b,c,x,y,z),lp;
     
    10221022
    10231023proc valvars (id, list #)
    1024 "USAGE:   valvars(id[,n1,p1,n2,p2,...]); id=poly/ideal/vector/module, 
     1024"USAGE:   valvars(id[,n1,p1,n2,p2,...]); id=poly/ideal/vector/module,
    10251025         p1,p2,...= product of vars, n1,n2,...=integers
    1026          ni controls the ordering of vars occuring in pi: 
     1026         ni controls the ordering of vars occuring in pi:
    10271027         ni=0 (resp.!=0) means that less (resp. more) complex vars come first
    10281028         (default: p1=product of all vars, n1=0)
     
    10321032         [1]: intvec, say v, describing the permutation such that the permuted
    10331033            ringvariables are ordered with respect to their complexity in id
    1034          [2]: list of intvecs, i-th intvec, say v(i) describing prmutation 
     1034         [2]: list of intvecs, i-th intvec, say v(i) describing prmutation
    10351035              of vars in a(i) such that v=v(1),v(2),...
    1036          [3]: list of ideals and intmat's, say a(i) and M(i), where ideal a(i) 
     1036         [3]: list of ideals and intmat's, say a(i) and M(i), where ideal a(i)
    10371037            = factors of pi, M(i) = valuation matrix of a(i), such that the
    1038             j-th column of M(i) is the valuation vector of j-th generator of a(i) 
    1039 NOTE:    Use proc 'sortvars' for the actual sorting of vars! 
     1038            j-th column of M(i) is the valuation vector of j-th generator of a(i)
     1039NOTE:    Use proc 'sortvars' for the actual sorting of vars!
    10401040         We define a variable x to be more complex than y (with respect to id)
    1041          if val(x) > val(y) lexicographically, where val(x) denotes the 
     1041         if val(x) > val(y) lexicographically, where val(x) denotes the
    10421042         valuation vector of x: consider id as list of polynomials in x with
    1043          coefficients in the remaining variables. Then val(x) = 
     1043         coefficients in the remaining variables. Then val(x) =
    10441044         (maximal occuring power of x, # of monomials in leading coefficient,
    10451045          # of monomials in coefficient of next smaller power of x,...)
     
    10601060
    10611061//---- for each pii in # create ideal a(ii) intvec v(ii) and list L(ii) -------
    1062 // a(ii) = ideal of vars in product, v(ii)[j]=k <=> a(ii)[j]=var(k) 
     1062// a(ii) = ideal of vars in product, v(ii)[j]=k <=> a(ii)[j]=var(k)
    10631063
    10641064   v = 1..nvars(basering);
     
    10741074         for ( jj=1; jj<=nvars(basering); jj++ )
    10751075         {
    1076             if ( #[ii]/var(jj) != 0) 
    1077             { 
    1078                a(ii) = a(ii) + var(jj); 
     1076            if ( #[ii]/var(jj) != 0)
     1077            {
     1078               a(ii) = a(ii) + var(jj);
    10791079               v(ii)=v(ii),jj;
    10801080               m[jj]=0;
     
    10831083         }
    10841084         v(ii)=v(ii)[2..size(v(ii))];
    1085       } 
    1086       if ( size(m)!=0 ) 
    1087       { 
    1088          l = 2*(l/2)+2; 
    1089          ideal a(l) = simplify(m,2); 
     1085      }
     1086      if ( size(m)!=0 )
     1087      {
     1088         l = 2*(l/2)+2;
     1089         ideal a(l) = simplify(m,2);
    10901090         intvec v(l) = compress(v);
    10911091         int n(l);
     
    10931093      }
    10941094   }
    1095    else 
    1096    { 
    1097       l = 2; 
    1098       ideal a(2) = maxideal(1); 
    1099       intvec v(2) = v; 
    1100       int n(2); 
     1095   else
     1096   {
     1097      l = 2;
     1098      ideal a(2) = maxideal(1);
     1099      intvec v(2) = v;
     1100      int n(2);
    11011101      if ( size(#)==1 ) { n(2) = #[1]; }
    11021102   }
     
    11111111      {
    11121112         C = coeffs(i,a(kk)[ii]);
    1113          w = nrows(C);                   
    1114          for ( jj=w[1]; jj>1; jj-- ) 
     1113         w = nrows(C);
     1114         for ( jj=w[1]; jj>1; jj-- )
    11151115         {
    11161116            s = size(C[jj,1..ncols(C)]);
    1117             w[w[1]-jj+2] = sum(s); 
     1117            w[w[1]-jj+2] = sum(s);
    11181118         }
    11191119         L[ii]=w;
     
    11211121      }
    11221122      intmat M(kk)[size(a(kk))][n];
    1123       for ( ii=1; ii<=size(a(kk)); ii++ ) 
    1124       { 
    1125          if ( n==1 ) { w = L[ii]; M(kk)[ii,1] = w[1]; } 
    1126          else  { M(kk)[ii,1..n] = L[ii]; } 
     1123      for ( ii=1; ii<=size(a(kk)); ii++ )
     1124      {
     1125         if ( n==1 ) { w = L[ii]; M(kk)[ii,1] = w[1]; }
     1126         else  { M(kk)[ii,1..n] = L[ii]; }
    11271127      }
    11281128      LM[kk-1] = a(kk);
     
    11331133      blockvec[kk/2] = vec;
    11341134      vec = sort(v(kk),vec)[1];
    1135       varvec = varvec,vec; 
     1135      varvec = varvec,vec;
    11361136   }
    11371137   varvec = varvec[2..size(varvec)];
     
    11391139   return(result);
    11401140}
    1141 example 
     1141example
    11421142{ "EXAMPLE:"; echo = 2;
    11431143   ring r=0,(a,b,c,x,y,z),lp;
     
    11641164y,u,b,c,a,z,t,x,v,d,w,e,f,h
    11651165v0;
    1166 14,9,12,11,10,8,7,6,5,4,3,2,1,13 
     116614,9,12,11,10,8,7,6,5,4,3,2,1,13
    11671167print(matrix(sort(maxideal(1),v0)));
    11681168h,v,e,w,d,x,t,z,a,c,b,u,y,f
    11691169v1;v2;
    1170 9,12,11,10,8,7,6,5,4,3,2,1,13,14 
    1171 13,12,11,10,8,7,6,5,4,3,2,1,9,14 
     11709,12,11,10,8,7,6,5,4,3,2,1,13,14
     117113,12,11,10,8,7,6,5,4,3,2,1,9,14
    11721172
    11731173Ev. Gute Ordnung fuer i:
     
    11781178d=deg_x(i) := max{deg_x(i[k]) | k=1..size(i)}
    11791179size_x(i,deg_x(i)..0) := size(ad),...,size(a0)
    1180 x>y  <== 
    1181   1. deg_x(i)>deg_y(i) 
     1180x>y  <==
     1181  1. deg_x(i)>deg_y(i)
    11821182  2. "=" in 1. und size_x lexikographisch
    11831183
  • Singular/LIB/primdec.lib

    r30c91f r82716e  
    1 // $Id: primdec.lib,v 1.17 1998-05-13 15:02:35 obachman Exp $
     1// $Id: primdec.lib,v 1.18 1998-05-14 18:45:13 Singular Exp $
    22///////////////////////////////////////////////////////
    33// primdec.lib
     
    1111//////////////////////////////////////////////////////
    1212
    13 version="$Id: primdec.lib,v 1.17 1998-05-13 15:02:35 obachman Exp $";
     13version="$Id: primdec.lib,v 1.18 1998-05-14 18:45:13 Singular Exp $";
    1414info="
    1515LIBRARY: primdec.lib: PROCEDURE FOR PRIMARY DECOMPOSITION (I)
     
    213213   ideal fac=tsil[2];
    214214   poly f=tsil[3];
    215    
     215
    216216   ideal star=quotient(laedi,f);
    217217   action=1;
     
    228228        g=1;
    229229        verg=laedi;
    230        
     230
    231231         for(j=1;j<=size(fac);j++)
    232232         {
     
    237237         }
    238238         verg=quotient(laedi,g);
    239          
     239
    240240         if(specialIdealsEqual(verg,star)==1)
    241241         {
     
    251251      }
    252252   }
    253    l=star,fac,f;   
     253   l=star,fac,f;
    254254   return(l);
    255255}
     
    259259{
    260260  poly keep=p;
    261  
     261
    262262   int i;
    263263   poly q=act[1][1]^act[2][1];
     
    272272      "ERROR IN FACTOR";
    273273      basering;
    274      
     274
    275275      act;
    276276      keep;
    277277      pause;
    278      
     278
    279279      p;
    280280      q;
     
    565565         m=m-1;
    566566      }
    567       //check whether i[m] =(c*var(n)+h)^e modulo prm for some 
     567      //check whether i[m] =(c*var(n)+h)^e modulo prm for some
    568568      //h in K[var(n+1),...,var(nvars(basering))], c in K
    569569      //if not (0) is returned, else var(n)+h is added to prm
     
    788788   {
    789789     attrib(l[2*i-1],"isSB",1);
    790      
     790
    791791     if((size(ser)>0)&&(size(reduce(ser,l[2*i-1],1))==0)&&(deg(l[2*i-1][1])>0))
    792792     {
    793793       "Achtung in split";
    794        
     794
    795795         l[2*i-1]=ideal(1);
    796796         l[2*i]=ideal(1);
     
    857857     return(primary);
    858858  }
    859  
    860   j=interred(j); 
     859
     860  j=interred(j);
    861861  attrib(j,"isSB",1);
    862862  if(vdim(j)==deg(j[1]))
    863   {   
     863  {
    864864     act=factor(j[1]);
    865865     for(@k=1;@k<=size(act[1]);@k++)
     
    879879       primary[2*@k]=interred(@qh);
    880880       attrib( primary[2*@k-1],"isSB",1);
    881        
     881
    882882       if((size(ser)>0)&&(size(reduce(ser,primary[2*@k-1],1))==0))
    883883       {
    884884          primary[2*@k-1]=ideal(1);
    885           primary[2*@k]=ideal(1);         
     885          primary[2*@k]=ideal(1);
    886886       }
    887887     }
     
    957957  }
    958958  else
    959   { 
     959  {
    960960     primary[1]=j;
    961961     if((size(#)>0)&&(act[2][1]>1))
     
    976976  if(size(#)==0)
    977977  {
    978    
     978
    979979     primary=splitPrimary(primary,ser,@wr,act);
    980      
     980
    981981  }
    982982
     
    10011001    }
    10021002  }
    1003    
     1003
    10041004  @k=0;
    10051005  ideal keep;
     
    10271027                    jmap2[zz]=primary[2*@k-1][@n];
    10281028                    @qht[@n]=var(zz);
    1029                      
     1029
    10301030                }
    10311031             }
     
    10391039       phi1=@P,jmap1;
    10401040       phi=@P,jmap;
    1041  
     1041
    10421042       for(@n=1;@n<=nva;@n++)
    10431043       {
     
    10481048
    10491049       @qh=phi(@qht);
    1050        
     1050
    10511051       if(npars(@P)>0)
    10521052       {
     
    10761076       kill @Phelp1;
    10771077       @qh=clearSB(@qh);
    1078        attrib(@qh,"isSB",1);       
     1078       attrib(@qh,"isSB",1);
    10791079       ser1=phi1(ser);
    10801080       @lh=zero_decomp (@qh,phi(ser1),@wr);
    10811081//       @lh=zero_decomp (@qh,psi(ser),@wr);
    1082        
    1083        
     1082
     1083
    10841084       kill lres0;
    10851085       list lres0;
     
    16811681   map phi=@P,qr[2];
    16821682   i=qr[1];
    1683    
     1683
    16841684   execute "ring gnir = ("+charstr(basering)+"),("+varstr(basering)+"),("
    16851685             +ordstr(basering)+");";
     
    19291929      }
    19301930  }
    1931  
     1931
    19321932  homo=homog(i);
    1933  
     1933
    19341934  if(homo==1)
    19351935  {
     
    19781978  option(redSB);
    19791979
    1980   ideal ser=fetch(@P,ser); 
     1980  ideal ser=fetch(@P,ser);
    19811981
    19821982  if(homo==1)
     
    20322032    }
    20332033  }
    2034  
     2034
    20352035  //----------------------------------------------------------------
    20362036  //j is the ring
     
    20702070     return(primary);
    20712071  }
    2072  
     2072
    20732073 //------------------------------------------------------------------
    20742074 //the zero-dimensional case
     
    21242124      indep=maxIndependSet(@j);
    21252125   }
    2126  
     2126
    21272127  ideal jkeep=@j;
    21282128
     
    21482148      ideal jwork=std(imap(gnir,@j),@hilb);
    21492149    }
    2150    
     2150
    21512151  }
    21522152  else
     
    21592159  di=dim(jwork);
    21602160  keepdi=di;
    2161  
     2161
    21622162  setring gnir;
    21632163  for(@m=1;@m<=size(indep);@m++)
     
    21752175        attrib(@j,"isSB",1);
    21762176        ideal ser=fetch(gnir,ser);
    2177        
     2177
    21782178     }
    21792179     else
     
    21922192        }
    21932193        ideal ser=phi(ser);
    2194        
    2195      }
    2196      option(noredSB);     
     2194
     2195     }
     2196     option(noredSB);
    21972197     if((deg(@j[1])==0)||(dim(@j)<jdim))
    21982198     {
     
    22502250        }
    22512251        //the primary decomposition of j*K(var(nnp+1),..,var(nva))[..the rest..]
    2252         option(redSB);       
     2252        option(redSB);
    22532253        list uprimary= zero_decomp(@j,ser,@wr);
    22542254        option(noredSB);
     
    23122312     //mentioned above is really computed
    23132313     for(@n=@n3/2+1;@n<=@n2/2;@n++)
    2314      {       
     2314     {
    23152315        if(specialIdealsEqual(quprimary[2*@n-1],quprimary[2*@n]))
    23162316        {
     
    23272327        }
    23282328     }
    2329    
     2329
    23302330     if(size(@h)>0)
    23312331     {
     
    23372337        if(@wr!=1)
    23382338        {
    2339           @q=minSat(jwork,@h)[2];   
     2339          @q=minSat(jwork,@h)[2];
    23402340        }
    23412341        else
     
    23572357        }
    23582358        jwork=std(jwork,@q);
    2359         keepdi=dim(jwork);       
     2359        keepdi=dim(jwork);
    23602360        if(keepdi<di)
    23612361        {
     
    23822382  {
    23832383    keepdi=di-1;
    2384   } 
     2384  }
    23852385  //---------------------------------------------------------------
    23862386  //notice that j=sat(j,gh) intersected with (j,gh^n)
     
    24132413
    24142414        if(size(ser)>0)
    2415         { 
    2416            ser=intersect(htest,ser); 
     2415        {
     2416           ser=intersect(htest,ser);
    24172417        }
    24182418        else
    24192419        {
    24202420          ser=htest;
    2421         } 
     2421        }
    24222422        setring gnir;
    24232423        ser=imap(@Phelp,ser);
    24242424     }
    24252425     if(size(reduce(ser,peek,1))!=0)
    2426      {       
     2426     {
    24272427        for(@m=1;@m<=size(restindep);@m++)
    24282428        {
    24292429         // if(restindep[@m][3]>=keepdi)
    2430          // { 
     2430         // {
    24312431           isat=0;
    24322432           @n2=0;
    24332433           option(redSB);
    2434            
     2434
    24352435           if(restindep[@m][1]==varstr(basering))
    24362436           //this is the good case, nothing to do, just to have the same notations
     
    24592459           }
    24602460           option(noredSB);
    2461            
     2461
    24622462           for (lauf=1;lauf<=size(@j);lauf++)
    24632463           {
     
    25082508           }
    25092509           //the primary decomposition of j*K(var(nnp+1),..,var(nva))[..the rest..]
    2510            
     2510
    25112511           option(redSB);
    25122512           list uprimary= zero_decomp(@j,ser,@wr);
    25132513           option(noredSB);
    2514            
    2515            
     2514
     2515
    25162516           //we need the intersection of the ideals in the list quprimary with the
    25172517           //polynomialring, i.e. let q=(f1,...,fr) in the quotientring such an ideal
     
    25482548           @n2=size(quprimary);
    25492549           @n3=@n2;
    2550            
     2550
    25512551           for(@n1=1;@n1<=size(collectprimary)/2;@n1++)
    25522552           {
     
    25612561              }
    25622562           }
    2563            
    2564            
     2563
     2564
    25652565           //here the intersection with the polynomialring
    25662566           //mentioned above is really computed
     
    26012601              ser=imap(@Phelp,ser);
    26022602           }
    2603            
     2603
    26042604         // }
    2605         }             
     2605        }
    26062606        if(size(reduce(ser,peek,1))!=0)
    26072607        {
     
    26232623        }
    26242624     }
    2625      
     2625
    26262626   }
    26272627  //------------------------------------------------------------
     
    26292629  //the final result: primary
    26302630  //------------------------------------------------------------
    2631  
     2631
    26322632  setring @P;
    26332633  primary=imap(gnir,quprimary);
     
    26662666   if(size(#)>0)
    26672667   {
    2668      il=#[1]; 
     2668     il=#[1];
    26692669   }
    26702670   ideal re=1;
     
    26732673   map phi=@P,qr[2];
    26742674   i=qr[1];
    2675    
     2675
    26762676   list pr=facstd(i);
    26772677
     
    27102710     int odim=dim(pr[1]);
    27112711     int count=1;
    2712    
     2712
    27132713     for(j=2;j<=s;j++)
    27142714     {
     
    27512751   return(phi(j));
    27522752}
    2753  
     2753
    27542754
    27552755///////////////////////////////////////////////////////////////////////////////
     
    27732773      return(ideal(0));
    27742774   }
    2775    
     2775
    27762776   def  @P = basering;
    27772777   list indep,allindep,restindep,fett,@mu;
     
    28332833
    28342834      return(ideal(@p));
    2835    }   
     2835   }
    28362836   //------------------------------------------------------------------
    28372837   //the case of a complete intersection
     
    28492849   if (jdim==0)
    28502850   {
    2851       @j1=finduni(@j); 
     2851      @j1=finduni(@j);
    28522852      for(@k=1;@k<=size(@j1);@k++)
    28532853      {
     
    28642864      return(@j);
    28652865   }
    2866  
     2866
    28672867   //------------------------------------------------------------------
    28682868   //search for a maximal independent set indep,i.e.
     
    28732873
    28742874   indep=maxIndependSet(@j);
    2875  
     2875
    28762876   di=dim(@j);
    28772877
     
    30023002      {
    30033003         fac=ideal(0);
    3004          for(lauf=1;lauf<=ncols(@h);lauf++)   
     3004         for(lauf=1;lauf<=ncols(@h);lauf++)
    30053005         {
    30063006            if(deg(@h[lauf])>0)
     
    30163016         }
    30173017
    3018        
     3018
    30193019         @mu=mstd(quotient(@j+ideal(@q),rad));
    30203020         @j=@mu[1];
    30213021         attrib(@j,"isSB",1);
    3022        
     3022
    30233023      }
    30243024      if((deg(rad[1])>0)&&(deg(collectrad[1])>0))
     
    30353035
    30363036      te=simplify(reduce(te*rad,@j),2);
    3037  
     3037
    30383038      if((dim(@j)<di)||(size(te)==0))
    30393039      {
     
    30493049   {
    30503050      return(rad);
    3051    }   
     3051   }
    30523052  // rad=intersect(rad,radicalKL(@mu,rad,@wr));
    30533053   rad=intersect(rad,radicalKL(@mu,ideal(1),@wr));
     
    30723072      il=#[1];
    30733073   }
    3074    
     3074
    30753075   option(redSB);
    30763076   list m=mstd(i);
     
    30893089        return(quotient(I,J));
    30903090      }
    3091    
     3091
    30923092      for(l=1;l<=cod;l++)
    30933093      {
     
    31073107         if(il==1)
    31083108         {
    3109      
     3109
    31103110            return(radI1);
    31113111         }
     
    31173117            return(radI1);
    31183118         }
    3119          return(intersect(radI1,radicalEHV(I2,re,il)));       
     3119         return(intersect(radI1,radicalEHV(I2,re,il)));
    31203120      }
    31213121   }
     
    31453145  }
    31463146  return(ann);
    3147 } 
    3148  
     3147}
     3148
    31493149//computes all equidimensional parts of the ideal i
    31503150proc prepareAss(ideal i)
     
    31633163  {
    31643164     list re=mres(i,0);             //fehler in sres
    3165   } 
     3165  }
    31663166  for(e=cod;e<=nvars(basering);e++)
    31673167  {
     
    31743174  }
    31753175  return(er);
    3176 } 
     3176}
    31773177
    31783178//computes the annihilator of Ext^n(R/i,R) with given resolution re
     
    31923192     ideal ann=Ann(transpose(re[n]));
    31933193  }
    3194   return(ann);           
     3194  return(ann);
    31953195}
    31963196
     
    32043204      re=intersect1(re,quotient(a,module(b[i])));
    32053205   }
    3206    return(re);   
     3206   return(re);
    32073207}
    32083208
     
    32103210
    32113211proc analyze(list pr)
    3212 { 
     3212{
    32133213   int ii,jj;
    32143214   for(ii=1;ii<=size(pr)/2;ii++)
     
    32303230         }
    32313231      }
    3232    }   
     3232   }
    32333233}
    32343234
     
    32373237{
    32383238  def r=basering;
    3239  
     3239
    32403240  int j,k;
    32413241  map phi;
    32423242  poly p;
    3243  
     3243
    32443244  ideal iwork=i;
    32453245  ideal imap1=maxideal(1);
    32463246  ideal imap2=maxideal(1);
    3247  
     3247
    32483248
    32493249  for(j=1;j<=nvars(basering);j++)
     
    32603260        iwork[k]=var(j);
    32613261        imap1=maxideal(1);
    3262         imap2[j]=-p;       
     3262        imap2[j]=-p;
    32633263        break;
    32643264      }
     
    32683268}
    32693269
    3270        
     3270
    32713271///////////////////////////////////////////////////////
    32723272// ini_mod
     
    38663866            }
    38673867        }
    3868         dimSP=dim(SP);
     3868        dimSP=dim(SP);
    38693869        for(j=size(m);j>=1; j--)
    38703870        {
     
    40634063      {
    40644064        f=polys[k];
    4065         degf=deg(f);
     4065        degf=deg(f);
    40664066      }
    40674067    }
     
    42734273   return(0);
    42744274}
    4275        
    4276        
     4275
     4276
    42774277 proc quotient2(module a,module b)
    42784278{
     
    42914291  setring @newP;
    42924292 ideal re=imap(@newr,re);
    4293  return(re);   
    4294 }
    4295 //Im homogenen Fall system("LaScala",i) verwenden 
     4293 return(re);
     4294}
     4295//Im homogenen Fall system("LaScala",i) verwenden
  • Singular/LIB/primitiv.lib

    r30c91f r82716e  
    1 // $Id: primitiv.lib,v 1.5 1998-05-05 11:55:35 krueger Exp $
     1// $Id: primitiv.lib,v 1.6 1998-05-14 18:45:14 Singular Exp $
    22// author:  Martin Lamm,  email: lamm@mathematik.uni-kl.de
    33// last change:           11.3.98
    44///////////////////////////////////////////////////////////////////////////////
    5 version="$Id: primitiv.lib,v 1.5 1998-05-05 11:55:35 krueger Exp $";
     5version="$Id: primitiv.lib,v 1.6 1998-05-14 18:45:14 Singular Exp $";
    66info="
    77LIBRARY:    primitiv.lib    PROCEDURES FOR FINDING A PRIMITIVE ELEMENT
     
    172172  else { if (find(varnames,"b")==0) { algname="b";}
    173173         else { if (find(varnames,"c")==0)
    174                                     { algname="c";}
     174                                    { algname="c";}
    175175         else { if (find(varnames,"o")==0)
    176                                     { algname="o";}
     176                                    { algname="o";}
    177177         else {
    178178           "** Sorry -- could not find a free name for the primitive element.";
    179179           "** Try e.g. a ring without 'a' or 'b' as variable.";
    180            return();
     180           return();
    181181         }}
    182182       }
     
    245245    ideal convid=maxideal(1);
    246246    convid[1]=nach_splt3_1(primit)[2];
    247     map convert=splt3,convid; 
     247    map convert=splt3,convid;
    248248    zwi=convert(zwi);
    249249    setring neuring;
  • Singular/LIB/sing.lib

    r30c91f r82716e  
    1 // $Id: sing.lib,v 1.10 1998-05-05 11:55:38 krueger Exp $
     1// $Id: sing.lib,v 1.11 1998-05-14 18:45:16 Singular Exp $
    22//system("random",787422842);
    33//(GMG/BM, last modified 26.06.96)
    44///////////////////////////////////////////////////////////////////////////////
    55
    6 version="$Id: sing.lib,v 1.10 1998-05-05 11:55:38 krueger Exp $";
     6version="$Id: sing.lib,v 1.11 1998-05-14 18:45:16 Singular Exp $";
    77info="
    88LIBRARY:  sing.lib      PROCEDURES FOR SINGULARITIES
     
    383383COMPUTE: the spectral numbers of the w-homogeneous polynomial f, computed in a
    384384         ring of charcteristik 0
    385 RETURN:  intvec  d,s1,...,su  where: 
     385RETURN:  intvec  d,s1,...,su  where:
    386386         d = w-degree(f)  and  si/d = ith spectral-number(f)
    387          No return value if basering has parameters or if f is no isolated 
     387         No return value if basering has parameters or if f is no isolated
    388388         singularity, displays a warning in this case
    389389EXAMPLE: example spectrum; shows an example
     
    411411   k = kbase(k);
    412412   for (i=1; i<=size(k); i++)
    413    { 
     413   {
    414414      sp[i]=W+ord(k[i]);
    415415   }
     
    418418   return(sp);
    419419}
    420 example 
     420example
    421421{ "EXAMPLE:"; echo = 2;
    422422   ring r;
     
    529529     module nb = [1]; module pnb;
    530530     dbprint(printlevel-voice+3,"// dim T1 = "+string(vdim(t1)));
    531      if( size(#)>0 ) 
    532      { 
    533         module st1 = t1*gen(1); 
     531     if( size(#)>0 )
     532     {
     533        module st1 = t1*gen(1);
    534534        attrib(st1,"isSB",1);
    535         return(st1,nb,pnb); 
     535        return(st1,nb,pnb);
    536536     }
    537537     return(t1);
     
    719719     {
    720720       kbT1 = 0;
    721      } 
     721     }
    722722     Sx   = fetch(Ox,Sx);
    723723     L = sbt1,sbt2,d1,d2,kbT1,Syz,Sx,t1,t2;
     
    828828       if (ie == 0)
    829829       {
    830         return(0);
     830        return(0);
    831831       }
    832832       if (iv[ie] != 0)
     
    867867   ideal m = x,y;
    868868   attrib(m,"isSB",1);  //let Singular know that ideals are a standard basis
    869    attrib(j,"isSB",1); 
     869   attrib(j,"isSB",1);
    870870   codim(m,j);          // should be 23 (Milnor number -1 of y7-x5)
    871871}
  • Singular/LIB/standard.lib

    r30c91f r82716e  
    1 // $Id: standard.lib,v 1.9 1998-05-14 12:49:28 krueger Exp $
     1// $Id: standard.lib,v 1.10 1998-05-14 18:45:16 Singular Exp $
    22///////////////////////////////////////////////////////////////////////////////
    33
    4 version="$Id: standard.lib,v 1.9 1998-05-14 12:49:28 krueger Exp $";
     4version="$Id: standard.lib,v 1.10 1998-05-14 18:45:16 Singular Exp $";
    55info="
    6 LIBRARY: standard.lib   PROCEDURES WHICH ARE ALWAYS LOADED AT START-UP
     6LIBRARY: standard.lib   PROCEDURES WHICH ARE ALWAYS LOADED AT START-UP
    77
    88 stdfglm(ideal[,ord])   standard basis of the ideal via fglm [and ordering ord]
    9  stdhilbert(ideal)      standard basis of the ideal using the Hilbert function
     9 stdhilbert(ideal)      standard basis of the ideal using the Hilbert function
    1010";
    1111
  • Singular/LIB/tex.lib

    r30c91f r82716e  
    1 // $Id: tex.lib,v 1.6 1998-05-05 11:55:39 krueger Exp $   
     1// $Id: tex.lib,v 1.7 1998-05-14 18:45:19 Singular Exp $
    22//
    33// author : Christian Gorzel email: gorzelc@math.uni-muenster.de
     
    55///////////////////////////////////////////////////////////////////////////////
    66
    7 version="$Id: tex.lib,v 1.6 1998-05-05 11:55:39 krueger Exp $";
     7version="$Id: tex.lib,v 1.7 1998-05-14 18:45:19 Singular Exp $";
    88info="
    99LIBRARY: tex.lib      PROCEDURES FOR TYPESET OF SINGULAROBJECTS IN TEX
    1010                        by Christian Gorzel, send bugs and
    1111                        comments to gorzelc@math.uni-muenster.de
    12  
     12
    1313 closetex(s);         writes closing line for TeX-document
    1414 opentex(s);          writes header for TeX-file s
     
    2525 xdvi(s);             call xdvi for dvi-file s
    2626         (parameters in square brackets [] are optional)
    27  
    28                       Global Variables:
     27
     28  Call example texdemo; to become familiar with the features of tex.lib
     29
     30  Global Variables:
    2931  TeXwidth, TeXnofrac, TeXbrack, TeXproj, TeXaligned, TeXreplace, NoDollars
    30                   are used to control the typesetting 
    31     Call example texdemo; to become familiar with the features of tex.lib
    32 
     32  are used to control the typesetting
    3333
    3434  TeXwidth      : int: -1,0,1..9, >9  controls the breaking of long polynomials
     
    4444///////////////////////////////////////////////////////////////////////////////
    4545
    46 proc closetex(string fname, list #) 
     46proc closetex(string fname, list #)
    4747"USAGE:   closetex(fname[,style]); fname,style = string
    4848RETURN:  nothing; writes a LaTeX2e closing line into file fname
    49 NOTE:    style overwrites the default setting latex2e; maybe latex,amstex,tex 
    50          preceeding \">>\" end ending \".tex\" may miss in fname; 
     49NOTE:    style overwrites the default setting latex2e; maybe latex,amstex,tex
     50         preceeding \">>\" end ending \".tex\" may miss in fname;
    5151         overwriting an existing file is not possible
    5252EXAMPLE: example closetex; shows an example
     
    6868  }
    6969  else {fname = fname + ".tex";}
    70  
     70
    7171  if (default=="tex") {write(fname,"\\bye");}
    72   else { write(fname,"\\end{document}");} 
    73   return(); 
     72  else { write(fname,"\\end{document}");}
     73  return();
    7474}
    7575example
     
    8484"USAGE:   tex(fname[,style]); fname,style = string
    8585RETURN:  nothing; calls latex2e for compiling the file fname
    86 NOTE:    style overwrites the default setting latex2e; maybe latex,amstex,tex 
    87          ending \".tex\" may miss in fname       
     86NOTE:    style overwrites the default setting latex2e; maybe latex,amstex,tex
     87         ending \".tex\" may miss in fname
    8888EXAMPLE: example tex; shows an example
    8989"
    90 { 
     90{
    9191  string default = "latex2e";           // may be changed appropriatly (C.G.)
    9292  int i=1;
     
    126126///////////////////////////////////////////////////////////////////////////////
    127127
    128 proc opentex(string fname, list #)         
     128proc opentex(string fname, list #)
    129129"USAGE:   opentex(fname[,style]); fname,style = string
    130130RETURN:  nothing; writes as LaTeX2e header into a new file fname
    131131NOTE:    suffix .tex may miss in fname
    132          style overwrites the default setting latex2e; may be latex,amstex,tex 
     132         style overwrites the default setting latex2e; may be latex,amstex,tex
    133133EXAMPLE: example opentex; shows an example
    134134"
     
    150150  write(fname,
    151151  "\\newcommand{\\C}{{\\Bbb C}}",
    152   "\\newcommand{\\F}{{\\Bbb F}}", 
     152  "\\newcommand{\\F}{{\\Bbb F}}",
    153153  "\\newcommand{\\N}{{\\Bbb N}}",
    154154 // "\\newcommand{\\P}{{\\Bbb P}}",
     
    158158  "\\newcommand{\\Z}{{\\Bbb Z}}",newline);
    159159  write(fname, "\\begin{document}");
    160   return();   
     160  return();
    161161}
    162162example
     
    168168///////////////////////////////////////////////////////////////////////////////
    169169
    170 proc texdemo(list #) 
     170proc texdemo(list #)
    171171"USAGE:   texdemo();
    172172RETURN:  nothing; generates automatically a LaTeX2e file called: texlibdemo.tex
    173173         explaining the  features of tex.lib and its gloabl variables
    174 NOTE:    this proc takes some minutes         
     174NOTE:    this proc takes some minutes
    175175EXAMPLE: example texdemo; executes the generation
    176176"
     
    181181  if (make_demo) {make_demo=(#[1]=="yes");}
    182182  if(make_demo)
    183   { 
     183  {
    184184   int TeXdemopart = sytem("sh","sh");
    185185   system("random",TeXdemopart);
     
    203203///////////////////////////////////////////////////////////////////////////////
    204204
    205 proc texfactorize(string fname, poly f, list #) 
     205proc texfactorize(string fname, poly f, list #)
    206206"USAGE:   opentex(fname,f); fname = string; f = poly
    207207RETURN:  string, the poly as as product of its irreducible factors
    208208                 in TeX-typesetting if fname == empty string;
    209          otherwise append this to file fname.tex; return nothing 
    210 NOTE:    preceeding \">>\" end ending \".tex\" may miss in fname 
     209         otherwise append this to file fname.tex; return nothing
     210NOTE:    preceeding \">>\" end ending \".tex\" may miss in fname
    211211EXAMPLE: example texfactorize; shows an example
    212212"
     
    224224  else { D = ""; }
    225225  TW = defined(TeXwidth);
    226   if (TW) {Tw = TeXwidth; TeXwidth = -1;} 
     226  if (TW) {Tw = TeXwidth; TeXwidth = -1;}
    227227  else {int TeXwidth = -1; export TeXwidth;}
    228228
     
    241241    if(size(g)>1 or (size(g)==1 and k>1))
    242242    { t = "(" + texpoly("",l[1][i]) + ")";}
    243     else { t =  texpoly("",l[1][i]);} 
     243    else { t =  texpoly("",l[1][i]);}
    244244    if (l[2][i]>1)
    245245    { t = t+"^{" +string(l[2][i]) + "}";}
     
    250250   if (TW) {TeXwidth = Tw;}
    251251  }
    252   if(size(fname)) 
     252  if(size(fname))
    253253  { i=1;
    254254    while (fname[i]==">"){i++;}
     
    271271  minpoly = a2 +a +3;
    272272  poly f = (a24x5 + x3)*a2x6*(x+1)^2;
    273   f; 
     273  f;
    274274  texfactorize("",f);
    275275}
     
    280280RETURN:  string, the map m from @r1 to @r2 preeceded by its name if m = string
    281281                 in TeX-typesetting if fname == empty string;
    282          otherwise append this to file fname.tex; return nothing 
    283 NOTE:    preceeding \">>\" end ending \".tex\" may miss in fname 
     282         otherwise append this to file fname.tex; return nothing
     283NOTE:    preceeding \">>\" end ending \".tex\" may miss in fname
    284284EXAMPLE: example texmap; shows an example
    285285"
    286 { 
     286{
    287287  int saveDollars= defined(NoDollars);
    288288  int TX = defined(TeXwidth);
     
    300300  { int i;
    301301
    302     for(i=1;i<=size(TeXreplace);i++) 
     302    for(i=1;i<=size(TeXreplace);i++)
    303303    { if (TeXreplace[i][1]==s) {s= TeXreplace[i][2]; break;}}
    304304    return(s);
    305305  }
    306  
     306
    307307// --- store all actual informations
    308308  if(TX) { Tw = TeXwidth; TeXwidth = -1;}
     
    358358  t = t + texpoly("",@J[1]);
    359359  for (i=2;i<=n; i++)
    360   {if(defined(TeXaligned)) 
     360  {if(defined(TeXaligned))
    361361   { t = t + vrg + texpoly("",@J[i]); }
    362362   else { t = t + "\\\\" + newline + texpoly("",@J[i]);}
     
    408408  else {return(s);}
    409409}
    410 example 
     410example
    411411{ "EXAMPLE:"; echo = 2;
    412412  string fname = "tldemo";
     
    421421  texmap("",phi,r1,r2,"\\C");
    422422  kill r1,r2,TeXreplace,TeXaligned;
    423 }       
     423}
    424424///////////////////////////////////////////////////////////////////////////////
    425425
    426 proc texname(string fname, string s) 
     426proc texname(string fname, string s)
    427427"USAGE:   texname(fname,s);  fname,s = string
    428428RETURN:  the string s if fname == the empty string \"\" ;
    429          otherwise append s to file fname.tex; return nothing 
    430 NOTE:    preceeding \">>\" end ending \".tex\" may miss in fname;         
     429         otherwise append s to file fname.tex; return nothing
     430NOTE:    preceeding \">>\" end ending \".tex\" may miss in fname;
    431431EXAMPLE: example texname; shows an example
    432432"
     
    455455  if (s[i]=="[") { anf = i+1;
    456456   while(s[i]!="]"){i++;}                    // matrices and vectors
    457     st = st + "_{" + s[anf,i-anf] + "}"; n = n+ 5*(i-anf); i++; 
     457    st = st + "_{" + s[anf,i-anf] + "}"; n = n+ 5*(i-anf); i++;
    458458  // besser: while s[i]<> nwline : scan forward: end, return
    459459  }
     
    465465  n = n+5*(i-anf);
    466466  anf =i;            // the next text in ( , ) as exponent
    467   if (op) { if (s[i]== ","){anf = anf+1;}             
     467  if (op) { if (s[i]== ","){anf = anf+1;}
    468468   while(s[i] !=")"){ i++;}
    469469   if (i<>anf){st = st + "^{" + s[anf,i-anf] + "}"; n = n +5*(i-anf);}
     
    504504"USAGE:   texobj(fname,l); fname = string,l = list of Singular dataypes
    505505RETURN:  string, the objects in TeX-typesetting if fname == empty string;
    506          otherwise append this to file fname.tex; return nothing   
    507 NOTE:    preceeding \">>\" end ending \".tex\" may miss in fname;         
     506         otherwise append this to file fname.tex; return nothing
     507NOTE:    preceeding \">>\" end ending \".tex\" may miss in fname;
    508508EXAMPLE: example texobj; shows an example
    509509"
     
    517517 string sep= ",";
    518518 string D,DA,DE = "$","\\begin{equation*}","\\end{equation*}"+ newline;
    519  string OB,CB = "(",")"; 
     519 string OB,CB = "(",")";
    520520 if (defined(TeXbrack))
    521521 {// if (TeXbrack=="(") {OB = "("; CB = ")";}
     
    536536 proc absterm(poly f)
    537537 { int k;
    538    
     538
    539539   for (k=1; k<=nvars(basering); k++)
    540540   { f = subst(f,var(k),0); }
     
    544544
    545545 if (size(#)==1)
    546  { if (typeof(#[1])=="int" or typeof(#[1])=="intvec" or typeof(#[1])=="vector" 
     546 { if (typeof(#[1])=="int" or typeof(#[1])=="intvec" or typeof(#[1])=="vector"
    547547   or typeof(#[1])=="number" or defined(TeXaligned)) { DA = D; DE = D; } }
    548548
     
    551551 for (k=1; k<=size(#); k++)
    552552 { def obj = #[k];
    553    if (typeof(obj) == "string") 
     553   if (typeof(obj) == "string")
    554554   { if (defined(`obj`))
    555      { if (typeof(`obj`)=="ideal") 
     555     { if (typeof(`obj`)=="ideal")
    556556       { Iname = obj; def e = `obj`;
    557557         kill obj; def obj = e; kill e;}
     
    561561   }
    562562   if (typeof(obj) == "int") { s = s + "  " + string(obj) + "  ";}
    563  
    564    if (typeof(obj) == "intvec") 
     563
     564   if (typeof(obj) == "intvec")
    565565   { s = s + "  (";
    566566     for(j=1; j<size(obj);j++) { s = s + string(obj[j]) + sep;}
     
    568568   }
    569569
    570    if (typeof(obj) == "number" ) 
     570   if (typeof(obj) == "number" )
    571571   { s = s + texpoly("",obj) + newline;
    572572   }
     
    580580   }
    581581
    582    if (typeof(obj) == "vector") 
     582   if (typeof(obj) == "vector")
    583583   { if (obj==0) { s = s + D + "0" + D;}
    584584     else
     
    590590    }
    591591
    592    if (typeof(obj) == "ideal") 
     592   if (typeof(obj) == "ideal")
    593593   { if (size(Iname))   // verwende hier align
    594594     { if (Tw==0) {TeXwidth = -1;}
    595595       s =  s + "\\begin{array}{rcl}" + newline;
    596596       for (i=1;i<=size(matrix(obj));i++)
    597        { s =  s + Iname+ "_{" + string(i) + "} & = & " 
     597       { s =  s + Iname+ "_{" + string(i) + "} & = & "
    598598               + texpoly("",obj[i]);
    599599         if (i<size(matrix(obj))){ s = s  + "\\\\" + newline;}
     
    604604       Iname ="";
    605605     }
    606      else 
    607      { 
    608       if (TeXwidth==0) 
     606     else
     607     {
     608      if (TeXwidth==0)
    609609      { obj= simplify(obj,2);
    610610        linear = 1;
     
    625625        }
    626626        else   // linear
    627         { s = s + 
     627        { s = s +
    628628   "\\begin{array}{*{" + string(2*nvars(basering)-1) + "}{c}cr}" + newline;
    629            for(j=1; j<=size(obj);j++) 
    630            { h = absterm(obj[j]); 
     629           for(j=1; j<=size(obj);j++)
     630           { h = absterm(obj[j]);
    631631             ineq = attrib(obj[j],"ineq");
    632632             if(!(size(ineq))) { ineq = "=" ; }
     
    639639                { if (t[1]!="-" and t[1]!= " " and nc ){sg = "+";}
    640640                  if  (t[1]=="-") { sg = "-"; nc =1; t=t[2,size(t)-1];}
    641                   if (t==" ") {sg ="";} 
     641                  if (t==" ") {sg ="";}
    642642                  l = l + " & " + sg + " & " + t;
    643643                }
     
    657657     if (defined(TeXaligned))
    658658     { s = s + texpoly("",obj,",");
    659      } 
     659     }
    660660     else
    661661     { s = s + newline + "\\begin{array}{c}" + newline +
    662                texpoly("",obj,", \\\\" + newline) + 
     662               texpoly("",obj,", \\\\" + newline) +
    663663                newline + "\\end{array}" + newline;
    664664     }
    665665    s = s + "\\right" + CB;
    666     } // end TeXwidth <> 0 
     666    } // end TeXwidth <> 0
    667667   }  // not Iname
    668668// s;
    669669  }
    670670
    671    if (typeof(obj) == "module") 
     671   if (typeof(obj) == "module")
    672672   { M = matrix(obj);
    673673     if (Tw ==0 or Tw > 9) { TeXwidth = -1;}
     
    675675     if (!(defined(TeXaligned)))
    676676     {  // Naechste Zeile nicht notwendig !
    677      // s = s + "\\begin{array}{*{"+ string(ncols(M)) + "}{c}}" + newline; 
    678       for(j=1;j<=ncols(M);j++) 
     677     // s = s + "\\begin{array}{*{"+ string(ncols(M)) + "}{c}}" + newline;
     678      for(j=1;j<=ncols(M);j++)
    679679      { l = "\\left" + OB + newline + "\\begin{array}{c}" + newline;
    680680        l = l + texpoly("",ideal(M[j]), " \\\\" + newline)
     
    685685     }
    686686     else    // TeXaligned
    687      { 
    688       for(j=1;j<=ncols(M);j++) 
     687     {
     688      for(j=1;j<=ncols(M);j++)
    689689      { s = s + "\\left" + OB + newline +
    690690                texpoly("",ideal(M[j]),",") + newline + "\\right" + CB;
     
    699699   { if (Tw==0 or Tw > 9) {TeXwidth = -1;}
    700700     M = transpose(obj);
    701      s = s + "\\left" + OB + newline + 
     701     s = s + "\\left" + OB + newline +
    702702             "\\begin{array}{*{"+ string(ncols(obj)) + "}{c}" + "}"+ newline;
    703703     for(i=1;i<=ncols(M);i++)
     
    706706     }
    707707     l = l + newline;
    708      s = s + l + "\\end{array}" + newline + 
     708     s = s + l + "\\end{array}" + newline +
    709709                 "\\right" + CB + newline;
    710710    TeXwidth = Tw;
    711711  }
    712  
     712
    713713   if (typeof(obj) == "intmat")
    714714   { nr,nc = nrows(obj),ncols(obj);
    715715     l = "";
    716      l =  "\\left" + OB + newline + 
     716     l =  "\\left" + OB + newline +
    717717          "\\begin{array}{*{"+ string(nc) + "}{r}}"+ newline;
    718718     for(i=1;i<=nr;i++)
    719      { for(j=1;j<=nc;j++) 
     719     { for(j=1;j<=nc;j++)
    720720       { l = l + string(obj[i,j]);
    721721         if (j <nc ) { l = l + " & ";}
     
    723723       }
    724724     }
    725      l = l + newline + "\\end{array}" + newline + 
     725     l = l + newline + "\\end{array}" + newline +
    726726             "\\right" + CB + newline;
    727     s = s + l; 
     727    s = s + l;
    728728  }
    729729
     
    766766///////////////////////////////////////////////////////////////////////////////
    767767
    768 proc texproc(string fname,string pname) 
     768proc texproc(string fname,string pname)
    769769"USAGE:   opentex(fname,pname); fname,pname = string
    770 RETURN:  string, the proc in a verbatim environment in TeX-typesetting 
     770RETURN:  string, the proc in a verbatim environment in TeX-typesetting
    771771                 if fname == empty string;
    772          otherwise append this to file fname.tex; return nothing 
    773 NOTE:    preceeding \">>\" end ending \".tex\" may miss in fname; 
    774 CAUTION: texproc cannot applied on itself correctly         
     772         otherwise append this to file fname.tex; return nothing
     773NOTE:    preceeding \">>\" end ending \".tex\" may miss in fname;
     774CAUTION: texproc cannot applied on itself correctly
    775775EXAMPLE: example texproc; shows an example
    776776"
     
    810810    { if(fname[size(fname)-3,4]!=".tex") {fname = fname +".tex"; }
    811811    }
    812     else {fname = fname + ".tex";} 
     812    else {fname = fname + ".tex";}
    813813    write(fname,s);
    814814  }
    815   else{return(s);}     
     815  else{return(s);}
    816816}
    817817example
     
    828828  }
    829829  export exp;
    830   texproc("","exp"); 
     830  texproc("","exp");
    831831}
    832832
    833833///////////////////////////////////////////////////////////////////////////////
    834834
    835 proc texring(string fname, def r, list #) 
     835proc texring(string fname, def r, list #)
    836836"USAGE:   texring(fname, r[,l]); fname = string; r = ring;
    837837                                l=list of strings : controls the symbol for
    838                                 coefficint field etc. see example texdemo(); 
     838                                coefficint field etc. see example texdemo();
    839839RETURN:  string, the ring in TeX-typesetting if fname == empty string;
    840          otherwise append this to file fname.tex; return nothing   
    841 NOTE:    preceeding \">>\" end ending \".tex\" may miss in fname;       
     840         otherwise append this to file fname.tex; return nothing
     841NOTE:    preceeding \">>\" end ending \".tex\" may miss in fname;
    842842EXAMPLE: example texring; shows an example
    843843"
    844 { 
     844{
    845845  int i,galT,flag,mipo,nopar,Dollars,TB,TA;
    846846  string ob,cb,cf,en,s,t,savebrack; //opening bracket, closing br, coef.field
     
    849849
    850850  proc tvar(intvec v)
    851   { 
     851  {
    852852    int i,j,ldots;
    853853    string s;
    854    
     854
    855855    j = 1;
    856856    s = texpoly("",var(1));
    857    
     857
    858858    if (nvars(basering)==1) { return(s);}
    859859    if (nvars(basering)==2) { return(s + "," + texpoly("",var(2)));}
     
    867867        ldots =1;
    868868      }
    869       if (i== v[j]) 
     869      if (i== v[j])
    870870      { s = s + "," + texpoly("",var(i));
    871871        ldots =0;
     
    896896  if (size(#))
    897897  { if (typeof(#[1])=="list") { # = #[1];}
    898   } 
     898  }
    899899  for (i=1;i<=size(#);i++)
    900900  { flag =0;
     
    932932  if (v!=0 and size(nvars(r))>3)
    933933  { s = s + tvar(v);}
    934   else 
     934  else
    935935  { for(i=1;i<nvars(r);i++) {s = s + texpoly("",var(i)) + ",";}
    936936    s = s + texpoly("",var(nvars(r)));
    937   } 
     937  }
    938938   s = s + cb + en;
    939939
    940940  if (typeof(r)=="qring")
    941941  { ideal @I = ideal(r);
    942     if (defined(TeXbrack)) 
     942    if (defined(TeXbrack))
    943943    {
    944       TB =1; savebrack = TeXbrack; 
     944      TB =1; savebrack = TeXbrack;
    945945      if (TeXbrack!= "<" and TeXbrack!="(") { TeXbrack = "<";}
    946946    }
     
    955955  }
    956956
    957   if (Dollars) 
     957  if (Dollars)
    958958  { kill NoDollars;
    959959    s =  "$" + s + "$";
     
    971971  }
    972972  else{return(s);}
    973 } 
     973}
    974974example
    975975{ "EXAMPLE:"; echo=2;
    976976  ring r0 = 0,(x,y,z),dp;       // short varnames polynomial ordering
    977977  texring("",r0);
    978   ring r7 =0,(x(0..2)),ds;      // char =7, long varnames 
     978  ring r7 =0,(x(0..2)),ds;      // char =7, long varnames
    979979  texring("",r7);
    980980  ring r1 = 0,(x1,x2,y1,y2),wp(1,2,3,4);
     
    985985  texring("",rr);
    986986  ring r;
    987   texring("",r); 
     987  texring("",r);
    988988  ring rabc =(0,t1,t2,t3),(x,y),dp;  // parameters
    989989  texring("",rabc);
     
    993993 // texring("",ralg,"mipo");
    994994  ring r49=(49,a),x,dp;              // Galoisfield
    995   texring("",r49); 
     995  texring("",r49);
    996996  setring r0;
    997997  ideal i = x2-z,xy2+1;
     
    10051005  intvec v = 5,6;
    10061006  texring("",rxy,v);
    1007   texring("",r0,"C","{"); 
     1007  texring("",r0,"C","{");
    10081008  texring("",ralg,"k");
    10091009  texring("",r7,"^G");
     
    10211021proc rmx(string fname)
    10221022"USAGE:   rmx(fname); fname = string
    1023 RETURN:  nothing; removes .log and .aux files associated to file <fname>     
     1023RETURN:  nothing; removes .log and .aux files associated to file <fname>
    10241024         removes tex and xdvi file too, if suffix \".tex\" or \".dvi\" is given
    1025 NOTE:    if fname ends by .dvi or .tex 
    1026          fname.dvi or fname.dvi and fname.tex will be deleted, too           
     1025NOTE:    if fname ends by .dvi or .tex
     1026         fname.dvi or fname.dvi and fname.tex will be deleted, too
    10271027EXAMPLE: example rmx; shows an example
    10281028"
     
    10381038    if (fname[size(fname)-3,4]==".dvi") { suffix = 1; }
    10391039    fname = fname[1,size(fname)-4];
    1040   } 
     1040  }
    10411041  system("sh","rm " + fname + ".aux");
    10421042  system("sh","rm " + fname + ".log");
     
    10781078  int i=1;
    10791079  string default = "xdvi";            // may be changed appropriatly (C.G.)
    1080  
     1080
    10811081  while (fname[i]==">") {i++;}
    10821082  fname = fname[i,size(fname)-i+1];
     
    11031103  pause;
    11041104  echo = 2;
    1105   system("sh","rm -i exp00?.*"); 
     1105  system("sh","rm -i exp00?.*");
    11061106}
    11071107///////////////////////////////////////////////////////////////////////////////
    11081108
    11091109proc texpoly(string fname,def p,list #)
    1110 { 
     1110{
    11111111  def @r = basering;
    11121112
     
    11161116  string sign,cfmt,pt,s,bg,t,monomt;
    11171117  string sep = newline;
    1118   int i,b,b2,n, msz,linesz, count,k; 
     1118  int i,b,b2,n, msz,linesz, count,k;
    11191119  int realT, parT, galT;
    11201120  int C = 2 + defined(TeXdisplay);
    1121    
     1121
    11221122
    11231123
    11241124  proc parsr(string s)                     // parse real
    1125   { string t; 
    1126                              
    1127     if (s=="      Inf") { return("\\infty",3);}   
     1125  { string t;
     1126
     1127    if (s=="      Inf") { return("\\infty",3);}
    11281128    if (s=="     -Inf") { return("\\-infty",6);}
    11291129    if (s[7]=="-"){t ="-";}
    11301130    if (s[8]<>"0"){t = t + s[8];}
    11311131    if (s[9]<>"0" or s[8]<>"0"){t = t + s[9];}
    1132     if (size(t)) 
     1132    if (size(t))
    11331133    { if (t=="1") {return(s[1,5]+"*10",21);}
    11341134      if (size(t)>1) {return(s[1,5]+"*10^{"+t+"}",21+2*size(t));}
     
    11411141  { int i,j = 1,1;
    11421142    string t;
    1143    
     1143
    11441144    if (short)
    1145     { t =s[1]; 
     1145    { t =s[1];
    11461146     if(size(s)>1) {return(t+"^{" + s[2,size(s)-1] + "}",3+2*(size(s)-1));}
    1147      else{return(t,5);}     
     1147     else{return(t,5);}
    11481148    }
    11491149    else
    11501150    { return(parselong(s+"!"));}
    11511151  }
    1152  
     1152
    11531153  if (defined(TeXdisplay)) { bg = "& ";}
    11541154  if (!(defined(TeXwidth))) { int TeXwidth = -1; export TeXwidth;}
    11551155  if (typeof(p)=="poly" or typeof(p)=="number") {I = p;}
    1156   if (typeof(p)=="ideal") 
     1156  if (typeof(p)=="ideal")
    11571157  { I = p;
    11581158    if(size(#)){ sep = #[1];}
    11591159  }
    11601160
    1161   if (I==0) 
     1161  if (I==0)
    11621162  { if (!(defined(NoDollars))){return("$0$");}
    11631163    else {return("0");}
    11641164  }
    11651165
    1166 //--------------------- 
     1166//---------------------
    11671167
    11681168
    11691169//------- set flags: --------------------------------------------------------
    1170    
     1170
    11711171  if (size(#))
    11721172  { if (typeof(#[1])=="int") { linesz = #[1];}
     
    11801180  { t = charstr(@r)[1,i-1];
    11811181    galT = (t <> string(char(@r)));  // the char is not the same as the ...
    1182   } 
     1182  }
    11831183  i = 0;
    1184  
     1184
    11851185//------- parse the polynom
    11861186  pt = bg;
    1187  
     1187
    11881188 for(k=1;k<=size(matrix(I));k++)
    11891189 { i = 0; linesz = 0; count =0;
    1190    sign =""; 
     1190   sign ="";
    11911191   f = I[k];
    11921192   if (f==0) { pt = pt + "0";}
     
    11951195
    11961196// ------ tex the coefficient
    1197     monom = lead(f);   
    1198     f = f - monom;       
     1197    monom = lead(f);
     1198    f = f - monom;
    11991199    cfm = leadcoef(monom);
    12001200    monom = monom/cfm;                  // the normalized monom
    12011201    s = string(monom) + "!";            // add an terminating sign
    12021202    cfmt = "";
    1203    
     1203
    12041204    if (defined(TeXreplace)) { short =0;}  // this is essential
    12051205    cfmt = string(cfm);
     
    12251225     if (b) {b++;}
    12261226     n = size(cfmt);
    1227      if (!(parT) and  !(realT) and !(galT))   
    1228      { if( !(b2) or defined(TeXnofrac)) 
     1227     if (!(parT) and  !(realT) and !(galT))
     1228     { if( !(b2) or defined(TeXnofrac))
    12291229       {monomt = cfmt; msz = size(monomt);}
    12301230       else
     
    12401240// -- now parse the monom
    12411241    if (monom <> 1)
    1242     { i = 1;   
     1242    { i = 1;
    12431243      if(short)
    12441244      {                   while(s[i]<>"!")
    1245         { monomt = monomt + s[i]; i++; 
     1245        { monomt = monomt + s[i]; i++;
    12461246          b = i;
    12471247          msz = msz + 3; //the was the single lettered var
     
    12591259      }
    12601260    }
    1261    
     1261
    12621262
    12631263
    12641264   if (TeXwidth > 10 and (linesz + msz > 2*TeXwidth) and linesz) {
    12651265   pt = pt + "\\\\" + newline +bg; linesz = 0; }
    1266    else { linesz = linesz + msz; } 
     1266   else { linesz = linesz + msz; }
    12671267   pt = pt + sign + monomt;
    12681268   sign = "+";
     
    12871287   }
    12881288  else {return(pt);}
    1289 }   
     1289}
    12901290example
    12911291{ "EXAMPLE:"; echo =2;
     
    12941294  texpoly("",f);
    12951295  texpoly("",2x2y23z);
    1296  
     1296
    12971297
    12981298  ring rr= real,(x,y),dp;
     
    13051305  f;
    13061306  texpoly("",f);
    1307 }     
     1307}
    13081308
    13091309proc parsp(string cfmt, int b)
     
    13471347"
    13481348{ int i,j =1,-1;
    1349   int b,k,jj,mz;                         // begin and end 
     1349  int b,k,jj,mz;                         // begin and end
    13501350  int saveshort=short;
    13511351            string t,c,vn,nom,denom,sg;
     
    13581358    { b=i; j++;
    13591359      while(s[i]>="0" and s[i]<="9" or (s[i]=="+" or s[i]=="-") and s[i]!="!")
    1360       {i++;}     // scan the number 
     1360      {i++;}     // scan the number
    13611361        t =s[b,i-b];
    13621362    //  if (t=="-1" and s[i]!="!" and s[i]!="-" and s[i]!="+"){t = "-";}
    13631363      if (t=="-1" and (s[i]<="0" or s[i]>="9") and s[i]!= "/" and s[i]!="!")
    13641364       {
    1365      t = "-";} 
    1366       if (s[i]=="/")     
     1365     t = "-";}
     1366      if (s[i]=="/")
    13671367      { i++;
    13681368        sg = "";
     
    13721372        }
    13731373        else { nom = t;}
    1374         b =i; 
     1374        b =i;
    13751375        while(s[i]>="0" and s[i]<="9") {i++;}
    13761376        denom = s[b,i-b];
     
    13801380        { t = sg + "(" + nom + "/" + denom + ")";
    13811381        }
    1382       } 
     1382      }
    13831383      c = c + t;
    13841384      if(s[i]!="!"){c = c + s[i]; i++;}      // the parameter
     
    13901390   }
    13911391   else                         // if not short ....
    1392    { while (s[i] <> "!") 
     1392   { while (s[i] <> "!")
    13931393     { b=i; j++;
    13941394       while(s[i]=="-" or s[i]=="+" or (s[i]>="0" and s[i]<="9")){i++;}
    13951395       t = s[b,i-b];
    13961396       if (t=="-1" and s[i]=="*" ) {t="-";}
    1397       if (s[i]=="/") 
     1397      if (s[i]=="/")
    13981398      { i++;
    13991399        sg = "";
     
    14031403        }
    14041404        else { nom = t;}
    1405         b =i; 
     1405        b =i;
    14061406        while(s[i]>="0" and s[i]<="9") {i++;}
    14071407        denom = s[b,i-b];
     
    14111411        { t = sg + "(" + nom + "/" + denom + ")";
    14121412        }
    1413       } 
    1414        c = c+t; t="";   
    1415        if (s[i]=="*"){i++;} 
     1413      }
     1414       c = c+t; t="";
     1415       if (s[i]=="*"){i++;}
    14161416       b=i;
    14171417       while(s[i]!="+" and s[i]!="-" and s[i]!="!")  //pass a monom
    1418        { // start with letters 
     1418       { // start with letters
    14191419        // alternativ:
    14201420        while((s[i]>="a" and s[i]<="z") or (s[i]>="A" and s[i]<="Z")){i++;}
    1421              k = i-b; 
     1421             k = i-b;
    14221422        vn = s[b,k];
    14231423        if (defined(TeXreplace))
    1424         { for (jj=1; jj<= size(TeXreplace);jj++) 
    1425          { if (vn == TeXreplace[jj][1]) 
     1424        { for (jj=1; jj<= size(TeXreplace);jj++)
     1425         { if (vn == TeXreplace[jj][1])
    14261426           {vn = TeXreplace[jj][2]; k=1;
    1427              if (s[i]=="*") {vn = vn + " ";} 
     1427             if (s[i]=="*") {vn = vn + " ";}
    14281428            break;} //suppose replacing by a single sign
    14291429         }
     
    14591459  f;
    14601460  parst(string(f));
    1461  
     1461
    14621462  f =(-a +4b2 -2);
    14631463  f;
    14641464  parst(string(f));
    1465  
     1465
    14661466  f = a23;
    14671467  f;
     
    14791479
    14801480proc parselong(string s)
    1481 { 
     1481{
    14821482  int i,j,k,b,mz;
    14831483  string t,vn;              // varname
    1484  
     1484
    14851485 // "s=" + s;
    1486   i = 1; 
    1487   while (s[i] <> "!") 
    1488   { b=i;     
    1489    
     1486  i = 1;
     1487  while (s[i] <> "!")
     1488  { b=i;
     1489
    14901490// -- scan now the letter ...
    14911491
     
    14961496 { i++;}
    14971497 // s[i]; i;
    1498    k = i-b; 
     1498   k = i-b;
    14991499   vn = s[b,k];
    15001500
    15011501   if (defined(TeXreplace))
    1502    { for (j=1; j<= size(TeXreplace);j++) 
    1503      { if (vn == TeXreplace[j][1]) 
     1502   { for (j=1; j<= size(TeXreplace);j++)
     1503     { if (vn == TeXreplace[j][1])
    15041504       {vn = TeXreplace[j][2]; k=1;
    1505         if (s[i]=="*") {vn = vn + " ";} 
     1505        if (s[i]=="*") {vn = vn + " ";}
    15061506         break;} //suppose replacing by a single sign
    15071507     }
     
    15281528}
    15291529example
    1530 { "EXAMPLE:"; echo =2; 
     1530{ "EXAMPLE:"; echo =2;
    15311531  ring r =(49,a),x,dp;
    15321532  number f = a13;
     
    15351535  TeXreplace[1] = list("b","\\beta");
    15361536  TeXreplace[2] = list("a","\\alpha");
    1537   TeXreplace[3] = list("c","\\gamma"); 
     1537  TeXreplace[3] = list("c","\\gamma");
    15381538  parselong(string(f)+"!");
    15391539}
  • Singular/LIB/tst.lib

    r30c91f r82716e  
    1 // $Id: tst.lib,v 1.4 1998-05-05 11:55:40 krueger Exp $
     1// $Id: tst.lib,v 1.5 1998-05-14 18:45:19 Singular Exp $
    22//(obachman, last modified 2/13/98)
    33///////////////////////////////////////////////////////////////////////////////
    44
    5 version="$Id: tst.lib,v 1.4 1998-05-05 11:55:40 krueger Exp $";
     5version="$Id: tst.lib,v 1.5 1998-05-14 18:45:19 Singular Exp $";
    66info="
    77LIBRARY:  tst.lib      PROCEDURES FOR RUNNING AUTOMATIC TST TESTS
    88
    99 tst_system(s)          returns string which is stdout of system(\"sh\", s)
    10  tst_ignore(any,[keyword], [link]) writes string(any) to link (or stdout), 
     10 tst_ignore(any,[keyword], [link]) writes string(any) to link (or stdout),
    1111                                   prepending prefix \"// ignore:\"
    12  tst_init()             writes some identification data to stdout 
     12 tst_init()             writes some identification data to stdout
    1313                        with tst_ignore
    1414";
     
    2424  string tmpfile = "/tmp/tst_" + string(system("pid"));
    2525  int errno;
    26  
     26
    2727  s = s + " 1>" + tmpfile + " 2>&1";
    2828  errno = system("sh", s);
     
    3838}
    3939
    40  
     40
    4141proc tst_ignore
    42 "USAGE:    tst_ignore(any,[keyword], [link]) 
     42"USAGE:    tst_ignore(any,[keyword], [link])
    4343            any     -- valid argument to string()
    4444            keyword -- one of \"time\" or \"memory\"
    45             link    -- a link which can be written to 
    46 RETURN:   none; writes string(any) to link (or stdout, if no link given), 
    47           prepending prefix \"// ignore:\", or \"// ignore: time:\", 
     45            link    -- a link which can be written to
     46RETURN:   none; writes string(any) to link (or stdout, if no link given),
     47          prepending prefix \"// ignore:\", or \"// ignore: time:\",
    4848          \"//ignore: memory:\"  if called with the respective keywords;
    49           should be used in tst files to output system dependent data 
    50           (like date, pathnames) { and timings With the keyword \"time\", 
     49          should be used in tst files to output system dependent data
     50          (like date, pathnames) { and timings With the keyword \"time\",
    5151          resp. memory usage with the keyword \"memory\"
    5252EXAMPLE:  example tst_ignore; shows examples
     
    5656  string keyword = "";
    5757  link outlink = "";
    58  
     58
    5959  // Check # of args
    6060  if (size(#) < 1 || size(#) > 3)
     
    6464    return;
    6565  }
    66  
     66
    6767  // Get Args
    6868  s = string(#[1]);
     
    8383    }
    8484  }
    85  
     85
    8686  // check args
    8787  if (typeof(keyword) != "string")
     
    102102    }
    103103  }
    104  
     104
    105105  if (status(outlink, "open", "no"))
    106106  {
     
    114114    return;
    115115  }
    116  
     116
    117117  // ready -- do the actual work
    118118  write(outlink, "// ignore: " + keyword + s);
     
    120120example
    121121{
    122   "EXAMPLE";   
     122  "EXAMPLE";
    123123  "System independent data can safely be output in tst files;";
    124124  "However, system dependent data like dates, or pathnames, should be output";
     
    151151
    152152
    153  
     153
Note: See TracChangeset for help on using the changeset viewer.