Changeset 458174a in git for Singular/LIB/fpaprops.lib


Ignore:
Timestamp:
May 2, 2018, 10:45:42 AM (6 years ago)
Author:
Karim Abou Zeid <karim23697@…>
Branches:
(u'spielwiese', 'ec94ef7a30b928574c0c3daf41f6804dff5f6b69')
Children:
0f987ab443ee33e628ea90f02a2fddfb9d8fa497
Parents:
75def9c8a4972706cb710a11c07681ad43676aed2ba25ee7ea3c483c73847576db73cb6464bc67ba
Message:
Merge branch 'spielwiese' into stable
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/fpaprops.lib

    r2ba25e r458174a  
    1818
    1919PROCEDURES:
    20   lpNoetherian(<GB>);     check whether A/<GB> is (left/right) noetherian
     20  lpNoetherian(<GB>);     check whether A/<LM(GB)> is (left/right) Noetherian
    2121  lpIsSemiPrime(<GB>);    check whether A/<LM(GB)> is semi prime
    2222  lpIsPrime(<GB>);        check whether A/<LM(GB)> is prime
     
    3333"USAGE: lpNoetherian(G); G an ideal in a Letterplace ring
    3434RETURN: int
    35 @*      0 not noetherian
    36 @*      1 left noetherian
    37 @*      2 right noetherian
    38 @*      3 noetherian
    39 PURPOSE: Check whether A/<G> is (left/right) noetherian
     35@*      0 not Noetherian
     36@*      1 left Noetherian
     37@*      2 right Noetherian
     38@*      3 Noetherian
     39@*      4 weak Noetherian
     40PURPOSE: Check whether the monomial algebra A/<LM(G)> is (left/right) noetherian
    4041ASSUME: - basering is a Letterplace ring
    4142@*      - G is a Groebner basis
     43THEORY: lpNoetherian works with the monomial algebra A/<LM(G)>.
     44If it gives an affirmative answer for one of the properties, then it
     45holds for both A/<LM(G)> and A/<G>. However, a negative answer applies
     46only to A/<LM(G)> and not necessarily to A/<G>.
     47NOTE: Weak Noetherian means that two-sided ideals in A/<LM(G)> satisfy
     48the acc (ascending chain condition).
    4249"
    4350{
     
    9198  intvec visited;
    9299  visited[ncols(UG)] = 0;
    93   int inFlag, outFlag;
     100  int inFlag, outFlag, inOutFlag;
    94101  for (int v = 1; v <= ncols(UG) && (inFlag + outFlag) != 3; v++) {
    95     int inOutFlags = inOrOutCommingEdgeInCycle(UG, v, visited, 0);
     102    int inOutFlags = inOutCommingEdgesInCycles(UG, v, visited, 0);
    96103    if (inOutFlags == 1) {
    97104      inFlag = 1;
    98105    }
    99106    if (inOutFlags == 2) {
    100       outFlag = 2;
     107      outFlag = 1;
    101108    }
    102109    if (inOutFlags == 3) {
    103110      inFlag = 1;
    104       outFlag = 2;
     111      outFlag = 1;
     112    }
     113    if (inOutFlags == 4) {
     114      inOutFlag = 1;
     115    }
     116    if (inOutFlags == 5) {
     117      inFlag = 1;
     118      inOutFlag = 1;
     119    }
     120    if (inOutFlags == 6) {
     121      outFlag = 1;
     122      inOutFlag = 1;
     123    }
     124    if (inOutFlags == 7) {
     125      inFlag = 1;
     126      outFlag = 1;
     127      inOutFlag = 1;
    105128    }
    106129    kill inOutFlags;
    107130  } kill v;
    108   return (3 - inFlag - outFlag);
     131  int noetherian = 3 - 1*inFlag - 2*outFlag;
     132  if (noetherian == 0) {
     133    return (4 - 4*inOutFlag); // weak noetherian
     134  }
     135  return (noetherian);
    109136}
    110137example
     
    118145}
    119146
    120 static proc inOrOutCommingEdgeInCycle(intmat G, int v, intvec visited, intvec path) {
     147static proc inOutCommingEdgesInCycles(intmat G, int v, intvec visited, intvec path) {
    121148  // Mark the current vertex as visited
    122149  visited[v] = 1;
     
    129156  }
    130157
    131   int inFlag, outFlag;
     158  int inFlag, outFlag, inOutFlag;
    132159
    133160  for (int w = 1; w <= ncols(G) && (inFlag + outFlag) != 3; w++) {
    134161    if (G[v,w] == 1) {
    135       if (visited[w] == 1) {
    136         // new cycle
    137         if (v == w) {
     162      if (visited[w] == 1) { // new cycle
     163        int tmpInFlag;
     164        int tmpOutFlag;
     165        if (v == w) { // cycle is a loop
    138166          for (int u = 1; u <= ncols(G); u++) {
    139167            if (G[v,u] && u != v) {
    140               outFlag = 2;
     168              outFlag = 1;
     169              tmpOutFlag = 1;
    141170            }
    142171            if (G[u,v] && u != v) {
    143172              inFlag = 1;
     173              tmpInFlag = 1;
    144174            }
    145175          } kill u;
     
    151181                if (path[i] != v) {
    152182                  if (u != path[i+1]) { // and u is not the next element in the cycle
    153                     outFlag = 2;
     183                    outFlag = 1;
     184                    tmpOutFlag = 1;
    154185                  }
    155186                } else {
    156187                  if (u != w) {
    157                     outFlag = 2;
     188                    outFlag = 1;
     189                    tmpOutFlag = 1;
    158190                  }
    159191                }
     
    163195                  if (u != path[i-1]) { // and u is not the previous element in the cylce
    164196                    inFlag = 1;
     197                    tmpInFlag = 1;
    165198                  }
    166199                } else {
    167200                  if (u != v) {
    168201                    inFlag = 1;
     202                    tmpInFlag = 1;
    169203                  }
    170204                }
     
    176210          } kill i;
    177211        }
     212        if (tmpInFlag > 0 && tmpOutFlag > 0) {
     213          // there are both in and outcomming edges in this cycle
     214          inOutFlag = 1;
     215        }
     216        kill tmpInFlag;
     217        kill tmpOutFlag;
    178218      } else {
    179         int inOutFlags = inOrOutCommingEdgeInCycle(G, w, visited, path);
     219        int inOutFlags = inOutCommingEdgesInCycles(G, w, visited, path);
    180220        if (inOutFlags == 1) {
    181221          inFlag = 1;
    182222        }
    183223        if (inOutFlags == 2) {
    184           outFlag = 2;
     224          outFlag = 1;
    185225        }
    186226        if (inOutFlags == 3) {
    187227          inFlag = 1;
    188           outFlag = 2;
     228          outFlag = 1;
     229        }
     230        if (inOutFlags == 4) {
     231          inOutFlag = 1;
     232        }
     233        if (inOutFlags == 5) {
     234          inFlag = 1;
     235          inOutFlag = 1;
     236        }
     237        if (inOutFlags == 6) {
     238          outFlag = 1;
     239          inOutFlag = 1;
     240        }
     241        if (inOutFlags == 7) {
     242          inFlag = 1;
     243          outFlag = 1;
     244          inOutFlag = 1;
    189245        }
    190246        kill inOutFlags;
     
    193249  } kill w;
    194250
    195   return (inFlag + outFlag);
     251  return (1*inFlag + 2*outFlag + 4*inOutFlag);
    196252}
    197253
     
    202258ASSUME: - basering is a Letterplace ring
    203259      - G is a Groebner basis
     260THEORY: lpIsSemiPrime works with the monomial algebra A/<LM(G)>.
     261A positive answer holds for both A/<LM(G)> and A/<G>, while
     262a negative answer applies only to A/<LM(G)> and not necessarily to
     263A/<G>.
    204264"
    205265{
     
    303363ASSUME: - basering is a Letterplace ring
    304364      - G is a Groebner basis
     365THEORY: lpIsPrime works with the monomial algebra A/<LM(G)>.
     366A positive answer holds for both A/<LM(G)> and A/<G>, while
     367a negative answer applies only to A/<LM(G)> and not necessarily to A/<G>.
    305368"
    306369{
Note: See TracChangeset for help on using the changeset viewer.