Lex standard monomials in SINGULAR

Download lexsm.lib.

Examples:
Run Singular (it can be downloaded from http://www.singular.uni-kl.de) and try the following:
    LIB "lexsm.lib";
    intvec po(1) = 1,1,3;
    intvec po(2) = 4,1,1;
    intvec po(3) = 3,1,3;
    intvec po(4) = 2,1,1;
    intvec po(5) = 4,2,1;
    intvec po(6) = 3,1,1;
    list V = po(1..6);
    ring R = 0,x(1..3),lp;
    LexSm(V);
This should result:
    // ** loaded lexsm.lib (1.1,2005/11/11)
    Starting BuildTrie...
    BuildTrie is ready.
    Starting BuildSmTrie...
    BuildSmTrie is ready.
    Starting SmListFromTrie...
    SmListFromTrie is Ready.
    [1]:
       1
    [2]:
       x(3)
    [3]:
       x(2)
    [4]:
       x(1)
    [5]:
       x(1)*x(3)
    [6]:
       x(1)^2
Now a more complicated computation:
    LIB "lexsm.lib";
    int n = 20;
    int m = 500;
    int j,k;
    for(int i=1;i<=m;i++){
      intvec po(i);
      for(k=1;k<=n;k++){
        po(i)[k] = random(0,9);
      };
    };
    list V = po(1..m);
    ring r = 0, (x(1..n)), lp;
    list smlist = LexSm(V);