source: git/Tst/Buch/Example_7_8_7.tst @ bf8015

spielwiese
Last change on this file since bf8015 was 891438c, checked in by Gerhard Pfister <pfister@…>, 23 years ago
*GP: initial release git-svn-id: file:///usr/local/Singular/svn/trunk@5579 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 696 bytes
Line 
1LIB "tst.lib";
2tst_init();
3
4proc projdim(module M)
5{
6   list l=mres(M,0);
7   int i;
8   while(i<size(l))
9   {
10     i++;
11     if(size(l[i])==0){return(i-1);}
12   }   
13}
14
15proc isCohenMacaulay1(ideal I)
16{
17  int de=nvars(basering)-projdim(I*freemodule(1));
18  int di=dim(std(I));
19  return(de==di);
20}
21ring R=0,(x,y,z),ds;
22ideal I=xz,yz;
23isCohenMacaulay1(I);
24
25
26I=x2-y3;
27isCohenMacaulay1(I);
28
29I=xz,yz,xy;
30isCohenMacaulay1(I);
31kill R;
32
33proc CohenMacaulayTest1(module M, int d)
34{
35  return((d-projdim(M))==dim(std(Ann(M))));
36}
37
38LIB"primdec.lib";
39ring R=0,(x,y,z),ds;
40ideal I=xz,yz;
41module M=I*freemodule(1);
42CohenMacaulayTest1(M,3);
43
44I=x2+y2,z7;
45M=I*freemodule(1);
46CohenMacaulayTest1(M,3);
47
48
49tst_status(1);$
Note: See TracBrowser for help on using the repository browser.